/* ================================================================
   ProdControl Web Portal — Design System
   Dark theme · Teal accent · Premium SaaS dashboard
   ================================================================ */

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---- Variables ---- */
:root {
  /* Backgrounds */
  --bg-page: #06080e;
  --bg-surface: #0b1018;
  --bg-card: #0f1621;
  --bg-elevated: #141d2c;
  --bg-hover: #151f30;
  --bg-input: #0d1520;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 225, 188, 0.3);
  --border-focus: rgba(0, 225, 188, 0.55);

  /* Accent (teal — matches desktop app) */
  --accent: #00e1bc;
  --accent-dim: rgba(0, 225, 188, 0.08);
  --accent-soft: rgba(0, 225, 188, 0.14);
  --accent-glow: rgba(0, 225, 188, 0.28);

  /* Text */
  --text-primary: #ebf0f8;
  --text-secondary: #8797b5;
  --text-muted: #445068;

  /* Layout */
  --sidebar-w: 228px;
  --header-h: 60px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.55);

  /* Typography */
  --font: -apple-system, "Segoe UI", "Inter", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", "Consolas", monospace;
}

/* ---- Base ---- */
html,
body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ================================================================
   LAYOUT
   ================================================================ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  grid-row: 1 / -1;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 16px 15px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent) 0%, #0099bb 100%);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  color: #000;
  flex-shrink: 0;
  box-shadow:
    0 0 28px var(--accent-glow),
    0 0 8px rgba(0, 225, 188, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.3s;
}
.sidebar-logo:hover {
  box-shadow:
    0 0 40px rgba(0, 225, 188, 0.5),
    0 0 12px rgba(0, 225, 188, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.2px;
}
.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.1px;
  padding: 10px 10px 4px;
  margin-top: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  position: relative;
  cursor: pointer;
}
.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-link.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 58%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px var(--accent);
}
.nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-badge.red {
  background: rgba(255, 100, 100, 0.15);
  color: #ff7070;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 10px 8px 14px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-user:hover {
  background: var(--bg-hover);
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ================================================================
   HEADER
   ================================================================ */
.app-header {
  grid-column: 2;
  background: rgba(11, 16, 24, 0.9);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow:
    0 1px 0 rgba(0, 225, 188, 0.06),
    0 4px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
.header-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Brand logo in the header (top-left). Two images: one for the dark theme
   (white-text logo) and one for the light theme (black-text logo). */
.header-logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding-right: 16px;
  margin-right: 4px;
  border-right: 1px solid var(--border-subtle);
}
.header-logo img {
  height: 30px;
  width: auto;
  display: block;
}
.header-logo .logo-light {
  display: none;
}
[data-theme="light"] .header-logo .logo-dark {
  display: none;
}
[data-theme="light"] .header-logo .logo-light {
  display: block;
}

.header-search {
  flex: 1;
  max-width: 380px;
  margin-left: 8px;
  position: relative;
}
.header-search input {
  width: 100%;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  color: var(--text-primary);
  padding: 0 14px 0 36px;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.header-search input:focus {
  border-color: var(--border-focus);
}
.header-search input::placeholder {
  color: var(--text-muted);
}
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-clock {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 600;
}
.btn-primary:hover {
  background: #00f5cc;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(255, 80, 80, 0.12);
  color: #ff7070;
  border: 1px solid rgba(255, 80, 80, 0.2);
}
.btn-danger:hover {
  background: rgba(255, 80, 80, 0.2);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.15s;
}
.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
  grid-column: 2;
  grid-row: 2;
  padding: 22px 24px;
  overflow-y: auto;
  background: var(--bg-page);
}

/* ================================================================
   STAT CARDS
   ================================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 1400px) {
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.stat-card:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--card-accent, var(--accent));
}
.stat-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: radial-gradient(
    circle,
    var(--card-glow, var(--accent-glow)) 0%,
    transparent 70%
  );
  pointer-events: none;
}
.stat-icon {
  font-size: 26px;
  margin-bottom: 10px;
  opacity: 0.8;
}
.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -1.5px;
}
.stat-change {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-change.up {
  color: #00e676;
}
.stat-change.down {
  color: #ff7070;
}

/* ================================================================
   SECTION HEADER
   ================================================================ */
.section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-hdr-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ================================================================
   DASHBOARD GRID
   ================================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
}
@media (max-width: 1200px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   PIPELINE VISUALIZATION
   ================================================================ */
.pipeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 18px;
}
.pipeline-stages {
  display: flex;
  gap: 4px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.pipeline-stage {
  flex: 1;
  min-width: 88px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 10px 10px 8px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}
.pipeline-stage:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.pipeline-stage.selected {
  border-color: var(--border-accent);
  background: var(--accent-dim);
}

.pipe-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--s-color, #555);
  box-shadow: 0 0 7px var(--s-color, transparent);
  margin-bottom: 8px;
}
.pipe-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 5px;
  line-height: 1.3;
}
.pipe-count {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  color: var(--s-color, var(--text-primary));
}
.pipe-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  padding-top: 14px;
  flex-shrink: 0;
}

/* ================================================================
   DATA TABLE
   ================================================================ */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.table-search {
  position: relative;
  flex: 1;
  max-width: 270px;
  min-width: 160px;
}
.table-search input {
  width: 100%;
  height: 34px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  color: var(--text-primary);
  padding: 0 12px 0 34px;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.table-search input:focus {
  border-color: var(--border-focus);
}
.table-search input::placeholder {
  color: var(--text-muted);
}
.ts-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.filter-select {
  height: 34px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  padding: 0 28px 0 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%238797B5'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s;
}
.filter-select:focus {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Table itself */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.data-table th:hover {
  color: var(--text-secondary);
}
.data-table th.sorted {
  color: var(--accent);
}
.sort-arrow {
  margin-left: 4px;
  opacity: 0.6;
}

.data-table td {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
  transition:
    background 0.12s,
    color 0.12s;
}
.data-table tr:last-child td {
  border-bottom: none;
}

/* Badge columns (Section / Status) — size to their content and never clip the
   pill, so long labels like "WAITING FOR SIDELIGHT COMPLETE" show in full. */
.data-table td.col-fit {
  max-width: none;
  width: 1%;
  overflow: visible;
  text-overflow: clip;
}
/* Customer column — ellipsis, narrows on smaller screens */
.data-table td.col-cust {
  max-width: 185px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── DENSITY MODEL ──
   > 1920px (the owner's 2K screen): the original SPACIOUS layout — tall rows,
   columns spread to fill the width (defaults above).
   ≤ 1920px (office monitors): COMPACT — short rows, columns hug their content,
   and the empty slack is collected into one trailing spacer column. */
/* The trailing spacer column is no longer used — columns spread to fill the
   width at every size (even gaps), only row height/font change per breakpoint. */
.data-table .col-spacer { display: none; }

@media (max-width: 1920px) {
  .data-table td { padding: 8px 13px; }
  .data-table th { padding: 8px 13px; }
  .data-table td.col-cust { max-width: 175px; }
}
@media (max-width: 1500px) {
  .data-table td { font-size: 13px; padding: 7px 11px; }
  .data-table th { padding: 7px 11px; font-size: 11px; }
  .badge { font-size: 12px; padding: 4px 9px; }
  .tag, .type-chip { font-size: 11px; padding: 3px 7px; }
  .badge::before { width: 5px; height: 5px; }
  .data-table td.col-cust { max-width: 140px; }
}
@media (max-width: 1300px) {
  .data-table td { font-size: 12px; padding: 6px 8px; }
  .data-table th { padding: 6px 8px; font-size: 10px; letter-spacing: 0.3px; }
  .badge { font-size: 10px; padding: 3px 7px; gap: 3px; }
  .badge::before { width: 4px; height: 4px; }
  .tag, .type-chip { font-size: 9.5px; padding: 2px 5px; }
  .data-table td.col-cust { max-width: 96px; }
}
.data-table tr:hover td {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.data-table tr.row-selected td {
  background: rgba(0, 225, 188, 0.06);
}
.data-table tr.row-red td {
  background: rgba(255, 70, 70, 0.13);
}
.data-table tr.row-red:hover td {
  background: rgba(255, 70, 70, 0.18);
}
.data-table tr.row-red td:first-child {
  box-shadow: inset 3px 0 0 #ff4d4d;
}

/* Row whose status/stage/section changed on the last refresh — green flash
   that holds for a while, then fades (cleared by the highlight timer). */
.data-table tr.row-updated td {
  background: rgba(0, 230, 118, 0.14) !important;
  animation: rowUpdated 1.1s ease;
}
.data-table tr.row-updated td:first-child {
  box-shadow: inset 3px 0 0 #00e676;
}
@keyframes rowUpdated {
  0% {
    background: rgba(0, 230, 118, 0.42) !important;
  }
  100% {
    background: rgba(0, 230, 118, 0.14) !important;
  }
}

/* Column widths */
.col-chk {
  width: 26px !important;
  min-width: 26px;
  padding: 8px 6px !important;
}
.col-job {
  width: 96px;
  min-width: 96px;
}
.col-cust {
  width: 190px;
}
.col-date {
  width: 120px;
}
.col-glas {
  width: 120px;
}
.col-sect {
  width: 110px;
}
.col-prod {
  width: 160px;
}
.col-stag {
  width: 130px;
}
.col-stat {
  width: 170px;
}
.col-comm {
  width: 220px;
}
.col-trk {
  width: 100px;
}

/* Job number */
.cell-job {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary) !important;
}
.cell-job:hover {
  color: var(--accent) !important;
  cursor: pointer;
}

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--b-color);
  box-shadow: 0 0 5px var(--b-color);
  flex-shrink: 0;
}

/* Section tag */
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 9px;
  border-radius: 5px;
  white-space: nowrap;
}
.tag-incomplete {
  background: rgba(255, 183, 77, 0.14);
  color: #ffb74d;
}
.tag-not-started {
  background: rgba(255, 138, 128, 0.14);
  color: #ff8a80;
}
.tag-warehouse {
  background: rgba(0, 230, 118, 0.12);
  color: #00e676;
}
.tag-loaded {
  background: rgba(0, 200, 83, 0.12);
  color: #00c853;
}
.tag-received {
  background: rgba(0, 191, 165, 0.12);
  color: #00bfa5;
}

/* F/S checkbox */
.chk-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border-default);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  color: transparent;
  transition: all 0.15s;
}
.chk-box.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.chk-box:hover {
  border-color: var(--border-accent);
}

/* Comment cell */
.cell-comment {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.cell-comment.has-red {
  color: #ff7070 !important;
  font-style: normal;
  font-weight: 600;
}

/* Tracking link */
.track-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}
.track-btn:hover {
  color: var(--accent);
  border-color: var(--border-accent);
  background: var(--accent-dim);
}

/* Product type chip */
.type-chip {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}
.type-chip.door {
  background: rgba(79, 195, 247, 0.1);
  color: #4fc3f7;
}
.type-chip.sidelight {
  background: rgba(179, 157, 219, 0.1);
  color: #b39ddb;
}
.type-chip.toplight {
  background: rgba(255, 241, 118, 0.1);
  color: #fff176;
}
.type-chip.galactic {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(6, 182, 212, 0.12));
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.35);
  box-shadow: 0 0 7px rgba(147, 51, 234, 0.3);
  text-shadow: 0 0 5px rgba(192, 132, 252, 0.5);
}

/* ================================================================
   DETAIL SLIDE PANEL
   ================================================================ */
.detail-panel {
  position: fixed;
  top: 0;
  right: -500px;
  width: 500px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  z-index: 200;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
}
.detail-panel.open {
  right: 0;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
}
.panel-job-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}
.panel-customer {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}
.panel-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  transition: all 0.15s;
  background: transparent;
  border: none;
}
.panel-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.panel-section {
  margin-bottom: 24px;
}
.panel-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-item-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.info-item-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 26px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-default);
}
.tl-item {
  position: relative;
  margin-bottom: 16px;
}
.tl-dot {
  position: absolute;
  left: -26px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  transition: all 0.2s;
}
.tl-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.tl-stage {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.tl-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Notes textarea */
.notes-area {
  width: 100%;
  min-height: 90px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.5;
}
.notes-area:focus {
  border-color: var(--border-focus);
}

.panel-actions {
  display: flex;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* ================================================================
   OVERLAY
   ================================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ================================================================
   ACTIVITY FEED (dashboard right column)
   ================================================================ */
.activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  height: fit-content;
}
.activity-hdr {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
  cursor: pointer;
}
.activity-item:last-child {
  border-bottom: none;
}
.activity-item:hover {
  background: var(--bg-hover);
}
.ac-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.ac-content {
  flex: 1;
  min-width: 0;
}
.ac-job {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.ac-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ================================================================
   ALERTS / ISSUES CARD
   ================================================================ */
.alert-card {
  background: rgba(255, 80, 80, 0.06);
  border: 1px solid rgba(255, 80, 80, 0.2);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.alert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 80, 80, 0.12);
}
.alert-row:last-child {
  border-bottom: none;
}
.alert-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.alert-job {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #ff7070;
}
.alert-msg {
  font-size: 12px;
  color: var(--text-muted);
}
.alert-action {
  margin-left: auto;
}

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.progress {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}
.empty-text {
  font-size: 14px;
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease both;
}
.slide-in {
  animation: slideIn 0.25s ease both;
}
.pulse {
  animation: pulse 2s ease infinite;
}

/* Stagger fade-in for table rows */
.data-table tbody tr {
  animation: fadeIn 0.2s ease both;
}
.data-table tbody tr:nth-child(1) {
  animation-delay: 0.02s;
}
.data-table tbody tr:nth-child(2) {
  animation-delay: 0.04s;
}
.data-table tbody tr:nth-child(3) {
  animation-delay: 0.06s;
}
.data-table tbody tr:nth-child(4) {
  animation-delay: 0.08s;
}
.data-table tbody tr:nth-child(5) {
  animation-delay: 0.1s;
}
.data-table tbody tr:nth-child(6) {
  animation-delay: 0.12s;
}
.data-table tbody tr:nth-child(7) {
  animation-delay: 0.14s;
}
.data-table tbody tr:nth-child(8) {
  animation-delay: 0.16s;
}
.data-table tbody tr:nth-child(9) {
  animation-delay: 0.18s;
}
.data-table tbody tr:nth-child(10) {
  animation-delay: 0.2s;
}

/* ================================================================
   TOOLTIP
   ================================================================ */
[title]:hover {
  position: relative;
}

/* ================================================================
   KEYBOARD SHORTCUT HINT
   ================================================================ */
.kbd {
  display: inline-block;
  padding: 2px 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ================================================================
   DATE RANGE PICKER (header)
   ================================================================ */
.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.date-range:hover {
  border-color: var(--border-accent);
}
.date-range-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.date-range-val {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}
.date-sep {
  color: var(--text-muted);
  font-size: 12px;
}

/* ================================================================
   NOTIFICATION DOT
   ================================================================ */
.notif-btn {
  width: 34px;
  height: 34px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all 0.15s;
}
.notif-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
}
.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff7070;
  border: 1.5px solid var(--bg-input);
  animation: pulse 2s infinite;
}

/* ================================================================
   THEME TOGGLE BUTTON
   ================================================================ */
.theme-toggle {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
  transform: rotate(15deg) scale(1.1);
}

/* ================================================================
   LIGHT THEME
   ================================================================ */
[data-theme="light"] {
  /* Backgrounds */
  --bg-page:     #eef2f7;
  --bg-surface:  #ffffff;
  --bg-card:     #f5f7fb;
  --bg-elevated: #f0f4f9;
  --bg-hover:    #e8edf5;
  --bg-input:    #ffffff;

  /* Borders */
  --border-subtle:  rgba(0, 0, 0, 0.06);
  --border-default: rgba(0, 0, 0, 0.10);
  --border-accent:  rgba(0, 135, 111, 0.30);
  --border-focus:   rgba(0, 135, 111, 0.60);

  /* Accent — darker teal for legibility on white */
  --accent:      #00876f;
  --accent-dim:  rgba(0, 135, 111, 0.08);
  --accent-soft: rgba(0, 135, 111, 0.14);
  --accent-glow: rgba(0, 135, 111, 0.22);

  /* Text */
  --text-primary:   #1a2035;
  --text-secondary: #4a5568;
  --text-muted:     #8fa0b8;

  /* Shadows — softer */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.13);
}

/* Dot grid — dark on light bg */
[data-theme="light"] body {
  background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

/* Header frosted glass */
[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 1px 0 rgba(0, 135, 111, 0.07),
    0 2px 12px rgba(0, 0, 0, 0.07);
}

/* Sidebar subtle bg */
[data-theme="light"] .sidebar {
  background: #f8fafc;
}

/* Type chip base — invisible on white without this */
[data-theme="light"] .type-chip {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-secondary);
}
/* spray route indicator — yellow so it reads at a glance. Flat: it used to
   carry a glow and a pulse, which just made a whole column of them throb. */
.type-chip.spray {
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.30), rgba(255, 170, 0, 0.22));
  color: #ffe24d;
  border: 1px solid rgba(255, 214, 10, 0.6);
}
[data-theme="light"] .type-chip.spray {
  background: linear-gradient(135deg, #ffcf1a, #ffab00);
  color: #4a2e00;
  border-color: rgba(190, 120, 0, 0.65);
}

/* ── Chip Wizzard block (detail panel) ────────────────────────────────
   Everything inside this card comes from THEIR tracker, not our database.
   Framed, tinted and rule-separated on purpose: dropped into a plain
   .panel-section it read as a continuation of our own Job Information
   sitting right above it, which is exactly what it must never look like. */
.cw-card {
  border: 1px solid rgba(78, 214, 251, 0.26);
  border-left: 3px solid rgba(78, 214, 251, 0.85);
  border-radius: var(--r-md);
  background: rgba(78, 214, 251, 0.05);
  padding: 13px 15px 15px;
}
.cw-card-h {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 13px;
  border-bottom: 1px solid rgba(78, 214, 251, 0.2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #7fd8fb;
}
.cw-card-note {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(78, 214, 251, 0.2);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
[data-theme="light"] .cw-card {
  border-color: rgba(2, 132, 199, 0.28);
  border-left-color: #0284c7;
  background: rgba(2, 132, 199, 0.05);
}
[data-theme="light"] .cw-card-h {
  color: #0369a1;
  border-bottom-color: rgba(2, 132, 199, 0.2);
}
[data-theme="light"] .cw-card-note {
  border-top-color: rgba(2, 132, 199, 0.2);
}

/* Chip Wizzard — this job is out at the chipper. Deliberately calm next to the
   glowing Spray chip: it's a "where is it" fact, not a warning. The status
   itself lives in the detail panel, not here. */
.type-chip.cw {
  background: rgba(78, 214, 251, 0.14);
  color: #7fd8fb;
  border: 1px solid rgba(78, 214, 251, 0.45);
}
[data-theme="light"] .type-chip.cw {
  background: rgba(2, 132, 199, 0.1);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.4);
}

/* Table rows */
[data-theme="light"] .data-table tr:hover td {
  background: #e5ecf5;
}
[data-theme="light"] .data-table tr.row-selected td {
  background: rgba(0, 135, 111, 0.07);
}

/* Sidebar logo glow */
[data-theme="light"] .sidebar-logo {
  box-shadow:
    0 0 20px rgba(0, 135, 111, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Notif dot border matches bg in light */
[data-theme="light"] .notif-dot {
  border-color: #ffffff;
}

/* Status filter pills in sidebar */
[data-theme="light"] .status-item {
  color: var(--text-secondary);
}
[data-theme="light"] .status-item:hover,
[data-theme="light"] .status-item.active {
  background: var(--bg-hover);
}

/* Section tabs */
[data-theme="light"] .section-tab {
  background: var(--bg-card);
  border-color: var(--border-default);
  color: var(--text-secondary);
}
[data-theme="light"] .section-tab.active {
  background: rgba(0, 135, 111, 0.10);
  border-color: var(--accent);
  color: var(--accent);
}

/* Detail panel */
[data-theme="light"] .detail-panel {
  background: #f8fafc;
}

/* Overlay */
[data-theme="light"] .overlay {
  background: rgba(30, 40, 60, 0.35);
}

/* ── Right-click context menu ─────────────────────────────────────── */
.ctx-menu {
  position: absolute;
  z-index: 9000;
  min-width: 200px;
  padding: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  animation: ctxPop 0.12s ease;
}
@keyframes ctxPop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.ctx-item {
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}
.ctx-item:hover {
  background: var(--bg-hover);
}
.ctx-item.ctx-red {
  color: #ff6b6b;
}
.ctx-item.ctx-danger {
  color: #ff8a8a;
}

/* ── "What's happened?" red-flag modal ────────────────────────────── */
.rf-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 12, 0.7);
  backdrop-filter: blur(6px);
}
.rf-card {
  width: 420px;
  max-width: 92vw;
  background: var(--bg-card);
  border: 1px solid rgba(255, 80, 80, 0.4);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 80, 80, 0.1);
  animation: rfPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes rfPop {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(10px);
  }
}
.rf-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.rf-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.rf-input {
  width: 100%;
  resize: vertical;
  min-height: 70px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.rf-input:focus {
  border-color: #ff6b6b;
}
.rf-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* ── Bubble pipeline (detail panel) — SVG with merging branches ────── */
.pipeline-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  margin-top: 4px;
}
.pl-link {
  fill: none;
  stroke: var(--border-default);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.pl-link.on {
  stroke: #00e676;
}
.pl-c {
  stroke-width: 2.5;
}
.pl-c.todo {
  fill: var(--bg-card);
  stroke: var(--border-default);
}
.pl-c.done {
  fill: #00e676;
  stroke: #00e676;
  filter: drop-shadow(0 0 4px rgba(0, 230, 118, 0.6));
}
.pl-c.current {
  fill: var(--bg-card);
  stroke: var(--accent);
  animation: plGlow 1.5s ease-in-out infinite;
}
@keyframes plGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 2px rgba(0, 225, 188, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 7px rgba(0, 225, 188, 0.9));
  }
}
.pl-t {
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  font-size: 13px;
  font-weight: 600;
  fill: var(--text-muted);
}
.pl-t.done {
  fill: var(--text-primary);
}
.pl-t.current {
  fill: var(--accent);
  font-weight: 700;
}

/* Red banner inside the detail panel */
.rf-banner {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 70, 70, 0.1);
  border: 1px solid rgba(255, 70, 70, 0.3);
}
.rf-banner-title {
  font-size: 13px;
  font-weight: 800;
  color: #ff7070;
  margin-bottom: 4px;
}
.rf-banner-body {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ── Header user chip ─────────────────────────────────────────────── */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-card);
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #022;
  background: linear-gradient(135deg, #00e1bc, #0099bb);
}
.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-logout {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 6px;
  line-height: 1;
}
.user-logout:hover {
  color: #ff7070;
  background: rgba(255, 112, 112, 0.1);
}

/* ── Comments thread (detail panel) ───────────────────────────────── */
.comments-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.cm-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px 0;
}
.cm-item {
  display: flex;
  gap: 10px;
}
.cm-avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #022;
  background: linear-gradient(135deg, #00e1bc, #0099bb);
}
.cm-main {
  flex: 1;
  min-width: 0;
}
.cm-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.cm-author {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.cm-time {
  font-size: 11px;
  color: var(--text-muted);
}
.cm-del {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 5px;
  line-height: 1;
}
.cm-del:hover {
  color: #ff7070;
  background: rgba(255, 112, 112, 0.1);
}
.cm-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-input {
  width: 100%;
  resize: vertical;
  min-height: 44px;
  padding: 9px 11px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.comment-input:focus {
  border-color: var(--accent);
}
.comment-form .btn {
  align-self: flex-end;
}
