.admin-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 260px; padding: 24px 18px; color: white; background: var(--navy); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand > img { width: 54px; height: 54px; object-fit: contain; border-radius: 12px; background: white; box-shadow: 0 8px 24px rgba(0,169,206,.18); }
.brand > div:last-child { display: grid; }
.brand strong { font-size: 18px; }
.brand span { color: var(--cyan); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .16em; }
.scope-chip { margin: 22px 8px; padding: 8px 10px; border: 1px solid rgba(110,241,250,.24); border-radius: 8px; color: #7ef5fd; background: rgba(22,199,217,.08); font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 6px; }
.nav-item { width: 100%; min-height: 46px; padding: 0 14px; border: 0; border-radius: 9px; color: #afc2ce; background: transparent; text-align: left; font-weight: 700; cursor: pointer; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.is-active { color: var(--navy); background: var(--cyan); }
.sidebar-footer { margin-top: auto; padding: 15px 10px 2px; border-top: 1px solid rgba(255,255,255,.09); display: flex; justify-content: space-between; color: #b6c9d3; font-size: 12px; }
.workspace { margin-left: 260px; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 72px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); display: flex; align-items: center; justify-content: space-between; }
.topbar > div:first-of-type { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.topbar > div:first-of-type span { color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 16px; }
.back-link { color: #087e8d; font-weight: 750; text-decoration: none; }
.identity { display: flex; align-items: center; gap: 9px; }
.identity > b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--navy); background: #d9f8fb; }
.identity > span { display: grid; }
.identity small { color: var(--muted); }
#logout { border: 0; color: #8d2631; background: transparent; font-weight: 750; cursor: pointer; }
.menu-button { display: none; }
main { padding: 34px; }
.page-heading { margin-bottom: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.eyebrow { color: #087e8d; font-size: 11px; font-weight: 900; letter-spacing: .15em; }
h1 { margin: 6px 0 4px; font-size: 34px; letter-spacing: -.035em; }
h2 { margin: 0; }
.page-heading p { margin: 0; color: var(--muted); }
.admin-section { display: none; }
.admin-section.is-active { display: block; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 10px 35px rgba(7,26,43,.05); }
.panel > header { padding: 20px 22px 8px; }
.panel-toolbar { padding: 16px; display: grid; grid-template-columns: minmax(240px,1fr) 190px auto; gap: 10px; border-bottom: 1px solid var(--line); }
.panel-toolbar input, .panel-toolbar select { min-height: 42px; padding: 0 12px; border: 1px solid #ccd9df; border-radius: 9px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 16px; color: var(--muted); background: #f7fafb; text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid #e8eef1; vertical-align: middle; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag, .status { display: inline-flex; padding: 4px 7px; border-radius: 99px; color: #305066; background: #eaf1f4; font-size: 10px; font-weight: 850; }
.status.active { color: #0f6f51; background: #ddf5ec; }
.status.suspended, .status.disabled { color: #97313c; background: #fde7ea; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions button { padding: 6px 8px; border: 1px solid #d4e0e5; border-radius: 7px; color: #214358; background: white; font-size: 11px; font-weight: 750; cursor: pointer; }
.row-actions button.danger { color: #9c303c; }
.empty { padding: 38px; color: var(--muted); text-align: center; }
.gap-top { margin-top: 22px; }
.settings-grid { padding: 22px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.setting { padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.setting span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.email-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.email-summary-card { padding: 17px 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 25px rgba(7,26,43,.04); }
.email-summary-card span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.email-summary-card strong { display: block; margin-top: 7px; color: var(--navy); font-size: 22px; }
.email-summary-card.ok { border-color: #bce7d8; background: #f4fcf9; }
.email-summary-card.bad { border-color: #f3c7cd; background: #fff7f8; }
.email-control-panel > header, .panel-header-split { padding-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.email-control-panel header p, .panel-header-split p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.delivery-mode { display: inline-flex; padding: 7px 10px; border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: .07em; white-space: nowrap; }
.delivery-mode.control { color: #805c08; background: #fff4d8; border: 1px solid #f0d995; }
.delivery-mode.routed { color: #0f6f51; background: #ddf5ec; border: 1px solid #bce7d8; }
.email-settings-form { padding: 0 22px 20px; display: grid; grid-template-columns: 220px minmax(280px,1fr) auto; align-items: end; gap: 14px; }
.settings-actions, .preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.email-control-panel > .message { margin: 0 22px 22px; }
.route-email { width: min(340px,100%); min-height: 38px; padding: 0 10px; border: 1px solid #cbd9e0; border-radius: 8px; }
.schedule-time { min-height: 38px; padding: 0 10px; border: 1px solid #cbd9e0; border-radius: 8px; }
.approval-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; }
.approval-switch input { width: 17px; height: 17px; accent-color: var(--cyan-dark); }
.preview-actions .button { min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; font-size: 11px; text-decoration: none; }
.status.email-pending, .status.email-processing { color: #805c08; background: #fff4d8; }
.status.email-sent { color: #0f6f51; background: #ddf5ec; }
.status.email-failed, .status.email-blocked { color: #97313c; background: #fde7ea; }
dialog { width: min(760px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; color: var(--text); box-shadow: 0 30px 90px rgba(7,26,43,.28); }
dialog::backdrop { background: rgba(3,17,28,.62); }
dialog form > header, dialog form > footer { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
dialog form > header { border-bottom: 1px solid var(--line); }
dialog form > footer { border-top: 1px solid var(--line); justify-content: flex-end; }
.dialog-close { border: 0; color: var(--muted); background: transparent; font-size: 27px; cursor: pointer; }
.dialog-body { padding: 24px; display: grid; gap: 20px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
fieldset { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
legend { padding: 0 6px; font-size: 13px; font-weight: 800; }
.roles-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.role-option { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 7px; background: #f5f8fa; font-size: 12px; }
@media (max-width: 1100px) { .email-settings-form { grid-template-columns: 1fr 1fr; } .settings-actions { grid-column: 1 / -1; } }
@media (max-width: 980px) { .sidebar { transform: translateX(-100%); transition: transform .2s; } .sidebar.is-open { transform: none; } .workspace { margin-left: 0; } .menu-button { display: block; } .settings-grid { grid-template-columns: 1fr 1fr; } .email-summary { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { main { padding: 22px 14px; } .topbar { padding: 0 14px; } .topbar > div:first-of-type, .back-link, .identity span { display: none; } .page-heading, .panel-header-split, .email-control-panel > header { align-items: stretch; flex-direction: column; } .panel-toolbar { grid-template-columns: 1fr; } .two-columns, .roles-grid, .settings-grid, .email-summary, .email-settings-form { grid-template-columns: 1fr; } .settings-actions { grid-column: auto; } }
