/* ============================================================
   DREGON ADMIN — admin.css
============================================================ */

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

:root {
  --bg:        #080810;
  --surface:   #0e0e16;
  --surface2:  #16161f;
  --surface3:  #1c1c28;
  --border:    rgba(255,255,255,0.06);
  --border2:   rgba(255,255,255,0.11);
  --text:      #e2e2ee;
  --text-dim:  #6a6a8a;
  --accent:    #60a5fa;
  --accent-dim:rgba(96,165,250,0.1);
  --accent-glow:rgba(96,165,250,0.18);
  --accent-border: rgba(96,165,250,0.3);
  --danger:    #f87171;
  --success:   #34d399;
  --amber:     #f59e0b;
  --radius:    10px;
  --sidebar-w: 220px;
  --topbar-h:  58px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
}

body {
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  background: var(--bg);
  background-image:
    radial-gradient(circle, rgba(96,165,250,0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Login ── */
.login-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity .3s;
}

.login-card {
  width: 100%; max-width: 400px;
  background: linear-gradient(160deg, #0e0e18 0%, #0b0b14 100%);
  border: 1px solid rgba(96,165,250,0.2);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(96,165,250,0.04), 0 32px 80px rgba(0,0,0,0.7), 0 0 60px rgba(96,165,250,0.06);
}

.login-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

.login-card h2 {
  font-size: 22px; font-weight: 700;
  margin-bottom: 8px;
}

.login-card > p {
  color: var(--text-dim);
  margin-bottom: 28px;
}

.login-field {
  text-align: left;
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.login-field input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s;
}

.login-field input:focus { border-color: var(--accent); }

.login-error {
  display: none;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 8px;
  color: var(--danger);
  font-size: 13px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

.login-error.show { display: block; }

.login-back {
  display: inline-block;
  margin-top: 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color .2s;
}

.login-back:hover { color: var(--text); }

/* ── Admin Shell ── */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-shell[hidden] { display: none; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #09090f;
  border-right: 1px solid rgba(96,165,250,0.08);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}

.sidebar-top {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
}
.sidebar-logo svg { filter: drop-shadow(0 0 6px rgba(96,165,250,0.5)); }

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex; flex-direction: column; gap: 1px;
}

.snav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  transition: background .15s, color .15s, box-shadow .15s;
  position: relative;
}

.snav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }

.snav-item.active {
  background: rgba(96,165,250,0.09);
  color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}

.snav-item svg { flex-shrink: 0; opacity: .6; transition: opacity .15s; }
.snav-item:hover svg { opacity: .85; }
.snav-item.active svg { opacity: 1; }

.sidebar-bottom {
  padding: 10px 8px 14px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  text-decoration: none;
  transition: background .15s, color .15s;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }

/* ── Main ── */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(8,8,16,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(96,165,250,0.1);
  box-shadow: 0 1px 0 rgba(96,165,250,0.04);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
}

.topbar-title {
  font-size: 13px; font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .07em;
  display: flex; align-items: center; gap: 8px;
}
.topbar-title::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  display: inline-block;
}

.topbar-actions { display: flex; gap: 10px; }

/* ── Buttons ── */
.a-btn-primary {
  background: linear-gradient(135deg, #4e9df5 0%, #60a5fa 50%, #3b82f6 100%);
  border: 1px solid rgba(96,165,250,0.5);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 20px;
  transition: opacity .2s, transform .1s, box-shadow .2s;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(96,165,250,0.25);
}

.a-btn-primary:hover { opacity: .9; box-shadow: 0 4px 20px rgba(96,165,250,0.4); }
.a-btn-primary:active { transform: scale(.97); }

.a-btn-ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  transition: border-color .2s, color .2s, background .2s;
  white-space: nowrap;
}

.a-btn-ghost:hover { border-color: rgba(96,165,250,0.3); color: var(--text); background: rgba(96,165,250,0.06); }

/* ── Sections ── */
.admin-section {
  display: none;
  padding: 24px 28px;
  flex-direction: column;
  gap: 18px;
}

.admin-section.active { display: flex; }

.sec-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .1em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.sec-title::before {
  content: '//';
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .8;
}

/* ── Cards ── */
.a-card {
  background: linear-gradient(160deg, var(--surface) 0%, #0d0d14 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color .2s, box-shadow .25s;
}
.a-card:hover {
  border-color: rgba(96,165,250,0.15);
  box-shadow: 0 4px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(96,165,250,0.04);
}

.card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.card-label::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 1px;
  transform: rotate(45deg);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(96,165,250,0.6);
}

/* ── Fields ── */
.a-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.a-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.a-input,
.a-textarea {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 9px 13px;
  outline: none;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s, background .2s;
  width: 100%;
}

.a-input:focus,
.a-textarea:focus {
  border-color: rgba(96,165,250,0.45);
  background: rgba(96,165,250,0.04);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.08);
}

.a-input::placeholder,
.a-textarea::placeholder { color: var(--text-dim); opacity: .5; }

.a-textarea { resize: vertical; min-height: 72px; }

.a-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.a-hint {
  color: var(--text-dim);
  font-size: 11.5px;
}

.a-hint-inline {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.a-badge {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 1px 6px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ── Color picker ── */
.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-picker {
  width: 42px; height: 38px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
  background: var(--surface2);
  flex-shrink: 0;
}

.hex-input { max-width: 120px; }

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-pair {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ── Chip editor ── */
.chip-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px 4px 12px;
  animation: chipIn .15s ease;
}

@keyframes chipIn {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}

.chip-del {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: .6;
  padding: 0;
  transition: opacity .15s;
}

.chip-del:hover { opacity: 1; }

.chip-input-row {
  display: flex;
  gap: 8px;
}

.chip-input-row input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 12px;
  outline: none;
  transition: border-color .2s;
}

.chip-input-row input:focus { border-color: var(--accent); }

.chip-add-btn {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  color: var(--accent);
  cursor: pointer;
  font-size: 18px;
  font-weight: 300;
  height: 36px; width: 36px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}

.chip-add-btn:hover { background: rgba(96,165,250,0.2); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: linear-gradient(135deg, #111120, #0d0d18);
  border: 1px solid rgba(52,211,153,0.25);
  border-left: 2px solid var(--success);
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,.7), 0 0 20px rgba(52,211,153,0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 14px 20px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s, opacity .25s;
  z-index: 9000;
  max-width: 300px;
  font-family: var(--font-mono);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error { border-left-color: var(--danger); }

/* ── Sidebar group label ── */
.snav-group-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; color: rgba(96,165,250,0.45);
  padding: 16px 12px 4px;
  pointer-events: none;
  font-family: var(--font-mono);
}

/* ── Maintenance control card ── */
.maint-card {
  border-color: rgba(52,211,153,0.15);
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.maint-card.maint-on {
  border-color: rgba(245,158,11,0.35) !important;
  background: linear-gradient(160deg, rgba(245,158,11,0.05) 0%, #0d0d14 70%) !important;
  box-shadow: 0 0 32px rgba(245,158,11,0.07) !important;
}
.maint-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.maint-left { display: flex; align-items: center; gap: 14px; }
.maint-status-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
}
.dot-live  { background: var(--success); box-shadow: 0 0 10px rgba(52,211,153,0.7); animation: maintPulse 2.5s ease-in-out infinite; }
.dot-maint { background: var(--amber);   box-shadow: 0 0 10px rgba(245,158,11,0.7);  animation: maintPulse 1.2s ease-in-out infinite; }
@keyframes maintPulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .6; transform: scale(.85); }
}
#maint-status-text { display: flex; flex-direction: column; gap: 2px; }
.maint-live-label  { font-size: 14px; font-weight: 700; color: var(--success); }
.maint-on-label    { font-size: 14px; font-weight: 700; color: var(--amber); }
.maint-sub         { font-size: 11px; color: var(--text-dim); }
.maint-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.maint-toggle-btn {
  padding: 9px 20px; border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3);
  color: var(--success); transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.maint-toggle-btn:hover { background: rgba(52,211,153,0.18); box-shadow: 0 0 14px rgba(52,211,153,0.2); }
.maint-toggle-btn.maint-off-btn {
  background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.35);
  color: var(--amber);
}
.maint-toggle-btn.maint-off-btn:hover { background: rgba(245,158,11,0.18); box-shadow: 0 0 14px rgba(245,158,11,0.2); }
.maint-fields { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; border-top: 1px solid var(--border); }

/* ── Dashboard header ── */
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(96,165,250,0.04) 0%, rgba(8,8,16,0) 60%);
  border: 1px solid rgba(96,165,250,0.1);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.dash-header::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    rgba(96,165,250,0.012) 2px, rgba(96,165,250,0.012) 4px
  );
  pointer-events: none;
}
.dash-hd-left { display: flex; flex-direction: column; gap: 4px; }
.dash-hd-brand { display: flex; align-items: center; gap: 10px; }
.dash-hd-title {
  font-size: 14px; font-weight: 800; color: var(--text);
  letter-spacing: .1em; text-transform: uppercase;
  font-family: var(--font-mono);
}
.dash-hd-meta { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }
.dash-hd-meta span { color: var(--accent); }
.dash-hd-right { display: flex; align-items: center; gap: 8px; }
.dash-hd-pill {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 100px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border2);
  color: var(--text-dim);
}
.dash-hd-pill.live {
  background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.3);
  color: var(--success); animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.3); }
  50% { box-shadow: 0 0 0 4px rgba(52,211,153,0); }
}

/* ── Pulsing status dot ── */
.dash-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--success);
  animation: pulseGlow 2s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(52,211,153,0.8); }
  50% { opacity: .6; box-shadow: 0 0 14px rgba(52,211,153,0.4); }
}

/* ── Dashboard section divider ── */
.dash-section-divider {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: rgba(96,165,250,0.5);
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono);
  padding: 4px 0;
}
.dash-section-divider::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(96,165,250,0.2), transparent);
}

/* ── Dashboard KPIs ── */
.dash-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.dash-kpi {
  background: linear-gradient(150deg, #101018 0%, #0c0c12 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-top: 1px solid rgba(96,165,250,0.35);
  border-radius: var(--radius);
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.dash-kpi::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96,165,250,0.6), transparent);
}
.dash-kpi:hover {
  border-color: rgba(96,165,250,0.2);
  box-shadow: 0 0 28px rgba(96,165,250,0.07), 0 8px 24px rgba(0,0,0,0.4);
}
.dk-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-dim);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.dk-label::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dk-value {
  font-size: 28px; font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text);
  line-height: 1;
  letter-spacing: -.01em;
}
.dk-value.green { color: var(--success); text-shadow: 0 0 20px rgba(52,211,153,0.35); }
.dk-value.amber { color: var(--amber); text-shadow: 0 0 20px rgba(245,158,11,0.3); }

/* ── Dashboard row (rev + status side by side) ── */
.dash-row { display: flex; gap: 14px; align-items: flex-start; }

/* ── Revenue by project ── */
.drp-row { display: flex; flex-direction: column; gap: 7px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.drp-row:last-child { border-bottom: none; }
.drp-name { font-size: 13px; font-weight: 600; color: var(--text); }
.drp-bars { display: flex; flex-direction: column; gap: 5px; }
.drp-bar-bg { background: rgba(255,255,255,0.05); border-radius: 3px; height: 4px; overflow: hidden; }
.drp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 3px;
  transition: width .6s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 6px rgba(96,165,250,0.4);
}
.drp-bar-bg.drp-paid .drp-bar-fill { background: linear-gradient(90deg, #22c55e, #34d399); box-shadow: 0 0 6px rgba(52,211,153,0.4); }
.drp-amounts { display: flex; gap: 12px; }
.drp-total { font-size: 12px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.drp-collected { font-size: 12px; color: var(--success); font-family: var(--font-mono); }

/* ── Client status breakdown ── */
.dcs-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.dcs-item:last-child { border-bottom: none; }
.dcs-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }
.dcs-label { flex: 1; font-size: 12px; color: var(--text); text-transform: capitalize; letter-spacing: .02em; }
.dcs-count { font-size: 14px; font-weight: 800; color: var(--text); font-family: var(--font-mono); }

/* ── Recent clients table ── */
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th {
  text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim); padding: 8px 10px 12px;
  border-bottom: 1px solid var(--border);
}
.dash-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tbody tr { transition: background .15s; }
.dash-table tbody tr:hover { background: rgba(255,255,255,0.025); }
.dt-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dt-name small { display: block; font-size: 11px; color: var(--text-dim); font-weight: 400; }
.dt-av {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--accent);
  box-shadow: 0 0 10px rgba(96,165,250,0.15);
}

/* ── Status badge ── */
.status-badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 100px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  background: color-mix(in srgb, var(--sc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--sc) 28%, transparent);
  color: var(--sc);
  box-shadow: 0 0 8px color-mix(in srgb, var(--sc) 20%, transparent);
}

/* ── Clients toolbar ── */
.clients-toolbar { display: flex; align-items: center; gap: 10px; }

/* ── Client card ── */
.client-card {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 1fr auto auto;
  align-items: center; gap: 16px;
  background: linear-gradient(160deg, var(--surface) 0%, #0d0d14 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  transition: border-color .2s, box-shadow .2s;
}
.client-card:hover { border-color: rgba(96,165,250,0.18); box-shadow: 0 4px 24px rgba(0,0,0,0.4); }
.cc-av {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: var(--accent);
  box-shadow: 0 0 12px rgba(96,165,250,0.2);
}
.cc-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.cc-meta { font-size: 12px; color: var(--text-dim); }
.cc-project { font-size: 13px; font-weight: 600; color: var(--text); }
.cc-project small { display: block; font-size: 11px; color: var(--text-dim); font-weight: 400; margin-top: 2px; }
.cc-paid { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.cc-paid span { font-size: 12px; color: var(--text-dim); font-weight: 400; }
.cc-prog-wrap { background: var(--surface2); border-radius: 4px; height: 4px; overflow: hidden; }
.cc-prog-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }
.cc-btns { display: flex; gap: 6px; }
.cc-btn {
  padding: 6px 14px; border-radius: 7px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); transition: border-color .15s, color .15s;
}
.cc-btn:hover { border-color: var(--accent); color: var(--accent); }
.cc-del { color: var(--danger); }
.cc-del:hover { border-color: var(--danger); color: var(--danger); }

/* ── Currency row ── */
.currency-row { display: flex; align-items: center; gap: 0; }
.cur-sym {
  padding: 9px 10px 9px 13px;
  background: var(--surface2); border: 1px solid var(--border2); border-right: none;
  border-radius: 8px 0 0 8px; font-size: 14px; color: var(--text-dim);
}
.currency-row .a-input { border-radius: 0 8px 8px 0; }

/* ── Form actions ── */
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }

/* ── Leads table ── */
.lead-av {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--accent);
  box-shadow: 0 0 10px rgba(96,165,250,0.15);
}
.leads-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.leads-table thead th {
  text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface2);
}
.lt-row { border-bottom: 1px solid var(--border); transition: background .15s; }
.lt-row:hover { background: rgba(255,255,255,.025); }
.lt-row td { padding: 12px 14px; vertical-align: middle; }
.lt-detail-row td { padding: 0 14px 12px; border-bottom: 1px solid var(--border); }
.lt-note-row td { padding: 0 14px 14px; border-bottom: 1px solid var(--border); }
.lt-person { display: flex; align-items: center; gap: 10px; }
.lt-av-sm { width: 32px !important; height: 32px !important; font-size: 12px !important; }
.lt-person-info { min-width: 0; }
.lt-name { font-size: 13px; font-weight: 700; color: var(--text); }
.lt-contact { font-size: 11px; color: var(--text-dim); }
.lt-company { font-size: 11px; color: var(--text-dim); font-style: italic; }
.lt-cell { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.lt-date { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.lt-actions { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.lt-status-sel { width: 120px !important; padding: 5px 8px !important; font-size: 12px !important; }
.lt-message {
  font-size: 12px; color: var(--text-dim); font-style: italic;
  line-height: 1.6; border-left: 2px solid var(--border2); padding-left: 12px; margin: 0 0 4px;
}
.lt-notes { font-size: 12px; color: var(--text-dim); margin: 0; }
.lt-note-inner { display: flex; flex-direction: column; max-width: 600px; }
.green-btn { color: var(--success) !important; border-color: rgba(52,211,153,.3) !important; }
.green-btn:hover { border-color: var(--success) !important; }

/* ── Client file section ── */
.cf-files-section {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.cf-files-header { display: flex; align-items: center; gap: 10px; }

.cf-files-list { display: flex; flex-direction: column; gap: 8px; }

.cf-no-files { font-size: 13px; color: var(--text-dim); padding: 8px 0; }

.cf-file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  transition: border-color .2s;
}
.cf-file-item:hover { border-color: var(--border2); }
.cfi-icon { font-size: 20px; flex-shrink: 0; }
.cfi-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cfi-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfi-meta { font-size: 11px; color: var(--text-dim); }
.cfi-actions { display: flex; gap: 6px; flex-shrink: 0; }

.cf-file-upload-row { display: flex; align-items: center; gap: 12px; }

/* ── Credentials group ── */
.cred-group {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.cred-group-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.cred-group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--accent);
}
.cred-add-btn {
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  border-radius: 7px; color: var(--accent); cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700;
  padding: 6px 14px; white-space: nowrap; transition: background .15s;
}
.cred-add-btn:hover { background: rgba(96,165,250,.22); }

#cf-creds-list { display: flex; flex-direction: column; gap: 12px; }

.cred-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.cred-row-top { display: flex; align-items: center; gap: 10px; }
.cred-row-top .cr-label { flex: 1; }
.cred-remove-btn {
  background: none; border: 1px solid var(--border2); border-radius: 6px;
  color: var(--text-dim); cursor: pointer; font-size: 12px; font-weight: 700;
  padding: 5px 10px; white-space: nowrap; transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.cred-remove-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ── Password row ── */
.pwd-row { display: flex; gap: 0; }
.pwd-row .a-input { border-radius: 8px 0 0 8px; flex: 1; }
.pwd-toggle {
  background: var(--surface2); border: 1px solid var(--border2); border-left: none;
  border-radius: 0 8px 8px 0; padding: 0 12px; cursor: pointer; font-size: 15px;
  color: var(--text-dim); transition: background .15s;
}
.pwd-toggle:hover { background: var(--border); }

/* ── Client card live link + cred badge ── */
.cc-live-link {
  display: inline-block; margin-left: 8px;
  font-size: 11px; font-weight: 700; color: var(--accent);
  text-decoration: none;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  border-radius: 4px; padding: 1px 7px;
  transition: background .15s;
}
.cc-live-link:hover { background: rgba(96,165,250,.22); }
.cc-cred-badge {
  display: inline-block; margin-left: 6px;
  font-size: 11px; color: var(--text-dim);
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 4px; padding: 1px 7px; cursor: default;
}

/* ── Image upload widget ── */
.img-upload-zone {
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
}

.img-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 32px 20px; text-align: center;
}

.img-choose-btn {
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  border-radius: 8px; color: var(--accent); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 9px 20px; transition: background .15s;
}
.img-choose-btn:hover { background: rgba(96,165,250,0.2); }

.img-preview {
  position: relative;
}
.img-preview img {
  display: block; width: 100%; max-height: 220px;
  object-fit: cover; border-radius: var(--radius);
}
.img-remove-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px; color: #fff; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 12px; transition: background .15s;
}
.img-remove-btn:hover { background: rgba(248,113,113,.7); }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 32px; color: var(--text-dim);
  font-size: 13px;
}

/* ── File Preview Modal ── */
.preview-modal {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.preview-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.75); backdrop-filter: blur(6px);
  cursor: pointer;
}
.preview-panel {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  display: flex; flex-direction: column;
  width: 100%; max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
  animation: pvIn .2s ease;
}
@keyframes pvIn {
  from { opacity:0; transform: scale(.96) translateY(12px); }
  to   { opacity:1; transform: none; }
}

.preview-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.preview-filename {
  font-size: 14px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.preview-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.preview-close-btn {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text-dim); cursor: pointer;
  font-size: 15px; font-weight: 700;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.preview-close-btn:hover { background: var(--border); color: var(--text); }

.preview-body {
  flex: 1; overflow: auto; display: flex;
  align-items: flex-start; justify-content: center;
  background: var(--bg); min-height: 0;
}

/* Image preview */
.pv-img {
  max-width: 100%; max-height: 75vh;
  object-fit: contain; display: block;
  margin: auto; padding: 20px;
}

/* PDF preview */
.pv-iframe {
  width: 100%; height: 75vh;
  border: none; display: block;
}

/* Unsupported type */
.pv-unsupported {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  padding: 60px 40px; text-align: center;
  color: var(--text-dim);
}
.pv-big-icon { font-size: 52px; line-height: 1; }
.pv-fname { font-size: 15px; font-weight: 700; color: var(--text); }
.pv-fmeta { font-size: 12px; }
.pv-unsupported p { font-size: 13px; line-height: 1.6; }

/* ── Theme toggle button ── */
.theme-toggle-btn {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text-dim); cursor: pointer;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* ── User "You" tag ── */
.user-you-tag {
  display: inline-block; font-size: 9px; font-weight: 700;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  color: var(--accent); border-radius: 4px; padding: 1px 5px;
  text-transform: uppercase; letter-spacing: .05em; vertical-align: middle; margin-left: 4px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(96,165,250,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(96,165,250,0.35); }

/* ═══════════════════════════════════════
   LIGHT MODE
═══════════════════════════════════════ */
html.light {
  --bg:          #f0f2f8;
  --surface:     #ffffff;
  --surface2:    #f4f6fb;
  --surface3:    #edf0f7;
  --border:      rgba(0,0,0,0.07);
  --border2:     rgba(0,0,0,0.12);
  --text:        #1a1a2e;
  --text-dim:    #6b7a99;
  --accent-dim:  rgba(59,130,246,0.1);
  --accent-glow: rgba(59,130,246,0.12);
  --accent-border: rgba(59,130,246,0.28);
}
html.light body {
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(59,130,246,0.04) 1px, transparent 1px);
  color: var(--text);
}
html.light .sidebar { background: #f7f8fd; border-right-color: rgba(0,0,0,0.08); }
html.light .sidebar-logo { color: var(--text); }
html.light .snav-item:hover { background: rgba(0,0,0,0.04); color: var(--text); }
html.light .snav-item.active { background: rgba(59,130,246,0.08); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
html.light .snav-group-label { color: rgba(59,130,246,0.5); }
html.light .sidebar-bottom { border-top-color: rgba(0,0,0,0.08); }
html.light .sidebar-link:hover { background: rgba(0,0,0,0.04); }
html.light .admin-topbar { background: rgba(240,242,248,0.9); border-bottom-color: rgba(0,0,0,0.08); box-shadow: 0 1px 0 rgba(0,0,0,0.04); }
html.light .topbar-title::before { background: var(--accent); }
html.light .theme-toggle-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); }
html.light .theme-toggle-btn:hover { background: rgba(0,0,0,0.08); }
html.light .a-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
html.light .a-card:hover { border-color: rgba(59,130,246,0.25); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
html.light .card-label { border-bottom-color: rgba(0,0,0,0.08); }
html.light .sec-title { border-bottom-color: rgba(0,0,0,0.08); color: var(--text-dim); }
html.light .dash-kpi { background: linear-gradient(150deg,#fff 0%,#f8f9fd 100%); border-color: rgba(0,0,0,0.06); border-top-color: rgba(59,130,246,0.35); }
html.light .dash-kpi:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
html.light .dash-kpi::after { background: linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent); }
html.light .dk-value { color: var(--text); }
html.light .dash-header { background: linear-gradient(135deg, rgba(59,130,246,0.05) 0%, rgba(240,242,248,0) 60%); border-color: rgba(59,130,246,0.12); }
html.light .dash-hd-title { color: var(--text); }
html.light .dash-hd-pill { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.1); color: var(--text-dim); }
html.light .a-input, html.light .a-textarea { background: #f4f6fb; border-color: rgba(0,0,0,0.1); color: var(--text); }
html.light .a-input:focus, html.light .a-textarea:focus { background: rgba(59,130,246,0.04); border-color: rgba(59,130,246,0.4); }
html.light .a-input::placeholder, html.light .a-textarea::placeholder { color: var(--text-dim); opacity: .5; }
html.light .client-card { background: #ffffff; border-color: rgba(0,0,0,0.08); }
html.light .client-card:hover { border-color: rgba(59,130,246,0.2); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
html.light .a-btn-ghost { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); color: var(--text-dim); }
html.light .a-btn-ghost:hover { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.3); color: var(--text); }
html.light .cc-btn { background: #f4f6fb; border-color: rgba(0,0,0,0.1); color: var(--text); }
html.light .cc-btn:hover { border-color: var(--accent); color: var(--accent); }
html.light .leads-table thead th { background: #f4f6fb; }
html.light .lt-row { border-bottom-color: rgba(0,0,0,0.07); }
html.light .lt-row:hover { background: rgba(0,0,0,0.025); }
html.light .dash-table td { border-bottom-color: rgba(0,0,0,0.07); }
html.light .dash-table tbody tr:hover { background: rgba(0,0,0,0.025); }
html.light .empty-state { color: var(--text-dim); }
html.light .snav-group-label { color: rgba(59,130,246,0.45); }
html.light .maint-card { border-color: rgba(52,211,153,0.2); }
html.light .maint-card.maint-on { background: linear-gradient(160deg,rgba(245,158,11,0.06) 0%,#fff 70%) !important; }
html.light .dash-section-divider { color: rgba(59,130,246,0.55); }
html.light .login-card { background: #ffffff; border-color: rgba(59,130,246,0.2); box-shadow: 0 20px 60px rgba(0,0,0,0.1), 0 0 40px rgba(59,130,246,0.06); }
html.light .snav-item svg { color: inherit; }
html.light .toast { background: #ffffff; color: var(--text); border-color: rgba(52,211,153,0.25); box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════
   DATE-TIME PICKER
══════════════════════════════════════ */
.dtp-wrap { position: relative; }

.dtp-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; cursor: pointer; user-select: none;
  transition: border-color .18s, background .18s;
  min-height: 40px;
}
.dtp-trigger:hover { border-color: rgba(255,255,255,0.15); }

.dtp-icon { flex-shrink: 0; color: var(--text-dim); }

.dtp-display { flex: 1; font-size: 13px; color: var(--text); }
.dtp-placeholder { color: var(--text-dim); }

.dtp-clear-x {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 12px; padding: 2px 5px;
  border-radius: 4px; line-height: 1;
}
.dtp-clear-x:hover { color: var(--text); background: var(--surface2); }

.dtp-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 9999;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.55);
  width: 300px; overflow: hidden;
}

.dtp-cal-section { padding: 14px 14px 10px; }

.dtp-cal-nav {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 12px;
}
.dtp-cal-title { font-size: 13px; font-weight: 700; color: var(--text); }

.dtp-nav-btn {
  background: none; border: 1px solid var(--border2); border-radius: 6px;
  color: var(--text-dim); cursor: pointer;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  transition: background .14s, color .14s;
}
.dtp-nav-btn:hover { background: var(--surface2); color: var(--text); }

.dtp-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px;
}
.dtp-weekdays span {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--text-dim); letter-spacing: .06em; padding: 3px 0;
}

.dtp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.dtp-day {
  background: none; border: none; border-radius: 6px;
  color: var(--text); cursor: pointer;
  font-size: 12px; font-weight: 500;
  padding: 6px 2px; text-align: center;
  transition: background .12s, color .12s; line-height: 1;
}
.dtp-day:hover { background: var(--surface2); }
.dtp-day.other-month { color: var(--text-dim); opacity: .35; }
.dtp-day.today { color: var(--accent); font-weight: 700; }
.dtp-day.selected { background: var(--accent); color: #000; font-weight: 700; }
.dtp-day.selected:hover { background: var(--accent); }

.dtp-divider { height: 1px; background: var(--border); }

.dtp-time-section { padding: 12px 14px 10px; }
.dtp-time-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 10px;
}

.dtp-time-row { display: flex; align-items: center; gap: 8px; }

.dtp-spin-group { display: flex; flex-direction: column; align-items: center; gap: 3px; }

.dtp-spin-btn {
  background: none; border: 1px solid var(--border2); border-radius: 4px;
  color: var(--text-dim); cursor: pointer; font-size: 9px; line-height: 1;
  padding: 3px 10px; transition: background .12s;
}
.dtp-spin-btn:hover { background: var(--surface2); color: var(--text); }

.dtp-spin-val {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border2);
  border-radius: 6px; color: var(--text);
  font-size: 17px; font-weight: 700; text-align: center;
  width: 52px; padding: 6px 4px; outline: none;
}
.dtp-spin-val:focus { border-color: var(--accent); }

.dtp-colon {
  font-size: 18px; font-weight: 700; color: var(--text-dim); margin-bottom: 2px;
}

.dtp-ampm { display: flex; flex-direction: column; gap: 4px; margin-left: 4px; }
.dtp-ampm-btn {
  background: none; border: 1px solid var(--border2); border-radius: 6px;
  color: var(--text-dim); cursor: pointer; font-size: 11px; font-weight: 700;
  padding: 5px 10px; letter-spacing: .04em; transition: background .12s, color .12s;
}
.dtp-ampm-btn:hover { background: var(--surface2); }
.dtp-ampm-btn.active { background: var(--accent); border-color: var(--accent); color: #000; }

.dtp-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
}

.dtp-clear-btn {
  background: none; border: 1px solid var(--border2); border-radius: 6px;
  color: var(--text-dim); cursor: pointer; font-size: 12px; font-weight: 600;
  padding: 7px 14px; transition: background .12s, color .12s;
}
.dtp-clear-btn:hover { background: var(--surface2); color: var(--text); }

.dtp-confirm {
  flex: 1; background: var(--accent); border: none; border-radius: 6px;
  color: #000; cursor: pointer; font-size: 12px; font-weight: 700;
  padding: 7px 16px; transition: opacity .15s;
}
.dtp-confirm:hover { opacity: .88; }

html.light .dtp-trigger { background: #f4f6fb; border-color: rgba(0,0,0,0.1); }
html.light .dtp-trigger:hover { border-color: rgba(59,130,246,0.3); }
html.light .dtp-panel { background: #ffffff; border-color: rgba(0,0,0,0.12); box-shadow: 0 12px 40px rgba(0,0,0,.18); }
html.light .dtp-nav-btn { border-color: rgba(0,0,0,0.1); }
html.light .dtp-nav-btn:hover { background: #f4f6fb; }
html.light .dtp-day:hover { background: #f4f6fb; }
html.light .dtp-spin-val { background: #f4f6fb; border-color: rgba(0,0,0,0.1); }
html.light .dtp-spin-btn { border-color: rgba(0,0,0,0.1); }
html.light .dtp-spin-btn:hover { background: #f4f6fb; }
html.light .dtp-clear-btn { border-color: rgba(0,0,0,0.1); }
html.light .dtp-clear-btn:hover { background: #f4f6fb; }
html.light .dtp-ampm-btn { border-color: rgba(0,0,0,0.1); }
html.light .dtp-ampm-btn:hover { background: #f4f6fb; }

/* ── Responsive ── */
@media (max-width: 720px) {

  /* Shell → stacked column */
  .admin-shell { flex-direction: column; }

  /* Sidebar → horizontal scroll strip */
  .sidebar {
    width: 100%; height: auto;
    position: relative;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto; overflow-y: hidden;
  }
  .sidebar-top    { display: none; }
  .sidebar-bottom { display: none; }

  .sidebar-nav {
    flex-direction: row;
    padding: 8px;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }

  /* Hide section group-label dividers in horizontal mode */
  .snav-group-label { display: none; }
  .snav-item { white-space: nowrap; }

  /* Topbar */
  .admin-topbar { padding: 0 16px; }
  #reset-btn    { display: none; }

  /* Section & card padding */
  .admin-section { padding: 16px; gap: 14px; }
  .a-card        { padding: 16px; }

  /* Dashboard header → stack */
  .dash-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dash-hd-right { width: 100%; }

  /* KPIs → 2 × 2 */
  .dash-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-kpi  { padding: 16px 14px; }
  .dk-value  { font-size: 22px; }

  /* Revenue + client-status side-by-side → stack */
  .dash-row { flex-direction: column; }
  .dash-row > * { width: 100% !important; flex-shrink: unset !important; }

  /* Stats grid → 1 col */
  .stats-grid { grid-template-columns: 1fr; }

  /* Client card → 2-col (avatar | info) with buttons spanning full width */
  .client-card {
    grid-template-columns: 40px 1fr;
    gap: 10px;
  }
  .cc-btns {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }

  /* Toolbar → wraps so search stays wide */
  .clients-toolbar { flex-wrap: wrap; }
  .clients-toolbar .a-input { min-width: 0; }
  #client-search, #lead-search { flex: 1 1 100%; }

  /* Tables → horizontal scroll inside their container */
  #leads-list, #dash-recent, #dash-recent-leads {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .leads-table { min-width: 620px; }
  .dash-table  { min-width: 500px; }

  /* Maintenance card */
  .maint-top  { flex-direction: column; align-items: flex-start; }
  .maint-right { width: 100%; }

  /* Form action buttons → full-width stack */
  .form-actions { flex-direction: column-reverse; }
  .form-actions .a-btn-primary,
  .form-actions .a-btn-ghost { width: 100%; text-align: center; }

  /* Login card — add breathing room */
  .login-overlay { padding: 20px; align-items: flex-start; padding-top: 60px; }
  .login-card    { padding: 28px 22px; max-width: 100%; }

  /* DTP panel — prevent right-edge overflow */
  .dtp-panel { left: auto; right: 0; width: min(295px, calc(100vw - 32px)); }
}

@media (max-width: 480px) {

  /* KPIs → single column */
  .dash-kpis { grid-template-columns: 1fr; }
  .dk-value  { font-size: 20px; }

  /* Tighter padding */
  .admin-section { padding: 12px; }
  .a-card        { padding: 14px; }

  /* All a-row fields → single column */
  .a-row { grid-template-columns: 1fr !important; }

  /* Client card → fully stacked, hide avatar to save space */
  .client-card { grid-template-columns: 1fr; }
  .cc-av { display: none; }

  /* Topbar action buttons → compact */
  .topbar-actions { gap: 6px; }
  .a-btn-primary  { font-size: 12px; padding: 7px 12px; }
  .a-btn-ghost    { font-size: 12px; padding: 6px 10px; }
  .theme-toggle-btn { width: 32px; height: 32px; }

  /* Login card */
  .login-card { padding: 24px 16px; }
  .login-overlay { padding-top: 40px; }
}

/* ============================================================
   ADMIN ENHANCED — Section transitions · KPI animations
============================================================ */

/* ── Admin section slide-in on activation ── */
@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.admin-section.active {
  animation: sectionFadeIn .22s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Login card entrance ── */
@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.login-card {
  animation: loginCardIn .4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Dashboard KPI card: value count-up glow ── */
.dash-kpi {
  transition: border-color .2s, box-shadow .2s, transform .2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dash-kpi:hover {
  transform: translateY(-3px);
  border-color: rgba(96,165,250,.3);
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(96,165,250,.08);
}
.dk-value {
  transition: text-shadow .3s;
}
.dash-kpi:hover .dk-value {
  text-shadow: 0 0 24px rgba(96,165,250,.35);
}

/* ── Sidebar nav item: smooth pill indicator ── */
.snav-item {
  transition: background .18s, color .18s, box-shadow .18s, padding-left .18s;
}
.snav-item.active {
  padding-left: 16px;
}

/* ── Client card: staggered entrance ── */
@keyframes cardSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}
.client-card {
  animation: cardSlideIn .2s ease both;
}

/* ── Toast: more prominent with left accent line ── */
.toast {
  border-left-width: 3px;
}

/* ── Chip animation: already has chipIn, make it spring ── */
@keyframes chipIn {
  from { opacity: 0; transform: scale(.82) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Sidebar logo glow pulse ── */
@keyframes logoGlow {
  0%,100% { filter: drop-shadow(0 0 6px rgba(96,165,250,.5)); }
  50%      { filter: drop-shadow(0 0 12px rgba(96,165,250,.8)); }
}
.sidebar-logo svg {
  animation: logoGlow 3s ease-in-out infinite;
}

/* ── Topbar title dot pulse ── */
@keyframes dotPulse {
  0%,100% { box-shadow: 0 0 6px var(--accent); transform: scale(1); }
  50%      { box-shadow: 0 0 14px var(--accent); transform: scale(1.25); }
}
.topbar-title::before {
  animation: dotPulse 2.5s ease-in-out infinite;
}

/* ── Revenue bar animated fill ── */
.drp-bar-fill {
  animation: barGrow .7s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes barGrow {
  from { width: 0 !important; }
}

/* ── Admin reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
