/* Tuntikirjaus – shared stylesheet
   One accent (beak yellow) marks the primary action and "now/today".
   Red is reserved for destructive actions, green for approved. */

:root {
    --ink: #18212E;
    --ink-soft: #2B3646;
    --paper: #F3F5F8;
    --surface: #FFFFFF;
    --rule: #D9DEE5;
    --rule-soft: #E8EBF0;
    --slate: #5A6577;
    --beak: #F4B41A;
    --beak-deep: #D99A00;
    --beak-wash: #FFF4D6;
    --talon: #C42B2F;
    --talon-wash: #FBEAEA;
    --fir: #1E7550;
    --fir-wash: #E5F3EC;
    --sky: #2563A6;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 2px rgba(24, 33, 46, .06), 0 4px 16px rgba(24, 33, 46, .05);

    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
    --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;

    --step--1: 0.8125rem;  /* 13px */
    --step-0: 0.9375rem;   /* 15px */
    --step-1: 1.0625rem;   /* 17px */
    --step-2: 1.3125rem;   /* 21px */
    --step-3: 1.75rem;     /* 28px */
    --step-4: 2.75rem;     /* 44px */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

img { max-width: 100%; }

a { color: var(--sky); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

:focus-visible {
    outline: 3px solid var(--beak);
    outline-offset: 2px;
    border-radius: 4px;
}

h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0;
}
h1 { font-size: var(--step-3); font-weight: 650; }
h2 { font-size: var(--step-2); font-weight: 600; margin: 32px 0 12px; }
h3 { font-size: var(--step-1); font-weight: 600; margin: 24px 0 10px; }

p { margin: 0 0 12px; max-width: 72ch; }

.muted { color: var(--slate); }
.small { font-size: var(--step--1); }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Top bar ---------- */

.topbar {
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 650;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand img { background: #fff; border-radius: 6px; padding: 2px; }

.nav-menu { flex: 1; }
.nav-menu > summary {
    list-style: none;
    cursor: pointer;
    display: none;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu[open] > .nav-panel { display: flex; align-items: center; gap: 24px; }

.nav-links, .nav-user { display: flex; align-items: center; gap: 4px; }
.nav-links { flex: 1; flex-wrap: wrap; }
.nav-links a, .nav-user a, .nav-user .link-button {
    color: #C9D1DC;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: var(--step--1);
    font-weight: 500;
    white-space: nowrap;
}
.nav-links a:hover, .nav-user a:hover, .nav-user .link-button:hover { color: #fff; background: var(--ink-soft); }
.nav-links a[aria-current="page"], .nav-user a[aria-current="page"] {
    color: var(--ink);
    background: var(--beak);
}
.nav-sep { width: 1px; height: 18px; background: #3A4659; margin: 0 8px; }
.nav-user-name { color: #8E99AA; font-size: var(--step--1); padding: 0 6px; white-space: nowrap; }
.nav-user form { margin: 0; display: flex; }
.nav-user .link-button { text-decoration: none; justify-content: flex-start; min-height: 0; }

@media (max-width: 899px) {
    .topbar-inner { justify-content: space-between; }
    .nav-menu { flex: 0 0 auto; position: static; }
    .nav-menu > summary {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #fff;
        padding: 8px 12px;
        border-radius: 6px;
        border: 1px solid #3A4659;
        font-size: var(--step--1);
        font-weight: 600;
    }
    .nav-burger, .nav-burger::before, .nav-burger::after {
        display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
    }
    .nav-burger::before, .nav-burger::after { content: ""; position: absolute; left: 0; }
    .nav-burger::before { top: -5px; }
    .nav-burger::after { top: 5px; }
    .nav-menu[open] > summary { background: var(--ink-soft); }
    .nav-menu[open] > .nav-panel {
        position: absolute;
        left: 0; right: 0; top: 56px;
        background: var(--ink);
        border-top: 1px solid #2E3A4C;
        box-shadow: 0 12px 24px rgba(0, 0, 0, .25);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 16px 12px;
    }
    .nav-links, .nav-user { flex-direction: column; align-items: stretch; gap: 2px; }
    .nav-user { border-top: 1px solid #2E3A4C; margin-top: 8px; padding-top: 8px; }
    .nav-links a, .nav-user a, .nav-user .link-button { font-size: var(--step-0); padding: 10px 12px; text-align: left; }
    .nav-sep { width: auto; height: 1px; margin: 6px 0; }
    .nav-user-name { padding: 10px 12px 4px; }
}

/* ---------- Page frame ---------- */

.page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 16px 64px;
}
.page-narrow { max-width: 640px; }
.page-medium { max-width: 920px; }

.back-link {
    display: inline-block;
    margin-bottom: 14px;
    font-size: var(--step--1);
    color: var(--slate);
    text-decoration: none;
}
.back-link::before { content: "‹ "; }
.back-link:hover { color: var(--ink); text-decoration: underline; }

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 20px;
}
.page-header p { margin: 6px 0 0; color: var(--slate); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.panel {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.panel + .panel { margin-top: 16px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }

.section { margin-top: 36px; }
.section > h2:first-child { margin-top: 0; }

/* ---------- Notices ---------- */

.notice {
    border-radius: var(--radius);
    padding: 10px 14px;
    margin: 0 0 16px;
    border: 1px solid transparent;
    max-width: 72ch;
}
.notice-success { background: var(--fir-wash); border-color: #BFE0CF; color: #14563A; }
.notice-error   { background: var(--talon-wash); border-color: #F0C4C5; color: #8F1D20; }
.notice-info    { background: var(--beak-wash); border-color: #F4DE9E; color: #6B4D00; }

/* ---------- Forms ---------- */

label { font-weight: 550; font-size: var(--step--1); color: var(--ink-soft); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], select, textarea {
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid #C5CCD6;
    border-radius: var(--radius);
    padding: 9px 11px;
    min-height: 40px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #9AA5B4; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(244, 180, 26, .45);
}
input:disabled, select:disabled { background: var(--rule-soft); color: var(--slate); }
textarea { min-height: 84px; resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ink); vertical-align: middle; margin: 0; }

/* Vertical form: label above field */
.form-stack { display: grid; gap: 14px; }
.form-stack .field { display: grid; gap: 6px; }
.form-stack .form-actions { margin-top: 6px; }

/* Two fields side by side on wider screens */
.field-pair { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .field-pair { grid-template-columns: 1fr; } }

.field-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: var(--step-0);
    color: var(--ink);
    cursor: pointer;
}

/* Inline filter bar: fields in a row, wrapping */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}
.filter-bar .field { display: grid; gap: 4px; min-width: 150px; }
.filter-bar .field-grow { flex: 1; min-width: 200px; }

.check-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }

.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */

button, .btn {
    font: inherit;
    font-weight: 600;
    font-size: var(--step-0);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
button:hover, .btn:hover { background: var(--ink-soft); color: #fff; }
button:disabled, .btn[aria-disabled="true"] {
    background: var(--rule-soft);
    border-color: var(--rule);
    color: #8F99A8;
    cursor: not-allowed;
}

.btn-secondary { background: var(--surface); color: var(--ink); border-color: #C5CCD6; }
.btn-secondary:hover { background: var(--paper); color: var(--ink); border-color: var(--ink); }

.btn-danger { background: var(--surface); color: var(--talon); border-color: #E3B3B4; }
.btn-danger:hover { background: var(--talon); color: #fff; border-color: var(--talon); }

.btn-approve { background: var(--fir); border-color: var(--fir); }
.btn-approve:hover { background: #165C3E; border-color: #165C3E; }

.btn-small { min-height: 32px; padding: 4px 10px; font-size: var(--step--1); }

/* The punch: the one loud button in the app */
.btn-punch {
    background: var(--beak);
    border-color: var(--beak);
    color: var(--ink);
    font-size: var(--step-1);
    min-height: 56px;
    padding: 12px 24px;
    border-radius: 10px;
    box-shadow: 0 2px 0 var(--beak-deep);
}
.btn-punch:hover { background: #FFC233; border-color: #FFC233; color: var(--ink); }
.btn-punch:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--beak-deep); }
.btn-punch:disabled { box-shadow: none; }

.btn-block { width: 100%; }

.link-button {
    background: none;
    border: none;
    min-height: 0;
    padding: 0;
    color: var(--sky);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.link-button:hover { background: none; color: var(--ink); }
.link-button.danger { color: var(--talon); }

/* Small icon-like text actions inside tables */
.row-actions { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.row-actions form { display: inline; margin: 0; }

/* ---------- Tables ---------- */

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule-soft); }
thead th {
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--slate);
    background: #F8F9FB;
    border-bottom: 1px solid var(--rule);
    white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }

/* Sortable column headers */
th[data-sort] { padding: 0; }
th[data-sort] button {
    all: unset;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    cursor: pointer;
    color: inherit;
    font: inherit;
}
th.num[data-sort] button { justify-content: flex-end; }
th[data-sort] button:hover { color: var(--ink); }
th[data-sort] button:focus-visible { outline: 3px solid var(--beak); outline-offset: -3px; }
th[data-sort] button::after { content: "↕"; font-size: 11px; color: #A3ADBB; }
th[aria-sort="ascending"] button::after { content: "▲"; color: var(--ink); }
th[aria-sort="descending"] button::after { content: "▼"; color: var(--ink); }
th[aria-sort] { color: var(--ink); }
tfoot td { font-weight: 650; border-top: 2px solid var(--rule); border-bottom: none; background: #F8F9FB; }
tbody tr.link-row { cursor: pointer; }
tbody tr.link-row:hover td { background: #F8F9FB; }
td.empty, .empty-row td { color: var(--slate); }
.table-compact th, .table-compact td { padding: 7px 10px; }
.table-dense { font-size: var(--step--1); }
.table-dense th, .table-dense td { padding: 8px 10px; }
th.group-start, td.group-start { border-left: 1px solid var(--rule); }
.table-sticky-first tbody td:first-child, .table-sticky-first tfoot td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.table-sticky-first thead th:first-child { position: sticky; left: 0; z-index: 2; }
.table-sticky-first tfoot td:first-child { background: #F8F9FB; }

/* ---------- Status tags ---------- */

.tag {
    display: inline-block;
    font-size: var(--step--1);
    font-weight: 600;
    line-height: 1.2;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
    background: var(--rule-soft);
    color: var(--ink-soft);
}
.tag-ok   { background: var(--fir-wash); color: var(--fir); }
.tag-warn { background: var(--beak-wash); color: #7A5700; }
.tag-bad  { background: var(--talon-wash); color: var(--talon); }

.pos { color: var(--fir); font-weight: 600; }
.neg { color: var(--talon); font-weight: 600; }

/* ---------- Figures ---------- */

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 40px;
    margin: 0 0 24px;
}
.stat { display: grid; gap: 2px; }
.stat dt { font-size: var(--step--1); color: var(--slate); }
.stat dd { margin: 0; font-size: var(--step-2); font-weight: 650; letter-spacing: -0.01em; }
.stat dd small { font-size: var(--step--1); font-weight: 500; color: var(--slate); }

/* ---------- Period navigation (prev / label / next) ---------- */

.period-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    flex-wrap: wrap;
}
.period-nav .period-label {
    font-weight: 650;
    font-size: var(--step-1);
    min-width: 170px;
    text-align: center;
}
.period-nav .btn { min-height: 36px; }

.segmented {
    display: inline-flex;
    border: 1px solid #C5CCD6;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.segmented a {
    padding: 7px 14px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 550;
    font-size: var(--step--1);
}
.segmented a + a { border-left: 1px solid #C5CCD6; }
.segmented a[aria-current="page"] { background: var(--ink); color: #fff; }

.month-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.month-chips a {
    min-width: 40px;
    text-align: center;
    padding: 6px 0;
    border-radius: 6px;
    border: 1px solid var(--rule);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    font-weight: 550;
    font-size: var(--step--1);
}
.month-chips a:hover { border-color: var(--ink); }
.month-chips a.is-current { background: var(--beak); border-color: var(--beak); }

/* ---------- Menu lists (admin hub pages) ---------- */

.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.menu-list li + li { border-top: 1px solid var(--rule-soft); }
.menu-list a {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 16px;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--ink);
}
.menu-list a:hover { background: #F8F9FB; }
.menu-list a:hover .menu-title { text-decoration: underline; }
.menu-title { font-weight: 650; font-size: var(--step-1); }
.menu-desc { grid-column: 1; color: var(--slate); font-size: var(--step--1); }
.menu-list .tag { grid-row: 1 / span 2; grid-column: 2; }
.menu-list .menu-chevron { grid-row: 1 / span 2; grid-column: 2; color: #A3ADBB; font-size: 1.4em; }

/* ---------- Simple editable lists (sections) ---------- */

.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rule-soft);
}
.item-list li:last-child { border-bottom: none; }
.item-list .item-name { flex: 1; font-weight: 600; }

.inline-add { display: flex; gap: 8px; margin-bottom: 20px; max-width: 520px; }
.inline-add input { flex: 1; }

/* ---------- Staff clock-in ---------- */

.greeting { color: var(--slate); margin: 6px 0 0; }

.today-card {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0 16px;
}
.today-meta { color: var(--slate); font-size: var(--step--1); margin-bottom: 4px; }
.readout {
    font-family: var(--font-display);
    font-size: var(--step-4);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 4px 0 18px;
}
.readout-label { font-size: var(--step--1); color: var(--slate); }

.shift-line {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--beak-wash);
    margin-bottom: 18px;
    border-left: 4px solid var(--beak);
}
.shift-line strong { font-size: var(--step-1); }

.punch-stack { display: grid; gap: 10px; }
.punch-stack form { margin: 0; }

.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule-soft);
}
.recent-list li:last-child { border-bottom: none; }
.recent-when { font-weight: 600; }
.recent-where { color: var(--slate); font-size: var(--step--1); }
.recent-actions { display: flex; gap: 8px; }
.recent-actions form { margin: 0; }

/* ---------- Day planning ---------- */

.planning-tools {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
@media (max-width: 900px) { .planning-tools { grid-template-columns: 1fr; } }
.planning-tools .panel { margin: 0; }
.shift-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
.shift-form .field { display: grid; gap: 4px; }
.shift-form .field-wide { grid-column: 1 / -1; }

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    align-items: start;
}
.section-col h2 { margin: 0 0 10px; font-size: var(--step-1); }
.subsection-block {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
}
.subsection-block > h3 {
    margin: 0;
    padding: 10px 14px;
    font-size: var(--step-0);
    background: #F8F9FB;
    border-bottom: 1px solid var(--rule);
}
.shift-list { list-style: none; margin: 0; padding: 4px 0; min-height: 48px; }
.shift-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    padding: 8px 14px;
    border-left: 3px solid var(--beak);
    margin: 4px 8px;
    border-radius: 6px;
    background: var(--beak-wash);
    cursor: grab;
}
.shift-item.is-published { border-left-color: var(--fir); background: var(--fir-wash); }
.shift-item:active { cursor: grabbing; }
.shift-item > a, .shift-item > .shift-time { grid-column: 1; }
.shift-item a { color: var(--ink); font-weight: 600; text-decoration: none; }
.shift-item a:hover { text-decoration: underline; }
.shift-time { font-weight: 600; }
.shift-note { grid-column: 1 / -1; color: var(--slate); font-size: var(--step--1); }
.shift-item .row-actions { grid-row: 1 / span 2; grid-column: 2; }
.icon-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--slate);
    min-height: 30px;
    width: 30px;
    padding: 0;
    border-radius: 6px;
    font-size: 15px;
}
.icon-btn:hover { background: var(--surface); border-color: var(--rule); color: var(--ink); }
.icon-btn.ok:hover { color: var(--fir); }
.icon-btn.danger:hover { color: var(--talon); }
.drop-hint { padding: 12px 14px; color: #8F99A8; font-size: var(--step--1); }
.drop-hover { outline: 2px dashed var(--ink); outline-offset: -4px; background: #F8F9FB; }

.day-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
}
.day-actions form { margin: 0; }

/* ---------- Week planning ---------- */

.week-table th, .week-table td { min-width: 120px; }
.week-table td:first-child, .week-table th:first-child { min-width: 150px; font-weight: 600; position: sticky; left: 0; background: var(--surface); }
.week-table thead th:first-child { background: #F8F9FB; }
.week-table th.is-today { color: var(--ink); box-shadow: inset 0 -3px 0 var(--beak); }
.week-chip {
    border-left: 3px solid var(--fir);
    background: var(--fir-wash);
    border-radius: 6px;
    padding: 6px 28px 6px 8px;
    margin-bottom: 6px;
    font-size: var(--step--1);
    position: relative;
}
.week-chip.is-draft { border-left-color: var(--beak); background: var(--beak-wash); }
.week-chip[draggable="true"] { cursor: grab; }
.week-chip[draggable="true"]:active { cursor: grabbing; }
.week-chip.is-dragging { opacity: .45; }
.week-cell.drop-hover { outline: 2px dashed var(--ink); outline-offset: -4px; background: #F8F9FB; }
.week-cell.drop-denied { background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(196, 43, 47, .06) 6px 12px); }
.week-chip .shift-time { display: block; font-size: var(--step-0); white-space: nowrap; }
.week-chip form { position: absolute; top: 2px; right: 2px; margin: 0; }
.week-chip .icon-btn { min-height: 24px; width: 24px; font-size: 12px; }

/* ---------- Month calendar (admin user details) ---------- */

.calendar { table-layout: fixed; min-width: 840px; }
.calendar th { text-align: left; }
.calendar td { height: 110px; padding: 6px 8px; border-right: 1px solid var(--rule-soft); }
.calendar td:last-child { border-right: none; }
.calendar td.is-outside { background: #FAFBFC; }
.calendar td.is-today { box-shadow: inset 0 3px 0 var(--beak); }
.cal-date { font-size: var(--step--1); font-weight: 650; color: var(--slate); margin-bottom: 4px; }
.cal-holiday { color: var(--talon); font-weight: 600; }
.report-note { margin-top: 8px; max-width: 80ch; }
.cal-total { font-size: var(--step--1); font-weight: 650; color: var(--ink); margin-top: 4px; }
.worklog-chip {
    display: block;
    padding: 4px 6px;
    margin: 0 0 4px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--surface);
    cursor: grab;
    user-select: none;
    font-size: var(--step--1);
}
.worklog-chip:active { cursor: grabbing; }
.worklog-chip.is-open { border-color: var(--beak); background: var(--beak-wash); }
.worklog-chip .row-actions { display: flex; gap: 8px; margin-top: 2px; }
.worklog-chip .row-actions a, .worklog-chip .link-button { font-size: 12px; }

/* ---------- Login ---------- */

body.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        linear-gradient(180deg, var(--ink) 0, var(--ink) 38vh, var(--paper) 38vh);
}
body.login .page { padding: 0; width: 100%; max-width: 400px; }
.login-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(24, 33, 46, .18);
    padding: 28px 28px 24px;
}
.login-mascot { display: block; width: 132px; margin: -84px auto 8px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }
.login-card h1 { text-align: center; margin-bottom: 4px; }
.login-card .lede { text-align: center; color: var(--slate); margin: 0 auto 20px; }
.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    color: var(--slate);
    font-size: var(--step--1);
}
.login-footer img { height: 22px; width: auto; }

/* ---------- Print ---------- */

@media print {
    .topbar, .back-link, .no-print, .day-actions, .planning-tools, form button, .row-actions, .icon-btn { display: none !important; }
    body { background: #fff; }
    .page { padding: 0; max-width: none; }
    .table-wrap, .subsection-block, .panel { border-color: #999; box-shadow: none; }
    .shift-item, .week-chip { background: none !important; }
}

/* ---------- Day planning print: landscape, one column per section ---------- */

.print-only { display: none; }

@media print {
    .print-only { display: block !important; }
    .page-header, .is-empty, .drop-hint { display: none !important; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    .print-title {
        display: flex !important;
        justify-content: space-between;
        align-items: baseline;
        border-bottom: 0.4mm solid var(--ink);
        padding-bottom: 1.5mm;
        margin-bottom: 3mm;
        font-size: 11pt;
    }
    .print-title strong { font-size: 13pt; }
    .print-title span { font-size: 9pt; color: #444; }

    /* Newspaper columns: sections flow down and continue in the next column, so short
       sections stack and a long one does not leave the others' columns empty.
       Columns are ~68 mm wide: four fill a landscape page, fewer stay compact. */
    .sections-grid {
        display: block;
        column-count: var(--print-cols, 4);
        column-gap: 3mm;
        max-width: calc(var(--print-cols, 4) * 68mm + (var(--print-cols, 4) - 1) * 3mm);
        margin: 0 auto;
    }
    .section-col { margin: 0 0 3mm; }
    .section-col h2 {
        break-inside: avoid;
        margin: 0 0 1.5mm;
        padding: 1.2mm 2mm;
        font-size: 10pt;
        text-align: center;
        background: var(--ink);
        color: #fff;
        break-after: avoid;
    }
    .subsection-block {
        border: 0.25mm solid #888;
        border-radius: 0;
        margin: 0 0 2mm;
        break-inside: avoid;
    }
    .subsection-block > h3 {
        padding: 0.8mm 2mm;
        font-size: 8.5pt;
        text-align: center;
        background: #DDE2E8;
        border-bottom: 0.25mm solid #888;
    }
    .subsection-block > h3 .muted { display: none; }
    .shift-list { padding: 0; min-height: 0; }
    .shift-item {
        display: flex;
        align-items: baseline;
        gap: 0 1.5mm;
        margin: 0;
        padding: 0.7mm 2mm;
        border: 0;
        border-top: 0.15mm solid #ccc;
        border-radius: 0;
        font-size: 8pt;
        line-height: 1.25;
        cursor: auto;
    }
    .shift-item:first-child { border-top: 0; }
    /* Name (note) .......... time */
    .shift-item > a { order: 0; min-width: 0; color: #000; font-weight: 600; text-decoration: none; }
    .shift-item > .shift-note { order: 1; min-width: 0; font-size: 7.5pt; color: #333; }
    .shift-item > .shift-note::before { content: "("; }
    .shift-item > .shift-note::after { content: ")"; }
    .shift-item > .shift-time { order: 2; margin-left: auto; padding-left: 2mm; white-space: nowrap; font-weight: 600; }
    .shift-item .tag {
        padding: 0;
        background: none;
        color: #000;
        font-size: 6.5pt;
        font-weight: 500;
        font-style: italic;
    }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
