:root {
    --sand: #f5efe2;
    --paper: #fffdf8;
    --ink: #1f2328;
    --muted: #69707d;
    --line: #d6d0c3;
    --brand: #0d5c63;
    --brand-soft: #cfe7e9;
    --accent: #bb9457;
    --danger: #c0392b;
    --success: #2d6a4f;
    --shadow: 0 16px 40px rgba(31, 35, 40, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(187, 148, 87, 0.18), transparent 24%),
        linear-gradient(180deg, #f8f3e9 0%, #ece8df 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

input,
select,
button {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 24px;
    background: rgba(255, 253, 248, 0.88);
    border-right: 1px solid rgba(214, 208, 195, 0.9);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand), #1c7c54);
}

.muted {
    color: var(--muted);
    font-size: 0.92rem;
}

.user-badge,
.flash,
.phase-head,
.inner-card {
    border-radius: 16px;
}

.user-badge {
    padding: 14px;
    margin-bottom: 16px;
    background: rgba(207, 231, 233, 0.55);
}

.nav-links {
    display: grid;
    gap: 8px;
}

.nav-links a {
    padding: 12px 14px;
    border-radius: 14px;
    transition: 0.2s ease;
}

.nav-links a:hover {
    background: var(--brand-soft);
    transform: translateX(3px);
}

.content {
    padding: 28px;
}

.flash {
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.92);
}

.flash-success {
    border-color: rgba(45, 106, 79, 0.35);
    color: var(--success);
}

.flash-error {
    border-color: rgba(192, 57, 43, 0.35);
    color: var(--danger);
}

.hero,
.panel-row,
.page-header,
.card-head,
.decision-bar,
.report-banner,
.report-meta-row,
.report-centerline,
.report-totals-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hero {
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(13, 92, 99, 0.97), rgba(28, 124, 84, 0.93));
    color: white;
    box-shadow: var(--shadow);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    opacity: 0.86;
}

.hero h1,
.page-header h1 {
    margin: 0 0 12px;
    line-height: 1.1;
}

.lead {
    max-width: 60ch;
}

.hero-panel,
.glass-panel,
.card,
.table-card,
.report-sheet {
    background: rgba(255, 253, 248, 0.9);
    border: 1px solid rgba(214, 208, 195, 0.92);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero-panel {
    min-width: 280px;
    padding: 18px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.button {
    background: var(--accent);
    color: white;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
}

.button-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

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

.stat-grid,
.card-grid,
.field-grid,
.metric-strip {
    display: grid;
    gap: 16px;
}

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

.stat-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-card strong {
    display: block;
    font-size: 1.35rem;
    margin-bottom: 6px;
}

.card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 24px;
}

.card,
.table-card,
.glass-panel {
    padding: 22px;
}

.card-active {
    outline: 2px solid var(--accent);
}

.pill,
.summary-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
    font-size: 0.85rem;
}

.summary-chip {
    background: white;
    border: 1px solid var(--line);
}

.text-link {
    color: var(--brand);
    font-weight: 600;
}

.page-header {
    margin-bottom: 20px;
}

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

.narrow-card {
    max-width: 720px;
}

.check-list {
    margin: 12px 0 0;
    padding-left: 18px;
}

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

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

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

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

.card-span {
    grid-column: 1 / -1;
}

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

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

.single-column {
    grid-template-columns: 1fr;
}

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

.form-actions {
    align-self: end;
}

.field-grid input,
.field-grid select {
    border: 1px solid var(--line);
    background: white;
    border-radius: 14px;
    padding: 12px 14px;
}

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

.check-section + .check-section {
    margin-top: 20px;
}

.phase-head {
    margin: 16px 0 8px;
    padding: 10px 14px;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
}

.check-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
}

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

.check-actions input[type="text"],
.check-actions input:not([type]) {
    min-width: 0;
}

.inline-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.inner-card {
    margin-top: 16px;
    padding: 0;
    box-shadow: none;
}

.operation-panel[data-hidden="true"] {
    display: none;
}

.metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.metric-strip > div {
    padding: 16px;
    border-radius: 18px;
    background: var(--sand);
}

.report-sheet {
    padding: 20px;
}

.report-logo {
    width: 140px;
    min-width: 140px;
    height: 140px;
    border: 2px solid #111;
    display: grid;
    place-items: center;
    font-size: 2.2rem;
    font-weight: 700;
}

.report-title-wrap {
    flex: 1;
}

.report-title-wrap h1 {
    margin: 0;
    padding: 20px;
    border: 2px solid #111;
    border-bottom: 0;
    text-align: center;
}

.report-meta-row > div {
    flex: 1;
    padding: 18px;
    border: 2px solid #111;
    text-align: center;
    font-size: 1.2rem;
}

.report-facts,
.report-grouping {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin: 14px 0;
}

.report-centerline {
    justify-content: center;
    margin: 10px 0;
}

.report-table th {
    border-top: 2px solid #111;
    border-bottom: 2px solid #111;
    white-space: nowrap;
}

.report-totals {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .card-grid,
    .two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .content {
        padding: 16px;
    }

    .hero,
    .page-header,
    .report-banner,
    .report-meta-row,
    .panel-row,
    .check-row,
    .decision-bar {
        display: grid;
    }

    .field-grid,
    .metric-strip,
    .check-actions {
        grid-template-columns: 1fr;
    }

    .report-logo {
        width: 100%;
        min-width: 0;
        height: 100px;
    }
}
