:root {
      --bg: #f6f7fb;
      --panel: #ffffff;
      --text: #111827;
      --muted: #667085;
      --line: #e5e7eb;
      --brand: #2563eb;
      --brand-dark: #1d4ed8;
      --green: #12b76a;
      --matte-green: #2f6f4e;
      --amber: #f79009;
      --matte-orange: #b65f16;
      --red: #f04438;
      --soft-blue: #eef4ff;
      --shadow: 0 20px 60px rgba(16, 24, 40, .10);
      --radius: 28px;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at top left, rgba(37,99,235,.16), transparent 32rem),
        radial-gradient(circle at bottom right, rgba(18,183,106,.10), transparent 30rem),
        var(--bg);
    }

    .app {
      max-width: 1180px;
      margin: 0 auto;
      padding: 30px 20px 50px;
    }

    header {
      display: flex;
      justify-content: space-between;
      gap: 18px;
      align-items: flex-start;
      margin-bottom: 22px;
    }

    .brand-lockup {
      display: flex;
      align-items: center;
      gap: 16px;
      min-width: 0;
    }

    .brand-logo {
      display: block;
      width: clamp(170px, 20vw, 230px);
      height: auto;
      flex: 0 1 auto;
    }

    .brand-divider {
      width: 1px;
      height: 42px;
      background: var(--line);
      flex: 0 0 auto;
    }

    .brand-lockup h1 {
      font-size: clamp(28px, 3vw, 40px);
      line-height: 1;
      letter-spacing: -.045em;
      white-space: nowrap;
    }

    .eyebrow {
      color: var(--brand);
      font-size: 13px;
      font-weight: 850;
      letter-spacing: .08em;
      text-transform: uppercase;
      margin-bottom: 8px;
    }

    h1 {
      margin: 0;
      font-size: clamp(34px, 5vw, 60px);
      line-height: .95;
      letter-spacing: -.055em;
    }

    .subtitle {
      margin: 12px 0 0;
      color: var(--muted);
      max-width: 680px;
      line-height: 1.5;
      font-size: 16px;
    }

    .clock {
      min-width: 205px;
      text-align: right;
      padding: 11px 14px;
      background: rgba(255,255,255,.78);
      border: 1px solid rgba(229,231,235,.85);
      border-radius: 20px;
      box-shadow: 0 12px 32px rgba(16, 24, 40, .06);
      backdrop-filter: blur(12px);
    }



    .top-controls {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      position: relative;
    }

    .top-menu { position: relative; }

    .menu-icon {
      width: 46px;
      height: 46px;
      border: 1px solid rgba(229,231,235,.9);
      border-radius: 16px;
      background: rgba(255,255,255,.86);
      box-shadow: 0 12px 32px rgba(16, 24, 40, .06);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      cursor: pointer;
      color: var(--text);
      transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    }

    .menu-icon:hover {
      transform: translateY(-1px);
      border-color: rgba(37,99,235,.32);
      box-shadow: 0 16px 34px rgba(16, 24, 40, .09);
    }

    .menu-icon span, .menu-icon::before, .menu-icon::after {
      content: '';
      width: 5px;
      height: 5px;
      border-radius: 999px;
      background: currentColor;
      display: block;
    }

    .dropdown-menu {
      position: absolute;
      top: 62px;
      right: 0;
      width: 220px;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 18px;
      box-shadow: 0 22px 50px rgba(16, 24, 40, .16);
      padding: 8px;
      z-index: 25;
    }

    .dropdown-menu button {
      width: 100%;
      border: 0;
      background: transparent;
      border-radius: 12px;
      padding: 13px 14px;
      text-align: left;
      font-weight: 800;
      color: var(--text);
      cursor: pointer;
      min-height: 44px;
    }

    .dropdown-menu button:hover { background: #f3f4f6; }

    .setting-row {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 13px 14px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: #f9fafb;
      color: var(--muted);
    }

    .setting-row strong { color: var(--text); }

    .clock strong { display: block; font-size: 19px; letter-spacing: -.02em; }
    .clock span { display: block; color: var(--muted); margin-top: 4px; font-size: 13px; }

    .hero {
      background: rgba(255,255,255,.9);
      border: 1px solid var(--line);
      border-radius: 34px;
      box-shadow: var(--shadow);
      padding: clamp(18px, 4vw, 34px);
      margin-bottom: 18px;
    }

    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
      align-items: stretch;
    }

    .kpi {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 22px;
      background: #fff;
      min-height: 146px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

    .kpi-tile { cursor: pointer; }
    .kpi-tile:focus-visible { outline: 4px solid rgba(37, 99, 235, .25); outline-offset: 4px; }

    .kpi.main {
      min-height: 230px;
      background: linear-gradient(135deg, #2f6f4e, #3f7f5d);
      color: #ffffff;
      border-color: rgba(47,111,78,.35);
      box-shadow: 0 20px 60px rgba(47, 111, 78, .20);
    }

    .kpi.main .kpi-label,
    .kpi.main small {
      color: rgba(255,255,255,.82);
    }

    .kpi.overnight {
      background: linear-gradient(135deg, #b65f16, #c7772d);
      color: #ffffff;
      border-color: rgba(182,95,22,.35);
      box-shadow: 0 20px 60px rgba(182, 95, 22, .18);
    }

    .kpi.overnight .kpi-label,
    .kpi.overnight small {
      color: rgba(255,255,255,.84);
    }

    .kpi-label {
      color: var(--muted);
      font-size: 13px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .055em;
    }

    .kpi-number {
      margin-top: 10px;
      font-size: clamp(46px, 8vw, 92px);
      font-weight: 900;
      letter-spacing: -.07em;
      line-height: .85;
    }

    .kpi.main .kpi-number,
    .kpi.overnight .kpi-number { font-size: clamp(69px, 12vw, 138px); }
    .kpi:not(.main):not(.overnight) .kpi-number { font-size: 48px; }
    .kpi small { color: var(--muted); line-height: 1.4; }

    .actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(220px, 1fr));
      gap: 12px;
      margin-top: 18px;
    }

    button {
      border: 0;
      border-radius: 18px;
      min-height: 50px;
      padding: 0 18px;
      font: inherit;
      font-weight: 850;
      cursor: pointer;
      transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
    }

    button:hover { transform: translateY(-1px); }
    button:active { transform: translateY(0); }

    .big-checkin {
      min-height: 90px;
      font-size: clamp(22px, 4vw, 36px);
      border-radius: 26px;
      background: var(--brand);
      color: #fff;
      box-shadow: 0 18px 36px rgba(37,99,235,.26);
    }
    .big-checkin:hover { background: var(--brand-dark); }

    .big-checkout {
      min-height: 90px;
      font-size: clamp(22px, 4vw, 36px);
      border-radius: 26px;
      background: #eef2f7;
      color: #344054;
      box-shadow: 0 18px 36px rgba(16,24,40,.08);
    }
    .big-checkout:hover { background: #e4e9f1; }

    .secondary {
      background: #eef2f7;
      color: #344054;
    }

    .danger {
      background: #fff1f0;
      color: var(--red);
    }

    #closeVendorList {
      background: #b85c57;
      color: #fff;
      box-shadow: 0 10px 22px rgba(184, 92, 87, .18);
    }

    #closeVendorList:hover { background: #a8504c; }

    .primary {
      background: var(--brand);
      color: #fff;
      box-shadow: 0 10px 24px rgba(37,99,235,.22);
    }

    .panel {
      background: rgba(255,255,255,.92);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 22px;
      margin-top: 16px;
    }

    .hidden { display: none !important; }

    .modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: grid;
      place-items: center;
      padding: 20px;
      background: rgba(17,24,39,.44);
      backdrop-filter: blur(8px);
    }

    .modal-card {
      width: min(920px, 100%);
      max-height: min(88vh, 820px);
      overflow: auto;
      background: rgba(255,255,255,.98);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: 0 28px 90px rgba(16,24,40,.24);
      padding: 24px;
    }

    .modal-close {
      min-height: 38px;
      min-width: 38px;
      padding: 0 12px;
      border-radius: 13px;
      background: #f2f4f7;
      color: #475467;
      font-size: 20px;
      line-height: 1;
    }

    .section-title {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      margin-bottom: 16px;
    }

    .section-title h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border-radius: 999px;
      padding: 7px 11px;
      font-size: 12px;
      font-weight: 850;
      background: var(--soft-blue);
      color: var(--brand-dark);
      white-space: nowrap;
    }

    .dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: currentColor;
    }

    form { display: grid; gap: 12px; }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    label {
      display: grid;
      gap: 7px;
      color: #344054;
      font-size: 13px;
      font-weight: 760;
    }

    label.wide { grid-column: span 2; }

    .label-text {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    input, select, textarea {
      width: 100%;
      height: 46px;
      border: 1px solid #d0d5dd;
      border-radius: 15px;
      background: #fff;
      padding: 0 13px;
      font: inherit;
      color: var(--text);
      outline: none;
      transition: .18s ease;
    }

    input:focus, select:focus, textarea:focus {
      border-color: var(--brand);
      box-shadow: 0 0 0 4px rgba(37,99,235,.12);
    }

    input[readonly] {
      background: #f2f4f7;
      color: #475467;
      cursor: not-allowed;
    }

    textarea {
      width: 100%;
      min-height: 110px;
      border: 1px solid #d0d5dd;
      border-radius: 15px;
      background: #fff;
      padding: 12px 13px;
      font: inherit;
      color: var(--text);
      outline: none;
      resize: vertical;
      transition: .18s ease;
    }

    input:required:invalid {
      border-color: #d0d5dd;
    }

    form.submitted input:required:invalid {
      border-color: var(--red);
      box-shadow: 0 0 0 4px rgba(240,68,56,.10);
    }

    .required-mark {
      color: var(--red);
      font-weight: 900;
    }

    .form-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .form-actions button { min-width: 160px; }

    .toolbar {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }

    .toolbar .search { flex: 1; min-width: 230px; }
    .toolbar button { min-height: 44px; }

    .table-wrap {
      overflow-x: hidden;
      overflow-y: auto;
      border: 1px solid var(--line);
      border-radius: 18px;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 0;
      table-layout: fixed;
      background: #fff;
    }

    th, td {
      padding: 12px 10px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      font-size: 13px;
      vertical-align: middle;
      overflow-wrap: anywhere;
      word-break: normal;
    }

    th:nth-child(1), td:nth-child(1) { width: 11%; }
    th:nth-child(2), td:nth-child(2) { width: 11%; }
    th:nth-child(3), td:nth-child(3) { width: 10%; }
    th:nth-child(4), td:nth-child(4) { width: 16%; }
    th:nth-child(5), td:nth-child(5) { width: 12%; }
    th:nth-child(6), td:nth-child(6) { width: 9%; }
    th:nth-child(7), td:nth-child(7) { width: 8%; }
    th:nth-child(8), td:nth-child(8) { width: 9%; }
    th:nth-child(9), td:nth-child(9) { width: 8%; }
    th:nth-child(10), td:nth-child(10) { width: 10%; }
    th:nth-child(11), td:nth-child(11) { width: 7%; }

    th {
      position: sticky;
      top: 0;
      z-index: 1;
      color: #475467;
      background: #f8fafc;
      font-size: 12px;
      letter-spacing: .04em;
      text-transform: uppercase;
      white-space: nowrap;
    }

    tr:last-child td { border-bottom: 0; }

    tbody tr.data-row { cursor: pointer; }
    tbody tr.data-row:hover { background: #f8fafc; }

    .status {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border-radius: 999px;
      padding: 6px 10px;
      font-weight: 850;
      font-size: 12px;
      white-space: nowrap;
    }

    .status.in { background: #ecfdf3; color: #027a48; }
    .status.out { background: #f2f4f7; color: #475467; }
    .status.alert { background: #fff8eb; color: #b54708; }

    .row-actions { display: flex; gap: 6px; justify-content: flex-start; }
    .row-actions button { min-height: 34px; padding: 0 8px; font-size: 11px; border-radius: 11px; line-height: 1.05; min-width: 0; }

    .empty {
      text-align: center;
      color: var(--muted);
      padding: 34px;
    }



    .history-card { width: min(980px, 100%); }

    .history-toolbar {
      display: flex;
      gap: 10px;
      align-items: center;
      margin: 6px 0 16px;
    }

    .history-toolbar .search { flex: 1; min-width: 240px; }

    .history-filters { align-items: end; }

    .history-date-filter,
    .history-export-card label {
      display: grid;
      gap: 6px;
      font-size: 13px;
      font-weight: 800;
      color: var(--muted);
      min-width: 170px;
    }

    .history-date-filter input,
    .history-export-card input {
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 14px 16px;
      font-size: 15px;
      font-weight: 800;
      color: var(--text);
      background: white;
      outline: none;
    }

    .history-export-card {
      display: flex;
      align-items: end;
      gap: 12px;
      flex-wrap: wrap;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 22px;
      background: #f8fafc;
      margin-bottom: 16px;
    }

    .history-export-title {
      width: 100%;
      font-weight: 900;
      color: var(--text);
      margin-bottom: 2px;
    }

    .small-action {
      min-height: 50px;
      padding: 0 20px;
      border-radius: 18px;
    }

    .history-log {
      display: grid;
      gap: 14px;
      max-height: 58vh;
      overflow: auto;
      padding-right: 4px;
    }

    .history-date-group {
      border: 1px solid var(--line);
      border-radius: 18px;
      overflow: hidden;
      background: #fff;
    }

    .history-date-header {
      padding: 12px 14px;
      background: #f8fafc;
      color: #475467;
      font-size: 12px;
      font-weight: 900;
      letter-spacing: .04em;
      text-transform: uppercase;
      border-bottom: 1px solid var(--line);
    }

    .history-entry {
      display: grid;
      grid-template-columns: 112px 160px 1fr;
      gap: 12px;
      padding: 13px 14px;
      border-bottom: 1px solid var(--line);
      align-items: center;
    }

    .history-entry:last-child { border-bottom: 0; }

    .history-time {
      color: var(--muted);
      font-size: 13px;
      font-weight: 800;
      white-space: nowrap;
    }

    .history-action {
      width: fit-content;
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 12px;
      font-weight: 900;
      background: var(--soft-blue);
      color: var(--brand-dark);
      white-space: nowrap;
    }

    .history-detail strong { display: block; margin-bottom: 2px; }
    .history-detail span { color: var(--muted); font-size: 13px; line-height: 1.35; }



    .settings-list {
      display: grid;
      gap: 10px;
      margin: 10px 0 18px;
    }

    .settings-group-title {
      margin: 8px 2px 2px;
      font-size: 11px;
      letter-spacing: .08em;
      text-transform: uppercase;
      color: #98a2b3;
      font-weight: 900;
    }

    .setting-edit-row {
      display: grid;
      grid-template-columns: 220px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      padding: 11px 12px;
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      background: #fff;
    }

    .setting-edit-row strong { color: var(--text); font-size: 14px; }

    .setting-edit-row input,
    .setting-edit-row select {
      height: 40px;
      border-radius: 11px;
      background: #fff;
    }

    .setting-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 11px 12px;
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      background: #fff;
    }

    .setting-row strong { font-size: 14px; }
    .setting-row span { color: var(--muted); font-size: 13px; line-height: 1.35; }

    .escort-manager {
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      background: #fff;
      padding: 12px;
      margin-top: 6px;
    }

    .escort-manager h3 {
      margin: 0 0 8px;
      font-size: 14px;
      letter-spacing: -.02em;
    }

    .escort-add-row {
      display: flex;
      gap: 8px;
      margin-bottom: 10px;
    }

    .escort-add-row input { flex: 1; }

    .escort-list {
      display: grid;
      gap: 6px;
      max-height: 220px;
      overflow: auto;
    }

    .escort-name-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 9px 10px;
      border: 1px solid #e5e7eb;
      border-radius: 11px;
      background: #fafafa;
    }

    .escort-name-row span {
      font-weight: 700;
      color: #344054;
    }

    .escort-name-row button {
      min-height: 30px;
      border-radius: 10px;
      padding: 0 10px;
      background: #fff1f0;
      color: var(--red);
    }

    .settings-actions {
      margin-top: 14px;
    }

    @media (max-width: 940px) {
      header { display: grid; }
      .clock { text-align: left; }
      .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .kpi.main { grid-column: auto; }
      .actions { grid-template-columns: 1fr; }
      .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .history-entry { grid-template-columns: 1fr; gap: 6px; }
    }

    @media (max-width: 560px) {
      .app { padding: 22px 14px 36px; }
      .hero, .panel, .modal-card { padding: 16px; border-radius: 22px; }
      .form-grid { grid-template-columns: 1fr; }
      label.wide { grid-column: span 1; }
      .big-checkin, .big-checkout { min-height: 78px; }
    }
  

    .auth-gate {
      position: fixed;
      inset: 0;
      z-index: 1000;
      display: grid;
      place-items: center;
      padding: 22px;
      background:
        radial-gradient(circle at top left, rgba(37,99,235,.22), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(18,183,106,.16), transparent 30rem),
        #f6f7fb;
    }

    .auth-card {
      width: min(460px, 100%);
      background: rgba(255,255,255,.96);
      border: 1px solid var(--line);
      border-radius: 30px;
      box-shadow: var(--shadow);
      padding: 30px;
    }

    .auth-card h2 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.04em; }
    .auth-card p { color: var(--muted); line-height: 1.5; margin: 0 0 22px; }
    .auth-error { color: var(--red); font-weight: 800; min-height: 20px; margin-top: 4px; }
    .auth-success { color: #027a48; font-weight: 800; line-height: 1.4; min-height: 20px; margin-top: 4px; }
    .auth-card button { width: 100%; margin-top: 4px; }
    .auth-secondary {
      background: transparent;
      border: 1px solid var(--line);
      color: #344054;
      box-shadow: none;
    }
    .auth-link-row {
      margin-top: 14px;
      text-align: center;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.45;
    }
    .auth-link-row button {
      width: auto;
      min-height: 0;
      padding: 0;
      border-radius: 0;
      background: transparent;
      color: var(--brand);
      box-shadow: none;
      font-weight: 900;
      text-decoration: underline;
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 8px;
      justify-content: flex-end;
    }

    .account-bar {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .clock {
      display: none;
    }

    .site-account-controls {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    #siteSelector {
      width: var(--site-selector-width, 230px);
      min-width: 0;
      max-width: min(100%, 360px);
      height: 44px;
      border-radius: 13px;
      font-weight: 750;
      background: rgba(255,255,255,.9);
    }

    #logoutButton {
      min-height: 44px;
      border-radius: 13px;
      white-space: nowrap;
      padding: 0 15px;
      display: inline-flex;
      align-items: center;
      gap: 9px;
      background: transparent;
      border: 1px solid var(--line);
      box-shadow: none;
    }

    #signedInUser {
      max-width: 150px;
      overflow: hidden;
      text-overflow: ellipsis;
      font-weight: 800;
    }

    .logout-action {
      padding-left: 9px;
      border-left: 1px solid var(--line);
      color: var(--muted);
      font-size: 12px;
      font-weight: 750;
    }

    .utility-row {
      display: flex;
      align-items: center;
    }

    .menu-icon {
      width: 44px;
      height: 44px;
      border-radius: 13px;
      box-shadow: none;
    }

    .site-empty { text-align:center; padding: 26px; color: var(--muted); }

    .admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
    .admin-grid-single { grid-template-columns: 1fr; }
    .admin-card { border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; padding: 16px; }
    .admin-card h3 { margin: 0 0 12px; font-size: 17px; }
    .admin-user-list { display: grid; gap: 10px; max-height: 46vh; overflow: auto; }
    .admin-user-row { border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 13px; display: grid; gap: 8px; }
    .admin-user-row strong { overflow-wrap: anywhere; }
    .pending-user-list { display: grid; gap: 10px; margin-bottom: 16px; }
    .pending-user-card {
      width: 100%;
      min-height: 0;
      padding: 13px;
      border: 1px solid #bfdbfe;
      border-radius: 15px;
      background: #eff6ff;
      color: var(--text);
      text-align: left;
      box-shadow: none;
      display: grid;
      gap: 5px;
    }
    .pending-user-card:hover { background: #dbeafe; }
    .pending-user-card strong { overflow-wrap: anywhere; }
    .pending-user-meta { color: var(--muted); font-size: 12px; line-height: 1.4; }
    .admin-access { color: var(--muted); font-size: 12px; line-height: 1.45; }
    .admin-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .admin-row-actions button { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 12px; }
    @media (max-width: 760px) { .admin-grid { grid-template-columns: 1fr; } }

    @media (max-width: 940px) {
      header { align-items: center; }
      .header-right { flex-wrap: wrap; }
      #siteSelector { width: var(--site-selector-width, 230px); min-width: 0; }
    }

    @media (max-width: 650px) {
      header { display: grid; gap: 16px; }
      .brand-lockup { gap: 12px; }
      .brand-logo { width: min(44vw, 175px); }
      .brand-divider { height: 34px; }
      .brand-lockup h1 { font-size: clamp(25px, 7vw, 32px); }
      .header-right { width: 100%; justify-content: flex-start; }
      .account-bar { flex: 1; min-width: 0; }
      .site-account-controls { width: 100%; }
      #siteSelector { flex: 0 1 auto; width: var(--site-selector-width, 230px); min-width: 0; max-width: 100%; }
      #logoutButton { padding: 0 12px; }
      #signedInUser { max-width: 90px; }
    }
  

    /* Minimal, user-friendly User Management */
    #userManagementPanel .modal-card {
      width: min(1040px, 100%);
      max-height: 90vh;
      padding: 22px;
      border-radius: 22px;
    }

    #userManagementPanel .section-title {
      margin-bottom: 14px;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--line);
    }

    #userManagementPanel .section-title h2 {
      font-size: 26px;
      letter-spacing: -.035em;
    }

    #userManagementPanel .admin-grid {
      margin-bottom: 14px;
      gap: 12px;
    }

    #userManagementPanel .admin-card {
      padding: 18px;
      border-radius: 16px;
      background: #fff;
      box-shadow: none;
    }

    #userManagementPanel .admin-card h3 {
      margin-bottom: 4px;
      font-size: 17px;
    }

    .admin-card-note {
      margin: 0 0 14px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }

    #adminAssignForm {
      display: grid;
      grid-template-columns: 1.45fr 1fr .8fr auto;
      gap: 10px;
      align-items: end;
    }

    #adminAssignForm label {
      gap: 6px;
      font-size: 12px;
    }

    #adminAssignForm input,
    #adminAssignForm select {
      height: 44px;
      border-radius: 12px;
      background: #fff;
    }

    #adminAssignForm button {
      min-height: 44px;
      border-radius: 12px;
      padding: 0 18px;
      white-space: nowrap;
      box-shadow: none;
    }

    .admin-list-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: 18px 2px 10px;
    }

    .admin-list-heading strong {
      font-size: 14px;
    }

    .admin-list-heading span {
      color: var(--muted);
      font-size: 12px;
    }

    #userManagementPanel .admin-user-list {
      gap: 8px;
      max-height: 42vh;
      padding-right: 4px;
    }

    #userManagementPanel .admin-user-row {
      grid-template-columns: minmax(240px, 1fr) auto;
      align-items: center;
      gap: 14px;
      padding: 14px 16px;
      border-radius: 14px;
      box-shadow: none;
    }

    .admin-user-main {
      min-width: 0;
      display: grid;
      gap: 7px;
    }

    .admin-user-email {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.25;
      overflow-wrap: anywhere;
    }

    .admin-user-name {
      font-size: 15px;
      line-height: 1.2;
      overflow-wrap: anywhere;
    }

    .admin-access {
      display: flex;
      align-items: center;
      gap: 7px;
      flex-wrap: wrap;
      color: var(--muted);
      font-size: 12px;
    }

    .access-badge {
      display: inline-flex;
      align-items: center;
      min-height: 27px;
      padding: 4px 9px;
      border-radius: 999px;
      border: 1px solid #dbe3ef;
      background: #f8fafc;
      color: #475467;
      font-weight: 750;
    }

    .access-badge.role {
      border-color: #bfdbfe;
      background: #eff6ff;
      color: #1d4ed8;
    }

    .access-badge.super {
      border-color: #c7ead9;
      background: #ecfdf3;
      color: #027a48;
    }

    .access-empty {
      color: #98a2b3;
      font-size: 12px;
    }

    #userManagementPanel .admin-row-actions {
      justify-content: flex-end;
      gap: 6px;
    }

    #userManagementPanel .admin-row-actions button {
      min-height: 34px;
      padding: 0 10px;
      border-radius: 10px;
      font-size: 11px;
      box-shadow: none;
    }

    #userManagementPanel .admin-row-actions .secondary {
      background: #f2f4f7;
      color: #344054;
    }

    #userManagementPanel .admin-row-actions .danger {
      background: transparent;
      color: #d92d20;
      border: 1px solid #fecdca;
    }

    #userManagementPanel > .modal-card > .form-actions {
      margin-top: 12px !important;
      padding-top: 12px;
      border-top: 1px solid var(--line);
    }

    #userManagementPanel > .modal-card > .form-actions button {
      min-height: 40px;
      border-radius: 11px;
    }

    @media (max-width: 860px) {
      #adminAssignForm { grid-template-columns: 1fr 1fr; }
      #adminAssignForm label:first-child { grid-column: 1 / -1; }
      #adminAssignForm button { width: 100%; }
      #userManagementPanel .admin-user-row { grid-template-columns: 1fr; }
      #userManagementPanel .admin-row-actions { justify-content: flex-start; }
    }

    @media (max-width: 560px) {
      #userManagementPanel .modal-card { padding: 15px; border-radius: 18px; }
      #adminAssignForm { grid-template-columns: 1fr; }
      #adminAssignForm label:first-child { grid-column: auto; }
      #userManagementPanel .admin-user-row { padding: 13px; }
      #userManagementPanel .admin-row-actions button { flex: 1 1 auto; }
    }


    /* Extra-compact User Management layout */
    #userManagementPanel .modal-card {
      width: min(900px, 96vw);
      max-height: 92vh;
      padding: 14px;
      border-radius: 16px;
    }

    #userManagementPanel .section-title {
      margin-bottom: 9px;
      padding-bottom: 9px;
    }

    #userManagementPanel .section-title h2 { font-size: 21px; }
    #userManagementPanel .modal-close {
      min-width: 34px;
      min-height: 34px;
      border-radius: 10px;
      font-size: 18px;
    }

    #userManagementPanel .admin-grid {
      gap: 8px;
      margin-bottom: 8px;
    }

    #userManagementPanel .admin-card {
      padding: 11px;
      border-radius: 12px;
    }

    #userManagementPanel .admin-card h3 {
      margin: 0 0 2px;
      font-size: 15px;
    }

    #userManagementPanel .admin-card-note {
      margin: 0 0 8px;
      font-size: 11px;
      line-height: 1.3;
    }

    #adminAssignForm {
      grid-template-columns: 1.35fr 1fr .72fr auto;
      gap: 7px;
    }

    #adminAssignForm label {
      gap: 4px;
      font-size: 11px;
    }

    #adminAssignForm input,
    #adminAssignForm select {
      height: 38px;
      padding: 0 10px;
      border-radius: 9px;
      font-size: 13px;
    }

    #adminAssignForm button {
      min-height: 38px;
      padding: 0 13px;
      border-radius: 9px;
      font-size: 12px;
    }

    #userManagementPanel .pending-user-list {
      gap: 6px;
      margin-bottom: 8px;
    }

    #userManagementPanel .pending-user-card {
      padding: 9px 10px;
      border-radius: 10px;
      gap: 2px;
    }

    #userManagementPanel .admin-list-heading {
      margin: 9px 1px 6px;
    }

    #userManagementPanel .admin-list-heading strong { font-size: 12px; }
    #userManagementPanel .admin-list-heading span { font-size: 10px; }

    #userManagementPanel .admin-user-list {
      gap: 5px;
      max-height: 48vh;
      padding-right: 2px;
    }

    #userManagementPanel .admin-user-row {
      grid-template-columns: minmax(210px, 1fr) auto;
      gap: 9px;
      padding: 9px 11px;
      border-radius: 11px;
    }

    #userManagementPanel .admin-user-main { gap: 4px; }
    #userManagementPanel .admin-user-email {
      font-size: 13px;
      line-height: 1.15;
    }

    #userManagementPanel .admin-access {
      gap: 4px;
      font-size: 10px;
      line-height: 1.2;
    }

    #userManagementPanel .access-badge {
      min-height: 22px;
      padding: 2px 7px;
      font-size: 10px;
    }

    #userManagementPanel .access-empty { font-size: 10px; }
    #userManagementPanel .admin-row-actions { gap: 4px; }

    #userManagementPanel .admin-row-actions button {
      min-height: 29px;
      padding: 0 8px;
      border-radius: 8px;
      font-size: 10px;
    }

    #userManagementPanel > .modal-card > .form-actions {
      margin-top: 8px !important;
      padding-top: 8px;
    }

    #userManagementPanel > .modal-card > .form-actions button {
      min-height: 34px;
      padding: 0 14px;
      border-radius: 9px;
      font-size: 12px;
    }

    @media (max-width: 760px) {
      #adminAssignForm { grid-template-columns: 1fr 1fr; }
      #adminAssignForm label:first-child { grid-column: 1 / -1; }
      #adminAssignForm button { width: 100%; }
      #userManagementPanel .admin-user-row { grid-template-columns: 1fr; }
      #userManagementPanel .admin-row-actions { justify-content: flex-start; }
    }

    @media (max-width: 520px) {
      #userManagementPanel .modal-card { width: 100%; padding: 10px; border-radius: 13px; }
      #adminAssignForm { grid-template-columns: 1fr; }
      #adminAssignForm label:first-child { grid-column: auto; }
      #userManagementPanel .admin-user-row { padding: 8px 9px; }
      #userManagementPanel .admin-row-actions button { flex: 0 1 auto; }
    }

    /* Minimal, user-friendly Site / Team Management */
    #settingsPanel .modal-card {
      width: min(920px, 96vw);
      max-height: 92vh;
      padding: 16px;
      border-radius: 18px;
    }

    #settingsPanel .section-title {
      margin-bottom: 10px;
      padding-bottom: 10px;
      border-bottom: 1px solid #eef2f7;
    }

    #settingsPanel .section-title h2 { font-size: 24px; }

    @media (max-width: 720px) {
      #settingsPanel .setting-edit-row,
      #settingsPanel .setting-row {
        grid-template-columns: 1fr;
      }
      #settingsPanel .setting-row {
        align-items: start;
      }
      #settingsPanel .setting-edit-row strong,
      #settingsPanel .setting-row strong {
        font-size: 13px;
      }
      #settingsPanel .setting-edit-row input,
      #settingsPanel .setting-edit-row select {
        width: 100%;
      }
    }

    #siteManagementPanel .section-title {
      margin-bottom: 8px;
      padding-bottom: 8px;
    }

    #siteManagementPanel .section-title h2 {
      font-size: 22px;
      letter-spacing: -.03em;
      margin-bottom: 4px;
    }

    .panel-subtitle {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }

    #siteManagementPanel .modal-close {
      min-width: 34px;
      min-height: 34px;
      border-radius: 10px;
      font-size: 18px;
    }

    #siteManagementPanel .admin-grid {
      margin-bottom: 8px;
      gap: 8px;
    }

    #siteManagementPanel .admin-card {
      padding: 12px;
      border-radius: 12px;
      background: #fff;
      box-shadow: none;
    }

    #siteManagementPanel .admin-card h3 {
      margin: 0 0 2px;
      font-size: 15px;
    }

    #siteManagementPanel .admin-card-note {
      margin: 0 0 8px;
      font-size: 11px;
      line-height: 1.3;
    }

    #createSiteForm {
      display: grid;
      grid-template-columns: 1.15fr .8fr 1.35fr auto;
      gap: 7px;
      align-items: end;
    }

    #createSiteForm label {
      gap: 4px;
      font-size: 11px;
    }

    #createSiteForm input {
      height: 38px;
      padding: 0 10px;
      border-radius: 9px;
      font-size: 13px;
    }

    #createSiteForm button {
      min-height: 38px;
      padding: 0 13px;
      border-radius: 9px;
      font-size: 12px;
      box-shadow: none;
    }

    #siteManagementPanel .admin-list-heading {
      margin: 10px 1px 6px;
    }

    #siteManagementPanel .admin-list-heading strong {
      font-size: 12px;
    }

    #siteManagementPanel .admin-list-heading span {
      font-size: 10px;
    }

    #siteManagementPanel .admin-user-list {
      gap: 6px;
      max-height: 54vh;
      padding-right: 2px;
    }

    #siteManagementPanel .admin-site-row {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fff;
      overflow: hidden;
    }

    #siteManagementPanel .admin-site-summary {
      list-style: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 12px;
      background: #f8fafc;
      cursor: pointer;
    }

    #siteManagementPanel .admin-site-summary::-webkit-details-marker {
      display: none;
    }

    #siteManagementPanel .admin-site-main {
      min-width: 0;
      display: grid;
      gap: 2px;
    }

    #siteManagementPanel .admin-site-main strong {
      font-size: 13px;
      line-height: 1.2;
    }

    #siteManagementPanel .admin-site-main span {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.25;
      overflow-wrap: anywhere;
    }

    #siteManagementPanel .admin-site-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    #siteManagementPanel .site-pill {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 2px 7px;
      border-radius: 999px;
      border: 1px solid #dbe3ef;
      background: #f8fafc;
      color: #475467;
      font-size: 10px;
      font-weight: 800;
      white-space: nowrap;
    }

    #siteManagementPanel .site-pill.active {
      border-color: #c7ead9;
      background: #ecfdf3;
      color: #027a48;
    }

    #siteManagementPanel .site-pill.inactive {
      border-color: #fed7aa;
      background: #fff7ed;
      color: #b45309;
    }

    #siteManagementPanel .site-edit-hint {
      color: #98a2b3;
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    #siteManagementPanel .admin-site-body {
      padding: 10px 12px 12px;
      display: grid;
      gap: 10px;
    }

    #siteManagementPanel .site-edit-grid {
      display: grid;
      grid-template-columns: 1.1fr .8fr 1.4fr .7fr;
      gap: 7px;
      align-items: end;
    }

    #siteManagementPanel .site-edit-grid label {
      gap: 4px;
      font-size: 11px;
    }

    #siteManagementPanel .site-edit-grid input,
    #siteManagementPanel .site-edit-grid select {
      height: 38px;
      padding: 0 10px;
      border-radius: 9px;
      font-size: 13px;
    }

    #siteManagementPanel .admin-row-actions {
      justify-content: flex-end;
      gap: 6px;
    }

    #siteManagementPanel .admin-row-actions button {
      min-height: 30px;
      padding: 0 9px;
      border-radius: 8px;
      font-size: 10px;
      box-shadow: none;
    }

    #siteManagementPanel .admin-row-actions .secondary {
      background: #f2f4f7;
      color: #344054;
    }

    #siteManagementPanel .admin-row-actions .danger {
      background: transparent;
      color: #d92d20;
      border: 1px solid #fecdca;
    }

    #siteManagementPanel > .modal-card > .form-actions {
      margin-top: 8px !important;
      padding-top: 8px;
      border-top: 1px solid var(--line);
    }

    #siteManagementPanel > .modal-card > .form-actions button {
      min-height: 34px;
      padding: 0 14px;
      border-radius: 9px;
      font-size: 12px;
    }

    @media (max-width: 860px) {
      #createSiteForm {
        grid-template-columns: 1fr 1fr;
      }
      #createSiteForm label:first-child {
        grid-column: 1 / -1;
      }
      #createSiteForm button {
        width: 100%;
      }
      #siteManagementPanel .site-edit-grid {
        grid-template-columns: 1fr 1fr;
      }
      #siteManagementPanel .admin-site-summary {
        align-items: flex-start;
      }
      #siteManagementPanel .admin-site-meta {
        justify-content: flex-start;
      }
    }

    @media (max-width: 560px) {
      #siteManagementPanel .modal-card {
        width: 100%;
        padding: 10px;
        border-radius: 13px;
      }
      #createSiteForm,
      #siteManagementPanel .site-edit-grid {
        grid-template-columns: 1fr;
      }
      #createSiteForm label:first-child {
        grid-column: auto;
      }
      #siteManagementPanel .admin-site-summary {
        padding: 9px 10px;
      }
      #siteManagementPanel .admin-site-body {
        padding: 9px 10px 10px;
      }
      #siteManagementPanel .admin-row-actions {
        justify-content: flex-start;
      }
    }

    /* Minimal dropdown action controls */
    #userManagementPanel .admin-row-actions {
      display: flex;
      justify-content: flex-end;
      align-items: flex-start;
    }

    #userManagementPanel .admin-actions-dropdown {
      position: relative;
      width: fit-content;
    }

    #userManagementPanel .admin-actions-dropdown summary {
      list-style: none;
      cursor: pointer;
      min-height: 30px;
      padding: 0 10px;
      border: 1px solid #e5e7eb;
      border-radius: 9px;
      background: #fff;
      color: #344054;
      font-size: 11px;
      font-weight: 800;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      user-select: none;
    }

    #userManagementPanel .admin-actions-dropdown summary::-webkit-details-marker { display: none; }

    #userManagementPanel .admin-actions-dropdown summary::after {
      content: '▾';
      font-size: 10px;
      color: #98a2b3;
      transform: translateY(-1px);
    }

    #userManagementPanel .admin-actions-dropdown[open] summary {
      border-color: #d0d5dd;
      background: #f8fafc;
    }

    #userManagementPanel .admin-actions-menu {
      position: absolute;
      right: 0;
      top: calc(100% + 6px);
      z-index: 20;
      min-width: 180px;
      padding: 6px;
      border: 1px solid #e5e7eb;
      border-radius: 11px;
      background: #fff;
      box-shadow: 0 12px 30px rgba(16, 24, 40, 0.10);
      display: grid;
      gap: 4px;
    }

    #userManagementPanel .admin-actions-menu button {
      width: 100%;
      min-height: 30px;
      padding: 0 10px;
      border: 0 !important;
      border-radius: 8px !important;
      background: transparent !important;
      color: #344054 !important;
      box-shadow: none !important;
      font-size: 11px;
      font-weight: 750;
      text-align: left;
    }

    #userManagementPanel .admin-actions-menu button:hover {
      transform: none;
      background: #f8fafc !important;
      color: #111827 !important;
    }

    #userManagementPanel .admin-actions-menu .danger {
      color: #b42318 !important;
    }

    #userManagementPanel .admin-actions-menu .danger:hover {
      background: #fff5f4 !important;
      color: #b42318 !important;
    }

    @media (max-width: 520px) {
      #userManagementPanel .admin-row-actions {
        width: 100%;
        justify-content: flex-start;
      }

      #userManagementPanel .admin-actions-menu {
        min-width: 160px;
      }
    }

/* ==========================================================
   Responsive layout and final visual overrides
   ========================================================== */

:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #111827;
    --muted: #667085;
    --line: #e4e7ec;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --shadow: 0 14px 36px rgba(16, 24, 40, 0.08);
    --radius: 20px;
  }

  .current-time-pill { margin-bottom: 16px; }
  .checkout-modal-card { width: min(620px, 100%); }
  .checkout-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .full-grid-row { grid-column: 1 / -1; }
  .empty-compact { padding: 18px; }
  .empty-error { color: var(--red); }
  .form-actions-spaced { margin-top: 12px; }
  .form-actions-spaced-lg { margin-top: 16px; }

  .guest-gate {
    min-height: 100vh;
    padding: 28px 16px;
    display: grid;
    place-items: center;
    background:
      radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28rem),
      var(--bg);
  }

  .guest-gate.hidden { display: none; }

  .guest-checkin-card {
    width: min(520px, 100%);
    padding: clamp(22px, 5vw, 36px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  .guest-checkin-card h2 {
    margin: 4px 0 8px;
    font-size: clamp(28px, 7vw, 38px);
    letter-spacing: -.04em;
  }

  .guest-checkin-card > p {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.5;
  }

  .guest-checkin-card form {
    display: grid;
    gap: 14px;
  }

  .guest-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
    font-size: 17px;
  }

  .guest-form-message {
    min-height: 22px;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.4;
  }

  .guest-form-message.error { color: var(--red); }
  .guest-form-message.success { color: #027a48; }

  .guest-checkin-card .guest-expiry-note {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 12px;
  }

  .kpi.qr-kpi {
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 14px;
    cursor: default;
  }

  .kpi.qr-kpi .kpi-label {
    text-align: center;
    font-size: 20px;
    line-height: 1;
    letter-spacing: .025em;
    white-space: nowrap;
  }

  .daily-qr-image {
    width: min(200px, 100%);
    min-height: 200px;
    padding: 0;
    display: grid;
    place-items: center;
    background: #fff;
  }

  .daily-qr-image img,
  .daily-qr-image canvas {
    width: 100%;
    max-width: 200px;
    height: auto;
  }

  .daily-qr-loading,
  .daily-qr-fallback {
    color: var(--muted);
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
  }

  @media (max-width: 700px) {
    .daily-qr-image {
      width: min(200px, 100%);
      min-height: 200px;
      justify-self: center;
    }
  }

  .vendor-heading-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 26rem),
      radial-gradient(circle at bottom right, rgba(18, 183, 106, 0.07), transparent 24rem),
      var(--bg);
  }

  .hero,
  .panel,
  .modal-card,
  .auth-card,
  .admin-card,
  .setting-row,
  .setting-edit-row,
  .escort-manager,
  .history-date-group,
  .history-export-card,
  .admin-user-row,
  .admin-site-row {
    border-radius: 18px;
    box-shadow: var(--shadow);
  }

  .modal-card {
    padding: 20px;
  }

  .section-title {
    margin-bottom: 14px;
  }

  .section-title h2 {
    font-size: 24px;
    letter-spacing: -0.04em;
  }

  .panel-subtitle,
  .subtitle,
  .history-detail span,
  .admin-card-note,
  .history-date-filter,
  .history-export-card label,
  .setting-row {
    color: var(--muted);
  }

  button,
  input,
  select,
  textarea {
    border-radius: 14px;
  }

  .big-checkin,
  .big-checkout,
  .primary,
  .secondary,
  .danger {
    border-radius: 16px;
  }

  .actions {
    gap: 10px;
  }

  .big-checkin,
  .big-checkout {
    min-height: 78px;
    font-size: clamp(20px, 3.6vw, 32px);
  }

  .kpi,
  .setting-edit-row,
  .setting-row {
    border-radius: 16px;
  }

  .kpi.main,
  .kpi.overnight {
    box-shadow: 0 16px 34px rgba(16, 24, 40, 0.10);
  }

  .top-menu .dropdown-menu {
    border-radius: 14px;
  }

  .history-card {
    width: min(920px, 100%);
  }

  .admin-user-clickable {
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  }

  .admin-user-clickable:hover {
    border-color: rgba(37, 99, 235, .42);
    box-shadow: 0 12px 28px rgba(37, 99, 235, .10);
    transform: translateY(-1px);
  }

  .admin-user-clickable:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .24);
    outline-offset: 3px;
  }

  .user-edit-card {
    width: min(520px, 100%);
  }

  .user-edit-form {
    display: grid;
    gap: 14px;
  }

  .user-edit-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
  }

  .user-edit-form input,
  .user-edit-form select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    padding: 11px 13px;
    font: inherit;
  }

  .user-edit-form input[readonly] {
    background: #f3f4f6;
    color: var(--muted);
  }

  .history-toolbar {
    display: grid;
    grid-template-columns: 1fr 180px auto;
    gap: 10px;
    align-items: end;
  }

  .history-toolbar .search {
    min-width: 0;
  }

  .history-date-filter {
    min-width: 0;
  }

  .history-export-card {
    background: #fafbfc;
    border: 1px solid var(--line);
    padding: 14px;
    gap: 10px;
  }

  .history-export-title {
    font-size: 18px;
    margin-bottom: 0;
  }

  .small-action {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
  }

  .history-log {
    gap: 10px;
    max-height: 56vh;
  }

  .history-date-header {
    padding: 10px 14px;
    background: #f8fafc;
  }

  .history-entry {
    grid-template-columns: 100px 118px 1fr;
    gap: 12px;
    padding: 12px 14px;
  }

  .history-time {
    font-size: 12px;
    font-weight: 750;
  }

  .history-action {
    padding: 6px 10px;
    font-size: 11px;
    background: #eef4ff;
    color: #1d4ed8;
  }

  .history-action.check-in {
    background: #ecfdf3;
    color: #027a48;
  }

  .history-action.check-out {
    background: #fff7ed;
    color: #c2410c;
  }

  .history-action.updated {
    background: #eef4ff;
    color: #1d4ed8;
  }

  .history-action.deleted {
    background: #fff1f0;
    color: #b42318;
  }

  .history-detail strong {
    margin-bottom: 3px;
    font-size: 15px;
  }

  .history-detail span {
    line-height: 1.45;
    font-size: 13px;
  }

  .history-date-filter input,
  .history-export-card input {
    border-radius: 14px;
  }

  .history-export-card input {
    min-width: 0;
  }

  .toolbar button,
  .row-actions button,
  .form-actions button,
  .escort-name-row button,
  .admin-row-actions button {
    border-radius: 12px;
  }

  .history-toolbar .search,
  .toolbar .search,
  #siteSelector,
  input,
  select,
  textarea {
    border-color: #d0d5dd;
  }

  .history-toolbar .search:focus,
  .toolbar .search:focus,
  #siteSelector:focus,
  input:focus,
  select:focus,
  textarea:focus {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
  }

  .empty {
    padding: 24px;
  }

  @media (max-width: 860px) {
    .history-toolbar {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 560px) {
    .modal-card,
    .hero,
    .panel {
      padding: 16px;
      border-radius: 18px;
    }

    .history-entry {
      grid-template-columns: 1fr;
      gap: 6px;
    }

    .history-export-card {
      padding: 12px;
    }

    .history-export-card label,
    .history-date-filter {
      min-width: 0;
    }
  }

  /* Compact overrides for Settings and History */
  #historyPanel .modal-card,
  #settingsPanel .modal-card {
    width: min(920px, 96vw);
    max-height: 90vh;
    padding: 8px;
    border-radius: 14px;
  }

  #historyPanel .section-title,
  #settingsPanel .section-title {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }

  #historyPanel .section-title h2,
  #settingsPanel .section-title h2 {
    font-size: 18px;
    letter-spacing: -.03em;
  }

  #historyPanel .modal-close,
  #settingsPanel .modal-close {
    min-width: 32px;
    min-height: 32px;
    border-radius: 9px;
    font-size: 17px;
  }

  /* Settings */
  #settingsPanel .settings-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    margin: 4px 0 6px;
    align-items: start;
  }

  #settingsPanel .settings-group-title {
    margin: 4px 2px 0;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #98a2b3;
    font-weight: 900;
  }

  #settingsPanel .setting-edit-row,
  #settingsPanel .setting-row,
  #settingsPanel .escort-manager {
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
  }

  #settingsPanel .setting-edit-row {
    width: 100%;
    padding: 6px 8px;
    gap: 8px;
    grid-template-columns: minmax(132px, 180px) minmax(0, 1fr);
    align-items: center;
    min-height: 48px;
  }

  #settingsPanel .setting-row {
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
  }

  #settingsPanel .setting-edit-row strong,
  #settingsPanel .setting-row strong {
    font-size: 12px;
  }

  #settingsPanel .setting-edit-row input,
  #settingsPanel .setting-edit-row select {
    height: 34px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 12px;
  }

  #settingsPanel .setting-row span {
    font-size: 11px;
    line-height: 1.3;
    text-align: right;
    color: var(--muted);
  }

  #settingsPanel .escort-manager {
    padding: 8px;
    margin-top: 0;
  }

  #settingsPanel .escort-manager h3 {
    margin: 0 0 6px;
    font-size: 13px;
    letter-spacing: -.02em;
  }

  #settingsPanel .escort-add-row {
    gap: 6px;
    margin-bottom: 6px;
  }

  #settingsPanel .escort-add-row input {
    height: 34px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 12px;
  }

  #settingsPanel .escort-add-row button {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 11px;
    box-shadow: none;
  }

  #settingsPanel .escort-list {
    gap: 5px;
    max-height: 170px;
    padding-right: 2px;
  }

  #settingsPanel .escort-name-row {
    padding: 7px 9px;
    border-radius: 9px;
  }

  #settingsPanel .escort-name-row span {
    font-size: 12px;
  }

  #settingsPanel .escort-name-row button {
    min-height: 28px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 10px;
  }

  #settingsPanel .settings-actions {
    margin-top: 8px;
    justify-content: flex-end;
  }

  #settingsPanel .settings-actions button {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 11px;
  }

  /* History */
  #historyPanel .history-toolbar,
  #historyPanel .history-export-card {
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    padding: 8px;
    box-shadow: none;
  }

  #historyPanel .history-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px auto;
    gap: 6px;
    align-items: end;
    margin: 6px 0 6px;
  }

  #historyPanel .history-toolbar .search {
    min-width: 0;
    height: 36px;
    border-radius: 9px;
  }

  #historyPanel .history-date-filter {
    min-width: 0;
  }

  #historyPanel .history-date-filter input {
    height: 36px;
    border-radius: 9px;
    font-size: 12px;
  }

  #historyPanel .history-export-card {
    display: grid;
    grid-template-columns: 1fr 132px 132px auto;
    gap: 6px;
    align-items: end;
    margin-bottom: 6px;
  }

  #historyPanel .history-export-title {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 0;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #98a2b3;
    font-weight: 900;
  }

  #historyPanel .history-export-card label,
  #historyPanel .history-date-filter {
    min-width: 0;
  }

  #historyPanel .history-export-card input {
    border-radius: 9px;
    height: 36px;
    font-size: 12px;
  }

  #historyPanel .small-action {
    min-height: 36px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 11px;
    box-shadow: none;
  }

  #historyPanel .history-log {
    gap: 6px;
    max-height: 42vh;
    padding-right: 2px;
  }

  #historyPanel .history-date-group {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
  }

  #historyPanel .history-date-header {
    padding: 8px 10px;
    background: #f8fafc;
    font-size: 10px;
    letter-spacing: .04em;
  }

  #historyPanel .history-entry {
    grid-template-columns: 82px 86px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 10px;
    align-items: center;
  }

  #historyPanel .history-time {
    font-size: 11px;
    font-weight: 750;
  }

  #historyPanel .history-action {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 999px;
  }

  #historyPanel .history-detail strong {
    margin-bottom: 1px;
    font-size: 12px;
  }

  #historyPanel .history-detail span {
    line-height: 1.25;
    font-size: 11px;
  }

  #historyPanel .form-actions {
    margin-top: 8px;
    justify-content: flex-end;
  }

  #historyPanel .form-actions button {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 11px;
  }

  /* Small-screen fallback */
  @media (max-width: 860px) {
    #settingsPanel .settings-list {
      grid-template-columns: 1fr;
    }

    #settingsPanel .setting-edit-row {
      grid-template-columns: 1fr;
      align-items: start;
    }

    #settingsPanel .setting-row {
      flex-direction: column;
      align-items: flex-start;
    }

    #settingsPanel .setting-row span {
      text-align: left;
    }

    #historyPanel .history-toolbar,
    #historyPanel .history-export-card {
      grid-template-columns: 1fr;
    }

    #historyPanel .history-export-title {
      grid-column: auto;
    }
  }

  @media (max-width: 520px) {
    #historyPanel .modal-card,
    #settingsPanel .modal-card {
      width: 100%;
      padding: 7px;
      border-radius: 12px;
    }

    #historyPanel .history-entry {
      grid-template-columns: 1fr;
      gap: 4px;
    }

    #historyPanel .history-time,
    #historyPanel .history-action {
      width: fit-content;
    }

    #settingsPanel .escort-add-row {
      flex-direction: column;
    }

    #settingsPanel .escort-add-row button {
      width: 100%;
    }
  }

  /* Unified minimal modal system */
  .modal-overlay {
    padding: 14px;
    background: rgba(15, 23, 42, .34);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  .modal-overlay .modal-card {
    width: min(760px, 100%);
    max-height: calc(100vh - 28px);
    padding: 18px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  #checkOutPanel .modal-card,
  #userEditPanel .modal-card {
    width: min(480px, 100%) !important;
  }

  #settingsPanel .modal-card {
    width: min(680px, 100%);
  }

  #userManagementPanel .modal-card,
  #siteManagementPanel .modal-card,
  #historyPanel .modal-card {
    width: min(840px, 100%);
  }

  .modal-overlay .section-title {
    min-height: 36px;
    margin: 0 0 14px;
    padding: 0 0 12px;
    border-bottom: 1px solid #edf0f4;
    align-items: flex-start;
  }

  .modal-overlay .section-title h2 {
    margin: 0;
    color: #172033;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.025em;
  }

  .modal-overlay .panel-subtitle {
    margin: 4px 0 0;
    color: #667085;
    font-size: 12px;
    line-height: 1.4;
  }

  .modal-overlay .modal-close {
    flex: 0 0 auto;
    min-width: 34px;
    min-height: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #f4f6f8;
    color: #667085;
    font-size: 18px;
    font-weight: 700;
    box-shadow: none;
  }

  .modal-overlay .modal-close:hover {
    background: #e9edf2;
    color: #1f2937;
    transform: none;
  }

  .modal-overlay form {
    gap: 10px;
  }

  .modal-overlay .form-grid {
    gap: 10px;
  }

  .modal-overlay label {
    gap: 5px;
    color: #475467;
    font-size: 12px;
    font-weight: 750;
  }

  .modal-overlay input,
  .modal-overlay select,
  .modal-overlay textarea {
    min-height: 40px;
    height: 40px;
    padding: 0 11px;
    border: 1px solid #d9dee7;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    box-shadow: none;
  }

  .modal-overlay textarea {
    min-height: 84px;
    height: auto;
    padding-block: 10px;
  }

  .modal-overlay input:focus,
  .modal-overlay select:focus,
  .modal-overlay textarea:focus {
    border-color: #7aa2f8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
  }

  .modal-overlay input[readonly] {
    background: #f6f7f9;
    color: #667085;
  }

  .modal-overlay .form-actions {
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #edf0f4;
    justify-content: flex-end;
  }

  .modal-overlay .form-actions button,
  .modal-overlay .primary,
  .modal-overlay .secondary,
  .modal-overlay .danger {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: none;
  }

  .modal-overlay .primary {
    background: #2563eb;
  }

  .modal-overlay .secondary {
    border: 1px solid #d9dee7;
    background: #fff;
    color: #344054;
  }

  .modal-overlay .danger {
    background: #fff1f0;
    color: #d92d20;
  }

  .user-edit-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding: 10px 11px;
    border: 1px solid #e8ebf0;
    border-radius: 11px;
    background: #fafbfc;
  }

  .user-edit-danger-copy {
    display: grid;
    gap: 3px;
  }

  .user-edit-danger-copy strong {
    color: #344054;
    font-size: 12px;
  }

  .user-edit-danger-copy span {
    color: #7c8799;
    font-size: 11px;
    line-height: 1.4;
  }

  .user-edit-danger-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .user-edit-danger-actions button {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    box-shadow: none;
  }

  .user-edit-danger-actions button:disabled {
    cursor: not-allowed;
    opacity: .45;
  }

  #userEditPanel .form-actions {
    margin-top: 2px;
    padding-top: 8px;
    border-top: 0;
  }

  #userEditPanel .form-actions button {
    flex: 0 0 auto;
    width: auto;
  }

  #userEditPanel .form-actions .secondary {
    min-width: 84px;
  }

  #userEditPanel .form-actions .primary {
    min-width: 126px;
  }

  .modal-overlay .admin-card,
  .modal-overlay .setting-row,
  .modal-overlay .setting-edit-row,
  .modal-overlay .escort-manager,
  .modal-overlay .history-export-card,
  .modal-overlay .history-date-group,
  .modal-overlay .admin-user-row,
  .modal-overlay .admin-site-row {
    border-color: #e6eaf0;
    border-radius: 12px;
    box-shadow: none;
  }

  .modal-overlay .admin-card {
    padding: 12px;
    background: #fafbfc;
  }

  .modal-overlay .admin-card h3 {
    margin: 0 0 8px;
    font-size: 14px;
  }

  .modal-overlay .admin-card-note {
    margin: -2px 0 10px;
    font-size: 11px;
    line-height: 1.4;
  }

  .app-toast-region {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    display: grid;
    gap: 8px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
  }

  .app-toast {
    padding: 11px 13px;
    border: 1px solid #dbe2ea;
    border-radius: 11px;
    background: #fff;
    color: #344054;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
    animation: toast-enter .16s ease-out;
  }

  .app-toast.success {
    border-color: #b7e4cf;
    background: #f0fbf6;
    color: #146c43;
  }

  .app-toast.error {
    border-color: #f3c6c2;
    background: #fff5f4;
    color: #b42318;
  }

  #appConfirmPanel {
    z-index: 2100;
  }

  #appConfirmPanel .app-confirm-card {
    width: min(420px, 100%) !important;
  }

  .app-confirm-message {
    margin: 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.5;
  }

  .app-confirm-input-row {
    margin-top: 12px;
  }

  #appConfirmPanel .form-actions button:disabled {
    cursor: not-allowed;
    opacity: .45;
  }

  @keyframes toast-enter {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .modal-overlay .empty {
    color: #7c8799;
    font-size: 12px;
  }

  @media (max-width: 700px) {
    .modal-overlay {
      padding: 8px;
      align-items: end;
    }

    .modal-overlay .modal-card,
    #historyPanel .modal-card,
    #settingsPanel .modal-card,
    #userManagementPanel .modal-card,
    #siteManagementPanel .modal-card {
      width: 100%;
      max-height: calc(100vh - 16px);
      padding: 14px;
      border-radius: 16px;
    }

    .modal-overlay .form-grid,
    #checkOutPanel .form-grid {
      grid-template-columns: 1fr !important;
    }

    .modal-overlay .form-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-overlay .form-actions button {
      width: 100%;
    }

    .user-edit-danger-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-edit-danger-actions button {
      width: 100%;
    }

    .user-edit-danger-zone {
      display: grid;
      align-items: stretch;
    }

    #userEditPanel .form-actions button {
      width: 100%;
      min-width: 0;
    }
  }

  /* Compact Activity History layout */
  #historyPanel .modal-card {
    width: min(760px, 100%);
    padding: 16px;
  }

  #historyPanel .section-title {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  #historyPanel .history-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px auto;
    gap: 8px;
    align-items: end;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #historyPanel .history-toolbar .search,
  #historyPanel .history-date-filter input,
  #historyPanel .history-export-card input {
    height: 38px;
    min-height: 38px;
    border-radius: 9px;
    font-size: 12px;
  }

  #historyPanel .history-date-filter,
  #historyPanel .history-export-card label {
    gap: 4px;
    font-size: 11px;
  }

  #historyPanel .history-export-card {
    display: grid;
    grid-template-columns: auto 150px 150px auto;
    gap: 8px;
    align-items: end;
    margin: 0 0 10px;
    padding: 9px 10px;
    border: 1px solid #e6eaf0;
    border-radius: 11px;
    background: #fafbfc;
    box-shadow: none;
  }

  #historyPanel .history-export-title {
    grid-column: auto;
    align-self: center;
    width: auto;
    margin: 0 4px 0 0;
    color: #667085;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
  }

  #historyPanel .small-action {
    min-height: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 11px;
    white-space: nowrap;
    box-shadow: none;
  }

  #historyPanel .history-log {
    max-height: 46vh;
  }

  #historyPanel > .modal-card > .form-actions {
    margin-top: 8px;
    padding-top: 8px;
  }

  #historyPanel > .modal-card > .form-actions button {
    min-height: 34px;
    width: auto;
    padding: 0 12px;
  }

  @media (max-width: 700px) {
    #historyPanel .history-toolbar {
      grid-template-columns: minmax(0, 1fr) 140px auto;
    }

    #historyPanel .history-export-card {
      grid-template-columns: 1fr 1fr auto;
    }

    #historyPanel .history-export-title {
      grid-column: 1 / -1;
    }
  }

  @media (max-width: 520px) {
    #historyPanel .history-toolbar,
    #historyPanel .history-export-card {
      grid-template-columns: 1fr;
    }

    #historyPanel .small-action,
    #historyPanel > .modal-card > .form-actions button {
      width: 100%;
    }
  }

  /* Vendor records: full-width table with a no-scroll card fallback */
  #vendorPanel .table-wrap {
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
  }

  #vendorPanel table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  #vendorPanel th,
  #vendorPanel td {
    padding: 11px 10px;
    min-width: 0;
  }

  #vendorPanel th {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.25;
    font-size: 10px;
    letter-spacing: .025em;
  }

  #vendorPanel td {
    font-size: 11px;
    line-height: 1.35;
  }

    #vendorPanel th:nth-child(1), #vendorPanel td:nth-child(1) { width: 20%; }
    #vendorPanel th:nth-child(2), #vendorPanel td:nth-child(2) { width: 11%; }
    #vendorPanel th:nth-child(3), #vendorPanel td:nth-child(3) { width: 10%; }
    #vendorPanel th:nth-child(4), #vendorPanel td:nth-child(4) { width: 18%; }
    #vendorPanel th:nth-child(5), #vendorPanel td:nth-child(5) { width: 13%; }
    #vendorPanel th:nth-child(6), #vendorPanel td:nth-child(6) { width: 10%; }
    #vendorPanel th:nth-child(7), #vendorPanel td:nth-child(7) { width: 10%; }
    #vendorPanel th:nth-child(8), #vendorPanel td:nth-child(8) { width: 7%; }

  #vendorPanel td:nth-child(6),
  #vendorPanel td:nth-child(7),
  #vendorPanel td:nth-child(8) {
    white-space: nowrap;
  }

  #vendorPanel .date-time-cell {
    display: inline-grid;
    gap: 2px;
    white-space: nowrap;
  }

  #vendorPanel .date-time-value {
    color: #172033;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.2;
  }

  #vendorPanel .date-time-date {
    color: #7c8799;
    font-size: 9px;
    line-height: 1.2;
  }

  #vendorPanel .name-with-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
  }

  #vendorPanel .name-with-state strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #vendorPanel .name-state {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-size: 9px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
  }

  #vendorPanel .name-state .dot {
    width: 6px;
    height: 6px;
  }

  #vendorPanel .name-state.in { background: transparent; color: #027a48; }
  #vendorPanel .name-state.out { background: transparent; color: #667085; }
  #vendorPanel .name-state.alert { background: transparent; color: #b54708; }

  #vendorPanel tbody tr.data-row.is-checked-out {
    background: #f6f7f9;
    color: #667085;
  }

  #vendorPanel tbody tr.data-row.is-checked-out:hover {
    background: #f1f3f6;
  }

  #vendorPanel tbody tr.data-row.is-checked-out strong,
  #vendorPanel tbody tr.data-row.is-checked-out .date-time-value {
    color: #475467;
  }

  #vendorPanel tbody tr.data-row.is-checked-out .date-time-date {
    color: #98a2b3;
  }

  #vendorPanel .status {
    max-width: 100%;
    gap: 5px;
    padding: 5px 7px;
    font-size: 10px;
  }

  #vendorPanel .row-actions {
    justify-content: flex-start;
    min-width: 0;
  }

    #vendorPanel .row-actions button {
      width: 100%;
      min-width: 0;
      max-width: 100%;
      min-height: 30px;
      padding: 0 4px;
      font-size: 9px;
      white-space: normal;
    }

  @media (max-width: 1050px) {
    #vendorPanel {
      padding: 16px;
    }

    #vendorPanel .section-title {
      margin-bottom: 10px;
    }

    #vendorPanel .section-title h2 {
      font-size: 20px;
    }

    #vendorPanel #closeVendorList {
      min-height: 40px;
      padding: 0 14px;
      border-radius: 12px;
      font-size: 12px;
    }

    #vendorPanel .toolbar {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(150px, 210px) auto;
      gap: 8px;
      margin-bottom: 10px;
    }

    #vendorPanel .toolbar .search,
    #vendorPanel .toolbar select {
      width: 100%;
      min-width: 0;
      min-height: 40px;
      height: 40px;
    }

    #vendorPanel .toolbar button {
      min-height: 40px;
      padding: 0 14px;
    }

    #vendorPanel .table-wrap {
      overflow: visible;
      border: 0;
      border-radius: 0;
      background: transparent;
    }

    #vendorPanel table,
    #vendorPanel tbody {
      display: block;
      width: 100%;
    }

    #vendorPanel thead {
      display: none;
    }

    #vendorPanel tbody {
      display: grid;
      gap: 8px;
    }

    #vendorPanel tbody tr.data-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0 14px;
      padding: 6px 10px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fff;
    }

    #vendorPanel tbody tr.data-row > td {
      display: grid;
      grid-template-columns: minmax(105px, .8fr) minmax(0, 1.2fr);
      gap: 8px;
      align-items: center;
      width: 100%;
      min-height: 32px;
      padding: 5px 0;
      border-bottom: 1px solid #edf0f4;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    #vendorPanel tbody td::before {
      content: attr(data-label);
      color: #667085;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .035em;
      text-transform: uppercase;
    }

    #vendorPanel tbody td:nth-last-child(-n + 2) {
      border-bottom: 0;
    }

    #vendorPanel .status {
      width: fit-content;
    }

    #vendorPanel .row-actions button {
      width: auto;
      min-width: 74px;
      max-width: none;
      padding-inline: 10px;
    }

    #vendorPanel tbody tr:not(.data-row) {
      display: block;
    }

    #vendorPanel tbody tr:not(.data-row) td {
      display: block;
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 14px;
    }

    #vendorPanel tbody tr:not(.data-row) td::before {
      content: none;
    }
  }

  @media (max-width: 700px) {
    #vendorPanel tbody tr.data-row {
      grid-template-columns: 1fr;
    }

    #vendorPanel tbody td:nth-last-child(2) {
      border-bottom: 1px solid #edf0f4;
    }

    #vendorPanel {
      padding: 14px;
    }

    #vendorPanel .section-title {
      align-items: flex-start;
      gap: 10px;
    }

    #vendorPanel .toolbar {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
    }

    #vendorPanel .toolbar .search,
    #vendorPanel .toolbar select,
    #vendorPanel .toolbar button {
      width: 100%;
      min-width: 0;
    }

    #vendorPanel tbody tr.data-row {
      padding: 8px 12px;
    }

    #vendorPanel tbody tr.data-row > td {
      grid-template-columns: minmax(96px, .75fr) minmax(0, 1.25fr);
      gap: 10px;
      padding: 8px 0;
    }

    #vendorPanel .name-with-state {
      justify-content: flex-start;
      flex-wrap: wrap;
    }
  }

  .overnight-sound-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
  }

  .overnight-sound-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    box-shadow: none;
  }

  .overnight-sound-button.is-enabled {
    background: #ecfdf3;
    border-color: #a6f4c5;
    color: #027a48;
  }

  /* Compact tablet/mobile dashboard without incomplete KPI rows or wasted space */
  @media (min-width: 561px) and (max-width: 1050px) {
    #mainApp.app {
      padding: 20px 16px 34px;
    }

    #mainApp header {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 14px;
      margin-bottom: 16px;
    }

    #mainApp h1 {
      font-size: clamp(34px, 5.2vw, 42px);
      line-height: 1;
    }

    #mainApp .header-right,
    #mainApp .account-bar,
    #mainApp .site-account-controls {
      width: 100%;
      min-width: 0;
    }

    #mainApp .header-right {
      justify-content: stretch;
    }

    #mainApp .account-bar {
      flex: 1 1 auto;
    }

    #mainApp #siteSelector {
      flex: 0 1 auto;
      width: var(--site-selector-width, 230px);
      min-width: 0;
      max-width: 100%;
      height: 48px;
    }

    #mainApp #logoutButton,
    #mainApp .menu-icon {
      min-height: 48px;
      height: 48px;
    }

    #mainApp .hero {
      padding: 18px;
      margin-bottom: 14px;
      border-radius: 22px;
    }

    #mainApp .kpi-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      grid-template-rows: none;
      gap: 12px;
    }

    #mainApp .kpi {
      min-width: 0;
      min-height: 220px;
      padding: 16px;
      border-radius: 16px;
    }

    #mainApp .kpi.main {
      grid-column: auto;
      grid-row: auto;
      min-height: 220px;
      padding: 18px;
    }

    #mainApp .kpi.main .kpi-number {
      font-size: clamp(78px, 14vw, 108px);
    }

    #mainApp .kpi.overnight .kpi-number {
      font-size: clamp(78px, 14vw, 108px);
    }

    #mainApp .kpi:not(.main):not(.overnight) .kpi-number {
      font-size: 40px;
    }

    #mainApp .kpi small {
      font-size: 12px;
    }

    #mainApp .actions {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      margin-top: 14px;
    }

    #mainApp .big-checkin,
    #mainApp .big-checkout {
      min-height: 68px;
      font-size: 24px;
      border-radius: 18px;
    }
  }

  /* Quiet, minimal header */
  #mainApp header {
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
  }

  #mainApp .brand-lockup {
    gap: 13px;
  }

  #mainApp .brand-logo {
    width: clamp(150px, 16vw, 185px);
  }

  #mainApp .brand-divider {
    display: none;
  }

  #mainApp .brand-lockup h1 {
    font-size: clamp(27px, 2.5vw, 35px);
    letter-spacing: -.04em;
  }

  #mainApp .header-right,
  #mainApp .account-bar,
  #mainApp .site-account-controls {
    align-items: center;
  }

  #mainApp .site-account-controls {
    gap: 6px;
  }

  #mainApp #siteSelector {
    height: 42px;
    min-height: 42px;
    padding-top: 0;
    padding-bottom: 0;
    border-radius: 11px;
    font-size: 14px;
  }

  #mainApp #logoutButton {
    min-height: 42px;
    height: 42px;
    padding: 4px 8px;
    gap: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
  }

  #mainApp #logoutButton:hover {
    background: #f2f4f7;
  }

  #mainApp #signedInUser {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    font-size: 14px;
    line-height: 1.1;
  }

  #mainApp .menu-icon {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .05);
  }

  #mainApp .menu-icon span {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    font-size: 25px;
    line-height: 1;
  }

  #mainApp .menu-icon::before,
  #mainApp .menu-icon::after {
    display: none;
  }

  #mainApp .menu-icon:hover {
    transform: none;
    border-color: #98a2b3;
    background: #f9fafb;
    box-shadow: 0 3px 8px rgba(16, 24, 40, .08);
  }

  @media (max-width: 650px) {
    #mainApp header {
      gap: 12px;
    }

    #mainApp .brand-lockup {
      gap: 10px;
    }

    #mainApp .brand-logo {
      width: min(40vw, 145px);
    }

    #mainApp .brand-lockup h1 {
      font-size: clamp(24px, 7vw, 29px);
    }

    #mainApp .site-account-controls {
      gap: 4px;
    }

    #mainApp #signedInUser {
      max-width: none;
      font-size: 13px;
    }

  }

  @media (prefers-reduced-motion: no-preference) {
    .modal-overlay:not(.hidden) .modal-card {
      animation: modal-enter .16s ease-out;
    }
  }

  @keyframes modal-enter {
    from { opacity: 0; transform: translateY(5px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Compact mobile home dashboard: paired status tiles over a centered QR tile. */
  @media (max-width: 700px) {
    #mainApp.app {
      padding: 12px 10px 24px;
    }

    #mainApp header {
      gap: 9px;
      margin-bottom: 10px;
    }

    #mainApp .hero {
      padding: 10px;
      margin-bottom: 10px;
      border-radius: 18px;
    }

    #mainApp .kpi-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: auto auto;
      gap: 8px;
    }

    #mainApp .kpi {
      min-width: 0;
      min-height: 112px;
      padding: 12px;
      border-radius: 14px;
    }

    #mainApp .kpi.main {
      grid-column: 1;
      grid-row: 1;
      min-height: 112px;
      padding: 12px;
    }

    #mainApp .kpi.overnight {
      grid-column: 2;
      grid-row: 1;
      min-height: 112px;
      padding: 12px;
    }

    #mainApp .kpi.main .kpi-number,
    #mainApp .kpi.overnight .kpi-number {
      margin-top: 6px;
      font-size: clamp(48px, 16vw, 64px);
      line-height: .85;
    }

    #mainApp .kpi-label {
      font-size: 11px;
      line-height: 1.15;
      letter-spacing: .035em;
    }

    #mainApp .kpi small {
      font-size: 10px;
      line-height: 1.2;
    }

    #mainApp .kpi.qr-kpi {
      grid-column: 1 / -1;
      grid-row: 2;
      width: 100%;
      min-height: 178px;
      padding: 10px 12px 12px;
      gap: 7px;
      align-items: center;
      justify-self: center;
      text-align: center;
    }

    #mainApp .kpi.qr-kpi .kpi-label {
      font-size: 13px;
      white-space: normal;
    }

    #mainApp .daily-qr-image {
      width: 132px;
      min-height: 132px;
      margin-inline: auto;
    }

    #mainApp .daily-qr-image img,
    #mainApp .daily-qr-image canvas {
      width: 132px;
      max-width: 132px;
    }

    #mainApp .overnight-sound-row {
      margin-top: 7px;
    }

    #mainApp .overnight-sound-button {
      width: 36px;
      min-width: 36px;
      height: 36px;
      min-height: 36px;
      border-radius: 10px;
      font-size: 17px;
    }

    #mainApp .actions {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 9px;
    }

    #mainApp .big-checkin,
    #mainApp .big-checkout {
      min-height: 58px;
      padding-inline: 8px;
      border-radius: 14px;
      font-size: clamp(17px, 5vw, 21px);
    }
  }

/* =========================================================
   ADAPTIVE DESKTOP / LARGE-DISPLAY ACCESSIBILITY
   CHECK IN / CHECK OUT ONLY
   Existing phone/tablet UI (<= 940px) remains unchanged.
   ========================================================= */
@media (min-width: 941px) {
  #checkInPanel,
  #checkOutPanel {
    padding: clamp(20px, 2vw, 36px);
  }

  #checkInPanel .modal-card {
    width: clamp(920px, 76vw, 1400px) !important;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    padding: clamp(24px, 2.2vw, 44px);
    border-radius: clamp(22px, 1.6vw, 34px);
  }

  #checkOutPanel .modal-card {
    width: clamp(620px, 52vw, 900px) !important;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    padding: clamp(24px, 2vw, 40px);
    border-radius: clamp(22px, 1.6vw, 34px);
  }

  #checkInPanel .section-title,
  #checkOutPanel .section-title {
    min-height: clamp(48px, 3.4vw, 68px);
    margin-bottom: clamp(16px, 1.4vw, 24px);
    padding-bottom: clamp(14px, 1.2vw, 20px);
  }

  #checkInPanel .section-title h2,
  #checkOutPanel .section-title h2 {
    font-size: clamp(28px, 1.8vw, 42px);
    line-height: 1.15;
    letter-spacing: -.025em;
  }

  #checkInPanel .modal-close,
  #checkOutPanel .modal-close {
    width: clamp(44px, 3vw, 60px);
    min-width: clamp(44px, 3vw, 60px);
    height: clamp(44px, 3vw, 60px);
    min-height: clamp(44px, 3vw, 60px);
    border-radius: clamp(12px, .9vw, 16px);
    font-size: clamp(22px, 1.5vw, 32px);
  }

  #checkInPanel .current-time-pill {
    margin-bottom: clamp(6px, .6vw, 10px);
    padding: clamp(8px, .6vw, 12px) clamp(12px, 1vw, 18px);
    font-size: clamp(14px, .9vw, 19px);
  }

  #checkInPanel form,
  #checkOutPanel form {
    gap: clamp(14px, 1.3vw, 26px);
  }

  #checkInPanel .form-grid,
  #checkOutPanel .checkout-form-grid,
  #checkOutPanel .form-grid {
    gap: clamp(14px, 1.25vw, 24px);
  }

  #checkInPanel label,
  #checkOutPanel label,
  #checkInPanel .label-text,
  #checkOutPanel .label-text {
    gap: clamp(7px, .5vw, 10px);
    font-size: clamp(16px, 1.05vw, 22px);
    line-height: 1.3;
    font-weight: 800;
  }

  #checkInPanel input,
  #checkInPanel select,
  #checkOutPanel input,
  #checkOutPanel select {
    min-height: clamp(54px, 3.8vw, 72px);
    height: clamp(54px, 3.8vw, 72px);
    padding-inline: clamp(14px, 1vw, 20px);
    border-radius: clamp(13px, .9vw, 17px);
    font-size: clamp(17px, 1.15vw, 24px);
    font-weight: 650;
  }

  #checkOutPanel textarea {
    min-height: clamp(140px, 12vh, 210px);
    height: clamp(140px, 12vh, 210px);
    padding: clamp(14px, 1vw, 20px);
    border-radius: clamp(13px, .9vw, 17px);
    font-size: clamp(17px, 1.15vw, 24px);
    line-height: 1.45;
  }

  #checkInPanel input::placeholder,
  #checkInPanel textarea::placeholder,
  #checkOutPanel input::placeholder,
  #checkOutPanel textarea::placeholder {
    font-size: inherit;
    opacity: .9;
  }

  #checkInPanel .form-actions,
  #checkOutPanel .form-actions {
    gap: clamp(12px, 1vw, 18px);
    margin-top: clamp(14px, 1.2vw, 22px);
    padding-top: clamp(14px, 1.2vw, 22px);
  }

  #checkInPanel .form-actions button,
  #checkOutPanel .form-actions button {
    min-width: clamp(180px, 14vw, 260px);
    min-height: clamp(54px, 4vw, 76px);
    padding-inline: clamp(22px, 2vw, 38px);
    border-radius: clamp(13px, .9vw, 17px);
    font-size: clamp(17px, 1.15vw, 24px);
    font-weight: 850;
  }
}
