:root {
    --ink: #122033;
    --muted: #66758a;
    --line: #dbe3ec;
    --soft: #f4f7fa;
    --paper: #ffffff;
    --brand: #1579b7;
    --brand-dark: #0d4060;
    --accent: #1fbf8f;
    --danger: #c2410c;
    --ok: #047857;
    --shadow: 0 18px 48px rgba(10, 35, 60, .12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

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

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 800;
    text-decoration: none;
}

.brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--brand);
    border-radius: 8px;
    font-weight: 900;
}

.side-menu {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: 18px 14px;
    background: var(--paper);
    border-right: 1px solid var(--line);
    box-shadow: 14px 0 34px rgba(10, 35, 60, .08);
    overflow-y: auto;
}

.app-frame {
    min-height: 100vh;
    margin-left: 260px;
}

.drawer-head {
    display: flex;
    align-items: center;
    min-height: 52px;
    margin-bottom: 16px;
    color: var(--ink);
    font-weight: 850;
}

.side-menu a,
.link-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 9px 10px;
    text-decoration: none;
}

.side-menu a,
.side-menu .link-button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
}

.side-menu form {
    margin: 0;
}

.side-menu a:hover,
.side-menu .link-button:hover {
    background: var(--soft);
}

.side-menu a:hover,
.link-button:hover {
    color: var(--brand);
}

.hero-landing {
    min-height: 82vh;
    display: grid;
    align-items: center;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(5, 17, 34, .95) 0%, rgba(5, 17, 34, .84) 45%, rgba(5, 17, 34, .34) 100%),
        url("/images/tutor-ai-hero.png") center right / cover no-repeat;
}

.hero-copy {
    max-width: 680px;
    padding: 68px 0 84px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    color: #dff8ff;
    background: rgba(255, 255, 255, .08);
    font-size: 14px;
    font-weight: 800;
}

.hero-copy h1 {
    margin: 18px 0 12px;
    max-width: 640px;
    font-size: clamp(42px, 7vw, 82px);
    line-height: .94;
    letter-spacing: 0;
}

.lead {
    max-width: 620px;
    color: #d6e8f2;
    font-size: clamp(18px, 2vw, 22px);
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 16px;
    color: #fff;
    background: var(--brand);
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: #0e6aa2;
}

.btn.secondary {
    color: #e7f6fb;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .28);
}

.btn.light {
    color: var(--brand-dark);
    background: #fff;
    border-color: var(--line);
}

.btn.danger {
    background: var(--danger);
}

.landing-band {
    padding: 54px 0;
    background: #fff;
}

.landing-band.alt {
    background: var(--soft);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.section-heading h2,
.page-title h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08;
    letter-spacing: 0;
}

.section-heading p,
.page-title p {
    margin: 8px 0 0;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 18px;
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 10px 28px rgba(20, 45, 70, .07);
}

.plan-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 24px;
}

.plan-card.featured {
    border-color: rgba(21, 121, 183, .5);
    box-shadow: var(--shadow);
}

.plan-card h3 {
    margin: 10px 0 8px;
    font-size: 24px;
    letter-spacing: 0;
}

.plan-card p {
    color: var(--muted);
}

.price {
    margin: 12px 0;
    font-size: 34px;
    font-weight: 900;
    color: var(--brand);
}

.list {
    display: grid;
    gap: 10px;
    margin: 18px 0 22px;
    padding: 0;
    list-style: none;
}

.list li {
    display: flex;
    gap: 10px;
    color: #334155;
}

.check {
    color: var(--accent);
    font-weight: 900;
}

.tag {
    width: fit-content;
    border-radius: 999px;
    padding: 5px 10px;
    background: #e8f7fb;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 850;
}

.video-frame {
    overflow: hidden;
    border-radius: 8px;
    background: #071c31;
    aspect-ratio: 16 / 9;
}

.video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.footer {
    padding: 28px 0;
    color: var(--muted);
    background: #fff;
    border-top: 1px solid var(--line);
}

.app-main {
    padding: 28px 0 56px;
}

.page-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
    margin: 0;
    font-size: 18px;
}

.panel-body {
    padding: 18px;
}

.metric {
    padding: 18px;
}

.metric strong {
    display: block;
    font-size: 30px;
    line-height: 1;
}

.metric span {
    color: var(--muted);
    font-weight: 700;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: #44546a;
    background: #f8fafc;
    font-size: 12px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 3px 9px;
    background: #e8eef4;
    color: #334155;
    font-size: 12px;
    font-weight: 850;
}

.status.sent,
.status.processed,
.status.available {
    color: var(--ok);
    background: #e7f7ef;
}

.status.failed,
.status.void {
    color: var(--danger);
    background: #fff1e8;
}

.status.assigned {
    color: #075985;
    background: #e0f2fe;
}

.status.pending,
.status.received,
.status.reserved {
    color: #92400e;
    background: #fef3c7;
}

.status.ignored {
    color: #4b5563;
    background: #f3f4f6;
}

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

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

.field.full {
    grid-column: 1 / -1;
}

label {
    color: #344256;
    font-size: 13px;
    font-weight: 850;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    padding: 10px 12px;
}

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

.code-area {
    min-height: 420px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.45;
}

.check-row {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 15px;
}

.check-row input {
    width: auto;
}

.checkbox-field {
    align-content: start;
}

.filters {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.billing-filters {
    grid-template-columns: minmax(220px, 1.5fr) minmax(180px, 1fr) minmax(140px, .8fr) minmax(160px, .9fr) minmax(130px, .7fr) minmax(130px, .7fr) auto;
}

.alert {
    margin-bottom: 18px;
    border: 1px solid #badbcc;
    border-radius: 8px;
    padding: 12px 14px;
    color: #0f5132;
    background: #d1e7dd;
}

.alert.error {
    border-color: #f5c2c7;
    color: #842029;
    background: #f8d7da;
}

.muted {
    color: var(--muted);
}

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

.inline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.code-preview {
    white-space: pre-wrap;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
}

code {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 7px;
    background: #f8fafc;
    color: #0f3d5c;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 0;
}

.auth-card {
    width: min(440px, 100%);
    padding: 24px;
}

@media (max-width: 900px) {
    .side-menu {
        width: 88px;
        align-items: center;
        padding: 12px 8px;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        box-shadow: 10px 0 24px rgba(10, 35, 60, .08);
    }

    .side-menu .drawer-head {
        justify-content: center;
        min-height: 50px;
        margin-bottom: 10px;
    }

    .side-menu .brand {
        justify-content: center;
    }

    .side-menu .brand > span:last-child {
        display: none;
    }

    .side-menu a,
    .side-menu .link-button {
        justify-content: center;
        width: 100%;
        min-height: 42px;
        padding: 10px 6px;
        font-size: 13px;
    }

    .side-menu form {
        width: 100%;
    }

    .app-frame {
        margin-left: 88px;
    }

    .auth-wrap {
        min-height: 100vh;
        padding: 22px 12px;
    }

    .grid.three,
    .grid.two,
    .grid.four,
    .form-grid,
    .filters {
        grid-template-columns: 1fr;
    }

    .hero-landing {
        min-height: 76vh;
        background-position: center;
    }

    .hero-copy {
        padding-top: 48px;
    }

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

@media (max-width: 560px) {
    .shell {
        width: min(100% - 22px, 1180px);
    }

    .auth-card {
        padding: 22px;
    }

    .page-title h1 {
        font-size: 32px;
    }

    .hero-copy h1 {
        font-size: 42px;
    }

    .btn {
        width: 100%;
    }
}
