/* Filename: src/timeledger/static/css/app.css */
/* Purpose: Responsive, dependency-free DKHTime interface. */
/* Last Modified: 2026-07-14 (NDT) */

:root {
  color-scheme: light;
  --ink: #14231d;
  --muted: #5f6e67;
  --paper: #f4f1e8;
  --surface: #fffdf7;
  --line: #d9d5c8;
  --green: #1f5c48;
  --green-dark: #154434;
  --gold: #906624;
  --danger: #9e302b;
  --shadow: 0 12px 28px rgb(32 45 38 / 8%);
}

* { box-sizing: border-box; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: var(--green); text-underline-offset: 0.18em; }
a:hover { color: var(--green-dark); }
h1, h2 { margin-top: 0; line-height: 1.16; font-family: Georgia, "Times New Roman", serif; }
h1 { margin-bottom: 0.65rem; font-size: clamp(2rem, 4.2vw, 3.5rem); }
h2 { margin-bottom: 0.75rem; font-size: 1.4rem; }
p { margin-top: 0; }
button, input, select, textarea { font: inherit; }

.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.page { min-height: calc(100vh - 142px); padding-block: 3rem 4.5rem; }
.site-header { border-bottom: 1px solid var(--line); background: rgb(255 253 247 / 92%); }
.nav { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font: 700 1.35rem Georgia, serif; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 1.15rem; }
.nav-links > a:not(.button), .link-button { display: inline-flex; align-items: center; padding-block: 0.62rem; color: var(--ink); font-weight: 650; text-decoration: none; }
.inline-form { display: inline; margin: 0; }
.link-button { padding-inline: 0; border: 0; background: transparent; cursor: pointer; }
.danger-link { color: var(--danger); }
.site-footer { padding: 1.25rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.68rem 1.05rem;
  border: 1px solid var(--green);
  border-radius: 5px;
  color: white;
  background: var(--green);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { color: white; background: var(--green-dark); }
.button-small { min-height: 36px; padding: 0.42rem 0.78rem; }
.button-secondary { color: var(--green); background: transparent; }
.button-secondary:hover { color: white; }
.button-full { width: 100%; }

.hero { display: grid; grid-template-columns: 1.4fr 0.8fr; align-items: center; gap: 3rem; min-height: 62vh; }
.lead { max-width: 680px; margin-bottom: 1.6rem; color: var(--muted); font-size: 1.15rem; }
.eyebrow { margin-bottom: 0.65rem; color: var(--gold); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.hero-card { padding: 2rem; }
.check-list { display: grid; gap: 0.72rem; padding-left: 1.25rem; margin-bottom: 0; }
.check-list li::marker { color: var(--green); }

.page-heading, .section-heading, .filter-bar, .form-actions, .action-row, .pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.page-heading { margin-bottom: 2rem; }
.page-heading h1 { margin-bottom: 0; }
.compact-heading { max-width: 820px; margin-inline: auto; }
.section-card { padding: 1.3rem; }
.section-heading { margin-bottom: 1rem; }
.section-heading h2 { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { padding: 1.25rem; border-left: 4px solid var(--gold); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.stat-value, .stat-label { display: block; }
.stat-value { font: 700 2rem Georgia, serif; }
.stat-label, .muted { color: var(--muted); }

.table-wrap { overflow-x: auto; }
.table-wrap td a { display: inline-block; padding: 0.5rem 0.35rem; margin: -0.5rem -0.35rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.78rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 99px; background: #e7e3d8; font-size: 0.77rem; font-weight: 800; }
.badge-submitted { color: #174d68; background: #dcecf4; }
.badge-approved { color: #15553a; background: #dceee4; }
.badge-rejected { color: #7f2c27; background: #f4dfdd; }
.action-row { justify-content: flex-start; }
.empty-state { padding: 3rem 1rem; color: var(--muted); text-align: center; }
.filter-bar { justify-content: flex-start; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.month-total { margin-left: auto; }
.pagination { justify-content: center; padding-top: 1rem; }

.auth-layout { display: grid; place-items: center; min-height: 60vh; }
.form-card { width: min(100%, 480px); padding: 2rem; }
.wide-form { width: min(100%, 820px); margin-inline: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1rem; }
.field { margin-bottom: 1rem; }
.label { display: block; margin-bottom: 0.35rem; font-weight: 750; }
.input { width: 100%; min-height: 44px; padding: 0.62rem 0.7rem; border: 1px solid #878b86; border-radius: 4px; color: var(--ink); background: white; }
.input:focus { outline: 3px solid rgb(31 92 72 / 66%); border-color: var(--green); }
.textarea { min-height: 120px; resize: vertical; }
.checkbox-row { margin: 0.4rem 0 1.2rem; }
.field-errors { margin: 0.35rem 0 0; padding-left: 1.1rem; color: var(--danger); font-size: 0.88rem; }
.form-actions { justify-content: flex-start; margin-top: 0.5rem; }
.week-picker { margin-bottom: 1.5rem; }
.week-picker .filter-bar { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.week-picker .field { margin-bottom: 0; }
.badge-large { padding: 0.45rem 0.8rem; font-size: 0.9rem; }
.notes-cell { min-width: 12rem; white-space: normal; }
.empty-day { background: rgb(244 241 232 / 55%); }
tfoot th { border-top: 2px solid var(--line); border-bottom: 0; }
.workflow-actions { display: flex; align-items: flex-start; gap: 1rem; margin-top: 1.5rem; }
.reject-form { width: min(100%, 520px); padding: 1.25rem; }
.button-danger { border-color: var(--danger); background: var(--danger); }
.button-danger:hover { background: #7f2521; }

.alert { margin-bottom: 1rem; padding: 0.85rem 1rem; border: 1px solid; border-radius: 5px; background: var(--surface); }
.alert-success { border-color: #70a98d; }
.alert-warning { border-color: #d6aa58; }
.alert-danger { border-color: #d2817d; color: #731f1b; }
.error-page { max-width: 700px; margin: 8vh auto; padding: 2.5rem; text-align: center; }
.guided-form { width: min(100%, 920px); margin-inline: auto; }
.settings-section { margin-bottom: 1.25rem; padding: clamp(1.2rem, 3vw, 2rem); }
.settings-section fieldset { min-width: 0; padding: 0; border: 0; }
.duration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.duration-field > .label { margin-bottom: 0.35rem; }
.checkbox-field label { display: inline-flex; align-items: flex-start; min-height: 44px; padding-block: 0.4rem; gap: 0.55rem; font-weight: 700; }
.checkbox-field input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; }
.help { margin-top: 0.3rem; color: var(--muted); font-size: 0.88rem; }
.conditional-panel { margin: 0 0 1.2rem 1.7rem; padding-left: 1rem; border-left: 3px solid var(--line); }
.readonly-setting { margin-bottom: 1rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.readonly-setting .label { margin-bottom: 0.15rem; }
.summary-list { margin: 0; }
.summary-list > div { display: grid; grid-template-columns: minmax(9rem, 0.35fr) 1fr; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.summary-list > div:last-child { border-bottom: 0; }
.summary-list dt { font-weight: 750; }
.summary-list dd { margin: 0; }
.error-summary { width: min(100%, 920px); margin-inline: auto; }
.error-summary h2 { font-family: inherit; font-size: 1rem; }
.history-summary { min-width: 24rem; white-space: normal; }
.badge-current { color: #15553a; background: #dceee4; }
.badge-scheduled { color: #174d68; background: #dcecf4; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; min-height: auto; }
  .nav, .page-heading, .filter-bar, .workflow-actions { align-items: flex-start; }
  .nav { padding-block: 0.75rem; }
  .nav-links { flex-wrap: wrap; justify-content: flex-end; }
  .page-heading, .filter-bar, .workflow-actions { flex-direction: column; }
  .month-total { margin-left: 0; }
  .stats, .form-grid { grid-template-columns: 1fr; }
  .summary-list > div { grid-template-columns: 1fr; gap: 0.2rem; }
  .page { padding-block: 2rem 3rem; }
}
