
:root {
    color-scheme: dark;
    --bg-0: #030712;
    --bg-1: #071225;
    --bg-2: #0c1f3a;
    --bg-3: #12365a;
    --panel: rgba(13, 30, 54, 0.94);
    --panel-2: rgba(17, 40, 72, 0.96);
    --panel-3: rgba(23, 53, 90, 0.92);
    --surface: rgba(255, 255, 255, 0.082);
    --surface-strong: rgba(255, 255, 255, 0.14);
    --field-bg: #07182d;
    --field-bg-focus: #0a223f;
    --line: rgba(232, 242, 255, 0.22);
    --line-strong: rgba(245, 249, 255, 0.42);
    --text: #ffffff;
    --text-soft: #f2f7ff;
    --muted: #d0def2;
    --muted-2: #b6c7df;
    --primary: #2dd4bf;
    --primary-dark: #0f766e;
    --primary-deep: #134e4a;
    --primary-2: #38bdf8;
    --primary-3: #818cf8;
    --gold: #f8d27a;
    --gold-2: #d9a441;
    --danger-text: #ffffff;
    --danger-bg: rgba(170, 36, 36, 0.46);
    --success-text: #ffffff;
    --success-bg: rgba(18, 132, 91, 0.46);
    --shadow: 0 34px 100px rgba(0, 0, 0, 0.62);
    --shadow-soft: 0 18px 52px rgba(0, 0, 0, 0.42);
    --ring: 0 0 0 5px rgba(66, 242, 189, 0.18);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 12% -6%, rgba(66, 242, 189, 0.24), transparent 28rem),
        radial-gradient(circle at 95% 4%, rgba(99, 183, 255, 0.20), transparent 30rem),
        radial-gradient(circle at 52% 104%, rgba(167, 139, 250, 0.18), transparent 38rem),
        linear-gradient(150deg, var(--bg-0) 0%, var(--bg-1) 42%, #02040b 100%);
    background-attachment: fixed;
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

body:before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.60), transparent 76%);
}

body:after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.028), transparent 44%, rgba(0,0,0,.24));
}

a { color: inherit; }

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

.app-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 1120px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px 14px 132px;
}

.app-shell:before {
    content: "";
    position: fixed;
    left: 50%;
    top: 0;
    width: min(100%, 1120px);
    height: 5px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    border-radius: 0 0 999px 999px;
    box-shadow: 0 14px 44px rgba(66, 242, 189, 0.28);
}

.auth-panel {
    min-height: calc(100vh - 36px);
    display: grid;
    align-content: center;
    gap: 18px;
}

.auth-panel > div:first-child { text-align: left; }

.brand-mark,
.module-icon,
.avatar {
    position: relative;
    isolation: isolate;
}

.brand-mark:after,
.module-icon:after,
.avatar:after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(145deg, rgba(255,255,255,.45), transparent 38%);
    opacity: .48;
    pointer-events: none;
    z-index: -1;
}

.brand-mark {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--primary-dark), var(--primary));
    color: #02111d;
    font-weight: 950;
    letter-spacing: -0.04em;
    box-shadow: 0 22px 58px rgba(66, 242, 189, 0.26);
    border: 1px solid rgba(255,255,255,.58);
}

.app-title {
    margin: 0;
    color: var(--text);
    font-size: clamp(2.18rem, 9vw, 3.55rem);
    line-height: 1.01;
    letter-spacing: -0.06em;
    text-shadow: 0 2px 30px rgba(0,0,0,.42);
}

.app-subtitle,
.page-kicker,
.module-card p,
.identity-subtitle {
    color: var(--muted);
}

.app-subtitle {
    margin: 10px 0 0;
    font-size: 1.04rem;
    max-width: 56ch;
}

.login-title { margin-top: 22px; }

.form-card,
.card,
.hero-card,
.module-card {
    position: relative;
    overflow: clip;
    margin-block: 0 20px;
    background:
        linear-gradient(152deg, rgba(23, 53, 90, 0.98), rgba(8, 20, 39, 0.94) 58%, rgba(8, 17, 31, 0.96));
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.form-card:before,
.card:before,
.hero-card:before,
.module-card:before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 30%),
        radial-gradient(circle at 98% 0%, rgba(66, 242, 189, 0.14), transparent 17rem),
        radial-gradient(circle at 6% 100%, rgba(99, 183, 255, 0.10), transparent 14rem);
}

.form-card:after,
.card:after,
.hero-card:after,
.module-card:after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.58), transparent);
    opacity: .75;
}

.form-card > *,
.card > *,
.hero-card > *,
.module-card > * { position: relative; }

.form-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.field { display: grid; gap: 8px; }

label {
    color: var(--text-soft);
    font-size: 0.98rem;
    font-weight: 850;
}

input,
textarea,
select {
    width: 100%;
    min-height: 58px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--field-bg);
    color: var(--text);
    padding: 14px 16px;
    font-size: 16px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 26px rgba(0,0,0,.18);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

textarea { min-height: 132px; resize: vertical; }

input::placeholder,
textarea::placeholder { color: #b8c9df; opacity: 1; }

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(66, 242, 189, 0.95);
    background: var(--field-bg-focus);
    box-shadow: var(--ring), inset 0 1px 0 rgba(255,255,255,.10);
}

.button-primary,
.button-link,
.button-secondary,
.icon-button {
    min-height: 54px;
    border-radius: 18px;
    font-weight: 920;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button-primary,
.button-link {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: #14b8a6;
    color: #02111d;
    box-shadow: 0 16px 34px rgba(20, 184, 166, 0.22);
}

.button-primary:hover,
.button-primary:focus,
.button-link:hover,
.button-link:focus,
.button-secondary:hover,
.button-secondary:focus,
.icon-button:hover,
.icon-button:focus { transform: translateY(-1px); }

.button-primary:focus-visible,
.button-link:focus-visible,
.button-secondary:focus-visible,
.icon-button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(255, 215, 130, 0.94);
    outline-offset: 3px;
}

.button-secondary,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line-strong);
    background: rgba(255,255,255,.08);
    color: var(--text);
    padding: 10px 15px;
    box-shadow: 0 12px 30px rgba(0,0,0,.24);
}

.button-secondary:hover,
.button-secondary:focus,
.icon-button:hover,
.icon-button:focus {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.60);
}

.icon-button {
    width: 54px;
    padding: 0;
    font-size: 1.6rem;
}

.alert {
    border-radius: var(--radius-lg);
    padding: 15px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    font-weight: 780;
    box-shadow: 0 16px 36px rgba(0,0,0,.30);
}

.alert-error { border-color: rgba(255, 179, 179, 0.65); color: var(--danger-text); background: var(--danger-bg); }
.alert-success { border-color: rgba(182, 255, 217, 0.65); color: var(--success-text); background: var(--success-bg); }

.meta-link {
    display: inline-flex;
    margin-top: 16px;
    color: var(--primary);
    font-weight: 850;
    text-decoration: none;
}

.page-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(18, 42, 75, 0.95), rgba(7, 17, 32, 0.92));
    box-shadow: 0 18px 42px rgba(0,0,0,.36);
}

.page-head h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.62rem, 7vw, 2.32rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.page-kicker {
    margin: 5px 0 0;
    font-size: 0.96rem;
    color: var(--muted);
}

.top-actions,
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions { margin-top: 22px; }

.hero-card {
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.hero-card .button-secondary { min-width: 126px; }

.hero-eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0;
    color: var(--text);
    font-size: clamp(2.08rem, 9vw, 3.72rem);
    line-height: .98;
    letter-spacing: -0.065em;
}

.role-badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 38px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(66, 242, 189, 0.50);
    background: rgba(66, 242, 189, 0.18);
    color: #e1fff4;
    font-size: 0.85rem;
    font-weight: 930;
}

.status-pill {
    border-color: rgba(255, 215, 130, 0.52);
    background: rgba(255, 215, 130, 0.16);
    color: #fff2cb;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.module-card {
    display: grid;
    gap: 15px;
    min-height: 186px;
    padding: 20px;
}

.module-card:hover { border-color: rgba(255,255,255,.36); }

.module-card.is-disabled { opacity: 1; filter: none; }
.module-card.is-disabled .module-icon { background: linear-gradient(145deg, #8797ad, #bac7d7); color: #05101d; }
.module-card.is-disabled .status-pill { border-color: rgba(220, 232, 248, 0.40); background: rgba(220, 232, 248, 0.13); color: var(--muted); }

.module-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.module-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 21px;
    background: linear-gradient(145deg, var(--primary-dark), var(--primary));
    color: #f8fffd;
    font-weight: 950;
    box-shadow: 0 16px 36px rgba(66, 242, 189, 0.24);
    border: 1px solid rgba(255,255,255,.40);
}

.module-card h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.28rem;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.module-card p { margin: 8px 0 0; color: var(--muted); }

.card { padding: 20px; margin-bottom: 16px; }
.identity-card { display: grid; gap: 16px; }
.identity-main { display: flex; gap: 14px; align-items: center; }

.avatar {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--primary-deep), var(--primary-dark));
    color: #ffffff;
    font-size: 1.62rem;
    font-weight: 950;
    box-shadow: 0 18px 44px rgba(255, 215, 130, 0.22);
    border: 1px solid rgba(255,255,255,.46);
}

.identity-title {
    margin: 0;
    color: var(--text);
    font-size: 1.42rem;
    line-height: 1.10;
    letter-spacing: -0.04em;
}

.identity-subtitle { margin: 6px 0 8px; color: var(--muted); overflow-wrap: anywhere; }

.detail-grid { display: grid; gap: 10px; }
.detail-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.082);
}
.detail-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 0.83rem; font-weight: 870; }
.detail-value { color: var(--text); font-weight: 850; overflow-wrap: anywhere; }

.action-card { display: grid; gap: 12px; }

.record-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.record-card {
    position: relative;
    overflow: clip;
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(152deg, rgba(23, 53, 90, 0.98), rgba(8, 20, 39, 0.94) 58%, rgba(8, 17, 31, 0.96));
    box-shadow: var(--shadow-soft);
}

.record-card:before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.13), transparent 30%),
        radial-gradient(circle at 96% 0%, rgba(66, 242, 189, 0.13), transparent 16rem);
}

.record-card > * {
    position: relative;
}

.record-card-head {
    display: grid;
    gap: 12px;
}

.record-card h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.28rem;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.record-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 850;
}

.empty-card {
    display: grid;
    gap: 14px;
    place-items: start;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 64px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.switch-row input {
    width: 26px;
    min-height: 26px;
    height: 26px;
    accent-color: var(--primary);
    box-shadow: none;
}

.category-editor {
    display: grid;
    gap: 20px;
}

.sticky-save {
    position: sticky;
    bottom: 104px;
    z-index: 20;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(3, 10, 22, 0.88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.form-card[hidden] {
    display: none;
}

.readonly-value {
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    overflow-wrap: anywhere;
}

.section-title { margin: 0 0 14px; color: var(--text); font-size: 1.28rem; line-height: 1.16; letter-spacing: -0.035em; }
.form-actions { margin-top: 4px; }

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 50;
    width: min(calc(100% - 28px), 520px);
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(232, 242, 255, 0.24);
    border-radius: 24px;
    background: rgba(3, 10, 22, 0.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.bottom-nav a {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 58px;
    border-radius: 17px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-decoration: none;
    line-height: 1.1;
}

.bottom-nav svg {
    width: 21px;
    height: 21px;
    display: block;
    stroke: currentColor;
    stroke-width: 2.1;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav a.is-active {
    background: rgba(20, 184, 166, 0.22);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}

.bottom-nav a:hover,
.bottom-nav a:focus { color: var(--text); background: rgba(255,255,255,.11); }

@media (max-width: 520px) {
    .page-head { grid-template-columns: auto 1fr; }
    .page-head .button-secondary { grid-column: 1 / -1; width: 100%; }
    .identity-main { align-items: flex-start; }
    .hero-actions .button-secondary { width: 100%; }
}

@media (min-width: 720px) {
    .app-shell { padding: 34px 24px 138px; }
    .auth-panel { width: min(100%, 480px); margin: 0 auto; }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .hero-card, .card, .form-card, .module-card { padding: 28px; }
    .action-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .record-card-head { grid-template-columns: 1fr auto; align-items: start; }
}

@media (min-width: 980px) {
    .dashboard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .module-card { min-height: 220px; }
}


/* 2026-05-30: premium stability and SVG menu refinements */
.button-primary,
.button-link {
    border-radius: 14px;
    background: #14b8a6;
    color: #02111d;
    text-shadow: none;
}

.button-primary:hover,
.button-primary:focus,
.button-link:hover,
.button-link:focus {
    background: #2dd4bf;
    box-shadow: 0 18px 38px rgba(20, 184, 166, 0.24);
}

.form-card,
.card,
.hero-card,
.module-card {
    margin-bottom: 24px;
    overflow: clip;
}

.form-card:last-child,
.card:last-child,
.hero-card:last-child,
.module-card:last-child {
    margin-bottom: 0;
}

.module-card {
    min-height: 0;
}

.bottom-nav .nav-label {
    display: block;
}

.bottom-nav a.is-active {
    color: #ffffff;
    border: 1px solid rgba(45, 212, 191, 0.36);
}

.bottom-nav a.is-active svg {
    color: #5eead4;
}

@media (max-width: 520px) {
    .app-shell {
        padding-bottom: 144px;
    }

    .form-card,
    .card,
    .hero-card,
    .module-card {
        margin-bottom: 22px;
    }

    .bottom-nav {
        width: min(calc(100% - 20px), 520px);
        bottom: calc(10px + env(safe-area-inset-bottom));
    }
}
