/* Geekfast ERP · operational interface, light */
:root {
  color-scheme: light;
  --color-primary: #4f46e5;
  --color-primary-dark: #4338ca;
  --color-primary-gradient: #4f46e5;
  --color-primary-rgb: 79, 70, 229;
  --color-accent-red: #b42318;
  --bg-body: #f3f5f7;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #f8f9fb;
  --bg-sidebar-hover: #edf0f3;
  --bg-sidebar-active: #eeeffe;
  --bg-input: #f3f5f7;
  --bg-secondary: #f8f9fb;
  --bg-hover: #edf0f3;
  --text-primary: #18212d;
  --text-secondary: #475364;
  --text-tertiary: #687586;
  --text-sidebar: #475364;
  --text-sidebar-active: #4338ca;
  --text-link: #4338ca;
  --border-color: #dce2e9;
  --border-color-light: #e5e9ef;
  --border-color-lighter: #edf0f3;
  --divider-color: #e5e9ef;
  --shadow-card-hover: 0 2px 8px rgba(20, 28, 40, .06);
  --shadow-primary: none;
  --font-body: 'Segoe UI Variable', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --font-display: var(--font-body);
}

html, body, button, input, select, textarea { font-family: var(--font-body); }
body, body.bg-\[\#eef3f8\] { background: var(--bg-body) !important; color: var(--text-primary); }
button, a, input, select, textarea { transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, opacity 160ms ease; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--color-primary) !important;
  outline-offset: 2px;
}
::selection { background: rgba(var(--color-primary-rgb), .22); }

/* Shell */
html #sidebar {
  width: 256px !important;
  background: var(--bg-sidebar) !important;
  border-right: 1px solid var(--border-color-light) !important;
}
html #sidebar.collapsed { width: 68px !important; }
html #sidebar .sidebar-brand,
html #sidebar .sidebar-utility {
  background: var(--bg-sidebar);
  border-color: var(--border-color-light) !important;
}
html #sidebar nav { padding: 16px 12px !important; gap: 4px !important; }
html #sidebar .sidebar-section-label {
  margin: 24px 8px 8px;
  min-height: 16px;
  color: var(--text-tertiary) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
}
html #sidebar .sidebar-section-label:first-child { margin-top: 0; }
html #sidebar .nav-item {
  min-height: 36px;
  padding: 8px 10px !important;
  gap: 10px !important;
  color: var(--text-sidebar) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
}
html #sidebar .menu-dropdown .nav-item { min-height: 32px; font-size: 12px !important; }
html #sidebar .nav-item:hover,
html #sidebar .nav-parent.expanded > .nav-item {
  color: var(--text-primary) !important;
  background: var(--bg-sidebar-hover) !important;
}
html #sidebar .nav-item.active,
html #sidebar .menu-dropdown .nav-item.active {
  color: var(--text-sidebar-active) !important;
  background: var(--bg-sidebar-active) !important;
  font-weight: 500 !important;
}
html #sidebar .nav-item.active::before { background: var(--color-primary); width: 2px; }
html #sidebar .menu-item-icon,
html #sidebar .nav-item > svg,
html #sidebar .menu-item-arrow { color: var(--text-tertiary) !important; }
html #sidebar .nav-item.active .menu-item-icon,
html #sidebar .nav-item.active > svg { color: var(--text-sidebar-active) !important; }
html #sidebar .menu-dropdown { border-left-color: var(--border-color) !important; }
html #sidebar .sidebar-store-status:hover,
html #sidebar .sidebar-collapse-control:hover { background: var(--bg-sidebar-hover); }
html #sidebar .sidebar-store-icon { color: var(--text-secondary); background: var(--bg-input); border-color: var(--border-color); }
html #sidebar .sidebar-store-copy strong { color: var(--text-primary); font-size: 12px; }
html #sidebar .sidebar-store-copy small,
html #sidebar .sidebar-collapse-control { color: var(--text-tertiary); font-size: 11px; }
html #sidebar .gf-wordmark strong { color: var(--text-primary); font-weight: 600; }
html #sidebar .gf-wordmark small { color: var(--text-tertiary); letter-spacing: .08em; }

html #header {
  min-height: 64px;
  background: var(--bg-card) !important;
  border-color: var(--border-color-light) !important;
  backdrop-filter: none;
}
html #header button:not(.workbench-btn),
html #header .user-menu { color: var(--text-secondary); }
html #header button:hover,
html #header .user-menu:hover { background: var(--bg-hover); color: var(--text-primary); }
html #globalSearch { background: var(--bg-input) !important; border-color: var(--border-color) !important; color: var(--text-primary) !important; }
html #header .header-tabs { background: var(--bg-input) !important; }
html #header .header-tab.active { background: var(--bg-card); color: var(--color-primary); box-shadow: none; }
html .header-store-btn { background: var(--bg-card); border-color: var(--border-color); color: var(--text-primary); }
html .header-store-dot { background: var(--text-tertiary); box-shadow: none; }
html #userAvatar > div:first-child { background: var(--bg-input) !important; color: var(--text-primary) !important; box-shadow: none; border: 1px solid var(--border-color); }
html #userAvatar .text-gray-800 { color: var(--text-primary) !important; }
html #userAvatar .text-gray-500 { color: var(--text-tertiary) !important; }
html #headerUserMenu { background: var(--bg-card) !important; border-color: var(--border-color) !important; box-shadow: 0 12px 32px rgba(0, 0, 0, .14) !important; }
html #headerUserMenu button { color: var(--text-primary) !important; }
html #headerUserMenu button:hover { background: var(--bg-hover) !important; }
html #header .animate-ping { animation: none !important; display: none; }
html .main-content { max-width: 1600px !important; width: 100%; padding: 32px !important; }
html #pageContainer { min-width: 0; }

/* Common content */
html .feature-card,
html .workbench-panel,
html .workbench-metric,
html .stat-card,
html .modal-dialog,
html .collect-table-wrap { background: var(--bg-card); border: 1px solid var(--border-color-light); box-shadow: none; border-radius: 12px; }
html .feature-card::before,
html .feature-card::after,
html .stat-card::before { display: none; }
html .feature-card:hover,
html .workbench-metric:hover,
html .stat-card:hover { transform: none; border-color: var(--border-color); box-shadow: none; }
html .btn-primary,
html .workbench-btn-primary { background: #4f46e5 !important; border-color: #4f46e5 !important; color: white !important; box-shadow: none !important; }
html .btn-primary::before { display: none; }
html .btn-secondary,
html .btn-ghost,
html .workbench-btn-secondary { background: var(--bg-card) !important; border: 1px solid var(--border-color) !important; color: var(--text-primary) !important; box-shadow: none !important; }
html .btn:hover { transform: none; }
html .form-input,
html .form-select,
html .form-textarea,
html input:not([type="checkbox"]):not([type="radio"]),
html select,
html textarea { color: var(--text-primary); }
html .form-input,
html .form-select,
html .form-textarea { background: var(--bg-input); border-color: var(--border-color); }
html .collect-tabs { border-radius: 10px; }
html .collect-tab { border-radius: 8px; }
html .collect-table thead th { background: var(--bg-secondary); color: var(--text-secondary); text-transform: none; letter-spacing: 0; }
html .collect-table tbody tr:nth-child(even) { background: var(--bg-card); }
html .collect-table tbody tr:hover { background: var(--bg-hover); }
html .collect-table td { border-color: var(--border-color-light); }
html .modal-header,
html .modal-footer { background: var(--bg-card); border-color: var(--border-color); }

/* Workbench */
html .workbench-shell { max-width: none; color: var(--text-primary); }
html .workbench-heading { margin-bottom: 24px; }
html .workbench-heading h1 { font-size: 32px; font-weight: 500; color: var(--text-primary); }
html .workbench-eyebrow,
html .workbench-heading p,
html .workbench-panel-header p { color: var(--text-secondary); }
html .workbench-live-dot { background: var(--color-primary); box-shadow: none; }
html .workbench-metrics { gap: 12px; margin-bottom: 20px; }
html .workbench-metric { min-height: 116px; padding: 20px; gap: 12px; }
html .workbench-metric-icon,
html .workbench-flow-icon { background: var(--bg-input); color: var(--text-tertiary); }
html .workbench-metric-label,
html .workbench-status-row > span { color: var(--text-secondary); }
html .workbench-metric-copy strong { color: var(--text-primary); font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums; }
html .workbench-metric-copy small,
html .workbench-flow-step small,
html .workbench-activity-main small { color: var(--text-tertiary); font-size: 12px; }
html .workbench-grid { grid-template-columns: minmax(0, 2fr) minmax(280px, .75fr); gap: 20px; }
html .workbench-main-column,
html .workbench-side-column { gap: 20px; }
html .workbench-panel-header { padding: 16px 20px; border-color: var(--border-color-light); }
html .workbench-panel-header h2 { color: var(--text-primary); font-size: 15px; font-weight: 500; }
html .workbench-flow { padding: 20px; }
html .workbench-flow-step:hover,
html .workbench-activity:hover,
html .workbench-quick-grid button:hover { background: var(--bg-hover); }
html .workbench-flow-index,
html .workbench-flow-connector { color: var(--text-tertiary); }
html .workbench-flow-step strong,
html .workbench-activity-main strong,
html .workbench-empty strong { color: var(--text-primary); font-size: 13px; font-weight: 500; }
html .workbench-activity { background: var(--bg-card); border-color: var(--border-color-light); }
html .workbench-status-row strong { color: var(--text-secondary); }
html .workbench-notice-panel .notice-header { background: var(--bg-card); }
html .workbench-loading span { animation: none; }
html .workbench-text-btn { color: var(--text-link); }

/* Listing workspaces */
html .aic-shell { background: var(--bg-body); color: var(--text-primary); --aic-text: var(--text-primary); --aic-muted: var(--text-tertiary); --aic-line: var(--border-color); --aic-cyan: var(--color-primary); }
html .aic-title { color: var(--text-primary); font-weight: 500; }
html .aic-title em { color: var(--color-primary); }
html .aic-kicker { color: var(--text-tertiary); letter-spacing: 0; }
html .aic-stat,
html .aic-panel,
html .aic-account-panel,
html .aic-detail-panel { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-color); }
html .aic-stat-value { color: var(--text-primary); font-weight: 500; font-variant-numeric: tabular-nums; }
html .aic-btn,
html .aic-filters input,
html .aic-filters select { background: var(--bg-input); color: var(--text-primary); border-color: var(--border-color); }
html .aic-table th,
html .aic-table-panel .aic-table th,
html .aic-table-panel .aic-panel-head,
html .aic-events { background: var(--bg-secondary); color: var(--text-secondary); }
html .aic-table td,
html .aic-flow-item,
html .aic-event { border-color: var(--border-color-light); color: var(--text-primary); }
html .aic-table-task,
html .aic-flow-item-text b,
html .aic-events .aic-event b { color: var(--text-primary); }
html .aic-flow-heading,
html .aic-flow-column.done .aic-flow-heading,
html .aic-flow-column.warn .aic-flow-heading,
html .aic-flow-column.error .aic-flow-heading { background: var(--bg-input); color: var(--text-primary); }
html .aic-flow-icon,
html .aic-flow-thumb,
html .aic-task-thumb,
html .aic-detail-grid { background: var(--bg-secondary); color: var(--text-secondary); }
html .aic-detail-error { background: var(--bg-input); color: var(--text-primary); }
html .aib-page { color: var(--text-primary); font-family: var(--font-body); }
html .aib-header h2,
html .aib-board-label,
html .aib-column-title,
html .aib-card-name { color: var(--text-primary); font-weight: 500; }
html .aib-header p,
html .aib-column-hint,
html .aib-card-detail,
html .aib-store-count { color: var(--text-secondary); }
html .aib-column,
html .aib-source,
html .aib-editor,
html .aib-card { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-color); box-shadow: none; }
html .aib-source { background: var(--bg-secondary); }
html .aib-card-facts,
html .aib-views,
html .aib-sku-group { background: var(--bg-input); color: var(--text-secondary); border-color: var(--border-color); }
html .aib-drop-hint,
html .aib-select,
html .aib-view[aria-pressed="true"],
html .aib-refresh { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-color); box-shadow: none; }
html .aib-editor-head,
html .aib-editor-footer { border-color: var(--border-color); }
html .aib-editor-field input,
html .aib-editor-field textarea { background: var(--bg-input); color: var(--text-primary); border-color: var(--border-color); }

@media (max-width: 1279px) {
  html #sidebar { width: 256px !important; }
  html .main-content { padding: 24px !important; }
}
@media (max-width: 1180px) {
  html .workbench-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  html .workbench-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  html .main-content { padding: 16px !important; }
  html .workbench-heading h1 { font-size: 28px; }
  html .workbench-metric { padding: 16px; }
}
