:root {
    --bg: #08111f;
    --bg-soft: #132033;
    --surface: rgba(12, 24, 39, 0.82);
    --surface-strong: #0d1b2b;
    --surface-muted: rgba(255, 255, 255, 0.04);
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #eef7ff;
    --muted: #8fa4bc;
    --accent: #59d4c5;
    --accent-rgb: 89, 212, 197;
    --accent-soft: rgba(89, 212, 197, 0.16);
    --accent-strong: #9ae6b4;
    --accent-contrast: #06131d;
    --success: #78e4b6;
    --warning: #f7bf63;
    --danger: #ff8e7a;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --bg-grad-start: #07101d;
    --bg-grad-mid: #0a1728;
    --bg-grad-end: #08111f;
    --bg-glow-warm: rgba(247, 191, 99, 0.14);
    --bg-glow-cool: rgba(89, 212, 197, 0.18);
    --bg-orb-warm: rgba(247, 191, 99, 0.22);
    --bg-orb-cool: rgba(89, 212, 197, 0.13);
    --nav-bg: rgba(8, 17, 31, 0.74);
    --hover-bg: rgba(255, 255, 255, 0.06);
    --chip-bg: rgba(255, 255, 255, 0.05);
    --control-bg: rgba(255, 255, 255, 0.04);
    --control-hover-bg: rgba(89, 212, 197, 0.12);
    --placeholder: rgba(150, 164, 198, 0.62);
    --focus-border: rgba(var(--accent-rgb), 0.42);
    --focus-ring: rgba(var(--accent-rgb), 0.14);
    --hero-bg: linear-gradient(145deg, rgba(12, 24, 39, 0.94), rgba(7, 16, 29, 0.98));
    --hero-chip-bg: rgba(255, 255, 255, 0.06);
    --hero-chip-text: #d7e0f8;
    --soft-panel-bg: rgba(255, 255, 255, 0.04);
    --soft-panel-strong: rgba(255, 255, 255, 0.03);
    --spotlight-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), radial-gradient(circle at top, rgba(89, 212, 197, 0.18), transparent 55%);
    --spotlight-screen-bg: rgba(7, 16, 29, 0.84);
    --spotlight-screen-border: rgba(255, 255, 255, 0.08);
    --footer-bg: rgba(8, 17, 31, 0.74);
    --dropdown-bg: rgba(8, 17, 31, 0.97);
    --dropdown-shadow: 0 28px 50px rgba(0, 0, 0, 0.38);
    --info-soft: rgba(114, 156, 255, 0.09);
    --success-soft: rgba(111, 227, 182, 0.12);
    --success-text: #bff3dd;
    --warning-soft: rgba(244, 185, 66, 0.14);
    --warning-text: #ffe2ad;
    --danger-soft: rgba(255, 143, 143, 0.14);
    --danger-text: #ffd0d0;
}

html[data-theme='light'] {
    --bg: #f6f1e7;
    --bg-soft: #fcf8f1;
    --surface: rgba(255, 252, 247, 0.88);
    --surface-strong: #fffdf9;
    --surface-muted: rgba(31, 48, 61, 0.04);
    --line: rgba(45, 60, 75, 0.1);
    --line-strong: rgba(45, 60, 75, 0.18);
    --text: #22303b;
    --muted: #687685;
    --accent: #295f8f;
    --accent-rgb: 41, 95, 143;
    --accent-soft: rgba(41, 95, 143, 0.11);
    --accent-strong: #1f496d;
    --accent-contrast: #f7fafc;
    --success: #3b8a63;
    --warning: #b6843b;
    --danger: #b65a50;
    --shadow: 0 18px 50px rgba(40, 49, 58, 0.11);
    --bg-grad-start: #faf6ef;
    --bg-grad-mid: #f4eee4;
    --bg-grad-end: #ece3d6;
    --bg-glow-warm: rgba(182, 132, 59, 0.08);
    --bg-glow-cool: rgba(41, 95, 143, 0.07);
    --bg-orb-warm: rgba(182, 132, 59, 0.08);
    --bg-orb-cool: rgba(41, 95, 143, 0.07);
    --nav-bg: rgba(252, 248, 241, 0.86);
    --hover-bg: rgba(41, 95, 143, 0.06);
    --chip-bg: rgba(41, 95, 143, 0.08);
    --control-bg: rgba(255, 255, 255, 0.78);
    --control-hover-bg: rgba(41, 95, 143, 0.08);
    --placeholder: rgba(104, 118, 133, 0.72);
    --focus-border: rgba(41, 95, 143, 0.36);
    --focus-ring: rgba(41, 95, 143, 0.12);
    --hero-bg: linear-gradient(145deg, rgba(255, 252, 247, 0.98), rgba(244, 237, 225, 0.96));
    --hero-chip-bg: rgba(41, 95, 143, 0.08);
    --hero-chip-text: #22303b;
    --soft-panel-bg: rgba(255, 255, 255, 0.74);
    --soft-panel-strong: rgba(41, 95, 143, 0.04);
    --spotlight-bg: linear-gradient(180deg, rgba(41, 95, 143, 0.02), transparent), radial-gradient(circle at top, rgba(41, 95, 143, 0.08), transparent 55%);
    --spotlight-screen-bg: rgba(252, 248, 241, 0.95);
    --spotlight-screen-border: rgba(45, 60, 75, 0.08);
    --footer-bg: rgba(252, 248, 241, 0.88);
    --dropdown-bg: rgba(255, 253, 248, 0.98);
    --dropdown-shadow: 0 20px 38px rgba(40, 49, 58, 0.16);
    --info-soft: rgba(78, 107, 155, 0.1);
    --success-soft: rgba(59, 138, 99, 0.11);
    --success-text: #24543d;
    --warning-soft: rgba(182, 132, 59, 0.12);
    --warning-text: #765222;
    --danger-soft: rgba(182, 90, 80, 0.12);
    --danger-text: #6e312a;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, var(--bg-glow-warm), transparent 28%),
        radial-gradient(circle at top right, var(--bg-glow-cool), transparent 34%),
        linear-gradient(180deg, var(--bg-grad-start) 0%, var(--bg-grad-mid) 45%, var(--bg-grad-end) 100%);
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: auto;
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

body::before {
    width: 18rem;
    height: 18rem;
    top: 7rem;
    right: 8%;
    background: var(--bg-orb-warm);
}

body::after {
    width: 22rem;
    height: 22rem;
    bottom: 12rem;
    left: 4%;
    background: var(--bg-orb-cool);
}

html[data-theme='light'] body::before,
html[data-theme='light'] body::after {
    opacity: 0.32;
}

a {
    color: inherit;
    text-decoration: none;
}

.text-muted,
.small,
small {
    color: var(--muted) !important;
}

.main-container,
.shell-footer {
    position: relative;
    z-index: 1;
}

.page-frame {
    padding: 2rem 0 4rem;
}

.page-content {
    display: grid;
    gap: 1.5rem;
}

.shell-nav {
    position: sticky;
    top: 0;
    z-index: 1040;
    padding: 1rem 0 0;
    backdrop-filter: blur(18px);
}

.impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 1088;
    background: linear-gradient(90deg, rgba(247, 191, 99, 0.96), rgba(89, 212, 197, 0.94));
    color: #072033;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.impersonation-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    font-weight: 800;
}

.shell-nav__inner {
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 1.6rem;
    background: var(--nav-bg);
    box-shadow: var(--shadow);
}

.navbar-toggler {
    border-color: var(--line-strong);
    border-radius: 1rem;
    padding: 0.55rem 0.75rem;
    color: var(--text);
    background: var(--soft-panel-bg);
}

.navbar-dark .navbar-toggler {
    border-color: var(--line-strong);
    color: var(--text);
    background: var(--soft-panel-bg);
}

.navbar-dark .navbar-toggler-icon {
    width: 1.4rem;
    height: 1.4rem;
    background-image:
        linear-gradient(var(--text), var(--text)),
        linear-gradient(var(--text), var(--text)),
        linear-gradient(var(--text), var(--text));
    background-repeat: no-repeat;
    background-size: 100% 2px, 100% 2px, 100% 2px;
    background-position: center 0.3rem, center center, center calc(100% - 0.3rem);
}

.shell-nav__menu,
.shell-nav__actions {
    gap: 0.2rem;
}

.shell-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--text) !important;
    font-family: 'Syne', sans-serif;
    letter-spacing: -0.03em;
}

.shell-brand strong,
.section-title,
.workspace-hero__title,
.marketing-copy h1,
.spotlight-panel strong,
.metric-value,
.shell-footer h2 {
    font-family: 'Syne', sans-serif;
}

.shell-brand small,
.shell-user__meta small,
.footer-eyebrow,
.section-kicker,
.metric-kicker,
.workspace-hero__eyebrow {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
}

.shell-brand__mark {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.95rem;
    background: linear-gradient(145deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: var(--accent-contrast);
    box-shadow: 0 14px 40px rgba(var(--accent-rgb), 0.24);
}

.shell-link {
    color: var(--muted) !important;
    padding: 0.7rem 1rem !important;
    margin: 0 0.2rem;
    border-radius: 999px;
    font-weight: 600;
    transition: 0.2s ease;
}

.shell-link:hover,
.shell-link.active {
    color: var(--text) !important;
    background: var(--hover-bg);
}

.shell-nav__dropdown {
    min-width: 20rem;
    max-width: min(26rem, calc(100vw - 2rem));
    overflow: visible;
}

.menu-group-label {
    padding: 0.65rem 0.95rem 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.menu-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: start;
    white-space: normal;
}

.menu-item i {
    width: 1.1rem;
    margin-top: 0.15rem;
    text-align: center;
    color: var(--accent);
}

.menu-item__body {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.menu-item__body strong {
    color: var(--text);
    font-size: 0.95rem;
}

.menu-item__body small {
    color: var(--muted) !important;
    line-height: 1.35;
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
}

.menu-item__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 0.75rem;
    font-weight: 800;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    margin-left: 0.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 0.72rem;
    font-weight: 800;
}

.shell-user {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text) !important;
    padding: 0.4rem 0.55rem 0.4rem 0.4rem;
    border-radius: 999px;
    background: var(--chip-bg);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--control-bg);
    color: var(--text);
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    background: var(--control-hover-bg);
    border-color: rgba(var(--accent-rgb), 0.35);
    transform: translateY(-1px);
}

.shell-user__avatar {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-rgb), 0.1));
    color: var(--text);
    font-weight: 800;
}

.shell-user__meta strong {
    display: block;
    font-size: 0.95rem;
}

.btn {
    border-radius: 999px;
    padding: 0.8rem 1.2rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: var(--accent-contrast);
    background: linear-gradient(145deg, var(--accent) 0%, var(--accent-strong) 100%);
    box-shadow: 0 18px 36px rgba(var(--accent-rgb), 0.24);
}

.btn-primary:hover,
.btn-primary:focus {
    color: var(--accent-contrast);
}

.btn-ghost,
.btn-surface,
.btn-outline-primary,
.btn-outline-secondary {
    border-color: var(--line-strong);
    color: var(--text);
    background: var(--control-bg);
}

.btn-ghost:hover,
.btn-surface:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover {
    color: var(--text);
    border-color: rgba(var(--accent-rgb), 0.35);
    background: var(--control-hover-bg);
}

.workspace-hero,
.marketing-hero,
.surface,
.metric-tile,
.poster-cta,
.feature-strip {
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.workspace-hero,
.marketing-hero,
.poster-cta {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--hero-bg);
}

.workspace-hero {
    padding: 2.2rem;
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: end;
    overflow: visible;
}

.workspace-hero__title {
    margin: 0.35rem 0 0.75rem;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1.03;
    letter-spacing: -0.05em;
}

.workspace-hero__copy,
.section-copy,
.marketing-copy__lead,
.ticket-item p,
.surface-list,
.feature-row p,
.metric-note {
    color: var(--muted);
}

.workspace-hero__meta,
.workspace-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.workspace-hero__actions,
.surface-head,
.table-shell,
.table-enhanced,
.dropdown {
    overflow: visible;
}

.workspace-hero__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: var(--hero-chip-bg);
    color: var(--hero-chip-text);
    font-size: 0.92rem;
}

.marketing-hero {
    padding: 0;
}

.marketing-hero__grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    min-height: 36rem;
}

.marketing-copy {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.marketing-copy h1 {
    margin: 0.2rem 0 1rem;
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.spotlight-panel {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--spotlight-bg);
    border-left: 1px solid var(--line);
}

.spotlight-panel__screen {
    position: relative;
    padding: 1.4rem;
    border-radius: var(--radius-lg);
    background: var(--spotlight-screen-bg);
    border: 1px solid var(--spotlight-screen-border);
    overflow: hidden;
}

.spotlight-panel__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--spotlight-screen-border);
}

.spotlight-panel__row:last-child {
    border-bottom: 0;
}

.spotlight-panel__pulse {
    position: absolute;
    width: 14rem;
    height: 14rem;
    right: -5rem;
    top: -5rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.18), transparent 70%);
}

.spotlight-panel__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.spotlight-panel__meta span {
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--muted);
    font-size: 0.9rem;
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-xl);
    background: var(--soft-panel-strong);
}

.feature-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: var(--radius-md);
    background: var(--soft-panel-strong);
}

.feature-row__icon {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
}

.surface {
    border-radius: var(--radius-xl);
    padding: 1.6rem;
    background: var(--surface);
    backdrop-filter: blur(20px);
}

.surface-muted {
    background: linear-gradient(180deg, var(--soft-panel-bg), var(--soft-panel-strong));
}

.surface-split,
.section-grid,
.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.44fr);
    gap: 1.5rem;
}

.surface-card,
.auth-panel {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--soft-panel-bg);
    border: 1px solid var(--line);
}

.surface-head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.3rem;
}

.section-title {
    margin: 0.2rem 0 0;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: -0.04em;
}

.surface-list {
    padding-left: 1.2rem;
}

.surface-list li {
    margin-bottom: 0.7rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.metric-tile {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--soft-panel-bg), var(--soft-panel-strong));
}

.metric-value {
    margin: 0.25rem 0 0.55rem;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.05em;
}

.metric-note {
    margin: 0;
}

.table-shell {
    position: relative;
    overflow: visible;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
}

.data-table {
    margin: 0;
    color: var(--text);
    background: transparent;
}

.data-table thead th {
    padding: 1rem 1.1rem;
    color: var(--muted);
    background: var(--soft-panel-strong);
    border-bottom: 1px solid var(--line);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.data-table td {
    padding: 1rem 1.1rem;
    background: transparent;
    border-color: var(--line);
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--soft-panel-strong);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-active {
    color: #09131e;
    background: var(--success);
}

.status-pending {
    color: #211707;
    background: var(--warning);
}

.status-danger {
    color: #2a0d10;
    background: var(--danger);
}

.status-muted {
    color: var(--text);
    background: var(--chip-bg);
}

.empty-note {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    background: var(--soft-panel-bg);
    color: var(--muted);
}

.action-list {
    display: grid;
    gap: 0.85rem;
}

.action-list a {
    display: flex;
    align-items: start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    background: var(--soft-panel-bg);
    color: var(--text);
}

.action-list a:hover {
    background: var(--control-hover-bg);
}

.row-actions {
    display: inline-flex;
    position: relative;
    z-index: 2;
    isolation: isolate;
}

.row-actions .dropdown-toggle::after {
    margin-left: 0.65rem;
}

.row-actions .btn {
    display: inline-flex;
    align-items: center;
    min-width: 9.5rem;
    justify-content: space-between;
}

.row-actions .dropdown-menu {
    min-width: 15rem;
    max-width: min(18rem, calc(100vw - 2rem));
    margin-top: 0.45rem !important;
}

.aside-stack {
    display: grid;
    gap: 1.5rem;
    align-content: start;
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.form-label {
    margin-bottom: 0.45rem;
    font-weight: 700;
    color: var(--text);
}

.field-hint {
    margin-top: 0.45rem;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.form-control,
.form-select,
.input-group-text,
.modal-content,
.card,
.list-group-item {
    border-radius: var(--radius-md);
}

.form-control,
.form-select {
    padding: 0.9rem 1rem;
    color: var(--text);
    background: var(--control-bg);
    border: 1px solid var(--line-strong);
}

.form-control::placeholder {
    color: var(--placeholder);
}

.form-control:focus,
.form-select:focus {
    color: var(--text);
    background: var(--control-bg);
    border-color: var(--focus-border);
    box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.ticket-feed {
    display: grid;
    gap: 1rem;
}

.ticket-item {
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    background: var(--soft-panel-bg);
    border: 1px solid var(--line);
}

.ticket-item__header,
.ticket-item__side {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.ticket-item__header {
    justify-content: space-between;
    align-items: start;
}

.ticket-item h3 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
}

.ticket-item p {
    margin: 0;
}

.poster-cta {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.profile-sidebar,
.profile-form {
    min-height: 100%;
}

.dropdown-menu {
    z-index: 1085;
    padding: 0.5rem;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: var(--dropdown-bg);
    box-shadow: var(--dropdown-shadow);
    max-width: min(22rem, calc(100vw - 1.5rem));
}

.dropdown-menu .dropdown-item i,
.dropdown-menu .dropdown-item-text i {
    width: 1.1rem;
    text-align: center;
}

.dropdown-item {
    color: var(--text);
    border-radius: 0.8rem;
    padding: 0.75rem 0.95rem;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active {
    color: var(--text);
    background: var(--accent-soft);
}

.dropdown-item-text {
    display: block;
    padding: 0.75rem 0.95rem;
    border-radius: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    white-space: normal;
}

.dropdown-divider {
    border-color: var(--line);
}

.alert {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.alert-success {
    background: var(--success-soft);
    color: var(--success-text);
}

.alert-danger {
    background: var(--danger-soft);
    color: var(--danger-text);
}

.alert-warning {
    background: var(--warning-soft);
    color: var(--warning-text);
}

.list-group-item,
.card {
    color: var(--text);
    background: var(--soft-panel-bg);
    border: 1px solid var(--line);
}

.card-body {
    padding: 1.6rem;
}

.shell-footer {
    padding: 0 0 3rem;
}

.shell-footer .container {
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: var(--footer-bg);
    box-shadow: var(--shadow);
}

.shell-footer h2 {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    letter-spacing: -0.04em;
}

.shell-footer h6 {
    margin-bottom: 1rem;
    font-family: 'Syne', sans-serif;
    color: var(--text);
}

.shell-footer li,
.shell-footer a,
.shell-footer span {
    color: var(--muted);
    margin-bottom: 0.55rem;
}

.shell-footer__bar {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.activity-card {
    display: grid;
    gap: 0.2rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--soft-panel-bg);
    border: 1px solid var(--line);
    color: var(--text);
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.catalog-card {
    display: grid;
    gap: 1rem;
    padding: 1.3rem;
    border-radius: var(--radius-lg);
    background: var(--soft-panel-bg);
    border: 1px solid var(--line);
    min-width: 0;
}

.catalog-card__price {
    margin: 0 0 0.4rem;
    color: var(--accent);
    font-weight: 800;
}

.storefront-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.store-card {
    align-content: start;
}

.store-card__header,
.store-card__badges,
.store-card__meta,
.store-card__footer {
    display: grid;
    gap: 0.75rem;
}

.store-card__title {
    margin: 0;
    font-size: 1.2rem;
}

.store-card__copy {
    margin: 0.5rem 0 0;
    color: var(--muted);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.store-card__badges {
    display: flex;
    flex-wrap: wrap;
}

.store-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
}

.store-card__badge--accent {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.store-card__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    color: var(--muted);
    font-size: 0.92rem;
}

.store-card__meta span,
.store-card__quote {
    min-width: 0;
}

.store-card__meta i {
    color: var(--accent);
    margin-right: 0.35rem;
}

.store-card__features {
    margin: 0;
}

.store-card__features li {
    display: flex;
    gap: 0.55rem;
    align-items: start;
    overflow-wrap: anywhere;
}

.store-card__features i {
    color: var(--accent);
    margin-top: 0.18rem;
}

.store-pricing-list,
.store-card__form {
    min-width: 0;
}

.store-pricing-option,
.gateway-option {
    min-width: 0;
}

.store-pricing-option__body {
    min-width: 0;
}

.store-pricing-option__body strong,
.store-pricing-option__body small {
    display: block;
    overflow-wrap: anywhere;
}

.store-duration {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--soft-panel-bg);
    border: 1px solid var(--line);
}

.store-duration__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(7rem, 8.5rem);
    gap: 0.75rem;
}

.store-duration__chip {
    min-height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 1rem;
    border: 1px solid var(--line-strong);
    background: var(--control-bg);
    color: var(--text);
    font-weight: 700;
}

.store-card__quote {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, var(--soft-panel-bg), var(--soft-panel-strong));
    border: 1px solid var(--line);
}

.store-card__quote-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.store-card__quote strong {
    display: block;
    font-size: 1.15rem;
    color: var(--text);
}

.store-card__quote small {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.store-domain-feedback__message {
    font-weight: 700;
}

.store-domain-feedback__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.45rem;
    font-size: 0.92rem;
}

.store-domain-feedback__meta strong {
    color: inherit;
}

.checkout-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.checkout-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.summary-list {
    display: grid;
    gap: 0.8rem;
}

.summary-list div {
    display: flex;
    justify-content: space-between;
    align-items: start;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--muted);
    min-width: 0;
}

.summary-list strong {
    color: var(--text);
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: right;
}

.gateway-list {
    display: grid;
    gap: 0.75rem;
}

.gateway-option {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.8rem;
    align-items: start;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    background: var(--soft-panel-bg);
    border: 1px solid var(--line);
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.shortcut-card {
    display: grid;
    gap: 0.45rem;
    padding: 1.15rem;
    border-radius: var(--radius-lg);
    background: var(--soft-panel-bg);
    border: 1px solid var(--line);
    color: var(--text);
}

.shortcut-card i {
    font-size: 1.3rem;
    color: var(--accent);
}

.shortcut-card--disabled {
    opacity: 0.72;
}

.insight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
    gap: 1.5rem;
}

.insight-panel {
    padding: 1.45rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--soft-panel-bg), var(--soft-panel-strong));
    min-width: 0;
}

.chart-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(2.8rem, 1fr));
    gap: 0.9rem;
    align-items: end;
    min-height: 17rem;
}

.apex-chart {
    min-height: 20rem;
}

.chart-bar {
    display: grid;
    gap: 0.5rem;
    justify-items: center;
}

.chart-bar__value {
    display: flex;
    align-items: end;
    justify-content: center;
    width: 100%;
    min-height: 2rem;
    padding: 0.45rem;
    border-radius: 1rem 1rem 0.8rem 0.8rem;
    background: linear-gradient(180deg, var(--accent-strong), var(--accent));
    color: var(--accent-contrast);
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.16);
}

.chart-bar__label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.breakdown-list {
    display: grid;
    gap: 0.9rem;
}

.breakdown-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
}

.breakdown-item strong {
    font-size: 1.05rem;
}

.breakdown-item span {
    color: var(--muted);
}

.breakdown-meter {
    grid-column: 1 / -1;
    height: 0.6rem;
    border-radius: 999px;
    background: var(--chip-bg);
    overflow: hidden;
}

.breakdown-meter > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.dt-container .dt-layout-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    color: var(--muted);
}

.dt-container .dt-layout-row:not(:last-child) {
    margin-bottom: 1rem;
}

.dt-container.table-enhanced .dt-layout-row:first-child {
    justify-content: space-between;
}

.dt-container .dt-input,
.dt-container .dt-length select {
    color: var(--text);
    background: var(--control-bg);
    border: 1px solid var(--line-strong);
    border-radius: 0.9rem;
    padding: 0.55rem 0.8rem;
}

.dt-container .dt-paging .dt-paging-button {
    border-radius: 999px !important;
    border: 1px solid var(--line-strong) !important;
    color: var(--text) !important;
    background: var(--control-bg) !important;
}

.dt-container .dt-paging .dt-paging-button.current,
.dt-container .dt-paging .dt-paging-button:hover {
    background: var(--control-hover-bg) !important;
    border-color: rgba(var(--accent-rgb), 0.28) !important;
}

.dt-container .dt-search {
    margin-left: auto;
}

.dt-container .dt-search input {
    min-width: min(20rem, 100%);
}

.admin-hub {
    padding: 0.2rem 0 0.4rem;
    max-width: 100%;
    min-width: 0;
}

.admin-hub__scroll {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(11.5rem, 100%), 1fr));
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

.admin-hub__link {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: var(--soft-panel-bg);
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.admin-hub__link i {
    flex: 0 0 auto;
    margin-top: 0.15rem;
}

.admin-hub__label {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.admin-hub__link:hover,
.admin-hub__link.is-active {
    color: var(--text);
    background: var(--control-hover-bg);
    border-color: rgba(var(--accent-rgb), 0.24);
    transform: translateY(-1px);
}

.conversation-thread {
    display: grid;
    gap: 0.9rem;
}

.chat-bubble {
    padding: 1rem 1.05rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--soft-panel-bg);
}

.chat-bubble--client {
    background: var(--accent-soft);
}

.chat-bubble--agent {
    background: var(--info-soft);
}

.chat-bubble--system {
    background: rgba(255, 255, 255, 0.04);
}

.chat-bubble p {
    margin: 0.55rem 0 0;
    color: var(--text);
}

.chat-bubble__meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.86rem;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 600;
}

.support-chat-shell {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
    gap: 1.25rem;
    align-items: start;
}

.support-chat-shell__sidebar,
.support-chat-shell__main {
    min-width: 0;
}

.support-chat-shell__sidebar {
    padding-right: 0.35rem;
}

.surface,
.metric-tile,
.surface-card,
.table-shell,
.activity-card,
.chat-bubble {
    min-width: 0;
}

.ticket-feed--compact .ticket-item {
    padding: 1rem 1.05rem;
}

.ticket-item--link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ticket-item--link:hover,
.ticket-item--link:focus {
    color: inherit;
    border-color: rgba(var(--accent-rgb), 0.4);
    transform: translateY(-1px);
}

.ticket-item--link.is-active {
    border-color: rgba(var(--accent-rgb), 0.55);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.chat-thread {
    display: grid;
    gap: 1rem;
}

.chat-thread__head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: start;
}

.chat-stream {
    min-height: 20rem;
    max-height: 34rem;
    overflow: auto;
    padding-right: 0.4rem;
}

.chat-thread__foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.36fr);
    gap: 1rem;
    align-items: start;
}

.chat-thread__foot .form-stack {
    margin: 0;
}

.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 3rem;
    border-radius: 1rem;
    border: 1px solid var(--line-strong);
    background: var(--control-bg);
    color: var(--text);
    padding: 0.35rem 0.8rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text);
    line-height: 2.2rem;
    padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--placeholder);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 0.6rem;
}

.select2-container--default .select2-selection--multiple {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-block: 0.25rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--accent-soft);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    color: var(--text);
    border-radius: 999px;
    padding: 0.2rem 0.7rem 0.2rem 1.4rem;
    margin-top: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    border-right: 0;
    color: var(--text);
    left: 0.55rem;
}

.select2-container--default .select2-search--inline .select2-search__field {
    margin-top: 0 !important;
    color: var(--text);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--focus-border);
    box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.select2-dropdown {
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: var(--dropdown-bg);
    color: var(--text);
    overflow: hidden;
    box-shadow: var(--dropdown-shadow);
}

.select2-container--default .select2-results__option {
    padding: 0.75rem 0.95rem;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--accent-soft);
    color: var(--text);
}

.select2-search--dropdown {
    padding: 0.55rem;
    background: transparent;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border-radius: 0.8rem;
    border: 1px solid var(--line);
    background: var(--control-bg);
    color: var(--text);
}

.dt-container .dt-length label,
.dt-container .dt-search label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.dt-container .dt-length .select2-container {
    width: auto !important;
    min-width: 5rem;
}

.dt-container .dt-length .select2-container--default .select2-selection--single {
    min-height: 2.5rem;
    padding: 0.2rem 2rem 0.2rem 0.75rem;
}

.dt-container .dt-length .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2rem;
}

html[data-theme='light'] .shell-nav__inner,
html[data-theme='light'] .btn-ghost,
html[data-theme='light'] .btn-surface,
html[data-theme='light'] .btn-outline-primary,
html[data-theme='light'] .btn-outline-secondary,
html[data-theme='light'] .feature-strip,
html[data-theme='light'] .feature-row,
html[data-theme='light'] .surface-muted,
html[data-theme='light'] .surface-card,
html[data-theme='light'] .auth-panel,
html[data-theme='light'] .metric-tile,
html[data-theme='light'] .empty-note,
html[data-theme='light'] .action-list a,
html[data-theme='light'] .activity-card,
html[data-theme='light'] .catalog-card,
html[data-theme='light'] .gateway-option,
html[data-theme='light'] .shortcut-card,
html[data-theme='light'] .admin-hub__link,
html[data-theme='light'] .chat-bubble,
html[data-theme='light'] .ticket-item,
html[data-theme='light'] .list-group-item,
html[data-theme='light'] .card,
html[data-theme='light'] .dropdown-menu {
    box-shadow: var(--shadow);
}

html[data-theme='light'] .spotlight-panel__row {
    border-bottom-color: var(--line);
}

html[data-theme='light'] .form-label {
    color: var(--text);
}

html[data-theme='light'] .status-muted {
    background: var(--chip-bg);
}

html[data-theme='light'] .chat-bubble--client {
    background: var(--accent-soft);
}

html[data-theme='light'] .chat-bubble--agent {
    background: var(--info-soft);
}

[data-motion='reveal'] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-motion='reveal'].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1199px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-grid,
    .profile-grid,
    .surface-split,
    .marketing-hero__grid,
    .insight-grid {
        grid-template-columns: 1fr;
    }

    .spotlight-panel {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .support-chat-shell,
    .chat-thread__foot {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .shell-nav__inner {
        border-radius: 1.4rem;
    }

    .shell-nav {
        padding-top: 0.6rem;
    }

    .navbar-toggler {
        margin-left: auto;
    }

    .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        padding-top: 1rem;
    }

    .shell-nav__menu,
    .shell-nav__actions {
        width: 100%;
        gap: 0.35rem;
        align-items: stretch !important;
        padding-top: 0;
    }

    .shell-nav__actions {
        margin-top: 0.85rem;
        border-top: 1px solid var(--line);
        padding-top: 0.9rem;
    }

    .shell-nav__menu .nav-item,
    .shell-nav__actions .nav-item {
        width: 100%;
    }

    .workspace-hero,
    .poster-cta,
    .surface-head,
    .ticket-item__header {
        flex-direction: column;
        align-items: start;
    }

    .shell-user {
        margin-top: 0.3rem;
    }

    .theme-toggle {
        margin-top: 0.3rem;
    }

    .shell-link,
    .shell-user,
    .theme-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .shell-link {
        margin: 0.15rem 0;
    }

    .shell-nav .dropdown-menu {
        position: static !important;
        inset: auto !important;
        width: 100%;
        margin-top: 0.45rem !important;
        box-shadow: none;
        background: var(--soft-panel-bg);
    }

    .shell-nav .dropdown-item,
    .shell-nav .dropdown-item-text {
        white-space: normal;
    }

    .row-actions .btn {
        min-width: 100%;
    }

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

    .support-chat-shell__sidebar {
        padding-right: 0;
    }
}

@media (max-width: 767px) {
    .page-frame {
        padding-top: 1.2rem;
    }

    .marketing-copy,
    .workspace-hero,
    .surface,
    .poster-cta,
    .shell-footer .container {
        padding: 1.35rem;
    }

    .feature-strip,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .checkout-inline,
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .store-duration__grid,
    .store-card__meta {
        grid-template-columns: 1fr;
    }

    .admin-hub__scroll {
        grid-template-columns: 1fr;
    }

    .impersonation-banner__inner {
        flex-direction: column;
        align-items: start;
    }

    .responsive-stack-table thead {
        display: none;
    }

    .responsive-stack-table,
    .responsive-stack-table tbody,
    .responsive-stack-table tr,
    .responsive-stack-table td {
        display: block;
        width: 100%;
    }

    .responsive-stack-table tr {
        padding: 0.9rem 1rem;
    }

    .responsive-stack-table td {
        padding: 0.15rem 0 0.35rem;
        border: 0;
        min-height: 2.1rem;
    }

    .responsive-stack-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.16rem;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .responsive-stack-table td.text-end {
        text-align: left !important;
        margin-top: 0.45rem;
    }

    .summary-list strong {
        text-align: left;
    }

    .dt-container .dt-search {
        width: 100%;
        margin-left: 0;
    }

    .dt-container .dt-search input {
        width: 100%;
        min-width: 0;
    }

    .shell-footer__bar {
        flex-direction: column;
    }
}


/* Phase 12 UI cleanup: consistent spacing, forms, tables, and sensitive-field toggles */
:root {
    --page-max-width: 1240px;
    --control-height: 46px;
}

.container,
.container-lg,
.container-md,
.container-sm,
.container-xl,
.container-xxl {
    max-width: var(--page-max-width);
}

.page-content > * {
    width: 100%;
}

.workspace-hero,
.surface,
.poster-cta,
.marketing-copy,
.table-shell,
.aside-stack > .surface,
.card,
.alert {
    overflow-wrap: anywhere;
}

.workspace-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.workspace-hero__title,
.section-title,
.surface h1,
.surface h2,
.surface h3 {
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.workspace-hero__copy,
.surface p:last-child {
    margin-bottom: 0;
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 1.25rem;
    align-items: start;
}

.section-grid > .surface,
.section-grid > .aside-stack,
.page-content > .surface,
.page-content > section,
.page-content > form {
    min-width: 0;
}

.aside-stack {
    display: grid;
    gap: 1rem;
}

.surface,
.card,
.table-shell {
    border-radius: var(--radius-lg, 22px);
    border: 1px solid var(--line, rgba(255,255,255,.1));
    background: var(--surface, rgba(12, 24, 39, 0.82));
    box-shadow: var(--shadow, 0 18px 60px rgba(0,0,0,.28));
}

.surface,
.card-body {
    padding: clamp(1rem, 2.2vw, 1.6rem);
}

.surface + .surface,
.surface + .section-grid,
.section-grid + .surface,
.section-grid + .section-grid {
    margin-top: 1.25rem;
}

.form-stack,
.surface form:not(.row) {
    display: grid;
    gap: 1rem;
}

.row.g-3,
.row.g-4 {
    align-items: end;
}

.form-label,
label {
    color: var(--text, #eef7ff);
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: var(--control-height);
    border-radius: var(--radius-sm, 12px) !important;
    border: 1px solid var(--line-strong, rgba(255,255,255,.18)) !important;
    background: var(--control-bg, rgba(255,255,255,.04)) !important;
    color: var(--text, #eef7ff) !important;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--focus-border, rgba(89,212,197,.42)) !important;
    box-shadow: 0 0 0 0.22rem var(--focus-ring, rgba(89,212,197,.14)) !important;
}

.form-control::placeholder {
    color: var(--placeholder, rgba(150,164,198,.62));
}

.btn {
    border-radius: var(--radius-sm, 12px);
    font-weight: 800;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
}

.btn-sm {
    min-height: 34px;
}

.table-shell {
    width: 100%;
    overflow-x: auto;
    padding: 0.35rem;
}

.table {
    margin-bottom: 0;
    color: var(--text, #eef7ff);
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    padding: 0.9rem 1rem;
    border-bottom-color: var(--line, rgba(255,255,255,.09));
}

.table thead th {
    color: var(--muted, #8fa4bc);
    font-size: .76rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-nav,
.admin-hub,
.metric-grid,
.feature-strip {
    gap: 1rem;
}

.shell-nav__inner,
.dropdown-menu,
.modal-content {
    border: 1px solid var(--line, rgba(255,255,255,.09));
}

.dropdown-menu {
    padding: .6rem;
    border-radius: 18px;
}

.dropdown-item {
    border-radius: 12px;
}

.secret-toggle-wrap {
    position: relative;
    width: 100%;
}

.secret-toggle-wrap > .form-control,
.secret-toggle-wrap > input {
    padding-right: 3rem !important;
    width: 100%;
}

.secret-toggle-btn {
    position: absolute;
    top: 50%;
    right: .45rem;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 10px;
    background: var(--control-hover-bg, rgba(89,212,197,.12));
    color: var(--muted, #8fa4bc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
}

.secret-toggle-btn:hover,
.secret-toggle-btn:focus {
    color: var(--text, #eef7ff);
    background: var(--accent-soft, rgba(89,212,197,.16));
    outline: none;
}

@media (max-width: 991px) {
    .section-grid {
        grid-template-columns: 1fr;
    }

    .workspace-hero {
        align-items: flex-start;
    }
}

@media (max-width: 767px) {
    .page-frame {
        padding-left: .2rem;
        padding-right: .2rem;
    }

    .surface,
    .card-body,
    .workspace-hero,
    .marketing-copy,
    .poster-cta {
        padding: 1rem;
        border-radius: 18px;
    }

    .row > [class*="col-"] {
        margin-bottom: .35rem;
    }

    .btn,
    .form-control,
    .form-select {
        width: 100%;
    }
}

/* Phase 13: Hostinger/GoDaddy-inspired polish */
:root {
    --brand-primary: #673de6;
    --brand-primary-rgb: 103, 61, 230;
    --brand-secondary: #00b090;
    --brand-ink: #1d1e20;
    --brand-panel: rgba(255, 255, 255, 0.94);
}

html[data-theme='light'] {
    --bg-grad-start: #f7f5ff;
    --bg-grad-mid: #f8fafc;
    --bg-grad-end: #eef7ff;
    --accent: var(--brand-primary);
    --accent-rgb: var(--brand-primary-rgb);
    --accent-strong: #5025d1;
    --surface: rgba(255,255,255,.92);
    --surface-strong: #ffffff;
    --nav-bg: rgba(255,255,255,.92);
    --dropdown-bg: #ffffff;
}

body {
    letter-spacing: -0.01em;
}

.shell-nav {
    padding: .75rem 0 0;
}

.shell-nav__inner {
    border-radius: 22px;
    background: var(--nav-bg);
    box-shadow: 0 18px 48px rgba(31, 41, 55, .10);
}

html[data-theme='light'] .navbar-dark .navbar-nav .nav-link,
html[data-theme='light'] .shell-link,
html[data-theme='light'] .shell-user,
html[data-theme='light'] .navbar-dark .navbar-brand {
    color: #1f2937;
}

.shell-brand__mark {
    background: linear-gradient(135deg, var(--brand-primary), #8b5cf6);
    color: #fff;
    box-shadow: 0 10px 24px rgba(var(--brand-primary-rgb), .26);
}

.btn-primary,
.btn-accent {
    background: linear-gradient(135deg, var(--brand-primary), #7c3aed) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 12px 26px rgba(var(--brand-primary-rgb), .24);
}

.btn-primary:hover,
.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(var(--brand-primary-rgb), .30);
}

.surface,
.surface-card,
.card,
.dashboard-card,
.metric-card,
.stat-card,
.table-shell,
.form-shell,
.auth-card,
.panel,
.module-card {
    border: 1px solid rgba(103,61,230,.10) !important;
    border-radius: 24px !important;
    background: var(--surface) !important;
    box-shadow: 0 18px 42px rgba(15,23,42,.08) !important;
}

.surface-head,
.card-header,
.page-header,
.section-head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.section-kicker,
.kicker,
.badge-soft,
.status-pill {
    letter-spacing: .02em;
    font-weight: 800;
}

.section-kicker,
.kicker {
    color: var(--brand-primary) !important;
}

.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 46px;
    border-radius: 14px !important;
    border-color: rgba(103,61,230,.16) !important;
    background: var(--control-bg) !important;
    color: var(--text) !important;
}

.form-control:focus,
.form-select:focus,
.select2-container--focus .select2-selection,
.select2-container--open .select2-selection {
    border-color: rgba(var(--brand-primary-rgb), .46) !important;
    box-shadow: 0 0 0 .22rem rgba(var(--brand-primary-rgb), .12) !important;
}

.table,
table.dataTable {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 .55rem !important;
}

.table thead th,
table.dataTable thead th {
    border: 0 !important;
    color: var(--muted) !important;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 800;
}

.table tbody tr,
table.dataTable tbody tr {
    background: var(--surface-strong) !important;
    box-shadow: 0 8px 24px rgba(15,23,42,.045);
}

.table tbody td,
table.dataTable tbody td {
    border-top: 1px solid var(--line) !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 1rem !important;
    vertical-align: middle;
}

.table tbody td:first-child,
table.dataTable tbody td:first-child {
    border-left: 1px solid var(--line) !important;
    border-radius: 16px 0 0 16px;
}

.table tbody td:last-child,
table.dataTable tbody td:last-child {
    border-right: 1px solid var(--line) !important;
    border-radius: 0 16px 16px 0;
}

.dt-container,
.table-enhanced {
    overflow-x: auto;
}

.dt-search,
.dt-length {
    margin-bottom: .85rem;
}

/* Message library color correction */
body .email-template-card,
body .template-card,
body .message-card,
body .message-library,
body .surface:has(.section-title) {
    color: var(--text);
}

body .admin-email-templates .surface,
body .admin-email-templates .card,
body .email-templates .surface,
body .email-templates .card {
    background: var(--surface-strong) !important;
    color: var(--text) !important;
}

body .message-preview,
body .template-preview,
body pre,
body code {
    background: rgba(103,61,230,.07) !important;
    border: 1px solid rgba(103,61,230,.12) !important;
    color: var(--text) !important;
    border-radius: 16px;
}

/* Better admin density */
.page-frame .container,
.shell-nav .container,
.shell-footer .container {
    max-width: 1240px;
}

.row.g-4,
.row.g-3,
.page-content {
    align-items: stretch;
}

@media (min-width: 992px) {
    .admin-grid,
    .dashboard-grid,
    .stat-grid,
    .summary-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .shell-nav__inner { border-radius: 0 0 22px 22px; }
    .page-frame { padding-top: 1rem; }
    .table tbody td:first-child,
    table.dataTable tbody td:first-child,
    .table tbody td:last-child,
    table.dataTable tbody td:last-child { border-radius: 0; }
}

/* Phase 14 Hostinger/GoDaddy-inspired refinement */
:root{--brand-host:#673de6;--brand-host-2:#00b090;--brand-page:#f4f7fb;--brand-card:#ffffff;--brand-text:#1d1e20;--brand-muted:#6d7081;--brand-border:#e7e9f2;--brand-shadow:0 18px 55px rgba(30,41,59,.08)}
html[data-theme='light'] body{background:linear-gradient(180deg,#f8f9ff 0%,#f4f7fb 42%,#fff 100%);color:var(--brand-text)}
html[data-theme='light'] .shell-nav{background:rgba(255,255,255,.88)!important;border-bottom:1px solid var(--brand-border);backdrop-filter:blur(18px)}
html[data-theme='light'] .shell-brand__mark{background:linear-gradient(135deg,var(--brand-host),#8b5cf6)!important;color:#fff!important;box-shadow:0 10px 26px rgba(103,61,230,.28)}
html[data-theme='light'] .shell-link,html[data-theme='light'] .shell-user{color:#2f3150!important;border-radius:999px}html[data-theme='light'] .shell-link.active,html[data-theme='light'] .shell-link:hover{background:rgba(103,61,230,.1)!important;color:var(--brand-host)!important}
html[data-theme='light'] .btn-primary{background:var(--brand-host)!important;border-color:var(--brand-host)!important;box-shadow:0 12px 24px rgba(103,61,230,.18)}html[data-theme='light'] .btn-primary:hover{background:#5025d1!important;border-color:#5025d1!important;transform:translateY(-1px)}
.page-shell,.admin-shell,.dashboard-shell{max-width:1220px;margin-inline:auto;padding:28px 18px}.page-heading,.admin-heading,.dashboard-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:22px}.page-heading h1,.admin-heading h1,.dashboard-heading h1{font-size:clamp(1.7rem,3vw,2.5rem);font-weight:850;letter-spacing:-.055em;margin:0}.page-heading p,.admin-heading p,.dashboard-heading p{color:var(--muted);max-width:760px;margin:.45rem 0 0}
.card,.panel,.table-shell,.stat-card,.admin-card,.feature-card,.billing-card,.message-library-card{border-radius:24px!important;border:1px solid var(--brand-border)!important;background:rgba(255,255,255,.92)!important;box-shadow:var(--brand-shadow)!important}.card:hover,.panel:hover,.admin-card:hover,.stat-card:hover{box-shadow:0 22px 70px rgba(30,41,59,.11)!important}.stat-card{position:relative;overflow:hidden}.stat-card:before{content:"";position:absolute;right:-32px;top:-38px;width:120px;height:120px;border-radius:999px;background:rgba(103,61,230,.10)}
.form-control,.form-select,input[type="text"],input[type="email"],input[type="password"],input[type="number"],input[type="url"],textarea,select{min-height:44px;border-radius:14px!important;border-color:var(--brand-border)!important;background:#fff!important;color:var(--brand-text)!important}.form-control:focus,.form-select:focus,input:focus,textarea:focus,select:focus{border-color:var(--brand-host)!important;box-shadow:0 0 0 4px rgba(103,61,230,.12)!important}.input-group-password{position:relative}.input-group-password input{padding-right:3.2rem!important}.password-toggle-btn{position:absolute;right:.35rem;top:50%;transform:translateY(-50%);border:0;background:transparent;color:var(--brand-muted);width:40px;height:38px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center}.password-toggle-btn:hover{background:rgba(103,61,230,.08);color:var(--brand-host)}
.table-shell{padding:0!important;overflow:hidden}.table-shell .table,.table-shell table{margin:0!important}.table-shell th{background:#f9fafc!important;color:#697386!important;font-size:.76rem;text-transform:uppercase;letter-spacing:.055em}.table-shell td,.table-shell th{border-color:#eef1f6!important;padding:15px 18px!important}.table-shell tbody tr:hover{background:#fbfaff!important}.dataTables_wrapper,.dt-container{padding:16px}.dt-search input,.dt-length select{border-radius:12px!important;border:1px solid var(--brand-border)!important;padding:.6rem .8rem!important}
.message-library,.message-library-card,.message-card{background:#fff!important;color:#172033!important}.message-library .badge,.message-library-card .badge{background:rgba(103,61,230,.1)!important;color:var(--brand-host)!important}.message-library .message-preview,.message-card__body{background:#f8fafc!important;border:1px solid #e8edf5!important;color:#27364a!important;border-radius:16px!important}.message-library .btn-outline,.message-library-card .btn-outline{border-color:#d9dded!important;color:#344054!important}.message-library .btn-outline:hover{background:#f4f0ff!important;color:var(--brand-host)!important}
.empty-state{border:1px dashed #cfd6e6;border-radius:22px;background:#fbfcff;padding:32px;text-align:center;color:var(--brand-muted)}.empty-state i{font-size:2rem;color:var(--brand-host);margin-bottom:10px}.status-pill.status-active,.badge.bg-success{background:rgba(0,176,144,.12)!important;color:#007f68!important}.status-pill.status-pending,.badge.bg-warning{background:rgba(245,158,11,.14)!important;color:#9a5b00!important}.status-pill.status-danger,.badge.bg-danger{background:rgba(239,68,68,.12)!important;color:#b42318!important}
@media(max-width:768px){.page-heading,.admin-heading,.dashboard-heading{display:block}.shell-nav__menu,.shell-nav__actions{align-items:stretch!important}.card,.panel,.table-shell,.stat-card,.admin-card{border-radius:18px!important}.table-shell{overflow-x:auto}.responsive-stack-table thead{display:none}.responsive-stack-table tbody tr{display:block;border-bottom:1px solid var(--brand-border);padding:10px}.responsive-stack-table tbody td{display:flex!important;justify-content:space-between;gap:18px;border:0!important;padding:10px 4px!important}.responsive-stack-table tbody td:before{content:attr(data-label);font-weight:800;color:var(--brand-muted)}}

/* Phase 15: responsive admin nav, modern host-style surfaces, skeleton UI, onboarding */
:root {
    --ui-purple: #673de6;
    --ui-purple-dark: #5025d1;
    --ui-green: #00b090;
    --ui-ink: #151827;
    --ui-muted: #667085;
    --ui-border: #e6e9f2;
    --ui-soft: #f6f7fb;
    --ui-card: rgba(255,255,255,.96);
    --ui-shadow: 0 22px 70px rgba(18, 24, 40, .09);
}
body { letter-spacing: -.01em; }
.shell-nav__dropdown { width: min(92vw, 430px); padding: .75rem; border-radius: 22px; box-shadow: 0 28px 80px rgba(17,24,39,.16); }
.shell-nav__dropdown .dropdown-item { white-space: normal; border-radius: 16px; }
.menu-item { display: flex; gap: .8rem; align-items: flex-start; padding: .78rem .85rem; }
.menu-item i { width: 34px; height: 34px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--ui-purple); background: rgba(103,61,230,.1); flex: 0 0 34px; }
.menu-item__body small { display: block; color: var(--ui-muted); line-height: 1.25; margin-top: .12rem; }

.admin-hub { margin: 0 0 1.4rem; }
.admin-hub__top { display: flex; gap: .8rem; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.admin-hub__search { max-width: 340px; border-radius: 999px !important; padding-left: 1rem !important; }
.admin-hub__scroll { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: .62rem; overflow: visible; }
.admin-hub__link { min-height: 48px; border: 1px solid var(--ui-border); background: var(--ui-card); color: #2d314a; border-radius: 16px; padding: .72rem .82rem; display: flex; align-items: center; gap: .65rem; text-decoration: none; box-shadow: 0 10px 26px rgba(18,24,40,.045); transition: all .18s ease; }
.admin-hub__link i { color: var(--ui-purple); }
.admin-hub__link:hover { transform: translateY(-1px); color: var(--ui-purple); border-color: rgba(103,61,230,.25); box-shadow: 0 18px 42px rgba(18,24,40,.08); }
.admin-hub__link.is-active { background: linear-gradient(135deg, var(--ui-purple), #8b5cf6); color: #fff; border-color: transparent; }
.admin-hub__link.is-active i { color: #fff; }
.admin-hub__mobile-select { display: none; }

.skeleton-area { display: none; }
.is-loading .skeleton-area, [data-loading="true"] .skeleton-area { display: block; }
.is-loading .onboarding-real-content, [data-loading="true"] .onboarding-real-content { display: none; }
.skeleton-line, .skeleton-input, .skeleton-card { position: relative; overflow: hidden; background: #edf0f7; border-radius: 999px; }
.skeleton-line { height: 14px; margin-bottom: 12px; }
.skeleton-line--short { width: 46%; }
.skeleton-input { height: 54px; border-radius: 16px; margin-top: 18px; }
.skeleton-card { height: 160px; border-radius: 24px; }
.skeleton-line::after, .skeleton-input::after, .skeleton-card::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent); animation: skeleton-sweep 1.2s infinite; }
@keyframes skeleton-sweep { to { transform: translateX(100%); } }

.onboarding-shell { max-width: 1120px; margin: 2rem auto; padding: 0 1rem; display: grid; grid-template-columns: 1.05fr .95fr; gap: 1.2rem; align-items: stretch; }
.onboarding-card { border: 1px solid var(--ui-border); border-radius: 30px; background: var(--ui-card); box-shadow: var(--ui-shadow); padding: clamp(1.3rem, 3vw, 2.2rem); }
.onboarding-card--intro { color: #fff; background: radial-gradient(circle at 15% 10%, rgba(255,255,255,.24), transparent 32%), linear-gradient(135deg, #1f134d, var(--ui-purple)); }
.onboarding-kicker { display: inline-flex; border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.12); border-radius: 999px; padding: .42rem .75rem; font-weight: 800; font-size: .78rem; margin-bottom: 1rem; }
.onboarding-card h1 { font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.065em; font-weight: 900; margin-bottom: .7rem; }
.onboarding-card h2 { font-weight: 850; letter-spacing: -.04em; }
.onboarding-card--intro p { color: rgba(255,255,255,.82); font-size: 1.05rem; }
.onboarding-steps { display: grid; gap: .7rem; margin-top: 2rem; }
.onboarding-steps span { display: flex; align-items: center; gap: .65rem; padding: .8rem; border-radius: 18px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.78); }
.onboarding-steps span.is-active, .onboarding-steps span.is-done { background: rgba(255,255,255,.18); color: #fff; }
.otp-input { text-align: center; font-size: 1.55rem !important; font-weight: 850; letter-spacing: .55rem; }
.verify-form .btn { min-height: 52px; border-radius: 16px; }

.table, .card, .surface, .panel { backdrop-filter: saturate(130%) blur(8px); }
.page-frame { background: linear-gradient(180deg, rgba(103,61,230,.04), transparent 360px); }

@media (max-width: 991px) {
    .navbar-collapse { background: rgba(255,255,255,.98); border: 1px solid var(--ui-border); border-radius: 22px; margin-top: .85rem; padding: .8rem; box-shadow: var(--ui-shadow); max-height: calc(100vh - 100px); overflow-y: auto; }
    .navbar-dark .navbar-nav .nav-link, .shell-link { color: #20243a !important; }
    .shell-nav__dropdown { position: static !important; transform: none !important; width: 100%; box-shadow: none; border: 1px solid var(--ui-border); margin: .35rem 0 .6rem; }
    .shell-nav__menu .nav-item { width: 100%; }
    .shell-nav__menu .shell-link { display: flex; justify-content: space-between; padding: .82rem .9rem; border-radius: 14px; }
    .admin-hub__top { display: grid; grid-template-columns: 1fr; }
    .admin-hub__mobile-select { display: block; width: 100%; border-radius: 16px !important; min-height: 48px; }
    .admin-hub__scroll { max-height: 238px; overflow-y: auto; grid-template-columns: 1fr 1fr; padding-right: .15rem; }
    .admin-hub__link { min-height: 44px; }
    .onboarding-shell { grid-template-columns: 1fr; margin-top: 1rem; }
}
@media (max-width: 575px) {
    .admin-hub__scroll { grid-template-columns: 1fr; }
    .onboarding-card { border-radius: 22px; }
    .otp-input { letter-spacing: .32rem; }
}

/* Phase 16: modern UI refinement and responsive admin control centre */
:root {
    --modern-primary: #673de6;
    --modern-primary-2: #7c3aed;
    --modern-primary-soft: rgba(103, 61, 230, .11);
    --modern-success: #00b090;
    --modern-warning: #f59e0b;
    --modern-danger: #ef4444;
    --modern-ink: #111827;
    --modern-muted: #667085;
    --modern-line: #e7e9f3;
    --modern-bg: #f7f8fc;
    --modern-card: rgba(255,255,255,.98);
    --modern-radius: 24px;
    --modern-shadow-sm: 0 12px 30px rgba(17, 24, 39, .06);
    --modern-shadow-md: 0 24px 70px rgba(17, 24, 39, .10);
}
html[data-theme='dark'] {
    --modern-ink: #f8fafc;
    --modern-muted: #aab3c5;
    --modern-line: rgba(255,255,255,.12);
    --modern-bg: #0b1020;
    --modern-card: rgba(17, 24, 39, .92);
    --modern-shadow-sm: 0 18px 48px rgba(0,0,0,.24);
    --modern-shadow-md: 0 30px 80px rgba(0,0,0,.32);
}
body {
    background:
        radial-gradient(circle at 10% -10%, rgba(103,61,230,.12), transparent 32rem),
        radial-gradient(circle at 95% 8%, rgba(0,176,144,.10), transparent 28rem),
        var(--modern-bg) !important;
    color: var(--modern-ink);
}
.page-frame { padding-top: 1.35rem; }
.page-content { gap: 1.25rem; }
.container { max-width: 1240px; }
.shell-nav { padding-top: .75rem; }
.shell-nav__inner {
    border-radius: 22px !important;
    border: 1px solid rgba(103,61,230,.14) !important;
    box-shadow: 0 12px 38px rgba(17,24,39,.08) !important;
}
.shell-brand__mark {
    background: linear-gradient(135deg, var(--modern-primary), #9f7aea) !important;
    box-shadow: 0 14px 28px rgba(103,61,230,.26);
}
.shell-link, .navbar .nav-link {
    border-radius: 999px !important;
    font-weight: 800;
    letter-spacing: -.01em;
}
.shell-link:hover, .shell-link.active {
    background: var(--modern-primary-soft) !important;
    color: var(--modern-primary) !important;
}
.shell-nav__dropdown {
    border: 1px solid var(--modern-line) !important;
    background: var(--modern-card) !important;
    box-shadow: var(--modern-shadow-md) !important;
}
.card, .surface-card, .panel, .table-shell, .admin-card, .stat-card, .dashboard-card, .settings-card {
    border: 1px solid var(--modern-line) !important;
    border-radius: var(--modern-radius) !important;
    background: var(--modern-card) !important;
    box-shadow: var(--modern-shadow-sm) !important;
}
.card:hover, .surface-card:hover, .panel:hover, .admin-card:hover, .dashboard-card:hover {
    box-shadow: var(--modern-shadow-md) !important;
}
.card-header, .panel-header, .table-shell__header {
    background: transparent !important;
    border-bottom: 1px solid var(--modern-line) !important;
    padding: 1rem 1.15rem !important;
}
.card-body { padding: 1.15rem !important; }
.btn { border-radius: 14px !important; font-weight: 800 !important; }
.btn-primary {
    background: linear-gradient(135deg, var(--modern-primary), var(--modern-primary-2)) !important;
    border-color: transparent !important;
    box-shadow: 0 12px 24px rgba(103,61,230,.22);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(103,61,230,.28); }
.btn-surface, .btn-outline-secondary, .btn-light {
    border: 1px solid var(--modern-line) !important;
    background: var(--modern-card) !important;
    color: var(--modern-ink) !important;
}
.form-control, .form-select, .select2-container .select2-selection--single, textarea.form-control {
    border-radius: 16px !important;
    border: 1px solid var(--modern-line) !important;
    min-height: 46px;
    box-shadow: none !important;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
    border-color: rgba(103,61,230,.55) !important;
    box-shadow: 0 0 0 .22rem rgba(103,61,230,.12) !important;
}
.table-shell { overflow: hidden; }
.table-responsive { border-radius: 18px; }
table.dataTable, .table {
    border-collapse: separate !important;
    border-spacing: 0 .45rem !important;
}
.table thead th, table.dataTable thead th {
    color: var(--modern-muted) !important;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .08em;
    border: 0 !important;
    padding: .75rem 1rem !important;
}
.table tbody tr, table.dataTable tbody tr {
    background: var(--modern-card) !important;
    box-shadow: inset 0 0 0 1px var(--modern-line);
}
.table tbody td, table.dataTable tbody td {
    border: 0 !important;
    padding: .9rem 1rem !important;
    vertical-align: middle;
}
.table tbody td:first-child { border-radius: 16px 0 0 16px; }
.table tbody td:last-child { border-radius: 0 16px 16px 0; }
.dataTables_wrapper, .dt-container { color: var(--modern-ink); }
.dt-search input, .dt-length select { border-radius: 12px !important; border: 1px solid var(--modern-line) !important; }
.status-pill, .badge {
    border-radius: 999px !important;
    font-weight: 900 !important;
    letter-spacing: -.01em;
}
.admin-command {
    position: sticky;
    top: 92px;
    z-index: 100;
    margin: 0 0 1.25rem;
    border: 1px solid var(--modern-line);
    border-radius: 26px;
    background: color-mix(in srgb, var(--modern-card) 92%, transparent);
    box-shadow: var(--modern-shadow-sm);
    backdrop-filter: blur(18px) saturate(135%);
    padding: 1rem;
}
.admin-command__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
}
.admin-command__title {
    font-size: clamp(1.18rem, 2vw, 1.55rem);
    font-weight: 950;
    letter-spacing: -.045em;
    margin: 0;
}
.admin-command__tools { display: flex; gap: .65rem; align-items: center; min-width: min(560px, 52vw); }
.admin-command__search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 46px;
    padding: 0 .9rem;
    border: 1px solid var(--modern-line);
    border-radius: 999px;
    background: var(--modern-bg);
    color: var(--modern-muted);
}
.admin-command__search {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--modern-ink);
    font-weight: 700;
}
.admin-command__select {
    display: none;
    min-height: 46px;
    border-radius: 16px;
    border: 1px solid var(--modern-line);
    background: var(--modern-card);
    color: var(--modern-ink);
    padding: 0 .85rem;
    font-weight: 800;
}
.admin-command__groups {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .62rem;
}
.admin-command__group {
    border: 1px solid var(--modern-line);
    border-radius: 18px;
    background: var(--modern-bg);
    overflow: hidden;
}
.admin-command__group summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    padding: .75rem .85rem;
    color: var(--modern-ink);
    font-weight: 950;
    font-size: .84rem;
}
.admin-command__group summary::-webkit-details-marker { display: none; }
.admin-command__group summary i { color: var(--modern-muted); transition: transform .18s ease; }
.admin-command__group[open] summary i { transform: rotate(180deg); }
.admin-command__links {
    display: grid;
    gap: .3rem;
    padding: 0 .5rem .55rem;
    max-height: 230px;
    overflow: auto;
}
.admin-command__link {
    display: flex;
    align-items: center;
    gap: .58rem;
    padding: .62rem .65rem;
    border-radius: 13px;
    color: var(--modern-muted);
    font-weight: 850;
    text-decoration: none;
}
.admin-command__link i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--modern-primary-soft);
    color: var(--modern-primary);
    flex: 0 0 28px;
}
.admin-command__link:hover, .admin-command__link.is-active {
    color: var(--modern-primary);
    background: #fff;
    box-shadow: 0 10px 22px rgba(17,24,39,.05);
}
html[data-theme='dark'] .admin-command__link:hover,
html[data-theme='dark'] .admin-command__link.is-active { background: rgba(255,255,255,.08); }
.admin-command__link.is-hidden { display: none; }
.admin-command__empty {
    display: none;
    padding: .85rem;
    color: var(--modern-muted);
    font-weight: 800;
}
.admin-command.is-filter-empty .admin-command__empty { display: block; }
.admin-hub { display: none !important; }
.skeleton-card, .skeleton-line, .skeleton-input, .skeleton-avatar {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #edf0f7 25%, #f7f8fc 37%, #edf0f7 63%);
    background-size: 400% 100%;
    animation: skeleton-flow 1.35s ease infinite;
}
html[data-theme='dark'] .skeleton-card,
html[data-theme='dark'] .skeleton-line,
html[data-theme='dark'] .skeleton-input,
html[data-theme='dark'] .skeleton-avatar {
    background: linear-gradient(90deg, rgba(255,255,255,.08) 25%, rgba(255,255,255,.16) 37%, rgba(255,255,255,.08) 63%);
    background-size: 400% 100%;
}
@keyframes skeleton-flow { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.message-library, .message-card, .chat-card, .conversation-card {
    background: var(--modern-card) !important;
    border: 1px solid var(--modern-line) !important;
    color: var(--modern-ink) !important;
}
.message-library .message-item,
.message-card .message-item,
.chat-bubble,
.ticket-message {
    background: #fff !important;
    color: #1f2937 !important;
    border: 1px solid #e8ebf4 !important;
    box-shadow: 0 10px 24px rgba(17,24,39,.045);
}
html[data-theme='dark'] .message-library .message-item,
html[data-theme='dark'] .message-card .message-item,
html[data-theme='dark'] .chat-bubble,
html[data-theme='dark'] .ticket-message {
    background: rgba(255,255,255,.08) !important;
    color: #f8fafc !important;
    border-color: rgba(255,255,255,.12) !important;
}
.message-library .message-item--out,
.chat-bubble--out,
.ticket-message--staff {
    background: linear-gradient(135deg, #673de6, #7c3aed) !important;
    color: #fff !important;
    border-color: transparent !important;
}
.message-library small, .message-card small, .chat-meta { color: var(--modern-muted) !important; }
.message-library .message-item--out small,
.chat-bubble--out small,
.ticket-message--staff small { color: rgba(255,255,255,.78) !important; }
.empty-state {
    border: 1px dashed rgba(103,61,230,.28) !important;
    border-radius: 24px !important;
    background: linear-gradient(135deg, rgba(103,61,230,.06), rgba(0,176,144,.05)) !important;
    padding: 2rem !important;
    text-align: center;
}
.empty-state i { color: var(--modern-primary); }
@media (min-width: 992px) {
    .admin-command__group:not([open]) .admin-command__links { display: none; }
}
@media (max-width: 1199px) {
    .admin-command__groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-command { top: 86px; }
}
@media (max-width: 991px) {
    .shell-nav { position: sticky; top: 0; }
    .navbar-collapse {
        background: var(--modern-card) !important;
        border: 1px solid var(--modern-line) !important;
        border-radius: 22px !important;
        max-height: calc(100vh - 104px);
        overflow-y: auto;
    }
    .shell-nav__dropdown { width: 100% !important; max-height: none; }
    .admin-command {
        position: static;
        border-radius: 22px;
    }
    .admin-command__header { display: grid; }
    .admin-command__tools { min-width: 0; width: 100%; display: grid; grid-template-columns: 1fr; }
    .admin-command__select { display: block; width: 100%; }
    .admin-command__groups { grid-template-columns: 1fr; max-height: 420px; overflow-y: auto; padding-right: .1rem; }
    .admin-command__group { border-radius: 16px; }
    .admin-command__links { max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
    .page-frame { padding-top: .9rem; }
    .container { padding-left: 1rem; padding-right: 1rem; }
    .card-body { padding: 1rem !important; }
    .admin-command { padding: .85rem; }
    .admin-command__links { grid-template-columns: 1fr; }
    .table-responsive table thead { display: none; }
    .table-responsive table tbody tr { display: block; border-radius: 18px; margin-bottom: .75rem; padding: .4rem; }
    .table-responsive table tbody td { display: flex; justify-content: space-between; gap: 1rem; border-radius: 0 !important; }
    .table-responsive table tbody td::before { content: attr(data-label); font-weight: 900; color: var(--modern-muted); }
}

/* Phase 17: admin-wide modern shell */
html.admin-ui-active,
html.admin-ui-active body {
    min-height: 100%;
    overflow-x: hidden;
}

html.admin-ui-active .shell-footer {
    display: none;
}

html.admin-ui-active .page-frame {
    padding-top: 1.25rem;
}

html.admin-ui-active .page-content.container {
    max-width: none;
    width: 100%;
    padding-left: 326px;
    padding-right: 2rem;
}

.admin-mobile-bar {
    display: none;
}

.admin-sidebar {
    position: fixed;
    z-index: 1035;
    top: 98px;
    bottom: 18px;
    left: max(16px, calc((100vw - 1320px) / 2 + 16px));
    width: 286px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(13,24,40,.96), rgba(8,17,31,.98));
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
    backdrop-filter: blur(18px);
}

html[data-theme='light'] .admin-sidebar {
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,249,252,.98));
    border-color: rgba(36,48,66,.12);
    box-shadow: 0 18px 40px rgba(31,45,61,.12);
}

.admin-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1rem .75rem;
    border-bottom: 1px solid var(--line);
}

.admin-sidebar__brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    font-weight: 900;
}

.admin-sidebar__brand span {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6, #5b21b6);
    color: #fff;
    box-shadow: 0 12px 30px rgba(124,58,237,.34);
}

.admin-sidebar__close {
    display: none;
    border: 0;
    background: var(--surface-muted);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.admin-sidebar__search {
    margin: .9rem 1rem .7rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .78rem .9rem;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255,255,255,.045);
    color: var(--muted);
}

.admin-sidebar__search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    min-width: 0;
}

.admin-sidebar__search input::placeholder {
    color: var(--placeholder);
}

.admin-sidebar__current {
    margin: 0 1rem .8rem;
    padding: .8rem .9rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(34,211,238,.08));
    border: 1px solid rgba(124,58,237,.24);
}

.admin-sidebar__current span {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .68rem;
    font-weight: 900;
}

.admin-sidebar__current strong {
    display: block;
    margin-top: .18rem;
    color: var(--text);
}

.admin-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 .8rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.55) transparent;
}

.admin-sidebar__group {
    margin-bottom: .45rem;
}

.admin-sidebar__group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: .8rem .55rem .55rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: .085em;
    font-size: .72rem;
    font-weight: 900;
}

.admin-sidebar__group-toggle i {
    transition: transform .2s ease;
}

.admin-sidebar__group-toggle[aria-expanded='true'] i {
    transform: rotate(180deg);
}

.admin-sidebar__links {
    display: grid;
    gap: .28rem;
}

.admin-sidebar__link {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: .72rem;
    padding: .62rem .65rem;
    border-radius: 15px;
    color: var(--muted);
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.admin-sidebar__link:hover,
.admin-sidebar__link:focus,
.admin-sidebar__link.is-active {
    color: var(--text);
    background: rgba(124,58,237,.16);
    transform: translateX(2px);
}

.admin-sidebar__link.is-active {
    box-shadow: inset 3px 0 0 #8b5cf6;
}

.admin-sidebar__link > i {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(124,58,237,.14);
    color: #8b5cf6;
}

.admin-sidebar__link span {
    min-width: 0;
}

.admin-sidebar__link strong,
.admin-sidebar__link small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-sidebar__link strong {
    font-size: .92rem;
    font-weight: 850;
}

.admin-sidebar__link small {
    font-size: .72rem;
    color: var(--muted);
    margin-top: .08rem;
}

/* Make every admin page inherit the modern card/table/form rhythm. */
html.admin-ui-active .page-content > :not(.admin-sidebar):not(.admin-mobile-bar):not(.admin-sidebar-backdrop) {
    min-width: 0;
}

html.admin-ui-active .page-content > .hero,
html.admin-ui-active .page-content > .section-hero,
html.admin-ui-active .page-content > .dashboard-hero,
html.admin-ui-active .page-content > .card,
html.admin-ui-active .page-content > .panel,
html.admin-ui-active .page-content > section:not(.admin-command) {
    border-radius: 24px;
}

html.admin-ui-active .card,
html.admin-ui-active .table-card,
html.admin-ui-active .dashboard-card,
html.admin-ui-active .content-card,
html.admin-ui-active .admin-card,
html.admin-ui-active .glass-card,
html.admin-ui-active .section-card {
    border: 1px solid var(--line) !important;
    background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)) !important;
    box-shadow: 0 18px 48px rgba(0,0,0,.18);
    border-radius: 22px !important;
}

html.admin-ui-active .table-responsive,
html.admin-ui-active .dataTables_wrapper,
html.admin-ui-active .dt-container {
    width: 100%;
    overflow-x: auto;
}

html.admin-ui-active table {
    color: var(--text);
}

html.admin-ui-active thead th {
    color: var(--muted) !important;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .75rem;
    border-bottom-color: var(--line) !important;
}

html.admin-ui-active tbody td {
    border-bottom-color: var(--line) !important;
    vertical-align: middle;
}

html.admin-ui-active .form-control,
html.admin-ui-active .form-select,
html.admin-ui-active .select2-container--default .select2-selection--single {
    min-height: 46px;
    border-radius: 14px !important;
    border-color: var(--line-strong) !important;
    background-color: rgba(255,255,255,.045) !important;
    color: var(--text) !important;
}

html.admin-ui-active .btn {
    border-radius: 13px;
    font-weight: 800;
}

/* Retire old oversized command-centre blocks if any cached view still renders them. */
html.admin-ui-active .admin-command {
    display: none !important;
}

/* Top navigation dropdowns: scrollable, contained and never full-screen blocking. */
.shell-nav__dropdown,
.dropdown-menu.shell-nav__dropdown {
    max-height: min(74vh, 680px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.navbar .dropdown-menu {
    max-width: min(92vw, 460px);
}

@media (max-width: 1199.98px) {
    html.admin-ui-active .page-content.container {
        padding-left: 300px;
        padding-right: 1rem;
    }

    .admin-sidebar {
        left: 12px;
        width: 268px;
    }
}

@media (max-width: 991.98px) {
    html.admin-ui-active .page-frame {
        padding-top: .75rem;
    }

    html.admin-ui-active .page-content.container {
        padding-left: var(--bs-gutter-x, .75rem);
        padding-right: var(--bs-gutter-x, .75rem);
    }

    .admin-mobile-bar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: .75rem;
        align-items: center;
        position: sticky;
        top: 82px;
        z-index: 1030;
        padding: .75rem;
        margin-bottom: .25rem;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(8,17,31,.9);
        backdrop-filter: blur(18px);
    }

    html[data-theme='light'] .admin-mobile-bar {
        background: rgba(255,255,255,.92);
    }

    .admin-mobile-jump {
        min-width: 0;
        height: 44px;
        border-radius: 13px;
        border: 1px solid var(--line);
        background: var(--control-bg);
        color: var(--text);
        padding: 0 .75rem;
        font-weight: 800;
    }

    .admin-sidebar {
        top: 0;
        bottom: 0;
        left: 0;
        width: min(88vw, 340px);
        border-radius: 0 26px 26px 0;
        transform: translateX(-105%);
        transition: transform .24s ease;
        z-index: 1091;
    }

    html.admin-sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-sidebar__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1090;
        background: rgba(0,0,0,.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    html.admin-sidebar-open .admin-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 575.98px) {
    .admin-mobile-bar {
        grid-template-columns: 1fr;
        top: 74px;
    }

    .admin-sidebar__link {
        grid-template-columns: 36px minmax(0, 1fr);
    }
}

/* Phase 18: true full-height admin sidebar shell.
   The previous admin control used a floating panel that overlapped content on wide screens.
   This turns it into a fixed left rail and offsets every admin page from the rail. */
body.admin-shell-body {
    --admin-sidebar-width: 284px;
    --admin-topbar-height: 70px;
    background:
        radial-gradient(circle at 12% -10%, rgba(124,58,237,.16), transparent 34%),
        radial-gradient(circle at 100% 10%, rgba(14,165,233,.12), transparent 32%),
        var(--body-bg);
}

body.admin-shell-body .shell-nav {
    position: sticky;
    top: 0;
    z-index: 1028;
    margin-left: var(--admin-sidebar-width);
    border-bottom: 1px solid var(--line);
    background: rgba(7, 15, 28, .82);
    backdrop-filter: blur(18px);
}

html[data-theme='light'] body.admin-shell-body .shell-nav {
    background: rgba(255, 255, 255, .9);
}

body.admin-shell-body .shell-nav .container {
    max-width: none;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

body.admin-shell-body .shell-brand {
    display: none !important;
}

body.admin-shell-body #adminDropdown,
body.admin-shell-body #adminDropdown + .dropdown-menu,
body.admin-shell-body .shell-nav__menu > .nav-item.dropdown:has(#adminDropdown) {
    display: none !important;
}

body.admin-shell-body .shell-nav__menu {
    display: none !important;
}

body.admin-shell-body .shell-nav__inner {
    min-height: var(--admin-topbar-height);
    justify-content: flex-end;
    padding: .7rem 0;
}

body.admin-shell-body .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
    justify-content: flex-end;
}

body.admin-shell-body .shell-nav__actions {
    margin-left: auto !important;
    gap: .75rem;
}

body.admin-shell-body .page-frame {
    margin-left: var(--admin-sidebar-width);
    padding-top: 1.25rem;
}

body.admin-shell-body .page-content.container,
html.admin-ui-active .page-content.container {
    max-width: none;
    width: 100%;
    padding-left: clamp(1rem, 2vw, 2rem) !important;
    padding-right: clamp(1rem, 2vw, 2rem) !important;
}

body.admin-shell-body .workspace-hero,
body.admin-shell-body .section-hero,
body.admin-shell-body .dashboard-hero {
    margin-top: 0;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

body.admin-shell-body .admin-mobile-bar {
    display: none !important;
}

body.admin-shell-body .admin-sidebar {
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: var(--admin-sidebar-width) !important;
    border-radius: 0 !important;
    border-left: 0;
    border-top: 0;
    border-bottom: 0;
    z-index: 1045;
    background: linear-gradient(180deg, rgba(8,17,31,.99), rgba(10,21,37,.98));
    box-shadow: 10px 0 36px rgba(0,0,0,.2);
    transform: none !important;
}

html[data-theme='light'] body.admin-shell-body .admin-sidebar {
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,249,252,.98));
}

body.admin-shell-body .admin-sidebar__header {
    min-height: var(--admin-topbar-height);
    padding: .9rem 1rem;
}

body.admin-shell-body .admin-sidebar__brand span {
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

body.admin-shell-body .admin-sidebar__brand strong {
    font-size: 1.02rem;
}

body.admin-shell-body .admin-sidebar__close,
body.admin-shell-body .admin-sidebar-backdrop,
body.admin-shell-body .admin-sidebar__current {
    display: none !important;
}

body.admin-shell-body .admin-sidebar__search {
    margin: .85rem .9rem .8rem;
    padding: .75rem .85rem;
    border-radius: 14px;
    background: rgba(255,255,255,.06);
}

body.admin-shell-body .admin-sidebar__nav {
    padding: .1rem .75rem .75rem;
}

body.admin-shell-body .admin-sidebar__group {
    margin: 0 0 .55rem;
}

body.admin-shell-body .admin-sidebar__group-toggle {
    padding: .7rem .55rem .45rem;
    font-size: .68rem;
    letter-spacing: .1em;
    color: var(--muted);
}

body.admin-shell-body .admin-sidebar__links {
    gap: .2rem;
}

body.admin-shell-body .admin-sidebar__link {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: .65rem;
    padding: .55rem .55rem;
    border-radius: 12px;
}

body.admin-shell-body .admin-sidebar__link > i {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: .86rem;
}

body.admin-shell-body .admin-sidebar__link strong {
    font-size: .86rem;
}

body.admin-shell-body .admin-sidebar__link small {
    display: none;
}

body.admin-shell-body .admin-sidebar__link:hover,
body.admin-shell-body .admin-sidebar__link:focus,
body.admin-shell-body .admin-sidebar__link.is-active {
    transform: none;
    background: linear-gradient(135deg, rgba(124,58,237,.28), rgba(124,58,237,.12));
}

body.admin-shell-body .admin-sidebar__link.is-active {
    box-shadow: inset 3px 0 0 #8b5cf6, 0 10px 24px rgba(124,58,237,.15);
}

.admin-sidebar__footer {
    padding: .75rem;
    border-top: 1px solid var(--line);
    display: grid;
    gap: .45rem;
}

.admin-sidebar__mini-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 42px;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--muted);
    background: rgba(255,255,255,.035);
    font-weight: 800;
}

.admin-sidebar__mini-link:hover,
.admin-sidebar__mini-link:focus {
    color: var(--text);
    background: rgba(124,58,237,.14);
}

/* Keep forms/tables readable on admin pages after the fixed-rail change. */
body.admin-shell-body .card,
body.admin-shell-body .surface,
body.admin-shell-body .table-shell,
body.admin-shell-body .content-card,
body.admin-shell-body .admin-card,
body.admin-shell-body .glass-card {
    border-radius: 20px;
    border-color: var(--line) !important;
}

body.admin-shell-body textarea.form-control,
body.admin-shell-body textarea {
    min-height: 140px;
    color: var(--text) !important;
    background: var(--control-bg) !important;
}

@media (max-width: 991.98px) {
    body.admin-shell-body {
        --admin-sidebar-width: 0px;
    }

    body.admin-shell-body .shell-nav,
    body.admin-shell-body .page-frame {
        margin-left: 0;
    }

    body.admin-shell-body .shell-brand {
        display: flex !important;
    }

    body.admin-shell-body .shell-nav__inner {
        justify-content: space-between;
    }

    body.admin-shell-body .navbar-toggler {
        display: none;
    }

    body.admin-shell-body .admin-mobile-bar {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr);
        top: 78px;
        position: sticky;
        z-index: 1030;
    }

    body.admin-shell-body .admin-sidebar {
        width: min(88vw, 340px) !important;
        border-radius: 0 24px 24px 0 !important;
        transform: translateX(-105%) !important;
        transition: transform .24s ease;
    }

    html.admin-sidebar-open body.admin-shell-body .admin-sidebar {
        transform: translateX(0) !important;
    }

    body.admin-shell-body .admin-sidebar__close {
        display: inline-flex !important;
    }

    body.admin-shell-body .admin-sidebar-backdrop {
        display: block !important;
    }

    body.admin-shell-body .admin-sidebar__link small {
        display: block;
    }
}

@media (max-width: 575.98px) {
    body.admin-shell-body .shell-user__meta {
        display: none;
    }

    body.admin-shell-body .admin-mobile-bar {
        grid-template-columns: 1fr;
    }
}


/* Phase 19: fixed admin topbar.
   Keeps the top navbar locked while scrolling and offsets admin content so it never sits underneath it. */
body.admin-shell-body {
    --admin-topbar-height: 72px;
}

body.admin-shell-body .shell-nav {
    position: fixed !important;
    top: 0 !important;
    left: var(--admin-sidebar-width) !important;
    right: 0 !important;
    width: auto !important;
    margin-left: 0 !important;
    z-index: 1040 !important;
    min-height: var(--admin-topbar-height);
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
}

body.admin-shell-body .shell-nav__inner {
    min-height: var(--admin-topbar-height);
}

body.admin-shell-body .page-frame {
    margin-left: var(--admin-sidebar-width) !important;
    padding-top: calc(var(--admin-topbar-height) + 1.25rem) !important;
}

body.admin-shell-body .admin-sidebar {
    z-index: 1050 !important;
}

body.admin-shell-body .admin-sidebar__nav {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    scrollbar-width: thin;
}

body.admin-shell-body .admin-sidebar__footer {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(8,17,31,.88), rgba(8,17,31,.99));
}

html[data-theme='light'] body.admin-shell-body .admin-sidebar__footer {
    background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(247,249,252,.99));
}

@media (max-width: 991.98px) {
    body.admin-shell-body .shell-nav {
        left: 0 !important;
    }

    body.admin-shell-body .page-frame {
        margin-left: 0 !important;
        padding-top: calc(var(--admin-topbar-height) + 4.5rem) !important;
    }

    body.admin-shell-body .admin-mobile-bar {
        position: fixed !important;
        left: 0;
        right: 0;
        top: var(--admin-topbar-height) !important;
        z-index: 1039 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: 0;
        border-right: 0;
        backdrop-filter: blur(16px);
    }

    body.admin-shell-body .admin-sidebar {
        z-index: 1055 !important;
    }
}

/* Phase 20 verified onboarding flow */
.onboarding-shell--three-step,
.onboarding-shell--wide {
    align-items: stretch;
    gap: clamp(1.25rem, 2vw, 2rem);
}
.onboarding-shell--wide {
    grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
}
.onboarding-card--wide-form {
    max-height: none;
}
.otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, minmax(42px, 1fr));
    gap: .75rem;
}
.otp-box {
    width: 100%;
    height: 58px;
    border-radius: 16px;
    border: 1px solid var(--border, rgba(148,163,184,.25));
    background: var(--surface, rgba(255,255,255,.04));
    color: var(--text, #fff);
    text-align: center;
    font-weight: 800;
    font-size: 1.35rem;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.otp-box:focus {
    border-color: var(--primary, #7c3aed);
    box-shadow: 0 0 0 .24rem rgba(124, 58, 237, .18);
    transform: translateY(-1px);
}
.form-section-title {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, rgba(148,163,184,.2));
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted, #94a3b8);
}
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
@media (max-width: 900px) {
    .onboarding-shell--wide,
    .onboarding-shell--three-step {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 560px) {
    .otp-boxes { gap: .45rem; }
    .otp-box { height: 48px; border-radius: 12px; font-size: 1.1rem; }
    .form-grid-2 { grid-template-columns: 1fr; }
}


/* Phase 21: stability, profile layout, responsive account menu, RBAC account builder */
.profile-dropdown { min-width: min(92vw, 320px) !important; max-width: 92vw; padding: .65rem !important; border-radius: 18px !important; }
.profile-dropdown__header { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: .75rem; align-items: center; padding: .8rem .85rem 1rem; margin-bottom: .35rem; border-bottom: 1px solid var(--border, rgba(148,163,184,.18)); }
.profile-dropdown__header strong, .profile-dropdown__header small { display: block; min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.profile-dropdown__header small { color: var(--muted, #94a3b8); margin-top: .15rem; }
.profile-dropdown__avatar { width: 46px; height: 46px; }
.profile-dropdown .dropdown-item { border-radius: 12px; white-space: normal; line-height: 1.25; padding: .72rem .85rem; }
.profile-grid { display: grid !important; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) !important; gap: clamp(1rem, 2vw, 1.5rem) !important; align-items: start; width: 100%; }
.profile-grid > .aside-stack { width: 100%; max-width: none; }
.profile-form .form-stack, .profile-grid .form-stack { max-width: 860px; }
.admin-account-builder .surface { min-width: 0; }
.form-grid-span { grid-column: 1 / -1; }
@media (max-width: 991.98px) { .profile-grid { grid-template-columns: 1fr !important; } .profile-sidebar { position: static !important; } }
@media (max-width: 575.98px) { .profile-dropdown { min-width: calc(100vw - 1.5rem) !important; } .shell-user__meta { max-width: 120px; } .shell-user__meta strong, .shell-user__meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }


/* Phase 22: readable onboarding/auth cards and affected light modules */
.auth-readable-card,
.onboarding-card--form,
.surface.auth-panel,
.setup-card,
.install-card,
.public-auth-card {
    color: #101828 !important;
    background: rgba(255,255,255,.98) !important;
}
.auth-readable-card h1,
.auth-readable-card h2,
.auth-readable-card h3,
.onboarding-card--form h1,
.onboarding-card--form h2,
.onboarding-card--form h3,
.surface.auth-panel h1,
.surface.auth-panel h2,
.surface.auth-panel h3 {
    color: #101828 !important;
}
.auth-readable-card p,
.auth-readable-card li,
.auth-readable-card label,
.onboarding-card--form p,
.onboarding-card--form li,
.onboarding-card--form label,
.surface.auth-panel p,
.surface.auth-panel li,
.surface.auth-panel label {
    color: #344054 !important;
}
.auth-readable-card .text-muted,
.onboarding-card--form .text-muted,
.surface.auth-panel .text-muted,
.auth-help {
    color: #667085 !important;
}
.auth-readable-card .form-label,
.onboarding-card--form .form-label,
.surface.auth-panel .form-label {
    font-weight: 800;
    color: #1d2939 !important;
}
.auth-readable-card .form-control,
.auth-readable-card .form-select,
.onboarding-card--form .form-control,
.onboarding-card--form .form-select,
.surface.auth-panel .form-control,
.surface.auth-panel .form-select {
    background: #ffffff !important;
    color: #101828 !important;
    border: 1px solid #d0d5dd !important;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.auth-readable-card .form-control::placeholder,
.onboarding-card--form .form-control::placeholder,
.surface.auth-panel .form-control::placeholder {
    color: #98a2b3 !important;
}
.auth-readable-card a,
.onboarding-card--form a,
.surface.auth-panel a {
    color: #673de6 !important;
    font-weight: 800;
}
.auth-step-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid rgba(103,61,230,.18);
    background: rgba(103,61,230,.08);
    color: #5025d1;
    border-radius: 999px;
    padding: .42rem .75rem;
    font-weight: 850;
    font-size: .78rem;
    margin-bottom: .85rem;
}
.auth-readable-card .otp-box,
.onboarding-card--form .otp-box {
    background: #ffffff !important;
    color: #101828 !important;
    border-color: #d0d5dd !important;
}
.auth-readable-card .form-section-title,
.onboarding-card--form .form-section-title {
    color: #475467 !important;
    border-color: #eaecf0 !important;
}
.alert-danger,
.alert-success,
.alert-warning,
.alert-info {
    color: #101828 !important;
}
/* Give profile content a fuller, balanced page width */
.profile-grid {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) !important;
    width: 100% !important;
}
.profile-grid .aside-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.profile-grid .profile-form {
    grid-column: 1 / -1;
}
.profile-grid .profile-form .form-stack {
    max-width: none !important;
}
@media (max-width: 1100px) {
    .profile-grid .aside-stack { grid-template-columns: 1fr; }
}
@media (max-width: 991.98px) {
    .profile-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 575.98px) {
    .onboarding-card--form,
    .surface.auth-panel { padding: 1.15rem !important; }
    .auth-readable-card .btn-lg { min-height: 48px; }
}


/* Phase 31: final contrast, searchable selects, navbar containment and invoice polish */
:root { --ca-select-bg:#ffffff; --ca-select-text:#101828; --ca-select-border:#cbd5e1; }
select,
.form-select,
select.form-select,
.form-control,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
html.admin-ui-active select,
html.admin-ui-active .form-select,
html.admin-ui-active .select2-container--default .select2-selection--single,
html.admin-ui-active .select2-container--default .select2-selection--multiple {
    background-color: var(--ca-select-bg) !important;
    color: var(--ca-select-text) !important;
    border-color: var(--ca-select-border) !important;
}
.form-select option,
select option,
select optgroup {
    background: #ffffff !important;
    color: #101828 !important;
}
.form-select:disabled,
select:disabled,
.select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #f2f4f7 !important;
    color: #667085 !important;
    opacity: 1 !important;
}
.select2-container { max-width: 100% !important; width: 100% !important; }
.select2-container--default .select2-selection--single { height: 46px !important; display:flex !important; align-items:center !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered,
.select2-container--default .select2-selection__placeholder {
    color: #101828 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    padding-left: .9rem !important;
    padding-right: 2.1rem !important;
}
.select2-dropdown,
.select2-container--default .select2-results__option,
.select2-container--default .select2-search--dropdown .select2-search__field {
    background: #ffffff !important;
    color: #101828 !important;
    border-color: var(--ca-select-border) !important;
}
.select2-container--default .select2-results__option--selected {
    background: #ede9fe !important;
    color: #3b0764 !important;
    font-weight: 800 !important;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: #673de6 !important;
    color: #ffffff !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    min-height: 42px !important;
    border-radius: 12px !important;
    outline: 0 !important;
}
.shell-nav__inner,
.navbar,
.navbar-collapse,
.navbar-nav { min-width: 0; }
.shell-nav__inner .navbar { flex-wrap: nowrap; }
.shell-brand,
.navbar-brand { min-width:0; max-width: min(58vw, 280px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.shell-nav__menu .nav-link,
.shell-nav__actions .nav-link { white-space: nowrap; }
.shell-nav__actions { flex-shrink: 0; }
.dropdown-menu.shell-nav__dropdown { max-width: min(92vw, 440px); }
.menu-item__body { min-width:0; }
.menu-item__body strong,
.menu-item__body small { overflow-wrap:anywhere; white-space:normal; }
@media (max-width: 991.98px) {
    .shell-nav { padding-top:.55rem; }
    .shell-nav__inner { border-radius: 1.1rem; padding:.65rem .75rem; }
    .navbar-collapse { margin-top:.75rem; max-height: calc(100vh - 6rem); overflow-y:auto; overflow-x:hidden; }
    .navbar-nav.shell-nav__menu,
    .navbar-nav.shell-nav__actions { align-items:stretch !important; gap:.45rem; }
    .navbar-nav .nav-item,
    .navbar-nav .nav-link,
    .navbar-nav .dropdown { width:100%; }
    .navbar-nav .nav-link,
    .theme-toggle { min-height:44px; justify-content:flex-start; }
    .dropdown-menu.shell-nav__dropdown { position:static !important; transform:none !important; width:100%; max-width:100%; box-shadow:none; margin:.35rem 0 .65rem; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    .shell-nav__menu { gap: .1rem; }
    .shell-nav__menu .nav-link { padding-left:.55rem !important; padding-right:.55rem !important; font-size:.92rem; }
}
.receipt-sheet {
    background: linear-gradient(180deg,#ffffff 0%,#f8fafc 100%) !important;
    border: 1px solid #e5e7eb !important;
}
.receipt-sheet::before { content:''; display:block; height:8px; border-radius:999px; background:linear-gradient(90deg,#673de6,#06b6d4,#22c55e); margin-bottom:1rem; }
.receipt-head { background:#111827; color:#ffffff; border-radius:18px; padding:1.25rem !important; border-bottom:0 !important; }
.receipt-head small,
.receipt-head .text-muted { color:#cbd5e1 !important; }
.receipt-total { color:#111827; }
.receipt-sheet table thead th { background:#eef2ff; color:#312e81 !important; }
.receipt-sheet table tbody tr:nth-child(even) td { background:#f8fafc; }
