:root {
  --bg-app: #f3f7fb;
  --bg-card: #ffffff;
  --bg-rail: #09182c;
  --bg-rail-hover: #102542;
  --bg-subtle: #f7fafd;
  --border: #e1e8f0;
  --border-strong: #c8d4e3;
  --text-main: #0c1a2e;
  --text-muted: #4b5e77;
  --text-light: #8797ad;
  --primary: #0284c7;
  --primary-bright: #0ea5e9;
  --primary-soft: #e0f2fe;
  --emerald: #059669;
  --emerald-soft: #f0fdf6;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --rose: #dc2626;
  --rose-soft: #fef2f2;
  --shadow-xs: 0 1px 2px rgba(9, 24, 44, 0.03);
  --shadow-sm: 0 1px 3px rgba(9, 24, 44, 0.05), 0 1px 2px rgba(9, 24, 44, 0.03);
  --shadow-md: 0 8px 24px rgba(9, 24, 44, 0.08);
  --shadow-lg: 0 22px 48px rgba(9, 24, 44, 0.18);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg-app);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 218px 1fr;
  grid-template-rows: 54px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Top Command Bar */
.topbar {
  grid-column: 1 / -1;
  background: #061121;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #132847;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-badge {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(145deg, #38bdf8, #0284c7);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.42);
}

.brand-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 11px;
  color: #7d8da6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.overall-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  color: #b8c4d8;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.55);
}

.overall-pill strong {
  color: #f8fafc;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Sidebar */
.sidebar {
  background: var(--bg-rail);
  color: #8ba2c1;
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  gap: 2px;
  border-right: 1px solid #132847;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #5b6b84;
  padding: 12px 10px 5px;
}

.nav-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px 5px;
}

.nav-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(14, 165, 233, 0.08);
  color: #7dd3fc;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.14s;
}

.nav-edit-btn:hover {
  background: rgba(14, 165, 233, 0.22);
  color: #ffffff;
}

.nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #b4c0d3;
  padding: 8px 11px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  transition: all 0.14s ease;
}

.nav-label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-label svg {
  opacity: 0.72;
  transition: opacity 0.14s;
}

.nav-btn:hover {
  background: var(--bg-rail-hover);
  color: #f8fafc;
}

.nav-btn:hover .nav-label svg,
.nav-btn.active .nav-label svg {
  opacity: 1;
}

.nav-btn.active {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(56, 189, 248, 0.3);
  color: #ffffff;
  font-weight: 600;
}

.nav-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2.5px;
  border-radius: 0 3px 3px 0;
  background: #38bdf8;
}

.nav-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #8ba2c1;
}

.nav-btn.active .nav-count {
  background: rgba(56, 189, 248, 0.22);
  color: #bae6fd;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid #132847;
  font-size: 11px;
  color: #6b7c96;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.side-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.side-metric strong {
  color: #dbe3ef;
  font-variant-numeric: tabular-nums;
}

/* Main Workspace */
.main-area {
  overflow-y: auto;
  padding: 18px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.btn:hover {
  background: #f8fafc;
  border-color: #9aa7bc;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.28);
}

.btn-primary:hover {
  background: #0369a1;
  border-color: #0369a1;
}

.btn-dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #d7e0ee;
}

.btn-dark:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11.5px;
}

.btn-danger {
  background: #fff5f5;
  border-color: #fecaca;
  color: #b91c1c;
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

input[type="text"], input[type="date"], input[type="number"], select, textarea {
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  transition: border-color 0.14s, box-shadow 0.14s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-bright);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
}

input[type="range"] {
  accent-color: var(--primary-bright);
}

/* Segmented Control */
.seg-group {
  display: inline-flex;
  background: #edf0f5;
  padding: 2px;
  border-radius: 7px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 5.5px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s;
}

.seg-btn:hover {
  color: var(--text-main);
}

.seg-btn.active {
  background: #ffffff;
  color: var(--text-main);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* KPI Strip */
.kpi-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-toolbar-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
}

.kpi-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kpi-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.kpi-edit-btn {
  opacity: 0;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.14s, color 0.14s, border-color 0.14s;
}

.kpi-card:hover .kpi-edit-btn {
  opacity: 1;
}

.kpi-edit-btn:hover {
  color: var(--primary);
  border-color: var(--primary-bright);
}

.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-icon {
  color: #64748b;
  display: inline-flex;
}

.kpi-val {
  font-size: 23px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 4px;
  background: #eaedf2;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* Cards & Panels */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: #fcfcfd;
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 16px;
}

/* GIS Map Container */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 286px;
  gap: 14px;
}

@media (max-width: 1150px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}

.map-wrap {
  position: relative;
  height: 556px;
  background: #0d1421;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
}

.map-wrap.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 35;
  border-radius: 0;
  border: none;
}

#gis-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#gis-canvas:active {
  cursor: grabbing;
}

.map-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  gap: 8px;
}

.map-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  pointer-events: auto;
  background: rgba(11, 16, 27, 0.78);
  backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  padding: 4px 9px;
  border-radius: 5.5px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}

.map-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.map-chip.active {
  background: #0284c7;
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
  font-weight: 600;
}

.map-draw-banner {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 17, 33, 0.92);
  backdrop-filter: blur(12px);
  color: #f8fafc;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  z-index: 12;
  box-shadow: var(--shadow-md);
}

.map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(11, 16, 27, 0.78);
  backdrop-filter: blur(12px);
  color: #d1d9e6;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  align-items: center;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.map-coords-box {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(11, 16, 27, 0.78);
  backdrop-filter: blur(12px);
  color: #cbd5e1;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.map-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(11, 16, 27, 0.94);
  backdrop-filter: blur(10px);
  color: #f8fafc;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11.5px;
  max-width: 265px;
  box-shadow: var(--shadow-md);
  z-index: 10;
  display: none;
}

.fs-layer-popover {
  position: absolute;
  top: 56px;
  right: 12px;
  width: 284px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
}

/* Layer panel beside map */
.layer-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-heading {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.layer-toggle {
  display: flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fafbfd;
  font-size: 12px;
  transition: border-color 0.12s, background 0.12s;
}

.layer-toggle:hover {
  background: #f1f5f9;
  border-color: var(--border-strong);
}

.layer-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  color: var(--text-main);
}

.layer-toggle input[type="checkbox"] {
  accent-color: var(--primary-bright);
}

/* Elevation Strip */
.elev-strip {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fafbfd;
  padding: 9px 12px 6px;
}

.elev-head {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.profile-svg {
  width: 100%;
  height: 114px;
  display: block;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.status-not_started { background: #f1f5f9; color: #475569; }
.status-in_progress { background: #e0f2fe; color: #0369a1; }
.status-completed   { background: #ecfdf5; color: #047857; }
.status-blocked     { background: #fef2f2; color: #b91c1c; }

.sev-high   { background: #fef2f2; color: #b91c1c; }
.sev-medium { background: #fffbeb; color: #b45309; }
.sev-low    { background: #e0f2fe; color: #0369a1; }

/* Tables & Matrices */
.table-wrap {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

table.data-table th {
  text-align: left;
  padding: 10px 11px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  white-space: nowrap;
}

table.data-table td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data-table tbody tr:hover td {
  background: #f8fafc;
}

.step-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.step-pill {
  border: 1px solid #e2e6ee;
  background: #ffffff;
  color: #526075;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.step-pill:hover {
  border-color: #93c5fd;
  color: var(--primary);
  background: #f8fbff;
}

.step-pill.done {
  background: #f0fdf6;
  border-color: #bbf7d0;
  color: #065f46;
  font-weight: 500;
}

.step-pill.partial {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* Batch Bar */
.batch-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 14px;
  background: #f6f8fc;
  border: 1px solid #dde4f0;
  border-radius: 8px;
}

/* Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 27, 0.36);
  backdrop-filter: blur(2px);
  z-index: 40;
  display: none;
}

.drawer-backdrop.open {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(600px, 96vw);
  height: 100vh;
  background: #fff;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 20px;
  background: #061121;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid #132847;
}

.drawer-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.drawer-tab {
  border: 1px solid var(--border-strong);
  background: #fafbfd;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.drawer-tab:hover {
  border-color: var(--primary-bright);
  color: var(--text-main);
}

.drawer-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.step-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fafbfd;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-card.done {
  background: #f4fbf7;
  border-color: #c6f0d6;
}

.step-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 27, 0.45);
  backdrop-filter: blur(2px);
  z-index: 60;
  display: none;
  place-items: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: min(500px, 100%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.modal-header {
  padding: 14px 18px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer {
  padding: 12px 18px;
  background: #fafbfd;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 22px;
  background: #061121;
  color: #f8fafc;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid #132847;
  font-size: 12px;
  box-shadow: var(--shadow-md);
  z-index: 80;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.edit-box {
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 12px 13px;
  background: #fafbfd;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.step-struct-row {
  display: grid;
  grid-template-columns: 1fr 68px auto;
  gap: 6px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #fff;
}

.icon-btn {
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-main);
  width: 24px;
  height: 24px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  padding: 0;
}

.icon-btn:hover {
  background: #e2e8f0;
}

.icon-btn.danger {
  color: #be123c;
  border-color: #fecdd3;
  background: #fff5f5;
}

.weight-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.weight-badge.ok {
  background: #ecfdf5;
  color: #065f46;
}

.weight-badge.warn {
  background: #fffbeb;
  color: #92400e;
}

/* Auth & Safety Controls (Option C) */
.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  white-space: nowrap;
}

.auth-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.auth-pill.reporter {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(56, 189, 248, 0.42);
  color: #7dd3fc;
}

.auth-pill.reporter .auth-dot {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.75);
}

.auth-pill.admin {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.auth-pill.admin .auth-dot {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}

.readonly-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 12px;
  line-height: 1.45;
}

.readonly-banner.locked {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 11px;
  font-weight: 600;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #f8fafc;
}

