/* ============================================================
   MoradoSolution — Customer Dashboard
   Black & white flat theme (no gloss, no color glows)
   Reuses base.css tokens; scoped under .dh / .ds / .dm prefixes
   ============================================================ */

:root {
  --ok: #f4f4f5;
  --warn: #b4b4b8;
  --err: #f4f4f5;
  --info: #d4d4d8;
  --accent: #ffffff;
  --accent-rgb: 255, 255, 255;

  --panel: #0d0d0e;
  --panel-strong: #141416;
  --panel-soft: rgba(255, 255, 255, 0.03);
  --edge: rgba(255, 255, 255, 0.08);
  --edge-strong: rgba(255, 255, 255, 0.16);
  --edge-faint: rgba(255, 255, 255, 0.05);

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

  --dh-h: 62px;
  --ds-w: 252px;
}

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

body.d-body ::-webkit-scrollbar { width: 10px; height: 10px; }
body.d-body ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; border: 3px solid var(--bg); }
body.d-body ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }
::selection { background: var(--text); color: var(--bg); }

/* ---------------- 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(9, 9, 11, 0.92);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--edge);
}

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

.d-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  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(--panel-soft); border-color: var(--edge); }
.d-icon-btn svg { width: 18px; height: 18px; }

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

.dh-user {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.26rem 0.6rem 0.26rem 0.3rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--panel-soft);
  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(--edge-strong); color: var(--text); background: var(--panel-soft); }
.d-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--panel-strong);
  border: 1px solid var(--edge-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: 264px;
  max-width: min(320px, calc(100vw - 2rem));
  background: var(--panel-strong);
  border: 1px solid var(--edge-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  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(--edge);
  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: 9px;
  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(--panel-soft); 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(--edge); margin: 0.4rem 0.3rem; }
.d-danger { color: var(--text) !important; }
.d-admin-link { color: var(--text) !important; font-weight: 600 !important; }
.d-admin-link svg { opacity: 1 !important; }
.d-admin-link:hover { background: var(--panel-soft) !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: 9px; cursor: pointer; }
.d-menu .d-notif-item:hover { background: var(--panel-soft); }
.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; }

/* ---------------- Sidebar ---------------- */
.ds {
  position: fixed;
  top: var(--dh-h);
  left: 0;
  bottom: 0;
  width: var(--ds-w);
  z-index: 250;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.85rem 1.25rem;
  background: var(--bg-raised);
  border-right: 1px solid var(--edge);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-strong) transparent;
  transition: width 240ms var(--ease-out), transform 240ms var(--ease-out);
}

.ds-scroll { flex: 1; min-height: 0; }

body.d-collapsed .ds { width: 72px; }
body.d-collapsed .ds-foot,
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; }
body.d-collapsed .ds-link .ds-count { display: none; }

.ds-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.72rem;
  border-radius: 9px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--fs-small);
  margin-bottom: 3px;
  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.7; }
.ds-link:hover { color: var(--text); background: var(--panel-soft); }
.ds-link.is-active { background: var(--text); color: var(--bg); }
.ds-link.is-active svg { opacity: 1; color: var(--bg); }
.ds-link.is-active::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 999px;
  background: var(--text);
}
.ds-link .ds-count {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-variant-numeric: tabular-nums;
}
.ds-link.is-active .ds-count { color: var(--bg); background: rgba(0, 0, 0, 0.12); border-color: transparent; }
.ds-section {
  margin: 1.15rem 0.72rem 0.45rem;
  font-size: 0.66rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.ds-label { font-size: 0.66rem; 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: 9px;
  cursor: pointer;
  text-align: left;
}
.ds-back:hover { color: var(--text); background: var(--panel-soft); }
.ds-back svg { width: 15px; height: 15px; }

.ds-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding: 0.7rem 0.55rem 0;
  border-top: 1px solid var(--edge);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-foot svg { width: 14px; height: 14px; color: var(--text); flex-shrink: 0; }

/* ---------------- Main layout ---------------- */
.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: 72px; }

.verify-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  border-color: var(--edge-strong);
  background: var(--panel);
}
.verify-banner svg { width: 20px; height: 20px; color: var(--text); flex-shrink: 0; }

/* drawer scrim */
.d-scrim {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(0, 0, 0, 0.6);
  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);
  color: var(--text);
}
.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 1.05rem;
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 500;
  border-radius: 9px;
  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(--edge-strong); }
.d-btn-outline:hover { border-color: var(--text-tertiary); background: var(--panel-soft); }
.d-btn-ghost { background: none; color: var(--text-secondary); }
.d-btn-ghost:hover { color: var(--text); background: var(--panel-soft); }
.d-btn-danger { background: none; color: var(--err); border-color: var(--edge-strong); }
.d-btn-danger:hover { background: var(--panel-soft); border-color: var(--text); }
.d-btn-sm { padding: 0.38rem 0.75rem; font-size: 0.8rem; border-radius: 8px; }
.d-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* cards */
.card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.card:hover { border-color: var(--edge-strong); box-shadow: var(--shadow); }
.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); }

/* ---- Overview page redesign ---- */
.ov-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ov-stat {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: border-color 0.2s, transform 0.2s;
}
.ov-stat:hover { border-color: var(--edge-strong); transform: translateY(-1px); }
.ov-stat-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ov-stat-icon svg { width: 18px; height: 18px; }
.ov-stat-body { display: flex; flex-direction: column; gap: 0.1rem; }
.ov-stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.ov-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.ov-stat-foot {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  padding-top: 0.5rem;
  border-top: 1px solid var(--edge-faint);
}
.ov-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.ov-card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
}
.ov-card-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.ov-card-empty h3 { margin: 0.8rem 0 0.3rem; font-size: 1rem; color: var(--text); }
.ov-card-empty p { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.ov-empty-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--edge);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ov-empty-icon svg { width: 24px; height: 24px; color: var(--text-muted); }
.ov-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.ov-card-head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.ov-card-head a {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.ov-card-head a:hover { color: var(--text); }
.ov-renewals { display: flex; flex-direction: column; }
.ov-renewal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--edge-faint);
}
.ov-renewal:last-child { border-bottom: 0; }
.ov-renewal-name { font-weight: 500; font-size: 0.88rem; color: var(--text); display: block; }
.ov-renewal-meta { font-size: 0.72rem; color: var(--text-muted); }
.ov-renewal-right { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.ov-renewal-date { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }
.ov-qa {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.ov-spend-total {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255,255,255,.04);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}
.ov-chart-range {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.ov-empty-inline {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.ov-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ov-feed li {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--edge-faint);
  align-items: flex-start;
}
.ov-feed li:last-child { border-bottom: 0; }
.ov-feed-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.35rem;
}
.ov-feed-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.ov-feed-body time {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}
.ov-verify {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(234,179,8,.06);
  border: 1px solid rgba(234,179,8,.15);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}
.ov-verify-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(234,179,8,.1);
  color: #eab308;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ov-verify-icon svg { width: 18px; height: 18px; }
.ov-verify-text { flex: 1; }
.ov-verify-text strong { font-size: 0.88rem; color: var(--text); }
.ov-verify-text p { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--text-muted); }
@media (max-width: 900px) {
  .ov-stats { grid-template-columns: repeat(2, 1fr); }
  .ov-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .ov-stats { grid-template-columns: 1fr; }
  .ov-verify { flex-wrap: wrap; }
  .ov-qa { grid-template-columns: 1fr; }
}

.grid { display: grid; gap: 1rem; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 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(--edge-strong);
  color: var(--text-secondary);
  background: var(--panel-soft);
  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: 6px;
  border-radius: 999px;
  background: var(--panel-soft);
  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.35rem, 1rem + 0.8vw, 1.7rem);
  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; }
.stat-ic {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--edge);
  color: var(--text-secondary);
}
.stat-ic svg { width: 18px; height: 18px; }
.stat-tile.hero { background: var(--text); border-color: transparent; }
.stat-tile.hero:hover { border-color: transparent; }
.stat-tile.hero .stat-label { color: rgba(0, 0, 0, 0.6); }
.stat-tile.hero .stat-value { color: var(--bg); }
.stat-tile.hero .stat-foot { color: rgba(0, 0, 0, 0.55); }
.stat-tile.hero .stat-ic { background: rgba(0, 0, 0, 0.08); border-color: rgba(0, 0, 0, 0.15); color: var(--bg); }

/* server card — sexy premium B&W */
.srv-card { display: flex; flex-direction: column; gap: 1.1rem; background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 1.25rem 1.35rem; transition: border-color .2s, transform .2s, box-shadow .2s; }
.srv-card:hover { border-color: var(--edge-strong); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.srv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.srv-name { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.srv-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.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);
  background: #09090b;
  border: 1px solid var(--edge-strong);
  border-radius: 8px;
  padding: 0.36rem 0.65rem;
}
.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.65rem 0.75rem;
  border-bottom: 1px solid var(--edge);
  white-space: nowrap;
  background: var(--panel-soft);
}
.tbl td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--edge-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: var(--panel-soft); }
.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 */
.pa-card .pa-row { display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0; border-bottom: 1px solid var(--edge-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(--panel-soft); border: 1px solid var(--edge-faint); border-radius: 7px; 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: 7px;
  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(--panel-soft); }
.icon-act.danger:hover { color: var(--text); }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--edge-strong);
  transition: background-color var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.switch i::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  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(16px); 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(--panel-soft);
  border: 1px solid var(--edge);
  border-radius: 9px;
  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(--edge-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(--edge-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(--panel-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);
  cursor: pointer;
}
input[type="checkbox"].chk { accent-color: var(--text); width: 15px; height: 15px; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--edge-strong); border-radius: 9px; overflow: hidden; background: var(--panel-soft); }
.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(--edge); }
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--text); color: var(--bg); }

/* tabs */
.tabs { display: flex; gap: 0.15rem; border-bottom: 1px solid var(--edge); 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;
  border-radius: 8px 8px 0 0;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.tabs button:hover { color: var(--text); background: var(--panel-soft); }
.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: #050506;
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  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(--edge);
  background: var(--panel);
}
.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(--edge);
  background: var(--panel);
}
.console-in input {
  flex: 1;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.83rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--edge);
  border-radius: 9px;
  padding: 0.5rem 0.7rem;
}
.console-in input:focus { outline: none; border-color: var(--edge-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: 7px; }
.fm-crumb button:hover { color: var(--text); background: var(--panel-soft); }
.fm-drop {
  border: 1px dashed var(--edge-strong);
  background: var(--panel-soft);
  border-radius: 9px;
  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); color: var(--text); background: var(--panel-soft); }
.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: #050506;
  border: 1px solid var(--edge);
  border-radius: 9px;
  padding: 0.85rem 1rem;
  resize: vertical;
}
.fm-editor textarea:focus { outline: none; border-color: var(--edge-strong); }

/* progress */
.progress { height: 6px; border-radius: 999px; background: var(--panel-soft); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--text-secondary); 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(--edge-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; }
.card-pad svg { width: 20px; height: 20px; }

/* skeleton */
.skel {
  border-radius: 7px;
  background: linear-gradient(90deg, var(--panel-soft) 25%, rgba(255, 255, 255, 0.09) 45%, var(--panel-soft) 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);
}
.d-modal-root.is-open { display: flex; }
.d-modal {
  width: 100%;
  max-width: 480px;
  max-height: min(86vh, 720px);
  overflow-y: auto;
  background: var(--panel-strong);
  border: 1px solid var(--edge-strong);
  border-radius: 16px;
  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.15rem 1.3rem 0; }
.d-modal-head h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: var(--tracking-heading);
  color: var(--text);
}
.d-modal-body { padding: 1.1rem 1.3rem 1.25rem; }
.d-modal-foot { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0 1.3rem 1.3rem; }

/* 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(--panel-strong);
  border: 1px solid var(--edge-strong);
  border-left: 3px solid var(--text);
  border-radius: 10px;
  font-size: var(--fs-small);
  color: var(--text);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  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 1rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 12px;
  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(--edge-strong); color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow); }
.qa:hover svg { opacity: 1; }

/* 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(--panel);
  border: 1px solid var(--edge);
  border-radius: 12px;
  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(--edge-strong); }
.ver-card.is-active { border-color: var(--text); color: var(--text); background: var(--panel-soft); }
.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(--edge-faint); font-size: var(--fs-small); }
.feed li:last-child { border-bottom: 0; }
.feed .f-dot { width: 8px; height: 8px; 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: 240px; }
  .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-foot,
  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.55rem 0.72rem; }
  body.d-collapsed .ds-link span, body.d-collapsed .ds-back span { display: inline; }
  body.d-collapsed .ds-link .ds-count { display: inline-flex; }
  .dm { margin-left: 0 !important; }
}

@media (max-width: 560px) {
  .dh-brand 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; }
  .d-btn { padding: 0.48rem 0.8rem; font-size: 0.8rem; }
  .tbl { font-size: 0.8rem; }
}

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

/* ---- Ticket system ---- */

/* ---- Support page redesign ---- */
.tk-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.tk-stat-card {
  padding: 1.2rem 1.4rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.tk-stat-card:hover { border-color: var(--edge-strong); transform: translateY(-2px); }
.tk-stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tk-stat-icon svg { width: 22px; height: 22px; }
.tk-stat-icon-open { background: rgba(59,130,246,0.1); color: #60a5fa; }
.tk-stat-icon-answered { background: rgba(234,179,8,0.1); color: #facc15; }
.tk-stat-icon-closed { background: rgba(59,130,246,0.1); color: #60a5fa; }
.tk-stat-num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.tk-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.tk-empty {
  text-align: center;
  padding: 5rem 2rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
}
.tk-empty-icon {
  width: 72px; height: 72px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: var(--panel-strong);
  border: 1px solid var(--edge);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tk-empty-icon svg { width: 30px; height: 30px; color: var(--text-muted); }
.tk-empty h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}
.tk-empty p { margin: 0 auto; font-size: 0.88rem; color: var(--text-muted); max-width: 380px; line-height: 1.6; }
.tk-empty-contact {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.tk-empty-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease-out);
}
.tk-empty-contact a:first-child {
  background: var(--text);
  color: var(--bg);
}
.tk-empty-contact a:first-child:hover { opacity: 0.9; }
.tk-empty-contact a:last-child {
  border: 1px solid var(--edge);
  color: var(--text-secondary);
  background: transparent;
}
.tk-empty-contact a:last-child:hover { border-color: var(--edge-strong); color: var(--text); }
.tk-empty-contact a svg { width: 16px; height: 16px; }

/* Ticket list */
.tk-list { display: flex; flex-direction: column; gap: 0.5rem; }
.tk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.tk-row:hover { border-color: var(--edge-strong); background: var(--panel-strong); transform: translateY(-1px); }
.tk-row-open { border-left: 3px solid #3b82f6; }
.tk-row-main { flex: 1; min-width: 0; }
.tk-row-top { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.tk-row-subject { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.tk-row-id { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.75rem; color: var(--text-muted); }
.tk-row-preview { margin-top: 0.3rem; font-size: 0.82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tk-row-meta { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.5rem; flex-wrap: wrap; }
.tk-row-time { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }
.tk-row-arrow { color: var(--text-muted); flex-shrink: 0; }
.tk-row-arrow svg { width: 16px; height: 16px; }

/* Status */
.d-st { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; font-weight: 500; }
.d-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.d-st-ok { color: #3b82f6; }
.d-st-warn { color: #eab308; }
.d-st-off { color: var(--text-muted); }

/* Badge */
.d-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--edge);
  color: var(--text-secondary);
  background: var(--panel-soft);
  white-space: nowrap;
}
.d-badge-warn { color: #eab308; border-color: rgba(234,179,8,0.3); }

/* Detail view */
.tk-detail { display: flex; flex-direction: column; height: calc(100vh - var(--dh-h) - 4rem); }
.tk-detail-head { padding-bottom: 1rem; border-bottom: 1px solid var(--edge); margin-bottom: 1rem; }
.tk-detail-title { margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.tk-detail-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.tk-detail-id { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.78rem; color: var(--text-muted); }
.tk-detail-thread {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.25rem;
}
.tk-detail-empty { text-align: center; padding: 3rem; color: var(--text-muted); }
.tk-detail-error { text-align: center; padding: 2rem; color: var(--text-muted); }
.tk-detail-closed {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--edge);
  margin-top: 0.5rem;
}

/* Messages */
.tk-msg {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.tk-msg-staff {
  background: var(--panel-strong);
  border-color: var(--edge-strong);
}
.tk-msg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.tk-msg-who { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.tk-msg-staff .tk-msg-who { color: #3b82f6; }
.tk-msg-time { font-size: 0.68rem; color: var(--text-muted); }
.tk-msg-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Ticket create form */
.tk-create-panel {
  background: #111113;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.tk-create-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}
.tk-create-header-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #e4e4e7;
}
.tk-create-header-icon svg { width: 18px; height: 18px; }
.tk-create-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fafafa;
}
.tk-create-header p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: rgba(255,255,255,.4);
}
.tk-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.4rem;
}
.tk-form-row { display: flex; flex-direction: column; gap: 0.35rem; }
.tk-form-row label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tk-form-row input,
.tk-form-row select,
.tk-form-row textarea {
  background: #0a0a0b;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  color: #fafafa;
  font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.tk-form-row input:focus,
.tk-form-row select:focus,
.tk-form-row textarea:focus {
  outline: none;
  border-color: rgba(255,255,255,.25);
  box-shadow: 0 0 0 3px rgba(255,255,255,.04);
}
.tk-form-row input::placeholder,
.tk-form-row textarea::placeholder {
  color: rgba(255,255,255,.2);
}
.tk-form-row select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,.3)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}
.tk-form-row textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.tk-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tk-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.01);
}

/* Attachments in messages */
.tk-msg-attachments { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.tk-att {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.6rem;
  background: var(--surface-2, var(--panel-strong)); border: 1px solid var(--edge); border-radius: 6px;
  font-size: 0.75rem; text-decoration: none; color: var(--text); transition: border-color .2s;
}
.tk-att:hover { border-color: var(--text-muted, var(--text-tertiary)); }
.tk-att img { max-width: 120px; max-height: 80px; border-radius: 4px; object-fit: cover; }

/* File upload */
.tk-upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 1.5rem; border: 1.5px dashed rgba(255,255,255,.1); border-radius: 8px;
  background: #0a0a0b; cursor: pointer; transition: border-color 0.2s, background 0.2s;
  text-align: center;
}
.tk-upload-zone:hover,
.tk-upload-zone.tk-upload-hover { border-color: rgba(255,255,255,.25); background: #0f0f11; }
.tk-upload-icon { color: rgba(255,255,255,.25); }
.tk-upload-icon svg { width: 28px; height: 28px; }
.tk-upload-zone p { margin: 0; font-size: 0.82rem; color: rgba(255,255,255,.35); }
.tk-upload-list { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.5rem; }
.tk-upload-item {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem;
  background: var(--panel-strong); border: 1px solid var(--edge); border-radius: 6px;
  font-size: 0.78rem;
}
.tk-upload-name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-upload-size { color: var(--text-tertiary, var(--text-muted)); font-size: 0.72rem; flex-shrink: 0; }
.tk-upload-remove {
  background: none; border: none; color: var(--text-tertiary, var(--text-muted)); cursor: pointer;
  font-size: 1rem; padding: 0 0.2rem; line-height: 1;
}
.tk-upload-remove:hover { color: var(--err); }
.tk-attach-btn { cursor: pointer; display: inline-flex; align-items: center; }
.tk-attach-btn svg { width: 16px; height: 16px; }

/* Reply */
.tk-reply-panel {
  margin-top: 0.5rem;
  background: #111113;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  overflow: hidden;
}
.tk-reply-box { padding: 0.85rem; }
.tk-reply-box textarea {
  width: 100%;
  background: #0a0a0b;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: #fafafa;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.65rem 0.85rem;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.tk-reply-box textarea:focus {
  outline: none;
  border-color: rgba(255,255,255,.25);
  box-shadow: 0 0 0 3px rgba(255,255,255,.04);
}
.tk-reply-box textarea::placeholder { color: rgba(255,255,255,.2); }
.tk-detail-reply-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.015);
}
.tk-attach-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: rgba(255,255,255,.45);
  transition: color 0.2s, background 0.2s;
  margin-right: auto;
}
.tk-attach-btn:hover { color: #e4e4e7; background: rgba(255,255,255,.06); }
.tk-attach-btn svg { width: 14px; height: 14px; }
.tk-detail-closed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.2rem;
  margin-top: 0.5rem;
  background: #111113;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  color: rgba(255,255,255,.35);
  font-size: 0.85rem;
}
.tk-detail-closed svg { width: 16px; height: 16px; color: rgba(255,255,255,.25); }

/* Skeleton */
.tk-list-skeleton { display: flex; flex-direction: column; gap: 0.5rem; }
.tk-skel-row {
  height: 72px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  animation: tk-pulse 1.5s ease-in-out infinite;
}
.tk-skel-msg {
  height: 60px;
  width: 70%;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  animation: tk-pulse 1.5s ease-in-out infinite;
}
.tk-skel-right { align-self: flex-end; }
@keyframes tk-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

@media (max-width: 640px) {
  .tk-stats { grid-template-columns: 1fr; }
  .tk-detail { height: calc(100vh - var(--dh-h) - 2rem); }
  .tk-row-meta { gap: 0.3rem; }
}