/* === TUVA Center Daily Report — Design System === */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  /* Brand */
  --brand: #77C3BE;
  --brand-dark: #4DADA8;
  --brand-light: #E0F5F3;
  --brand-pale: #EAF8F7;
  --brand-bg: #F2FAF9;

  /* KPI 3-level */
  --kpi-green: #34C759;
  --kpi-green-bg: #F0FFF4;
  --kpi-yellow: #FF9500;
  --kpi-yellow-bg: #FFFBF0;
  --kpi-red: #FF3B30;
  --kpi-red-bg: #FFF5F5;

  /* Delta (contextual) */
  --positive: #34C759;
  --negative: #FF3B30;

  /* Text */
  --text-1: #1D1D1F;
  --text-2: #3A3A3C;
  --text-3: #6E6E73;
  --text-4: #AEAEB2;

  /* Background & Border */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F7;
  --bg-hover: #EAF8F7;
  --border: #E5E5EA;
  --border-light: #F0F0F5;

  /* Spacing */
  --header-height: 56px;
  --toolbar-height: 48px;
  --section-gap: 24px;
  --card-gap: 16px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-1);
  background: var(--bg-secondary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* === Header (Sticky) === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 24px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo-icon {
  width: 28px;
  height: 28px;
  background: var(--brand);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-stale-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--kpi-yellow-bg);
  color: var(--kpi-yellow);
  font-size: 12px;
  border-radius: var(--radius-sm);
  margin-right: 8px;
}

/* === Toolbar === */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-label {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-pale);
}

.btn-primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: white;
}

.btn-icon {
  padding: 0 8px;
  height: 34px;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* === Select / Dropdown === */
.select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23AEAEB2'/%3E%3C/svg%3E") no-repeat right 8px center;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-1);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-light);
}

/* === Custom Dropdown === */
.cd-dropdown { position: relative; display: inline-flex; }

.cd-dropdown-trigger {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  min-width: 0;
}

.cd-dropdown-trigger:focus-visible,
.cd-dropdown--open .cd-dropdown-trigger {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-light);
}

.cd-dropdown-value { overflow: hidden; text-overflow: ellipsis; }
.cd-dropdown-placeholder { color: var(--text-3); }

.cd-dropdown-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  transition: transform 0.15s ease;
  pointer-events: none;
}

.cd-dropdown--open .cd-dropdown-arrow { transform: translateY(-50%) rotate(180deg); }

.cd-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 280px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 150;
  opacity: 0;
  transform: translateY(-4px);
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cd-dropdown--open .cd-dropdown-panel {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.cd-dropdown--flip .cd-dropdown-panel {
  top: auto;
  bottom: calc(100% + 4px);
  transform: translateY(4px);
}
.cd-dropdown--flip.cd-dropdown--open .cd-dropdown-panel {
  transform: translateY(0);
}

.cd-dropdown-search { padding: 4px; border-bottom: 1px solid var(--border-light); }

.cd-dropdown-search-input {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-1);
  outline: none;
  box-sizing: border-box;
}
.cd-dropdown-search-input:focus {
  border-color: var(--brand);
}

.cd-dropdown-list { overflow-y: auto; flex: 1; padding: 4px 0; }

.cd-dropdown-option {
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s ease;
  white-space: nowrap;
}

.cd-dropdown-option:hover,
.cd-dropdown-option--focused {
  background: var(--bg-secondary);
}

.cd-dropdown-option--selected {
  color: var(--brand-dark);
  font-weight: 500;
  background: var(--brand-light);
}

.cd-dropdown-option--selected:hover,
.cd-dropdown-option--selected.cd-dropdown-option--focused {
  background: var(--brand-light);
}

.cd-dropdown-empty {
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

/* === Confirm Dialog === */
.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s;
}
.confirm-dialog.visible { opacity: 1; visibility: visible; }

.confirm-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.confirm-dialog-box {
  position: relative;
  width: 90%;
  max-width: 380px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.confirm-dialog-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 8px;
}

.confirm-dialog-message {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 20px;
  line-height: 1.5;
}

.confirm-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-danger {
  background: var(--negative) !important;
  color: #fff !important;
  border-color: var(--negative) !important;
}
.btn-danger:hover { opacity: 0.9; }

/* === Tab Switcher === */
.tab-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.tab-btn {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
  font-family: inherit;
  border: none;
  background: var(--bg-primary);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn + .tab-btn {
  border-left: 1px solid var(--border);
}

.tab-btn.active {
  background: var(--brand);
  color: white;
}

.tab-btn:hover:not(.active) {
  background: var(--brand-pale);
  color: var(--brand-dark);
}

/* === Upload Area === */
.upload-section {
  padding: 0 24px;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.upload-section.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.upload-section.expanded {
  max-height: 200px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-primary);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--brand);
  background: var(--brand-pale);
}

.upload-dropzone-icon {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--text-4);
}

.upload-dropzone-text {
  font-size: 13px;
  color: var(--text-3);
}

.upload-dropzone-text strong {
  color: var(--brand-dark);
}

.upload-dropzone input[type="file"] {
  display: none;
}

/* === Main Content === */
.main {
  padding: 20px 24px;
  max-width: 1600px;
  margin: 0 auto;
}

/* === Summary Cards === */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--card-gap);
  margin-bottom: var(--section-gap);
}

.summary-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.summary-card-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.summary-card-gauge {
  width: 80px;
  height: 80px;
  margin: 0 auto 8px;
}

.summary-card-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-1);
}

.summary-card-delta {
  font-size: 12px;
  margin-top: 2px;
}

.summary-card-delta.positive { color: var(--positive); }
.summary-card-delta.negative { color: var(--negative); }

.summary-card-kpi {
  font-size: 11px;
  color: var(--text-4);
  margin-top: 4px;
}

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

.kpi-badge.green { background: var(--kpi-green-bg); color: var(--kpi-green); }
.kpi-badge.yellow { background: var(--kpi-yellow-bg); color: var(--kpi-yellow); }
.kpi-badge.red { background: var(--kpi-red-bg); color: var(--kpi-red); }

/* === Search Bar === */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.search-input {
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  width: 240px;
  background: var(--bg-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23AEAEB2' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 10px center;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-light);
}

/* === Table Section === */
.table-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--section-gap);
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.table-title {
  font-size: 14px;
  font-weight: 600;
}

/* AG Grid Overrides */
.ag-theme-alpine {
  --ag-font-family: 'Pretendard', -apple-system, sans-serif;
  --ag-font-size: 13px;
  --ag-row-height: 40px;
  --ag-header-height: 38px;
  --ag-header-background-color: var(--bg-secondary);
  --ag-header-foreground-color: var(--text-2);
  --ag-row-border-color: var(--border-light);
  --ag-border-color: var(--border-light);
  --ag-row-hover-color: var(--bg-hover);
  --ag-selected-row-background-color: var(--brand-light);
  --ag-range-selection-border-color: var(--brand);
}

.ag-theme-alpine .ag-header-cell {
  font-weight: 600;
  font-size: 12px;
}

.ag-theme-alpine .ag-cell {
  display: flex;
  align-items: center;
}

/* Cell renderers */
.cell-delta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.cell-delta-value {
  font-size: 13px;
}

.cell-delta-arrow {
  font-size: 10px;
  font-weight: 500;
}

.cell-delta-arrow.up-good { color: var(--positive); }
.cell-delta-arrow.up-bad { color: var(--negative); }
.cell-delta-arrow.down-good { color: var(--positive); }
.cell-delta-arrow.down-bad { color: var(--negative); }

.cell-kpi-green { background-color: var(--kpi-green-bg) !important; }
.cell-kpi-yellow { background-color: var(--kpi-yellow-bg) !important; }
.cell-kpi-red { background-color: var(--kpi-red-bg) !important; }

.cell-center-name {
  font-weight: 500;
  cursor: pointer;
  color: var(--text-1);
}

.cell-center-name:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

/* Pinned rows */
.ag-theme-alpine .ag-row-pinned {
  background: var(--bg-secondary) !important;
  font-weight: 600;
}

/* INDIRECT group separator */
.indirect-separator {
  background: var(--brand-pale) !important;
  font-weight: 600;
  color: var(--text-3);
  font-size: 11px;
}

/* === Chart Section === */
.chart-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--section-gap);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.chart-tabs {
  display: flex;
}

.chart-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-family: inherit;
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

.chart-tab.active {
  color: var(--brand-dark);
  font-weight: 600;
}

.chart-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand);
}

.chart-tab:hover:not(.active) {
  color: var(--text-2);
}

.chart-container {
  padding: 16px;
  height: 400px;
  transition: height 0.2s ease;
}

.trend-center-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--border-light);
  min-height: 38px;
}

.trend-chips-label {
  font-size: 11px;
  color: var(--text-3);
  margin-right: 4px;
}

.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px 2px 10px;
  font-size: 12px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-2);
}

.trend-chip-remove {
  cursor: pointer;
  opacity: 0.5;
  font-size: 15px;
  line-height: 1;
  margin-left: 2px;
}

.trend-chip-remove:hover { opacity: 1; }

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Fullscreen modal (settings) */
.modal-fullscreen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 300;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.modal-fullscreen.visible {
  transform: translateY(0);
}

.modal-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 10;
}

.modal-fullscreen-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-fullscreen-body {
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
}

/* Center detail modal */
.modal-center {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-center-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-center-body {
  padding: 24px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text-1);
}

/* === Insight Tab === */
.insight-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--section-gap);
}

.insight-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.insight-card:last-child {
  border-bottom: none;
}

.insight-card-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.insight-card-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

.insight-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px;
  color: var(--text-3);
  font-size: 13px;
}

.insight-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-3);
  max-width: 400px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* === Confirm Dialog === */
.confirm-dialog {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.confirm-dialog-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.confirm-dialog-text {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 20px;
}

.confirm-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* === Settings Tabs === */
.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}

.settings-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-family: inherit;
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  position: relative;
}

.settings-tab.active {
  color: var(--brand-dark);
  font-weight: 600;
}

.settings-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand);
}

.settings-content {
  padding: 24px;
}

/* Settings forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-light);
}

/* Settings table */
.settings-table {
  width: 100%;
  border-collapse: collapse;
}

.settings-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.settings-table td {
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}

.settings-table tr:hover td {
  background: var(--bg-hover);
}

/* === Export Modal === */
.export-modal {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.export-section {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
}

.export-section:last-child {
  border-bottom: none;
}

.export-section-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.export-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.export-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.export-checkbox input[type="checkbox"] {
  accent-color: var(--brand);
}

.export-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.export-radio input[type="radio"] {
  accent-color: var(--brand);
}

.export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

/* === Delta Inline === */
.delta-good { color: var(--positive); font-size: 10px; margin-left: 2px; }
.delta-bad { color: var(--negative); font-size: 10px; margin-left: 2px; }

/* === Utility === */
.hidden { display: none !important; }
.text-brand { color: var(--brand-dark); }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-semibold { font-weight: 600; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-4);
}

/* ── Login Screen ── */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 40px 32px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-field {
  margin-bottom: 16px;
}

.login-field .form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.login-field .form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-1);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}

.login-field .form-input:focus {
  border-color: var(--brand);
}

.otp-input {
  letter-spacing: 10px;
  font-size: 22px !important;
  text-align: center;
  font-weight: 600;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* User badge in header */
.user-badge {
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--brand-pale);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  display: none;
}

#app-header:not(.hidden) .user-badge {
  display: inline-block;
}
