:root {
    color-scheme: light;
    --page: #f3f5f2;
    --surface: #ffffff;
    --surface-soft: #f7f8f6;
    --ink: #18221d;
    --muted: #66716b;
    --line: #dde3df;
    --line-strong: #cdd6d0;
    --accent: #1f5c45;
    --accent-hover: #174735;
    --accent-soft: #e8f2ed;
    --pdf: #bd4437;
    --pdf-soft: #faebe8;
    --danger: #a33b31;
    --danger-soft: #fff0ed;
    --shadow: 0 18px 55px rgba(26, 45, 35, 0.08);
    --radius-large: 22px;
    --radius-medium: 12px;
    --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--page);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(31, 92, 69, 0.08), transparent 28rem),
        var(--page);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

svg {
    display: block;
}

.page-shell {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 72px 0 36px;
}

.page-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    margin-bottom: 32px;
}

.brand-mark {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    color: #ffffff;
    background: var(--accent);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(31, 92, 69, 0.2);
}

.header-copy {
    min-width: 0;
}

.eyebrow {
    margin: 1px 0 5px;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 6px;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 720;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.intro {
    max-width: 630px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.02rem;
}

.document-count {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    padding: 9px 13px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(31, 92, 69, 0.12);
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 680;
    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #2b9369;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(43, 147, 105, 0.12);
}

.document-panel {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(24, 34, 29, 0.07);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
    margin-bottom: 2px;
    font-size: 1.12rem;
    font-weight: 720;
    letter-spacing: -0.02em;
}

.panel-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.file-type {
    display: inline-flex;
    padding: 5px 9px;
    color: var(--pdf);
    background: var(--pdf-soft);
    border-radius: 7px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

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

thead {
    background: var(--surface-soft);
}

th,
td {
    padding: 17px 28px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 730;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}

th:first-child,
td:first-child {
    width: 48%;
}

th:nth-child(2),
td:nth-child(2) {
    width: 17%;
}

th:last-child,
td:last-child {
    width: 35%;
}

.actions-heading {
    padding-left: 32px;
}

tbody tr {
    border-top: 1px solid var(--line);
    transition: background-color 150ms ease;
}

tbody tr:first-child {
    border-top: 0;
}

tbody tr:hover {
    background: #fbfcfb;
}

.file-cell {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 13px;
}

.pdf-icon {
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 46px;
    place-items: center;
    color: var(--pdf);
    background: var(--pdf-soft);
    border: 1px solid rgba(189, 68, 55, 0.12);
    border-radius: 9px;
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.035em;
}

.file-details {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.filename {
    overflow: hidden;
    color: var(--ink);
    font-size: 0.94rem;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.76rem;
}

time {
    color: #455149;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 680;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:focus-visible {
    outline: 3px solid rgba(31, 92, 69, 0.24);
    outline-offset: 2px;
}

.button--primary {
    color: #ffffff;
    background: var(--accent);
}

.button--primary:hover {
    background: var(--accent-hover);
}

.button--secondary {
    color: #39453e;
    background: var(--surface);
    border-color: var(--line-strong);
}

.button--secondary:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: rgba(31, 92, 69, 0.22);
}

.state-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 260px;
    padding: 42px;
    text-align: left;
}

.state-icon {
    display: grid;
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    place-items: center;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 800;
}

.state-message h3 {
    margin-bottom: 4px;
    font-size: 1rem;
}

.state-message p {
    max-width: 500px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.state-message--error .state-icon {
    color: var(--danger);
    background: var(--danger-soft);
}

.page-footer {
    padding: 20px 4px 0;
}

.page-footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

@media (max-width: 850px) {
    .page-shell {
        width: min(100% - 28px, 760px);
        padding-top: 42px;
    }

    th,
    td {
        padding-right: 20px;
        padding-left: 20px;
    }

    th:first-child,
    td:first-child {
        width: 42%;
    }

    th:nth-child(2),
    td:nth-child(2) {
        width: 18%;
    }

    th:last-child,
    td:last-child {
        width: 40%;
    }

    .actions-heading {
        padding-left: 24px;
    }
}

@media (max-width: 700px) {
    .page-header {
        grid-template-columns: auto minmax(0, 1fr);
        margin-bottom: 24px;
    }

    .document-count {
        grid-column: 2;
        justify-self: start;
        margin-top: 0;
    }

    .panel-heading {
        padding: 20px;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 18px 14px;
        padding: 20px;
    }

    tbody td,
    tbody td:first-child,
    tbody td:nth-child(2),
    tbody td:last-child {
        width: auto;
        padding: 0;
    }

    tbody td:first-child {
        grid-column: 1 / -1;
    }

    tbody td:nth-child(2) {
        align-self: center;
    }

    tbody td:nth-child(2)::before {
        display: block;
        margin-bottom: 2px;
        color: var(--muted);
        content: attr(data-label);
        font-size: 0.64rem;
        font-weight: 730;
        letter-spacing: 0.065em;
        text-transform: uppercase;
    }

    .actions {
        justify-content: flex-end;
    }

    .state-message {
        min-height: 230px;
        padding: 34px 24px;
    }
}

@media (max-width: 500px) {
    .page-shell {
        width: min(100% - 20px, 470px);
        padding-top: 26px;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    h1 {
        font-size: 2rem;
    }

    .intro {
        font-size: 0.93rem;
    }

    .document-panel {
        border-radius: 16px;
    }

    tbody tr {
        grid-template-columns: 1fr;
    }

    tbody td:first-child {
        grid-column: auto;
    }

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

    .button {
        min-height: 43px;
    }

    .state-message {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    body {
        background: #ffffff;
    }

    .page-shell {
        width: 100%;
        padding: 20px;
    }

    .document-panel {
        box-shadow: none;
    }

    .actions,
    .page-footer {
        display: none;
    }
}
