/* Cable Network Distance Analysis — Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary:       #0F172A;
  --accent:        #2563EB;
  --accent-muted:  #EFF6FF;
  --danger:        #DC2626;
  --danger-muted:  #FEF2F2;
  --success:       #059669;
  --success-muted: #ECFDF5;
  --warning:       #D97706;
  --warning-muted: #FFFBEB;
  --bg:            #F8FAFC;
  --surface:       #FFFFFF;
  --text:          #0F172A;
  --text-muted:    #64748B;
  --border:        #E2E8F0;
  --radius:        10px;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.05);
  --shadow:        0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --sidebar-w:     220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Left navigation sidebar ──────────────────────── */
.nav-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #0F172A;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  user-select: none;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-brand-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.nav-brand-text {
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.nav-menu {
  list-style: none;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,.48);
  cursor: pointer;
  font-size: .84rem;
  font-weight: 500;
  font-family: inherit;
  transition: background .15s, color .15s;
  text-align: left;
}
.nav-item:hover  { background: rgba(255,255,255,.07); color: rgba(255,255,255,.82); }
.nav-item.active { background: rgba(37,99,235,.28); color: #fff; }

.nav-icon { display: flex; align-items: center; flex-shrink: 0; }
.nav-label { flex: 1; }

/* ── Main content area ────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.tab-panel { display: none; flex: 1; }
.tab-panel.active { display: flex; flex-direction: column; }

/* ── Page header ──────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 0;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.02em;
}
.page-subtitle {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.page-header-actions { display: flex; gap: 8px; align-items: center; }

.content-body { padding: 18px 28px 28px; flex: 1; }

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   CARDS
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-flat {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -.01em;
  margin-bottom: 4px;
}
.card-hint {
  font-size: .79rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.card-hint code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .78rem;
}

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   BUTTONS
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
.btn {
  padding: 8px 15px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: .83rem;
  font-weight: 600;
  font-family: inherit;
  transition: opacity .15s, box-shadow .15s, transform .1s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.4;
}
.btn:hover   { opacity: .88; }
.btn:active  { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary  { background: var(--accent);  color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.25); }
.btn-success  { background: var(--success); color: #fff; box-shadow: 0 1px 2px rgba(5,150,105,.25); }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-outline  { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover  { background: var(--bg); color: var(--text); opacity: 1; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }

.btn-sm { padding: 5px 10px; font-size: .77rem; }
.btn-lg { padding: 10px 20px; font-size: .9rem; }

.nav-address-row { display: flex; gap: 8px; margin-bottom: 8px; }
.nav-address-row .btn { flex: 1; justify-content: center; }

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   FORM ELEMENTS
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
input[type="text"],
select {
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 7px 11px;
  font-size: .84rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: var(--surface);
  color: var(--text);
}
input[type="text"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.select-input { min-width: 200px; flex: 1; }

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.file-input {
  flex: 1;
  min-width: 0;
  border: 1.5px dashed var(--border);
  border-radius: 7px;
  padding: 7px 12px;
  font-size: .82rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s;
}
.file-input:hover { border-color: var(--accent); }
.file-input:focus { outline: none; border-color: var(--accent); }

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   BADGES
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.badge-red   { background: var(--danger-muted);  color: var(--danger); }
.badge-green { background: var(--success-muted); color: var(--success); }
.badge-blue  { background: var(--accent-muted);  color: var(--accent); }
.badge-grey  { background: #F1F5F9; color: var(--text-muted); }

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   TABLES
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
thead th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 9px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #F8FAFC; }
tbody td { padding: 9px 12px; }

tbody tr.flagged  > td { background: var(--danger-muted); }
tbody tr.verified > td { background: var(--success-muted); }
tbody tr.pending  > td { color: var(--text-muted); font-style: italic; }
tbody tr[data-address-index] { cursor: pointer; }
tbody tr[data-address-index]:hover > td { filter: brightness(.97); }

/* \u2500\u2500 Editable table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
.edit-table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 6px;
  gap: 8px;
  flex-wrap: wrap;
}
.edit-table-count  { font-size: .77rem; color: var(--text-muted); }
.edit-table-actions { display: flex; gap: 6px; }

.cell-input {
  width: 100%;
  min-width: 60px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: .81rem;
  background: transparent;
  font-family: inherit;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.cell-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(37,99,235,.08);
}
tbody tr:hover .cell-input { border-color: var(--border); }

.btn-del-row {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  opacity: .45;
  transition: opacity .15s, background .15s;
}
.btn-del-row:hover { opacity: 1; background: var(--danger-muted); }

[id^="editTable_"] td { padding: 3px 6px; }

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   DATA INPUT TAB
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.proceed-row { display: flex; justify-content: flex-end; padding-top: 4px; }

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   PHOTO VIEW
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
/* Photo View panel must fill the shell height */
#panel-photo.tab-panel.active { display: flex; flex-direction: column; overflow: hidden; height: 100%; }

.photo-layout {
  display: grid;
  grid-template-columns: 1fr 270px;
  flex: 1;
  overflow: hidden;
}
@media (max-width: 960px) {
  .photo-layout { grid-template-columns: 1fr; overflow: auto; }
}

.map-section {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
  position: relative;
}

.map-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

#map {
  flex: 1;
  min-height: 280px;
  background: #dde8f0;
  position: relative;
}

.map-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255,255,255,0.93);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.74rem;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  min-width: 170px;
}
.map-legend-title {
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--text);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
  color: var(--text-muted);
}
.map-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,0.18);
}
.map-legend.hidden { display: none !important; }

/* Map loading overlay */
.map-loader {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.map-loader.hidden { display: none !important; }
.map-loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.map-loader-text {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.results-section {
  flex-shrink: 0;
  max-height: 230px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

/* \u2500\u2500 Photo sidebar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
.photo-sidebar {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-section { padding: 13px 14px; }
.sidebar-divider  { height: 1px; background: var(--border); flex-shrink: 0; }

.sidebar-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.sidebar-value {
  font-size: .86rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.sidebar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .79rem;
}
.sidebar-meta-label { color: var(--text-muted); }
.sidebar-meta-value { font-weight: 600; color: var(--primary); font-family: monospace; font-size: .77rem; }

.pin-badge {
  font-size: 0.7rem;
  color: var(--success);
  cursor: pointer;
  margin-left: 6px;
  white-space: nowrap;
}
.pin-badge:hover { text-decoration: underline; }

.coord-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 8px;
}
.coord-dot {
  width: 21px; height: 21px;
  border-radius: 50%;
  font-size: .68rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  color: #fff;
}
.coord-dot--x { background: #7C3AED; }
.coord-dot--y { background: var(--accent); }
.coord-dot--z { background: var(--success); }
.coord-name { font-size: .73rem; color: var(--text-muted); }
.coord-val  { font-size: .76rem; font-family: monospace; color: var(--primary); font-weight: 600; }

/* ── Line Analysis section highlight ───────────────────────────── */
.sidebar-section--analysis {
  background: rgba(37,99,235,.05);
  border: 1px solid rgba(37,99,235,.15);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 -2px;
}
.sidebar-section--analysis .sidebar-section-label {
  font-size: .72rem;
  color: var(--accent);
  letter-spacing: .09em;
}

.distance-block { display: flex; align-items: baseline; gap: 8px; padding: 6px 0 4px; }
.distance-value {
  font-size: 2.7rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.distance-value.flagged { color: var(--danger); }
.distance-value.ok      { color: var(--success); }
.distance-unit {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}

.layers-list { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.layers-list li {
  font-size: .86rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  background: color-mix(in srgb, var(--layer-color, #f59e0b) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--layer-color, #f59e0b) 35%, transparent);
}
.layers-list li::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--layer-color, #f59e0b);
  flex-shrink: 0;
}

.sidebar-actions {
  padding: 12px 14px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sidebar-actions .btn { justify-content: center; }

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   ANALYSE TAB
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-box {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px 16px 14px;
}
.stat-box--success { border-left-color: var(--success); }
.stat-box--danger  { border-left-color: var(--danger); }
.stat-box--warning { border-left-color: var(--warning); }

.stat-box .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.stat-box .stat-label {
  font-size: .76rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-box--success .stat-value { color: var(--success); }
.stat-box--danger  .stat-value { color: var(--danger); }
.stat-box--warning .stat-value { color: var(--warning); }

.analyse-headline {
  padding: 6px 0 18px;
  font-size: .86rem;
  color: var(--text-muted);
}
.analyse-actions { display: flex; gap: 10px; margin-top: 20px; }

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   SPINNER + TOAST
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: .83rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 9999;
  max-width: 340px;
  display: none;
  border: 1px solid transparent;
  align-items: center;
  gap: 8px;
}
#toast:not(.hidden) { display: flex; }
.toast--info    { background: var(--primary); color: #fff; }
.toast--success { background: var(--success-muted); color: var(--success); border-color: #A7F3D0; }
.toast--error   { background: var(--danger-muted);  color: var(--danger);  border-color: #FECACA; }
.toast--warning { background: var(--warning-muted); color: var(--warning); border-color: #FDE68A; }
.toast.hidden   { display: none !important; }
