/* MarketWeb Super Admin Console — Gentelella-Inspired Control Plane
   Signature Palette: Deep Slate Sidebar (#2A3F54) + Gentelella Teal (#1ABB9C / #14967C)
   + Crisp Light Canvas (#F7F7F7) + Structured x_panel Cards (#FFFFFF)
   Zero Bootstrap / Zero jQuery / Zero external CDNs · Logical CSS (RTL/LTR) · Strict CSP */

:root {
  --mw-sidebar-bg: #2a3f54;
  --mw-sidebar-dark: #172d44;
  --mw-sidebar-hover: #354b60;
  --mw-sidebar-ink: #e7ecef;
  --mw-sidebar-muted: #9eb1c2;
  --mw-teal: #1abb9c;
  --mw-teal-dark: #138a72;
  --mw-canvas: #f5f7f9;
  --mw-card: #ffffff;
  --mw-topbar: #ffffff;
  --mw-ink: #2b3a4a;
  --mw-muted: #607080;
  --mw-line: #e2e7ee;
  --mw-ok: #148a5b;
  --mw-ok-soft: #e4f7ef;
  --mw-warn: #b4690e;
  --mw-warn-soft: #fef3e2;
  --mw-danger: #c62828;
  --mw-danger-soft: #fdeaea;
  --mw-info: #1e6bb8;
  --mw-info-soft: #e8f3fc;
  --mw-sidebar-w: 256px;
  --mw-sidebar-mini: 74px;
  --mw-font: "Segoe UI", Tahoma, Arial, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--mw-font);
  background: var(--mw-canvas);
  color: var(--mw-ink);
  font-size: 0.94rem;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.84em;
  background: #eef2f6;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-block-start: -100px; inset-inline-start: 1rem;
  background: var(--mw-teal-dark); color: #ffffff; padding: 0.55rem 1.1rem; border-radius: 6px; z-index: 1000;
}
.skip-link:focus { inset-block-start: 1rem; }

/* Main Shell */
.admin-shell {
  display: grid;
  grid-template-columns: var(--mw-sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}
.admin-shell.is-collapsed {
  grid-template-columns: var(--mw-sidebar-mini) minmax(0, 1fr);
}

/* Signature Gentelella Sidebar */
.sidebar {
  background: var(--mw-sidebar-bg);
  color: var(--mw-sidebar-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  inset-block-start: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}
.sidebar__brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.1rem;
  border-block-end: 1px solid rgba(255, 255, 255, 0.08);
}
.site-title { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.site-title__icon {
  flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  display: grid; place-items: center;
  color: var(--mw-teal);
}
.site-title__label { display: flex; flex-direction: column; line-height: 1.15; overflow: hidden; }
.site-title__label strong { font-size: 1.18rem; font-weight: 800; color: #ffffff; }
.site-title__label small { font-size: 0.65rem; letter-spacing: 0.14em; color: var(--mw-teal); font-weight: 700; }
.sidebar__mobile-close {
  display: none; border: 0; background: transparent; color: #ffffff; font-size: 1.5rem; cursor: pointer;
}

.profile-card {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-block-end: 1px solid rgba(255, 255, 255, 0.08);
}
.profile-card__avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: var(--mw-teal-dark); color: #ffffff;
  font-weight: 800; font-size: 1.1rem; display: grid; place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.profile-card__info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.profile-card__info span { font-size: 0.75rem; color: var(--mw-sidebar-muted); }
.profile-card__info strong { font-size: 0.96rem; color: #ffffff; }
.mfa-pill { font-size: 0.72rem; color: #79f2d8; font-weight: 700; }

.side-nav { flex: 1; padding: 0.9rem 0; display: flex; flex-direction: column; gap: 1.2rem; }
.menu-group__title {
  margin: 0 0 0.45rem;
  padding-inline: 1.15rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--mw-sidebar-muted);
  font-weight: 700;
}
.menu-group ul { list-style: none; margin: 0; padding: 0; }
.side-link {
  width: 100%;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.72rem 1.15rem;
  border: 0;
  border-inline-end: 4px solid transparent;
  background: transparent;
  color: var(--mw-sidebar-ink);
  font-weight: 600; font-size: 0.91rem;
  text-align: start; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.side-link:hover { background: var(--mw-sidebar-hover); color: #ffffff; }
.side-link.is-active {
  background: linear-gradient(90deg, rgba(26, 187, 156, 0.16), rgba(26, 187, 156, 0.06));
  border-inline-end-color: var(--mw-teal);
  color: #ffffff;
}
.side-link svg { flex: none; opacity: 0.9; }
.nav-badge {
  margin-inline-start: auto;
  background: var(--mw-teal-dark); color: #ffffff;
  font-size: 0.72rem; font-weight: 700;
  padding: 0.1rem 0.48rem; border-radius: 999px;
}
.nav-badge--warn { background: #d97706; }

/* Collapsed Mini Sidebar (Gentelella nav-sm) */
.admin-shell.is-collapsed .site-title__label,
.admin-shell.is-collapsed .profile-card,
.admin-shell.is-collapsed .menu-group__title,
.admin-shell.is-collapsed .side-link span,
.admin-shell.is-collapsed .sidebar__footer { display: none; }
.admin-shell.is-collapsed .side-link { justify-content: center; padding-inline: 0.5rem; }

/* Sidebar Bottom Utility Bar */
.sidebar__footer {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--mw-sidebar-dark);
  border-block-start: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-tool {
  display: grid; place-items: center;
  padding-block: 0.75rem; border: 0; background: transparent;
  color: var(--mw-sidebar-muted); cursor: pointer;
}
.footer-tool:hover { background: var(--mw-sidebar-hover); color: var(--mw-teal); }

/* Workspace & Topbar */
.workspace { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; inset-block-start: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1.4rem;
  background: var(--mw-topbar);
  border-block-end: 1px solid var(--mw-line);
}
.topbar__start, .topbar__end { display: flex; align-items: center; gap: 0.8rem; }
.topbar__start { flex: 1; min-width: 0; }
.global-search { flex: 1; max-width: 420px; }
.global-search input {
  width: 100%;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--mw-line);
  border-radius: 999px;
  background: var(--mw-canvas);
  font-size: 0.88rem;
}
.global-search input:focus { outline: 2px solid var(--mw-teal); border-color: transparent; background: #ffffff; }

.host-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.8rem; font-weight: 700; color: var(--mw-muted);
  background: var(--mw-canvas); border: 1px solid var(--mw-line);
  padding: 0.32rem 0.75rem; border-radius: 999px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot--ok { background: var(--mw-teal); }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--mw-line); background: #ffffff; color: var(--mw-ink);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--mw-teal-dark); color: var(--mw-teal-dark); }
.alert-badge {
  position: absolute; inset-block-start: -4px; inset-inline-end: -4px;
  min-width: 19px; height: 19px; border-radius: 999px;
  background: var(--mw-danger); color: #ffffff; font-size: 0.7rem; font-weight: 700;
  display: grid; place-items: center;
}

.alerts-wrap { position: relative; }
.dropdown-menu {
  position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0;
  width: min(340px, 90vw);
  background: #ffffff; border: 1px solid var(--mw-line); border-radius: 10px;
  box-shadow: 0 14px 36px rgba(23, 45, 68, 0.16);
  overflow: hidden; z-index: 60;
}
.dropdown-menu[hidden] { display: none; }
.dropdown-menu__head { padding: 0.75rem 1rem; background: var(--mw-canvas); border-block-end: 1px solid var(--mw-line); }
.alerts-list { list-style: none; margin: 0; padding: 0; }
.alerts-list li { border-block-end: 1px solid var(--mw-line); }
.alerts-list li:last-child { border-block-end: 0; }
.alerts-list button {
  width: 100%; border: 0; background: #ffffff; padding: 0.75rem 1rem;
  text-align: start; font-size: 0.84rem; display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer;
}
.alerts-list button:hover { background: var(--mw-canvas); }

.admin-chip { display: flex; align-items: center; gap: 0.55rem; }
.admin-chip__avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--mw-sidebar-bg); color: #ffffff;
  font-weight: 800; display: grid; place-items: center;
}
.admin-chip__text { display: flex; flex-direction: column; line-height: 1.15; font-size: 0.82rem; }
.admin-chip__text small { color: var(--mw-muted); font-size: 0.72rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.58rem 1.15rem; border-radius: 6px;
  border: 1px solid transparent; font-weight: 700; font-size: 0.88rem;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.btn--primary { background: var(--mw-teal-dark); color: #ffffff; }
.btn--primary:hover { background: #0e705c; }
.btn--ghost { background: #ffffff; border-color: var(--mw-line); color: var(--mw-ink); }
.btn--ghost:hover { border-color: var(--mw-sidebar-bg); }
.btn--danger { background: var(--mw-danger); color: #ffffff; }
.btn--danger:hover { background: #9c1f1f; }
.btn--sm { padding: 0.42rem 0.85rem; font-size: 0.82rem; }
.btn--xs { padding: 0.28rem 0.62rem; font-size: 0.76rem; }
.link-btn { border: 0; background: none; color: var(--mw-teal-dark); font-weight: 700; font-size: 0.84rem; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Content Area */
.content { flex: 1; padding: 1.4rem; display: flex; flex-direction: column; gap: 1.25rem; }
.view-section[hidden] { display: none; }

.toast {
  padding: 0.8rem 1.1rem; border-radius: 8px;
  background: var(--mw-sidebar-bg); color: #ffffff;
  font-weight: 600; border-inline-start: 4px solid var(--mw-teal);
}
.toast[hidden] { display: none; }

.page-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-block-end: 1.2rem;
}
.page-head h1 { margin: 0 0 0.25rem; font-size: clamp(1.3rem, 2.2vw, 1.65rem); font-weight: 800; }
.page-head p { margin: 0; color: var(--mw-muted); font-size: 0.9rem; }
.page-head__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Signature Gentelella tile_count Strip */
.tile-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  background: var(--mw-card);
  border: 1px solid var(--mw-line);
  border-radius: 8px;
  margin-block-end: 1.25rem;
  overflow: hidden;
}
.tile-stat {
  padding: 1rem 1.1rem;
  border-inline-end: 1px solid var(--mw-line);
  display: flex; flex-direction: column; gap: 0.2rem;
}
.tile-stat:last-child { border-inline-end: 0; }
.tile-stat__label { font-size: 0.78rem; color: var(--mw-muted); font-weight: 700; }
.tile-stat__val { font-size: 1.65rem; font-weight: 800; color: var(--mw-ink); line-height: 1.2; }
.tile-stat__val small { font-size: 0.85rem; font-weight: 700; }
.tile-stat__meta { font-size: 0.76rem; color: var(--mw-muted); }
.text-ok { color: var(--mw-ok); }
.text-warn { color: var(--mw-warn); }

/* Signature Gentelella x_panel */
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-block-end: 1.25rem; }
.dashboard-grid--wide { grid-template-columns: 1.35fr 1fr; }
.dashboard-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.x-panel {
  background: var(--mw-card);
  border: 1px solid var(--mw-line);
  border-radius: 8px;
  display: flex; flex-direction: column;
  margin-block-end: 1.25rem;
}
.dashboard-grid .x-panel { margin-block-end: 0; }
.x-panel__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.65rem 0.8rem;
  padding: 0.9rem 1.2rem;
  border-block-end: 2px solid var(--mw-line);
}
.security-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.x-panel__head--wrap { flex-wrap: wrap; }
.x-panel__head h2 { margin: 0; font-size: 1.04rem; font-weight: 800; }
.x-panel__head h2 small { font-weight: 500; color: var(--mw-muted); font-size: 0.82rem; margin-inline-start: 0.4rem; }
.x-panel__body { padding: 1.15rem 1.2rem; }

/* Segmented Controls & Chart */
.segmented { display: inline-flex; border: 1px solid var(--mw-line); border-radius: 6px; overflow: hidden; }
.seg-btn { border: 0; background: #ffffff; padding: 0.32rem 0.75rem; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.seg-btn.is-active { background: var(--mw-sidebar-bg); color: #ffffff; }

.chart-legend { display: flex; gap: 1.2rem; font-size: 0.82rem; color: var(--mw-muted); margin-block-end: 0.8rem; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-inline-end: 0.3rem; vertical-align: middle; }
.swatch--teal { background: var(--mw-teal); }
.swatch--navy { background: var(--mw-sidebar-bg); }
.svg-chart-wrap svg { width: 100%; height: auto; display: block; }

/* Health & Progress Lists */
.health-list, .progress-list, .compact-list, .audit-mini-list {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.85rem;
}
.health-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 0.8rem;
  padding-block-end: 0.75rem; border-block-end: 1px dashed var(--mw-line);
}
.health-list li:last-child { border-block-end: 0; padding-block-end: 0; }
.health-list strong { display: block; font-size: 0.9rem; }
.health-list small { color: var(--mw-muted); font-size: 0.78rem; }

.progress-row { display: flex; justify-content: space-between; font-size: 0.86rem; margin-block-end: 0.35rem; }
.progress-track { height: 9px; border-radius: 999px; background: #edf1f5; overflow: hidden; }
.progress-fill { display: block; height: 100%; border-radius: 999px; }
.progress-fill--teal { background: var(--mw-teal); }
.progress-fill--blue { background: #3498db; }
.progress-fill--purple { background: #7b5cd6; }
.progress-fill--amber { background: #e69119; }
.progress-fill--slate { background: #5a6d82; }
.w-34 { width: 34%; } .w-24 { width: 24%; } .w-18 { width: 18%; } .w-12 { width: 12%; }

.compact-list li, .audit-mini-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 0.65rem;
  padding-block-end: 0.7rem; border-block-end: 1px solid var(--mw-line); font-size: 0.86rem;
}
.compact-list li:last-child, .audit-mini-list li:last-child { border-block-end: 0; padding-block-end: 0; }
.compact-list small, .audit-mini-list small { display: block; color: var(--mw-muted); font-size: 0.76rem; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.18rem 0.58rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700; white-space: nowrap;
}
.badge--ok { background: var(--mw-ok-soft); color: var(--mw-ok); }
.badge--warn { background: var(--mw-warn-soft); color: var(--mw-warn); }
.badge--danger { background: var(--mw-danger-soft); color: var(--mw-danger); }
.badge--info { background: var(--mw-info-soft); color: var(--mw-info); }
.badge--muted { background: #edf1f5; color: var(--mw-muted); }

/* Filters & Tables */
.filter-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pill-tab {
  border: 1px solid var(--mw-line); background: #ffffff; color: var(--mw-muted);
  padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.82rem; font-weight: 700; cursor: pointer;
}
.pill-tab.is-active, .pill-tab:hover { background: var(--mw-sidebar-bg); border-color: var(--mw-sidebar-bg); color: #ffffff; }
.table-search {
  padding: 0.45rem 0.85rem; border: 1px solid var(--mw-line); border-radius: 6px;
  min-width: 240px; font-size: 0.86rem;
}

.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th, .data-table td {
  padding: 0.82rem 1rem; text-align: start; border-block-end: 1px solid var(--mw-line); vertical-align: middle;
}
.data-table th { background: #f8fafc; color: var(--mw-muted); font-size: 0.8rem; font-weight: 800; white-space: nowrap; }
.data-table tbody tr:hover { background: #fafcfd; }
.table-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* Plans & Templates Grids */
.plans-grid, .templates-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-block-end: 1.25rem; }
.plan-card { padding: 1.35rem; }
.plan-card--featured { border: 2px solid var(--mw-teal); }
.plan-card__head h3 { margin: 0.65rem 0 0.3rem; font-size: 1.15rem; }
.plan-price { margin: 0 0 1rem; color: var(--mw-muted); }
.plan-price strong { font-size: 1.55rem; color: var(--mw-ink); }
.plan-limits { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; font-size: 0.88rem; }

.tpl-card { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.tpl-card__top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.tpl-card h3 { margin: 0; font-size: 1.08rem; }
.tpl-card p { margin: 0; font-size: 0.86rem; color: var(--mw-muted); flex: 1; }
.tpl-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.78rem; color: var(--mw-muted); }

/* Footer */
.admin-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem;
  padding: 0.9rem 1.4rem; background: #ffffff; border-block-start: 1px solid var(--mw-line);
  font-size: 0.8rem; color: var(--mw-muted);
}

/* Modal & Drawer */
.modal[hidden], .drawer[hidden], .sidebar-backdrop[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; }
.modal__backdrop, .drawer__backdrop, .sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(23, 45, 68, 0.55); z-index: 45;
}
.modal__panel {
  position: relative; z-index: 101; width: min(560px, 100%);
  max-height: calc(100vh - 2rem); overflow-y: auto;
  background: #ffffff; border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.modal__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-block-end: 1px solid var(--mw-line);
}
.modal__head h3 { margin: 0; font-size: 1.1rem; }
.modal__form { padding: 1.2rem 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; }
.modal__notice {
  margin: 0; padding: 0.75rem 0.9rem; border-radius: 6px;
  background: var(--mw-warn-soft); color: var(--mw-warn); font-size: 0.86rem;
}
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.form-row { display: flex; flex-direction: column; gap: 0.35rem; }
.form-row label { font-size: 0.84rem; font-weight: 700; }
.form-row input, .form-row select, .form-row textarea {
  padding: 0.55rem 0.75rem; border: 1px solid var(--mw-line); border-radius: 6px; background: #ffffff;
}
.modal__foot { display: flex; justify-content: flex-end; gap: 0.65rem; padding-block-start: 0.5rem; }

.drawer { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.drawer__panel {
  position: relative; z-index: 101; width: min(460px, 100%); height: 100%;
  background: #ffffff; display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
}
.drawer__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem;
  padding: 1.1rem 1.25rem; border-block-end: 1px solid var(--mw-line); background: var(--mw-canvas);
}
.drawer__head h3 { margin: 0.35rem 0 0; }
.drawer__body { flex: 1; overflow-y: auto; padding: 1.2rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.detail-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.detail-box { padding: 0.75rem; border: 1px solid var(--mw-line); border-radius: 6px; background: var(--mw-canvas); }
.detail-box small { display: block; color: var(--mw-muted); font-size: 0.75rem; }
.detail-box strong { font-size: 0.92rem; }

/* Responsive */
@media (max-width: 1200px) {
  .tile-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile-stat { border-block-end: 1px solid var(--mw-line); }
  .dashboard-grid--wide, .dashboard-grid--three, .plans-grid, .templates-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .admin-shell, .admin-shell.is-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px;
    transform: translateX(105%); transition: transform 0.22s ease;
  }
  [dir="ltr"] .sidebar { transform: translateX(-105%); }
  .sidebar.is-mobile-open { transform: translateX(0); }
  .sidebar__mobile-close { display: inline-block; }
  .host-pill, .admin-chip__text { display: none; }
  .dashboard-grid, .form-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .tile-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { padding-inline: 0.85rem; }
  .content { padding: 0.95rem; }
}

/* Live Django Admin Login & Action Helpers */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(150deg, #1f3041 0%, #2a3f54 55%, #172d44 100%);
}
.login-card {
  width: min(440px, 100%);
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.login-card__head {
  background: #2a3f54;
  color: #ffffff;
  padding: 1.5rem;
  border-block-end: 3px solid var(--mw-teal);
}
.login-brand { display: flex; align-items: center; gap: 0.75rem; margin-block-end: 0.9rem; }
.login-brand strong { display: block; font-size: 1.25rem; }
.login-brand small { color: var(--mw-teal); font-size: 0.68rem; letter-spacing: 0.14em; font-weight: 700; }
.login-card__head h1 { margin: 0 0 0.25rem; font-size: 1.2rem; }
.login-card__head p { margin: 0; font-size: 0.85rem; color: #c7d5e2; }
.login-card__head code { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.login-error {
  margin: 1rem 1.25rem 0;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  background: var(--mw-danger-soft);
  color: var(--mw-danger);
  font-weight: 700;
  font-size: 0.86rem;
}
.login-footnote {
  margin: 0;
  padding: 0.85rem 1.25rem 1.2rem;
  font-size: 0.78rem;
  color: var(--mw-muted);
  text-align: center;
}
.inline-form { display: inline; margin: 0; }
.footer-tool--full { width: 100%; height: 100%; }
.form-inline-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.75rem; align-items: center; }
.checkbox-row { display: flex; align-items: center; gap: 0.55rem; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.subhead { margin: 1.2rem 0 0.7rem; font-size: 0.96rem; }
.toast--error { background: #7f1d1d; border-inline-start-color: #f87171; }
.toast--warning { background: #78350f; border-inline-start-color: #fbbf24; }
.toast--success { background: #14532d; border-inline-start-color: var(--mw-teal); }
.toast { word-break: break-word; line-height: 1.55; }
.plan-card__badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-block-end: 0.45rem; }
.plan-desc { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--mw-muted); }
.plan-limits {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem;
  padding: 0.65rem; border-radius: 6px; background: var(--mw-canvas);
  font-size: 0.8rem; color: var(--mw-ink);
}
.plan-feature-list {
  margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column;
  gap: 0.35rem; font-size: 0.84rem; color: var(--mw-ink);
}
.plan-editor { margin-block-start: 0.5rem; border-block-start: 1px dashed var(--mw-line); padding-block-start: 0.7rem; }
.plan-editor summary { list-style: none; cursor: pointer; width: 100%; justify-content: center; }
.plan-editor summary::-webkit-details-marker { display: none; }
.plan-editor__form { display: flex; flex-direction: column; gap: 0.75rem; margin-block-start: 0.85rem; }
.plan-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.modal__form--compact { padding: 0; }
.helper-note { margin: 0 0 0.75rem; font-size: 0.86rem; color: var(--mw-muted); line-height: 1.6; }
.text-muted { color: var(--mw-muted); font-size: 0.78rem; }
.text-danger { color: var(--mw-danger); }
.cf-portal-wrap { width: min(980px, 100%); margin-inline: auto; display: flex; flex-direction: column; gap: 1rem; }
.cf-portal-wrap > .login-card { margin-inline: auto; }
.cf-editor-shell { background: var(--mw-canvas); padding: 1.25rem; border-radius: 12px; display: flex; flex-direction: column; gap: 1rem; }
.cf-editor-shell[hidden], .login-card[hidden], .login-error[hidden], .toast[hidden] { display: none; }
.cf-editor-shell table input { width: 100%; padding: 0.4rem 0.55rem; border: 1px solid var(--mw-line); border-radius: 6px; }
@media (max-width: 720px) { .form-inline-grid, .plan-checks { grid-template-columns: 1fr; } }
