/* =============================================
   TEAM DASHBOARD — Shared Styles
   ============================================= */
:root {
  --bg:       #0d1117;
  --bg2:      #161c26;
  --bg3:      #1d2535;
  --bg4:      #242d40;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.13);
  --text:     #e2e8f0;
  --text2:    #8892a8;
  --text3:    #4a5568;
  --blue:     #4f8ef7;
  --blue-dim: rgba(79,142,247,0.12);
  --green:    #3ecf8e;
  --green-dim:rgba(62,207,142,0.10);
  --red:      #f76b6b;
  --red-dim:  rgba(247,107,107,0.10);
  --amber:    #f5a623;
  --amber-dim:rgba(245,166,35,0.10);
  --purple:   #a78bfa;
  --purple-dim:rgba(167,139,250,0.10);
  --radius:   10px;
  --radius-lg:14px;
  --font:     'Noto Sans JP', sans-serif;
  --mono:     'DM Mono', monospace;
  --nav-w:    220px;
  --nav-collapsed: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar Nav ── */
.nav {
  width: var(--nav-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 50;
  transition: width 0.25s;
  overflow: hidden;
}
.nav-logo {
  padding: 1.25rem 1.1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-logo-icon {
  width: 32px; height: 32px;
  background: var(--blue-dim);
  border: 1px solid rgba(79,142,247,0.3);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.nav-logo-text { font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.nav-logo-sub  { font-size: 10px; color: var(--text3); white-space: nowrap; }

.nav-section { padding: .75rem .75rem .25rem; font-size: 10px; font-weight: 600; color: var(--text3); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: .55rem .9rem;
  margin: 2px .5rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--blue-dim); color: var(--blue); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.nav-footer {
  margin-top: auto;
  padding: 1rem .75rem;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text3);
  white-space: nowrap;
}
.nav-updated { display: flex; align-items: center; gap: 6px; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2.5s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ── Main Content ── */
.main {
  margin-left: var(--nav-w);
  flex: 1;
  min-width: 0;
  padding: 2rem 2rem 4rem;
  max-width: 1200px;
}
@media (max-width: 900px) {
  .nav { width: var(--nav-collapsed); }
  .nav-logo-text, .nav-logo-sub, .nav-section, .nav-item span, .nav-footer { display: none; }
  .nav-item { justify-content: center; padding: .65rem; margin: 2px .4rem; }
  .main { margin-left: var(--nav-collapsed); padding: 1.5rem 1rem 3rem; }
}

/* ── Page Header ── */
.page-header { margin-bottom: 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.page-header p { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ── Cards ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.card-title {
  font-size: 11px; font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1rem;
}

/* ── Metrics ── */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; margin-bottom: 1.5rem; }
.metric {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  position: relative; overflow: hidden;
}
.metric::before { content:''; position:absolute; top:0;left:0;right:0;height:2px; border-radius:2px 2px 0 0; }
.metric.blue::before   { background: var(--blue); }
.metric.green::before  { background: var(--green); }
.metric.amber::before  { background: var(--amber); }
.metric.red::before    { background: var(--red); }
.metric.purple::before { background: var(--purple); }
.metric-label { font-size: 11px; color: var(--text2); margin-bottom: 5px; }
.metric-value { font-size: 24px; font-weight: 700; font-family: var(--mono); letter-spacing: -.03em; }
.metric-sub   { font-size: 11px; color: var(--text3); margin-top: 3px; font-family: var(--mono); }

/* ── Grid ── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 700px) { .grid2,.grid3 { grid-template-columns: 1fr; } }

/* ── Badges ── */
.badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; letter-spacing: .03em; }
.badge-達成   { background: var(--green-dim); color: var(--green); }
.badge-未達成 { background: var(--red-dim);   color: var(--red); }
.badge-blue   { background: var(--blue-dim);  color: var(--blue); }
.badge-green  { background: var(--green-dim); color: var(--green); }
.badge-amber  { background: var(--amber-dim); color: var(--amber); }
.badge-red    { background: var(--red-dim);   color: var(--red); }
.badge-purple { background: var(--purple-dim);color: var(--purple); }

/* ── Table ── */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.tbl th.left { text-align: left; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; vertical-align: middle; }
.tbl td.left { text-align: left; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--bg3); }
.tbl .q-col { background: rgba(79,142,247,0.05); font-family: var(--mono); font-weight: 700; color: var(--blue); }
.tbl tfoot tr td { border-top: 1px solid var(--border2); color: var(--blue); font-family: var(--mono); font-weight: 700; border-bottom: none; }

/* ── Section Label ── */
.section-label {
  font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .1em;
  margin: 1.75rem 0 .75rem;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after { content:''; flex:1; height:1px; background: var(--border); }

/* ── Loading overlay ── */
#loading {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  flex-direction: column; gap: 12px;
  color: var(--text2); font-size: 13px;
}
.spinner { width: 28px; height: 28px; border: 2px solid var(--border2); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#app { opacity: 0; transition: opacity .4s; width:100%; }
#app.ready { opacity: 1; }

/* ── Chart wrap ── */
.chart-wrap { position: relative; width: 100%; }

/* ── Misc ── */
.mono { font-family: var(--mono); }
.text2 { color: var(--text2); }
.text3 { color: var(--text3); }
.gap-1 { margin-bottom: .75rem; }
.gap-2 { margin-bottom: 1.5rem; }
