/* Team leave tracker. One stylesheet, no framework, no build step. */

:root {
    --bg: #ffffff;
    --fg: #1c2128;
    --muted: #667085;
    --line: #dfe3e8;
    --panel: #f6f7f9;
    --weekend: #eef0f3;
    --holiday: #fdf0e3;
    --accent: #2f6fed;
    --danger: #d9534f;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16191d;
        --fg: #e4e7ec;
        --muted: #98a2b3;
        --line: #2c313a;
        --panel: #1d2126;
        --weekend: #21262c;
        --holiday: #33291d;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    flex-wrap: wrap;
}

.brand { font-weight: 600; text-decoration: none; color: var(--fg); }
.bar nav { display: flex; gap: 16px; }
.bar nav a { color: var(--muted); text-decoration: none; }
.bar nav a.on, .bar nav a:hover { color: var(--fg); }
.bar .out { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bar .who { color: var(--muted); }

button, .button {
    font: inherit;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); }
button:hover { border-color: var(--muted); }

main { padding: 24px 20px 60px; max-width: 1400px; margin: 0 auto; }

h1 { font-size: 22px; margin: 0; }
.head { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.months { display: flex; gap: 16px; margin: 0; }
.months a { color: var(--accent); text-decoration: none; }

.flash { padding: 10px 14px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
.flash.error { border-color: var(--danger); color: var(--danger); }
.empty { color: var(--muted); }

/* The grid can be wider than the viewport; it scrolls inside its own box so the
   page itself never scrolls sideways. */
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }

.grid { border-collapse: collapse; width: 100%; }
.grid th, .grid td { border: 1px solid var(--line); text-align: center; }
.grid thead th { padding: 4px 0; font-weight: 500; font-size: 12px; color: var(--muted); }
.grid .dom { display: block; font-size: 13px; color: var(--fg); }
.grid .dow { display: block; font-size: 10px; text-transform: uppercase; }

.grid th.name, .grid td.name {
    text-align: left;
    padding: 6px 12px;
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: var(--bg);
    z-index: 1;
    font-weight: 500;
}
.grid thead th.name { background: var(--panel); }

.grid tbody td { height: 30px; min-width: 26px; padding: 0; }
.grid .weekend { background: var(--weekend); }
.grid .holiday { background: var(--holiday); }
.grid .today { outline: 2px solid var(--accent); outline-offset: -2px; }

.grid td.off { background: var(--cell); }
.grid td.off.pending {
    background: repeating-linear-gradient(
        45deg, var(--cell), var(--cell) 4px, transparent 4px, transparent 8px
    );
}
/* A half day fills half the cell, so a morning off reads differently from a
   whole day at a glance rather than only in the tooltip. */
.grid td.off.half-am { background: linear-gradient(to bottom, var(--cell) 50%, transparent 50%); }
.grid td.off.half-pm { background: linear-gradient(to top, var(--cell) 50%, transparent 50%); }

.legend { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; padding: 16px 0 0; margin: 0; color: var(--muted); font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 7px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; background: var(--cell, var(--line)); border: 1px solid var(--line); }
.swatch.pending-swatch { background: repeating-linear-gradient(45deg, var(--muted), var(--muted) 3px, transparent 3px, transparent 6px); }
.swatch.holiday-swatch { background: var(--holiday); }

table.list { border-collapse: collapse; width: 100%; margin-top: 8px; }
table.list th, table.list td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; }
table.list th { color: var(--muted); font-weight: 500; font-size: 13px; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list tr.low td { color: var(--danger); }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.pill.approved { border-color: #2f9e44; color: #2f9e44; }
.pill.pending { border-color: #c48a00; color: #c48a00; }
.pill.denied, .pill.cancelled { border-color: var(--danger); color: var(--danger); }

form.inline { display: inline; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 0 0 20px; }
legend { padding: 0 6px; color: var(--muted); font-size: 13px; }
label { display: block; margin-bottom: 10px; }
label span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
input[type=text], input[type=date], input[type=number], input[type=email], select, textarea {
    font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px;
    background: var(--bg); color: var(--fg); width: 100%; max-width: 340px;
}
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }

.login { max-width: 380px; margin: 80px auto; text-align: center; }
.login .button { display: inline-block; text-decoration: none; background: #4a154b; color: #fff; border-color: #4a154b; padding: 10px 18px; }
