/* MB Schedule — high-tech dark theme (default). Light theme via data-theme="light". */
:root {
  --bg: #070b12; --surface: #0f1622; --surface2: #131c2b; --text: #e6edf3;
  --dim: #8b98a9; --border: #1e2a3a; --dark: #05080e; --dark2: #0b1220;
  --accent: #00e5ff; --accent2: #7c5cff; --accent-ink: #001018;
  --red: #ff5c6c; --amber: #ffb454; --amber-bg: #2a1f0d;
  --radius: 10px;
}
:root[data-theme="light"] {
  --bg: #f2f4f7; --surface: #fff; --surface2: #f8fafc; --text: #17202b;
  --dim: #5b6a78; --border: #ccd4da; --dark: #222; --dark2: #333;
  --accent: #1565c0; --accent2: #5b4bc4; --accent-ink: #fff;
  --red: #b71c1c; --amber: #7a4a00; --amber-bg: #fff4d6;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.topbar { background: linear-gradient(90deg, #05080e, #0b1220 60%, #0d1a2e); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--accent); box-shadow: 0 0 24px rgba(0, 229, 255, .15); }
.brand { font-size: 20px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.brand-sub { font-size: 12px; font-weight: 400; color: var(--accent); margin-left: 10px; letter-spacing: 2px; text-transform: uppercase; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.wrap { max-width: 100%; padding: 16px 20px 40px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar-2 { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 10px 0; }
.toolbar h1 { margin: 0; font-size: 22px; flex: 0 0 auto; letter-spacing: .5px; }
.spacer { flex: 1; }
.btn { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 14px; text-decoration: none; }
.btn:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-ghost { background: transparent; color: #fff; border-color: #33415a; }
.btn-wide { width: 100%; padding: 10px; margin-top: 8px; }
.btn.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.hidden { display: none !important; }
.field-inline { font-size: 14px; color: var(--dim); display: flex; gap: 6px; align-items: center; }
input, select { font-size: 14px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface2); color: var(--text); }
.hint { color: var(--dim); font-size: 14px; line-height: 1.5; }
.legend-off { color: var(--red); font-weight: 700; }
.legend-training { color: var(--amber); font-weight: 700; }
.status-msg { min-height: 1.2em; font-size: 14px; color: var(--dim); }
.table-scroll { overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.roster { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.roster th, .roster td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 8px; vertical-align: top; white-space: nowrap; }
.roster th { background: var(--dark2); color: var(--accent); font-size: 12px; text-align: center; position: sticky; top: 0; z-index: 2; letter-spacing: 1px; }
.roster th.emp-col, .roster td.emp-col { position: sticky; left: 0; z-index: 3; background: var(--surface); text-align: left; min-width: 150px; }
.roster th.emp-col { background: var(--dark2); color: var(--accent); z-index: 4; }
.roster td { cursor: pointer; min-width: 138px; font-size: 13px; line-height: 1.45; }
.roster td:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.roster .emp-name { font-weight: 700; }
.roster .emp-team { color: var(--dim); font-size: 12px; }
.cell-shift { font-weight: 600; }
.cell-lunch { color: var(--dim); }
.cell-off { color: var(--red); font-weight: 700; }
.cell-training { color: var(--amber); font-weight: 700; }
.cell-closed, .cell-holiday { color: var(--dim); font-weight: 600; }
.cell-ns { color: var(--dim); }
.roster td.cell-weekend { background: var(--surface2); }
/* Calendar view — the main view. Times right-align so they line up. */
.cal-grid { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head-cell { background: var(--dark2); color: var(--accent); font-weight: 800; letter-spacing: 2px; text-align: center; padding: 10px 4px; font-size: 12px; border-right: 1px solid var(--border); }
.cal-cell { border-right: 1px solid var(--border); border-top: 1px solid var(--border); min-height: 150px; padding: 8px; vertical-align: top; }
.cal-cell.cal-blank { background: var(--surface2); }
.cal-date { font-weight: 800; font-size: 16px; margin-bottom: 6px; color: var(--text); }
.cal-date-sat { color: var(--accent); }
/* Calendar person block: name on its own line, then shift and lunch as two
   true columns underneath, so times line up down the whole day. */
.cal-person { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text); padding: 3px 2px; cursor: pointer; border-radius: 4px; }
.cal-person:hover { background: var(--surface2); outline: 1px solid var(--accent); }
.cal-person .cal-name { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-times-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums; color: var(--dim); }
.cal-times-row .cal-shift, .cal-times-row .cal-lunch { white-space: nowrap; overflow: hidden; }
.cal-person.cal-off .cal-name, .cal-person.cal-off .cal-times-row { color: var(--red); font-weight: 700; }
.cal-person.cal-training .cal-name, .cal-person.cal-training .cal-times-row { color: var(--amber); font-weight: 700; }
/* Month picker: make the native calendar button bright and obvious in dark mode. */
/* Date/month picker buttons: dark color-scheme already renders a LIGHT native
   icon — do NOT invert it, or it goes dark again (that was the earlier bug).
   A tinted chip behind the icon makes the button itself unmistakable. Applies
   to the main month picker AND to date fields in modals (e.g. Saturday roster). */
:root[data-theme="dark"] input[type="month"], :root[data-theme="dark"] input[type="date"] { color-scheme: dark; background: #1b2740; border: 1px solid var(--accent); box-shadow: 0 0 12px rgba(0, 229, 255, .35); color: #fff; font-weight: 700; }
:root[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator, :root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { opacity: 1; cursor: pointer; background-color: rgba(0, 229, 255, .35); border-radius: 5px; padding: 3px; }
:root[data-theme="light"] input[type="month"], :root[data-theme="light"] input[type="date"] { color-scheme: light; border: 1px solid var(--accent); font-weight: 700; }
:root[data-theme="light"] input[type="month"]::-webkit-calendar-picker-indicator, :root[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { opacity: 1; cursor: pointer; background-color: rgba(21, 101, 192, .20); border-radius: 5px; padding: 3px; }
/* Employees view */
.emp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.emp-table th, .emp-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px 10px; vertical-align: top; text-align: left; }
.emp-table th { background: var(--dark2); color: var(--accent); font-size: 12px; letter-spacing: 1px; }
.emp-table .emp-time { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; white-space: nowrap; }
.emp-table .emp-time small { color: var(--dim); display: block; font-size: 11px; }
.def-row { display: grid; grid-template-columns: 90px 1fr 1fr 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.def-row .def-day { font-weight: 700; }
.cal-closed { color: var(--dim); font-weight: 700; font-size: 13px; }
.cal-add { margin-top: 6px; background: transparent; border: 1px dashed var(--border); color: var(--dim); border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 12px; }
.cal-add:hover { color: var(--accent); border-color: var(--accent); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; z-index: 50; }
.modal-backdrop.hidden { display: none; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; width: min(480px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.modal h2 { margin: 0 0 14px; }
.modal label { display: block; margin-bottom: 10px; font-size: 14px; }
.modal label input, .modal label select { width: 100%; margin-top: 4px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--border); background: var(--surface2); color: var(--text); border-radius: 20px; padding: 6px 12px; cursor: pointer; }
.chip.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.error { color: var(--red); font-weight: 600; }
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; width: min(420px, 92vw); box-shadow: 0 0 32px rgba(0, 229, 255, .12); }
.auth-card h1 { margin: 0 0 6px; letter-spacing: 1px; }
.auth-card label { display: block; margin: 14px 0 4px; font-size: 14px; }
.auth-card input { width: 100%; margin-top: 4px; }
.print-page { background: #fff; color: #111; }
.print-header { background: #222; color: #fff; text-align: center; padding: 18px; }
.print-header h1 { margin: 0; font-size: 32px; letter-spacing: 2px; }
.print-header p { margin: 4px 0 0; letter-spacing: 6px; font-size: 12px; color: #ccc; }
.print-hint { font-size: 13px; color: #555; padding: 0 16px; }
.print-grid { border: 1px solid #999; margin: 0 16px 16px; }
.print-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.print-cell { border-right: 1px solid #999; border-bottom: 1px solid #999; min-height: 110px; padding: 6px; font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums; background: #fff; }
.print-head-cell { min-height: auto; background: #333; color: #fff; font-weight: 700; text-align: center; }
.print-date { font-weight: 800; font-size: 14px; }
.print-closed { color: #555; font-weight: 700; }
.print-holiday { color: #555; }
.print-off { color: #b71c1c; font-weight: 700; }
.print-training { font-weight: 700; }
.print-blank { background: #f0ede8; }
@media (max-width: 700px) {
  .brand-sub { display: none; }
  .roster td { min-width: 120px; }
  .cal-cell { min-height: 110px; padding: 6px; }
  .cal-line .cal-times { font-size: 11px; }
}
