.schedule-grid { table-layout: fixed; min-width: var(--grid-min, 1150px); }
/* Tight cells so more people fit on screen. */
.schedule-grid > :not(caption) > * > * { padding: 3px 4px; }
.schedule-grid th.employee-col { width: 180px; }
.schedule-grid th.total-col { width: 70px; }
.schedule-grid td { vertical-align: top; }
.schedule-grid .today { background-color: rgba(255, 193, 7, 0.12); }
/* Each shift (each part of a split shift) on one line, in a small font; anything too long for a narrow window is cut off with "...". */
.shift-chip { display: block; border-left: 4px solid #999; background: #f8f9fa; border-radius: 4px; padding: 1px 4px; margin-bottom: 2px; font-size: 0.72rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit; text-decoration: none; }
.shift-chip .shift-part { display: block; overflow: hidden; text-overflow: ellipsis; }
.shift-chip:hover { background: #e9ecef; }
.shift-chip small { display: block; color: #6c757d; }
/* Shifts added by Build schedule, until the manager changes them. The left border keeps the job colour. */
.shift-chip.shift-built { border-top: 1px dashed #6c757d; border-right: 1px dashed #6c757d; border-bottom: 1px dashed #6c757d; }
@media print { .shift-chip.shift-built { border-top: 0; border-right: 0; border-bottom: 0; } }
/* Printed schedule: each shift's start and end stay on one line. Landscape and tighter cells give the wider lines room. */
@page { size: landscape; margin: 0.4in; }
@media print {
    .shift-chip, .shift-chip .shift-part { white-space: nowrap; font-size: 0.7rem; padding: 1px 4px; margin-bottom: 0; overflow: visible; text-overflow: clip; }
    .shift-chip .shift-part { padding: 0; }
    .shift-chip + .shift-chip { margin-top: 2px; }
    .schedule-grid { font-size: 0.75rem; }
    .schedule-grid > :not(caption) > * > * { padding: 2px 4px; }
}
.colour-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
/* Employee list: white on green for people who can be scheduled, white on red for those who can't. */
.table > tbody > tr.employee-active > * { --bs-table-bg: var(--bs-success); --bs-table-color: #fff; }
.table > tbody > tr.employee-inactive > * { --bs-table-bg: var(--bs-danger); --bs-table-color: #fff; }
.table > tbody > tr.employee-active a:not(.btn), .table > tbody > tr.employee-inactive a:not(.btn) { color: #fff; }
@media print {
    nav, .no-print { display: none !important; }
    .schedule-grid tr.no-shifts { display: none; }
    .schedule-grid { min-width: 0; }
}
/* A person's name on the schedule grid, dragged onto a day to add a shift. */
.employee-drag { cursor: grab; user-select: none; border-radius: 4px; padding: 1px 4px; margin-left: -4px; }
.employee-drag::before { content: "\2807"; color: #adb5bd; margin-right: 4px; }
.employee-drag:hover { background: rgba(13, 110, 253, 0.08); }
.employee-drag:active { cursor: grabbing; }
@media print { .employee-drag::before { content: none; } }
/* The + and "+ note" buttons sit over the cell's top-right corner on hover, so no space is kept for them. */
.schedule-grid td.drop-cell { position: relative; }
.dragging-employee .schedule-grid td.drop-cell { outline: 1px dashed #adb5bd; outline-offset: -3px; }
.schedule-grid td.drop-over { background-color: rgba(13, 110, 253, 0.12) !important; outline: 2px dashed #0d6efd !important; }
.add-shift-btn { position: absolute; right: 2px; top: 1px; z-index: 1; border: 0; border-radius: 4px; background: var(--bs-body-bg); box-shadow: 0 0 0 1px #dee2e6; color: #adb5bd; font-size: 1.1rem; line-height: 1; padding: 0 4px; opacity: 0; }
.schedule-grid td.drop-cell:hover .add-shift-btn, .add-shift-btn:focus { opacity: 1; }
.add-shift-btn:hover { color: #0d6efd; }
@media (hover: none) { .add-shift-btn { opacity: 1; } }
.schedule-grid td.unavailable { background-image: repeating-linear-gradient(135deg, rgba(108, 117, 125, 0.12) 0, rgba(108, 117, 125, 0.12) 6px, transparent 6px, transparent 12px); }
.unavailable-chip { display: block; font-size: 0.75rem; color: #842029; background: #f8d7da; border-radius: 4px; padding: 1px 6px; margin-bottom: 4px; }
/* Schedule grid by job: a heavy border between jobs, then the job's row (people working each day and notes), then its people. */
.schedule-grid > tbody.job-group { border-top: 3px solid #495057; }
.schedule-grid tr.job-row > * { background-color: #f1f3f5; }
.schedule-grid th.job-name { font-weight: 600; }
/* The grid scrolls inside the window so the day headings and names stay in view. */
/* The vertical scroll bar is always shown (a solid bar, not one that fades away), even when the schedule fits. */
.schedule-scroll { max-height: calc(100vh - 1rem); overflow-x: auto; overflow-y: scroll; scrollbar-width: auto; scrollbar-color: #adb5bd #f1f3f5; border: 1px solid var(--bs-border-color); }
.schedule-scroll .schedule-grid { margin-bottom: 0; }
.schedule-scroll .schedule-grid > thead > tr:first-child > th { position: sticky; top: 0; z-index: 3; box-shadow: inset 0 -1px 0 var(--bs-border-color); }
.schedule-scroll .schedule-grid > tbody > tr > th { position: sticky; left: 0; z-index: 2; background-color: var(--bs-body-bg); }
.schedule-scroll .schedule-grid > tbody > tr.job-row > th, .schedule-scroll .schedule-grid > thead > tr > th:first-child { background-color: #f1f3f5; }
.schedule-scroll .schedule-grid > thead > tr:first-child > th:first-child { left: 0; z-index: 4; }
/* The Hours column stays on the right while the days scroll sideways between it and the names. */
.schedule-scroll .schedule-grid > * > tr > :last-child:not([colspan]) { position: sticky; right: 0; z-index: 2; background-color: var(--bs-body-bg); box-shadow: inset 1px 0 0 var(--bs-border-color); }
.schedule-scroll .schedule-grid > thead > tr > :last-child:not([colspan]) { background-color: #f1f3f5; }
.schedule-scroll .schedule-grid > thead > tr:first-child > th:last-child { z-index: 4; }
.schedule-scroll .schedule-grid > tbody > tr.job-row > :last-child { background-color: #f1f3f5; }

/* Click a job's name to fold its people away. */
.job-toggle { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.job-caret::before { content: "\25BE"; display: inline-block; width: 1em; color: #6c757d; }
.job-folded .job-caret::before { content: "\25B8"; }
.schedule-grid tbody.job-folded > tr:not(.job-row) { display: none; }
@media print {
    .schedule-scroll { max-height: none; overflow: visible; border: 0; }
    .schedule-scroll .schedule-grid th, .schedule-scroll .schedule-grid td { position: static !important; }
    .schedule-grid tbody.job-folded > tr:not(.job-row):not(.no-shifts) { display: table-row; }
    .job-caret { display: none; }
}
.schedule-grid > tbody > tr > th.employee-name { padding-left: 1.5rem; }
.schedule-grid td.job-day, .schedule-grid td.note-cell { position: relative; }
/* One-line day headings; the store's "+ note" button shows on hover. */
.schedule-grid th.day-head { white-space: nowrap; }
.schedule-grid th.day-head:hover .add-note-btn, .add-note-btn:focus { opacity: 1; }
/* Slim job rows: a short "X of Y" box. */
.schedule-grid tr.job-row > * { padding-top: 2px; padding-bottom: 2px; }
.requirement-input { height: 1.25rem; }
/* "By person": each shift also names its job. */
/* On the same line as the times; a long job name is cut off with "..." (the chip's tooltip has it in full). */
.person-group .shift-chip .shift-part { display: inline; }
.shift-chip .shift-job { display: inline; margin-left: 4px; color: #6c757d; font-size: 0.65rem; }
/* Build schedule and Add a shift slide in from the right. */
.schedule-panel { --bs-offcanvas-width: 520px; }
.schedule-toolbar h1 { font-weight: 600; }
.schedule-grid tr.store-notes-row > * { vertical-align: top; }
/* "Only show people with shifts": hides people without shifts; job rows stay. */
.schedule-grid.hide-empty tbody.job-group > tr.no-shifts { display: none; }
.job-people { display: block; font-size: 0.75rem; font-weight: 600; color: #495057; }
/* Against the staffing requirement: red when short, blue when over, green when met. */
.job-people.job-short { color: #b02a37; }
.job-people.job-over { color: #0a58ca; }
.job-people.job-met { color: #146c43; }
.requirement-cell { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.requirement-input { width: 3.2rem; padding: 0 4px; font-size: 0.75rem; font-weight: 600; border: 1px solid #ced4da; border-radius: 4px; color: inherit; background: #fff; }
.requirement-input.changed { border-color: #0d6efd; background: #e7f1ff; }
@media print { .requirement-input { border: 0; background: transparent; width: 2rem; } }
.note-chip { width: 100%; text-align: left; font-size: 0.75rem; line-height: 1.25; color: #664d03; background: #fff3cd; border: 0; border-left: 3px solid #ffc107; border-radius: 4px; padding: 1px 6px; margin-bottom: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
button.note-chip:hover { background: #ffe69c; }
.add-note-btn { position: absolute; right: 2px; top: 2px; z-index: 1; border: 0; border-radius: 4px; background: var(--bs-body-bg); box-shadow: 0 0 0 1px #dee2e6; color: #adb5bd; font-size: 0.75rem; line-height: 1; padding: 0 4px; opacity: 0; }
.schedule-grid td.job-day:hover .add-note-btn, .schedule-grid td.note-cell:hover .add-note-btn, .add-note-btn:focus { opacity: 1; }
.add-note-btn:hover { color: #0d6efd; }
@media (hover: none) { .add-note-btn { opacity: 1; } }
@media print {
    .schedule-grid tbody.no-shifts { display: none; }
    .note-chip { display: none !important; }
    .schedule-grid tr.job-row > * { background-color: #f1f3f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Field labels are bold on every page. */
.form-label {
    font-weight: bold;
}

/* Store Settings: keep the daily shift start table and minutes between starts compact. */
.shift-start-input {
    width: 8.5rem;
}

/* Store look and feel. */
.store-logo-nav {
    max-height: 32px;
    max-width: 160px;
    object-fit: contain;
}

.store-logo-current {
    max-height: 48px;
    max-width: 200px;
    object-fit: contain;
}

.store-logo-login {
    max-height: 96px;
    max-width: 100%;
    object-fit: contain;
}

.store-logo-print {
    max-height: 64px;
    max-width: 240px;
    object-fit: contain;
}

.brand-swatch-colour {
    width: 1.75rem;
    height: 1.75rem;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #adb5bd;
    padding: 0;
}

.brand-swatch-colour.active {
    box-shadow: 0 0 0 2px #212529;
}

.brand-preview {
    max-width: 28rem;
}

/* Field hints: the ⓘ icon after a label. */
.kiss-hint { margin-left: 0.25rem; color: var(--bs-secondary-color); cursor: help; font-size: 0.85em; }
.kiss-hint:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; border-radius: 50%; }
@media print { .kiss-hint { display: none; } }
/* Tooltips turned off on the profile: no ⓘ icons either (the layout's script takes the title text off everything else). */
.kiss-no-tooltips .kiss-hint { display: none; }

/* Jobs sub tabs and the Job Order page */
.jobs-subnav .nav-link { padding: .25rem .75rem; }
.job-order .job-order-handle-col { width: 2rem; }
.job-order .drag-handle { cursor: grab; user-select: none; color: #6c757d; font-size: 1.1rem; padding: .25rem; touch-action: none; }
.job-order .drag-handle:active { cursor: grabbing; }
.job-order tr.job-dragging { opacity: .5; }
.job-order input[type="text"] { max-width: 24rem; }
.validation-summary-valid { display: none; }

/* Printed schedule: no empty space under each person's shifts. The space is for the on-screen + buttons, so these
   rules come last to win over the cell padding set above. */
@media print {
    .schedule-grid td.drop-cell, .schedule-grid td.job-day, .schedule-grid td.note-cell { min-height: 0; padding-bottom: 2px; }
    /* The daily job requirements ("2 of 2", "3 people") are for building the schedule, not for staff. */
    .schedule-grid .job-people { display: none !important; }
}

/* KISS's confirmation dialog (wwwroot/js/kiss-dialog.js). The top bar, icon and main button follow the store's colour;
   deletes are always red and warnings amber. */
.kiss-dialog .modal-content { border: 0; border-radius: .75rem; overflow: hidden; box-shadow: 0 1rem 3rem rgba(0,0,0,.25); }
.kiss-dialog .modal-content::before { content: ""; display: block; height: 5px; background: var(--kiss-dialog-accent); }
.kiss-dialog .modal-body { padding: 1.5rem 1.5rem 1rem; display: flex; gap: 1rem; align-items: flex-start; }
.kiss-dialog .kiss-dialog-icon { flex: 0 0 auto; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--kiss-dialog-tint); color: var(--kiss-dialog-accent); }
.kiss-dialog .kiss-dialog-icon svg { width: 1.4rem; height: 1.4rem; }
.kiss-dialog .kiss-dialog-title { font-size: 1.125rem; font-weight: 600; margin: .35rem 0; }
.kiss-dialog .kiss-dialog-message { color: var(--bs-secondary-color); margin: 0; white-space: pre-line; }
.kiss-dialog .kiss-dialog-input { margin-top: .75rem; }
.kiss-dialog .modal-footer { border-top: 0; padding: .5rem 1.5rem 1.25rem; gap: .5rem; }
.kiss-dialog .modal-footer > * { margin: 0; }
.kiss-dialog.tone-primary { --kiss-dialog-accent: var(--kiss-brand, #212529); --kiss-dialog-tint: rgba(var(--bs-primary-rgb), .12); }
.kiss-dialog.tone-danger { --kiss-dialog-accent: var(--bs-danger); --kiss-dialog-tint: rgba(var(--bs-danger-rgb), .12); }
.kiss-dialog.tone-warning { --kiss-dialog-accent: #b7791f; --kiss-dialog-tint: rgba(var(--bs-warning-rgb), .2); }

/* Schedule page: bin in the lower left; drop a shift on it to delete the shift. */
.shift-trash { position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 1030; width: 3.5rem; height: 3.5rem; padding: 0.75rem; border-radius: 50%; background: var(--bs-body-bg); color: var(--bs-secondary-color); border: 2px solid var(--bs-border-color); box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15); transition: transform 0.15s, background-color 0.15s, color 0.15s, border-color 0.15s; }
.shift-trash svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.dragging-shift .shift-trash { border-color: var(--bs-danger); color: var(--bs-danger); }
.shift-trash.over { transform: scale(1.2); background: var(--bs-danger); border-color: var(--bs-danger); color: #fff; }
/* The flame above the bin: flickers while a shift is held over it, flares up and dies away when it is dropped. */
.shift-trash .trash-flame { position: absolute; left: 50%; bottom: 72%; width: 2.2rem; height: 3rem; margin-left: -1.1rem; opacity: 0; transform: scale(0); transform-origin: 50% 100%; transition: opacity 0.15s, transform 0.15s; pointer-events: none; }
.shift-trash .trash-flame svg { width: 100%; height: 100%; display: block; transform-origin: 50% 100%; }
.trash-flame .flame-outer { fill: #fd7e14; }
.trash-flame .flame-inner { fill: #ffda6a; }
.shift-trash.over .trash-flame { opacity: 1; transform: scale(0.85); }
.shift-trash.over .trash-flame svg { animation: trash-flicker 0.18s ease-in-out infinite alternate; }
.shift-trash.burning { background: var(--bs-danger); border-color: var(--bs-danger); color: #fff; animation: trash-shake 0.1s linear 4; }
.shift-trash.burning .trash-flame { opacity: 1; transform: scale(1); animation: trash-flare 0.7s ease-out forwards; }
.shift-trash.burning .trash-flame svg { animation: trash-flicker 0.1s ease-in-out infinite alternate; }
.shift-chip.burnt { animation: chip-burn 0.6s ease-in forwards; pointer-events: none; }
@keyframes trash-flicker {
    from { transform: scaleY(1) skewX(-4deg); }
    to { transform: scaleY(1.12) skewX(4deg); }
}
@keyframes trash-flare {
    0% { transform: scale(0.85); opacity: 1; }
    45% { transform: scale(1.7); opacity: 1; }
    100% { transform: scale(0.4); opacity: 0; }
}
@keyframes trash-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px) rotate(-4deg); }
    75% { transform: translateX(3px) rotate(4deg); }
}
@keyframes chip-burn {
    0% { background: #fff3cd; }
    40% { background: #fd7e14; color: #fff; }
    100% { background: #212529; color: transparent; opacity: 0; transform: scaleY(0.4); }
}
@media (prefers-reduced-motion: reduce) {
    .shift-trash .trash-flame svg, .shift-trash.burning, .shift-trash.burning .trash-flame, .shift-chip.burnt { animation: none; }
}

/* Store settings, daily schedule: closed days are greyed out. */
.daily-schedule tr.day-closed td:not(:nth-child(2)) { opacity: 0.45; }
/* Holidays and closed days on the schedule: nothing can be scheduled, so their cells are greyed and striped. */
.schedule-grid .day-off { background-image: repeating-linear-gradient(135deg, rgba(108, 117, 125, 0.08) 0, rgba(108, 117, 125, 0.08) 6px, transparent 6px, transparent 12px); }
.schedule-grid th .day-flag { display: block; font-size: 0.68rem; font-weight: 600; color: #842029; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Store settings: each section is a card with a coloured heading bar, and Save stays in view at the bottom. */
.settings-section { scroll-margin-top: 1rem; }
.settings-section > .card-header { background: var(--bs-tertiary-bg); border-left: 4px solid var(--bs-primary); }
.settings-section > .card-body > :last-child { margin-bottom: 0 !important; }
.settings-actions { position: sticky; bottom: 0; z-index: 5; background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color); padding: 0.75rem 0; margin-bottom: 1rem; }
.schedule-grid th .day-flag.day-flag-warn { color: #997404; }
/* A key after the names of key holders. */
.key-holder-mark { display: inline-block; width: 1.1em; height: 1.1em; margin-left: 0.25em; vertical-align: -0.15em; color: #b8860b; }
.employee-active .key-holder-mark, .employee-inactive .key-holder-mark { color: #ffe08a; }
.key-holder-mark svg { width: 100%; height: 100%; display: block; }
/* Section quick links stay on one line (scrolling sideways on a narrow screen rather than wrapping). */
.settings-nav { flex-wrap: nowrap !important; overflow-x: auto; }
.settings-nav > a { white-space: nowrap; flex: 0 0 auto; }
/* Super Admin dashboard tiles. */
.dashboard-tile { border-left: 4px solid var(--bs-primary); }
.dashboard-tile-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--bs-secondary-color); }
.dashboard-tile-value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.dashboard-bar { height: 0.6rem; background: var(--bs-primary); border-radius: 3px; min-width: 2px; }

/* A table filling a card (Jobs tab): its cells line up with the card header's padding, and the last row has no line. */
.card-table > :not(caption) > * > * {
    padding-left: 1rem;
    padding-right: 1rem;
}

.card-table > tbody:last-child > tr:last-child > * {
    border-bottom-width: 0;
}

/* Keeps the line breaks someone typed, such as a trade message. */
.text-prewrap { white-space: pre-wrap; }
