/* Camilla Plumley Decorator – staff portal
   Brand colours taken from her logo: slate ink and a soft sage brush-stroke. */
:root {
  --brand: #50555e;        /* slate, the logo lettering */
  --brand-dark: #3b4048;
  --brand-ink: #ffffff;    /* text on slate */
  --accent: #7d9996;       /* deeper sage for focus and highlights */
  --wash: #d7e0df;         /* the logo's brush-stroke */
  --paper: #f3f6f5;        /* page background, faint sage */
  --card: #ffffff;
  --ink: #2f3238;
  --muted: #6d727a;
  --line: #dde4e3;
  --ok: #3d7a5c;
  --ok-bg: #e3f1ea;
  --wait: #9a6a1c;
  --wait-bg: #f8eedb;
  --bad: #a3392f;
  --bad-bg: #f8e3e0;
  --bank: #d7e0df;
  --bank-ink: #3b4048;
  --sick: #ebe4f0;
  --sick-ink: #66457a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(47, 50, 56, .05), 0 2px 8px rgba(47, 50, 56, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Josefin Sans", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 var(--font);
}
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
h1, h2 { font-family: var(--display); line-height: 1.2; color: var(--brand); text-transform: uppercase; }
h1 { font-size: 1.6rem; font-weight: 300; letter-spacing: .1em; margin: 1.4rem 0 1rem; }
h2 { font-size: 1rem; font-weight: 600; letter-spacing: .08em; margin: 0 0 .85rem; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 2rem; }

/* Header: white, with her logo, and a sage brush-stroke band for the tabs */
.site-header { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand); text-decoration: none; }
.brand img { height: 64px; width: auto; display: block; }
@media (max-width: 520px) { .brand img { height: 52px; } }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--wash); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--display); font-size: 1.25rem; font-weight: 400; letter-spacing: .06em; }
.brand-sub { font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.header-user { display: flex; align-items: center; gap: 14px; font-size: .9rem; }
.header-user a, .header-user .linklike { color: var(--brand); }
.header-user .who { color: var(--muted); }
@media (max-width: 520px) { .header-user .who { display: none; } }

.nav-band { background: var(--wash); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.tabs a {
  color: var(--brand-dark); text-decoration: none; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; font-family: var(--display); font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em; font-size: .85rem;
}
.tabs a:hover { background: rgba(255,255,255,.6); }
.tabs a.on { background: var(--brand); color: var(--brand-ink); }

/* Footer */
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .8rem; padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid var(--line); }

/* Cards and layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; box-shadow: var(--shadow); }
.card.highlight { border-color: var(--accent); background: #f5f9f8; }
.card.faded { opacity: .7; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.narrow { max-width: 420px; }
.lead { font-size: 1.05rem; color: #3b3f43; max-width: 70ch; }
.hint { color: var(--muted); font-size: .88rem; }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; margin: .25rem 0; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }

/* Flash messages */
.flash { border-radius: 10px; padding: 12px 14px; margin: 14px 0; border: 1px solid; }
.flash-success { background: var(--ok-bg); border-color: #bcdcc8; color: #1e5236; }
.flash-error { background: var(--bad-bg); border-color: #ecc3bd; color: #7a2a22; }
.flash-info { background: #fff7e8; border-color: #f0dcb4; color: #6d4a12; }

/* Forms */
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .92rem; margin-bottom: 14px; }
.form input, .form select, .form textarea, .decide input, .ent-form input, .actions-row input, .picker select {
  font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid #c9d1d0; border-radius: 9px; padding: 10px 12px; min-height: 44px; width: 100%;
}
.form textarea { min-height: auto; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(125,153,150,.5); outline-offset: 1px; border-color: var(--accent); }
.grid-form { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 640px) { .grid-form { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); padding: 11px 18px; min-height: 44px; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-quiet { background: var(--wash); color: var(--brand-dark); }
.btn-quiet:hover { background: #c9d4d3; color: var(--brand-dark); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #24603e; }
.btn.danger, .linklike.danger { color: var(--bad); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
form.inline { display: inline; margin: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat-num { font-family: var(--display); font-size: 2.1rem; font-weight: 400; color: var(--brand-dark); line-height: 1; }
.stat-label { color: var(--muted); font-size: .82rem; margin-top: 6px; }
.stat-main { background: var(--brand); border-color: var(--brand); }
.stat-main .stat-num, .stat-main .stat-label { color: var(--brand-ink); }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr 1fr; } .stat-main { grid-column: span 2; } }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list-row:first-child { border-top: 0; }
.list-main { flex: 1 1 260px; }
.list-side { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.note { font-size: .88rem; color: #4a4e52; margin-top: 4px; }
.note-admin { color: var(--brand-dark); }
.plain-list { list-style: none; padding: 0; margin: 0; columns: 2 260px; }
.plain-list li { padding: 4px 0; break-inside: avoid; }
.date-col { display: inline-block; min-width: 9.5em; font-variant-numeric: tabular-nums; color: var(--muted); }
.doc-icon { display: inline-block; font-size: .65rem; font-weight: 700; letter-spacing: .04em; color: var(--brand); border: 1.5px solid currentColor; border-radius: 4px; padding: 1px 4px; margin-right: 6px; vertical-align: 2px; }

.badge, .type { display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.badge-pending { background: var(--wait-bg); color: var(--wait); }
.badge-approved { background: var(--ok-bg); color: var(--ok); }
.badge-declined { background: var(--bad-bg); color: var(--bad); }
.badge-cancelled { background: #eee; color: #777; }
.type { background: #eef2f1; color: var(--brand-dark); margin-right: 4px; }
.type-sick { background: var(--sick); color: var(--sick-ink); }
.type-other { background: #e9eef0; color: #3c5560; }

/* Pending approvals */
.pending { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.pending:first-of-type { border-top: 0; }
.decide { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1 1 320px; justify-content: flex-end; }
.decide input { flex: 1 1 180px; width: auto; }

/* Picker and year navigation */
.picker { margin: 0 0 14px; }
.picker label { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; }
.picker select { width: auto; }
.year-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.year-nav a { padding: 6px 12px; border-radius: 999px; background: var(--wash); text-decoration: none; color: var(--brand-dark); font-weight: 500; font-size: .9rem; }
.year-nav a.on { background: var(--brand); color: var(--brand-ink); }

/* Calendar */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0; padding: 0; font-size: .85rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.key { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.key-bank { background: var(--bank); }
.key-approved { background: var(--ok); }
.key-pending { background: var(--wait-bg); box-shadow: inset 0 0 0 2px var(--wait); }
.key-sick { background: var(--sick); box-shadow: inset 0 0 0 2px var(--sick-ink); }

.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.month { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.month h2 { font-size: 1rem; margin-bottom: 8px; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dow { font-size: .7rem; text-align: center; color: var(--muted); font-weight: 600; padding-bottom: 2px; }
.day {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; border-radius: 7px; font-size: .85rem; font-variant-numeric: tabular-nums;
  color: var(--ink); text-decoration: none; min-height: 30px;
}
a.day:hover { background: var(--wash); color: var(--brand-dark); }
.day.blank { visibility: hidden; }
.day.weekend { color: #a9a49b; }
.day.bank, .day.closure { background: var(--bank); color: var(--bank-ink); font-weight: 600; box-shadow: inset 0 0 0 1px #bfcbca; }
.day.closure { background: #e9e6df; color: #5e5546; }
.day.approved { background: var(--ok); color: #fff; font-weight: 600; }
.day.pending { background: var(--wait-bg); color: var(--wait); box-shadow: inset 0 0 0 2px var(--wait); font-weight: 600; }
.day.sick { background: var(--sick); color: var(--sick-ink); box-shadow: inset 0 0 0 2px var(--sick-ink); font-weight: 600; }
.day.half.approved { background: linear-gradient(135deg, var(--ok) 0 50%, #cfe6d8 50% 100%); }
.day.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.day:has(.who-marks) { flex-direction: column; line-height: 1; gap: 1px; }
.who-marks { position: static; bottom: 1px; left: 0; right: 0; font-size: .5rem; line-height: 1; text-align: center; letter-spacing: -.02em; opacity: .9; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; margin: 10px 0 4px; display: block; overflow-x: auto; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.ent-form input { width: 5.5em; min-height: 36px; padding: 6px 8px; display: inline-block; }
.mini-links { display: flex; gap: 16px; flex-wrap: wrap; font-weight: 500; }
.warn-dot { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; background: var(--wait); color: #fff; font-size: .7rem; align-items: center; justify-content: center; }
details { margin-top: 10px; }
summary { cursor: pointer; color: var(--brand); font-weight: 500; }
.actions-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 10px; }
.actions-row label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.actions-row input { width: 240px; max-width: 100%; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
code.big { font-size: 1.2rem; background: #eef2f1; padding: 3px 8px; border-radius: 6px; letter-spacing: .04em; }

@media print {
  .site-header .tabs, .header-user, .site-footer, .quick, form, .cal-toolbar .year-nav { display: none !important; }
  body { background: #fff; }
  .card, .month, .stat { box-shadow: none; }
}


.btn-block { display: flex; width: 100%; margin-top: 12px; }
.month { scroll-margin-top: 12px; }
.month.current-month { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
/* iPhone: comfortable tap targets, no zoom on inputs (iOS zooms below 16px) */
@media (max-width: 560px) {
  .form input, .form select, .form textarea, .decide input { font-size: 16px; }
  .decide { justify-content: stretch; }
  .decide .btn { flex: 1 1 40%; }
  .day { min-height: 36px; font-size: .9rem; }
  .year-grid { grid-template-columns: 1fr; }
}
