:root {
    --bg: #f6f1e8;
    --card: #fffaf4;
    --ink: #1f2a24;
    --muted: #647067;
    --line: #dfd2bf;
    --accent: #d46a4b;
    --accent-dark: #9e4229;
    --secondary: #436b5d;
    --good: #2f7a55;
    --shadow: 0 18px 40px rgba(89, 67, 39, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Avenir Next", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(212, 106, 75, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(67, 107, 93, 0.14), transparent 20%),
        linear-gradient(180deg, #fcf7ef 0%, var(--bg) 100%);
    min-height: 100vh;
}

.site-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 2rem 2.5rem 1rem;
    flex-wrap: wrap;
}

.site-header h1,
.hero-card h2,
.panel h2,
.panel h3 {
    font-family: Georgia, "Times New Roman", serif;
    margin: 0;
}

.site-header-logo {
    width: min(100%, 260px);
    height: auto;
    display: block;
}

.site-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #ece5d8;
    font-weight: 700;
}

.page-shell {
    padding: 0 2.5rem 2.5rem;
}

.hero-card,
.panel,
.note-card {
    background: var(--card);
    border: 1px solid rgba(223, 210, 191, 0.8);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

.filter-row,
.action-stack,
.table-actions,
.print-toolbar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

.custom-list {
    display: grid;
    gap: 0.55rem;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

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

.button-secondary {
    background: var(--secondary);
    color: white;
}

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

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

.summary-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    text-decoration: none;
    color: var(--ink);
    background: white;
}

.summary-card-static {
    text-decoration: none;
}

.panel {
    padding: 1.5rem;
}

.login-panel {
    max-width: 560px;
    margin: 3rem auto 0;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-logo {
    width: min(100%, 320px);
    height: auto;
}

.eyebrow,
.muted,
.list-row p,
.report-card small {
    color: var(--muted);
}

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

.flash {
    padding: 1rem 1.2rem;
    border-radius: 16px;
}

.flash-success {
    background: #edf8f1;
    border: 1px solid #cfead8;
}

.flash-error {
    background: #fff0eb;
    border: 1px solid #f3c7b9;
}

label {
    display: grid;
    gap: 0.45rem;
    font-weight: 600;
}

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

textarea {
    resize: vertical;
}

.checkbox-row {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.checkbox-row input {
    width: auto;
}

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

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

th,
td {
    text-align: left;
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--line);
}

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

.check-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1rem;
    display: grid;
    gap: 0.55rem;
}

.check-card label {
    grid-template-columns: auto 1fr;
    align-items: center;
    font-weight: 500;
}

.check-card input {
    width: auto;
}

.remarks-box {
    margin-top: 0.5rem;
}

.remarks-box summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--secondary);
}

.remarks-box textarea {
    margin-top: 0.75rem;
}

.report-card {
    display: grid;
    gap: 0.15rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    text-decoration: none;
    color: var(--ink);
}

.student-link {
    color: inherit;
    text-decoration: none;
}

.student-link:hover {
    text-decoration: underline;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--line);
}

.list-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.report-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-block;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    background: #ece5d8;
}

.status-good {
    background: #e5f5eb;
    color: var(--good);
}

.incident-card {
    border: 1px solid #e0b5a6;
    background: #fff3ee;
}

.person-strip,
.picture-pair {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.picture-pair-wrap {
    flex-wrap: wrap;
}

.picture-pair-large {
    margin-bottom: 1.25rem;
}

.avatar {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #f3eadf;
}

.avatar-large {
    width: 72px;
    height: 72px;
}

.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--secondary);
}

.report-photo {
    width: 180px;
    max-width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #f3eadf;
}

.button-small {
    padding: 0.6rem 0.9rem;
    font-size: 0.92rem;
}

.print-page {
    background: white;
}

.inline-password-form {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

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

    body,
    .print-page {
        background: white;
    }

    .page-shell {
        padding: 0;
    }

    .panel,
    .note-card {
        box-shadow: none;
    }
}

.note-card {
    padding: 1.25rem;
}

.inset-panel {
    margin-top: 1.5rem;
}

@media (max-width: 800px) {
    .page-shell,
    .site-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }

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