body { margin: 0; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; }
.form-page { background: var(--form-bg); color: var(--form-text); padding: 40px 20px; }
.guard-page { background: var(--gate-bg); color: var(--gate-text); padding: 20px; }
.container { max-width: 1100px; margin: auto; }
.form-page .container { max-width: 500px; background: #fff; padding: 30px; border-radius: 12px; border-top: 5px solid var(--form-accent); }
.logo-container { text-align: center; margin-bottom: 20px; }
.logo-container img, .qr { max-width: 220px; height: auto; }
h1 { font-size: 22px; }
label { display: block; font-weight: 600; margin-top: 15px; }
input, select, button { font: inherit; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="file"], select {
  width: 100%; padding: 12px; margin-top: 6px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box;
}
.form-page button { background: var(--form-button); color: #fff; border: 0; border-radius: 6px; padding: 12px 16px; margin-top: 16px; cursor: pointer; }
.form-page h2 { font-size: 18px; margin: 22px 0 8px; }
.form-actions, .stack-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.form-actions button, .stack-actions button, .stack-actions form { margin-top: 0; }
.form-page a.button { display: inline-block; background: var(--form-button); color: #fff; text-decoration: none; border-radius: 6px; padding: 12px 16px; }
.form-page button.danger, .form-page a.button.danger { background: #8a1c1c; color: #fff; }
.details { margin: 0; }
.details div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eee; }
.details dt { font-weight: 600; }
.details dd { margin: 0; text-align: right; }
.code-box { margin: 12px 0; padding: 14px; border: 1px dashed var(--form-accent); border-radius: 8px; text-align: center; font-family: Consolas, monospace; font-size: 28px; letter-spacing: 0.18em; }
input.code { font-family: Consolas, monospace; letter-spacing: 0.18em; text-transform: uppercase; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 10px 0; border-bottom: 1px solid #eee; }
.history time { display: block; color: #666; font-size: 13px; margin-bottom: 2px; }
.guard-page .history li { border-bottom-color: #333; }
.guard-page .history time { color: #aaa; }
.guard-page .details div { border-bottom-color: #333; }
.guard-page .search-btn { background: var(--gate-button); color: #fff; border: 0; border-radius: 6px; padding: 12px 16px; cursor: pointer; }
.msg { padding: 12px; background: #d1e7dd; color: #0f5132; border-radius: 6px; }
.msg.error { background: #f8d7da; color: #842029; }
.hp { position: absolute; left: -10000px; }
.time-inputs, .search-container, .admin-nav, .header { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.time-inputs { align-items: flex-end; flex-wrap: nowrap; gap: 8px; }
.time-inputs > div { flex: 1; }
.clock { display: flex; align-items: center; gap: 4px; }
.clock input { width: 3.5rem; flex: 0 0 3.5rem; text-align: center; padding-left: 0; padding-right: 0; font-variant-numeric: tabular-nums; }
.clock-sep { margin-top: 6px; font-weight: 700; }
.range-sep { flex: 0 0 auto; height: 46px; display: flex; align-items: center; font-weight: 700; font-size: 22px; }
.header { justify-content: space-between; border-bottom: 2px solid #333; padding-bottom: 10px; }
table { width: 100%; border-collapse: collapse; background: #2a2a2a; }
.form-page table { background: #2a2a2a; }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid #333; }
th { color: #aaa; font-weight: normal; text-transform: uppercase; font-size: 13px; }
.badge { background: #ff9800; color: #000; font-weight: bold; padding: 6px 10px; border-radius: 6px; letter-spacing: 1px; }
.time-in { color: #1b7f37; font-weight: 700; }
.time-out { color: #d32f2f; font-weight: 700; }
.muted { color: #ff9800; }
.future-date { color: #1c1c1c; }
.empty { text-align: center; color: #888; }
.pagination, .nav-links { display: flex; gap: 8px; margin-top: 16px; }
a { color: var(--gate-accent); }
.form-page a { color: var(--form-accent); }
.search-input { flex: 1; background: #1a1a1a; color: #fff; border: 1px solid #444; }
.clear-btn { background: #d32f2f; color: #fff; text-decoration: none; padding: 12px 16px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.inline { display: inline; }
button.link { background: transparent; color: var(--gate-accent); border: 0; padding: 0; margin: 0; cursor: pointer; }
.codes { font-family: Consolas, monospace; }
.manual { font-family: Consolas, monospace; letter-spacing: 1px; }
.stack input, .stack select { margin-bottom: 8px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.admin-nav a, .admin-nav button { margin-right: 12px; }

.admin-page { background: #eef0f3; color: #1c1c1c; padding: 0; overflow-x: hidden; }
.dash, .dash *, .dash *::before, .dash *::after { box-sizing: border-box; }
.dash-toggle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dash-scrim, .dash-burger, .dash-close { display: none; }
.dash { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.dash-side {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  display: flex; flex-direction: column; gap: 8px;
  background: #111; color: #fff; padding: 18px 14px 16px;
  box-shadow: inset 3px 0 0 var(--form-accent);
}
.dash-side-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dash-brand { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; color: #fff; text-decoration: none; }
.dash-logo { display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 12px; padding: 14px 16px; }
.dash-logo img { display: block; width: auto; max-width: 100%; height: 34px; object-fit: contain; }
.dash-brand-name { padding: 0 4px; color: #c8c8c8; font-size: 13px; font-weight: 600; }
.dash-menu { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.dash-label { margin: 14px 12px 6px; color: #8d8d8d; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dash-label:first-child { margin-top: 0; }
.dash-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: #e8e8e8; font-weight: 600; text-decoration: none;
}
.dash-menu a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.dash-menu a:hover { background: #242424; color: #fff; }
.dash-menu a.is-active { background: var(--form-accent); color: #fff; }
.dash-user {
  margin-top: auto; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center;
  padding: 14px 8px 4px; border-top: 1px solid #2a2a2a;
}
.dash-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--form-accent); color: #fff; font-weight: 700;
}
.dash-user-meta strong, .dash-user-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-user-meta span { color: #9a9a9a; font-size: 13px; }
.dash-user form { grid-column: 1 / -1; margin: 0; }
.dash-main { min-width: 0; max-width: 100%; }
.dash-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px;
  padding: 14px 28px; background: #fff; border-bottom: 1px solid #e6e8ec;
}
.dash-heading {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  min-width: 0; flex: 1 1 16rem;
}
.dash-top h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.dash-lead { margin: 0; color: #666; font-size: 14px; line-height: 1.3; overflow-wrap: break-word; }
.dash-clock-wrap {
  flex: 0 0 auto; margin-left: auto;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.dash-clock {
  display: flex; align-items: center; justify-content: center;
  color: #111; font-size: 22px; font-weight: 700; line-height: 1.05; letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dash-clock-day { margin: 0; color: #666; font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (min-width: 901px) {
  .dash-clock { font-size: 36px; }
}
.dash-content { min-width: 0; max-width: 100%; padding: 22px 28px 48px; }
.dash-content > * { min-width: 0; max-width: 100%; }
.dash-burger {
  width: 42px; height: 42px; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid #e4e6ea; border-radius: 10px; background: #fff; cursor: pointer;
}
.dash-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #111; }
.dash-content > .msg, .settings-form { margin-bottom: 16px; }
.dash .msg p { margin: 0; }
.dash .msg p + p { margin-top: 6px; }
.settings-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 0; }
.settings-form > * { min-width: 0; max-width: 100%; }
.card { min-width: 0; max-width: 100%; background: #fff; border: 1px solid #e6e8ec; border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 16, 16, .04); }
.card:not(.card-table) { padding: 20px 22px 22px; }
.card-head, .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.card-head { border-bottom: 1px solid #eee; }
.card-foot { border-top: 1px solid #eee; }
.dash h2 { margin: 0 0 4px; font-size: 18px; }
.dash h3 { margin: 22px 0 10px; color: #666; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.card-head h2 { margin: 0; }
.card-note, .dash-count { margin: 0; color: #666; font-size: 14px; }
.card-note { margin-bottom: 16px; overflow-wrap: break-word; }
.dash-split { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; }
.dash-stack { display: grid; gap: 16px; min-width: 0; }
.field-grid, .color-grid { display: grid; gap: 14px; }
.field-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.color-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.field-grid > div, .color-pick, .logo-preview, .settings-form { min-width: 0; max-width: 100%; }
.color-pick { overflow-wrap: break-word; }
.dash input, .dash select, .dash textarea { max-width: 100%; }
.dash textarea {
  width: 100%; min-height: 96px; margin-top: 6px; padding: 12px;
  border: 1px solid #d0d4da; border-radius: 8px; font: inherit; resize: vertical;
}
.dash .field-grid label, .color-pick { margin-top: 0; }
.dash .check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 600; }
.color-pick input[type="color"] {
  display: block; width: 100%; height: 42px; margin-top: 6px; padding: 4px;
  border: 1px solid #d0d4da; border-radius: 8px; background: #fff; cursor: pointer;
}
.notice-colors {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 8px 0 16px; padding: 0; border: 0; min-width: 0;
}
.notice-colors legend { display: flex; align-items: center; gap: 6px; flex: 1 0 100%; margin: 0 0 4px; padding: 0; font-weight: 700; }
.notice-preview {
  display: flex; margin: 0; padding: 4px; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
}
.notice-preview:has(input:checked) { border-color: var(--form-accent); box-shadow: 0 0 0 1px var(--form-accent); }
.notice-preview:focus-within { outline: 2px solid var(--form-accent); outline-offset: 2px; }
.notice-preview input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.notice-swatch { width: 32px; height: 32px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .18); flex: 0 0 auto; }
.notice-swatch-fff3cd { background: #fff3cd; }
.notice-swatch-ffe0b2 { background: #ffe0b2; }
.notice-swatch-f8d7da { background: #f8d7da; }
.notice-swatch-d1e7dd { background: #d1e7dd; }
.notice-swatch-cfe2ff { background: #cfe2ff; }
.notice-swatch-1f2937 { background: #1f2937; }
.field-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.field-name > label { margin-top: 0; min-width: 0; }
.card > .field-name,
.sound-upload > .field-name { margin-top: 15px; }
.field-grid .field-name,
.color-pick .field-name { margin-top: 0; }
.field-name .check { margin-top: 0; }
.check-line { margin-top: 14px; }
.field-hint { position: relative; display: inline-flex; flex: 0 0 auto; }
.dash button.field-hint-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin: 0; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #6b7280; line-height: 0; cursor: help;
}
.dash button.field-hint-btn:hover,
.dash button.field-hint-btn:focus-visible { filter: none; background: #f0f1f3; color: #111; }
.field-hint-btn svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.field-hint-pop {
  position: absolute; z-index: 30; bottom: calc(100% + 8px); left: 0;
  width: max-content; max-width: min(280px, calc(100vw - 48px));
  padding: 10px 12px; border-radius: 10px; background: #1c1c1c; color: #fff;
  font-size: 13px; font-weight: 500; line-height: 1.45; letter-spacing: 0;
  text-align: left; text-transform: none; white-space: normal; overflow-wrap: break-word;
  box-shadow: 0 8px 24px rgba(16, 16, 16, .2);
  opacity: 0; visibility: hidden;
}
.field-hint-pop.is-below { bottom: auto; top: calc(100% + 8px); }
.field-hint-pop.is-end { left: auto; right: 0; }
.field-hint:hover .field-hint-pop,
.field-hint:focus-within .field-hint-pop { opacity: 1; visibility: visible; }
.logo-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; min-width: 0; max-width: 100%; margin-bottom: 8px; padding: 14px; background: #f6f7f9; border: 1px solid #e6e8ec; border-radius: 12px; }
input.logo-file { margin-bottom: 16px; }
.logo-preview div { min-width: 0; }
.logo-preview img { height: 42px; width: auto; max-width: 180px; object-fit: contain; padding: 8px 12px; background: #fff; border-radius: 8px; }
.logo-preview strong, .logo-preview span { display: block; }
.logo-preview span { color: #666; font-size: 13px; }
.sound-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 8px 0 14px; padding: 14px; background: #f6f7f9; border: 1px solid #e6e8ec; border-radius: 12px; }
.sound-preview audio { width: min(100%, 320px); height: 40px; }
.sound-preview strong, .sound-preview span { display: block; }
.sound-preview span { color: #666; font-size: 13px; font-weight: 400; }
.sound-choices { margin: 8px 0 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
.sound-choices legend { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 0; font-weight: 700; }
.sound-choice { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; padding: 10px 12px; background: #f6f7f9; border: 1px solid #e6e8ec; border-radius: 12px; }
.sound-choice:has(input:checked) { border-color: var(--form-accent); background: #fff; }
.sound-choice label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; margin: 0; font-weight: 600; cursor: pointer; }
.sound-choice input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.dash .sound-choice button { margin: 0; padding: 6px 10px; font-size: 13px; }
.sound-upload .card-note { margin-top: 8px; margin-bottom: 0; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: #f3f4f6; border-radius: 10px; }
.dash .seg a { padding: 8px 14px; border-radius: 8px; color: #333; font-weight: 600; text-decoration: none; }
.dash .seg a.is-on { background: #fff; color: #111; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.card-table { overflow: hidden; }
.table-scroll { display: block; width: 100%; max-width: 100%; overflow-x: auto; }
.dash table { width: 100%; min-width: 720px; border-collapse: collapse; background: #fff; }
.dash th, .dash td { padding: 12px 14px; text-align: left; vertical-align: middle; color: #1c1c1c; border-bottom: 1px solid #f0f1f3; }
.dash th { background: #fafafa; color: #666; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.dash tbody tr:hover td { background: #fcfcfd; }
.dash tbody tr:last-child td { border-bottom: 0; }
.dash td.cell { position: relative; }
.cell-value { min-width: 0; }
.cell-label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.note-excerpt { margin: 0; }
.dash button.note-more {
  display: inline; width: auto; margin: 0 0 0 .35em; padding: 0; background: transparent;
  color: var(--form-accent); font-size: 12px; font-weight: 600; line-height: 1.2;
  vertical-align: baseline; text-align: left; text-decoration: underline; white-space: nowrap;
}
.dash button.note-more:hover { filter: none; }
.row-menu { position: relative; display: inline-block; }
.row-menu summary {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 1px solid #e4e6ea; border-radius: 8px; background: #fff; color: #333;
  font-size: 18px; line-height: 1; list-style: none; cursor: pointer;
}
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu summary:focus-visible { outline: 2px solid var(--form-accent); outline-offset: 2px; }
.row-menu-list {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 40; display: flex; flex-direction: column; gap: 2px;
  min-width: 180px; margin: 0; padding: 6px; background: #fff; border: 1px solid #e6e8ec;
  border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 16, 16, .14);
}
@supports (position-anchor: --row-menu) {
  .row-menu[open] summary { anchor-name: --row-menu; }
  .row-menu[open] .row-menu-list {
    position: fixed;
    position-anchor: --row-menu;
    top: calc(anchor(bottom) + 4px);
    right: anchor(right);
    left: auto;
    margin: 0;
    position-try-fallbacks: flip-block, flip-inline;
  }
}
.dash .row-menu-list button {
  width: 100%; margin: 0; padding: 8px 10px; background: transparent; color: #111;
  border-radius: 8px; font-size: 14px; font-weight: 600; text-align: left;
}
.dash .row-menu-list button:hover { filter: none; background: #f3f4f6; }
.modal {
  width: min(520px, calc(100% - 32px)); max-height: min(80vh, 640px); padding: 0;
  border: 0; border-radius: 16px; box-shadow: 0 16px 48px rgba(16, 16, 16, .24);
}
.modal::backdrop { background: rgba(16, 16, 16, .45); }
.modal-card { display: flex; flex-direction: column; gap: 12px; max-height: min(80vh, 640px); padding: 18px; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-lead { margin: 0; color: #666; font-size: 13px; }
.dash .modal-close {
  width: 32px; height: 32px; margin: 0; padding: 0; background: #fff; color: #111;
  border: 1px solid #d0d4da; border-radius: 8px; font-size: 20px; line-height: 1;
}
.dash .modal-close:hover { filter: none; }
.modal .note-form { margin-top: 0; }
.dash-content a { color: var(--form-accent); font-weight: 600; }
.dash th .sort-link {
  display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit;
  letter-spacing: inherit; text-decoration: none; text-transform: inherit; white-space: nowrap;
}
.dash th .sort-link:hover { color: var(--form-accent); }
.dash th[aria-sort] .sort-link { color: #111; }
.choice-head { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.dash button.select-all {
  width: auto; margin: 0; padding: 0; background: transparent; color: var(--form-accent);
  border-radius: 0; font-size: 12px; font-weight: 700; letter-spacing: 0; line-height: 1.3;
  text-align: left; text-transform: none; white-space: nowrap;
}
.dash button.select-all:hover { filter: none; text-decoration: underline; }
.nowrap { white-space: nowrap; }
.muted-cell { color: #666; }
.plate { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #111; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-ok { background: #e5f6ea; color: #0f6b32; }
.pill-warn { background: #fff4e0; color: #8a5a00; }
.pill-danger { background: #fde8ea; color: #9f1239; }
.pill-muted { background: #f0f1f3; color: #555; }
.dash input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--form-accent); }
.dash button {
  background: var(--form-button); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 16px; font-weight: 600; cursor: pointer;
}
.dash button.secondary { background: #fff; color: #111; border: 1px solid #d0d4da; }
.dash button.danger { background: #8a1c1c; color: #fff; }
.dash button:hover { filter: brightness(1.08); }
.dash .dash-user button {
  width: 100%; background: transparent; color: #fff; filter: none;
  border: 1px solid #3a3a3a; border-radius: 8px; padding: 8px 12px; font-weight: 600; cursor: pointer;
}
.dash .dash-user button:hover { filter: none; border-color: #fff; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions form { margin: 0; }
.row-actions button { padding: 6px 10px; font-size: 13px; }
.form-bar { display: flex; justify-content: flex-end; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; }
.dash .pager a, .dash .pager span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 36px;
  padding: 8px 12px; border: 1px solid #e6e8ec; border-radius: 8px;
  background: #fff; color: #222; font-weight: 600; text-decoration: none;
}
.dash .pager a:hover { border-color: var(--form-accent); color: var(--form-accent); }
.dash .pager .is-current { background: var(--form-button); border-color: transparent; color: #fff; }
.dash .pager .is-disabled { color: #999; }
.dash .pager .pager-label { min-width: 0; border: 0; background: transparent; }
.dash a:focus-visible, .dash button:focus-visible, .dash input:focus-visible, .dash select:focus-visible, .dash-burger:focus-visible, .dash-close:focus-visible {
  outline: 2px solid var(--form-accent); outline-offset: 2px;
}
@media (max-width: 900px) {
  .dash { display: block; }
  .dash-side {
    position: fixed; z-index: 40; width: min(300px, 88vw);
    transform: translateX(-105%); transition: transform .2s ease;
  }
  .dash-toggle:checked ~ .dash .dash-side { transform: none; box-shadow: inset 3px 0 0 var(--form-accent), 0 0 40px rgba(0, 0, 0, .35); }
  .dash-toggle:checked ~ .dash-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .45); }
  .dash-burger { display: inline-flex; }
  .dash-close {
    display: inline-flex; align-items: center; padding: 6px 10px;
    border: 1px solid #3a3a3a; border-radius: 8px; color: #fff; background: transparent;
    font-size: 13px; font-weight: 600; cursor: pointer;
  }
  .dash-top, .dash-content { padding-left: 16px; padding-right: 16px; }
  .dash-clock-wrap { display: none; }
  .card:not(.card-table) { padding: 16px; }
  .dash-split, .field-grid, .color-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-split > *, .field-grid > *, .color-grid > * { min-width: 0; max-width: 100%; }
  body:has(.dash-toggle:checked) { overflow: hidden; }
}
.dash-content > .card + .card { margin-top: 16px; }
.dash .gate-search { display: flex; flex: 1; gap: 8px; align-items: center; min-width: 0; flex-wrap: wrap; }
.dash .gate-search.list-tools { flex: 1 1 100%; }
.dash .gate-search input { flex: 1; width: auto; min-width: 12rem; margin: 0; background: #fff; color: #111; border: 1px solid #d0d4da; }
.dash .gate-search button { margin: 0; }
.dash button.accent { background: var(--gate-button); color: #fff; }
.dash a.clear-btn { display: inline-flex; align-items: center; margin: 0; padding: 10px 16px; border: 1px solid #d0d4da; border-radius: 8px; background: #fff; color: #111; font-weight: 600; text-decoration: none; }
.card-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dash .sound-toggle {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  font-size: 14px; font-weight: 600; cursor: pointer; user-select: none;
}
.sound-label { min-width: 0; line-height: 1.3; }
.dash .sound-toggle input {
  position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0);
}
.sound-switch {
  position: relative; flex: 0 0 auto; width: 44px; height: 26px;
  border-radius: 999px; background: #c5c9d0; transition: background .15s ease;
}
.sound-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform .15s ease;
}
.dash .sound-toggle input:checked + .sound-switch { background: #0f6b32; }
.dash .sound-toggle input:checked + .sound-switch::after { transform: translateX(18px); }
.dash .sound-toggle input:focus-visible + .sound-switch { outline: 2px solid var(--form-accent); outline-offset: 2px; }
@media (max-width: 900px) {
  #panel .card-head { align-items: stretch; flex-direction: column; }
  #panel .gate-search { flex: none; width: 100%; }
  #panel .gate-search input { min-width: 0; flex: 1 1 0; }
  #panel .gate-search button,
  #panel .gate-search .clear-btn { flex: 0 0 auto; }
  #panel .card-tools { width: 100%; justify-content: flex-start; align-items: center; }
  #panel .sound-toggle { flex: 0 1 auto; max-width: 100%; min-width: min(100%, max-content); }
}
.gate-notice {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px;
  margin: 0; padding: 14px 18px; font-weight: 600;
}
.gate-notice-body { flex: 1 1 12rem; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.gate-notice-time { flex: 0 0 auto; font-size: 13px; font-weight: 700; opacity: .8; }
.gate-notice-fff3cd { background: #fff3cd; color: #1a1a1a; }
.gate-notice-ffe0b2 { background: #ffe0b2; color: #1a1a1a; }
.gate-notice-f8d7da { background: #f8d7da; color: #1a1a1a; }
.gate-notice-d1e7dd { background: #d1e7dd; color: #1a1a1a; }
.gate-notice-cfe2ff { background: #cfe2ff; color: #1a1a1a; }
.gate-notice-1f2937 { background: #1f2937; color: #ffffff; }
.list-title {
  margin: 0; padding: 16px 18px 8px; color: #111; font-size: 16px; font-weight: 700;
}
.list-title span { margin-left: 8px; color: #666; font-size: 13px; font-weight: 600; }
.list-block + .list-block { border-top: 1px solid #eee; }
.list-block table { table-layout: fixed; min-width: 48rem; }
.list-block col.col-choice { width: 4.75rem; }
.list-block col.col-plate { width: 10.25rem; }
.list-block col.col-when { width: 9.5rem; }
.list-block col.col-menu { width: 4.5rem; }
.list-block th.col-menu,
.list-block td.cell-menu { text-align: right; }
.list-block th.col-choice,
.list-block td.cell-check { padding-left: 10px; padding-right: 10px; }
.visits-table td.cell-when { font-weight: 700; }
.visits-table td.cell-added { font-size: 14px; }
.list-block th,
.list-block td { overflow-wrap: anywhere; }
.list-block .future-date { display: block; }
.note-cell { white-space: pre-wrap; overflow-wrap: anywhere; }
.dash tbody tr:has(+ tr.note-row) td { border-bottom: 0; padding-bottom: 2px; }
.dash tbody tr.note-row td { padding-top: 0; padding-bottom: 12px; background: #fff; font-size: 13px; line-height: 1.4; }
.dash tbody tr:has(+ tr.note-row):hover td,
.dash tbody tr:has(+ tr.note-row:hover) td,
.dash tbody tr:hover + tr.note-row td,
.dash tbody tr.note-row:hover td { background: #fcfcfd; }
.note-row .cell-label {
  position: static; display: inline; width: auto; height: auto; margin: 0 8px 0 0; overflow: visible; clip-path: none;
  color: #777; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.note-row .cell-value,
.note-row .note-excerpt { display: inline; }
.note-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.note-list li { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: #f6f7f9; border: 1px solid #e6e8ec; border-radius: 12px; }
.note-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; color: #666; font-size: 13px; }
.note-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 16px; }
.note-form label { margin-top: 0; }
.dash .note-form button { margin-top: 0; }
.dash .update-status { margin: 0; padding: 0 18px; }
.dash .update-status:not(:empty) { padding-bottom: 8px; }
.dash #results .pager,
.dash .list-block .pager { margin: 0; padding: 14px 18px; border-top: 1px solid #eee; }
.dash .details div { border-bottom-color: #eee; }
.dash .history li { border-bottom-color: #eee; }
.dash .history time { color: #666; }
@media (max-width: 900px) {
  .dash .table-scroll { overflow: visible; }
  .dash .table-scroll table { min-width: 0; background: transparent; }
  .dash .table-scroll table,
  .dash .table-scroll thead,
  .dash .table-scroll tbody { display: block; width: 100%; }
  .dash .table-scroll thead.record-labels { display: none; }
  .dash thead.record-tools tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 8px 10px; background: #fff; border-bottom: 1px solid #eee;
  }
  .dash thead.record-tools tr::before {
    content: "Sortowanie"; order: 1; flex: 1 0 100%;
    color: #666; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  }
  .dash thead.record-tools th {
    display: none; padding: 0; background: transparent; border: 0;
    letter-spacing: 0; text-transform: none;
  }
  .dash thead.record-tools th.sortable { display: block; order: 2; }
  .dash thead.record-tools th.col-choice { display: block; order: 0; flex: 1 0 100%; }
  .dash thead.record-tools .choice-label { display: none; }
  .dash thead.record-tools .choice-head { flex-direction: row; }
  .dash thead.record-tools th.sortable .sort-link {
    padding: 4px 9px; border: 1px solid #e4e6ea; border-radius: 999px; background: #f3f4f6;
    color: #333; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none;
  }
  .dash thead.record-tools th[aria-sort] .sort-link {
    border-color: var(--form-accent); background: #fff; color: #111;
  }
  .dash thead.record-tools button.select-all {
    display: flex; width: 100%; margin: 0; padding: 10px 12px; justify-content: center;
    border: 1px solid #d0d4da; border-radius: 8px; background: #fff; color: #111;
    font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none;
  }
  .dash thead.record-tools button.select-all:hover { filter: none; text-decoration: none; border-color: var(--form-accent); }
  .dash .table-scroll tbody {
    display: flex; flex-direction: column; gap: 6px;
    padding: 8px; background: #f3f4f6;
  }
  .dash .table-scroll tbody tr {
    position: relative; display: flex; flex-flow: row wrap; align-items: center; gap: 2px 8px;
    min-width: 0; padding: 7px 10px;
    background: #fff; border: 1px solid #e6e8ec; border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 16, 16, .04);
  }
  .dash .table-scroll tbody tr:hover td { background: transparent; }
  .dash .table-scroll tbody tr td {
    display: flex; flex: 1 0 100%; flex-direction: column; align-items: stretch; gap: 1px;
    width: auto; min-width: 0; padding: 3px 0;
    border-bottom: 0; white-space: normal; overflow-wrap: anywhere;
  }
  .dash .table-scroll td.cell-lead { order: -1; padding-top: 0; padding-bottom: 0; font-size: 15px; font-weight: 700; }
  .dash .table-scroll td.cell-head {
    flex: 0 1 auto; flex-direction: row; align-items: center; order: 3;
    width: auto; padding: 0; font-size: 14px; font-weight: 700;
  }
  .dash .table-scroll td.cell-check.cell-head { order: 1; background: transparent; }
  .dash .table-scroll td.cell-head:has(.plate) { order: 2; }
  .dash .table-scroll td.cell-head .plate { padding: 2px 6px; font-size: 13px; }
  .dash .table-scroll td.cell-when { font-variant-numeric: tabular-nums; }
  .dash .table-scroll td.cell-check .cell-value { flex: 0 0 auto; }
  .dash .table-scroll td.cell-check input[type="checkbox"] { width: 18px; height: 18px; }
  .dash .table-scroll td .cell-label {
    position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none;
    color: #666; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: normal;
  }
  .dash .table-scroll tbody tr:has(.cell-menu) { padding-right: 46px; }
  .dash .table-scroll td.cell-head .cell-label,
  .dash .table-scroll td.cell-link .cell-label,
  .dash .table-scroll td.cell-menu .cell-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .dash .table-scroll td.cell-pair,
  .dash .table-scroll td.note-cell { order: 5; }
  .dash .table-scroll td.cell-pair { flex-direction: row; align-items: baseline; gap: 6px; padding: 1px 0; }
  .dash .table-scroll td.cell-pair .cell-label {
    flex: 0 0 auto; color: #777; font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none;
  }
  .dash .table-scroll td.cell-pair .cell-value { flex: 1 1 auto; min-width: 0; font-weight: 700; }
  .dash .table-scroll td .cell-value { max-width: 100%; }
  .dash .table-scroll td.note-indent { display: none; }
  .dash .table-scroll tbody tr.note-row {
    margin-top: -6px; padding-top: 0; border-top: 0; border-radius: 0 0 12px 12px; box-shadow: none;
  }
  .dash .table-scroll tbody tr:has(+ tr.note-row) {
    padding-bottom: 0; border-bottom: 0; border-radius: 12px 12px 0 0;
  }
  .dash .table-scroll tr.note-row td.note-cell { flex-direction: row; align-items: baseline; gap: 6px; }
  .dash .table-scroll td.note-cell { gap: 0; padding-top: 3px; font-size: 13px; line-height: 1.35; }
  .dash .table-scroll td.note-cell .cell-label {
    font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none;
  }
  .dash .table-scroll td.nowrap { white-space: normal; }
  .dash .table-scroll td.empty { display: block; flex: 1 0 100%; text-align: center; }
  .dash .table-scroll td.cell-link,
  .dash .table-scroll td.cell-menu {
    position: absolute; top: 6px; right: 6px; flex: none; width: auto; padding: 0;
  }
  .dash .table-scroll td.cell-link a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; padding: 0; border: 1px solid #e4e6ea; border-radius: 6px;
    background: #fff; color: #666; font-size: 12px; font-weight: 700; line-height: 1; text-decoration: none;
  }
  .dash .table-scroll td.cell-actions .row-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .dash .table-scroll td.cell-actions .row-actions button { width: 100%; }
  .dash .table-scroll td.cell-actions:not(:has(.row-actions)),
  .dash .table-scroll td.is-blank { display: none; }
}
.session-idle {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  display: flex; align-items: center; gap: 12px; width: min(420px, calc(100vw - 32px));
  margin: 0; padding: 14px 16px; background: #fff; color: #1c1c1c;
  border: 1px solid #e6e8ec; border-left: 4px solid #8a5a00; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 16, 16, .16);
}
.session-idle[hidden] { display: none; }
.session-idle p { margin: 0; font-weight: 600; }
.session-idle button {
  flex: 0 0 auto; margin: 0; padding: 10px 14px; background: var(--form-button); color: #fff;
  border: 0; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer;
}
.session-idle button:hover { filter: brightness(1.08); }
.session-idle button:focus-visible { outline: 2px solid var(--form-accent); outline-offset: 2px; }
@media (max-width: 640px) {
  .session-idle { flex-direction: column; align-items: stretch; }
  .session-idle button { width: 100%; }
}
