/* NSMS shared dashboard theme
   The components below are deliberately class-based so pages can stay mostly semantic. */

:root {
    color-scheme: light;
    --navy-950: #0a1322;
    --navy-900: #0f1d31;
    --navy-850: #14253d;
    --navy-800: #1a2d47;
    --slate-700: #46566a;
    --slate-600: #607084;
    --slate-500: #8491a1;
    --slate-300: #d4dde2;
    --slate-200: #e5ebed;
    --slate-100: #f1f5f5;
    --canvas: #eef4f3;
    --surface: #ffffff;
    --surface-muted: #f7faf9;
    --mint-700: #0f7566;
    --mint-600: #148c79;
    --mint-500: #20ae91;
    --mint-300: #a7e5d4;
    --mint-100: #e4f8f1;
    --coral-700: #b8484d;
    --coral-600: #d65d60;
    --coral-500: #ef7774;
    --coral-100: #fff0ee;
    --amber-600: #bd7815;
    --amber-100: #fff6dd;
    --blue-600: #3e6fbd;
    --blue-100: #edf4ff;
    --shadow-xs: 0 1px 2px rgb(15 29 49 / 0.05);
    --shadow-sm: 0 5px 18px rgb(15 29 49 / 0.07);
    --shadow-md: 0 16px 34px rgb(15 29 49 / 0.12);
    --radius-sm: 0.65rem;
    --radius: 1rem;
    --radius-lg: 1.35rem;
    --sidebar-width: 17.25rem;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas);
    scroll-behavior: smooth;
}

body {
    min-width: 20rem;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 96% -10%, rgb(32 174 145 / 0.11), transparent 27rem),
        var(--canvas);
    color: var(--navy-900);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
[role="button"] {
    cursor: pointer;
}

a {
    color: var(--mint-700);
    text-decoration: none;
}

a:hover {
    color: var(--mint-600);
}

img,
svg {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid rgb(32 174 145 / 0.36);
    outline-offset: 3px;
}

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

/* Application frame */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
        "sidebar topbar"
        "sidebar content";
    min-height: 100dvh;
}

.app-shell > .sidebar {
    grid-area: sidebar;
}

.app-shell > .topbar {
    grid-area: topbar;
}

.app-shell > .content {
    grid-area: content;
}

.app-shell > :is(.main, .main-shell, .main-content, .workspace) {
    grid-column: 2;
    grid-row: 1 / -1;
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100dvh;
    padding: 1.35rem 1rem 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    color: #dce7f0;
    background:
        radial-gradient(circle at 10% 0%, rgb(32 174 145 / 0.18), transparent 16rem),
        linear-gradient(165deg, var(--navy-850), var(--navy-950));
    border-right: 1px solid rgb(255 255 255 / 0.07);
    box-shadow: 4px 0 25px rgb(8 19 34 / 0.08);
    z-index: 50;
}

.sidebar-brand,
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0.25rem 0.5rem 1.5rem;
    color: #fff;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.brand-mark {
    display: grid;
    flex: 0 0 2.4rem;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    overflow: hidden;
    color: var(--navy-900);
    background: linear-gradient(135deg, #b9f2e0, var(--mint-500));
    border-radius: 0.75rem;
    box-shadow: 0 7px 18px rgb(8 19 34 / 0.25);
}

.brand-copy {
    display: grid;
    line-height: 1.15;
}

.brand-copy small {
    margin-top: 0.2rem;
    color: #93a6b9;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-section-label,
.nav-label {
    display: block;
    padding: 0.8rem 0.65rem 0.45rem;
    color: #8295a9;
    font-size: 0.67rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar nav,
.sidebar .nav-list,
.nav-list {
    display: grid;
    gap: 0.25rem;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    min-height: 2.8rem;
    padding: 0.66rem 0.75rem;
    color: inherit;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: 0.72rem;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

button.nav-item {
    width: 100%;
    text-align: left;
    background: transparent;
}

.sidebar .nav-item {
    color: #b9c8d5;
}

.sidebar .nav-item:hover {
    color: #fff;
    background: rgb(255 255 255 / 0.075);
    border-color: rgb(255 255 255 / 0.05);
}

.sidebar .nav-item.is-active,
.sidebar .nav-item.active,
.sidebar .nav-item[aria-current="page"] {
    color: #eafff8;
    background: linear-gradient(100deg, rgb(32 174 145 / 0.29), rgb(32 174 145 / 0.09));
    border-color: rgb(144 239 213 / 0.15);
    box-shadow: inset 3px 0 0 var(--mint-500);
}

.nav-item .nav-icon,
.nav-item > svg:first-child {
    flex: 0 0 1.15rem;
    width: 1.15rem;
    height: 1.15rem;
    opacity: 0.9;
}

.nav-item .nav-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item .nav-count {
    display: inline-grid;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    margin-left: auto;
    place-items: center;
    color: #dcfff5;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    background: rgb(32 174 145 / 0.25);
    border-radius: 999px;
}

.sidebar-footer {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 0.25rem 0.1rem;
    margin-top: auto;
    border-top: 1px solid rgb(255 255 255 / 0.09);
}

.sidebar-footer .nav-item {
    color: #b9c8d5;
}

.topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    min-height: 5.25rem;
    padding: 0.9rem clamp(1.25rem, 3vw, 2.5rem);
    background: rgb(255 255 255 / 0.83);
    border-bottom: 1px solid rgb(15 29 49 / 0.075);
    box-shadow: 0 3px 16px rgb(15 29 49 / 0.025);
    backdrop-filter: blur(14px);
    z-index: 30;
}

.topbar-left,
.topbar-right,
.topbar-actions,
.inline-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.topbar-left {
    flex: 1 1 auto;
}

.topbar-title,
.page-title {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 760;
    letter-spacing: -0.03em;
}

.topbar-subtitle,
.page-subtitle {
    margin: 0.15rem 0 0;
    color: var(--slate-600);
    font-size: 0.82rem;
}

.menu-toggle,
[data-menu-toggle] {
    display: none;
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    place-items: center;
    color: var(--navy-850);
    background: var(--surface);
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xs);
}

.search-field,
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: min(23rem, 34vw);
}

.search-field > svg,
.search-box > svg {
    position: absolute;
    left: 0.85rem;
    width: 1rem;
    height: 1rem;
    color: var(--slate-500);
    pointer-events: none;
}

.search-field input,
.search-box input {
    width: 100%;
    min-height: 2.65rem;
    padding: 0.6rem 0.85rem 0.6rem 2.5rem;
    color: var(--navy-900);
    background: var(--surface-muted);
    border: 1px solid transparent;
    border-radius: 0.75rem;
    outline: 0;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.search-field input::placeholder,
.search-box input::placeholder {
    color: var(--slate-500);
}

.search-field input:focus,
.search-box input:focus {
    background: var(--surface);
    border-color: rgb(32 174 145 / 0.5);
    box-shadow: 0 0 0 4px rgb(32 174 145 / 0.1);
}

.icon-button,
.notification-button {
    position: relative;
    display: inline-grid;
    flex: 0 0 auto;
    width: 2.55rem;
    height: 2.55rem;
    padding: 0;
    place-items: center;
    color: var(--slate-700);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.75rem;
}

.icon-button:hover,
.notification-button:hover {
    color: var(--mint-700);
    background: var(--mint-100);
}

.notification-dot {
    position: absolute;
    top: 0.43rem;
    right: 0.42rem;
    width: 0.48rem;
    height: 0.48rem;
    background: var(--coral-500);
    border: 2px solid var(--surface);
    border-radius: 50%;
}

.user-menu {
    position: relative;
    flex: 0 0 auto;
}

.user-menu > summary,
.user-menu > details > summary,
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem;
    color: var(--navy-850);
    list-style: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.85rem;
    cursor: pointer;
}

.user-menu > summary::-webkit-details-marker,
.user-menu > details > summary::-webkit-details-marker {
    display: none;
}

.user-menu > summary:hover,
.user-menu > details > summary:hover,
.user-menu-trigger:hover {
    background: var(--surface-muted);
    border-color: var(--slate-200);
}

.avatar {
    display: inline-grid;
    flex: 0 0 auto;
    width: 2.15rem;
    height: 2.15rem;
    place-items: center;
    overflow: hidden;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 750;
    background: linear-gradient(145deg, var(--navy-800), var(--mint-600));
    border-radius: 50%;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar.avatar-sm {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.67rem;
}

.avatar.avatar-lg {
    width: 3.1rem;
    height: 3.1rem;
    font-size: 1rem;
}

.user-menu-name {
    display: grid;
    line-height: 1.2;
}

.user-menu-name strong {
    max-width: 10rem;
    overflow: hidden;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-name small {
    margin-top: 0.15rem;
    color: var(--slate-600);
    font-size: 0.68rem;
}

.user-menu-panel,
.user-menu [role="menu"] {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    display: grid;
    width: min(18rem, calc(100vw - 2rem));
    padding: 0.45rem;
    background: var(--surface);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 70;
}

.user-menu:not(.is-open) .user-menu-panel,
.user-menu > details:not([open]) .user-menu-panel,
.user-menu > details:not([open]) [role="menu"] {
    display: none;
}

.user-menu-panel a,
.user-menu-panel button,
.user-menu [role="menu"] a,
.user-menu [role="menu"] button {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 2.4rem;
    padding: 0.55rem 0.65rem;
    color: var(--navy-850);
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 0.62rem;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover,
.user-menu [role="menu"] a:hover,
.user-menu [role="menu"] button:hover {
    color: var(--mint-700);
    background: var(--mint-100);
}

.content {
    min-width: 0;
    padding: clamp(1.25rem, 3vw, 2.45rem);
}

.main-content .content,
.main-shell .content,
.workspace .content {
    min-height: 100%;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.page-heading {
    min-width: 0;
}

.page-heading h1,
.page-heading h2 {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    font-weight: 780;
    letter-spacing: -0.045em;
    line-height: 1.18;
}

.page-heading p {
    margin: 0.45rem 0 0;
    color: var(--slate-600);
}

.page-actions,
.panel-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

/* Buttons, chips, and status */
.button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.55rem;
    padding: 0.58rem 0.95rem;
    color: var(--navy-800);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    background: var(--surface);
    border: 1px solid var(--slate-300);
    border-radius: 0.72rem;
    box-shadow: var(--shadow-xs);
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.btn:hover {
    color: var(--navy-900);
    border-color: #b7c6ca;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.button:active,
.btn:active {
    transform: translateY(0);
}

.button > svg,
.btn > svg {
    width: 1rem;
    height: 1rem;
}

.button.primary,
.button.is-primary,
.button--primary,
.btn.primary,
.btn--primary,
.button[data-variant="primary"] {
    color: #f4fffb;
    background: linear-gradient(135deg, var(--mint-700), var(--mint-500));
    border-color: var(--mint-700);
    box-shadow: 0 7px 16px rgb(15 117 102 / 0.2);
}

.button.primary:hover,
.button.is-primary:hover,
.button--primary:hover,
.btn.primary:hover,
.btn--primary:hover,
.button[data-variant="primary"]:hover {
    color: #fff;
    background: linear-gradient(135deg, #0c6a5d, #19a98c);
    border-color: #0c6a5d;
}

.button.coral,
.button.danger,
.button--danger,
.btn.danger,
.btn--danger,
.button[data-variant="danger"] {
    color: #fff;
    background: linear-gradient(135deg, var(--coral-700), var(--coral-500));
    border-color: var(--coral-700);
}

.button.ghost,
.button--ghost,
.btn.ghost,
.btn--ghost {
    color: var(--mint-700);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.button.ghost:hover,
.button--ghost:hover,
.btn.ghost:hover,
.btn--ghost:hover {
    color: var(--mint-700);
    background: var(--mint-100);
    border-color: transparent;
}

.button.small,
.button--small,
.btn.small,
.btn--small {
    min-height: 2.1rem;
    padding: 0.43rem 0.7rem;
    font-size: 0.76rem;
    border-radius: 0.6rem;
}

.button:disabled,
.btn:disabled,
.button.is-loading,
.btn.is-loading,
[aria-busy="true"] {
    cursor: wait;
    opacity: 0.67;
}

.button.is-loading,
.btn.is-loading {
    position: relative;
    pointer-events: none;
}

.button.is-loading::after,
.btn.is-loading::after {
    width: 0.9rem;
    height: 0.9rem;
    content: "";
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 650ms linear infinite;
}

.badge,
.role-chip,
.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    min-height: 1.65rem;
    padding: 0.22rem 0.55rem;
    color: var(--slate-700);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.01em;
    line-height: 1.1;
    white-space: nowrap;
    background: var(--slate-100);
    border: 1px solid rgb(70 86 106 / 0.08);
    border-radius: 999px;
}

.badge.success,
.badge.active,
.badge--success,
.badge[data-status="active"],
.badge[data-status="paid"],
.badge[data-status="present"] {
    color: var(--mint-700);
    background: var(--mint-100);
    border-color: rgb(32 174 145 / 0.17);
}

.badge.warning,
.badge.pending,
.badge--warning,
.badge[data-status="pending"],
.badge[data-status="late"] {
    color: var(--amber-600);
    background: var(--amber-100);
    border-color: rgb(189 120 21 / 0.15);
}

.badge.danger,
.badge.inactive,
.badge.overdue,
.badge--danger,
.badge[data-status="inactive"],
.badge[data-status="overdue"],
.badge[data-status="absent"] {
    color: var(--coral-700);
    background: var(--coral-100);
    border-color: rgb(214 93 96 / 0.16);
}

.badge.info,
.badge--info,
.badge[data-status="info"] {
    color: var(--blue-600);
    background: var(--blue-100);
    border-color: rgb(62 111 189 / 0.14);
}

.role-chip {
    color: #315a80;
    background: #eaf4fd;
    border-color: #d7e9f7;
}

.role-chip.admin,
.role-chip[data-role="admin"] {
    color: #644698;
    background: #f3ecff;
    border-color: #e9dcff;
}

.role-chip.teacher,
.role-chip[data-role="teacher"] {
    color: var(--mint-700);
    background: var(--mint-100);
    border-color: #d2f2e7;
}

.role-chip.bursar,
.role-chip[data-role="bursar"] {
    color: #9a6013;
    background: #fff4db;
    border-color: #f9e7b7;
}

.role-chip.nurse,
.role-chip[data-role="nurse"] {
    color: var(--coral-700);
    background: var(--coral-100);
    border-color: #ffdeda;
}

/* Dashboard cards */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.metric-card {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 9.3rem;
    padding: 1.1rem;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgb(15 29 49 / 0.075);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    isolation: isolate;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.metric-card::after {
    position: absolute;
    right: -2.5rem;
    bottom: -3.2rem;
    width: 8rem;
    height: 8rem;
    content: "";
    background: radial-gradient(circle, rgb(32 174 145 / 0.13), transparent 68%);
    border-radius: 50%;
    z-index: -1;
}

.metric-card:hover {
    border-color: rgb(32 174 145 / 0.23);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-card.coral::after,
.metric-card.metric-card--coral::after {
    background: radial-gradient(circle, rgb(239 119 116 / 0.17), transparent 68%);
}

.metric-card.amber::after,
.metric-card.metric-card--amber::after {
    background: radial-gradient(circle, rgb(236 175 44 / 0.17), transparent 68%);
}

.metric-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
}

.metric-label {
    color: var(--slate-600);
    font-size: 0.78rem;
    font-weight: 650;
}

.metric-icon {
    display: inline-grid;
    flex: 0 0 2.45rem;
    width: 2.45rem;
    height: 2.45rem;
    place-items: center;
    color: var(--mint-700);
    background: var(--mint-100);
    border-radius: 0.75rem;
}

.metric-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.metric-card.coral .metric-icon,
.metric-card.metric-card--coral .metric-icon {
    color: var(--coral-700);
    background: var(--coral-100);
}

.metric-card.amber .metric-icon,
.metric-card.metric-card--amber .metric-icon {
    color: var(--amber-600);
    background: var(--amber-100);
}

.metric-value {
    align-self: end;
    margin-top: 0.5rem;
    color: var(--navy-900);
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 780;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.05em;
    line-height: 1;
}

.metric-footer,
.metric-change {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.65rem;
    color: var(--slate-600);
    font-size: 0.73rem;
}

.metric-change.positive,
.metric-change.up {
    color: var(--mint-700);
}

.metric-change.negative,
.metric-change.down {
    color: var(--coral-700);
}

.dashboard-grid,
.panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 1fr);
    gap: 1rem;
}

.panel {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgb(15 29 49 / 0.075);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel + .panel {
    margin-top: 1rem;
}

.dashboard-grid > .panel + .panel,
.panel-grid > .panel + .panel {
    margin-top: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.35rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--slate-200);
}

.panel-title {
    margin: 0;
    color: var(--navy-900);
    font-size: 0.97rem;
    font-weight: 760;
    letter-spacing: -0.02em;
}

.panel-subtitle {
    margin: 0.2rem 0 0;
    color: var(--slate-600);
    font-size: 0.76rem;
}

.panel-body {
    padding: 1.25rem;
}

.panel-body.flush,
.panel-body--flush {
    padding: 0;
}

.panel-footer {
    padding: 0.9rem 1.25rem;
    background: var(--surface-muted);
    border-top: 1px solid var(--slate-200);
}

.stat-list,
.activity-list {
    display: grid;
    padding: 0;
    margin: 0;
    list-style: none;
}

.stat-list > li,
.activity-list > li,
.list-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.88rem 0;
    border-bottom: 1px solid var(--slate-200);
}

.stat-list > li:last-child,
.activity-list > li:last-child,
.list-row:last-child {
    border-bottom: 0;
}

.list-row-main {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
}

.list-row-main strong {
    overflow: hidden;
    color: var(--navy-850);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-row-main small,
.list-row-meta {
    margin-top: 0.15rem;
    color: var(--slate-600);
    font-size: 0.72rem;
}

/* Tables */
.table-wrap,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table,
.table {
    width: 100%;
    border-collapse: collapse;
}

table caption {
    padding: 0.75rem 1.25rem;
    color: var(--slate-600);
    text-align: left;
}

table th,
.table th {
    padding: 0.8rem 1.25rem;
    color: var(--slate-600);
    font-size: 0.68rem;
    font-weight: 780;
    letter-spacing: 0.075em;
    line-height: 1.25;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--slate-200);
}

table td,
.table td {
    padding: 0.9rem 1.25rem;
    color: var(--slate-700);
    font-size: 0.82rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--slate-200);
}

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

table tbody tr,
.table tbody tr {
    transition: background-color 140ms ease;
}

table tbody tr:hover,
.table tbody tr:hover {
    background: #f4fbf8;
}

table .primary-cell,
.table .primary-cell {
    color: var(--navy-850);
    font-weight: 700;
}

table .person-cell,
.table .person-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 10rem;
}

table .person-cell > span,
.table .person-cell > span {
    display: grid;
    min-width: 0;
}

table .person-cell strong,
.table .person-cell strong {
    overflow: hidden;
    color: var(--navy-850);
    text-overflow: ellipsis;
    white-space: nowrap;
}

table .person-cell small,
.table .person-cell small {
    margin-top: 0.08rem;
    color: var(--slate-600);
    font-size: 0.71rem;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
}

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

.form-grid .span-2,
.form-grid .full-width {
    grid-column: 1 / -1;
}

.field,
.form-field {
    display: grid;
    gap: 0.42rem;
}

.field > label,
.form-field > label,
.field-label {
    color: var(--navy-800);
    font-size: 0.78rem;
    font-weight: 700;
}

.field :is(input, select, textarea),
.form-field :is(input, select, textarea) {
    width: 100%;
    min-height: 2.65rem;
    padding: 0.58rem 0.75rem;
    color: var(--navy-900);
    background: var(--surface);
    border: 1px solid var(--slate-300);
    border-radius: 0.68rem;
    outline: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea,
.form-field textarea {
    min-height: 6rem;
    resize: vertical;
}

.field :is(input, select, textarea):focus,
.form-field :is(input, select, textarea):focus {
    border-color: var(--mint-500);
    box-shadow: 0 0 0 4px rgb(32 174 145 / 0.11);
}

.field :is(input, select, textarea)[aria-invalid="true"],
.form-field :is(input, select, textarea)[aria-invalid="true"] {
    border-color: var(--coral-500);
    box-shadow: 0 0 0 4px rgb(239 119 116 / 0.1);
}

.field-help,
.field-error {
    color: var(--slate-600);
    font-size: 0.71rem;
}

.field-error {
    color: var(--coral-700);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
    padding: 0.9rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.filter-bar .field,
.filter-bar .form-field {
    flex: 1 1 10rem;
}

/* Tabs, empty states, and loading */
.tabs,
.tab-list,
[role="tablist"] {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
    padding: 0.3rem;
    overflow-x: auto;
    background: var(--slate-100);
    border-radius: 0.75rem;
    scrollbar-width: thin;
}

[data-tab] {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.45rem 0.75rem;
    color: var(--slate-600);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.55rem;
}

button[data-tab] {
    cursor: pointer;
}

[data-tab]:hover {
    color: var(--navy-850);
}

[data-tab].is-active,
[data-tab].active,
[data-tab][aria-selected="true"] {
    color: var(--mint-700);
    background: var(--surface);
    border-color: rgb(15 117 102 / 0.1);
    box-shadow: var(--shadow-xs);
}

[data-tab-panel] {
    min-width: 0;
}

.empty-state {
    display: grid;
    min-height: 15rem;
    padding: 2rem;
    place-items: center;
    text-align: center;
}

.empty-state > div {
    max-width: 25rem;
}

.empty-state-icon {
    display: grid;
    width: 3.75rem;
    height: 3.75rem;
    margin: 0 auto 0.9rem;
    place-items: center;
    color: var(--mint-700);
    background: var(--mint-100);
    border-radius: 1.1rem;
}

.empty-state h2,
.empty-state h3 {
    margin: 0;
    color: var(--navy-850);
    font-size: 1rem;
}

.empty-state p {
    margin: 0.45rem 0 1rem;
    color: var(--slate-600);
    font-size: 0.82rem;
}

.skeleton,
.loading-line {
    position: relative;
    overflow: hidden;
    background: #e8eeef;
    border-radius: 0.5rem;
}

.skeleton::after,
.loading-line::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / 0.65) 50%, transparent 80%);
    animation: shimmer 1.35s infinite;
    transform: translateX(-100%);
}

.is-loading:not(.button):not(.btn) {
    position: relative;
}

.is-loading:not(.button):not(.btn)::before {
    position: absolute;
    inset: 0;
    content: "";
    background: rgb(255 255 255 / 0.42);
    border-radius: inherit;
    cursor: wait;
    z-index: 2;
}

.is-loading:not(.button):not(.btn)::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.35rem;
    height: 1.35rem;
    content: "";
    border: 3px solid var(--mint-300);
    border-top-color: var(--mint-700);
    border-radius: 50%;
    animation: spin 650ms linear infinite;
    transform: translate(-50%, -50%);
    z-index: 3;
}

/* Toasts are created by app.js when the page does not provide a toast region. */
.toast-region,
[data-toast-region] {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    display: grid;
    gap: 0.65rem;
    width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
    z-index: 200;
}

.toast {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    min-height: 4rem;
    padding: 0.8rem;
    color: #ecf5f8;
    pointer-events: auto;
    background: linear-gradient(135deg, var(--navy-850), var(--navy-900));
    border: 1px solid rgb(255 255 255 / 0.1);
    border-radius: 0.9rem;
    box-shadow: 0 14px 34px rgb(8 19 34 / 0.28);
    opacity: 0;
    transform: translateY(0.75rem) scale(0.98);
    transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    color: #d9fff4;
    font-size: 0.9rem;
    font-weight: 800;
    background: rgb(32 174 145 / 0.25);
    border-radius: 50%;
}

.toast--error .toast-icon,
.toast--danger .toast-icon {
    color: #ffe8e6;
    background: rgb(239 119 116 / 0.28);
}

.toast--warning .toast-icon {
    color: #fff4d6;
    background: rgb(236 175 44 / 0.25);
}

.toast-message {
    min-width: 0;
    font-size: 0.8rem;
    font-weight: 650;
}

.toast-dismiss {
    display: inline-grid;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    place-items: center;
    color: #c4d0da;
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
}

.toast-dismiss:hover {
    color: #fff;
    background: rgb(255 255 255 / 0.1);
}

.menu-scrim,
[data-menu-scrim] {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    pointer-events: none;
    visibility: hidden;
    background: rgb(4 13 25 / 0.46);
    border: 0;
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
    z-index: 45;
}

.menu-scrim.is-visible,
[data-menu-scrim].is-visible {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.bottom-nav {
    display: none;
}

.mobile-shell {
    width: 100%;
    max-width: 34rem;
    min-height: 100dvh;
    margin-inline: auto;
}

.mobile-only {
    display: none !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}

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

    .dashboard-grid,
    .panel-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar becomes an off-canvas menu. */
@media (max-width: 960px) {
    body.menu-open {
        overflow: hidden;
    }

    .app-shell {
        display: block;
    }

    .app-shell > :is(.main, .main-shell, .main-content, .workspace) {
        min-height: 100dvh;
    }

    .sidebar,
    .app-shell > .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(var(--sidebar-width), 84vw);
        height: 100dvh;
        transform: translateX(-103%);
        transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
        will-change: transform;
    }

    .sidebar.is-open,
    .sidebar.open {
        box-shadow: 14px 0 34px rgb(4 13 25 / 0.3);
        transform: translateX(0);
    }

    .topbar {
        min-height: 4.7rem;
        padding: 0.75rem clamp(1rem, 4vw, 1.45rem);
    }

    .menu-toggle,
    [data-menu-toggle] {
        display: inline-grid;
    }

    .content {
        padding: 1.35rem clamp(1rem, 4vw, 1.45rem);
    }

    .search-field,
    .search-box {
        width: min(20rem, 42vw);
    }
}

@media (max-width: 680px) {
    body {
        font-size: 0.9rem;
    }

    .topbar {
        gap: 0.55rem;
    }

    .topbar-subtitle,
    .topbar .search-field,
    .topbar .search-box,
    .user-menu-name,
    .desktop-only {
        display: none !important;
    }

    .topbar-right,
    .topbar-actions {
        gap: 0.3rem;
    }

    .content {
        padding: 1.1rem 1rem calc(5.9rem + env(safe-area-inset-bottom));
    }

    .page-header {
        display: grid;
        gap: 0.85rem;
        margin-bottom: 1.05rem;
    }

    .page-actions,
    .panel-actions {
        justify-content: flex-start;
    }

    .page-actions .button,
    .page-actions .btn {
        flex: 1 1 auto;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.7rem;
        margin-bottom: 0.8rem;
    }

    .metric-card {
        min-height: 8.55rem;
        padding: 0.9rem;
        border-radius: 0.9rem;
    }

    .metric-icon {
        width: 2.15rem;
        height: 2.15rem;
    }

    .metric-value {
        font-size: 1.55rem;
    }

    .metric-footer,
    .metric-change {
        font-size: 0.67rem;
    }

    .panel {
        border-radius: 0.9rem;
    }

    .panel-header {
        min-height: auto;
        padding: 0.95rem 1rem;
    }

    .panel-body {
        padding: 1rem;
    }

    table th,
    .table th {
        padding: 0.7rem 0.9rem;
    }

    table td,
    .table td {
        padding: 0.78rem 0.9rem;
    }

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

    .form-grid .span-2,
    .form-grid .full-width {
        grid-column: auto;
    }

    .filter-bar {
        display: grid;
        grid-template-columns: 1fr;
        padding: 0.8rem;
    }

    .filter-bar .button,
    .filter-bar .btn {
        width: 100%;
    }

    .bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: stretch;
        min-height: calc(4.65rem + env(safe-area-inset-bottom));
        padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
        background: rgb(255 255 255 / 0.93);
        border-top: 1px solid var(--slate-200);
        box-shadow: 0 -6px 22px rgb(15 29 49 / 0.08);
        backdrop-filter: blur(15px);
        z-index: 40;
    }

    .bottom-nav .nav-item {
        display: grid;
        min-width: 0;
        min-height: 3.8rem;
        padding: 0.32rem 0.15rem;
        place-content: center;
        gap: 0.15rem;
        color: var(--slate-600);
        font-size: 0.63rem;
        font-weight: 700;
        text-align: center;
        background: transparent;
        border: 0;
        border-radius: 0.7rem;
        box-shadow: none;
    }

    .bottom-nav .nav-item .nav-icon,
    .bottom-nav .nav-item > svg:first-child {
        width: 1.18rem;
        height: 1.18rem;
        margin-inline: auto;
    }

    .bottom-nav .nav-item .nav-text {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .bottom-nav .nav-item.is-active,
    .bottom-nav .nav-item.active,
    .bottom-nav .nav-item[aria-current="page"] {
        color: var(--mint-700);
        background: var(--mint-100);
    }

    .mobile-only {
        display: initial !important;
    }

    .toast-region,
    [data-toast-region] {
        right: 0.75rem;
        bottom: calc(5.3rem + env(safe-area-inset-bottom));
        left: 0.75rem;
        width: auto;
    }
}

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

    .metric-card {
        min-height: 7.8rem;
    }

    .topbar-title {
        max-width: 10rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Nexus-specific portal surfaces ------------------------------------------------ */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--mint-700);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.live-pill,
.sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: var(--mint-700);
    font-size: 0.72rem;
    font-weight: 750;
    white-space: nowrap;
}

.live-pill i,
.sync-indicator i {
    display: block;
    width: 0.48rem;
    height: 0.48rem;
    background: var(--mint-500);
    border: 2px solid var(--mint-100);
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgb(32 174 145 / 0.18);
}

.sync-indicator {
    min-height: 2.3rem;
    padding: 0.45rem 0.65rem;
    color: var(--mint-700);
    background: var(--mint-100);
    border-radius: 999px;
}

.section-panel { margin-top: 1rem; }

.pulse-item {
    display: flex;
    gap: 0.72rem;
    padding: 0.15rem 0 0.85rem;
}

.pulse-item + .pulse-item {
    padding-top: 0.85rem;
    border-top: 1px solid var(--slate-200);
}

.pulse-icon,
.payment-icon {
    display: grid;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    place-items: center;
    color: var(--mint-700);
    font-size: 0.94rem;
    font-weight: 800;
    background: var(--mint-100);
    border-radius: 0.65rem;
}

.pulse-item > div { min-width: 0; }
.pulse-item strong,
.event-strip strong { display: block; color: var(--navy-850); font-size: 0.8rem; }
.pulse-item p { margin: 0.22rem 0; color: var(--slate-600); font-size: 0.74rem; line-height: 1.45; }
.pulse-item small,
.event-strip small { color: var(--slate-500); font-size: 0.68rem; }

.event-strip {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #eff9f5, #f8fcfa);
    border: 1px solid var(--mint-100);
    border-radius: 0.8rem;
}

.event-strip > span {
    display: grid;
    width: 2.3rem;
    height: 2.3rem;
    place-content: center;
    color: var(--mint-700);
    font-size: 0.91rem;
    font-weight: 800;
    line-height: 0.95;
    text-align: center;
    background: #fff;
    border-radius: 0.6rem;
}

.event-strip > span small { display: block; color: var(--mint-600); font-size: 0.48rem; letter-spacing: 0.08em; }
.event-strip > div { min-width: 0; }
.event-strip small { display: block; margin-top: 0.15rem; }

.child-list { display: grid; }
.child-row {
    display: flex;
    align-items: center;
    gap: 0.78rem;
    min-height: 4.65rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--slate-200);
    transition: background-color 160ms ease;
}
.child-row:last-child { border-bottom: 0; }
.child-row:hover { background: var(--surface-muted); }
.child-row > div:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.child-row strong { overflow: hidden; color: var(--navy-850); font-size: 0.83rem; text-overflow: ellipsis; white-space: nowrap; }
.child-row small { margin-top: 0.15rem; color: var(--slate-600); font-size: 0.71rem; }
.child-row-meta { display: grid; justify-items: end; gap: 0.2rem; }
.row-arrow { color: var(--slate-500); font-size: 1.5rem; font-weight: 300; }
.amount-cell { display: grid; justify-items: end; text-align: right; }
.amount-cell strong { color: var(--navy-850); font-size: 0.78rem; }
.amount-cell small { color: var(--slate-600); font-size: 0.68rem; }

.inline-status-form { display: flex; align-items: center; justify-content: flex-end; gap: 0.38rem; }
.inline-status-form select {
    min-height: 2.1rem;
    max-width: 6.8rem;
    padding: 0.32rem 0.42rem;
    color: var(--navy-800);
    font-size: 0.74rem;
    background: var(--surface);
    border: 1px solid var(--slate-300);
    border-radius: 0.55rem;
}

.form-submit { align-self: end; display: flex; align-items: end; }
.form-submit .button { width: 100%; }
.compact-metrics .metric-card { min-height: 8rem; }

.update-card {
    padding: 1rem 0;
    border-bottom: 1px solid var(--slate-200);
}
.update-card:first-child { padding-top: 0; }
.update-card:last-child { padding-bottom: 0; border-bottom: 0; }
.update-card-top { display: flex; align-items: center; gap: 0.65rem; }
.update-card-top > div { display: grid; flex: 1; min-width: 0; }
.update-card-top strong { color: var(--navy-850); font-size: 0.81rem; }
.update-card-top small { overflow: hidden; color: var(--slate-600); font-size: 0.69rem; text-overflow: ellipsis; white-space: nowrap; }
.update-card p { margin: 0.76rem 0 0.55rem 2.7rem; color: var(--slate-700); font-size: 0.81rem; line-height: 1.58; }
.update-card footer { margin-left: 2.7rem; color: var(--slate-500); font-size: 0.69rem; }
.announcement-row { display: flex; gap: 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--slate-200); }
.announcement-row:last-child { border-bottom: 0; }
.announcement-row > span { display: grid; flex: 0 0 1.9rem; width: 1.9rem; height: 1.9rem; place-items: center; color: var(--amber-600); background: var(--amber-100); border-radius: 0.6rem; }
.announcement-row strong { display: block; color: var(--navy-850); font-size: 0.81rem; }
.announcement-row p { margin: 0.18rem 0 0; color: var(--slate-600); font-size: 0.75rem; }

.account-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr); gap: 1rem; }
.profile-hero { display: flex; align-items: center; gap: 0.95rem; padding-bottom: 1.15rem; border-bottom: 1px solid var(--slate-200); }
.profile-hero > div { min-width: 0; }
.profile-hero h3 { margin: 0; color: var(--navy-850); font-size: 1.08rem; letter-spacing: -0.025em; }
.profile-hero p { margin: 0.2rem 0 0.5rem; overflow: hidden; color: var(--slate-600); font-size: 0.77rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-list { display: grid; gap: 0; margin: 0; }
.profile-list > div { display: grid; grid-template-columns: 8.4rem 1fr; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--slate-200); }
.profile-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.profile-list dt { color: var(--slate-600); font-size: 0.76rem; }
.profile-list dd { margin: 0; color: var(--navy-850); font-size: 0.79rem; font-weight: 700; text-align: right; }
.security-list,
.session-list { display: grid; padding: 0; margin: 0; list-style: none; }
.security-list li { display: flex; gap: 0.7rem; padding: 0.72rem 0; border-bottom: 1px solid var(--slate-200); }
.security-list li:last-child { border-bottom: 0; }
.security-list li > span { display: grid; flex: 0 0 1.5rem; width: 1.5rem; height: 1.5rem; place-items: center; color: var(--mint-700); font-size: 0.72rem; font-weight: 900; background: var(--mint-100); border-radius: 999px; }
.security-list div { display: grid; }
.security-list strong { color: var(--navy-850); font-size: 0.78rem; }
.security-list small { margin-top: 0.14rem; color: var(--slate-600); font-size: 0.71rem; }
.session-list li { display: flex; align-items: center; gap: 0.8rem; padding: 0.95rem 1.25rem; border-bottom: 1px solid var(--slate-200); }
.session-list li:last-child { border-bottom: 0; }
.device-icon { display: grid; flex: 0 0 2rem; width: 2rem; height: 2rem; place-items: center; color: var(--blue-600); background: var(--blue-100); border-radius: 0.65rem; }
.session-list li > div { display: grid; flex: 1; min-width: 0; }
.session-list strong { color: var(--navy-850); font-size: 0.79rem; }
.session-list small { margin-top: 0.17rem; overflow: hidden; color: var(--slate-600); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.session-status { color: var(--slate-500); font-size: 0.7rem; font-weight: 700; }

/* Authentication */
.auth-page {
    min-height: 100vh;
    background: #0b1728;
}
.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(26rem, 0.92fr);
    min-height: 100vh;
}
.auth-story {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: clamp(1.4rem, 4vw, 3rem) clamp(1.4rem, 7vw, 7rem);
    overflow: hidden;
    color: #f3fffb;
    background:
        radial-gradient(circle at 75% 17%, rgb(75 216 179 / 0.19), transparent 20rem),
        radial-gradient(circle at 18% 90%, rgb(91 144 255 / 0.13), transparent 24rem),
        linear-gradient(135deg, #102641, #071321 75%);
}
.auth-story::after {
    position: absolute;
    right: clamp(-11rem, -10vw, -5rem);
    bottom: clamp(-10rem, -8vw, -4rem);
    width: 29rem;
    height: 29rem;
    content: "";
    border: 1px solid rgb(167 229 212 / 0.15);
    border-radius: 47% 53% 38% 62%;
    transform: rotate(19deg);
}
.auth-story .brand { position: relative; z-index: 1; width: max-content; }
.auth-story .brand-copy small { color: #9ab1c2; }
.auth-story-copy { position: relative; z-index: 1; max-width: 35rem; margin: auto 0; padding: 4.2rem 0; }
.auth-story .eyebrow { color: var(--mint-300); }
.auth-story h1 { max-width: 13ch; margin: 0.85rem 0 1rem; color: #fff; font-size: clamp(2.4rem, 5vw, 4.5rem); font-weight: 760; letter-spacing: -0.065em; line-height: 0.98; }
.auth-story h1 em { color: var(--mint-300); font-style: normal; }
.auth-story-copy > p { max-width: 34rem; margin: 0; color: #b9c9d4; font-size: clamp(0.92rem, 1.2vw, 1.05rem); line-height: 1.7; }
.auth-proof { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.auth-proof > div { display: grid; gap: 0.25rem; padding: 0.9rem; background: rgb(255 255 255 / 0.055); border: 1px solid rgb(255 255 255 / 0.09); border-radius: 0.85rem; backdrop-filter: blur(6px); }
.auth-proof strong { color: #eafff8; font-size: 0.73rem; }
.auth-proof span { color: #93aab9; font-size: 0.65rem; line-height: 1.35; }
.auth-card-wrap { display: grid; min-height: 100%; padding: clamp(1.25rem, 5vw, 4rem); place-items: center; background: #f4f8f7; }
.auth-card { width: min(100%, 25.5rem); padding: clamp(1.35rem, 3vw, 2.35rem); background: #fff; border: 1px solid rgb(15 29 49 / 0.07); border-radius: 1.25rem; box-shadow: 0 22px 55px rgb(7 23 36 / 0.12); }
.auth-card-heading { display: inline-flex; align-items: center; gap: 0.42rem; color: var(--slate-600); font-size: 0.69rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 0.48rem; height: 0.48rem; background: var(--mint-500); border-radius: 99px; box-shadow: 0 0 0 3px var(--mint-100); }
.auth-card h2 { margin: 1rem 0 0.35rem; color: var(--navy-900); font-size: 1.65rem; letter-spacing: -0.05em; }
.auth-card > p { margin: 0; color: var(--slate-600); font-size: 0.84rem; line-height: 1.55; }
.auth-form { display: grid; gap: 1rem; margin-top: 1.45rem; }
.auth-form > label { display: grid; gap: 0.42rem; color: var(--navy-800); font-size: 0.76rem; font-weight: 750; }
.auth-form input:not([type="checkbox"]) { width: 100%; min-height: 2.85rem; padding: 0.62rem 0.76rem; color: var(--navy-900); background: var(--surface-muted); border: 1px solid var(--slate-300); border-radius: 0.72rem; }
.auth-form input:not([type="checkbox"]):focus { background: #fff; border-color: var(--mint-500); box-shadow: 0 0 0 3px rgb(32 174 145 / 0.13); outline: 0; }
.auth-form .remember { display: flex; align-items: center; gap: 0.52rem; color: var(--slate-600); font-size: 0.73rem; font-weight: 600; }
.auth-form .remember input { accent-color: var(--mint-600); }
.auth-submit { width: 100%; min-height: 3rem; margin-top: 0.15rem; font-size: 0.86rem; }
.auth-submit span { font-size: 1.1rem; }
.auth-alert { margin-top: 1rem; padding: 0.72rem 0.8rem; font-size: 0.75rem; line-height: 1.45; border-radius: 0.7rem; }
.auth-alert.error { color: var(--coral-700); background: var(--coral-100); border: 1px solid #ffdcd7; }
.auth-alert.success { color: var(--mint-700); background: var(--mint-100); border: 1px solid #d2f2e7; }
.auth-help { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-top: 1.25rem; color: var(--slate-500); font-size: 0.67rem; }
.auth-help > span { margin-right: 0.15rem; font-weight: 750; }
.auth-help button { padding: 0; color: var(--mint-700); font: inherit; font-weight: 750; background: transparent; border: 0; }
.auth-help button:hover { text-decoration: underline; }
.auth-footer { margin-top: 1.2rem !important; font-size: 0.75rem !important; text-align: center; }
.auth-footer a { font-weight: 750; }
.reset-shell { display: grid; min-height: 100vh; padding: clamp(1.25rem, 4vw, 3rem); place-items: center; background: radial-gradient(circle at 50% 10%, rgb(32 174 145 / 0.12), transparent 25rem), #edf4f3; }
.reset-brand { position: absolute; top: 1.5rem; left: clamp(1.25rem, 4vw, 3rem); color: var(--navy-900); }
.reset-brand .brand-copy small { color: var(--slate-600); }

/* Deliberately separate mobile-first client preview. */
.native-mobile-page { min-height: 100dvh; background: #0b1728; }
.native-mobile { min-height: 100dvh; max-width: 31rem; padding: max(1rem, env(safe-area-inset-top)) 1rem calc(5.9rem + env(safe-area-inset-bottom)); margin: 0 auto; overflow: hidden; background: #f1f7f5; }
.native-mobile-header { display: flex; align-items: center; gap: 0.72rem; padding: 0.15rem 0 1.3rem; }
.native-mobile-header > a { display: grid; flex: 0 0 2.25rem; width: 2.25rem; height: 2.25rem; place-items: center; color: var(--navy-850); font-size: 1.25rem; background: #fff; border: 1px solid var(--slate-200); border-radius: 0.72rem; }
.native-mobile-header > div { display: grid; flex: 1; }
.native-mobile-header small { color: var(--slate-600); font-size: 0.64rem; font-weight: 700; }
.native-mobile-header strong { color: var(--navy-900); font-size: 0.86rem; letter-spacing: -0.02em; }
.mobile-welcome { padding: 1.1rem; color: #effff9; background: radial-gradient(circle at 90% 5%, rgb(161 249 221 / 0.22), transparent 7rem), linear-gradient(135deg, #0e7767, #124e68); border-radius: 1.15rem; box-shadow: 0 13px 27px rgb(11 79 79 / 0.18); }
.mobile-welcome .eyebrow { color: #baf6e5; font-size: 0.6rem; }
.mobile-welcome h1 { margin: 0.45rem 0 0.25rem; color: #fff; font-size: 1.58rem; letter-spacing: -0.05em; }
.mobile-welcome p { margin: 0; color: #d2f6eb; font-size: 0.72rem; }
.mobile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin: 0.9rem 0 1.35rem; }
.mobile-stats article { display: grid; min-height: 6.7rem; padding: 0.82rem; background: #fff; border: 1px solid rgb(15 29 49 / 0.07); border-radius: 0.95rem; box-shadow: var(--shadow-xs); }
.mobile-stats span { color: var(--slate-600); font-size: 0.67rem; font-weight: 650; }
.mobile-stats strong { align-self: end; color: var(--navy-900); font-size: 1.25rem; letter-spacing: -0.04em; line-height: 1.05; }
.mobile-stats small { margin-top: 0.27rem; color: var(--mint-700); font-size: 0.62rem; font-weight: 650; }
.mobile-section { margin-top: 1.15rem; }
.mobile-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0 0 0.55rem; }
.mobile-section-heading h2 { margin: 0; color: var(--navy-850); font-size: 0.9rem; letter-spacing: -0.025em; }
.mobile-section-heading a { font-size: 0.68rem; font-weight: 750; }
.mobile-list { display: grid; overflow: hidden; background: #fff; border: 1px solid rgb(15 29 49 / 0.07); border-radius: 0.95rem; box-shadow: var(--shadow-xs); }
.mobile-list article { display: flex; align-items: center; gap: 0.7rem; min-height: 4.35rem; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--slate-200); }
.mobile-list article:last-child { border-bottom: 0; }
.mobile-list article > div { display: grid; flex: 1; min-width: 0; }
.mobile-list strong { overflow: hidden; color: var(--navy-850); font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.mobile-list small { display: block; margin-top: 0.18rem; overflow: hidden; color: var(--slate-600); font-size: 0.65rem; text-overflow: ellipsis; white-space: nowrap; }
.mobile-list article > span:last-child { color: var(--slate-500); font-size: 1.25rem; }
.mobile-list b { color: var(--navy-850); font-size: 0.69rem; }
.mobile-avatar { display: grid; flex: 0 0 2rem; width: 2rem; height: 2rem; place-items: center; color: var(--navy-800); font-size: 0.68rem; font-weight: 800; background: var(--mint-100); border-radius: 0.65rem; }
.native-bottom { position: fixed; right: max(0px, calc((100vw - 31rem) / 2)); bottom: 0; left: max(0px, calc((100vw - 31rem) / 2)); display: grid; grid-template-columns: repeat(4, 1fr); min-height: calc(4.7rem + env(safe-area-inset-bottom)); padding: 0.35rem 0.55rem calc(0.35rem + env(safe-area-inset-bottom)); background: rgb(255 255 255 / 0.95); border-top: 1px solid var(--slate-200); box-shadow: 0 -7px 24px rgb(15 29 49 / 0.1); backdrop-filter: blur(15px); }
.native-bottom a { display: grid; gap: 0.12rem; align-content: center; color: var(--slate-600); font-size: 0.6rem; font-weight: 750; text-align: center; }
.native-bottom a span { font-size: 1.05rem; }
.native-bottom a.active { color: var(--mint-700); }
.mobile-skeleton { min-height: 6.7rem; background: linear-gradient(90deg, #eaf1ef 25%, #f8fbfa 40%, #eaf1ef 60%); background-size: 300% 100%; border-radius: 0.95rem; animation: shimmer 1.5s infinite linear; }
.mobile-skeleton.wide { min-height: 4.35rem; margin: 0; border-radius: 0; }

@media (max-width: 960px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-story { min-height: auto; padding-bottom: 2rem; }
    .auth-story-copy { margin: 1.5rem 0 0; padding: 1.5rem 0 2.25rem; }
    .auth-story h1 { max-width: 18ch; font-size: clamp(2.1rem, 8vw, 3.3rem); }
    .auth-card-wrap { min-height: auto; padding: 2rem 1.2rem 2.7rem; }
    .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .auth-proof { grid-template-columns: 1fr; gap: 0.45rem; }
    .auth-proof > div { grid-template-columns: 8rem 1fr; align-items: center; padding: 0.72rem; }
    .auth-card { border-radius: 1rem; }
    .sync-indicator { padding: 0.4rem; }
    .sync-indicator span { display: none; }
    .child-row { gap: 0.58rem; min-height: 4.35rem; padding: 0.75rem 0.95rem; }
    .child-row-meta small { display: none; }
    .inline-status-form { flex-wrap: wrap; justify-content: flex-start; }
    .inline-status-form select { max-width: 5.8rem; }
    .update-card p,
    .update-card footer { margin-left: 0; }
    .profile-list > div { grid-template-columns: 1fr; gap: 0.15rem; }
    .profile-list dd { text-align: left; }
    .session-status { display: none; }
    .native-mobile { max-width: none; }
    .native-bottom { right: 0; left: 0; }
}
