/* ============================================================
   APmax Auto — 汽配跨境智能工作台
   配色取自 Logo: 深蓝 #00417b + 亮橙 #fc8600 + 白底
   ============================================================ */

:root {
  /* 背景 */
  --bg: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef1f6;
  /* 边框 */
  --border: #d0d7e2;
  --border-light: #e2e7ef;
  /* 文字 */
  --text: #1a2a3a;
  --text-secondary: #5a6d82;
  --text-tertiary: #8a9bb0;
  /* Logo 深蓝系 */
  --blue-dark: #00417b;
  --blue: #1a5fa0;
  --blue-light: #d0e0f0;
  --blue-bg: rgba(0, 65, 123, 0.06);
  /* Logo 橙色系 */
  --accent: #fc8600;
  --accent-hover: #e07800;
  --accent-light: #fff0e0;
  --accent-bg: rgba(252, 134, 0, 0.08);
  /* 功能色 */
  --green: #2da44e;
  --green-bg: rgba(45, 164, 78, 0.08);
  --red: #cf222e;
  --red-bg: rgba(207, 34, 46, 0.08);
  --orange: #f39d3a;
  --orange-bg: rgba(243, 157, 58, 0.10);
  --purple: #8250df;
  --purple-bg: rgba(130, 80, 223, 0.08);

  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --transition: 150ms ease;

  --sidebar-w: 220px;
  --topbar-h: 56px;
}

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

html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC',
               'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 16px 10px 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* 侧边栏 Logo 图标 */
.sidebar-logo-icon {
  width: 110px;
  height: auto;
  display: block;
}

/* 侧边栏 Logo 文字 */
.sidebar-logo-text {
  width: 120px;
  height: auto;
  display: block;
  margin-top: 2px;
}

.nav-list {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-label {
  padding: 14px 12px 4px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-home {
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--blue-bg);
  color: var(--blue-dark);
  text-decoration: none;
}

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
  border-left: 3px solid var(--accent);
}

.nav-icon { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Main ───────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

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

.content {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text); }

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-download {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green);
}
.btn-download:hover { background: rgba(45, 164, 78, 0.18); }

.btn-run {
  margin-top: 16px;
  padding: 10px 24px;
  font-size: 14px;
  width: 100%;
  justify-content: center;
}

/* ── Module Panel ────────────────────────────────────── */
.module-panel {
  max-width: 1100px;
  margin: 0 auto;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.panel-badge {
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid var(--accent);
}

.panel-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.panel-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Section Box ─────────────────────────────────────── */
.section-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-hint {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 400;
  text-transform: none;
}

/* ── File Grid ───────────────────────────────────────── */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.file-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--bg);
}

.file-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.file-card-icon { font-size: 14px; }
.file-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.file-card-desc {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

/* ── Drop Zone ───────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  background: var(--bg-tertiary);
}

.drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.drop-zone.drag-over {
  border-color: var(--green);
  background: var(--green-bg);
}

.drop-zone.has-file {
  border-color: var(--green);
  border-style: solid;
  background: var(--green-bg);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-text { padding: 4px 0; }
.drop-icon { font-size: 20px; display: block; margin-bottom: 4px; }
.drop-label { font-size: 11px; color: var(--text-secondary); display: block; }
.drop-hint { font-size: 9px; color: var(--text-tertiary); display: block; margin-top: 2px; }

.file-selected {
  padding: 4px 0;
}

.file-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  display: block;
  word-break: break-all;
}

.file-size {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ── Log Box ─────────────────────────────────────────── */
.log-box {
  background: #1a2a3a;
  color: #a0d0a0;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
  padding: 14px;
  border-radius: var(--radius-sm);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
  tab-size: 2;
}

.log-box::-webkit-scrollbar {
  width: 4px;
}
.log-box::-webkit-scrollbar-thumb {
  background: #4a5a6a;
  border-radius: 2px;
}

.log-status { display: flex; align-items: center; gap: 6px; }

/* ── Tags ────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.tag-running { background: var(--blue-bg); color: var(--blue); }
.tag-success { background: var(--green-bg); color: var(--green); }
.tag-error { background: var(--red-bg); color: var(--red); }

/* ── Progress Bar ────────────────────────────────────── */
.progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-dark), var(--accent));
  border-radius: 2px;
  animation: progress-anim 2s infinite;
  width: 60%;
}

@keyframes progress-anim {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* ── Output ──────────────────────────────────────────── */
.output-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.output-placeholder {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 20px;
  text-align: center;
}

.output-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.output-item:hover { border-color: var(--border); }

.output-icon { font-size: 16px; }
.output-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.output-filename {
  font-size: 10px;
  color: var(--text-tertiary);
  font-family: monospace;
}

/* ── Spinner ─────────────────────────────────────────── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(252, 134, 0, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
}

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

/* ── Operations Overview ─────────────────────────────── */
#module-welcome {
  max-width: 1380px;
}

.overview-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0 24px;
  border-bottom: 1px solid var(--border);
}

.overview-eyebrow,
.overview-kicker {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-hero h2 {
  margin-top: 5px;
  font-size: 26px;
  line-height: 1.25;
  color: var(--blue-dark);
}

.overview-hero p {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 13px;
}

.overview-hero time {
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) minmax(240px, 1.35fr);
  gap: 10px;
  padding: 18px 0 24px;
}

.overview-stat {
  min-height: 100px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.overview-stat-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.overview-stat strong {
  font-size: 27px;
  line-height: 1;
}

.overview-stat small {
  color: var(--text-tertiary);
  font-size: 10px;
}

.overview-stat-note {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
}

.overview-stat-note .overview-stat-label,
.overview-stat-note small {
  color: rgba(255, 255, 255, 0.7);
}

.overview-stat-note strong {
  font-size: 14px;
  line-height: 1.4;
}

.value-blue { color: var(--blue); }
.value-green { color: var(--green); }

.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.overview-section {
  min-width: 0;
}

.overview-section-head {
  min-height: 42px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.overview-section-head h3 {
  margin-top: 2px;
  font-size: 16px;
}

.overview-section-hint {
  color: var(--text-tertiary);
  font-size: 10px;
  padding-top: 18px;
}

.overview-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 10px;
}

.overview-module-card {
  min-height: 188px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.overview-module-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(26, 42, 58, 0.08);
  transform: translateY(-1px);
}

.overview-card-top,
.overview-card-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.overview-card-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 17px;
}

.readiness {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
}

.readiness-ready { color: var(--green); background: var(--green-bg); }
.readiness-warn { color: var(--accent-hover); background: var(--accent-bg); }
.readiness-neutral { color: var(--blue); background: var(--blue-bg); }

.overview-card-group {
  margin-top: 13px;
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 700;
}

.overview-module-card > strong {
  margin-top: 3px;
  font-size: 14px;
}

.overview-card-desc {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

.overview-card-footer {
  margin-top: auto;
  padding-top: 12px;
  color: var(--text-tertiary);
  font-size: 10px;
  border-top: 1px solid var(--border-light);
}

.overview-card-footer span:last-child {
  color: var(--accent);
  font-size: 15px;
}

.overview-history {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
}

.icon-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
}

.icon-button:hover {
  color: var(--blue-dark);
  border-color: var(--blue);
}

.run-history-list {
  border-top: 1px solid var(--border);
}

.run-history-item {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border: none;
  border-bottom: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}

.run-history-item:hover {
  color: var(--blue-dark);
}

.run-history-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex: 0 0 auto;
}

.run-history-status.status-done { background: var(--green); }
.run-history-status.status-error { background: var(--red); }
.run-history-status.status-running,
.run-history-status.status-pending { background: var(--accent); }

.run-history-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.run-history-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-history-main small {
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 10px;
}

.overview-empty {
  min-height: 190px;
  padding: 28px 20px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.overview-empty > span {
  color: var(--border);
  font-size: 34px;
}

.overview-empty strong {
  margin-top: 8px;
  font-size: 12px;
}

.overview-empty p {
  max-width: 210px;
  margin-top: 6px;
  color: var(--text-tertiary);
  font-size: 10px;
}

/* ── Param Row ───────────────────────────────────────── */
.param-row {
  margin-top: 12px;
  margin-bottom: 4px;
}

.param-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.param-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  transition: border-color var(--transition);
}

.param-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── No Upload ───────────────────────────────────────── */
.no-upload {
  text-align: center;
  padding: 24px;
}

.no-upload p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.report-access {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 24px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg);
  text-align: center;
}

.report-access-icon {
  display: block;
  margin-bottom: 8px;
  font-size: 30px;
}

.report-access strong {
  display: block;
  font-size: 14px;
}

.report-access p {
  margin: 7px auto 14px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.7;
}

/* ── 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-tertiary); }

/* ── P8 Chat ──────────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 120px);
  min-height: 500px;
}

/* ── Quick Commands ── */
.chat-quick-cmds {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}

.quick-cmd-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  white-space: nowrap;
  margin-right: 2px;
}

.quick-cmd-chip {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.quick-cmd-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Messages ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: msgIn 0.2s ease-out;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg.assistant {
  align-self: flex-start;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.chat-msg.user .chat-avatar {
  background: var(--accent-light);
  border-color: var(--accent);
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
}

.chat-msg.user .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant .chat-bubble {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
}

.chat-bubble p {
  margin: 0 0 6px;
}
.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble ul, .chat-bubble ol {
  margin: 4px 0;
  padding-left: 18px;
}

.chat-bubble li {
  margin: 2px 0;
  font-size: 12px;
}

.chat-bubble code {
  background: rgba(0,0,0,0.07);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

.chat-bubble pre {
  background: #1a2a3a;
  border-radius: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  margin: 6px 0;
}

.chat-bubble pre code {
  background: none;
  padding: 0;
  font-size: 11px;
  color: #a0d0a0;
}

.chat-msg.user .chat-bubble code {
  background: rgba(255,255,255,0.2);
}

.chat-msg.user .chat-bubble pre {
  background: rgba(0,0,0,0.3);
}

.chat-bubble b {
  font-weight: 700;
}

/* ── Streaming cursor ── */
.chat-cursor {
  display: inline-block;
  animation: blink 0.8s infinite;
  color: var(--accent);
  font-weight: 700;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Input Area ── */
.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 0 0;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  min-height: 42px;
  max-height: 160px;
  transition: border-color var(--transition);
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent);
}

.chat-input::placeholder {
  color: var(--text-tertiary);
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
}

/* ── Login Page ───────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--blue-dark) 0%, #002050 100%);
  margin: 0;
  padding: 0;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 44px 36px;
  text-align: center;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 32, 80, 0.25);
}

.login-logo-wrap {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 24px 20px 16px;
  margin-bottom: 12px;
  display: inline-block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.login-logo-icon {
  max-width: 140px;
  height: auto;
  display: block;
  margin: 0 auto 6px;
}

.login-logo-wordmark {
  max-width: 180px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.login-logo { display: none; }

.login-card h2 {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0 0 4px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0 0 28px;
}

.login-field {
  margin-bottom: 14px;
  text-align: left;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.login-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-field input::placeholder { color: var(--text-tertiary); }

.login-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 14px;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  justify-content: center;
  margin-top: 4px;
}

/* ── User Badge (topbar) ─────────────────────────────── */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 5px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 12px;
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.user-name {
  font-weight: 600;
  color: var(--text);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-tag {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.role-admin    { background: var(--red-bg);    color: var(--red); }
.role-operator { background: var(--blue-bg);  color: var(--blue); }
.role-viewer   { background: var(--green-bg); color: var(--green); }
.role-supplier { background: #fff3dc; color: #8a4b00; }

/* ── Disabled Run Button ─────────────────────────────── */
.btn-run:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Admin: User Management Panel ──────────────────────── */
.admin-users-section {
  margin-bottom: 20px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

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

.admin-table .user-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.perm-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  margin: 1px 2px;
}

.perm-write {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(45,164,78,0.3);
}

.perm-read {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid rgba(26,95,160,0.3);
}

.perm-none {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border: 1px solid var(--border-light);
}

/* Admin user form */
.admin-form {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.admin-form h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--blue-dark);
}

.admin-form .form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.admin-form .form-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 60px;
}

.admin-form input[type="text"],
.admin-form input[type="password"] {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  min-width: 160px;
}

.admin-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-form select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
}

.role-radio-group {
  display: flex;
  gap: 14px;
}

.role-radio-group label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500 !important;
  cursor: pointer;
  min-width: auto !important;
}

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

/* Permission matrix */
.perm-matrix {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 11px;
}

.perm-matrix th {
  padding: 5px 6px;
  text-align: center;
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
}

.perm-matrix th:first-child {
  text-align: left;
  min-width: 140px;
  padding-left: 8px;
}

.perm-matrix td {
  padding: 5px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.perm-matrix td:first-child {
  text-align: left;
  font-weight: 600;
  padding-left: 8px;
  color: var(--text);
}

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

.perm-matrix tr:nth-child(even) td {
  background: var(--bg);
}

/* Admin action buttons */
.btn-admin-add {
  margin-bottom: 12px;
}

.btn-table-action {
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: inherit;
  transition: all var(--transition);
  margin: 1px 2px;
}

.btn-table-action:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.btn-table-action.edit:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-bg);
}

.btn-table-action.delete:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg);
}

/* ── P5: AI 图片视频工作台 ──────────────────────────── */

/* Pipeline flow */
.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  padding: 8px 0;
}

.pipe-step {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 6px 10px 6px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: all var(--transition);
}

.pipe-step:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.pipe-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.pipe-arrow {
  color: var(--text-tertiary);
  margin: 0 6px;
  font-size: 14px;
  font-weight: 400;
}

.pipeline-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Workflow card grid */
.wf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.wf-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition);
}

.wf-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 12px rgba(0,65,123,0.08);
  transform: translateY(-1px);
}

.wf-card-featured {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.wf-card-featured:hover {
  border-color: var(--accent-hover);
  box-shadow: 0 2px 12px rgba(252,134,0,0.12);
}

.wf-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.wf-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.wf-info {
  min-width: 0;
}

.wf-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.wf-eng {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: 'Consolas', 'Courier New', monospace;
  word-break: break-all;
}

.wf-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.wf-params {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wf-param-tag {
  display: inline-block;
  padding: 2px 7px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.wf-model {
  font-size: 10px;
  color: var(--purple);
  font-weight: 600;
  padding: 3px 8px;
  background: var(--purple-bg);
  border-radius: 3px;
  display: inline-block;
  align-self: flex-start;
}

.wf-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--blue-dark);
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  align-self: flex-start;
  transition: all var(--transition);
}

.wf-link:hover {
  background: var(--blue);
  color: #fff;
  text-decoration: none;
}

/* API key note */
.api-key-note {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.api-key-note code {
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-family: 'Consolas', 'Courier New', monospace;
  color: var(--blue-dark);
}

/* Clickable workflow cards */
.wf-card-clickable {
  cursor: pointer;
}

.wf-card-clickable:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 4px 16px rgba(252, 134, 0, 0.15) !important;
}

.wf-card-selected {
  border-color: var(--accent) !important;
  background: var(--accent-light) !important;
  box-shadow: 0 0 0 2px var(--accent) !important;
}

.wf-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  padding: 24px;
}

/* P5 Parameter Form */
.p5-param-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.p5-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p5-form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.p5-input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.p5-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(252, 134, 0, 0.12);
}

.p5-textarea {
  resize: vertical;
  min-height: 60px;
}

/* Toggle switch for boolean params */
.p5-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.p5-toggle input[type="checkbox"] {
  display: none;
}

.p5-toggle-slider {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}

.p5-toggle-slider::after {
  content: '';
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--transition);
}

.p5-toggle input:checked + .p5-toggle-slider {
  background: var(--accent);
}

.p5-toggle input:checked + .p5-toggle-slider::after {
  transform: translateX(18px);
}

.p5-toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 24px;
}

/* P5 Drop Zone (override for P5 form) */
.p5-drop-zone {
  max-width: 100% !important;
  min-height: 80px;
}

.p5-url-or {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.p5-url-or::before,
.p5-url-or::after {
  content: ' — ';
  color: var(--border-light);
}

/* P5 Result Grid */
.p5-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.p5-result-item {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.p5-result-item img,
.p5-result-item video {
  display: block;
  object-fit: cover;
}

.p5-result-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.p5-result-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: auto;
}

/* P5 Form Actions */
.p5-form-actions {
  display: flex;
  align-items: center;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 60px; min-width: 60px; }
  .sidebar .sidebar-logo-icon, .sidebar .sidebar-logo-text, .sidebar .nav-label,
  .sidebar .sidebar-footer, .sidebar .nav-group-label { display: none; }
  .sidebar-header { padding: 12px 8px; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-icon { font-size: 20px; width: auto; }

  .main { margin-left: 60px; }
  .file-grid { grid-template-columns: 1fr; }
  .overview-stats { grid-template-columns: 1fr 1fr; }
  .overview-layout { grid-template-columns: 1fr; }
  .overview-module-grid { grid-template-columns: 1fr 1fr; }
  .overview-history { position: static; }
}

@media (max-width: 520px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .file-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; }
  .topbar-actions .user-name, .topbar-actions .role-tag, #btn-cleanup { display: none; }
  .overview-hero { align-items: flex-start; flex-direction: column; gap: 8px; }
  .overview-hero h2 { font-size: 22px; }
  .overview-stats { grid-template-columns: 1fr 1fr; }
  .overview-stat { min-height: 92px; }
  .overview-stat-note { grid-column: 1 / -1; }
  .overview-module-grid { grid-template-columns: 1fr; }
  .content { padding: 12px; }
}

/* Final visual pass: calm operational hierarchy and responsive navigation. */
:root {
  --bg: #f3f6f9;
  --bg-tertiary: #edf2f6;
  --border: #cbd5df;
  --border-light: #e3e9ef;
  --text: #142638;
  --text-secondary: #5b6f82;
  --text-tertiary: #8798a9;
  --blue-dark: #083f73;
  --blue: #1767a6;
  --blue-light: #dbe9f5;
  --blue-bg: rgba(23, 103, 166, 0.07);
  --accent: #e87812;
  --accent-hover: #c96108;
  --accent-light: #fff1e4;
  --accent-bg: rgba(232, 120, 18, 0.09);
  --shadow: 0 2px 8px rgba(20, 38, 56, 0.05);
  --sidebar-w: 232px;
}

.sidebar {
  box-shadow: 2px 0 12px rgba(20, 38, 56, 0.04);
}

.sidebar-header {
  padding-top: 20px;
  padding-bottom: 16px;
}

.nav-list { padding: 12px 10px; gap: 3px; }
.nav-group-label { padding-top: 16px; letter-spacing: 0; }
.nav-item { min-height: 40px; }
.nav-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
  border-left: 0;
}

.main { background: var(--bg); }
.topbar {
  padding: 0 clamp(18px, 3vw, 40px);
  box-shadow: 0 1px 0 rgba(20, 38, 56, 0.03);
}
.topbar h1 { font-size: 15px; }
.topbar-actions { align-items: center; }
.content {
  padding: 28px clamp(18px, 3vw, 40px) 44px;
}

.mobile-nav-toggle {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}
.mobile-nav-toggle:hover { color: var(--blue-dark); border-color: var(--blue); }
.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 24, 38, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.panel-header {
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
}
.panel-badge {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border: 1px solid rgba(232, 120, 18, 0.45);
  box-shadow: var(--shadow);
}
.panel-header h2 { font-size: 22px; letter-spacing: 0; }
.panel-desc { font-size: 13px; line-height: 1.6; }

.section-box {
  border-color: var(--border-light);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.section-title {
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0;
}
.section-hint { line-height: 1.5; }

.overview-hero {
  padding: 4px 0 28px;
  border-bottom-color: var(--border-light);
}
.overview-hero h2 { font-size: 30px; }
.overview-hero p { max-width: 680px; line-height: 1.7; }
.overview-stats { gap: 14px; padding: 20px 0 30px; }
.overview-stat {
  min-height: 112px;
  padding: 17px 18px;
  border-color: var(--border-light);
  box-shadow: var(--shadow);
  border-radius: 8px;
}
.overview-stat strong { font-size: 30px; }
.overview-stat-note { box-shadow: none; }
.overview-layout { gap: 34px; }
.overview-section-head { margin-bottom: 14px; }
.overview-section-head h3 { font-size: 17px; }
.overview-module-grid { gap: 14px; }
.overview-module-card {
  min-height: 198px;
  padding: 17px;
  border-color: var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.overview-module-card:hover {
  border-color: rgba(232, 120, 18, 0.55);
  box-shadow: 0 8px 20px rgba(20, 38, 56, 0.09);
  transform: translateY(-2px);
}
.overview-card-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-light);
  background: #f7f9fb;
}
.overview-card-group { margin-top: 15px; color: var(--blue); }
.overview-module-card > strong { font-size: 15px; }
.overview-card-desc { font-size: 12px; line-height: 1.65; }
.overview-card-footer { padding-top: 14px; }
.overview-history { padding-left: 2px; }
.run-history-list { border-top-color: var(--border-light); }
.run-history-item { min-height: 62px; padding: 11px 4px; }

.file-card {
  border-color: var(--border-light);
  border-radius: 8px;
  background: #fbfcfd;
}
.drop-zone { min-height: 92px; display: flex; align-items: center; justify-content: center; }
.btn { min-height: 36px; }
.btn-primary { box-shadow: 0 3px 8px rgba(232, 120, 18, 0.18); }
.btn-ghost { background: var(--bg-secondary); }
.user-badge { background: #f7f9fb; }

@media (max-width: 1100px) {
  .overview-module-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .overview-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; }
}

@media (max-width: 768px) {
  .sidebar-scrim { display: block; }
  .overview-layout { grid-template-columns: 1fr; }
  .overview-history { padding-left: 0; }
  .overview-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding-top: 22px; }
}

@media (max-width: 520px) {
  .sidebar {
    display: flex;
    width: min(82vw, 280px);
    min-width: min(82vw, 280px);
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: 12px 0 28px rgba(18, 38, 63, 0.16);
  }
  body.mobile-nav-open .sidebar { transform: translateX(0); }
  body.mobile-nav-open { overflow: hidden; }
  body.mobile-nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .sidebar .sidebar-logo-icon,
  .sidebar .sidebar-logo-text,
  .sidebar .nav-label,
  .sidebar .sidebar-footer,
  .sidebar .nav-group-label { display: initial; }
  .sidebar-header { padding: 18px 10px 14px; }
  .sidebar-logo-icon { width: 112px; }
  .sidebar-logo-text { width: 122px; }
  .nav-item { justify-content: flex-start; padding: 10px 12px; }
  .nav-icon { font-size: 16px; width: 24px; }
  .topbar { gap: 10px; }
  .topbar h1 { flex: 1; min-width: 0; }
  .mobile-nav-toggle { display: inline-flex; }
  .overview-hero h2 { font-size: 24px; }
  .overview-stats { gap: 9px; padding-bottom: 22px; }
  .overview-stat { min-height: 96px; padding: 13px; }
  .overview-stat strong { font-size: 25px; }
  .overview-module-grid { grid-template-columns: 1fr; gap: 10px; }
  .overview-module-card { min-height: 170px; }
  .section-box { padding: 16px; }
  .panel-header { align-items: flex-start; }
  .panel-header h2 { font-size: 19px; }
  .topbar-actions { gap: 5px; }
}
