/* Operations dashboard — shell, sidebar, KPIs, tables */

body.dash-body {
  margin: 0;
  min-height: 100vh;
  background: #e8f0f6;
  background-image:
    radial-gradient(ellipse 100% 60% at 0% 0%, rgba(30, 167, 138, 0.12), transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 20%, rgba(72, 120, 180, 0.1), transparent 45%);
}

.dash-app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.dash-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 1.35rem 1rem;
  border-right: 1px solid rgba(24, 58, 82, 0.1);
  background: linear-gradient(180deg, #0f2a3d 0%, #163a52 55%, #1a4560 100%);
  color: #e8f4fc;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 4px 0 24px rgba(15, 42, 61, 0.15);
}

.dash-brand {
  padding: 0.35rem 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-brand-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #7ee4c8;
  font-weight: 600;
}

.dash-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.dash-nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: rgba(232, 244, 252, 0.88);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.dash-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.dash-nav a.active {
  background: linear-gradient(135deg, rgba(30, 167, 138, 0.35), rgba(30, 167, 138, 0.12));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(126, 228, 200, 0.35);
}

.dash-nav-icon {
  width: 1.25rem;
  text-align: center;
  opacity: 0.85;
  font-size: 0.95rem;
}

.dash-sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  color: rgba(232, 244, 252, 0.55);
  line-height: 1.45;
}

.dash-sidebar-footer a {
  color: #9ed9ff;
}

.dash-main {
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 2.5rem;
  min-width: 0;
}

.dash-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dash-topbar h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.dash-topbar-sub {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 52ch;
}

.dash-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(30, 87, 129, 0.14);
  color: var(--muted);
}

.dash-meta-pill.ok {
  border-color: rgba(30, 167, 138, 0.35);
  color: var(--accent-dim);
}

.dash-filter-card {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(30, 87, 129, 0.12);
  box-shadow: var(--shadow);
}

.dash-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}

.dash-filter-grid label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-filter-grid input,
.dash-filter-grid select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(30, 87, 129, 0.2);
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
}

.dash-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  grid-column: 1 / -1;
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(30, 87, 129, 0.08);
}

.dash-filter-actions button.secondary {
  background: #f4f9fc;
}

button.dash-export {
  background: linear-gradient(165deg, #4a8fd4, #2d6a9f);
  box-shadow: 0 6px 16px rgba(45, 106, 159, 0.25);
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.dash-kpi {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid rgba(30, 87, 129, 0.1);
  box-shadow: 0 8px 20px rgba(24, 58, 82, 0.06);
  position: relative;
  overflow: hidden;
}

.dash-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  opacity: 0.85;
}

.dash-kpi.warn::before {
  background: var(--warning);
}

.dash-kpi.danger::before {
  background: var(--danger);
}

.dash-kpi-label {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.dash-kpi-value {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.dash-kpi-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.dash-panel {
  margin-bottom: 1.1rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid rgba(30, 87, 129, 0.1);
  box-shadow: 0 8px 22px rgba(24, 58, 82, 0.05);
}

.dash-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.dash-panel-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-panel-count {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.dash-table th,
.dash-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(30, 87, 129, 0.08);
  text-align: left;
  vertical-align: top;
}

.dash-table th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: rgba(248, 252, 255, 0.9);
}

.dash-table tbody tr:hover {
  background: rgba(30, 167, 138, 0.05);
}

.dash-table .mono {
  font-family: var(--mono);
  font-size: 0.76rem;
  word-break: break-all;
}

.dash-table .num {
  font-variant-numeric: tabular-nums;
  color: var(--accent-dim);
  font-weight: 600;
}

.dash-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: lowercase;
}

.dash-badge.ok {
  background: rgba(30, 167, 138, 0.15);
  color: var(--accent-dim);
}

.dash-badge.warn {
  background: rgba(181, 138, 16, 0.15);
  color: #8a6910;
}

.dash-badge.err {
  background: rgba(200, 87, 87, 0.15);
  color: #a33;
}

.dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dash-session-card {
  margin-bottom: 1.1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(30, 167, 138, 0.35);
  background: linear-gradient(135deg, rgba(30, 167, 138, 0.08), rgba(255, 255, 255, 0.9));
}

.dash-session-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.86rem;
}

.dash-session-card dt {
  color: var(--muted);
  font-weight: 600;
}

.dash-session-card dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.dash-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.dash-loading {
  opacity: 0.55;
  pointer-events: none;
}

.dash-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: #0f2a3d;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 12px 32px rgba(15, 42, 61, 0.35);
  animation: dash-toast-in 0.25s ease-out;
}

@keyframes dash-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .dash-app {
    grid-template-columns: 1fr;
  }

  .dash-sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .dash-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dash-sidebar-footer {
    width: 100%;
  }

  .dash-split {
    grid-template-columns: 1fr;
  }
}
