/* Redesign (October 2026): the shift-wall.com look, matching Shift-Wall. A navy header with a big clock, calm white
   name cards with each person's colour, one clear blue action, and a navy admin menu. Loaded after styles.css and
   only overrides it. */
:root {
  --navy: #142238;
  --navy-raised: #1b2d47;
  --navy-line: #34496a;
  --on-navy: #d2dfed;
  --on-navy-muted: #acbfd4;
  --sky: #85bbff;
  --sky-hover: #aad0ff;
  --brand: #1f5fb5;
  --brand-hover: #184e90;
  --mist: #eaf1f8;
  --bg-main: #eef2f6;
  --radius-md: 12px;
  --radius-lg: 18px;
  --card-shadow: 0 1px 2px rgb(18 32 51 / 5%), 0 12px 28px -22px rgb(18 32 51 / 40%);
}
:root[data-theme="dark"] {
  --navy: #101b2e;
  --navy-raised: #1b2d47;
  --navy-line: #2c4060;
  --brand: #6aa6f2;
  --brand-hover: #8dbbf6;
  --mist: #17263b;
  --bg-main: #0b1220;
  --card-shadow: none;
}
body { background: var(--bg-main); }

/* Header: navy, like the website's hero, with the clock as the main thing. */
.app-header { background: var(--navy); border-bottom: 0; color: #f7f8fb; padding: 0.7rem 1.5rem; }
.brand-logo, .brand-logo h1 { color: #ffffff; letter-spacing: -0.03em; white-space: nowrap; }
.brand-logo svg { color: var(--sky); }
.live-clock-container { background: transparent; border: 0; padding: 0; }
.live-time { color: #ffffff; font-size: 1.9rem; font-weight: 760; letter-spacing: -0.02em; }
.live-date { color: var(--on-navy-muted); border-left-color: var(--navy-line); }
.app-header .btn-outline { background: transparent; border-color: var(--navy-line); color: var(--on-navy); }
.app-header .btn-outline:hover { background: var(--navy-raised); border-color: var(--navy-line); color: #ffffff; }
.app-header .btn-primary { background: var(--sky); color: #101b2e; }
.app-header .btn-primary:hover { background: var(--sky-hover); }
.app-header .theme-toggle { background: transparent; border-color: var(--navy-line); color: var(--on-navy); }
.connection-status-badge { border-radius: 999px; }

/* Kiosk: quiet bar above the names. */
.kiosk-subbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.stat-pill { border-radius: 999px; }

/* Name cards: white, the person's colour in a solid initials circle, one blue action. */
.employee-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.employee-card:hover { border-color: var(--border-focus); box-shadow: 0 14px 30px -18px rgb(18 32 51 / 45%); }
.employee-card.is-in, .employee-card.is-in:hover { background: var(--surface); border-color: var(--border); }
/* Each person's own colour (--p-h from the server), equally light for every hue (OKLCH). */
.person-tone { --tone-edge: oklch(0.6 0.17 var(--p-h)); }
.person-tone.deep { --tone-edge: oklch(0.5 0.16 var(--p-h)); }
:root[data-theme="dark"] .person-tone { --tone-edge: oklch(0.76 0.13 var(--p-h)); }
.employee-card .avatar, .employee-card.is-in .avatar { background: var(--tone-edge, var(--chip-bg)); color: #ffffff; box-shadow: none; border: 0; }
:root[data-theme="dark"] .employee-card .avatar { color: #0d1522; }
.emp-name { font-size: 1.2rem; letter-spacing: -0.02em; }
/* The staff code is for payroll, not for finding your own name. */
.emp-meta > span:not(.dept-badge) { display: none; }
.dept-badge { border-radius: 999px; }
.card-status-row { border-top-color: var(--border); }
.status-tag.in { background: transparent; padding-left: 0; }
.status-tag.out { background: transparent; padding-left: 0; }
.card-action-btn { min-height: 52px; border-radius: 14px; font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; }
.card-action-btn.in-btn { background: var(--brand); color: #ffffff; }
.card-action-btn.in-btn:hover { background: var(--brand-hover); }
.card-action-btn.out-btn { background: var(--surface); color: var(--text-main); border: 2px solid var(--primary); }
.card-action-btn.out-btn:hover { background: var(--mist); }
:root[data-theme="dark"] .card-action-btn.in-btn { color: #0d1522; }

/* Confirm dialog: big, calm, one blue button. */
.modal-content { border-radius: 22px; border: 0; box-shadow: 0 30px 60px -20px rgb(0 0 0 / 45%); }
.modal-header h3 { font-weight: 760; letter-spacing: -0.02em; font-size: 1.35rem; }
.confirm-profile-card { border-radius: 16px; }
.confirm-action-banner { border-radius: 16px; }
.confirm-action-banner.is-in { background: var(--mist); border-color: transparent; color: var(--brand); }
.confirm-action-banner.is-out { background: var(--navy); border-color: transparent; color: #ffffff; }
#modal-confirm-btn { min-height: 56px; padding-inline: 1.6rem; border: 0; border-radius: 14px; background: var(--brand); color: #ffffff; font-size: 1.08rem; font-weight: 800; }
#modal-confirm-btn:hover { background: var(--brand-hover); }
:root[data-theme="dark"] #modal-confirm-btn { color: #0d1522; }
.modal-footer .btn-outline { min-height: 56px; border-radius: 14px; font-weight: 700; }
.keypad-key { border-radius: 16px; font-weight: 760; }

/* Admin: navy menu like Shift-Wall's, white cards on the mist page. */
.admin-layout { --bg-main: #eef2f6; --bg-card: #ffffff; }
:root[data-theme="dark"] .admin-layout { --bg-main: #0b1220; --bg-card: #142033; }
.admin-sidebar { background: linear-gradient(180deg, #1d3150 0%, #142238 100%); border-right: 0; }
:root[data-theme="dark"] .admin-sidebar { background: linear-gradient(180deg, #18283f 0%, #101b2e 100%); }
.admin-sidebar .nav-item { border-radius: 12px; }
/* Computer: the admin menu floats as a soft rounded panel, like Shift-Wall's. */
@media (min-width: 1025px) {
  .admin-sidebar { margin: 16px 0 16px 16px; border-radius: 22px; box-shadow: 0 18px 40px -24px rgb(18 32 51 / 55%); }
  :root[data-theme="dark"] .admin-sidebar { box-shadow: none; }
}
.admin-sidebar .nav-item { color: var(--on-navy); }
.admin-sidebar .nav-item:hover { background: var(--navy-raised); color: #ffffff; }
.admin-sidebar .nav-item.active { background: rgb(133 187 255 / 16%); color: #ffffff; }
.admin-sidebar :focus-visible { outline-color: var(--sky); }
.admin-sidebar .sidebar-count { background: var(--sky); color: #101b2e; }
.admin-sidebar .sidebar-bottom { border-top-color: var(--navy-line); }
.admin-sidebar .sidebar-bottom .btn-outline, .admin-sidebar .sidebar-bottom button { color: var(--on-navy); border-color: var(--navy-line); background: transparent; }
/* The phone menu's heading sits on the same navy as the items below it. */
.admin-sidebar .admin-drawer-heading { color: #ffffff; border-bottom-color: var(--navy-line); }
.admin-section-header h2 { font-size: 2rem; font-weight: 760; letter-spacing: -0.045em; }
.admin-main .card, .admin-main .stat-card, .admin-main .table-container, .admin-main .panel {
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}
.btn { border-radius: var(--radius-md); }

/* Motion: short and light (colour, opacity, movement only), off for people who ask for reduced motion. */
.btn, .card-action-btn, .nav-item, .keypad-key, .stat-pill { transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.btn:active:not(:disabled), .card-action-btn:active, .keypad-key:active { transform: scale(.97); }
.modal-backdrop:not([hidden]) { animation: hw-fade .2s ease-out; backdrop-filter: none; }
.modal-backdrop:not([hidden]) .modal-content { animation: hw-pop .22s ease-out; }
@keyframes hw-fade { from { opacity: 0; } }
@keyframes hw-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@media (prefers-reduced-motion: reduce) {
  .btn, .card-action-btn, .nav-item, .keypad-key, .stat-pill { transition: none; }
  .modal-backdrop:not([hidden]), .modal-backdrop:not([hidden]) .modal-content { animation: none; }
}

/* ======================================================================
   Phones and tablets. Kiosk: one compact header row (icons for the less used buttons), counters on one line,
   compact name cards on a phone. Admin: a tab bar at the bottom like the one in Shift-Wall, page titles above
   their buttons, and long tables as small cards on a phone.
   ====================================================================== */
.admin-tabs { display: none; }

@media (max-width: 1366px) {
  /* Back, Info and Fullscreen become icon buttons (the words stay for screen readers); the date stays on one line. */
  #btn-back-workplaces > span, #btn-kiosk-help > span, #btn-fullscreen > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #btn-back-workplaces, #btn-kiosk-help, #btn-fullscreen { width: 44px; min-width: 44px; height: 44px; padding: 0; justify-content: center; }
  .header-actions .btn svg { flex-shrink: 0; }
  .live-date { white-space: nowrap; }
  .header-actions .btn { white-space: nowrap; }
}

@media (max-width: 1024px) {
  /* One header row: name and clock on the left, buttons on the right (they go below only on a phone). */
  .app-header { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.6rem 1rem; }
  .brand-section { width: auto; flex: 1 1 auto; justify-content: flex-start; gap: 1rem; }
  .live-clock-container { flex-direction: row; align-items: baseline; gap: 0.5rem; padding: 0; }
  .live-time { font-size: 1.6rem; }
  .header-actions { width: auto; flex-wrap: nowrap; justify-content: flex-end; gap: 0.4rem; }
  .header-actions .btn { min-height: 44px; }
  /* The admin pages: a tab bar at the bottom; More opens the full menu. */
  .admin-menu-toggle { display: none !important; }
  .admin-main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .admin-tabs {
    position: fixed;
    inset: auto 0 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 26px -22px rgb(18 32 51 / 45%);
  }
  .admin-tabs button { position: relative; display: grid; place-items: center; gap: 2px; min-height: 56px; padding: 4px 0; border: 0; border-radius: 12px; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer; }
  .admin-tabs button::before { content: ""; position: absolute; top: 4px; left: 50%; width: 56px; height: 30px; margin-left: -28px; border-radius: 999px; background: var(--mist); opacity: 0; scale: .4 1; transition: opacity .25s ease, scale .45s var(--ease-spring, ease); }
  .admin-tabs button > svg, .admin-tabs button > span { position: relative; }
  .admin-tabs button[aria-current="page"] { color: var(--text-main); font-weight: 800; }
  .admin-tabs button[aria-current="page"]::before { opacity: 1; scale: 1; }
  .admin-tabs button[aria-current="page"] svg { color: var(--brand); }
  .admin-tab-count { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #ffffff; font-size: 0.68rem; line-height: 18px; }
  .admin-tab-count[hidden] { display: none; }
  /* Page titles sit above their buttons, which share a row and stay big enough to tap. */
  .admin-section-header { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .admin-section-header h2 { font-size: 1.6rem; }
  .admin-section-header > :not(h2) { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .admin-section-header .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  /* Attendance on a tablet: row buttons side by side instead of stacked. */
  #attendance-table-body .row-actions { flex-direction: row; flex-wrap: wrap; gap: 0.35rem; }
  #attendance-table-body .row-actions .btn { padding: 0.3rem 0.6rem; min-height: 36px; }
}

@media (max-width: 600px) {
  /* Kiosk on a phone: the clock beside the name, small icon buttons below, no fullscreen (phones cannot). */
  .app-header { padding: 0.5rem 0.75rem; }
  .brand-section { width: 100%; justify-content: space-between; }
  .live-date { display: none; }
  .live-time { font-size: 1.5rem; }
  .header-actions { width: 100%; justify-content: space-between; }
  #btn-fullscreen { display: none; }
  #kiosk-connection-badge { padding: 0 0.55rem; min-height: 44px; }
  #kiosk-connection-badge .status-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #lang-toggle-btn { font-size: 0; min-width: 48px; padding: 0 0.6rem; }
  :root[lang="nl"] #lang-toggle-btn::after { content: "EN"; font-size: 0.95rem; }
  :root:not([lang="nl"]) #lang-toggle-btn::after { content: "NL"; font-size: 0.95rem; }
  .header-actions .btn { padding-inline: 0.7rem; }
  /* In the admin pages, Back to Kiosk is in the More menu, so the header is one row: name, language, light/dark. */
  .admin-view #btn-open-admin { display: none; }
  .admin-view .app-header { flex-wrap: nowrap; }
  .admin-view .brand-section { width: auto; min-width: 0; }
  .admin-view .header-actions { width: auto; justify-content: flex-end; }
  .admin-view #lang-toggle-btn { flex: 0 0 auto; }
  /* Page buttons: the two outline ones share a row, the main one is full width. */
  .admin-section-header .btn-outline { flex: 1 1 calc(50% - 0.25rem); font-size: 0.85rem; white-space: normal; line-height: 1.2; }
  .admin-section-header .btn-primary { flex: 1 1 100%; }
  /* Counters on one line, search and filters full width. */
  .stats-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; width: 100%; }
  .stat-pill { justify-content: center; padding: 0.45rem 0.4rem; font-size: 0.78rem; white-space: nowrap; }
  .kiosk-subbar { padding: 0.65rem 0.75rem; }
  /* Search and filters full width; the cards use the whole width of the screen. */
  .search-filter-row, .search-box, .filter-pills { width: 100%; max-width: none; }
  .filter-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-btn { min-height: 44px; }
  #kiosk-main.main-content { padding: 0.75rem; }
  /* Name cards: one compact row each, name and status on the left, the button on the right. */
  .employee-grid { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; padding: 0; }
  .employee-card .card-status-row { justify-content: flex-start; gap: 0.6rem; white-space: nowrap; font-size: 0.85rem; }
  .employee-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.35rem 0.75rem; padding: 0.75rem 0.85rem; }
  .employee-card .card-top { grid-column: 1; gap: 0.65rem; margin: 0; }
  .employee-card .avatar { width: 42px; height: 42px; font-size: 0.95rem; }
  .emp-name { font-size: 1.02rem; }
  .employee-card .emp-meta { display: none; }
  .employee-card .card-status-row { grid-column: 1; margin: 0; padding: 0 0 0 calc(42px + 0.65rem); border: 0; }
  .employee-card .card-action-btn { grid-column: 2; grid-row: 1 / span 2; width: auto; min-height: 48px; margin: 0; padding: 0 1rem; font-size: 0.92rem; }
  /* Confirm sheet: the main button full width on top, the others below it. */
  #confirm-modal .modal-footer { flex-wrap: wrap; }
  #confirm-modal .modal-footer > div { order: -1; width: 100%; margin-left: 0 !important; }
  #confirm-modal .modal-footer > div .btn { flex: 1 1 0; }
  #confirm-modal .modal-footer > .btn { width: 100%; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-content { width: 100%; max-width: none !important; max-height: 94dvh; border-radius: 22px 22px 0 0; }
  /* Admin overview: three small counters on one line; the working-now list wraps its time below the name. */
  .metrics-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .metric-card { padding: 0.7rem 0.75rem; }
  .metric-label { font-size: 0.7rem; }
  .metric-value { font-size: 1.25rem; }
  #overview-live-list > div { flex-wrap: wrap; gap: 0.35rem; padding: 0.65rem 0.8rem !important; }
  #overview-live-list > div > div:last-child { gap: 0.6rem !important; }
  /* Employees: a small card per person instead of a squeezed table. */
  #section-employees .data-table thead { display: none; }
  #section-employees .data-table, #employees-table-body { display: block; }
  #employees-table-body tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); }
  #employees-table-body td { padding: 0; border: 0; background: transparent; }
  #employees-table-body td:nth-child(2) { order: -2; flex: 1 1 60%; font-size: 1rem; }
  #employees-table-body td:nth-child(6) { order: -1; }
  #employees-table-body td:nth-child(1) { color: var(--text-muted); font-size: 0.8rem; }
  #employees-table-body td:nth-child(4)::before { content: "PIN "; color: var(--text-muted); font-size: 0.8rem; }
  #employees-table-body td:nth-child(4) { font-size: 0.8rem; }
}

/* Attendance on a phone: a compact card per shift (who and status, when and hours, then the buttons). */
@media (max-width: 720px) {
  #attendance-table-body tr { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "person person status" "date time net" "pause pause pause" "actions actions actions"; gap: 0.3rem 0.65rem; padding: 0.75rem 0.9rem; align-items: center; }
  #attendance-table-body td { background: transparent !important; }
  #attendance-table-body td[data-label]::before { display: none; }
  #attendance-table-body td:nth-child(1) { grid-area: date; }
  #attendance-table-body .attendance-person { grid-area: person; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
  #attendance-table-body td:nth-child(3) { grid-area: time; color: var(--text-muted); }
  #attendance-table-body td:nth-child(4) { grid-area: pause; font-size: 0.8rem; color: var(--text-muted); }
  #attendance-table-body td:nth-child(4)::before { display: inline !important; content: attr(data-label) ": "; text-transform: none; font-size: inherit; font-weight: 600; }
  #attendance-table-body td.no-break { display: none; }
  #attendance-table-body td:nth-child(5) { grid-area: net; font-weight: 800; text-align: right; }
  #attendance-table-body td:nth-child(6) { grid-area: status; }
  #attendance-table-body .attendance-actions { grid-area: actions; }
  #attendance-table-body .row-actions .btn { flex: 0 0 auto; }
}

/* Kiosk cards show where each person is at a glance (option A, tinted cards): green while working, amber on a break,
   light grey when away. On a break the main button (End Break) is solid amber. */
.employee-card:not(.is-in), .employee-card:not(.is-in):hover { background: #f4f6f9; border-color: #e2e8f0; box-shadow: none; }
.employee-card:not(.is-in) .status-tag.out { color: #64748b; }
.employee-card.is-in, .employee-card.is-in:hover { background: linear-gradient(180deg, #e7f8ee 0%, #f6fdf9 100%); border-color: #9be3b6; }
.employee-card.is-in .status-tag.in { color: #15803d; }
.employee-card.is-in .card-action-btn.out-btn { background: #ffffff; border-color: #15803d; color: #14532d; }
.employee-card.is-in .card-action-btn.out-btn:hover { background: #f0fdf4; }
.employee-card.is-break, .employee-card.is-break:hover { background: linear-gradient(180deg, #fff3d6 0%, #fffaf0 100%); border-color: #f5c96a; }
.employee-card.is-break .status-tag.break { background: transparent; color: #b45309; }
.employee-card.is-break .card-action-btn, .employee-card.is-break .card-action-btn.out-btn { background: #f59e0b; border-color: #f59e0b; color: #2b1700; }
.employee-card.is-break .card-action-btn:hover { background: #e48f06; }
:root[data-theme="dark"] .employee-card:not(.is-in), :root[data-theme="dark"] .employee-card:not(.is-in):hover { background: #111a28; border-color: #223149; }
:root[data-theme="dark"] .employee-card:not(.is-in) .status-tag.out { color: #93a4bb; }
:root[data-theme="dark"] .employee-card.is-in, :root[data-theme="dark"] .employee-card.is-in:hover { background: linear-gradient(180deg, #123323 0%, #102419 100%); border-color: #23704a; }
:root[data-theme="dark"] .employee-card.is-in .status-tag.in { color: #4ade80; }
:root[data-theme="dark"] .employee-card.is-in .card-action-btn.out-btn { background: transparent; border-color: #4ade80; color: #bbf7d0; }
:root[data-theme="dark"] .employee-card.is-break, :root[data-theme="dark"] .employee-card.is-break:hover { background: linear-gradient(180deg, #3a2a0c 0%, #2a1f0b 100%); border-color: #9a6a16; }
:root[data-theme="dark"] .employee-card.is-break .status-tag.break { color: #fbbf24; }
:root[data-theme="dark"] .employee-card.is-break .card-action-btn, :root[data-theme="dark"] .employee-card.is-break .card-action-btn.out-btn { background: #f59e0b; border-color: #f59e0b; color: #1f1300; }

/* Every remove action (delete, revoke, remove): red with white text and a trash can. The icon is drawn by CSS, so a
   translated label (data-i18n replaces the text) keeps it. */
.btn-remove, .btn-remove:visited { display: inline-flex; align-items: center; justify-content: center; gap: 0.4em; background-color: var(--danger); border-color: var(--danger); color: #ffffff; }
.btn-remove:hover, .btn-remove:focus-visible { background-color: #b91c1c; border-color: #b91c1c; color: #ffffff; }
.btn-remove::before {
  content: ''; flex: none; width: 1.05em; height: 1.05em; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E") center / contain no-repeat;
}
