:root {
    color-scheme: light;
    --canvas: #efe8da;
    --paper: rgba(255, 251, 244, 0.92);
    --panel: rgba(255, 255, 255, 0.76);
    --ink: #1b2428;
    --muted: #5c6a71;
    --line: rgba(89, 103, 109, 0.22);
    --green: #0f7b57;
    --gold: #a86d12;
    --red: #b7453f;
    --blue: #1d5f8c;
    --shadow: 0 24px 60px rgba(35, 45, 50, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(15, 123, 87, 0.18), transparent 30rem),
        radial-gradient(circle at bottom right, rgba(29, 95, 140, 0.14), transparent 26rem),
        linear-gradient(140deg, #e8dfcf 0%, var(--canvas) 52%, #dee8e3 100%);
    padding: 2rem;
}

a {
    color: inherit;
}

.shell {
    width: min(1100px, 100%);
    margin: 0 auto;
}

.shell-admin {
    width: min(1500px, 100%);
}

.hero,
.panel,
.page-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-grid,
.panel-grid {
    display: grid;
    grid-template-columns: 1.5fr 0.9fr;
    gap: 2rem;
    padding: 3rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(15, 123, 87, 0.1);
    color: var(--green);
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 1rem 0;
    font-size: clamp(2.8rem, 6vw, 5.3rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
}

h2,
h3 {
    margin: 0;
}

.lead,
.copy,
.meta,
.field-help,
.notice {
    color: var(--muted);
    line-height: 1.7;
}

.hero-actions,
.card-actions,
.stack,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.button,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.8rem 1.15rem;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 0.98rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    cursor: pointer;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
}

.button-primary,
button,
input[type="submit"] {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 10px 24px rgba(27, 36, 40, 0.2);
}

.button-secondary {
    border-color: var(--line);
    color: var(--ink);
    background: rgba(255, 255, 255, 0.55);
}

.summary,
.sidebar-card,
.admin-card,
.card,
.file-list {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(247, 243, 235, 0.9));
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1.4rem;
}

.apps,
.dashboard-grid {
    margin-top: 1.6rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-grid {
    grid-template-columns: 1.2fr 0.8fr;
}

.admin-wide {
    display: grid;
    gap: 1.4rem;
    margin-top: 1.6rem;
}

.card-top,
.row-between {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
}

.badge-online {
    color: var(--green);
    background: rgba(15, 123, 87, 0.1);
    border-color: rgba(15, 123, 87, 0.18);
}

.badge-beta {
    color: var(--gold);
    background: rgba(168, 109, 18, 0.1);
    border-color: rgba(168, 109, 18, 0.18);
}

.badge-internal {
    color: var(--blue);
    background: rgba(29, 95, 140, 0.1);
    border-color: rgba(29, 95, 140, 0.18);
}

.badge-offline {
    color: var(--red);
    background: rgba(183, 69, 63, 0.1);
    border-color: rgba(183, 69, 63, 0.18);
}

.badge-neutral {
    color: var(--ink);
    background: rgba(27, 36, 40, 0.08);
    border-color: rgba(27, 36, 40, 0.12);
}

.section-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.notes,
.empty-state {
    margin-top: 1.6rem;
    padding: 1.5rem;
    background: rgba(255, 251, 244, 0.7);
    border: 1px solid var(--line);
    border-radius: 22px;
}

code {
    font-family: "Courier New", monospace;
    font-size: 0.94em;
    background: rgba(27, 36, 40, 0.06);
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
}

form {
    display: grid;
    gap: 1rem;
}

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

label {
    display: grid;
    gap: 0.45rem;
    font-size: 0.96rem;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    padding: 0.85rem 0.95rem;
    font: inherit;
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

.flash {
    padding: 1rem 1.15rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(15, 123, 87, 0.08);
}

.flash-error {
    background: rgba(183, 69, 63, 0.08);
}

.list {
    display: grid;
    gap: 0.85rem;
}

.file-list ul,
.project-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.8rem;
}

.manifest-preview {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.manifest-preview summary {
    cursor: pointer;
    font-weight: 700;
}

.manifest-preview pre {
    margin: 1rem 0 0;
    padding: 1rem;
    overflow: auto;
    white-space: pre-wrap;
    background: rgba(27, 36, 40, 0.92);
    color: #f7f1e6;
    border-radius: 14px;
    font-family: "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.6;
}

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

.manifest-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}

.manifest-table th,
.manifest-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.manifest-table th {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(27, 36, 40, 0.04);
}

.manifest-table tr:last-child td {
    border-bottom: 0;
}

.manifest-table td input {
    min-width: 180px;
}

.project-list li,
.file-list li {
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.note-attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.note-attachment-card {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.note-image {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    object-fit: cover;
}

.note-pdf-frame {
    width: 100%;
    min-height: 26rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
}

.note-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.note-toolbar-button {
    min-height: 2.4rem;
    padding: 0.45rem 0.9rem;
}

.note-underline {
    text-decoration: underline;
}

.note-size-small {
    font-size: 0.88rem;
}

.note-size-large {
    font-size: 1.18rem;
}

.note-size-xlarge {
    font-size: 1.4rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.stat-value {
    margin-top: 0.35rem;
    font-size: 2rem;
    line-height: 1;
}

@media (max-width: 920px) {
    .hero-grid,
    .panel-grid,
    .apps,
    .dashboard-grid,
    .field-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    body {
        padding: 1rem;
    }

    .hero-grid,
    .panel-grid {
        padding: 2rem;
    }
}
