/* Leave Tracker v1.0.1 — colours copied from the Leave Tracker Space
   (theme.css variables + TYPE_COLORS): warm cream background, deep teal
   accent. Plain, phone-friendly styles. */
:root {
  --bg: #f6f1e7; --surface: #fdfbf6; --surface-alt: #efe8d8;
  --text: #1d2420; --dim: #68705f; --border: #ddd3bd;
  --accent: #0e4d45; --accent-soft: #dcebe4;
  --amber: #b45309; --amber-soft: #f7e8cd;
  --red: #b42318; --red-soft: #f9ded9;
  --green: #177245; --green-soft: #d9ecdd;
  --annual: #0e7a5f; --annual-soft: #d9ecdd;
  --sick: #b45309; --sick-soft: #f7e8cd;
  --emergency: #b42318; --emergency-soft: #f9ded9;
  --unpaid: #6d28d9; --unpaid-soft: #e9e2fb;
  --holiday: #1d4ed8; --holiday-soft: #eff6ff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131a17; --surface: #1c2420; --surface-alt: #242e29;
    --text: #ece7da; --dim: #9aa393; --border: #39423c;
    --accent: #5ec4b3; --accent-soft: #23423c;
    --amber: #e8a34c; --amber-soft: #453517;
    --red: #f08a7d; --red-soft: #472723;
    --green: #6fce97; --green-soft: #1f4030;
  }
  .cal-day.holiday { background: rgba(23, 37, 84, .45); }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); }
a.danger-link { color: var(--red); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 14px 40px; }
.topbar { background: var(--bg); border-bottom: 1px solid var(--border); color: var(--text); }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.topbar h1 { font-size: 20px; margin: 0; }
.topbar h1 a { color: var(--text); text-decoration: none; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; }
.topbar nav a { color: var(--dim); text-decoration: none; padding: 4px 2px; }
.topbar nav a.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
.topbar nav a:hover { color: var(--accent); text-decoration: underline; }
h2 { font-size: 22px; margin: 22px 0 10px; }
h3 { font-size: 17px; margin: 18px 0 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 14px 0; }
.flash { border-radius: 6px; padding: 10px 12px; margin: 14px 0 0; }
.flash.ok { background: var(--green-soft); color: var(--green); border: 1px solid var(--green); }
.flash.err { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); }
label { display: block; font-weight: 600; margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea { width: 100%; max-width: 420px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: var(--surface); color: var(--text); }
textarea { min-height: 70px; }
.btn { display: inline-block; background: var(--accent); color: var(--bg); border: 0; border-radius: 6px; padding: 9px 16px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.15); }
.btn.small { padding: 5px 10px; font-size: 14px; }
.btn.danger { background: var(--red); color: #fff; }
.btn.approve { background: var(--green); color: #fff; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.inline { display: inline; }
table { width: 100%; border-collapse: collapse; margin: 8px 0; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--dim); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.badge.pending { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.badge.approved { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.badge.rejected { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin: 8px 0; }
.legend .pending-swatch { background: var(--amber-soft); border: 1px dashed var(--amber); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.stat { font-size: 28px; font-weight: 700; color: var(--accent); }
.muted { color: var(--dim); font-size: 14px; }
.site-footer { text-align: center; color: var(--dim); font-size: 13px; padding: 18px 0 4px; }

/* Calendar */
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.cal-nav .title { font-size: 19px; font-weight: 700; margin-right: auto; }
.view-switch a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--text); background: var(--surface); }
.view-switch a.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.cal-week { margin-bottom: 6px; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day { border: 1px solid var(--border); background: var(--surface); min-height: 64px; padding: 4px 6px; font-size: 13px; overflow: hidden; }
.cal-day.other { background: var(--surface-alt); color: var(--dim); }
.cal-day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day.holiday { background: var(--holiday-soft); }
.cal-num { font-weight: 700; display: block; }
.cal-wd { color: var(--dim); font-size: 11px; display: block; }
.cal-hol { display: block; color: var(--holiday); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bars { position: relative; }
.cal-bar { position: absolute; height: 22px; line-height: 22px; border-radius: 4px; color: #fff; font-size: 12px; font-weight: 600; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.cal-bar.pending { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px); }
.cal-year { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mini-month h3 { margin: 0 0 6px; font-size: 15px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-hd { font-size: 11px; color: var(--dim); text-align: center; }
.mini-day { display: block; text-align: center; font-size: 12px; padding: 3px 0; border-radius: 3px; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); }
.mini-day.empty { background: transparent; border-color: transparent; }
.mini-day.today { outline: 2px solid var(--accent); outline-offset: -1px; }
.mini-day.holiday { background: var(--holiday) !important; color: #fff; }
.mini-day.leave { color: #fff; }
.mini-day.leave-pending { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px); }

@media (max-width: 700px) {
  .grid2 { grid-template-columns: 1fr; }
  .cal-year { grid-template-columns: 1fr; }
  .cal-day { min-height: 48px; padding: 3px 4px; font-size: 12px; }
  .cal-wd, .cal-hol { display: none; }
  .cal-bar { font-size: 11px; }
  table { font-size: 14px; }
  .topbar nav { margin-left: 0; }
}
