/* AutoByte Admin System v1.5.7
   --------------------------------------------------------------------------
   Canonical admin stylesheet.

   Source of truth:
   /portal/admin/assets/css/admin.css

   Design goals:
   - Match the premium dark dashboard language.
   - Keep Admin Overview and Mail Admin on the same shell geometry.
   - Use one shared header style across admin pages.
   - Keep glow subtle, consistent and non-distracting.
*/

/* --------------------------------------------------------------------------
   01. Design tokens and base reset
-------------------------------------------------------------------------- */

:root {
  --ab-bg: #020713;
  --ab-bg-deep: #01040b;
  --ab-surface: rgba(5, 14, 29, 0.78);
  --ab-surface-strong: rgba(7, 16, 32, 0.86);
  --ab-surface-soft: rgba(255, 255, 255, 0.028);
  --ab-text: rgba(248, 251, 255, 0.98);
  --ab-muted: rgba(202, 215, 235, 0.68);
  --ab-soft: rgba(225, 235, 250, 0.78);
  --ab-line: rgba(154, 183, 230, 0.105);
  --ab-line-strong: rgba(205, 225, 255, 0.18);
  --ab-cyan: #56d9ff;
  --ab-green: #63f2b6;
  --ab-violet: #8f6cff;
  --ab-copper: #c68448;
  --ab-danger: #ff6b7a;
  --ab-radius-xl: 32px;
  --ab-radius-lg: 24px;
  --ab-radius-md: 18px;
  --ab-shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
  --ab-ease: cubic-bezier(0.22, 0.8, 0.18, 1);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--ab-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ab-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(85, 215, 255, 0.10), transparent 36%),
    radial-gradient(circle at 82% 8%, rgba(198, 132, 72, 0.08), transparent 34%),
    linear-gradient(180deg, #030b18 0%, #020713 42%, #01040b 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(rgba(160, 210, 255, 0.26) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 78%);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }

/* --------------------------------------------------------------------------
   02. Shared admin shell and header
-------------------------------------------------------------------------- */

.admin-shell {
  width: min(100% - 36px, 1580px);
  max-width: 1580px;
  margin: 0 auto;
  padding: 24px 0 52px;
}

.admin-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid var(--ab-line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.034), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(18px) saturate(1.15);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.admin-brand-mark {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 10px 24px rgba(45,165,255,0.24));
}

.admin-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-nav a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--ab-line);
  border-radius: 999px;
  color: rgba(234, 242, 255, 0.86);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 900;
  transition: transform 0.22s var(--ab-ease), border-color 0.22s var(--ab-ease), background 0.22s var(--ab-ease);
}

.admin-nav a:hover {
  transform: translateY(-1px);
  border-color: rgba(86, 217, 255, 0.34);
  background: rgba(86, 217, 255, 0.07);
}

/* --------------------------------------------------------------------------
   03. Shared admin workspace layout
-------------------------------------------------------------------------- */

.admin-workspace-frame {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.admin-sidebar {
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 132px);
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--ab-line);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(7, 16, 32, 0.86), rgba(2, 7, 16, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.admin-sidebar::before {
  content: "";
  position: absolute;
  inset: -10% auto auto -36%;
  width: 220px;
  height: 220px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(86, 217, 255, 0.045), transparent 68%);
}

.admin-sidebar > * {
  position: relative;
  z-index: 1;
}

.admin-side-profile {
  padding: 12px;
  border: 1px solid rgba(147, 178, 222, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.025);
}

.admin-side-profile strong,
.admin-side-profile span:not(.admin-pill) {
  display: block;
}

.admin-side-profile strong {
  margin-top: 12px;
  font-size: 1.3rem;
  letter-spacing: -0.055em;
}

.admin-side-profile span:not(.admin-pill) {
  margin-top: 4px;
  color: var(--ab-muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.admin-side-nav {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.admin-side-item,
.admin-subnav-item {
  position: relative;
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 12px 13px;
  border: 1px solid rgba(147, 178, 222, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ab-ease), background 0.2s var(--ab-ease), box-shadow 0.2s var(--ab-ease);
}

.admin-side-item span,
.admin-subnav-item span {
  color: rgba(245, 248, 255, 0.94);
  font-weight: 950;
  letter-spacing: -0.035em;
}

.admin-side-item small,
.admin-subnav-item small {
  color: rgba(158, 171, 193, 0.82);
  font-size: 0.76rem;
  font-weight: 750;
}

.admin-side-item:hover,
.admin-subnav-item:hover {
  border-color: rgba(86, 217, 255, 0.22);
  background: rgba(86, 217, 255, 0.045);
}

.admin-side-item.active,
.admin-subnav-item.active {
  border-color: rgba(86, 217, 255, 0.28);
  background: linear-gradient(135deg, rgba(86, 217, 255, 0.082), rgba(167, 139, 250, 0.038));
  box-shadow: 0 0 18px rgba(86, 217, 255, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.036);
}

.admin-side-item.is-muted {
  opacity: 0.62;
}

.admin-nav-group {
  display: grid;
  gap: 7px;
}

.admin-nav-group summary {
  list-style: none;
}

.admin-nav-group summary::-webkit-details-marker {
  display: none;
}

.admin-nav-group summary::after {
  content: "+";
  position: absolute;
  right: 13px;
  top: 13px;
  color: rgba(158, 171, 193, 0.9);
  font-weight: 950;
}

.admin-nav-group[open] summary::after {
  content: "−";
}

.admin-subnav {
  display: grid;
  gap: 7px;
  padding-left: 12px;
}

.admin-subnav-item {
  padding: 10px 12px;
  border-radius: 16px;
}

.admin-side-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 12px;
  color: var(--ab-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-side-footer a {
  color: #8fe9ff;
}

.admin-side-footer small {
  color: rgba(190, 205, 228, 0.48);
  font-weight: 800;
  line-height: 1.45;
}

.admin-main {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   04. Cards, hero areas and grids
-------------------------------------------------------------------------- */

.admin-pill {
  width: max-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(86, 217, 255, 0.22);
  border-radius: 999px;
  background: rgba(86, 217, 255, 0.07);
  color: #8fe9ff;
  font-size: 0.75rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-pill.compact {
  min-height: 26px;
  padding: 0 10px;
  font-size: 0.68rem;
}

.admin-hero-card,
.admin-panel,
.admin-feature-card {
  border: 1px solid var(--ab-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.034), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), var(--ab-shadow);
  backdrop-filter: blur(16px) saturate(1.12);
}

.admin-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
  padding: 26px;
  border-radius: var(--ab-radius-xl);
  background:
    radial-gradient(circle at 12% 6%, rgba(198, 132, 72, 0.08), transparent 34%),
    radial-gradient(circle at 86% 10%, rgba(85, 215, 255, 0.07), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.034), rgba(255, 255, 255, 0.012));
}

.admin-hero-copy h1,
.template-editor-title-block h1 {
  max-width: 900px;
  margin: 14px 0 0;
  font-size: clamp(2.65rem, 4.2vw, 4.5rem);
  line-height: 0.92;
  letter-spacing: -0.085em;
  text-wrap: balance;
}

.admin-hero-copy p,
.template-editor-title-block p,
.admin-panel-head p {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(184, 196, 216, 0.84);
  font-weight: 650;
  line-height: 1.58;
}

.admin-status-card {
  position: relative;
  min-height: 176px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(147, 178, 222, 0.13);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.018));
  overflow: hidden;
}

.admin-status-card::before {
  content: "";
  position: absolute;
  inset: auto -18% -48% 20%;
  height: 130px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(99, 242, 182, 0.12), transparent 68%);
}

.status-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--ab-green);
  box-shadow: 0 0 16px rgba(99, 242, 182, 0.34);
}

.admin-status-card strong,
.admin-status-card span:not(.status-dot) {
  display: block;
  position: relative;
  text-align: left;
}

.admin-status-card strong {
  font-size: 1.18rem;
  letter-spacing: -0.04em;
}

.admin-status-card span:not(.status-dot) {
  max-width: 260px;
  margin-top: 5px;
  color: var(--ab-muted);
  font-weight: 750;
  line-height: 1.45;
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.admin-feature-card {
  min-height: 180px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 22px;
  border-radius: var(--ab-radius-lg);
  transition: transform 0.22s var(--ab-ease), border-color 0.22s var(--ab-ease), background 0.22s var(--ab-ease);
}

.admin-feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--ab-line-strong);
  background: linear-gradient(145deg, rgba(15, 32, 55, 0.80), rgba(5, 14, 27, 0.72));
}

.admin-feature-card > span {
  color: #8fe9ff;
  font-size: 0.76rem;
  font-weight: 1000;
  letter-spacing: 0.13em;
}

.admin-feature-card strong {
  font-size: 1.5rem;
  letter-spacing: -0.055em;
}

.admin-feature-card p {
  max-width: 360px;
  margin: 0;
  color: var(--ab-muted);
  font-weight: 650;
  line-height: 1.5;
}

.admin-two-column,
.admin-panel-layout,
.template-editor-area {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.admin-panel {
  min-width: 0;
  padding: 22px;
  border-radius: var(--ab-radius-lg);
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.admin-panel-head h2 {
  margin: 12px 0 0;
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: -0.06em;
}

.admin-panel-head > span:not(.admin-pill) {
  color: var(--ab-muted);
  font-weight: 850;
}

.admin-route-list,
.smtp-check-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-route-list li,
.smtp-check-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(147, 178, 222, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.024);
}

.admin-route-list span,
.smtp-check-list span {
  color: var(--ab-muted);
  font-weight: 800;
}

.admin-route-list strong,
.smtp-check-list strong {
  color: rgba(245, 248, 255, 0.92);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
  text-align: right;
}

/* --------------------------------------------------------------------------
   05. Mail sections and forms
-------------------------------------------------------------------------- */

.mail-section {
  display: none;
}

.mail-section.active {
  display: block;
}

.mail-locked-panel {
  min-height: 320px;
  display: grid;
  align-content: center;
}

.mail-locked-panel h2 {
  max-width: 760px;
  margin: 14px 0 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.96;
  letter-spacing: -0.08em;
}

.mail-locked-panel p {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--ab-muted);
  font-weight: 650;
  line-height: 1.6;
}

.email-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.email-field,
.email-toggle {
  display: grid;
  gap: 7px;
}

.email-field-wide {
  grid-column: 1 / -1;
}

.email-field span,
.email-toggle span {
  color: rgba(245, 248, 255, 0.86);
  font-size: 0.80rem;
  font-weight: 950;
}

.email-field input,
.email-field textarea,
.email-field select {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid rgba(147, 178, 222, 0.16);
  border-radius: 15px;
  outline: none;
  color: var(--ab-text);
  background: rgba(2, 7, 17, 0.54);
  transition: border-color 0.18s var(--ab-ease), box-shadow 0.18s var(--ab-ease), background 0.18s var(--ab-ease);
}

.email-field textarea {
  min-height: 106px;
  resize: vertical;
}

.email-field input:focus,
.email-field textarea:focus,
.email-field select:focus {
  border-color: rgba(86, 217, 255, 0.36);
  background: rgba(2, 7, 17, 0.72);
  box-shadow: 0 0 0 4px rgba(86, 217, 255, 0.055);
}

.email-field small {
  color: var(--ab-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.email-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(147, 178, 222, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.024);
}

.email-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.admin-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--ab-line);
  border-radius: 999px;
  color: rgba(245, 248, 255, 0.9);
  background: rgba(255, 255, 255, 0.042);
  cursor: pointer;
  font-weight: 950;
}

.admin-button.primary {
  border-color: rgba(86, 217, 255, 0.34);
  background: linear-gradient(135deg, rgba(86, 217, 255, 0.18), rgba(167, 139, 250, 0.10));
}

.admin-button.danger {
  border-color: rgba(255, 107, 122, 0.24);
  color: #ffd7dc;
}

.email-status {
  color: var(--ab-muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.email-status.is-error {
  color: #ff9aa6;
}

/* --------------------------------------------------------------------------
   06. Template editor and email preview
-------------------------------------------------------------------------- */

.template-main .template-editor-area {
  margin-top: 0;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: start;
}

.template-editor-head {
  align-items: flex-start;
}

.template-editor-title-block h1 {
  font-size: clamp(2.25rem, 4vw, 3.8rem);
}

.template-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.template-list-item {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(147, 178, 222, 0.13);
  border-radius: 17px;
  color: inherit;
  background: rgba(255, 255, 255, 0.026);
  cursor: pointer;
  text-align: left;
}

.template-list-item span {
  font-weight: 950;
}

.template-list-item small {
  color: var(--ab-muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.template-list-item.active {
  border-color: rgba(86, 217, 255, 0.26);
  background: rgba(86, 217, 255, 0.070);
}

.template-list-item.ghost {
  opacity: 0.58;
  cursor: not-allowed;
}

.placeholder-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.placeholder-row button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(147, 178, 222, 0.14);
  border-radius: 999px;
  color: #bdefff;
  background: rgba(86, 217, 255, 0.052);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
}

.template-advanced-meta,
.template-store {
  color: rgba(158, 171, 193, 0.72);
  font-size: 0.76rem;
  font-weight: 850;
}

.template-advanced-meta {
  margin-top: 12px;
}

.email-preview-panel {
  position: sticky;
  top: 110px;
}

.preview-browser-bar {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(147, 178, 222, 0.12);
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.028);
}

.preview-browser-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(245, 248, 255, 0.34);
}

.email-preview-card {
  padding: 26px;
  border: 1px solid rgba(154, 183, 230, 0.12);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(85, 215, 255, 0.075), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(198, 132, 72, 0.060), transparent 34%),
    linear-gradient(180deg, rgba(9, 21, 39, 0.96), rgba(3, 9, 20, 0.98));
  color: var(--ab-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.052);
}

.preview-kicker {
  color: rgba(143, 233, 255, 0.92);
  font-size: 0.74rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.email-preview-card h2 {
  margin: 14px 0 0;
  font-size: 2rem;
  line-height: 1.02;
  letter-spacing: -0.065em;
}

.email-preview-card p {
  color: var(--ab-muted);
  line-height: 1.58;
}

.email-preview-card a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 0 18px;
  border-radius: 999px;
  color: #06111d;
  background: linear-gradient(135deg, var(--ab-cyan), var(--ab-green));
  font-weight: 950;
}

/* --------------------------------------------------------------------------
   07. Legacy compatibility aliases
   These keep older HTML safe while the clean admin structure rolls out.
-------------------------------------------------------------------------- */

.mail-workspace-frame { display: contents; }
.mail-sidebar { position: sticky; top: 18px; min-height: calc(100vh - 132px); display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--ab-line); border-radius: 30px; background: linear-gradient(180deg, rgba(8, 18, 34, 0.86), rgba(3, 9, 20, 0.94)); }
.mail-main { min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.route-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.route-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid rgba(147, 178, 222, 0.12); border-radius: 14px; background: rgba(255, 255, 255, 0.024); }
.route-list span { color: var(--ab-muted); font-weight: 800; }
.route-list strong { overflow-wrap: anywhere; text-align: right; }

/* --------------------------------------------------------------------------
   08. Responsive states
-------------------------------------------------------------------------- */

@media (max-width: 1220px) {
  .admin-workspace-frame,
  .admin-hero-card,
  .admin-card-grid,
  .admin-two-column,
  .admin-panel-layout,
  .template-main .template-editor-area {
    grid-template-columns: 1fr;
  }

  .admin-sidebar,
  .email-preview-panel {
    position: relative;
    top: auto;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    width: min(100% - 24px, 1580px);
    padding-top: 14px;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 24px;
  }

  .admin-nav {
    justify-content: flex-start;
  }

  .admin-hero-card,
  .admin-panel,
  .admin-feature-card {
    border-radius: 22px;
  }

  .admin-hero-card,
  .admin-panel {
    padding: 18px;
  }

  .admin-hero-copy h1,
  .template-editor-title-block h1 {
    font-size: clamp(2.2rem, 13vw, 3.6rem);
  }

  .email-form-grid,
  .template-picker {
    grid-template-columns: 1fr;
  }
}


/* --------------------------------------------------------------------------
   06b. Dashboard aligned email preview polish
-------------------------------------------------------------------------- */

.template-preview-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.012));
}

.email-preview-card h2 {
  color: var(--ab-text);
}

.email-preview-card #previewFooter {
  color: rgba(202, 215, 235, 0.58);
  font-size: 0.92rem;
}

.admin-feature-card:nth-child(2),
.admin-feature-card:nth-child(3) {
  opacity: 0.94;
}

/* --------------------------------------------------------------------------
   09. Admin sidebar refinement v1.3.33
   --------------------------------------------------------------------------
   Overview is intentionally sidebar-free. The left navigation is reserved for
   Mail Admin, where it acts as a focused workspace navigator.
-------------------------------------------------------------------------- */

.admin-overview-main {
  margin-top: 18px;
}

.admin-shell[data-admin-page="overview"] .admin-card-grid,
.admin-shell[data-admin-page="overview"] .admin-two-column {
  width: 100%;
}

.mail-layout-shell .admin-sidebar {
  background:
    radial-gradient(circle at 18% 0%, rgba(86, 217, 255, 0.035), transparent 42%),
    linear-gradient(180deg, rgba(5, 14, 29, 0.86), rgba(2, 7, 16, 0.94));
  border-color: rgba(154, 183, 230, 0.095);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 28px 70px rgba(0, 0, 0, 0.34);
}

.mail-layout-shell .admin-sidebar::before {
  opacity: 0.45;
  background: radial-gradient(circle, rgba(86, 217, 255, 0.032), transparent 70%);
}

.mail-layout-shell .admin-side-profile {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.010));
  border-color: rgba(154, 183, 230, 0.105);
}

.mail-layout-shell .admin-side-item,
.mail-layout-shell .admin-subnav-item {
  background: rgba(255, 255, 255, 0.014);
  border-color: rgba(154, 183, 230, 0.088);
}

.mail-layout-shell .admin-side-item:hover,
.mail-layout-shell .admin-subnav-item:hover {
  background: rgba(86, 217, 255, 0.026);
  border-color: rgba(86, 217, 255, 0.15);
}

.mail-layout-shell .admin-side-item.active,
.mail-layout-shell .admin-subnav-item.active {
  background:
    linear-gradient(135deg, rgba(86, 217, 255, 0.052), rgba(198, 132, 72, 0.028));
  border-color: rgba(86, 217, 255, 0.19);
  box-shadow: 0 0 10px rgba(86, 217, 255, 0.030), inset 0 1px 0 rgba(255, 255, 255, 0.030);
}

.mail-layout-shell .admin-nav-group[open] .admin-side-item.active {
  border-color: rgba(86, 217, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.mail-layout-shell .admin-subnav {
  padding-left: 10px;
  border-left: 1px solid rgba(154, 183, 230, 0.075);
  margin-left: 8px;
}

.email-preview-card {
  background:
    radial-gradient(circle at 14% 0%, rgba(86, 217, 255, 0.052), transparent 34%),
    radial-gradient(circle at 92% 10%, rgba(198, 132, 72, 0.040), transparent 34%),
    linear-gradient(180deg, rgba(7, 17, 34, 0.97), rgba(2, 7, 16, 0.99));
}


/* Admin simplification patch v1.3.33
   --------------------------------------------------------------------------
   Reduces duplicate navigation and keeps technical storage details out of the
   primary admin flow. Global links live in the header; workspace navigation
   lives inside each workspace only.
*/
.admin-focus-panel {
  margin-top: 22px;
}

.admin-panel-copy {
  margin: 0;
  color: rgba(219, 232, 255, 0.68);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 720px;
}

.admin-side-footer {
  min-height: 0;
  padding-top: 18px;
}

.admin-side-footer a {
  display: none !important;
}

.template-store.is-quiet {
  opacity: 0.55;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --------------------------------------------------------------------------
   10. Mail OS workspace refinement (v1.3.42)
   --------------------------------------------------------------------------
   The mail workspace follows the dashboard design language: graphite surfaces,
   restrained glow, clear hierarchy and one focused workspace at a time.
*/

.mail-ops-sidebar .admin-side-item,
.mail-ops-sidebar .admin-subnav-item {
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
}

.mail-ops-sidebar .admin-nav-group[open] > summary.admin-side-item {
  margin-bottom: 8px;
}

.mail-command-grid {
  margin-top: 22px;
}

.mail-system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.mail-system-panel h2 {
  margin: 12px 0 8px;
  color: #f5f8ff;
  font-size: 1.15rem;
}

.mail-system-panel p {
  margin: 0;
  color: rgba(218, 229, 247, .68);
  line-height: 1.6;
}

.template-library-shell {
  display: grid;
  gap: 18px;
}

.template-library-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
}

.template-library-header h1 {
  margin: 10px 0 8px;
  max-width: 760px;
  color: #fff;
  font-size: clamp(2rem, 3.4vw, 3.55rem);
  line-height: .96;
  letter-spacing: -.055em;
}

.template-library-header p {
  margin: 0;
  max-width: 620px;
  color: rgba(220, 231, 248, .66);
  line-height: 1.65;
}

.template-library-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.template-filter {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(10, 16, 28, .72);
  color: rgba(222, 232, 248, .72);
  border-radius: 999px;
  padding: 11px 15px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .05em;
  cursor: pointer;
}

.template-filter.active {
  color: #fff;
  border-color: rgba(108, 185, 255, .2);
  background: linear-gradient(180deg, rgba(24, 35, 57, .94), rgba(11, 17, 30, .94));
  box-shadow: 0 14px 42px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08);
}

.template-editor-area {
  display: grid;
  grid-template-columns: 250px minmax(0, 1.08fr) minmax(330px, .72fr);
  gap: 18px;
  align-items: start;
}

.template-picker-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.template-picker-head p {
  margin: 10px 0 0;
  color: rgba(221,231,248,.62);
  font-size: .9rem;
  line-height: 1.55;
}

.template-picker-group {
  display: grid;
  gap: 9px;
}

.template-picker-group.is-hidden {
  display: none;
}

.template-group-label {
  display: block;
  margin: 6px 0 2px;
  color: rgba(127, 231, 255, .72);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.template-list-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,.065);
  background: linear-gradient(180deg, rgba(14, 21, 35, .84), rgba(8, 13, 23, .9));
  color: rgba(235, 242, 255, .88);
  border-radius: 18px;
  padding: 13px 14px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.template-list-item span {
  font-size: .88rem;
  font-weight: 850;
}

.template-list-item small {
  color: rgba(220,231,248,.48);
  font-size: .72rem;
}

.template-list-item.active {
  border-color: rgba(104, 194, 255, .28);
  background: linear-gradient(180deg, rgba(20, 34, 55, .96), rgba(9, 16, 29, .96));
  box-shadow: 0 18px 54px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.08);
}

.template-editor-title-block p {
  max-width: 620px;
}

.email-preview-card--dashboard,
.email-preview-card {
  background:
    radial-gradient(circle at 18% 8%, rgba(76, 196, 255, .08), transparent 32%),
    linear-gradient(180deg, rgba(14, 22, 37, .98), rgba(6, 11, 20, .99));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 24px 80px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.06);
}

.email-preview-card h2 {
  color: #fff;
  letter-spacing: -.035em;
}

.email-preview-card p {
  color: rgba(221, 232, 248, .72);
}

.email-preview-card a {
  background: linear-gradient(135deg, #7fe7ff, #69a7ff);
  color: #04101d;
  box-shadow: 0 16px 42px rgba(73, 183, 255, .18);
}

@media (max-width: 1240px) {
  .template-editor-area {
    grid-template-columns: minmax(210px, .44fr) minmax(0, 1fr);
  }

  .template-preview-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .template-library-header,
  .mail-system-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .template-editor-area {
    grid-template-columns: 1fr;
  }

  .template-picker-panel {
    position: static;
  }
}


/* Mail Template Studio v1.3.42
   --------------------------------------------------------------------------
   Focuses the template screen into a clear browser -> editor -> preview flow.
   The left sidebar is now workspace navigation only; template categories live
   in the main content area to prevent navigation-inside-navigation clutter. */

.template-studio-shell {
  display: grid;
  gap: 20px;
}

.template-studio-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  min-height: 0;
}

.template-studio-hero h1 {
  max-width: 780px;
  margin: 18px 0 10px;
  font-size: clamp(2.4rem, 5vw, 4.9rem);
  line-height: .88;
  letter-spacing: -.07em;
}

.template-studio-hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.template-studio-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.template-browser-panel,
.template-editor-panel,
.template-preview-panel {
  width: 100%;
  min-width: 0;
}

.template-browser-head,
.template-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.template-browser-head h2,
.template-preview-head h2 {
  margin: 10px 0 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.template-browser-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.template-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.template-card-grid .template-list-item {
  min-height: 96px;
  justify-content: center;
}

.template-card-grid .template-list-item.is-hidden {
  display: none;
}

.template-editor-panel .template-editor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 24px;
}

.template-editor-panel .template-editor-title-block h1 {
  margin: 16px 0 8px;
  max-width: 920px;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: .9;
  letter-spacing: -.06em;
}

.template-editor-panel .template-editor-title-block p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.65;
}

.template-editor-panel .email-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-editor-actions {
  align-items: center;
}

.email-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 360px;
  padding: 10px 14px;
  border: 1px solid rgba(130, 220, 255, .12);
  border-radius: 999px;
  background: rgba(9, 14, 25, .72);
  color: rgba(205, 222, 245, .78);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.35;
}

.email-status.is-error {
  border-color: rgba(255, 185, 122, .16);
  background: rgba(38, 24, 12, .42);
  color: rgba(255, 214, 172, .92);
}

.email-status.is-success {
  border-color: rgba(100, 255, 190, .18);
  background: rgba(12, 38, 30, .38);
  color: rgba(190, 255, 230, .92);
}

.template-preview-panel {
  padding: 26px;
}

.template-preview-panel .preview-browser-bar {
  max-width: 980px;
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
}

.template-preview-panel .email-preview-card {
  max-width: 980px;
  margin: 0 auto;
  min-height: 360px;
  padding: clamp(32px, 5vw, 64px);
  border-radius: 0 0 28px 28px;
}

.template-preview-panel .email-preview-card h2 {
  font-size: clamp(2.2rem, 4vw, 4.6rem);
  line-height: .92;
}

.template-preview-panel .email-preview-card p {
  max-width: 760px;
  font-size: 1.08rem;
  line-height: 1.75;
}

/* Legacy three-column template layout guard. */
.template-main .template-editor-area,
.template-editor-area {
  display: block;
}

.template-picker-panel,
.template-picker-group,
.template-group-label {
  display: none !important;
}

@media (max-width: 1100px) {
  .template-studio-hero,
  .template-editor-panel .template-editor-head {
    grid-template-columns: 1fr;
  }

  .template-studio-tabs {
    justify-content: flex-start;
  }

  .template-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .template-card-grid,
  .template-editor-panel .email-form-grid {
    grid-template-columns: 1fr;
  }

  .template-preview-panel {
    padding: 18px;
  }
}


/* --------------------------------------------------------------------------
   AutoByte 1.3.44 - Admin/Mail typography density
   Dashboard-aligned title scale and zero title letter-spacing.
   -------------------------------------------------------------------------- */
:where(
  .admin-hero h1,
  .mail-hero h1,
  .mail-workspace-hero h1,
  .mail-template-studio h1,
  .template-browser h1,
  .template-editor h1,
  .admin-panel h2,
  .admin-action h2,
  .mail-panel h2,
  .mail-card h2,
  .mail-template-card h3,
  .template-card h3,
  .mail-editor-title,
  .mail-preview h2,
  .email-preview h2,
  .mail-sidebar strong,
  .mail-nav-title
){letter-spacing:0!important}

.admin-hero h1,.mail-hero h1,.mail-workspace-hero h1{font-size:clamp(38px,3.6vw,58px)!important;line-height:1.02!important}
.admin-panel h2,.admin-action h2,.mail-panel h2,.mail-card h2{font-size:clamp(24px,2vw,32px)!important;line-height:1.08!important}
.template-browser h1,.mail-template-studio h1{font-size:clamp(32px,3vw,46px)!important;line-height:1.04!important;margin-bottom:10px!important}
.template-browser,.mail-template-browser{padding:24px!important;border-radius:28px!important}
.template-grid,.mail-template-grid{gap:12px!important}
.template-card,.mail-template-card,[data-template-key]{min-height:72px!important;padding:16px 18px!important;border-radius:18px!important}
.template-card h3,.mail-template-card h3,[data-template-key] strong{font-size:16px!important;line-height:1.1!important}
.template-card p,.mail-template-card p,[data-template-key] small{font-size:12px!important;line-height:1.35!important}
.mail-editor-title,.template-editor h1{font-size:clamp(28px,2.55vw,40px)!important;line-height:1.05!important}
.email-preview h2,.mail-preview h2{font-size:clamp(24px,2vw,32px)!important;line-height:1.08!important}
.mail-sidebar strong,.mail-nav-title{font-size:15px!important;line-height:1.1!important}

/* --------------------------------------------------------------------------
   AutoByte 1.3.45 - Mail Template Studio precision typography pass
   --------------------------------------------------------------------------
   Golden-ratio scale from a 14px base:
   14px base text -> 16px UI titles -> 23px section headings -> 37px hero.
   Minimum readable UI size is 14px. Letter spacing is normalized to 0.
   -------------------------------------------------------------------------- */
.mail-layout-shell,
.mail-layout-shell * {
  letter-spacing: 0 !important;
}

.mail-layout-shell {
  font-size: 14px;
}

.mail-layout-shell p,
.mail-layout-shell small,
.mail-layout-shell span,
.mail-layout-shell label,
.mail-layout-shell input,
.mail-layout-shell textarea,
.mail-layout-shell button,
.mail-layout-shell a {
  font-size: max(14px, 1em);
}

.mail-layout-shell .admin-side-item strong,
.mail-layout-shell .admin-subnav-item strong,
.mail-layout-shell .mail-sidebar strong,
.mail-layout-shell .mail-nav-title {
  font-size: 16px !important;
  line-height: 1.18 !important;
}

.mail-layout-shell .admin-side-item span,
.mail-layout-shell .admin-subnav-item span,
.mail-layout-shell .admin-side-profile small,
.mail-layout-shell .admin-side-footer {
  font-size: 14px !important;
  line-height: 1.35 !important;
}

.template-studio-hero {
  gap: 18px !important;
}

.template-studio-hero h1 {
  max-width: 680px !important;
  margin: 12px 0 8px !important;
  font-size: clamp(34px, 3.1vw, 46px) !important;
  line-height: 1.03 !important;
}

.template-studio-hero p {
  max-width: 680px !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
}

.template-studio-tabs .template-filter,
.template-filter {
  min-height: 36px !important;
  padding: 8px 13px !important;
  font-size: 14px !important;
}

.template-browser-panel,
.template-editor-panel,
.template-preview-panel {
  padding: 22px !important;
}

.template-browser-head,
.template-preview-head {
  margin-bottom: 14px !important;
}

.template-browser-head h2,
.template-preview-head h2 {
  margin: 6px 0 0 !important;
  font-size: 23px !important;
  line-height: 1.12 !important;
}

.template-browser-head p,
.template-picker-head p,
.template-editor-panel .template-editor-title-block p {
  font-size: 14px !important;
  line-height: 1.5 !important;
}

.template-card-grid {
  gap: 12px !important;
}

.template-card-grid .template-list-item,
.template-list-item,
.template-card,
.mail-template-card,
[data-template-key] {
  min-height: 58px !important;
  padding: 13px 16px !important;
  border-radius: 18px !important;
}

.template-card-grid .template-list-item span,
.template-list-item span,
.template-card h3,
.mail-template-card h3,
[data-template-key] strong {
  font-size: 16px !important;
  line-height: 1.22 !important;
}

.template-card-grid .template-list-item small,
.template-list-item small,
.template-card p,
.mail-template-card p,
[data-template-key] small {
  font-size: 14px !important;
  line-height: 1.35 !important;
}

.template-editor-panel .template-editor-head {
  margin-bottom: 18px !important;
}

.template-editor-panel .template-editor-title-block h1,
.mail-editor-title,
.template-editor h1 {
  margin: 10px 0 8px !important;
  font-size: clamp(30px, 2.5vw, 38px) !important;
  line-height: 1.08 !important;
}

.email-field span,
.email-toggle span,
.template-editor-panel label span,
.template-editor-panel .email-field span {
  font-size: 14px !important;
  line-height: 1.3 !important;
}

.email-field input,
.email-field textarea,
.email-field select {
  font-size: 14px !important;
  line-height: 1.45 !important;
}

.template-advanced-meta,
.template-store,
.email-status {
  font-size: 14px !important;
}

.template-preview-panel .email-preview-card h2,
.email-preview-card h2,
.email-preview h2,
.mail-preview h2 {
  font-size: clamp(24px, 2.1vw, 32px) !important;
  line-height: 1.12 !important;
}

.template-preview-panel .email-preview-card p,
.email-preview-card p {
  font-size: 14px !important;
  line-height: 1.65 !important;
}

/* --------------------------------------------------------------------------
   AutoByte 1.3.47 - Mail Admin workspace card polish
   --------------------------------------------------------------------------
   Keeps Mail Admin aligned with dashboard cards: less hero weight, warmer
   graphite surfaces, tighter empty states and consistent card text alignment.
-------------------------------------------------------------------------- */
.mail-layout-shell,
.mail-layout-shell * {
  letter-spacing: 0 !important;
}

.mail-layout-shell .admin-main {
  --mail-card-surface: linear-gradient(145deg, rgba(15, 21, 35, .94), rgba(6, 11, 21, .98));
  --mail-card-surface-soft:
    radial-gradient(circle at 8% 0%, rgba(198, 132, 72, .055), transparent 34%),
    radial-gradient(circle at 92% 2%, rgba(76, 196, 255, .05), transparent 34%),
    linear-gradient(145deg, rgba(15, 21, 35, .94), rgba(6, 11, 21, .98));
}

.mail-layout-shell .admin-hero-card,
.mail-layout-shell .admin-panel,
.mail-layout-shell .admin-feature-card,
.mail-layout-shell .template-browser-panel,
.mail-layout-shell .template-editor-panel,
.mail-layout-shell .template-preview-panel {
  background: var(--mail-card-surface-soft) !important;
  border-color: rgba(150, 178, 220, .105) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 26px 76px rgba(0,0,0,.34) !important;
}

.mail-layout-shell .admin-hero-card {
  padding: 22px !important;
  min-height: 0 !important;
}

.mail-layout-shell .admin-hero-copy h1,
.mail-layout-shell .mail-workspace-hero h1,
.mail-layout-shell .mail-hero h1 {
  max-width: 720px !important;
  margin: 10px 0 8px !important;
  font-size: clamp(32px, 3vw, 46px) !important;
  line-height: 1.03 !important;
  letter-spacing: 0 !important;
}

.mail-layout-shell .admin-hero-copy p,
.mail-layout-shell .mail-workspace-hero p,
.mail-layout-shell .mail-hero p {
  max-width: 680px !important;
  margin-top: 8px !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
}

.mail-layout-shell .admin-status-card {
  min-height: 124px !important;
  padding: 16px !important;
  background: linear-gradient(145deg, rgba(30, 38, 54, .58), rgba(8, 13, 23, .72)) !important;
}

.mail-layout-shell .admin-card-grid.mail-command-grid {
  gap: 16px !important;
  align-items: stretch !important;
}

.mail-layout-shell .admin-feature-card {
  min-height: 132px !important;
  padding: 20px !important;
  align-content: start !important;
  justify-items: start !important;
  text-align: left !important;
  gap: 10px !important;
}

.mail-layout-shell .admin-feature-card > span {
  font-size: 14px !important;
  line-height: 1.2 !important;
  color: #8fe9ff !important;
}

.mail-layout-shell .admin-feature-card strong {
  display: block !important;
  font-size: 23px !important;
  line-height: 1.12 !important;
  letter-spacing: 0 !important;
}

.mail-layout-shell .admin-feature-card p {
  max-width: 92% !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: rgba(218, 229, 247, .66) !important;
}

.mail-layout-shell .mail-system-grid {
  gap: 16px !important;
}

.mail-layout-shell .mail-system-panel {
  min-height: 0 !important;
  padding: 22px !important;
}

.mail-layout-shell .mail-system-panel h2,
.mail-layout-shell .admin-panel-head h2,
.mail-layout-shell .mail-locked-panel h2 {
  font-size: 23px !important;
  line-height: 1.12 !important;
  letter-spacing: 0 !important;
}

.mail-layout-shell .mail-system-panel p,
.mail-layout-shell .mail-locked-panel p {
  font-size: 14px !important;
  line-height: 1.55 !important;
}

.mail-layout-shell .mail-locked-panel {
  min-height: 190px !important;
  align-content: start !important;
  padding: 28px !important;
}

.mail-layout-shell .mail-locked-panel h2 {
  margin-top: 16px !important;
  max-width: 680px !important;
}

.mail-layout-shell .mail-locked-panel p {
  max-width: 720px !important;
  margin-top: 10px !important;
}

.mail-layout-shell .template-studio-hero {
  background: var(--mail-card-surface-soft) !important;
}


/* --------------------------------------------------------------------------
   v1.3.48 Mail/Admin visual unification pass
   --------------------------------------------------------------------------
   - Mail Admin cards now follow the dashboard overview card language.
   - Template submenu stays open/usable on template pages.
   - Category navigation lives in the left sidebar, not as duplicate top filters.
   - Settings is a focused single-panel workspace.
   - Hover states are consistent across admin buttons, cards and sidebar items.
-------------------------------------------------------------------------- */

.admin-layout-shell h1,
.admin-layout-shell h2,
.admin-layout-shell h3,
.admin-layout-shell h4,
.admin-layout-shell .admin-feature-card strong,
.admin-layout-shell .admin-side-item span,
.admin-layout-shell .admin-subnav-item span,
.admin-layout-shell .template-list-item span,
.admin-layout-shell .template-editor-title-block h1 {
  letter-spacing: 0 !important;
}

.admin-layout-shell .admin-pill,
.admin-layout-shell .admin-pill.compact {
  letter-spacing: 0 !important;
}

.admin-layout-shell {
  --admin-card-dashboard:
    radial-gradient(circle at 12% 0%, rgba(198, 132, 72, .075), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(85, 215, 255, .07), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.034), rgba(255,255,255,.012));
  --admin-card-dashboard-soft:
    radial-gradient(circle at 10% 0%, rgba(198, 132, 72, .045), transparent 32%),
    radial-gradient(circle at 90% 8%, rgba(85, 215, 255, .045), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.011));
}

.admin-layout-shell .admin-topbar,
.admin-layout-shell .admin-hero-card,
.admin-layout-shell .admin-panel,
.admin-layout-shell .admin-feature-card,
.admin-layout-shell .template-browser-panel,
.admin-layout-shell .template-editor-panel,
.admin-layout-shell .template-preview-panel {
  background: var(--admin-card-dashboard-soft) !important;
  border-color: rgba(154, 183, 230, .105) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 34px 90px rgba(0,0,0,.38) !important;
}

.admin-layout-shell .admin-hero-card {
  background: var(--admin-card-dashboard) !important;
}

.admin-layout-shell .admin-side-item,
.admin-layout-shell .admin-subnav-item,
.admin-layout-shell .admin-button,
.admin-layout-shell .template-list-item,
.admin-layout-shell .template-filter,
.admin-layout-shell input,
.admin-layout-shell textarea,
.admin-layout-shell select {
  transition:
    transform .2s var(--ab-ease),
    border-color .2s var(--ab-ease),
    background .2s var(--ab-ease),
    box-shadow .2s var(--ab-ease),
    color .2s var(--ab-ease) !important;
}

.admin-layout-shell .admin-side-item:hover,
.admin-layout-shell .admin-subnav-item:hover {
  transform: translateX(2px);
  border-color: rgba(205,225,255,.18) !important;
  background: rgba(255,255,255,.046) !important;
  color: #fff !important;
}

.admin-layout-shell .admin-side-item.active,
.admin-layout-shell .admin-subnav-item.active {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018)) !important;
  border-color: rgba(205,225,255,.18) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 16px 44px rgba(0,0,0,.18) !important;
}

.admin-layout-shell .admin-nav a:hover,
.admin-layout-shell .admin-button:hover,
.admin-layout-shell .template-list-item:hover,
.admin-layout-shell .admin-feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(205,225,255,.18) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.052), rgba(255,255,255,.02)) !important;
}

.admin-layout-shell .admin-button.primary:hover,
.admin-layout-shell .template-list-item.active:hover {
  border-color: rgba(86,217,255,.32) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 48px rgba(85,215,255,.08) !important;
}

/* Sidebar: keep Templates as an expandable workspace group. */
.mail-layout-shell .admin-nav-group[open] .admin-subnav {
  display: grid !important;
}

.mail-layout-shell .admin-nav-group[open] > summary.admin-side-item {
  border-color: rgba(205,225,255,.18) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.052), rgba(255,255,255,.018)) !important;
}

.mail-layout-shell .admin-subnav {
  margin-top: 7px;
  padding-left: 14px !important;
  border-left: 1px solid rgba(154,183,230,.105);
}

.mail-layout-shell .admin-subnav-item {
  min-height: 58px;
  padding: 10px 12px !important;
}

.mail-layout-shell .admin-side-item span,
.mail-layout-shell .admin-subnav-item span {
  font-size: 16px !important;
  line-height: 1.1 !important;
}

.mail-layout-shell .admin-side-item small,
.mail-layout-shell .admin-subnav-item small {
  font-size: 14px !important;
  line-height: 1.25 !important;
}

/* Mail overview cards: dashboard-like, consistent and less boxed-in. */
.mail-layout-shell .admin-card-grid.mail-command-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

.mail-layout-shell .admin-feature-card {
  min-height: 138px !important;
  align-content: start !important;
  justify-items: start !important;
  padding: 20px !important;
  gap: 10px !important;
  text-align: left !important;
}

.mail-layout-shell .admin-feature-card > span {
  font-size: 14px !important;
  line-height: 1 !important;
  color: rgba(165,235,255,.95) !important;
}

.mail-layout-shell .admin-feature-card strong {
  font-size: 23px !important;
  line-height: 1.08 !important;
}

.mail-layout-shell .admin-feature-card p {
  max-width: 360px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: rgba(202,215,235,.68) !important;
}

.mail-layout-shell .mail-system-grid {
  gap: 16px !important;
}

.mail-layout-shell .mail-locked-panel,
.mail-layout-shell .mail-system-panel {
  min-height: 0 !important;
  padding: 22px !important;
  align-content: start !important;
}

.mail-layout-shell .mail-locked-panel h2,
.mail-layout-shell .mail-system-panel h2 {
  margin-top: 14px !important;
  font-size: 23px !important;
  line-height: 1.12 !important;
}

.mail-layout-shell .mail-locked-panel p,
.mail-layout-shell .mail-system-panel p {
  max-width: 700px !important;
  margin-top: 8px !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}

/* Template Studio: categories are in the sidebar; hero stays clean. */
.template-studio-shell .template-studio-hero {
  grid-template-columns: minmax(0, 1fr) !important;
  padding: 22px !important;
}

.template-studio-shell .template-studio-tabs {
  display: none !important;
}

.template-studio-shell .template-studio-hero h1 {
  max-width: 720px !important;
  font-size: clamp(34px, 3vw, 46px) !important;
  line-height: 1.03 !important;
  margin: 10px 0 8px !important;
}

.template-studio-shell .template-studio-hero p {
  max-width: 760px !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}

.template-browser-panel {
  padding: 20px !important;
}

.template-browser-head h2,
.template-preview-head h2,
.template-editor-panel .template-editor-title-block h1,
.mail-layout-shell .admin-panel-head h2 {
  font-size: 23px !important;
  line-height: 1.12 !important;
}

.template-browser-head p,
.template-editor-panel .template-editor-title-block p,
.template-preview-head p {
  font-size: 14px !important;
  line-height: 1.55 !important;
}

.template-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.template-card-grid .template-list-item {
  min-height: 78px !important;
  padding: 14px 16px !important;
  align-content: center !important;
  justify-items: start !important;
  text-align: left !important;
}

.template-card-grid .template-list-item span {
  font-size: 16px !important;
  line-height: 1.15 !important;
}

.template-card-grid .template-list-item small {
  font-size: 14px !important;
  line-height: 1.25 !important;
}

.email-field > span,
.email-toggle span {
  font-size: 14px !important;
  line-height: 1.25 !important;
}

/* Settings: one focused panel, no redundant preview/status card. */
.mail-layout-shell [data-section-panel="settings"] .admin-panel-layout {
  grid-template-columns: minmax(0, 760px) !important;
  justify-content: start !important;
}

.mail-layout-shell [data-section-panel="settings"] .email-editor-panel {
  max-width: 760px;
}

.mail-layout-shell [data-section-panel="settings"] .email-preview-panel {
  display: none !important;
}

@media (max-width: 1100px) {
  .mail-layout-shell .admin-card-grid.mail-command-grid,
  .template-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .mail-layout-shell .admin-card-grid.mail-command-grid,
  .template-card-grid {
    grid-template-columns: 1fr !important;
  }
}


/* --------------------------------------------------------------------------
   AutoByte 1.3.49 - Admin/Mail tone sync
   --------------------------------------------------------------------------
   The Mail Template Studio was slightly brighter than Admin Overview because
   later mail-specific surface rules overrode the shared admin card palette.
   This final pass forces every Admin/Mail workspace to use the same dashboard
   surface stack, hover treatment and low-intensity glow system.
-------------------------------------------------------------------------- */
.admin-layout-shell,
.mail-layout-shell {
  --admin-unified-card:
    radial-gradient(circle at 12% 0%, rgba(198, 132, 72, .050), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(85, 215, 255, .045), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.027), rgba(255,255,255,.010));
  --admin-unified-card-strong:
    radial-gradient(circle at 12% 0%, rgba(198, 132, 72, .060), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(85, 215, 255, .052), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.030), rgba(255,255,255,.011));
  --admin-unified-line: rgba(154, 183, 230, .105);
}

.admin-layout-shell .admin-topbar,
.admin-layout-shell .admin-panel,
.admin-layout-shell .admin-feature-card,
.admin-layout-shell .template-browser-panel,
.admin-layout-shell .template-editor-panel,
.admin-layout-shell .template-preview-panel,
.mail-layout-shell .admin-topbar,
.mail-layout-shell .admin-panel,
.mail-layout-shell .admin-feature-card,
.mail-layout-shell .template-browser-panel,
.mail-layout-shell .template-editor-panel,
.mail-layout-shell .template-preview-panel,
.mail-layout-shell .mail-system-panel,
.mail-layout-shell .mail-locked-panel {
  background: var(--admin-unified-card) !important;
  border-color: var(--admin-unified-line) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 30px 82px rgba(0,0,0,.38) !important;
}

.admin-layout-shell .admin-hero-card,
.mail-layout-shell .admin-hero-card,
.mail-layout-shell .mail-workspace-hero,
.mail-layout-shell .template-studio-hero {
  background: var(--admin-unified-card-strong) !important;
  border-color: var(--admin-unified-line) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.050), 0 32px 88px rgba(0,0,0,.39) !important;
}

.mail-layout-shell .admin-sidebar {
  background:
    radial-gradient(circle at 16% 0%, rgba(86, 217, 255, .026), transparent 42%),
    linear-gradient(180deg, rgba(5, 13, 27, .88), rgba(2, 7, 16, .95)) !important;
  border-color: rgba(154, 183, 230, .100) !important;
}

.mail-layout-shell .admin-side-item,
.mail-layout-shell .admin-subnav-item,
.mail-layout-shell .template-list-item,
.mail-layout-shell input,
.mail-layout-shell textarea,
.mail-layout-shell select {
  background: rgba(255,255,255,.012) !important;
  border-color: rgba(154,183,230,.090) !important;
}

.mail-layout-shell .admin-side-item:hover,
.mail-layout-shell .admin-subnav-item:hover,
.mail-layout-shell .template-list-item:hover {
  background: rgba(86,217,255,.022) !important;
  border-color: rgba(86,217,255,.145) !important;
}

.mail-layout-shell .admin-side-item.active,
.mail-layout-shell .admin-subnav-item.active,
.mail-layout-shell .template-list-item.active {
  background:
    radial-gradient(circle at 0% 0%, rgba(86,217,255,.045), transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,.020), rgba(255,255,255,.010)) !important;
  border-color: rgba(86,217,255,.175) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 0 0 1px rgba(86,217,255,.018) !important;
}

.mail-layout-shell .template-card-grid .template-list-item,
.mail-layout-shell .template-list-item {
  color: var(--ab-text) !important;
}


/* --------------------------------------------------------------------------
   AutoByte 1.3.50 - Admin dashboard-card parity pass
   --------------------------------------------------------------------------
   Source of truth: dashboard overview cards (Balance / Combined Momentum).
   Every admin and mail workspace now uses the same low-contrast graphite card
   surface, subtle copper/cyan ambient accents, identical hover behavior and
   consistent open template submenu states.
-------------------------------------------------------------------------- */
.admin-layout-shell,
.mail-layout-shell {
  --admin-dashboard-card:
    radial-gradient(circle at 12% 0%, rgba(198, 132, 72, .070), transparent 34%),
    radial-gradient(circle at 88% 6%, rgba(85, 215, 255, .060), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.034), rgba(255,255,255,.012));
  --admin-dashboard-card-soft:
    radial-gradient(circle at 12% 0%, rgba(198, 132, 72, .052), transparent 34%),
    radial-gradient(circle at 88% 6%, rgba(85, 215, 255, .048), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.030), rgba(255,255,255,.011));
  --admin-dashboard-input: rgba(255,255,255,.020);
  --admin-dashboard-input-hover: rgba(255,255,255,.036);
  --admin-dashboard-line: rgba(255,255,255,.072);
  --admin-dashboard-line-strong: rgba(255,255,255,.128);
}

.admin-layout-shell :is(h1,h2,h3,h4,strong,span,small,p,a,button,label,input,textarea,select),
.mail-layout-shell :is(h1,h2,h3,h4,strong,span,small,p,a,button,label,input,textarea,select) {
  letter-spacing: 0 !important;
}

.admin-layout-shell :is(.admin-topbar,.admin-hero-card,.admin-panel,.admin-action,.admin-feature-card,.admin-status-card),
.mail-layout-shell :is(.admin-topbar,.admin-hero-card,.admin-panel,.admin-action,.admin-feature-card,.admin-status-card,.mail-system-panel,.mail-locked-panel,.template-studio-hero,.template-browser-panel,.template-editor-panel,.template-preview-panel) {
  background: var(--admin-dashboard-card) !important;
  border-color: var(--admin-dashboard-line) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 34px 90px rgba(0,0,0,.38) !important;
}

.admin-layout-shell :is(.admin-action,.admin-feature-card),
.mail-layout-shell :is(.admin-feature-card,.mail-system-panel,.mail-locked-panel,.template-browser-panel,.template-editor-panel,.template-preview-panel) {
  background: var(--admin-dashboard-card-soft) !important;
}

.mail-layout-shell .template-studio-hero,
.mail-layout-shell .admin-hero-card,
.admin-layout-shell .admin-hero-card {
  padding: 24px !important;
}

.admin-layout-shell :is(.admin-action,.admin-feature-card,.admin-panel,.admin-status-card),
.mail-layout-shell :is(.admin-feature-card,.admin-panel,.mail-system-panel,.mail-locked-panel,.template-browser-panel,.template-editor-panel,.template-preview-panel,.template-list-item) {
  transition: transform .22s var(--ab-ease), border-color .22s var(--ab-ease), background .22s var(--ab-ease), box-shadow .22s var(--ab-ease), color .22s var(--ab-ease) !important;
}

.admin-layout-shell :is(.admin-action,.admin-feature-card):hover,
.mail-layout-shell :is(.admin-feature-card,.template-list-item):hover {
  transform: translateY(-3px) !important;
  border-color: var(--admin-dashboard-line-strong) !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(198, 132, 72, .082), transparent 34%),
    radial-gradient(circle at 88% 6%, rgba(85, 215, 255, .072), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.044), rgba(255,255,255,.018)) !important;
}

/* Template category pages must not use a brighter surface than overview. */
.mail-layout-shell[data-mail-template-category],
.mail-layout-shell[data-admin-page="mail-templates"],
.mail-layout-shell[data-template-scope="transactional"],
.mail-layout-shell[data-template-scope="billing"] {
  background: transparent !important;
}

.mail-layout-shell[data-admin-page="mail-templates"] :is(.template-studio-hero,.template-browser-panel,.template-editor-panel,.template-preview-panel,.template-list-item),
.mail-layout-shell :is([data-template-group="transactional"],[data-template-group="billing"],.template-card-grid .template-list-item) {
  background: var(--admin-dashboard-card-soft) !important;
  border-color: var(--admin-dashboard-line) !important;
}

.mail-layout-shell .template-list-item.active,
.mail-layout-shell .admin-side-item.active,
.mail-layout-shell .admin-subnav-item.active {
  background:
    radial-gradient(circle at 10% 0%, rgba(85, 215, 255, .045), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,.034), rgba(255,255,255,.012)) !important;
  border-color: rgba(85,215,255,.18) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 16px 42px rgba(0,0,0,.18) !important;
}

.mail-layout-shell .template-list-item.active:hover,
.mail-layout-shell .admin-subnav-item.active:hover,
.mail-layout-shell .admin-side-item.active:hover {
  background:
    radial-gradient(circle at 10% 0%, rgba(85, 215, 255, .056), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,.042), rgba(255,255,255,.016)) !important;
}

.mail-layout-shell .admin-nav-group[data-admin-nav-group="templates"] .admin-subnav,
.mail-layout-shell .admin-nav-group[open][data-admin-nav-group="templates"] .admin-subnav {
  display: grid !important;
  opacity: 1 !important;
  visibility: visible !important;
  height: auto !important;
}

.mail-layout-shell .admin-nav-group[data-admin-nav-group="templates"] > summary::-webkit-details-marker {
  display: none !important;
}

.mail-layout-shell .admin-sidebar,
.admin-layout-shell .admin-sidebar {
  background:
    radial-gradient(circle at 16% 0%, rgba(85,215,255,.030), transparent 42%),
    linear-gradient(180deg, rgba(5,13,27,.90), rgba(2,7,16,.96)) !important;
  border-color: rgba(255,255,255,.070) !important;
}

.mail-layout-shell :is(input,textarea,select,.email-toggle,.template-store,.email-status),
.admin-layout-shell :is(input,textarea,select) {
  background: var(--admin-dashboard-input) !important;
  border-color: var(--admin-dashboard-line) !important;
}

.mail-layout-shell :is(input,textarea,select):focus,
.admin-layout-shell :is(input,textarea,select):focus {
  background: var(--admin-dashboard-input-hover) !important;
  border-color: rgba(85,215,255,.22) !important;
}

/* Density: admin/mail headings should match dashboard card proportions. */
.mail-layout-shell .template-studio-hero h1,
.mail-layout-shell .admin-hero-copy h1,
.mail-layout-shell .mail-workspace-hero h1,
.admin-layout-shell .admin-hero-copy h1 {
  font-size: clamp(32px, 3vw, 46px) !important;
  line-height: 1.03 !important;
  margin: 8px 0 8px !important;
}

.mail-layout-shell :is(.template-browser-head h2,.template-preview-head h2,.template-editor-title-block h1,.mail-system-panel h2,.mail-locked-panel h2,.admin-feature-card strong),
.admin-layout-shell :is(.admin-action h2,.admin-panel h2,.admin-feature-card strong) {
  font-size: 23px !important;
  line-height: 1.12 !important;
}

.mail-layout-shell :is(.template-browser-head p,.template-preview-head p,.template-editor-title-block p,.admin-feature-card p,.mail-system-panel p,.mail-locked-panel p),
.admin-layout-shell :is(.admin-action p,.admin-panel p,.admin-feature-card p) {
  font-size: 14px !important;
  line-height: 1.55 !important;
  color: rgba(202,215,235,.70) !important;
}

.mail-layout-shell .template-card-grid .template-list-item {
  min-height: 68px !important;
  padding: 14px 16px !important;
  text-align: left !important;
  align-content: center !important;
}

.mail-layout-shell .template-card-grid .template-list-item span {
  font-size: 16px !important;
  line-height: 1.18 !important;
}

.mail-layout-shell .template-card-grid .template-list-item small {
  font-size: 14px !important;
  line-height: 1.25 !important;
}


/* --------------------------------------------------------------------------
   AutoByte 1.3.55 - Authoritative Admin Surface Inheritance
   --------------------------------------------------------------------------
   This is the single source of truth for admin surfaces. It intentionally
   neutralizes older mail/template-specific brightness rules that appeared
   later in the cascade. Admin Overview, Mail Overview, Library, Transactional
   and Billing now inherit the same surface token. Active states may change
   border/accent only, never the base card color.
-------------------------------------------------------------------------- */
.admin-layout-shell,
.mail-layout-shell {
  --ab-admin-surface-inherited:
    radial-gradient(circle at 13% 0%, rgba(198, 132, 72, 0.042), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(85, 215, 255, 0.038), transparent 38%),
    linear-gradient(180deg, rgba(13, 20, 34, 0.90), rgba(4, 9, 18, 0.965));
  --ab-admin-surface-inherited-soft:
    radial-gradient(circle at 13% 0%, rgba(198, 132, 72, 0.034), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(85, 215, 255, 0.032), transparent 38%),
    linear-gradient(180deg, rgba(11, 17, 30, 0.88), rgba(3, 8, 17, 0.965));
  --ab-admin-field-inherited: linear-gradient(180deg, rgba(8, 14, 25, 0.84), rgba(3, 7, 15, 0.92));
  --ab-admin-border-inherited: rgba(154, 183, 230, 0.102);
  --ab-admin-border-inherited-strong: rgba(154, 183, 230, 0.155);
  --ab-admin-shadow-inherited: inset 0 1px 0 rgba(255,255,255,0.040), 0 32px 86px rgba(0,0,0,0.40);
}

.admin-layout-shell :is(.admin-topbar,.admin-hero-card,.admin-panel,.admin-action,.admin-feature-card,.admin-status-card,.mail-system-panel,.mail-locked-panel,.template-studio-hero,.template-browser-panel,.template-editor-panel,.template-preview-panel),
.mail-layout-shell :is(.admin-topbar,.admin-hero-card,.admin-panel,.admin-action,.admin-feature-card,.admin-status-card,.mail-system-panel,.mail-locked-panel,.template-studio-hero,.template-browser-panel,.template-editor-panel,.template-preview-panel) {
  background: var(--ab-admin-surface-inherited) !important;
  border-color: var(--ab-admin-border-inherited) !important;
  box-shadow: var(--ab-admin-shadow-inherited) !important;
}

.admin-layout-shell :is(.admin-action,.admin-feature-card,.mail-system-panel,.mail-locked-panel,.template-browser-panel,.template-editor-panel,.template-preview-panel),
.mail-layout-shell :is(.admin-action,.admin-feature-card,.mail-system-panel,.mail-locked-panel,.template-browser-panel,.template-editor-panel,.template-preview-panel) {
  background: var(--ab-admin-surface-inherited-soft) !important;
}

.admin-layout-shell :is(.admin-side-item,.admin-subnav-item,.template-list-item,input,textarea,select,.email-toggle,.template-store,.email-status),
.mail-layout-shell :is(.admin-side-item,.admin-subnav-item,.template-list-item,input,textarea,select,.email-toggle,.template-store,.email-status) {
  background: var(--ab-admin-field-inherited) !important;
  border-color: var(--ab-admin-border-inherited) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.026) !important;
}

.admin-layout-shell :is(.admin-side-item:hover,.admin-subnav-item:hover,.template-list-item:hover),
.mail-layout-shell :is(.admin-side-item:hover,.admin-subnav-item:hover,.template-list-item:hover) {
  background: var(--ab-admin-field-inherited) !important;
  border-color: var(--ab-admin-border-inherited-strong) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035), 0 14px 34px rgba(0,0,0,0.18) !important;
}

.admin-layout-shell :is(.admin-side-item.active,.admin-subnav-item.active,.template-list-item.active),
.mail-layout-shell :is(.admin-side-item.active,.admin-subnav-item.active,.template-list-item.active) {
  background: var(--ab-admin-field-inherited) !important;
  border-color: rgba(86,217,255,0.22) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035), 0 0 0 1px rgba(86,217,255,0.025) !important;
}

/* Template routes must never get a separate, brighter surface. */
.mail-layout-shell[data-admin-page="mail-templates"] :is(.template-studio-hero,.template-browser-panel,.template-editor-panel,.template-preview-panel,.template-list-item),
.mail-layout-shell :is([data-template-group="transactional"],[data-template-group="billing"],.template-card-grid .template-list-item),
.mail-layout-shell[data-template-scope="transactional"] :is(.template-studio-hero,.template-browser-panel,.template-editor-panel,.template-preview-panel,.template-list-item),
.mail-layout-shell[data-template-scope="billing"] :is(.template-studio-hero,.template-browser-panel,.template-editor-panel,.template-preview-panel,.template-list-item) {
  background: var(--ab-admin-field-inherited) !important;
}

.mail-layout-shell[data-admin-page="mail-templates"] :is(.template-studio-hero,.template-browser-panel,.template-editor-panel,.template-preview-panel),
.mail-layout-shell[data-template-scope="transactional"] :is(.template-studio-hero,.template-browser-panel,.template-editor-panel,.template-preview-panel),
.mail-layout-shell[data-template-scope="billing"] :is(.template-studio-hero,.template-browser-panel,.template-editor-panel,.template-preview-panel) {
  background: var(--ab-admin-surface-inherited-soft) !important;
}

/* Keep the Templates submenu open across Library, Transactional and Billing. */
.mail-layout-shell .admin-nav-group[data-admin-nav-group="templates"] .admin-subnav,
.mail-layout-shell .admin-nav-group[open][data-admin-nav-group="templates"] .admin-subnav {
  display: grid !important;
  opacity: 1 !important;
  visibility: visible !important;
  height: auto !important;
}

/* Typography is inherited, not route-specific. */
.admin-layout-shell :is(h1,h2,h3,h4,strong,span,small,p,a,button,label,input,textarea,select),
.mail-layout-shell :is(h1,h2,h3,h4,strong,span,small,p,a,button,label,input,textarea,select) {
  letter-spacing: 0 !important;
}


/* AutoByte 1.5.7 - Admin interaction and commercial polish
   Dashboard is the visual reference: compact glass actions, cyan/copper/green accents. */
.admin-button{
  width:max-content;
  min-width:0;
  min-height:44px;
  padding:0 16px;
  border-radius:17px;
  background:linear-gradient(180deg,rgba(255,255,255,.052),rgba(255,255,255,.018));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
.admin-button.primary{
  border-color:rgba(86,217,255,.28);
  color:rgba(236,249,255,.98);
  background:radial-gradient(circle at 0 0,rgba(86,217,255,.13),transparent 42%),linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.018));
}
.admin-button.danger{
  border-color:rgba(198,132,72,.28);
  color:rgba(255,226,190,.96);
  background:radial-gradient(circle at 0 0,rgba(198,132,72,.12),transparent 42%),linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.016));
}
.admin-button:hover{
  transform:translateY(-1px)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 18px 48px rgba(85,217,255,.065)!important;
}
.email-actions,.template-actions{
  align-items:center;
  justify-content:flex-start;
}
.admin-feature-card.primary{
  border-color:rgba(86,217,255,.18);
  background:radial-gradient(circle at 0 0,rgba(86,217,255,.075),transparent 42%),linear-gradient(180deg,rgba(255,255,255,.036),rgba(255,255,255,.012));
}
.admin-feature-card:nth-child(2){
  border-color:rgba(198,132,72,.14);
  background:radial-gradient(circle at 0 0,rgba(198,132,72,.055),transparent 42%),linear-gradient(180deg,rgba(255,255,255,.032),rgba(255,255,255,.012));
}
.admin-feature-card:nth-child(3){
  border-color:rgba(86,243,181,.13);
  background:radial-gradient(circle at 0 0,rgba(86,243,181,.052),transparent 42%),linear-gradient(180deg,rgba(255,255,255,.032),rgba(255,255,255,.012));
}
.admin-status-card{
  border-color:rgba(86,243,181,.13);
}
@media(max-width:720px){
  .admin-button{width:100%;}
}


/* AutoByte 4.9 - admin brand uses transparent A mark without legacy glass bubble. */
