/* ================================================================
   settings.css — tabbed settings panel + dashboard charts
   ================================================================ */

/* ── Two-column layout ──────────────────────────────────────────── */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sp-lg);
  align-items: start;
}

/* ── Sidebar tab nav ─────────────────────────────────────────────── */
.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  position: sticky;
  top: calc(var(--header-h) + var(--sp-md));
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem .85rem;
  border-radius: var(--r-md);
  color: var(--muted);
  font-weight: 500;
  font-size: .875rem;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--body-font);
  width: 100%;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.settings-tab:hover        { background: var(--panel-alt); color: var(--ink); text-decoration: none; }
.settings-tab.active       { background: var(--primary); color: #fff; }
.settings-tab i            { font-size: 1.05rem; flex-shrink: 0; color: var(--primary); }
.settings-tab:hover  i     { color: var(--primary); }
.settings-tab.active i     { color: #fff; }

/* ── Charts ─────────────────────────────────────────────────────── */
.chart { width: 100%; }
.chart-bar   { fill: var(--primary); transition: fill .15s; }
.chart-bar:hover { fill: var(--accent); }
.chart-label { font-size: 11px; fill: var(--muted); }
.chart-value { font-size: 11px; fill: var(--dark); font-weight: 600; }

/* ── System health list ──────────────────────────────────────────── */
.health-list { display: flex; flex-direction: column; gap: .4rem; }
.health-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: .9rem;
}
.health-item .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.health-item.ok   .dot { background: var(--success); }
.health-item.warn .dot { background: var(--warning); }
.health-item.fail .dot { background: var(--danger); }

/* ── Tablet: 769 – 1024 px ───────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .settings-layout { grid-template-columns: 176px 1fr; gap: var(--sp-md); }
  .settings-tab    { font-size: .82rem; padding: .55rem .7rem; gap: .4rem; }
  .settings-tab i  { font-size: .95rem; }
}

/* ── Mobile: ≤ 768 px ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .settings-layout { grid-template-columns: 1fr; gap: var(--sp-md); }

  /* Horizontal scroll strip */
  .settings-tabs {
    flex-direction: row;
    overflow-x: auto;
    position: static;
    gap: .25rem;
    padding-bottom: .3rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .settings-tabs::-webkit-scrollbar { display: none; }

  /* Each tab: icon stacked above label */
  .settings-tab {
    flex-direction: column;
    flex-shrink: 0;
    min-width: 60px;
    padding: .5rem .65rem;
    font-size: .7rem;
    gap: .2rem;
    text-align: center;
    white-space: nowrap;
    border-radius: var(--r-md);
  }
  .settings-tab i { font-size: 1.25rem; }

  /* Tighten panel padding */
  .settings-content .panel { padding: var(--sp-md); }
}

/* ── Small mobile: ≤ 480 px ──────────────────────────────────────── */
@media (max-width: 480px) {
  .settings-tab              { min-width: 46px; padding: .45rem .5rem; }
  .settings-tab .tab-label   { display: none; }
}
