* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --blue: #1d4ed8;
  --blue-soft: #eef2ff;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  --top1-bg: linear-gradient(90deg, rgba(254, 243, 199, 0.72) 0%, rgba(255, 251, 235, 0.92) 100%);
  --top2-bg: linear-gradient(90deg, rgba(226, 232, 240, 0.85) 0%, rgba(248, 250, 252, 0.95) 100%);
  --top3-bg: linear-gradient(90deg, rgba(255, 237, 213, 0.82) 0%, rgba(255, 247, 237, 0.95) 100%);
  --top4-bg: linear-gradient(90deg, rgba(219, 234, 254, 0.80) 0%, rgba(239, 246, 255, 0.94) 100%);
  --top5-bg: linear-gradient(90deg, rgba(237, 233, 254, 0.82) 0%, rgba(245, 243, 255, 0.95) 100%);
}
body {
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 300px;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #fff;
  padding: 24px 18px;
}
.brand h2 {
  margin: 0;
  font-size: 24px;
}
.brand p {
  margin: 8px 0 24px;
  color: #cbd5e1;
  font-size: 13px;
}
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar li {
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: #e5e7eb;
}
.sidebar li.active {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}
.sidebar li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.nav-label {
  flex: 1;
  line-height: 1.35;
}
.soon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.sidebar li.active .soon-pill {
  background: rgba(255, 255, 255, 0.18);
  color: #eff6ff;
}
.headline p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.empty-state {
  grid-column: 1 / -1;
  padding: 20px 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #f9fafb;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}
.main {
  flex: 1;
  padding: 24px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.topbar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.filters select,
.filters input {
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 14px;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}
.session-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #fff;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.session-button.admin {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
  color: #fff;
}
.session-button.logout {
  background: linear-gradient(135deg, #ef4444 0%, #db2777 100%);
  color: #fff;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card.highlight {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
}
.card.highlight .label,
.card.highlight small,
.card.highlight strong {
  color: #fff;
}
.card .label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.card strong {
  display: block;
  font-size: 32px;
  margin-bottom: 6px;
}
.card small { color: var(--muted); }
.panel { margin-bottom: 24px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h2 {
  margin: 0;
  font-size: 20px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #3730a3;
  font-size: 12px;
  font-weight: 600;
}
.muted { color: var(--muted); font-size: 13px; }
.month-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(80px, 1fr));
  gap: 10px;
}
.month-item {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.month-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.month-item strong {
  color: #2563eb;
  font-size: 20px;
}
.week-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 110px;
}
.week-item strong {
  line-height: 1.4;
}
.month-item strong.future-month { color: var(--muted); }
.stats-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 16px;
}
.mini-stat {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.mini-stat span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.mini-stat strong { font-size: 28px; }
.top-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 12px;
}
.top-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f9fafb;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}
.top-item.top-item-1 {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.95) 0%, rgba(255, 251, 235, 1) 100%);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), 0 10px 24px rgba(15, 23, 42, 0.07), 0 0 22px rgba(245, 158, 11, 0.18);
}
.top-item.top-item-2 {
  border-color: #94a3b8;
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.95) 0%, rgba(248, 250, 252, 1) 100%);
}
.top-item.top-item-3 {
  border-color: #fb923c;
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.96) 0%, rgba(255, 247, 237, 1) 100%);
}
.top-item.top-item-4 {
  border-color: #60a5fa;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.96) 0%, rgba(239, 246, 255, 1) 100%);
}
.top-item.top-item-5 {
  border-color: #a78bfa;
  background: linear-gradient(135deg, rgba(237, 233, 254, 0.96) 0%, rgba(245, 243, 255, 1) 100%);
}
.top-item .rank,
.top-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10);
}
.top-item .rank { margin-bottom: 10px; }
.top-item .rank.rank-1,
.top-badge-1 {
  background: linear-gradient(135deg, #fef3c7 0%, #f59e0b 100%);
  color: #7c2d12;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.16), 0 8px 18px rgba(245, 158, 11, 0.22);
}
.top-item .rank.rank-2,
.top-badge-2 { background: linear-gradient(135deg, #e5e7eb 0%, #cbd5e1 100%); color: #334155; }
.top-item .rank.rank-3,
.top-badge-3 { background: linear-gradient(135deg, #fed7aa 0%, #fb923c 100%); color: #7c2d12; }
.top-item .rank.rank-4,
.top-badge-4 { background: linear-gradient(135deg, #dbeafe 0%, #60a5fa 100%); color: #1e3a8a; }
.top-item .rank.rank-5,
.top-badge-5 { background: linear-gradient(135deg, #ede9fe 0%, #a78bfa 100%); color: #5b21b6; }
.top-item .name { font-weight: 700; margin-bottom: 6px; }
.top-item .dept { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.top-item .score { font-size: 24px; font-weight: 800; }
.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  min-width: 1380px;
  border-collapse: separate;
  border-spacing: 0;
}
table[data-view="week"] {
  min-width: 780px;
}
thead th {
  position: sticky;
  top: 0;
  background: #f3f4f6;
  padding: 12px 10px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid #d1d5db;
  z-index: 3;
}
tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #eef2f7;
  font-size: 14px;
  background: #fff;
}
thead th:first-child,
tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}
thead th:first-child {
  z-index: 4;
  background: #f3f4f6;
}
.month-score { font-weight: 700; text-align: center; }
.score-green { color: #16a34a; }
.score-yellow { color: #ca8a04; }
.score-red { color: #dc2626; }
.score-future { color: #9ca3af; }
.total-cell { font-weight: 800; color: var(--blue); }
.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.person-name { font-weight: 700; }
.top-row { position: relative; }
.top-row td { font-weight: 600; }
.top-row.top-1 td { background: var(--top1-bg); }
.top-row.top-2 td { background: var(--top2-bg); }
.top-row.top-3 td { background: var(--top3-bg); }
.top-row.top-4 td { background: var(--top4-bg); }
.top-row.top-5 td { background: var(--top5-bg); }
.top-row.top-1 td:first-child {
  border-left: 4px solid #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
}
.top-row.top-2 td:first-child { border-left: 4px solid #94a3b8; }
.top-row.top-3 td:first-child { border-left: 4px solid #fb923c; }
.top-row.top-4 td:first-child { border-left: 4px solid #60a5fa; }
.top-row.top-5 td:first-child { border-left: 4px solid #a78bfa; }
.top-row:hover { filter: saturate(1.03); }
.loading {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(3px);
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
  z-index: 999;
}
.loading.show { display: flex; }
.error-row td { color: #b91c1c; font-weight: 700; }
@media (max-width: 1280px) {
  .layout {
    gap: 18px;
    padding: 16px;
  }
  .sidebar {
    width: 320px;
    min-width: 320px;
  }
  .sidebar-toggle-open {
    top: 14px;
    left: 14px;
  }
  .cards { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .month-grid { grid-template-columns: repeat(4, minmax(80px, 1fr)); }
  .top-list { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 1120px) {
  .sidebar {
    width: 300px;
    min-width: 300px;
  }
  .brand-card {
    padding: 16px;
  }
  .brand-logo-wrap {
    width: 76px;
    height: 76px;
  }
  .brand h2 {
    font-size: 22px;
  }
  .nav-label {
    font-size: 14px;
  }
}
@media (max-width: 768px) {
  .layout { display: block; }
  .sidebar,
  .sidebar-toggle-open { display: none !important; }
  .main { padding: 14px; }
  .topbar {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
  }
  .topbar h1 { font-size: 25px; }
  .filters {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .filters select,
  .filters input {
    width: 100%;
    min-width: 0;
  }

  .session-actions {
    width: 100%;
    margin-left: 0;
  }
  .session-chip,
  .session-button {
    width: 100%;
    justify-content: center;
  }
  .cards,
  .stats-panel { grid-template-columns: 1fr; }
  .month-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .month-item {
    padding: 10px 8px;
  }
  .month-item strong { font-size: 18px; }
  .top-list {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }
  .top-item {
    min-width: 220px;
    scroll-snap-align: start;
  }
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
  table {
    min-width: 1220px;
  }
  table[data-view="week"] {
    min-width: 720px;
  }
  thead th,
  tbody td {
    padding: 11px 8px;
    font-size: 13px;
  }
  .name-cell {
    min-width: 190px;
  }
  .top-badge {
    min-width: 74px;
    padding: 5px 8px;
    font-size: 11px;
  }
}
@media (max-width: 480px) {
  .main { padding: 12px; }
  .card,
  .panel {
    padding: 14px;
    border-radius: 16px;
  }
  .card strong { font-size: 24px; }
  .month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table { min-width: 1160px; }
  table[data-view="week"] { min-width: 640px; }
}


.shell-intro {
  margin-bottom: 18px;
}
.shell-intro p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.kpi-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-tab {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: normal;
  text-align: left;
  max-width: 100%;
}
.tab-label {
  line-height: 1.35;
}
.tab-soon-pill {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.kpi-tab.active .tab-soon-pill {
  background: rgba(255, 255, 255, 0.14);
  color: #eff6ff;
  border-color: rgba(255, 255, 255, 0.22);
}
.kpi-tab:hover {
  border-color: #93c5fd;
  color: var(--blue);
}
.kpi-tab.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.20);
}

.kpi-tab[data-id=kpi1] { border-color: rgba(245, 158, 11, 0.35); }
.kpi-tab[data-id=kpi2] { border-color: rgba(59, 130, 246, 0.35); }
.kpi-tab[data-id=kpi3] { border-color: rgba(16, 185, 129, 0.35); }
.kpi-tab[data-id=kpi4] { border-color: rgba(168, 85, 247, 0.35); }
.kpi-tab[data-id=kpi5] { border-color: rgba(236, 72, 153, 0.35); }
.kpi-tab[data-id=kpi6] { border-color: rgba(239, 68, 68, 0.35); }
.kpi-tab[data-id=kpi1]::before,
.kpi-tab[data-id=kpi2]::before,
.kpi-tab[data-id=kpi3]::before,
.kpi-tab[data-id=kpi4]::before,
.kpi-tab[data-id=kpi5]::before,
.kpi-tab[data-id=kpi6]::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45), 0 0 0 1px rgba(15,23,42,0.08);
}
.kpi-tab[data-id=kpi1]::before { background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%); }
.kpi-tab[data-id=kpi2]::before { background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%); }
.kpi-tab[data-id=kpi3]::before { background: linear-gradient(135deg, #34d399 0%, #059669 100%); }
.kpi-tab[data-id=kpi4]::before { background: linear-gradient(135deg, #c084fc 0%, #7c3aed 100%); }
.kpi-tab[data-id=kpi5]::before { background: linear-gradient(135deg, #f9a8d4 0%, #ec4899 100%); }
.kpi-tab[data-id=kpi6]::before { background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%); }
.kpi-tab.active::before {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55), 0 0 0 3px rgba(255,255,255,0.16);
}
.shell-stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.shell-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.shell-stage-head h2 {
  margin: 0;
  font-size: 20px;
}
.shell-stage-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.open-current-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.kpi-frame {
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 760px;
  border: 0;
  display: block;
  background: #fff;
}
.embedded-mode body {
  background: #fff;
}
.embedded-mode .layout {
  display: block;
  min-height: auto;
}
.embedded-mode .sidebar {
  display: none;
}
.embedded-mode .main {
  padding: 16px;
}
@media (max-width: 768px) {
  .shell-stage-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .kpi-frame {
    height: calc(100vh - 210px);
    min-height: 640px;
  }
  .embedded-mode .main {
    padding: 12px;
  }
}

.coming-soon-panel {
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: linear-gradient(135deg, rgba(29,78,216,0.08) 0%, rgba(124,58,237,0.08) 100%);
}
.coming-soon-box {
  padding: 22px 8px;
  text-align: center;
}
.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #1d4ed8;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(59,130,246,0.18);
  box-shadow: 0 10px 30px rgba(37,99,235,0.10);
}
.coming-soon-box h2 {
  margin: 18px 0 12px;
  font-size: 28px;
  line-height: 1.35;
  color: #0f172a;
}
.coming-soon-box p {
  max-width: 760px;
  margin: 0 auto 12px;
  font-size: 16px;
  line-height: 1.7;
  color: #475569;
}
.coming-soon-meta {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.82);
  color: #334155;
  font-weight: 600;
}
@media (max-width: 768px) {
  .coming-soon-box { padding: 12px 0; }
  .coming-soon-box h2 { font-size: 22px; }
  .coming-soon-box p { font-size: 15px; }
}


/* 20260422-kpi-auth-2 dashboard refresh */
:root {
  --bg: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 42%, #fff1f8 100%);
  --panel: rgba(255, 255, 255, 0.92);
  --line: rgba(167, 139, 250, 0.18);
  --text: #1e1b4b;
  --muted: #6b5d8c;
  --blue: #4f46e5;
  --blue-soft: #eef2ff;
  --shadow: 0 18px 45px rgba(76, 29, 149, 0.10);
}
body {
  min-height: 100vh;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
}
.layout {
  position: relative;
  gap: 22px;
  padding: 20px;
  transition: gap 0.22s ease, padding 0.22s ease;
}
.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(76, 29, 149, 0.20);
  backdrop-filter: blur(12px);
}
.sidebar-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.24);
}
.sidebar-toggle-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.sidebar-toggle-open {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 40;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 58%, #db2777 100%);
}
.sidebar-toggle-open[hidden] {
  display: none !important;
}
.sidebar {
  position: sticky;
  top: 20px;
  align-self: flex-start;
  width: 360px;
  min-width: 360px;
  min-height: calc(100vh - 40px);
  padding: 22px 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, #1d4ed8 0%, #6d28d9 55%, #db2777 100%);
  box-shadow: 0 25px 60px rgba(76, 29, 149, 0.24);
  overflow: hidden;
  transition: width 0.24s ease, min-width 0.24s ease, padding 0.24s ease, opacity 0.18s ease, transform 0.24s ease, margin 0.24s ease;
}
body.sidebar-collapsed .layout {
  gap: 0;
}
body.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-24px);
  box-shadow: none;
}
body.sidebar-collapsed .main {
  padding-left: 0;
}
body.sidebar-collapsed .shell-intro {
  padding-left: 28px;
}
.sidebar::before {
  content: '';
  position: absolute;
  inset: -30% auto auto -20%;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  filter: blur(18px);
}
.brand-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 24px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
}
.brand-logo-wrap {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  padding: 10px;
  border-radius: 22px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 14px 30px rgba(30, 27, 75, 0.16);
}
.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
}
.brand-copy {
  min-width: 0;
  width: 100%;
}
.brand-kicker {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.94);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand h2 {
  margin: 10px 0 8px;
  font-size: 24px;
  line-height: 1.18;
  word-break: keep-all;
}
.brand p {
  margin: 0;
  color: rgba(255,255,255,0.86);
  font-size: 14px;
  line-height: 1.55;
}
.nav-section-label {
  position: relative;
  z-index: 1;
  margin: 0 6px 10px;
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sidebar nav {
  position: relative;
  z-index: 1;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding-right: 4px;
}
.sidebar ul {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar li {
  padding: 0;
  margin-bottom: 0;
  border-radius: 18px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 10px 24px rgba(30, 27, 75, 0.08);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.sidebar li:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.18);
  box-shadow: 0 16px 28px rgba(30, 27, 75, 0.14);
}
.sidebar li a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 62px;
  padding: 14px 16px;
  gap: 12px;
}
.sidebar li.active {
  background: linear-gradient(135deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.18) 100%);
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 18px 30px rgba(30, 27, 75, 0.18);
}
.nav-label {
  display: block;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}
.soon-pill {
  justify-self: end;
  flex-shrink: 0;
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.16);
}
.main {
  flex: 1;
  padding: 4px 4px 24px;
}
.shell-intro {
  padding: 22px 24px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.96) 0%, rgba(245,243,255,0.96) 55%, rgba(255,241,248,0.96) 100%);
  border: 1px solid rgba(167, 139, 250, 0.18);
  box-shadow: var(--shadow);
}
.topbar h1,
.headline h1 {
  color: #312e81;
  font-size: 32px;
  letter-spacing: -0.02em;
}
.headline p,
.shell-intro p {
  color: #6d5aa2;
  max-width: 720px;
  line-height: 1.65;
}
.filters {
  justify-content: flex-end;
}
.filters select,
.filters input {
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.16);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.06);
}
.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.42);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.10);
}
.session-chip {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(224,231,255,0.95) 0%, rgba(243,232,255,0.96) 100%);
  border: 1px solid rgba(139, 92, 246, 0.18);
  color: #4338ca;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.08);
}
.session-button {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.session-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.18);
}
.session-button.admin,
.card.highlight,
.kpi-tab.active {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #db2777 100%);
  border-color: transparent;
}
.session-button.password {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  color: #fff;
}
.session-button.logout {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}
.kpi-tabs {
  gap: 14px;
  margin: 22px 0 20px;
}
.kpi-tab {
  min-height: 52px;
  border-radius: 18px;
  border-color: rgba(167, 139, 250, 0.22);
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.06);
}
.kpi-tab:hover {
  border-color: rgba(124, 58, 237, 0.30);
  color: #6d28d9;
}
.card,
.panel,
.month-item {
  border-color: rgba(167, 139, 250, 0.16);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
}
.card strong,
.month-item strong {
  color: #4338ca;
}
.badge {
  background: linear-gradient(135deg, rgba(224,231,255,0.95) 0%, rgba(243,232,255,0.96) 100%);
  color: #5b21b6;
}
.coming-soon-panel {
  border-color: rgba(139, 92, 246, 0.16);
  background: linear-gradient(135deg, rgba(237,233,254,0.66) 0%, rgba(253,242,248,0.72) 100%);
}
.loading {
  backdrop-filter: blur(6px);
  background: rgba(49, 46, 129, 0.16);
  color: #312e81;
  font-weight: 800;
}
.password-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(49, 46, 129, 0.32);
  backdrop-filter: blur(7px);
}
.password-modal-overlay.show {
  display: flex;
}
.password-modal {
  width: min(100%, 520px);
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(245,243,255,0.98) 100%);
  box-shadow: 0 24px 60px rgba(76, 29, 149, 0.20);
  border: 1px solid rgba(167, 139, 250, 0.20);
}
.password-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.password-modal-header h3 {
  margin: 0;
  font-size: 24px;
  color: #312e81;
}
.password-modal-header p {
  margin: 8px 0 0;
  color: #6d5aa2;
  line-height: 1.6;
}
.password-modal-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  color: #6d28d9;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.10);
}
.password-modal-field {
  margin-bottom: 14px;
}
.password-modal-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #4338ca;
}
.password-modal-field input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.20);
  background: rgba(255,255,255,0.92);
  font-size: 14px;
}
.password-modal-field input:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.42);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.10);
}
.password-modal-message {
  min-height: 22px;
  margin: 6px 0 10px;
  font-size: 13px;
  font-weight: 700;
}
.password-modal-message.success { color: #047857; }
.password-modal-message.error { color: #b91c1c; }
.password-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}
.password-modal-actions button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}
.password-modal-actions .secondary {
  background: rgba(224,231,255,0.9);
  color: #4338ca;
}
.password-modal-actions .primary {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #db2777 100%);
  color: #fff;
  box-shadow: 0 16px 28px rgba(99, 102, 241, 0.18);
}
@media (max-width: 1280px) {
  .layout {
    gap: 16px;
    padding: 16px;
  }
  .sidebar {
    width: 292px;
  }
}
@media (max-width: 768px) {
  .layout {
    display: block;
    padding: 10px;
  }
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    margin-bottom: 14px;
    border-radius: 24px;
  }
  .brand-card {
    padding: 14px;
  }
  .brand-logo-wrap {
    flex-basis: 62px;
    width: 62px;
    height: 62px;
  }
  .main {
    padding: 0 0 14px;
  }
  .shell-intro {
    padding: 18px;
    border-radius: 22px;
  }
  .topbar h1,
  .headline h1 {
    font-size: 26px;
  }
  .filters {
    width: 100%;
  }
  .filters select,
  .filters input,
  .session-chip,
  .session-button {
    width: 100%;
  }
  .session-actions {
    width: 100%;
    margin-left: 0;
  }
  .password-modal {
    padding: 18px;
    border-radius: 22px;
  }
  .password-modal-actions {
    flex-direction: column-reverse;
  }
  .password-modal-actions button {
    width: 100%;
  }
}


/* 20260422-kpi-auth-3 table scroll */
#tablePanel {
  display: flex;
  flex-direction: column;
}
.table-wrap {
  overflow: auto;
  max-height: min(68vh, 720px);
  border: 1px solid rgba(167, 139, 250, 0.16);
  border-radius: 20px;
  background: rgba(255,255,255,0.82);
  scrollbar-gutter: stable both-edges;
}
.table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
.table-wrap::-webkit-scrollbar-track {
  background: rgba(224, 231, 255, 0.72);
  border-radius: 999px;
}
.table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #93c5fd 0%, #8b5cf6 55%, #ec4899 100%);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.85);
}
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #60a5fa 0%, #7c3aed 55%, #db2777 100%);
}
thead th {
  top: 0;
  box-shadow: 0 1px 0 rgba(209, 213, 219, 0.96);
}
thead th:first-child,
tbody td:first-child {
  box-shadow: 1px 0 0 rgba(224, 231, 255, 0.95);
}
tbody td:first-child {
  background: rgba(255,255,255,0.98);
}
.top-row.top-1 td:first-child { background: var(--top1-bg); }
.top-row.top-2 td:first-child { background: var(--top2-bg); }
.top-row.top-3 td:first-child { background: var(--top3-bg); }
.top-row.top-4 td:first-child { background: var(--top4-bg); }
.top-row.top-5 td:first-child { background: var(--top5-bg); }
@media (max-width: 768px) {
  .table-wrap {
    max-height: min(56vh, 560px);
    border-radius: 18px;
  }
}
