:root {
    --bg: #f4efe4;
    --surface: #fffdf7;
    --surface-strong: #ffffff;
    --text: #17211c;
    --muted: #5f6a63;
    --accent: #0f766e;
    --accent-soft: #dbf2ef;
    --border: #d7d0c1;
    --danger: #8f2d21;
    --success: #1f6b3b;
    --shadow: 0 20px 60px rgba(23, 33, 28, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.14), transparent 28%),
        linear-gradient(180deg, #f7f0e1 0%, #f4efe4 100%);
    color: var(--text);
}

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

a:hover {
    text-decoration: underline;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(215, 208, 193, 0.7);
    backdrop-filter: blur(16px);
    background: rgba(255, 253, 247, 0.85);
}

.header-inner,
.page-head,
.actions,
.hero,
.auth-layout,
.grid.two,
.stats-grid,
.quick-links {
    display: grid;
    gap: 1rem;
}

.header-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    color: inherit;
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand span {
    display: grid;
}

.brand small,
.muted {
    color: var(--muted);
}

.brand-mark {
    width: 2.8rem;
    height: 2.8rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #14532d);
    color: white;
    font-weight: 700;
}

.top-nav {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

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

.hero {
    grid-template-columns: 1.5fr 1fr;
    align-items: stretch;
    padding: 2rem 0;
}

.hero h1,
.auth-layout h1,
.page-head h1 {
    margin: 0.2rem 0 0.8rem;
    font-size: clamp(2rem, 3vw, 3.4rem);
    line-height: 1.05;
}

.lead {
    font-size: 1.05rem;
    max-width: 60ch;
    color: var(--muted);
}

.hero-card,
.panel,
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.hero-card,
.panel {
    padding: 1.4rem;
}

.hero-card {
    background: linear-gradient(180deg, #fefefe 0%, #f7faf8 100%);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.15rem;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.button:hover {
    text-decoration: none;
    filter: brightness(1.05);
}

.button.subtle {
    background: var(--accent-soft);
    color: var(--accent);
}

.actions {
    grid-auto-flow: column;
    justify-content: start;
}

.actions form,
.table-action {
    display: inline-flex;
}

.bulk-toolbar {
    margin-bottom: 1rem;
}

.table-action {
    margin-top: 0.45rem;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

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

.auth-layout .accent {
    background: linear-gradient(180deg, #effcf8 0%, #e3f3ef 100%);
}

.page-head {
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-bottom: 1.25rem;
}

.page-head.compact {
    margin-bottom: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.25rem;
}

.stat-card {
    padding: 1.1rem 1.2rem;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.stat-card strong {
    font-size: 1.65rem;
}

.quick-links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.25rem;
}

.link-card {
    text-align: center;
    font-weight: 600;
}

.link-card:hover {
    text-decoration: none;
    border-color: var(--accent);
}

.form-grid,
.stack {
    display: grid;
    gap: 1rem;
}

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

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

label span {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

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

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
}

textarea {
    resize: vertical;
}

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

th,
td {
    padding: 0.85rem 0.6rem;
    border-bottom: 1px solid rgba(215, 208, 193, 0.75);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.simple-list,
.detail-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.simple-list li + li,
.detail-list dt + dd,
.detail-list dd + dt {
    margin-top: 0.7rem;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 700;
}

.detail-list dd {
    margin-left: 0;
}

.notice,
.receipt-link {
    display: block;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(15, 118, 110, 0.08);
}

.receipt-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.receipt-link:hover {
    text-decoration: none;
}

.pill {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: #ece7da;
    color: var(--text);
    font-size: 0.85rem;
}

.flash-stack {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.flash {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid transparent;
}

.flash.success {
    background: #e6f7eb;
    border-color: #b6e2c3;
    color: var(--success);
}

.flash.danger {
    background: #faece8;
    border-color: #efc3b8;
    color: var(--danger);
}

.flash.info,
.flash.warning {
    background: #eef5fb;
    border-color: #c7dcec;
    color: #215677;
}

.receipt-sheet {
    max-width: 880px;
    margin: 0 auto;
    padding: 1.75rem;
    border-radius: 26px;
    background: white;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.receipt-top,
.receipt-grid {
    display: grid;
    gap: 1rem;
}

.receipt-top {
    grid-template-columns: 1fr auto;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.receipt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.receipt-grid dt {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.receipt-grid dd {
    margin: 0;
    font-weight: 600;
}

.receipt-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.form-note {
    color: var(--muted);
    font-size: 0.95rem;
}

.pagination {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.checkbox-cell {
    width: 3rem;
}

.top-gap {
    margin-top: 1rem;
}

.right {
    text-align: right;
}

@media (max-width: 900px) {
    .hero,
    .auth-layout,
    .grid.two,
    .page-head,
    .stats-grid,
    .quick-links,
    .form-grid.two-cols,
    .receipt-top,
    .receipt-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        grid-auto-flow: row;
    }

    .top-nav {
        justify-content: start;
    }
}

@media print {
    .site-header,
    .flash-stack,
    .actions,
    .button {
        display: none !important;
    }

    body {
        background: white;
    }

    .page,
    .receipt-sheet {
        padding: 0;
        box-shadow: none;
        border: none;
    }
}
