/* DAC-ADMIN-SHELL-V3
 * L-shaped chrome: fixed navy top bar + fixed navy sidebar.
 * Both rendered by admin-shell.js. Page content sits below + right.
 */
:root {
  --dac-bg: #fafafa;
  --dac-surface: #fff;
  --dac-text: #0a0a0a;
  --dac-muted: #666;
  --dac-line: #e5e5e5;
  --dac-chrome-bg: #0f172a;
  --dac-chrome-fg: #cbd5e1;
  --dac-chrome-fg-muted: #94a3b8;
  --dac-chrome-hover: #1e293b;
  --dac-chrome-divider: rgba(255,255,255,0.08);
  --dac-active: #22c55e;
  --dac-accent: #2563eb;
  --dac-accent-dark: #1d4ed8;
  --dac-success: #059669;
  --dac-warning: #d97706;
  --dac-error: #dc2626;
  --dac-topbar-h: 52px;
  --dac-sidebar-w: 224px;
  --dac-sidebar-w-collapsed: 60px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--dac-bg);
  color: var(--dac-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }

/* ─── Layout: top bar across full width, sidebar + content below ─── */
.dac-shell {
  display: grid;
  grid-template-rows: var(--dac-topbar-h) 1fr;
  grid-template-columns: var(--dac-sidebar-w) 1fr;
  min-height: 100vh;
}

/* ─── TOP BAR ─── */
.dac-topbar {
  grid-column: 1 / 3;
  background: var(--dac-chrome-bg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--dac-chrome-divider);
}
.dac-tb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.dac-tb-brand .av {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  letter-spacing: -0.02em;
}
.dac-tb-brand .name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.dac-tb-brand .name .sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--dac-chrome-fg-muted);
  margin-right: 4px;
}
.dac-tb-brand .sep {
  color: #475569;
  margin: 0 8px;
}
.dac-tb-brand .page {
  font-style: italic;
  font-weight: 400;
  color: var(--dac-chrome-fg);
}
.dac-tb-search {
  flex: 1;
  max-width: 380px;
  position: relative;
}
.dac-tb-search input {
  width: 100%;
  background: var(--dac-chrome-hover);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 7px;
  padding: 7px 12px 7px 32px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.dac-tb-search input::placeholder { color: #64748b; }
.dac-tb-search input:focus {
  border-color: var(--dac-accent);
  background: #1e293b;
}
.dac-tb-search .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dac-chrome-fg-muted);
  font-size: 14px;
  pointer-events: none;
}
.dac-tb-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.dac-tb-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--dac-chrome-hover);
  border-radius: 999px;
  padding: 3px 12px 3px 3px;
  cursor: default;
}
.dac-tb-chip .av {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.dac-tb-chip .nm {
  font-size: 12px;
  color: #fff;
  font-weight: 500;
}
.dac-tb-signout {
  background: var(--dac-error);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.12s;
}
.dac-tb-signout:hover { opacity: 0.88; }

/* ─── SIDEBAR ─── */
.dac-sidebar {
  background: var(--dac-chrome-bg);
  color: var(--dac-chrome-fg);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: var(--dac-topbar-h);
  height: calc(100vh - var(--dac-topbar-h));
  overflow-y: auto;
  border-right: 1px solid var(--dac-chrome-divider);
}
.dac-sb-section {
  font-size: 10px;
  color: #64748b;
  padding: 8px 18px 6px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 600;
}
.dac-sb-item, .dac-sb-item-disabled {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--dac-chrome-fg);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
}
.dac-sb-item:hover { background: var(--dac-chrome-hover); color: #fff; }
.dac-sb-item.active {
  background: rgba(34,197,94,0.10);
  color: var(--dac-active);
  border-left-color: var(--dac-active);
  font-weight: 500;
}
.dac-sb-item-disabled {
  color: #475569;
  cursor: not-allowed;
}
.dac-sb-item-disabled:hover { background: transparent; }
.dac-sb-item-disabled .soon {
  margin-left: auto;
  font-size: 9px;
  background: #1e293b;
  color: #64748b;
  padding: 1px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.dac-sb-item i, .dac-sb-item-disabled i {
  font-size: 15px;
  width: 16px;
  text-align: center;
  opacity: 0.85;
}
.dac-sb-footer {
  margin-top: auto;
  padding: 12px 18px;
  border-top: 1px solid var(--dac-chrome-divider);
  font-size: 10px;
  color: #475569;
  line-height: 1.4;
}

/* ─── CONTENT AREA ─── */
.dac-content {
  background: var(--dac-bg);
  padding: 24px 28px;
  min-width: 0;
  overflow-x: auto;
}

/* Responsive: collapse sidebar on narrow viewports */
@media (max-width: 900px) {
  :root { --dac-sidebar-w: 60px; }
  .dac-sb-section,
  .dac-sb-footer,
  .dac-sb-item span:not(.icon),
  .dac-sb-item-disabled span:not(.icon) { display: none; }
  .dac-sb-item, .dac-sb-item-disabled { justify-content: center; padding: 10px 0; }
  .dac-tb-brand .name { font-size: 12px; }
  .dac-tb-search { max-width: 180px; }
  .dac-tb-chip .nm { display: none; }
}

/* ─── DAC-COLLAPSIBLE-V1: sidebar collapse + toggle ─── */
.dac-sb-toggle {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px;
  border-bottom: 1px solid var(--dac-chrome-divider);
  margin-bottom: 4px;
}
.dac-sb-toggle button {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--dac-chrome-fg);
  width: 28px;
  height: 26px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.dac-sb-toggle button:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
}

/* Smooth grid-column transition when toggling */
.dac-shell {
  transition: grid-template-columns 0.2s ease;
}

/* Collapsed state: narrow sidebar, hide labels + footer + section label */
.dac-shell.dac-collapsed {
  grid-template-columns: var(--dac-sidebar-w-collapsed) 1fr;
}
.dac-shell.dac-collapsed .dac-sb-section,
.dac-shell.dac-collapsed .dac-sb-footer,
.dac-shell.dac-collapsed .dac-sb-item span,
.dac-shell.dac-collapsed .dac-sb-item-disabled span:not(.icon),
.dac-shell.dac-collapsed .dac-sb-item-disabled .soon {
  display: none;
}
.dac-shell.dac-collapsed .dac-sb-item,
.dac-shell.dac-collapsed .dac-sb-item-disabled {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}
.dac-shell.dac-collapsed .dac-sb-toggle {
  justify-content: center;
  padding: 8px 0;
}

/* ─── DAC-HOVER-OVERLAY-V1: hover-expand sidebar (overlay) ─── */

/* When .dac-shell.dac-collapsed AND not pinned, sidebar floats over content */
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar {
  position: fixed;
  left: 0;
  top: var(--dac-topbar-h);
  height: calc(100vh - var(--dac-topbar-h));
  width: var(--dac-sidebar-w-collapsed);
  z-index: 90;
  transition: width 0.18s ease;
  box-shadow: none;
  overflow: hidden;
}

/* Reserve the 60px column in the grid (content sits in the right cell) */
.dac-shell.dac-collapsed:not(.dac-pinned) {
  grid-template-columns: var(--dac-sidebar-w-collapsed) 1fr;
}

/* On hover, sidebar expands to full width on top of content */
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar:hover {
  width: var(--dac-sidebar-w);
  box-shadow: 4px 0 24px rgba(0,0,0,0.25);
  overflow-y: auto;
}

/* On hover, show all labels/sections/footer again */
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar:hover .dac-sb-section,
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar:hover .dac-sb-footer,
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar:hover .dac-sb-item span,
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar:hover .dac-sb-item-disabled span,
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar:hover .dac-sb-item-disabled .soon {
  display: revert;
}
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar:hover .dac-sb-item,
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar:hover .dac-sb-item-disabled {
  justify-content: flex-start;
  padding: 8px 18px;
  gap: 11px;
}
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar:hover .dac-sb-toggle {
  justify-content: flex-end;
  padding: 8px 12px;
}

/* Visual cue: pinned ☰ button looks pressed */
.dac-shell.dac-pinned .dac-sb-toggle button {
  background: rgba(34,197,94,0.18);
  color: var(--dac-active);
  border-color: rgba(34,197,94,0.30);
}

/* ─── DAC-GRID-FIX-V1: pin .dac-content to grid column 2 ───
 * Required because when the sidebar uses position:fixed (overlay mode),
 * it's removed from the grid flow; .dac-content would fall back to column 1.
 */
.dac-content {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  min-width: 0;
}


/* DAC-LIGHT-SIDEBAR-V1 — light sidebar, top bar stays navy */
.dac-sidebar { background: #ffffff; color: #0a0a0a; border-right: 1px solid #e5e7eb; }
.dac-sb-section { color: #94a3b8; }
.dac-sb-item, .dac-sb-item-disabled { color: #334155; }
.dac-sb-item i, .dac-sb-item-disabled i { color: #64748b; }
.dac-sb-item:hover { background: #f1f5f9; color: #0a0a0a; }
.dac-sb-item:hover i { color: #2563eb; }
.dac-sb-item.active { background: #eff6ff; color: #1d4ed8; border-left-color: #2563eb; font-weight: 500; }
.dac-sb-item.active i { color: #2563eb; }
.dac-sb-item-disabled { color: #cbd5e1; }
.dac-sb-item-disabled i { color: #cbd5e1; }
.dac-sb-item-disabled .soon { background: #f1f5f9; color: #94a3b8; }
.dac-sb-toggle { border-bottom: 1px solid #e5e7eb; }
.dac-sb-toggle button { background: #f8fafc; border: 1px solid #e5e7eb; color: #475569; }
.dac-sb-toggle button:hover { background: #f1f5f9; color: #0a0a0a; }
.dac-sb-footer { border-top: 1px solid #e5e7eb; }


/* DAC-PINNED-EXPAND-FIX-V1 */
.dac-shell.dac-collapsed.dac-pinned { grid-template-columns: var(--dac-sidebar-w) 1fr; }
.dac-shell.dac-collapsed.dac-pinned .dac-sb-section { display: block; }
.dac-shell.dac-collapsed.dac-pinned .dac-sb-footer { display: block; }
.dac-shell.dac-collapsed.dac-pinned .dac-sb-item span,
.dac-shell.dac-collapsed.dac-pinned .dac-sb-item-disabled span:not(.icon) { display: inline; }
.dac-shell.dac-collapsed.dac-pinned .dac-sb-item-disabled .soon { display: inline-block; }
.dac-shell.dac-collapsed.dac-pinned .dac-sb-item,
.dac-shell.dac-collapsed.dac-pinned .dac-sb-item-disabled { justify-content: flex-start; padding: 8px 18px; gap: 11px; }
.dac-shell.dac-collapsed.dac-pinned .dac-sidebar { position: sticky; width: auto; box-shadow: none; overflow-y: auto; }
.dac-shell.dac-collapsed.dac-pinned .dac-sb-toggle { justify-content: flex-end; padding: 8px 12px; }

/* ===== ADMIN_HEADER_V4_CSS — header icon clusters ===== */
.dac-tb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-right: 6px;
}
.dac-tb-ico {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 44px;
  height: 42px;
  border-radius: 9px;
  border: none;
  background: var(--dac-chrome-hover);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s, transform 0.08s;
}
.dac-tb-ico:hover { background: #24344f; }
.dac-tb-ico:active { transform: scale(0.95); }
.dac-tb-ico i { font-size: 18px; line-height: 1; }
.dac-tb-ico span {
  font-size: 9px;
  color: var(--dac-chrome-fg-muted);
  line-height: 1;
}
.dac-tb-right { display: flex; align-items: center; gap: 8px; }
.dac-tb-alerts { position: relative; }
.dac-tb-alerts .dac-alert-dot {
  position: absolute; top: 5px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--dac-error);
}

/* ===== ADMIN_OVERLAY_V4_CSS — sidebar becomes off-canvas overlay, content full-width ===== */
/* Force single-column shell regardless of collapsed/pinned state */
.dac-shell,
.dac-shell.dac-collapsed,
.dac-shell.dac-collapsed:not(.dac-pinned),
.dac-shell.dac-collapsed.dac-pinned {
  grid-template-columns: 1fr !important;
}
/* Content spans full width */
.dac-content,
.dac-shell.dac-collapsed.dac-pinned .dac-content {
  grid-column: 1 / -1 !important;
}
/* Sidebar off-canvas by default */
.dac-shell .dac-sidebar,
.dac-shell.dac-collapsed .dac-sidebar,
.dac-shell.dac-collapsed:not(.dac-pinned) .dac-sidebar,
.dac-shell.dac-collapsed.dac-pinned .dac-sidebar {
  position: fixed !important;
  top: var(--dac-topbar-h);
  left: 0;
  height: calc(100vh - var(--dac-topbar-h));
  width: 280px !important;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  box-shadow: 2px 0 16px rgba(0,0,0,0.18);
  overflow-y: auto;
  z-index: 210;
}
/* Reveal any hidden labels — full overlay always shows full labels */
.dac-shell .dac-sb-item span,
.dac-shell .dac-sb-item-disabled span,
.dac-shell .dac-sb-item-disabled .soon,
.dac-shell .dac-sb-section,
.dac-shell .dac-sb-footer { display: inline-block !important; }
.dac-shell .dac-sb-item,
.dac-shell .dac-sb-item-disabled { justify-content: flex-start !important; padding: 8px 18px !important; gap: 11px; }
/* Hide the old in-sidebar toggle button — Menu icon in header drives it now */
.dac-sb-toggle { display: none !important; }
/* Open state: slide in */
.dac-shell.dac-nav-open .dac-sidebar { transform: translateX(0) !important; }
/* Backdrop */
.dac-nav-backdrop {
  position: fixed; inset: var(--dac-topbar-h) 0 0 0;
  background: rgba(0,0,0,0.42);
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 200;
}
.dac-shell.dac-nav-open .dac-nav-backdrop { opacity: 1; pointer-events: auto; }
/* Numbered chips + count badges in overlay */
.dac-sb-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex-shrink: 0;
  font-size: 11px; color: var(--dac-muted);
  font-variant-numeric: tabular-nums;
}
.dac-sb-badge {
  margin-left: auto;
  background: var(--dac-accent); color: #fff;
  font-size: 10px; font-weight: 600;
  padding: 1px 7px; border-radius: 10px;
  min-width: 18px; text-align: center;
}
.dac-sb-badge.warn { background: var(--dac-warning); }
.dac-sb-badge.err  { background: var(--dac-error); }

/* ===== ADMIN_MOBILE_V4 — phone header reflow + card grid ===== */
@media (max-width: 720px) {
  :root { --dac-topbar-h: 132px; }
  .dac-topbar {
    flex-wrap: wrap;
    height: auto;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 8px;
    row-gap: 8px;
  }
  /* Row 1: brand takes full width */
  .dac-tb-brand { order: 1; width: 100%; }
  /* Row 2: left nav cluster + right cluster share a row */
  .dac-tb-nav   { order: 2; margin-right: 0; }
  .dac-tb-right { order: 3; }
  /* Row 3: search full width */
  .dac-tb-search { order: 4; width: 100%; max-width: none; flex: 1 0 100%; }
  /* Shrink the labeled squares a touch on phones */
  .dac-tb-ico { width: 40px; height: 38px; }
  .dac-tb-ico i { font-size: 17px; }
  .dac-tb-ico span { font-size: 8px; }
  .dac-tb-signout { padding: 7px 12px; font-size: 12px; }
}
@media (max-width: 480px) {
  :root { --dac-topbar-h: 128px; }
  .dac-tb-nav { gap: 4px; }
  .dac-tb-ico { width: 36px; height: 36px; }
  #dac-card-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .dac-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ===== ADMIN_HEADER_V5_CSS — 2x2 left icons, search under brand, stacked right ===== */
:root { --dac-topbar-h: 92px; }
.dac-topbar { align-items: center; padding: 8px 18px; gap: 16px; }
/* Left icons -> 2x2 grid */
.dac-tb-nav { display: grid; grid-template-columns: 44px 44px; grid-template-rows: 38px 38px; gap: 5px; margin-right: 4px; }
.dac-tb-ico { width: 44px; height: 38px; }
/* Brand + search stacked in one column */
.dac-tb-brandcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dac-tb-brandcol .dac-tb-brand { flex-shrink: 1; }
.dac-tb-brandcol .dac-tb-search { flex: none; max-width: 420px; width: 100%; }
/* Right: Alerts icon + stacked Emran-over-Signout */
.dac-tb-right { display: flex; align-items: center; gap: 8px; }
.dac-tb-stack { display: grid; grid-template-rows: 38px 38px; gap: 5px; }
.dac-tb-stack .dac-tb-chip { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,0.08); border-radius: 8px; padding: 0 12px; }
.dac-tb-stack .dac-tb-signout { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; margin: 0; }

/* ===== ADMIN_MOBILE_V5 — mobile header: 3-row stack, 6-icon row, auto-hide ===== */
@media (max-width: 720px) {
  :root { --dac-topbar-h: 150px; }
  .dac-topbar {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 8px 12px;
    gap: 8px;
    transition: transform 0.25s ease;
  }
  /* Row 1: brand full width, page title pushed right */
  .dac-tb-brandcol { order: 1; width: 100%; flex-direction: column; gap: 8px; }
  .dac-tb-brand { width: 100%; }
  .dac-tb-brand .name { font-size: 13px; }
  /* Row 2: all six actions in one even row */
  .dac-tb-nav {
    order: 2;
    display: flex;
    width: 100%;
    gap: 6px;
    margin: 0;
  }
  .dac-tb-nav .dac-tb-ico { flex: 1; width: auto; height: 44px; }
  .dac-tb-right {
    order: 2;
    display: flex;
    gap: 6px;
    width: 100%;
    margin-top: -2px;
  }
  /* Merge nav + right into a single 6-across row via flex on the header */
  .dac-tb-right .dac-tb-ico,
  .dac-tb-right .dac-tb-stack { flex: 1; }
  .dac-tb-right .dac-tb-alerts { flex: 1; width: auto; height: 44px; }
  .dac-tb-stack { display: flex; }
  .dac-tb-stack .dac-tb-chip { display: none; }
  .dac-tb-stack .dac-tb-signout {
    flex: 1; height: 44px; flex-direction: column; gap: 2px;
    font-size: 9px; padding: 0; border-radius: 8px;
  }
  .dac-tb-stack .dac-tb-signout i { font-size: 17px; }
  /* Row 3: search full width */
  .dac-tb-search {
    order: 3; width: 100%; max-width: none;
  }
  .dac-tb-search input { padding: 10px 12px 10px 34px; }

  /* Auto-hide: collapsed = slim bar (brand row + menu only) */
  .dac-topbar.dac-hdr-slim {
    --slim: 1;
  }
  .dac-topbar.dac-hdr-slim .dac-tb-nav,
  .dac-topbar.dac-hdr-slim .dac-tb-right,
  .dac-topbar.dac-hdr-slim .dac-tb-search { display: none; }
  .dac-topbar.dac-hdr-slim { padding: 8px 12px; }
  /* Slim bar shows a lone menu button injected by JS */
  .dac-hdr-slimbtn { display: none; }
  .dac-topbar.dac-hdr-slim .dac-hdr-slimbtn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 34px; border-radius: 8px; border: none;
    background: rgba(255,255,255,0.12); color: #fff; cursor: pointer;
    position: absolute; right: 12px; top: 8px;
  }
  .dac-topbar.dac-hdr-slim .dac-tb-brand { padding-right: 48px; }
}

/* ===== ADMIN_SLIM_HEIGHT_v1 — collapse reserved height when header is slim ===== */
@media (max-width: 720px) {
  /* The topbar is sticky inside a grid row sized by --dac-topbar-h.
     When slim, shrink that row so no navy gap remains below the bar. */
  .dac-shell:has(.dac-topbar.dac-hdr-slim) {
    grid-template-rows: auto 1fr;
  }
  .dac-topbar.dac-hdr-slim {
    min-height: 0;
    height: auto;
  }
  /* The slim bar becomes a compact single row: brand left, menu right */
  .dac-topbar.dac-hdr-slim .dac-tb-brandcol { flex-direction: row; align-items: center; }
  .dac-topbar.dac-hdr-slim .dac-tb-brandcol .dac-tb-search { display: none; }
}

/* ===== ADMIN_BOTTOMBAR_CSS_v1 — mobile: move nav buttons to a bottom bar ===== */
@media(max-width:720px){
  /* Hide the in-header button row + the alerts placeholder; keep brand + search */
  .dac-topbar .dac-tb-nav,
  .dac-topbar .dac-tb-right .dac-tb-alerts,
  .dac-topbar .dac-tb-alerts { display:none !important; }
  /* Kill the auto-hide slim behavior (superseded by bottom bar) */
  .dac-topbar.dac-hdr-slim .dac-tb-search { display:flex !important; }
  .dac-hdr-slimbtn { display:none !important; }
  /* Content clears the bottom bar */
  .dac-content, .dac-main { padding-bottom:76px !important; }

  .dac-bottombar{
    position:fixed; left:0; right:0; bottom:0; height:64px;
    background:#0f172a; border-top:1px solid #1e293b;
    display:flex; align-items:stretch; z-index:1200;
    padding-bottom:env(safe-area-inset-bottom, 0px);
  }
  .dac-bb-btn{
    flex:1; background:none; border:none; color:#fff; cursor:pointer;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
    font-family:inherit; -webkit-tap-highlight-color:transparent;
  }
  .dac-bb-btn:active{ background:rgba(255,255,255,0.08); }
  .dac-bb-btn i{ font-size:24px; line-height:1; }
  .dac-bb-btn span{ font-size:9px; color:#8CA6C4; line-height:1; }
}
@media(min-width:721px){ .dac-bottombar{ display:none !important; } }

/* ===== ADMIN_TOPCLEAN_v1 — mobile: remove search + sign-out from top ===== */
@media(max-width:720px){
  .dac-topbar .dac-tb-search { display:none !important; }
  .dac-topbar .dac-tb-stack,
  .dac-topbar .dac-tb-signout,
  .dac-topbar .dac-tb-chip { display:none !important; }
  /* Slim the top down to just the brand row */
  :root { --dac-topbar-h: auto; }
  .dac-topbar { padding:12px 14px !important; }
}

/* ===== ADMIN_SEARCH_SHEET_CSS_v1 — full-screen admin search sheet ===== */
#dacAdminSearch{ display:none; position:fixed; inset:0; z-index:1300; background:#fff; flex-direction:column; }
#dacAdminSearch.open{ display:flex; }
#dacAdminSearch .das-bar{ display:flex; align-items:center; gap:8px; padding:12px; background:#0f172a; }
#dacAdminSearch .das-close{ background:none; border:none; color:#fff; font-size:22px; cursor:pointer; padding:4px 8px; flex-shrink:0; }
#dacAdminSearch .das-input{ flex:1; height:44px; border:none; border-radius:10px; padding:0 14px; font-size:16px; outline:none; background:#fff; }
#dacAdminSearch .das-go{ background:#2563eb; color:#fff; border:none; border-radius:10px; height:44px; padding:0 16px; font-size:15px; font-weight:600; cursor:pointer; flex-shrink:0; }
#dacAdminSearch .das-hint{ padding:16px; color:#94a3b8; font-size:13px; }

/* ===== ADMIN_MENU_SIGNOUT_CSS_v1 — sign out item at bottom of menu ===== */
.dac-sb-signout{ margin-top:8px; border-top:1px solid rgba(255,255,255,0.1); color:#fca5a5 !important; }
.dac-sb-signout i{ color:#fca5a5 !important; }
.dac-sb-signout:hover{ background:rgba(239,68,68,0.12) !important; }

/* ===== ADMIN_MENU_SCROLL_v1 — make the menu overlay scrollable on mobile ===== */
@media(max-width:720px){
  .dac-sidebar{
    max-height:100dvh !important;
    height:100dvh !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
    padding-bottom:80px !important;
    box-sizing:border-box !important;
  }
}

/* ===== ADMIN_BB_SIZE_v1 — bottom bar icons 1.4x ===== */
@media(max-width:720px){
  .dac-bottombar{ height:78px !important; }
  .dac-bb-btn i{ font-size:34px !important; }
  .dac-bb-btn span{ font-size:11px !important; }
  .dac-bb-btn{ gap:4px !important; }
  /* content clears the taller bar */
  .dac-content, .dac-main { padding-bottom:90px !important; }
  /* menu clears the taller bar too */
  .dac-sidebar{ padding-bottom:94px !important; }
}

/* ===== ADMIN_HEADER_CENTERED_CSS_v1 — white, taller, centered layout (match dealer header) ===== */
:root{ --dac-topbar-h: 112px; }

/* White topbar (sidebar stays navy via the shared var) */
.dac-topbar{
  background:#ffffff !important;
  color:#0f172a !important;
  border-bottom:1px solid #e5e7eb !important;
  align-items:center !important;
  padding:0 22px !important;
  gap:16px !important;
}

/* Left + right nav clusters -> soft-blue 2x2 grid */
.dac-topbar .dac-tb-nav,
.dac-topbar .dac-tb-right{
  display:grid !important;
  grid-template-columns:repeat(2,auto) !important;
  gap:6px !important;
  flex-shrink:0 !important;
}
.dac-topbar .dac-tb-ico{
  display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important;
  gap:2px !important;
  width:56px !important; height:44px !important;
  background:#eef2ff !important; color:#185FA5 !important;
  border:none !important; border-radius:12px !important; cursor:pointer !important;
  font-size:12px !important; text-decoration:none !important;
}
.dac-topbar .dac-tb-ico i{ font-size:17px !important; color:#185FA5 !important; }
.dac-topbar .dac-tb-ico span{ font-size:9px !important; color:#185FA5 !important; line-height:1 !important; }
.dac-topbar .dac-tb-ico:hover{ background:#dbe4ff !important; color:#0C447C !important; }

/* Center column: title + page subtitle + search, stacked & centered */
.dac-topbar .dac-tb-brandcol{
  flex:1 1 auto !important;
  display:flex !important; flex-direction:column !important;
  align-items:center !important; justify-content:center !important;
  min-width:0 !important; gap:0 !important;
}
.dac-topbar .dac-tb-brand{
  display:flex !important; flex-direction:column !important; align-items:center !important; gap:1px !important;
}
.dac-topbar .dac-tb-brand .name{
  font-size:23px !important; font-weight:800 !important; color:#0f172a !important; letter-spacing:-0.01em !important; line-height:1.1 !important;
}
.dac-topbar .dac-tb-brand .page{
  font-size:11px !important; font-weight:600 !important; color:#64748b !important;
  text-transform:uppercase !important; letter-spacing:0.06em !important; font-style:normal !important; margin-top:2px !important;
}
.dac-topbar .dac-tb-search{
  flex:none !important; width:min(480px,46vw) !important; max-width:none !important;
  margin-top:9px !important;
}
.dac-topbar .dac-tb-search input{
  background:#ffffff !important; border:1px solid #e5e7eb !important; color:#0f172a !important;
  border-radius:22px !important; height:38px !important;
}
.dac-topbar .dac-tb-search input::placeholder{ color:#94a3b8 !important; }
.dac-topbar .dac-tb-search .icon{ color:#94a3b8 !important; }

/* Right cluster: avatar chip -> soft-blue square, red Sign out kept distinct */
.dac-topbar .dac-tb-stack{ display:contents !important; }
.dac-topbar .dac-tb-chip{
  display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important;
  width:56px !important; height:44px !important;
  background:#eef2ff !important; color:#185FA5 !important; border-radius:12px !important; gap:1px !important;
}
.dac-topbar .dac-tb-chip .av{ font-size:13px !important; font-weight:700 !important; color:#185FA5 !important; background:none !important; }
.dac-topbar .dac-tb-chip .nm{ display:none !important; }
.dac-topbar .dac-tb-signout{
  display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important;
  gap:2px !important;
  width:56px !important; height:44px !important;
  background:#FDECEC !important; color:#DC3545 !important; border:none !important; border-radius:12px !important;
  font-size:9px !important; cursor:pointer !important;
}
.dac-topbar .dac-tb-signout i{ font-size:16px !important; }
.dac-topbar .dac-tb-signout:hover{ background:#f9d7d7 !important; }

/* HDR_COUNTRY_SWITCHER_v1 */
.dac-tb-ctry{ position:relative; }
.dac-tb-ctry-btn{ display:flex; align-items:center; gap:8px; height:52px; box-sizing:border-box;
  background:var(--surface-1,#f6f7f9); border:1px solid #d5d9e0; border-radius:10px; padding:8px 12px; cursor:pointer; }
.dac-tb-ctry-btn:hover{ border-color:#b6bcc7; }
.dac-tb-ctry-btn .fl{ font-size:18px; line-height:1; }
.dac-tb-ctry-btn .tx{ display:flex; flex-direction:column; align-items:flex-start; line-height:1.15; }
.dac-tb-ctry-btn .lb{ font-size:9px; letter-spacing:.04em; color:#8b93a1; }
.dac-tb-ctry-btn .nm{ font-size:13px; font-weight:500; color:#1f2733; }
.dac-tb-ctry-btn .ch{ font-size:15px; color:#5f6b7a; }
.dac-tb-ctry-menu{ position:absolute; right:0; top:calc(100% + 6px); width:250px; z-index:50;
  background:#fff; border:1px solid #d5d9e0; border-radius:12px; overflow:hidden; box-shadow:0 8px 24px rgba(0,0,0,.12); }
.dac-tb-ctry-menu .hd{ padding:8px 12px; font-size:10px; letter-spacing:.06em; color:#8b93a1; border-bottom:1px solid #eceef1; }
.dac-tb-ctry-menu .it{ display:flex; align-items:center; gap:10px; padding:9px 12px; cursor:pointer; }
.dac-tb-ctry-menu .it:hover{ background:#f4f6f8; }
.dac-tb-ctry-menu .it.on{ background:#eaf1fb; }
.dac-tb-ctry-menu .it .fl{ font-size:17px; line-height:1; }
.dac-tb-ctry-menu .it .nm{ flex:1; font-size:13px; font-weight:500; color:#1f2733; }
.dac-tb-ctry-menu .it.on .nm{ color:#185fa5; }
.dac-tb-ctry-menu .it .ck{ font-size:15px; color:#185fa5; }

/* HDR_HIDE_SBTOGGLE_v1 — remove far-right sidebar toggle, push Alerts+switcher to far right */
.dac-sb-toggle{ display:none !important; }
.dac-tb-right{ margin-left:auto; }

/* HDR_SLIMBTN_HIDE_v1 — kill the auto-hide slim hamburger that overlays the header/switcher */
.dac-hdr-slimbtn{ display:none !important; }
.dac-topbar.dac-hdr-slim{ transform:none !important; }
.dac-tb-ctry, .dac-tb-ctry-btn, .dac-tb-ctry-menu{ pointer-events:auto !important; }
.dac-tb-ctry{ z-index:60; }

/* CTRY_SEARCH_v1 — country switcher search box */
.dac-ctry-search{
  width: calc(100% - 20px);
  margin: 6px 10px 8px;
  padding: 8px 10px;
  border: 1px solid #d7dce3;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
.dac-ctry-search:focus{ border-color:#185fa5; box-shadow:0 0 0 3px rgba(24,95,165,.12); }


/* HDR_BTN_LARGER_v1 - single row, larger, spaced; same gray/blue style */
.dac-topbar .dac-tb-nav{
  display:flex !important;
  flex-direction:row !important;
  grid-template-columns:none !important;
  grid-template-rows:none !important;
  gap:12px !important;
  align-items:center !important;
}
.dac-topbar .dac-tb-nav .dac-tb-ico{
  width:64px !important;
  height:60px !important;
  gap:4px !important;
  border-radius:10px !important;
}
.dac-topbar .dac-tb-nav .dac-tb-ico i{ font-size:20px !important; }
.dac-topbar .dac-tb-nav .dac-tb-ico span{ font-size:11px !important; }
@media(max-width:640px){
  .dac-topbar .dac-tb-nav{ gap:8px !important; }
  .dac-topbar .dac-tb-nav .dac-tb-ico{ width:52px !important; height:50px !important; }
  .dac-topbar .dac-tb-nav .dac-tb-ico i{ font-size:18px !important; }
  .dac-topbar .dac-tb-nav .dac-tb-ico span{ font-size:10px !important; }
}
