:root {
    --blue: #3b00db;
    --blue-dark: #2d00a8;
    --blue-soft: #eeeaff;
    --orange: #f28c18;
    --orange-soft: #fff3e4;
    --ink: #050505;
    --paper: #fff;
    --canvas: #f3f3f5;
    --muted: #66656d;
    --line: rgba(5, 5, 5, .14);
    --danger: #a71919;
    --shadow: 0 28px 70px rgba(5, 5, 5, .13);
    --shadow-soft: 0 14px 34px rgba(5, 5, 5, .08);
    --content-width: 1440px;
    --accent-color: var(--blue);
    --user-color: var(--blue);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    font-synthesis: none;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

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

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[hidden],
.hidden {
    display: none !important;
}

::selection {
    color: var(--paper);
    background: var(--blue);
}

:focus-visible {
    outline: 3px solid rgba(59, 0, 219, .28);
    outline-offset: 3px;
}

.page-grid {
    position: fixed;
    z-index: -2;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(59, 0, 219, .07) 1px, transparent 1px),
        linear-gradient(0deg, rgba(59, 0, 219, .055) 1px, transparent 1px);
    background-size: 72px 72px;
}

.eyebrow,
.section-number {
    margin: 0 0 7px;
    color: var(--blue);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2,
.hero-summary > strong,
.metric-card strong {
    font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    font-stretch: condensed;
    letter-spacing: -.045em;
}

/* Authentication */
.auth-page {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    overflow-x: hidden;
    padding: 44px 24px;
}

.auth-page::before {
    position: fixed;
    z-index: -1;
    top: -18%;
    right: -10%;
    width: min(48vw, 740px);
    height: 98%;
    content: "";
    background: var(--blue);
    box-shadow: -30px 40px 80px rgba(59, 0, 219, .15);
    transform: rotate(14deg);
}

.auth-page::after {
    position: fixed;
    z-index: -1;
    bottom: 3vh;
    left: 3vw;
    width: 120px;
    height: 120px;
    content: "";
    border: 20px solid var(--ink);
    border-radius: 50%;
    opacity: .045;
}

.auth-shell {
    display: grid;
    width: min(100%, 1040px);
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, .85fr);
    box-shadow: var(--shadow);
}

.auth-brand,
.auth-panel {
    position: relative;
    min-width: 0;
}

.auth-brand {
    display: flex;
    min-height: 590px;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 56px;
    color: var(--paper);
    background: var(--ink);
    border-radius: 10px 0 0 50px;
}

.auth-brand::before {
    position: absolute;
    inset: 0;
    content: "";
    background-image:
        linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to right, #000, transparent);
}

.auth-brand::after {
    position: absolute;
    right: -90px;
    bottom: -120px;
    width: 330px;
    height: 330px;
    content: "";
    background: var(--blue);
    border-radius: 50%;
    opacity: .92;
}

.auth-brand > * {
    position: relative;
    z-index: 1;
}

.auth-brand img {
    width: min(100%, 330px);
    max-height: 104px;
    margin-bottom: 36px;
    padding: 16px 18px;
    object-fit: contain;
    background: var(--paper);
    border-radius: 5px 22px 5px 5px;
}

.brand-rule {
    width: 58px;
    height: 4px;
    margin-bottom: 18px;
    background: var(--orange);
}

.auth-brand .eyebrow {
    color: var(--orange);
}

.auth-brand h1 {
    margin-bottom: 22px;
    font-size: clamp(3.5rem, 6vw, 5.6rem);
    font-weight: 950;
    line-height: .82;
    text-shadow: 5px 5px 0 rgba(59, 0, 219, .65);
}

.auth-brand h1 em,
.planner-hero h1 em,
.admin-intro h1 em {
    color: var(--paper);
    font-style: normal;
}

.auth-brand > p:not(.eyebrow) {
    max-width: 440px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, .76);
    font-size: 1.08rem;
    line-height: 1.6;
}

.auth-features {
    display: grid;
    margin-top: 34px;
    gap: 10px;
}

.auth-features span {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, .72);
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.auth-features strong {
    color: var(--orange);
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 52px 46px 36px;
    background: rgba(255, 255, 255, .985);
    border-radius: 0 50px 10px 0;
}

.card-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 42%;
    height: 7px;
    background: var(--blue);
}

.form-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.form-heading .eyebrow {
    margin-bottom: 4px;
}

.form-heading h2 {
    margin: 0;
    font-size: 2.15rem;
    font-weight: 950;
    line-height: 1;
}

.form-heading p:last-child {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .94rem;
}

.heading-icon {
    display: grid;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    place-items: center;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 7px 18px 7px 7px;
}

.heading-icon svg {
    width: 25px;
    height: 25px;
}

.stack {
    display: grid;
    gap: 17px;
}

label {
    display: grid;
    gap: 7px;
    font-size: .9rem;
    font-weight: 750;
}

label.inline {
    display: flex;
    align-items: center;
    gap: 11px;
}

.input-wrap {
    position: relative;
    margin-top: -10px;
}

.input-wrap > svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 19px;
    height: 19px;
    color: #85858b;
    transform: translateY(-50%);
    pointer-events: none;
}

input,
select {
    width: 100%;
    min-height: 48px;
    padding: 10px 13px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid rgba(5, 5, 5, .22);
    border-radius: 7px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-wrap input {
    padding-left: 45px;
}

input:focus,
select:focus {
    outline: 0;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 0, 219, .12);
}

.primary-button,
button:not(.slot):not(.reservation-bar):not(.reservation-item):not(.secondary):not(.danger):not(.icon-close),
.btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 18px;
    color: var(--paper);
    background: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 7px;
    box-shadow: 0 12px 25px rgba(59, 0, 219, .2);
    font-weight: 780;
    text-decoration: none;
    transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.primary-button {
    width: 100%;
}

.primary-button svg,
button svg {
    width: 20px;
    height: 20px;
}

.primary-button:hover,
button:not(.slot):not(.reservation-bar):not(.reservation-item):not(.secondary):not(.danger):not(.icon-close):hover,
.btn:hover {
    background: var(--blue-dark);
    box-shadow: 0 16px 32px rgba(59, 0, 219, .28);
    transform: translateY(-2px);
}

.primary-button.compact {
    width: auto;
    min-height: 42px;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 22px 0 0;
    color: #77767d;
    font-size: .77rem;
}

.security-note svg {
    width: 15px;
    height: 15px;
    color: var(--blue);
}

.back-link {
    margin-top: 22px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    color: var(--blue);
}

.alert {
    margin: 0 0 20px;
    padding: 13px 15px;
    color: #144723;
    background: #e9f8ed;
    border: 1px solid #b9dfc3;
    border-radius: 7px 18px 7px 7px;
    font-size: .9rem;
}

.alert.error,
.error {
    color: #691010;
    background: #fff0f0;
    border-color: #e6bcbc;
}

.register-shell {
    width: min(100%, 1040px);
}

.register-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 25px 34px;
    color: var(--paper);
    background: var(--ink);
    border-radius: 10px 10px 0 0;
}

.register-heading img {
    width: min(42%, 330px);
    max-height: 92px;
    padding: 13px 16px;
    object-fit: contain;
    background: var(--paper);
    border-radius: 5px 18px 5px 5px;
}

.register-heading .eyebrow {
    color: var(--orange);
}

.register-heading h1 {
    margin: 0;
    font-size: clamp(2.3rem, 5vw, 4rem);
    font-weight: 950;
    line-height: .95;
}

.register-heading p:last-child {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, .68);
}

.register-panel {
    padding: 38px 46px 44px;
    border-radius: 0 0 48px 10px;
    box-shadow: var(--shadow);
}

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

.form-section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 7px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.form-section-heading > span {
    color: var(--blue);
    font-size: 1.35rem;
    font-weight: 950;
}

.form-section-heading h2,
.form-section-heading p {
    margin: 0;
}

.form-section-heading h2 {
    font-size: 1.35rem;
}

.form-section-heading p {
    margin-top: 3px;
    color: var(--muted);
    font-size: .86rem;
}

.charter-box {
    position: relative;
    overflow: hidden;
    padding: 24px 26px;
    background: var(--blue-soft);
    border: 1px solid rgba(59, 0, 219, .2);
    border-radius: 7px 28px 7px 7px;
}

.charter-box::after {
    position: absolute;
    right: -24px;
    bottom: -36px;
    width: 100px;
    height: 100px;
    content: "";
    background: var(--blue);
    border-radius: 50%;
    opacity: .08;
}

.charter-box h2 {
    margin-bottom: 8px;
    font-size: 1.35rem;
}

.charter-box p:last-child {
    margin: 0;
    color: var(--muted);
}

.consent-line {
    align-items: flex-start !important;
    font-size: .92rem;
}

.consent-line input,
.choice-group input[type="radio"] {
    width: 21px;
    min-height: 21px;
    flex: 0 0 21px;
    margin: 0;
    accent-color: var(--blue);
}

/* Header */
.site-header {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 12px max(20px, calc((100vw - var(--content-width)) / 2));
    background: rgba(255, 255, 255, .97);
    border-bottom: 3px solid var(--blue);
    box-shadow: 0 10px 28px rgba(5, 5, 5, .06);
    backdrop-filter: blur(16px);
}

.header-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.header-brand img {
    width: 200px;
    height: 48px;
    object-fit: contain;
    object-position: left center;
}

.header-brand > span {
    width: 1px;
    height: 35px;
    background: var(--line);
}

.header-brand strong {
    font-size: 1.08rem;
    white-space: nowrap;
}

.user-area,
.admin-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-color {
    width: 12px;
    height: 12px;
    background: var(--user-color);
    border: 3px solid var(--paper);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--line);
}

.user-copy {
    display: grid;
    padding-right: 16px;
    text-align: right;
    border-right: 1px solid var(--line);
}

.user-copy span {
    color: var(--muted);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.user-copy strong {
    font-size: .92rem;
}

.header-action,
.admin-nav a {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 750;
    text-decoration: none;
}

.header-action:hover,
.admin-nav a:hover,
.admin-nav a[aria-current="page"] {
    color: var(--blue);
}

.logout-button {
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
    color: var(--ink) !important;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 7px;
    font-weight: 800;
    text-decoration: none;
}

.logout-button:hover {
    color: var(--paper) !important;
    background: var(--ink);
}

.logout-button svg {
    width: 18px;
    height: 18px;
}

/* Hero */
.planner-hero {
    position: relative;
    display: grid;
    width: min(calc(100% - 40px), var(--content-width));
    min-height: 390px;
    margin: 34px auto 0;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
    overflow: hidden;
    color: var(--paper);
    background: var(--ink);
    border-radius: 10px 58px 10px 10px;
    box-shadow: var(--shadow);
}

.planner-hero::before {
    position: absolute;
    inset: 0 35% 0 0;
    content: "";
    background: var(--blue);
    transform: skewX(-15deg);
    transform-origin: top;
}

.hero-pattern {
    position: absolute;
    inset: 0 32% 0 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .09) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to right, #000 72%, transparent);
}

.hero-content,
.hero-summary {
    position: relative;
    z-index: 2;
}

.hero-content {
    align-self: center;
    padding: 60px 70px;
}

.hero-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: .74rem;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.hero-kicker span {
    width: 34px;
    height: 3px;
    background: var(--paper);
}

.planner-hero h1 {
    margin-bottom: 26px;
    font-size: clamp(4rem, 7.4vw, 7rem);
    font-weight: 950;
    line-height: .79;
    text-shadow: 6px 6px 0 rgba(5, 5, 5, .8);
}

.planner-hero .hero-content > p:last-child {
    max-width: 600px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, .82);
    font-size: 1.08rem;
    line-height: 1.55;
}

.hero-summary {
    align-self: center;
    margin: 36px 42px 36px 0;
    padding: 30px;
    color: var(--ink);
    background: var(--paper);
    border-radius: 7px 34px 7px 7px;
    box-shadow: 16px 18px 0 rgba(242, 140, 24, .96);
    transform: rotate(1.5deg);
}

.hero-summary > strong {
    display: block;
    margin-bottom: 24px;
    font-size: 2.4rem;
    font-weight: 950;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.summary-grid div {
    display: grid;
    padding: 16px 10px;
    text-align: center;
    border-right: 1px solid var(--line);
}

.summary-grid div:last-child {
    border-right: 0;
}

.summary-grid span {
    color: var(--muted);
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.summary-grid b {
    margin-top: 5px;
    font-size: 1.6rem;
}

.hero-user {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.hero-user span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Planner */
.planner-section {
    width: min(calc(100% - 40px), var(--content-width));
    margin: 92px auto 100px;
}

.section-heading,
.admin-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 32px;
}

.section-heading h2 {
    margin: 0;
    padding-left: 23px;
    border-left: 7px solid var(--blue);
    font-size: clamp(3.2rem, 6vw, 6rem);
    font-weight: 950;
    line-height: .82;
}

.section-intro {
    max-width: 420px;
    margin: 0 0 6px;
    color: var(--muted);
    line-height: 1.6;
}

.planner-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
    padding: 13px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: 8px 28px 8px 8px;
    box-shadow: var(--shadow-soft);
}

.navigation-group,
.planning-legend {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navigation-group strong {
    margin-left: 8px;
    font-size: 1rem;
}

.square-button,
.text-button {
    display: inline-grid;
    min-height: 43px;
    place-items: center;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 7px;
    font-weight: 780;
    text-decoration: none;
}

.square-button {
    width: 43px;
}

.square-button svg {
    width: 20px;
    height: 20px;
}

.text-button {
    padding: 0 16px;
}

.square-button:hover,
.text-button:hover {
    color: var(--paper);
    background: var(--ink);
}

.planning-legend {
    padding-right: 12px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.planning-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-dot {
    width: 11px;
    height: 11px;
    border: 2px solid var(--line);
    border-radius: 50%;
}

.legend-dot.mine {
    background: var(--legend-color);
    border-color: var(--legend-color);
}

.planning-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 22px;
}

.planner {
    min-width: 0;
}

.planning-grid {
    position: relative;
    display: grid;
    grid-template-columns: 118px repeat(12, minmax(86px, 1fr));
    overflow: auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px 34px 8px 8px;
    box-shadow: var(--shadow);
}

.corner,
.day-head,
.half-head,
.desk-label,
.slot {
    min-height: 38px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.corner,
.day-head,
.half-head,
.desk-label {
    display: grid;
    place-items: center;
    background: var(--canvas);
    font-weight: 800;
}

.day-head,
.half-head {
    position: sticky;
    z-index: 4;
}

.day-head {
    top: 0;
    min-height: 50px;
    color: var(--paper);
    background: var(--ink);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.corner {
    position: sticky;
    z-index: 6;
    top: 0;
    left: 0;
    min-height: 50px;
    color: var(--paper);
    background: var(--blue);
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.corner.small {
    top: 50px;
    min-height: 32px;
    background: var(--ink);
}

.half-head {
    top: 50px;
    min-height: 32px;
    color: var(--muted);
    background: #f7f7f8;
    font-size: .67rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.desk-label {
    position: sticky;
    z-index: 3;
    left: 0;
    display: flex;
    min-height: 43px;
    justify-content: flex-start;
    gap: 9px;
    padding-left: 13px;
    color: #44434a;
    background: #f7f7f8;
    font-size: .8rem;
}

.desk-label span {
    color: var(--blue);
    font-size: .66rem;
    font-weight: 900;
}

.slot {
    min-width: 86px;
    min-height: 43px;
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    background: var(--paper);
    border-top: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
    text-overflow: ellipsis;
}

.slot:hover,
.slot.selected {
    background: var(--blue-soft);
    outline: 2px solid var(--blue);
    outline-offset: -2px;
    transform: none;
}

.slot.reserved {
    color: transparent;
    background: #f3f3f5;
}

.slot.reserved.mine {
    box-shadow: inset 0 0 0 2px var(--reservation-color);
}

.reservation-bar {
    position: absolute;
    z-index: 8;
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0 12px;
    color: var(--paper);
    background: var(--reservation-color);
    border: 1px solid rgba(0, 0, 0, .16);
    border-radius: 5px 14px 5px 5px;
    box-shadow: 0 8px 18px rgba(20, 28, 38, .18);
    font-size: .76rem;
    font-weight: 750;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reservation-bar.editable:hover {
    filter: saturate(1.06) brightness(.96);
    transform: translateY(-1px);
}

.side-panel {
    position: sticky;
    top: 104px;
    align-self: start;
    overflow: hidden;
    padding: 25px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px 32px 8px 8px;
    box-shadow: var(--shadow);
}

.side-panel::before {
    display: block;
    width: 76px;
    height: 6px;
    margin: -25px -25px 24px;
    content: "";
    background: var(--orange);
}

.side-panel h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 950;
}

.reservation-list {
    display: grid;
    gap: 10px;
}

.reservation-item {
    display: grid;
    width: 100%;
    min-height: 0;
    justify-content: stretch;
    justify-items: start;
    gap: 4px;
    padding: 13px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 5px 14px 5px 5px;
    box-shadow: none;
    text-align: left;
}

.reservation-item:hover {
    color: var(--paper);
    background: var(--ink);
    border-color: var(--ink);
    transform: translateX(3px);
}

.reservation-item span,
.muted,
.hint {
    color: var(--muted);
}

.reservation-item:hover span {
    color: rgba(255, 255, 255, .65);
}

.hint {
    margin: 20px 0 0;
    padding-top: 17px;
    border-top: 1px solid var(--line);
    font-size: .82rem;
    line-height: 1.5;
}

.hint strong {
    color: var(--blue);
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 5, 5, .62);
    backdrop-filter: blur(5px);
}

.modal-card {
    position: relative;
    z-index: 1001;
    display: grid;
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    gap: 17px;
    overflow-y: auto;
    padding: 30px;
    background: var(--paper);
    border-radius: 8px 38px 8px 8px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .32);
}

.modal-card::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 7px;
    content: "";
    background: var(--blue);
}

.dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 5px;
}

.dialog-heading h2 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 950;
}

.icon-close {
    width: 42px;
    min-height: 42px !important;
    padding: 0 !important;
    color: var(--ink) !important;
    background: var(--canvas) !important;
    border-color: var(--line) !important;
    border-radius: 50% !important;
    box-shadow: none !important;
}

.icon-close:hover {
    color: var(--paper) !important;
    background: var(--ink) !important;
}

.choice-group {
    display: grid;
    gap: 11px;
    padding: 18px 20px;
    background: var(--blue-soft);
    border: 1px solid rgba(59, 0, 219, .2);
    border-radius: 7px 22px 7px 7px;
}

.choice-group legend {
    padding: 0 6px;
    font-weight: 800;
}

.choice-group label.inline {
    justify-content: flex-start;
}

.modal-actions {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

button.secondary,
.btn.secondary {
    color: var(--ink);
    background: var(--paper);
    border-color: var(--line);
    box-shadow: none;
}

button.secondary:hover,
.btn.secondary:hover {
    color: var(--paper);
    background: var(--ink);
}

button.danger,
.btn.danger {
    color: var(--danger);
    background: var(--paper);
    border-color: rgba(167, 25, 25, .35);
    box-shadow: none;
}

button.danger:hover,
.btn.danger:hover {
    color: var(--paper);
    background: var(--danger);
}

/* Admin */
.admin-header {
    border-bottom-color: var(--ink);
}

.admin-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-nav a[aria-current="page"] {
    position: relative;
}

.admin-nav a[aria-current="page"]::after {
    position: absolute;
    right: 0;
    bottom: -10px;
    left: 0;
    height: 3px;
    content: "";
    background: var(--blue);
}

.admin-main {
    min-height: calc(100vh - 160px);
}

.admin-intro {
    display: flex;
    width: min(calc(100% - 40px), var(--content-width));
    min-height: 300px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    margin: 34px auto 0;
    padding: 56px 64px;
    color: var(--paper);
    background:
        linear-gradient(118deg, var(--blue) 0 61%, transparent 61%),
        var(--ink);
    border-radius: 10px 56px 10px 10px;
    box-shadow: var(--shadow);
}

.admin-intro .section-number {
    color: var(--orange);
}

.admin-intro h1 {
    margin: 0;
    font-size: clamp(4rem, 7vw, 7rem);
    font-weight: 950;
    line-height: .8;
    text-shadow: 6px 6px 0 rgba(5, 5, 5, .65);
}

.admin-intro > p {
    max-width: 400px;
    margin: 0 0 6px;
    color: rgba(255, 255, 255, .72);
    font-size: 1.05rem;
    line-height: 1.6;
}

.admin-content {
    width: min(calc(100% - 40px), var(--content-width));
    margin: 70px auto 100px;
}

.admin-section-heading {
    align-items: center;
}

.admin-section-heading h1,
.admin-section-heading h2 {
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 4rem);
    font-weight: 950;
}

.admin-section-heading p:last-child {
    margin: 8px 0 0;
    color: var(--muted);
}

.toolbar-link {
    white-space: nowrap;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.metric-card {
    position: relative;
    display: grid;
    min-height: 190px;
    align-content: space-between;
    overflow: hidden;
    padding: 27px;
    color: var(--paper);
    background: var(--blue);
    border-radius: 7px 38px 7px 7px;
    box-shadow: var(--shadow-soft);
}

.metric-card.orange {
    background: var(--orange);
}

.metric-card.dark {
    background: var(--ink);
}

.metric-card span {
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.metric-card strong {
    font-size: 5rem;
    font-weight: 950;
    line-height: 1;
}

.metric-card i {
    position: absolute;
    right: -8px;
    bottom: -31px;
    color: rgba(255, 255, 255, .12);
    font-size: 9rem;
    font-style: normal;
    font-weight: 950;
}

.quick-grid {
    display: grid;
    margin-top: 18px;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.quick-card {
    position: relative;
    display: grid;
    min-height: 160px;
    align-content: start;
    gap: 10px;
    padding: 25px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 7px 28px 7px 7px;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease;
}

.quick-card:hover {
    border-color: var(--blue);
    transform: translateY(-4px);
}

.quick-card > span {
    color: var(--blue);
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.quick-card > strong {
    max-width: 260px;
    font-size: 1.18rem;
}

.quick-card > b {
    position: absolute;
    right: 24px;
    bottom: 20px;
    color: var(--blue);
    font-size: 1.8rem;
}

.export-card p {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 7px 0 0;
}

.export-card a {
    padding: 7px 9px;
    color: var(--ink);
    background: var(--canvas);
    border-radius: 5px;
    font-size: .78rem;
    font-weight: 750;
    text-decoration: none;
}

.settings-grid {
    align-items: start;
}

.settings-card,
.data-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px 32px 8px 8px;
    box-shadow: var(--shadow-soft);
}

.settings-card {
    padding: 28px;
}

.settings-card h2 {
    margin: -6px 0 6px;
    font-size: 1.7rem;
}

.settings-card button[type="submit"] {
    margin-top: 5px;
}

.table-wrap {
    overflow-x: auto;
}

.data-card {
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

th,
td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--paper);
    background: var(--ink);
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

tbody tr {
    background: var(--paper);
    transition: background-color 160ms ease;
}

tbody tr:hover {
    background: var(--blue-soft);
}

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

td small {
    color: var(--muted);
}

.inline-delete-form,
td form {
    margin: 0;
}

.color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border: 2px solid var(--paper);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--line);
    vertical-align: -2px;
}

.site-footer {
    display: flex;
    min-height: 110px;
    align-items: center;
    gap: 24px;
    padding: 24px max(20px, calc((100vw - var(--content-width)) / 2));
    background: var(--paper);
    border-top: 1px solid var(--line);
}

.site-footer img {
    width: 190px;
    height: 54px;
    object-fit: contain;
    object-position: left center;
}

.site-footer p {
    margin: 0;
    color: var(--muted);
    font-size: .77rem;
}

.site-footer p:last-child {
    margin-left: auto;
}

@media (max-width: 1180px) {
    .site-header {
        align-items: flex-start;
    }

    .admin-header {
        flex-direction: column;
    }

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

    .planning-layout {
        grid-template-columns: 1fr;
    }

    .side-panel {
        position: static;
    }

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

@media (max-width: 980px) {
    .auth-shell {
        max-width: 680px;
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: 430px;
        border-radius: 10px 48px 0 0;
    }

    .auth-panel {
        border-radius: 0 0 48px 10px;
    }

    .planner-hero {
        grid-template-columns: 1fr;
    }

    .planner-hero::before {
        inset: 0;
        transform: none;
    }

    .hero-pattern {
        inset: 0;
    }

    .hero-summary {
        margin: 0 42px 46px;
        transform: none;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .planner-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .metric-card {
        min-height: 150px;
    }

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

@media (max-width: 760px) {
    .site-header {
        position: relative;
        align-items: flex-start;
        flex-direction: column;
    }

    .header-brand img {
        width: 170px;
    }

    .user-area {
        width: 100%;
        flex-wrap: wrap;
    }

    .user-copy {
        flex: 1;
        text-align: left;
        border-right: 0;
    }

    .planner-hero,
    .planner-section,
    .admin-intro,
    .admin-content {
        width: min(calc(100% - 24px), var(--content-width));
    }

    .hero-content {
        padding: 48px 28px;
    }

    .planner-hero h1 {
        font-size: clamp(3.5rem, 17vw, 5.7rem);
    }

    .hero-summary {
        margin: 0 20px 32px;
        padding: 24px 18px;
    }

    .section-heading h2 {
        font-size: clamp(3rem, 16vw, 5rem);
    }

    .planner-section {
        margin-top: 64px;
    }

    .planning-legend {
        flex-wrap: wrap;
    }

    .navigation-group {
        width: 100%;
        flex-wrap: wrap;
    }

    .navigation-group strong {
        width: 100%;
        margin: 8px 0 0;
    }

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

    .register-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .register-heading img {
        width: 100%;
    }

    .register-panel {
        padding: 30px 22px;
    }

    .admin-intro {
        min-height: 380px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-end;
        padding: 38px 28px;
        background:
            linear-gradient(155deg, var(--blue) 0 62%, transparent 62%),
            var(--ink);
    }

    .admin-intro h1 {
        font-size: clamp(3.7rem, 18vw, 6rem);
    }

    .admin-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .site-footer p:last-child {
        margin-left: 0;
    }
}

@media (max-width: 560px) {
    .auth-page {
        padding: 18px 12px;
    }

    .auth-brand {
        min-height: 410px;
        padding: 34px 26px;
    }

    .auth-brand img {
        margin-bottom: 28px;
    }

    .auth-brand h1 {
        font-size: clamp(3.35rem, 18vw, 4.8rem);
    }

    .auth-panel {
        padding: 36px 24px 28px;
    }

    .form-heading {
        align-items: flex-start;
    }

    .summary-grid span {
        font-size: .55rem;
    }

    .summary-grid b {
        font-size: 1.25rem;
    }

    .header-brand > span,
    .header-brand strong {
        display: none;
    }

    .logout-button span {
        display: none;
    }

    .admin-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    .admin-nav a {
        flex: 0 0 auto;
    }

    .admin-nav .logout-button {
        min-height: 36px;
    }

    .modal-card {
        padding: 25px 20px;
    }

    .modal-actions {
        grid-template-columns: 1fr;
    }

    .modal-actions > span {
        display: none;
    }

    .modal-actions .primary-button,
    .modal-actions button {
        width: 100%;
    }
}
