:root {
  --green: #173d35;
  --green-soft: #23584d;
  --gold: #b38648;
  --paper: #f7f4ed;
  --panel: #fffdf8;
  --ink: #26332f;
  --muted: #68736d;
  --line: #dcd8ce;
  --error: #a95142;
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(circle at 10% 0%, #e9ddc4, transparent 35%), linear-gradient(135deg, var(--paper), #e8f0eb); font-family: Arial, sans-serif; }
a { color: var(--green-soft); }
.auth-shell { width: min(520px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0; }
.auth-logo { display: block; width: 110px; height: auto; margin: 0 auto 6px; }
.brand-logo { width: 34px; height: 34px; vertical-align: middle; margin-right: 8px; }
.brand { display: inline-block; color: var(--green); font: 700 1rem Georgia, serif; text-decoration: none; }
.auth-card { margin-top: 28px; padding: clamp(24px, 6vw, 42px); border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 253, 248, .92); box-shadow: 0 18px 48px rgba(23, 61, 53, .1); }
.eyebrow { margin: 0 0 8px; color: var(--gold); font: 700 .74rem Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; color: var(--green); font: 700 clamp(2rem, 7vw, 3.4rem)/1 Georgia, serif; letter-spacing: -.03em; }
.lead { color: var(--muted); line-height: 1.55; }
form { display: grid; gap: 15px; margin-top: 24px; }
label { display: grid; gap: 6px; color: var(--green); font-weight: 700; font-size: .86rem; }
input, select { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; font: inherit; }
textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; font: inherit; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(179, 134, 72, .24); border-color: var(--gold); }
button { padding: 12px 15px; border: 0; border-radius: 5px; color: #fffdf8; background: var(--green); font: 700 .9rem Arial, sans-serif; cursor: pointer; }
button:hover { background: var(--green-soft); }
.form-message { min-height: 20px; margin: 0; color: var(--muted); font-size: .9rem; }
.form-message.error { color: var(--error); }
.form-message.success { color: var(--green-soft); }
.auth-links { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 20px; font-size: .9rem; }
.auth-links a { text-decoration: none; }
.dashboard { width: min(900px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.dashboard-header button { background: var(--gold); }
.dashboard-actions { display: flex; align-items: center; gap: 14px; }
.dashboard-actions a { font-weight: 700; text-decoration: none; }
.dashboard-panel { margin-top: 28px; padding: 28px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 253, 248, .9); }
.dashboard-panel p { color: var(--muted); line-height: 1.55; }
.admin-kicker { margin-top: 14px; }
.admin-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-form button, .admin-form .form-message { grid-column: 1 / -1; }
.dashboard-panel h2 { margin: 0; color: var(--green); font: 700 1.5rem Georgia, serif; }
.checkbox-label { display: flex; align-items: center; gap: 8px; }
.checkbox-label input { width: auto; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.filter-label { min-width: 200px; }
.section-heading h2 { margin: 0; color: var(--green); font: 700 1.5rem Georgia, serif; }
.table-wrap { margin-top: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--green); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; }
.status-pill { padding: 4px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.status-pill.active { color: var(--green-soft); background: #dcefe6; }
.status-pill.inactive { color: var(--error); background: #f7dfda; }
.status-pill.pending { color: #7a5a18; background: #f6e9cd; }
.status-pill.late { color: #8a5a20; background: #f3ddbb; }
.muted-cell { color: var(--muted); }
.safety-flag { display: block; margin-top: 4px; color: var(--error); font-size: .76rem; font-weight: 700; white-space: normal; max-width: 260px; }
.alert-panel { border-left: 4px solid var(--gold); }
.alert-list { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.alert-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.alert-text { flex: 1 1 260px; font-size: .9rem; }
.alert-action { color: var(--muted); font-size: .78rem; }
.offline-banner { padding: 10px 16px; color: #fffdf8; background: var(--error); font: 700 .86rem Arial, sans-serif; text-align: center; }
.full-width { grid-column: 1 / -1; }
.notice-list { display: grid; gap: 14px; margin-top: 18px; }
.notice-card { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.notice-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.notice-meta { color: var(--muted); font-size: .8rem; }
.notice-card h3 { margin: 10px 0 6px; color: var(--green); font: 700 1.05rem Georgia, serif; }
.notice-card p { margin: 0; color: var(--ink); font-size: .9rem; line-height: 1.55; white-space: pre-wrap; }
.notice-action:not(:empty) { margin-top: 14px; }
.link-button { display: inline-block; padding: 11px 15px; border-radius: 5px; color: #fffdf8; background: var(--green); font: 700 .88rem Arial, sans-serif; text-decoration: none; }
.link-button:hover { background: var(--green-soft); color: #fffdf8; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-top: 18px; }
.kpi-card { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.kpi-value { margin: 0; color: var(--green); font: 700 1.9rem Georgia, serif; line-height: 1.1; }
.kpi-label { margin: 6px 0 0; color: var(--ink); font-size: .86rem; font-weight: 700; }
.kpi-hint { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.header-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.job-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 12px 0 0; }
.job-detail dt { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.job-detail dd { margin: 2px 0 0; font-size: .88rem; font-weight: 700; }
.callout-box { margin-top: 18px; padding: 16px 18px; border-left: 4px solid var(--gold); border-radius: 6px; background: #fbf4e6; }
.callout-box p { margin: 0 0 6px; }
.tracking-code { font: 700 1.5rem/1.2 Georgia, serif; letter-spacing: .12em; color: var(--green); }
.application-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 14px; }
.application-controls .note-input { flex: 1 1 220px; }
.app-dialog { width: min(440px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); }
.app-dialog::backdrop { background: rgba(23, 61, 53, .45); }
.app-dialog h3 { margin: 0 0 6px; color: var(--green); font: 700 1.15rem Georgia, serif; }
.app-dialog form { margin-top: 0; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ghost-button { color: var(--green); background: transparent; border: 1px solid var(--line); }
.ghost-button:hover { color: #fffdf8; background: var(--muted); }
.table-action { padding: 7px 9px; font-size: .76rem; }
.status-select, .note-input, .score-input { padding: 7px 9px; font-size: .84rem; }
.score-input { width: 100px; }
.name-input { width: 100%; min-width: 140px; }
.actions-cell { display: flex; gap: 8px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 20px; }
.student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 18px; }
.student-card { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.student-card h3 { margin: 0 0 12px; color: var(--green); font: 700 1.1rem Georgia, serif; }
.student-card dl { display: grid; gap: 8px; margin: 0; }
.student-card dl div { display: flex; justify-content: space-between; gap: 12px; }
.student-card dt { color: var(--muted); font-size: .8rem; }
.student-card dd { margin: 0; font-size: .86rem; font-weight: 700; text-align: right; }
.grade-low { color: var(--error); font-weight: 700; }
.grade-total { font-weight: 700; background: #f2eee3; }
.report-caption { margin: 4px 0 0; color: var(--green); font-weight: 700; font-size: .9rem; }
@media (max-width: 560px) { .dashboard-header { align-items: flex-start; flex-direction: column; } }
@media (max-width: 680px) { .admin-form { grid-template-columns: 1fr; } .admin-form button, .admin-form .form-message { grid-column: auto; } .section-heading { align-items: flex-start; flex-direction: column; } }
@media print {
  body { background: none; }
  .dashboard-actions, .admin-form, #print, .header-buttons, .form-message { display: none; }
  .dashboard-panel { border: 0; padding: 0; background: none; }
  th, td { white-space: normal; }
}
