:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --ink: #0d172a;
    --muted: #60708a;
    --line: #dfe6f0;
    --brand: #111a33;
    --brand-2: #1f6feb;
    --accent: #f4b942;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(31, 111, 235, 0.12), transparent 34rem),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 48%, #eef3f9 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.site-header {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-shell,
main,
.site-footer {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.nav-shell {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: white;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    font-weight: 800;
    box-shadow: var(--shadow);
}

.brand small {
    display: block;
    color: var(--muted);
    margin-top: 0.1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.nav-links a {
    text-decoration: none;
}

.nav-links form { margin: 0; }
.link-button, .danger-button { border: 0; padding: 0; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.link-button:hover { color: var(--ink); }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2rem;
    align-items: center;
    padding: 5rem 0 3rem;
}

.compact-hero h1 { font-size: clamp(2.7rem, 6vw, 4.8rem); }
.page-hero { max-width: 900px; padding: 5rem 0 2rem; }

.eyebrow {
    color: var(--brand-2);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

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

h1 {
    max-width: 760px;
    margin-bottom: 1rem;
    font-size: clamp(2.8rem, 7vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

h2 {
    font-size: clamp(1.8rem, 3vw, 2.65rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

h3 {
    font-size: 1.2rem;
}

.hero-text {
    max-width: 720px;
    color: var(--muted);
    font-size: 1.18rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.8rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
}

.button.primary {
    color: white;
    background: var(--brand);
    border-color: var(--brand);
}

.button.secondary {
    background: white;
}

.button:disabled { cursor: not-allowed; opacity: .5; }

.status-card,
.panel,
.module-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.status-card {
    padding: 1.5rem;
}

.status-pill {
    display: inline-flex;
    margin-bottom: 1.5rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    color: #0b6b3a;
    background: #dff8e9;
    font-weight: 800;
    font-size: 0.8rem;
}

.muted,
.section-heading p,
.module-card p,
.panel p {
    color: var(--muted);
    line-height: 1.65;
}

.section {
    padding: 2rem 0 3rem;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 1.5rem;
}

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

.module-card {
    display: flex;
    flex-direction: column;
    min-height: 245px;
    padding: 1.25rem;
}

.module-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.priority {
    white-space: nowrap;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    color: var(--brand);
    background: #fff4cf;
    font-size: 0.75rem;
    font-weight: 800;
}

.priority.high { color: #991b1b; background: #fee2e2; }
.priority.normal { color: #854d0e; background: #fef3c7; }
.priority.low { color: #334155; background: #e2e8f0; }

.module-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.module-meta a {
    color: var(--brand-2);
    font-weight: 800;
    text-decoration: none;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.panel {
    padding: 1.5rem;
}

.panel.dark {
    color: white;
    background: linear-gradient(135deg, var(--brand), #22345f);
}

.panel.dark .eyebrow,
.panel.dark p {
    color: rgba(255, 255, 255, 0.76);
}

.next-list {
    color: var(--muted);
    line-height: 1.8;
    padding-left: 1.25rem;
}

.flash-stack { display: grid; gap: .5rem; padding-top: 1rem; }
.flash { padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.flash.success { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.flash.error { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.login-shell { min-height: 70vh; display: grid; place-items: center; padding: 3rem 0; }
.login-card { width: min(100%, 520px); padding: 2rem; background: white; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.login-card h1 { font-size: clamp(2.3rem, 8vw, 4rem); }
.stack-form { display: grid; gap: .75rem; }
.stack-form label { color: var(--ink); font-size: .9rem; font-weight: 800; }
.stack-form input, .stack-form textarea, .stack-form select { width: 100%; padding: .8rem .9rem; color: var(--ink); background: white; border: 1px solid #cbd5e1; border-radius: 12px; font: inherit; }
.stack-form input:focus, .stack-form textarea:focus, .stack-form select:focus { outline: 3px solid rgba(31, 111, 235, .2); border-color: var(--brand-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-row > div { display: grid; gap: .5rem; }
.action-layout { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr); gap: 1rem; align-items: start; }
.action-list { display: grid; gap: .75rem; }
.action-item, .empty-state { padding: 1.25rem; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.action-item { display: flex; justify-content: space-between; gap: 1rem; }
.action-item h3 { margin: .65rem 0 .3rem; }
.action-item p { margin-bottom: 0; color: var(--muted); white-space: pre-wrap; }
.action-item.complete { opacity: .68; }
.action-item.complete h3 { text-decoration: line-through; }
.action-heading, .item-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.item-actions { align-self: center; justify-content: flex-end; }
.item-actions .button { min-height: 38px; padding: .5rem .8rem; }
.danger-button { color: #b91c1c; font-weight: 800; }
.empty-state { text-align: center; color: var(--muted); }

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 0;
    color: var(--muted);
    font-size: 0.92rem;
}

@media (max-width: 860px) {
    .hero,
    .two-column,
    .action-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 620px) {
    .nav-shell,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    .hero {
        padding-top: 3rem;
    }

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

    .form-row { grid-template-columns: 1fr; }
    .action-item { flex-direction: column; }
    .item-actions { justify-content: flex-start; }
}
