/* ============================================================
   Vertice Host — Customer Dashboard
   Reuses base.css tokens; scoped under .dh / .ds / .dm prefixes
   ============================================================ */

:root {
  --ok: #3ecf8e;
  --warn: #d9a13b;
  --err: #e5484d;
  --info: #8b8b93;
  --accent: #818cf8;
  --accent-rgb: 129, 140, 248;
  --dh-h: 60px;
  --ds-w: 248px;
}

body.d-body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: clip;
}
body.d-no-scroll { overflow: hidden; }

/* ---------------- Top header ---------------- */
.dh {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--dh-h);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 clamp(0.9rem, 2vw, 1.5rem);
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.dh-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
  color: var(--text);
  text-decoration: none;
  font-size: 1.02rem;
  margin-right: auto;
}
.dh-brand img { width: 24px; height: 24px; object-fit: contain; }
.dh-brand span em {
  font-style: normal;
  color: var(--text-tertiary);
  font-size: 0.72rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  margin-left: 0.35rem;
}

.dh-nav { display: flex; align-items: center; gap: 0.25rem; margin-right: auto; }
.dh-nav a {
  position: relative;
  padding: 0.42rem 0.75rem;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.dh-nav a:hover { color: var(--text); background: var(--surface); }
.dh-nav a.is-active { color: var(--text); }
.dh-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0.75rem; right: 0.75rem; bottom: -1px;
  height: 2px;
  background: var(--text);
}

.dh-actions { display: flex; align-items: center; gap: 0.4rem; }

.d-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.d-icon-btn:hover { color: var(--text); background: var(--surface); border-color: var(--border); }
.d-icon-btn svg { width: 18px; height: 18px; }

.d-dot-badge {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--err);
  box-shadow: 0 0 0 2px var(--bg);
}

.dh-user {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.28rem 0.6rem 0.28rem 0.32rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--fs-small);
  font-family: inherit;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.dh-user:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.d-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2c2c31, #17171a);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.d-caret { width: 14px; height: 14px; opacity: 0.6; }

/* dropdown panels */
.d-menu {
  position: absolute;
  top: calc(var(--dh-h) - 8px);
  right: clamp(0.9rem, 2vw, 1.5rem);
  z-index: 320;
  min-width: 260px;
  max-width: min(320px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility 0s linear var(--dur-fast);
}
.d-menu.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.d-menu-head {
  padding: 0.7rem 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border-faint);
  margin-bottom: 0.4rem;
}
.d-menu-head strong { display: block; font-size: 0.92rem; color: var(--text); }
.d-menu-head span { font-size: 0.76rem; color: var(--text-tertiary); display: block; margin-top: 0.2rem; word-break: break-all; }
.d-menu button,
.d-menu a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.d-menu button:hover, .d-menu a:hover { background: var(--surface-strong); color: var(--text); }
.d-menu button svg, .d-menu a svg { width: 18px; height: 18px; opacity: 0.7; flex-shrink: 0; }
.d-menu-sep { height: 1px; background: var(--border-faint); margin: 0.4rem 0.3rem; }
.d-danger { color: var(--err) !important; }
.d-admin-link { color: var(--accent) !important; font-weight: 600 !important; }
.d-admin-link svg { opacity: 1 !important; }
.d-admin-link:hover { background: rgba(var(--accent-rgb, 129, 140, 248), 0.12) !important; color: var(--accent) !important; }
#notifMenu { right: clamp(3.2rem, 6vw, 5.5rem); }
#userMenu { right: clamp(0.9rem, 2vw, 1.5rem); }
.d-menu .d-notif-item { display: block; padding: 0.65rem 0.75rem; border-radius: var(--radius-sm); cursor: pointer; }
.d-menu .d-notif-item:hover { background: var(--surface-strong); }
.d-menu .d-notif-item strong { display: block; font-size: 0.88rem; font-weight: 500; color: var(--text); }
.d-menu .d-notif-item span { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 0.15rem; display: block; }

/* ---------------- Layout ---------------- */
.ds {
  position: fixed;
  top: var(--dh-h);
  left: 0;
  bottom: 0;
  width: var(--ds-w);
  z-index: 250;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem 0.85rem 2rem;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-strong) transparent;
  transition: width 240ms var(--ease-out), transform 240ms var(--ease-out);
}
body.d-collapsed .ds { width: 70px; }
body.d-collapsed .ds-label,
body.d-collapsed .ds-section { display: none; }
body.d-collapsed .ds-link,
body.d-collapsed .ds-back { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
body.d-collapsed .ds-link span,
body.d-collapsed .ds-back span { display: none; }

.ds-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--fs-small);
  margin-bottom: 2px;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.ds-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.65; }
.ds-link:hover { color: var(--text); background: var(--surface); }
.ds-link.is-active { color: var(--text); background: var(--surface-strong); }
.ds-link.is-active svg { opacity: 0.9; }
.ds-link .ds-count {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  background: var(--surface-strong);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}
.ds-section {
  margin: 1.15rem 0.7rem 0.4rem;
  font-size: 0.68rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.ds-back {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  padding: 0.45rem 0.55rem;
  width: 100%;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--fs-small);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}
.ds-back:hover { color: var(--text); background: var(--surface); }
.ds-back svg { width: 15px; height: 15px; }

.dm {
  margin-left: var(--ds-w);
  padding: calc(var(--dh-h) + 2rem) clamp(1.25rem, 3vw, 2.5rem) 4rem;
  max-width: 1560px;
  min-height: 100vh;
  transition: margin-left 240ms var(--ease-out);
}
body.d-collapsed .dm { margin-left: 70px; }

.verify-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  border-color: rgba(217, 161, 59, 0.45);
}
.verify-banner svg { width: 20px; height: 20px; color: var(--warn); flex-shrink: 0; }

/* drawer scrim */
.d-scrim {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease-out), visibility 0s linear var(--dur-fast);
}
.d-scrim.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }

/* ---------------- Generic UI ---------------- */
.d-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.d-page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1rem + 1.2vw, 2rem);
  font-weight: 700;
  letter-spacing: var(--tracking-heading);
  line-height: var(--leading-tight);
}
.d-page-head p { margin: 0.35rem 0 0; color: var(--text-tertiary); font-size: var(--fs-small); }
.d-head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.d-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.56rem 1rem;
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.d-btn svg { width: 15px; height: 15px; }
.d-btn-primary { background: var(--text); color: var(--bg); font-weight: 500; }
.d-btn-primary:hover { background: #e8e8ea; }
.d-btn-outline { background: none; color: var(--text); border-color: var(--border-strong); }
.d-btn-outline:hover { border-color: var(--text-tertiary); }
.d-btn-ghost { background: none; color: var(--text-secondary); }
.d-btn-ghost:hover { color: var(--text); background: var(--surface); }
.d-btn-danger { background: none; color: var(--err); border-color: rgba(229, 72, 77, 0.4); }
.d-btn-danger:hover { background: rgba(229, 72, 77, 0.08); border-color: var(--err); }
.d-btn-sm { padding: 0.38rem 0.7rem; font-size: 0.8rem; }
.d-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.card:hover { border-color: var(--border-strong); box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.card-pad { padding: clamp(1rem, 2vw, 1.35rem); }
.card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
}
.card-sub { margin: 0.2rem 0 0; font-size: 0.8rem; color: var(--text-tertiary); }

.grid { display: grid; gap: 1rem; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-servers { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }

/* status */
.st { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; font-weight: 500; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-ok { color: var(--ok); }
.st-off { color: var(--text-tertiary); }
.st-warn { color: var(--warn); }
.st-err { color: var(--err); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* meters */
.meter-row { display: grid; grid-template-columns: 86px 1fr auto; gap: 0.6rem; align-items: center; font-size: 0.78rem; }
.meter-row .m-label { color: var(--text-tertiary); }
.meter-row .m-val { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.meter {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--text-secondary);
  transition: width 400ms var(--ease-out);
}
.meter i.hot { background: var(--warn); }
.meter i.crit { background: var(--err); }

/* stat tiles */
.stat-tile { display: flex; flex-direction: column; gap: 0.55rem; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); }
.stat-value { font-family: var(--font-display); font-size: clamp(1.3rem, 1rem + 0.8vw, 1.65rem); font-weight: 600; letter-spacing: var(--tracking-heading); line-height: 1; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-foot { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 0.1rem; }
.stat-spark { margin-top: 0.25rem; }
.stat-spark svg { display: block; width: 100%; height: 34px; }

/* server card */
.srv-card { display: flex; flex-direction: column; gap: 0.95rem; }
.srv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.srv-name { margin: 0; font-size: 1.02rem; font-weight: 600; letter-spacing: var(--tracking-heading); }
.srv-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.srv-ip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  padding: 0.32rem 0.55rem;
}
.srv-ip button {
  border: 0; background: none; color: var(--text-tertiary); cursor: pointer;
  display: inline-flex; padding: 0;
  transition: color var(--dur-fast) var(--ease-out);
}
.srv-ip button:hover { color: var(--text); }
.srv-ip svg { width: 13px; height: 13px; }
.srv-facts { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; font-size: 0.78rem; color: var(--text-tertiary); }
.srv-facts strong { color: var(--text-secondary); font-weight: 500; }
.srv-meters { display: grid; gap: 0.45rem; }
.srv-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.1rem; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--border-faint); color: var(--text-secondary); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.tbl td strong, .tbl td .mono { color: var(--text); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.8em; }

.row-actions { display: flex; gap: 0.3rem; justify-content: flex-end; }

/* Panel access card (Services page) */
.pa-card .pa-row { display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border-faint); }
.pa-card .pa-row:last-child { border-bottom: 0; }
.pa-card .pa-label { width: 88px; flex: none; font-size: 0.7rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }
.pa-card code { flex: 1; min-width: 0; font-family: Menlo, Consolas, monospace; font-size: 0.85rem; color: var(--text); word-break: break-all; background: var(--surface); border: 1px solid var(--border-faint); border-radius: 6px; padding: 0.3rem 0.6rem; }
.pa-card .d-btn-ghost { padding: 0.25rem 0.55rem; font-size: 0.68rem; border-radius: 6px; flex: none; }
.pa-card .pa-pass { letter-spacing: 0.12em; }
.icon-act {
  border: 0;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.icon-act:hover { color: var(--text); background: var(--surface-strong); }
.icon-act.danger:hover { color: var(--err); }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 34px; height: 19px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  transition: background-color var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.switch i::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.switch input:checked + i { background: var(--text); border-color: var(--text); }
.switch input:checked + i::before { transform: translateX(15px); background: var(--bg); }

/* forms */
.field { display: grid; gap: 0.4rem; margin-bottom: 0.9rem; }
.field label { font-size: 0.74rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: var(--fs-small);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.75rem;
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.field .hint { font-size: 0.75rem; color: var(--text-tertiary); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border-faint); }
.check-row:last-child { border-bottom: 0; }
.check-row .cr-text strong { display: block; font-size: var(--fs-small); font-weight: 500; color: var(--text); }
.check-row .cr-text span { font-size: 0.78rem; color: var(--text-tertiary); }
input[type="range"].slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-strong);
  border-radius: 999px;
  outline: none;
}
input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--bg-raised);
  cursor: pointer;
}
input[type="checkbox"].chk { accent-color: var(--text); width: 15px; height: 15px; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button {
  border: 0;
  background: none;
  color: var(--text-tertiary);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.36rem 0.75rem;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--surface-strong); color: var(--text); }

/* tabs (server mgmt subnav lives in sidebar; settings tabs here) */
.tabs { display: flex; gap: 0.15rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs button {
  border: 0;
  background: none;
  color: var(--text-tertiary);
  font: inherit;
  font-size: var(--fs-small);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.tabs button:hover { color: var(--text); }
.tabs button.is-active { color: var(--text); border-bottom-color: var(--text); }

/* chart */
.chart-block { display: grid; gap: 0.9rem; }
.chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; }
.chart-svg { display: block; width: 100%; height: 190px; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.75rem; color: var(--text-tertiary); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-secondary); margin-right: 0.35rem; }
.live-pill { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.74rem; color: var(--ok); }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: d-pulse 1.6s infinite; }
@keyframes d-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* console */
.console {
  background: #08080a;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}
.console-bar span { font-size: 0.76rem; color: var(--text-tertiary); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.console-out {
  height: 380px;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.79rem;
  line-height: 1.62;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-strong) transparent;
}
.console-out .ln { white-space: pre-wrap; word-break: break-word; color: var(--text-secondary); }
.console-out .ln time { color: var(--text-tertiary); margin-right: 0.6em; }
.console-out .ln.info { color: var(--text-secondary); }
.console-out .ln.ok { color: var(--ok); }
.console-out .ln.warn { color: var(--warn); }
.console-out .ln.err { color: var(--err); }
.console-in {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
}
.console-in input {
  flex: 1;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.83rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
}
.console-in input:focus { outline: none; border-color: var(--border-strong); }

/* power row */
.power-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* file manager */
.fm-toolbar { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-bottom: 0.85rem; }
.fm-crumb { display: flex; align-items: center; gap: 0.15rem; font-size: 0.85rem; color: var(--text-tertiary); flex-wrap: wrap; }
.fm-crumb button { border: 0; background: none; color: var(--text-secondary); font: inherit; font-size: 0.85rem; cursor: pointer; padding: 0.15rem 0.3rem; border-radius: var(--radius-sm); }
.fm-crumb button:hover { color: var(--text); background: var(--surface); }
.fm-drop {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: 0.85rem;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.fm-drop.is-over { border-color: var(--text-secondary); color: var(--text); background: var(--surface); }
.fm-editor textarea {
  width: 100%;
  min-height: 320px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text);
  background: #0a0a0c;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  resize: vertical;
}
.fm-editor textarea:focus { outline: none; border-color: var(--border-strong); }

/* progress */
.progress { height: 6px; border-radius: 999px; background: var(--surface-strong); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--text); border-radius: 999px; transition: width 250ms var(--ease-out); }

/* key-value info list */
.kv { display: grid; gap: 0; font-size: var(--fs-small); }
.kv > div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border-faint); }
.kv > div:last-child { border-bottom: 0; }
.kv .k { color: var(--text-tertiary); }
.kv .v { color: var(--text); text-align: right; word-break: break-all; }

/* empty state */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-tertiary);
}
.empty svg { width: 30px; height: 30px; opacity: 0.4; margin-bottom: 0.6rem; }
.empty p { margin: 0; font-size: var(--fs-small); }
.empty .d-btn { margin-top: 0.9rem; }

/* skeleton */
.skel {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-strong) 45%, var(--surface) 65%);
  background-size: 240% 100%;
  animation: d-shimmer 1.3s infinite linear;
}
@keyframes d-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.skel-line { height: 12px; margin-bottom: 0.7rem; }

/* modal */
.d-modal-root {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.d-modal-root.is-open { display: flex; }
.d-modal {
  width: 100%;
  max-width: 480px;
  max-height: min(86vh, 720px);
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  animation: d-pop 180ms var(--ease-out);
}
.d-modal.wide { max-width: 640px; }
@keyframes d-pop { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.d-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem 0; }
.d-modal-head h3 { margin: 0; font-size: 1.02rem; letter-spacing: var(--tracking-heading); }
.d-modal-body { padding: 1.1rem 1.25rem 1.25rem; }
.d-modal-foot { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0 1.25rem 1.25rem; }

/* toast */
.d-toasts {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
}
.d-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  color: var(--text);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  animation: d-toast-in 200ms var(--ease-out);
}
.d-toast.ok { border-left-color: var(--ok); }
.d-toast.err { border-left-color: var(--err); }
.d-toast.warn { border-left-color: var(--warn); }
@keyframes d-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.d-toast.hide { opacity: 0; transform: translateY(6px); transition: all 250ms var(--ease-out); }

/* quick actions */
.qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.7rem; }
.qa {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.9rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform 120ms var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.qa svg { width: 18px; height: 18px; opacity: 0.7; }
.qa:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* version cards */
.ver-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.7rem; }
.ver-card {
  position: relative;
  padding: 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font: inherit;
  color: var(--text-secondary);
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.ver-card:hover { border-color: var(--border-strong); }
.ver-card.is-active { border-color: var(--text); color: var(--text); }
.ver-card.is-active::after {
  content: "";
  position: absolute;
  top: 10px; right: 10px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text);
}
.ver-card strong { display: block; font-size: 0.92rem; color: inherit; }
.ver-card span { font-size: 0.75rem; color: var(--text-tertiary); }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 0.85rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border-faint); font-size: var(--fs-small); }
.feed li:last-child { border-bottom: 0; }
.feed .f-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-tertiary); margin-top: 6px; flex-shrink: 0; }
.feed .f-text { color: var(--text-secondary); }
.feed .f-text strong { color: var(--text); font-weight: 500; }
.feed time { margin-left: auto; color: var(--text-tertiary); font-size: 0.75rem; white-space: nowrap; }

/* responsive */
@media (max-width: 1024px) {
  :root { --ds-w: 232px; }
  .dh-nav { display: none; }
  .ds {
    transform: translateX(-105%);
    transition: transform 260ms var(--ease-out);
    box-shadow: none;
  }
  body.d-drawer .ds {
    transform: none;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
  }
  body.d-collapsed .ds { width: var(--ds-w); }
  body.d-collapsed .ds-label, body.d-collapsed .ds-section { display: block; }
  body.d-collapsed .ds-link, body.d-collapsed .ds-back { justify-content: flex-start; gap: 0.7rem; padding: 0.52rem 0.7rem; }
  body.d-collapsed .ds-link span, body.d-collapsed .ds-back span { display: inline; }
  .dm { margin-left: 0 !important; }
}

@media (max-width: 560px) {
  .dh-brand span em { display: none; }
  .dh-user .dh-uname { display: none; }
  .d-menu { min-width: 220px; max-width: calc(100vw - 1.5rem); }
  #notifMenu { right: 0.9rem; }
  .console-out { height: 300px; }
  .meter-row { grid-template-columns: 64px 1fr auto; }
  .page-pad { padding: 0.25rem !important; }
  .d-btn { padding: 0.48rem 0.8rem; font-size: 0.8rem; }
  .tbl { font-size: 0.8rem; }
}

@media (min-width: 1800px) {
  .dm { max-width: 1640px; }
}
