@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');

  :root{
    --bg:#F7F5EF;
    --card:#FFFFFF;
    --border:#DAD5C8;
    --text:#1E2530;
    --text-dim:#5B6472;
    --accent:#1D5FD1;
    --accent-dark:#124398;
    --accent-bg:#E4ECFB;
    --green:#1E8E5A;
    --green-bg:#E4F5EC;
    --red:#B23A2E;
    --red-bg:#FBEAE7;
    --warn:#93690B;
    --warn-bg:#FFF3D6;
    --focus:#1D5FD1;
    --track-bg:#EFEBDF;
    --track-dash:#C9C3B2;
  }

  /* Bluish-slate dark mode — not pitch black, easier on the eyes at night */
  html[data-theme="dark"]{
    --bg:#161D29;
    --card:#1E2733;
    --border:#324055;
    --text:#E7ECF4;
    --text-dim:#93A3BB;
    --accent:#5B9BFF;
    --accent-dark:#3D7DE0;
    --accent-bg:#213048;
    --green:#3ED089;
    --green-bg:#163527;
    --red:#FF7A6B;
    --red-bg:#3A2020;
    --warn:#FFC26B;
    --warn-bg:#3A2E14;
    --focus:#5B9BFF;
    --track-bg:#20293A;
    --track-dash:#3D4E68;
  }

  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background:var(--bg);
    color:var(--text);
    font-family:'Atkinson Hyperlegible', Arial, sans-serif;
    font-size:19px;
    min-height:100vh;
    line-height:1.5;
    transition:background-color .25s ease, color .25s ease;
  }
  h1,h2,h3{margin:0; font-weight:700;}
  button{font-family:inherit; cursor:pointer; border:none; background:none; color:inherit;}
  input,select{
    font-family:inherit; font-size:20px;
    background:var(--card); border:2px solid var(--border); color:var(--text);
    border-radius:8px; padding:14px 16px; width:100%;
  }
  input::placeholder{color:#A6A196;}
  html[data-theme="dark"] input::placeholder{color:#7C8AA3;}
  /* Some browsers auto-fill inputs with their own white background + dark text,
     ignoring our theme entirely — force it back to match dark mode. */
  html[data-theme="dark"] input:-webkit-autofill,
  html[data-theme="dark"] input:-webkit-autofill:hover,
  html[data-theme="dark"] input:-webkit-autofill:focus{
    -webkit-text-fill-color:var(--text);
    -webkit-box-shadow:0 0 0 1000px var(--card) inset;
    box-shadow:0 0 0 1000px var(--card) inset;
    caret-color:var(--text);
    transition:background-color 9999s ease-in-out 0s;
  }
  :focus-visible{outline:3px solid var(--focus); outline-offset:2px;}

  .app-shell{max-width:1080px; margin:0 auto; padding:22px 18px 60px;}

  /* ---------- topbar ---------- */
  /* Sticky so the message icon (and everything else up here) is always
     reachable without scrolling back up the page. */
  .topbar{
    position:sticky; top:0; z-index:200;
    background:var(--bg);
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 0 16px; margin-bottom:20px; border-bottom:3px solid var(--border);
    flex-wrap:wrap; gap:12px;
  }
  .brand{font-size:26px; font-weight:700; color:var(--accent-dark); display:flex; align-items:center; gap:10px;}
  .brand-logo{
    width:60px; height:60px; object-fit:contain; border-radius:8px;
    background:#FFFFFF; border:1px solid var(--border); flex-shrink:0;
  }
  .brand-emoji{line-height:1;}
  .theme-toggle{
    font-size:20px; padding:8px 10px; border-radius:8px; background:var(--card); border:2px solid var(--border);
    line-height:1;
  }
  .theme-toggle:hover{border-color:var(--text-dim);}
  .who{display:flex; align-items:center; gap:14px; font-size:18px; color:var(--text-dim); flex-wrap:wrap;}
  .who strong{color:var(--text);}
  .btn-logout{
    font-size:16px; color:#FFFFFF; background:var(--text-dim);
    padding:10px 18px; border-radius:8px; font-weight:700;
  }
  .topbar-actions{display:flex; align-items:center; gap:14px; flex-wrap:wrap;}

  /* On narrow screens the brand drops to its own row, and everything in
     topbar-actions (theme toggle, notif bell, greeting, logout) lines up
     together on one tidy row instead of splitting apart mid-group. */
  @media (max-width:639px){
    .topbar{flex-direction:column; align-items:stretch; gap:10px;}
    .brand{font-size:22px;}
    .brand-logo{width:44px; height:44px;}
    .topbar-actions{width:100%; justify-content:space-between; gap:10px;}
    .who{gap:10px; font-size:16px;}
    .who strong{max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; vertical-align:bottom;}
    .btn-logout{padding:8px 14px; font-size:14px;}
  }

  /* ---------- messaging (chat-style) ---------- */
  .notif-wrap{position:relative;}
  .notif-bell{
    position:relative; font-size:22px; padding:8px 10px; border-radius:8px; background:var(--card); border:2px solid var(--border);
    display:flex; align-items:center; gap:8px;
  }
  .notif-bell:hover{border-color:var(--text-dim);}
  .notif-bell-icon{line-height:1;}
  /* Text label hidden on small screens — icon-only until there's room to spare. */
  .notif-bell-label{display:none; font-size:15px; font-weight:700; color:var(--text); white-space:nowrap;}
  @media (min-width:640px){
    .notif-bell-label{display:inline;}
  }
  .notif-badge{
    position:absolute; top:-4px; right:-4px; background:var(--red); color:#fff;
    font-size:11px; font-weight:700; min-width:18px; height:18px; border-radius:9px;
    display:flex; align-items:center; justify-content:center; padding:0 4px; border:2px solid var(--bg);
  }
  .chat-modal-overlay{
    position:fixed; inset:0; z-index:1000; background:rgba(10,14,20,0.55);
    display:flex; align-items:center; justify-content:center; padding:20px;
    animation:modal-fade-in .18s ease-out;
  }
  .chat-modal-panel-wrap{position:relative; width:400px; max-width:100%; height:560px; max-height:85vh;}
  .chat-panel{
    position:absolute; inset:0; z-index:1;
    background:var(--card); border:3px solid var(--border); border-radius:16px;
    box-shadow:0 20px 50px rgba(0,0,0,0.35);
    display:flex; flex-direction:column; overflow:hidden;
    animation:modal-pop-in .2s cubic-bezier(.2,.9,.3,1.2);
  }
  .chat-modal-close{
    position:absolute; top:-14px; right:-14px; z-index:5;
    width:34px; height:34px; border-radius:50%;
    background:var(--red); border:2px solid var(--red); color:#fff;
    display:flex; align-items:center; justify-content:center;
    font-size:20px; line-height:1; font-weight:700;
    box-shadow:0 6px 16px rgba(0,0,0,0.3);
  }
  .chat-modal-close:hover{background:#8f2c22; border-color:#8f2c22;}
  .chat-panel-head{
    display:flex; align-items:center; justify-content:space-between; gap:8px;
    font-weight:700; font-size:16px; color:#fff; background:var(--accent);
    padding:12px 14px; flex-shrink:0;
  }
  .chat-panel-head .icon-btn{background:rgba(255,255,255,0.15); color:#fff; border-color:transparent; font-size:14px; padding:6px 10px;}
  .chat-panel-head .icon-btn:hover{background:rgba(255,255,255,0.28);}

  /* thread */
  .chat-thread{
    flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:8px;
    background:repeating-linear-gradient(135deg, var(--bg) 0 14px, var(--track-bg) 14px 28px);
  }
  .chat-bubble-row{display:flex; position:relative; align-items:flex-end; gap:4px;}
  .chat-bubble-row.mine{justify-content:flex-end;}
  .chat-bubble-row.theirs{justify-content:flex-start;}
  .chat-bubble{
    max-width:78%; padding:8px 12px 6px; border-radius:14px; font-size:14px; line-height:1.4;
    position:relative; word-break:break-word;
  }
  .chat-bubble-row.mine .chat-bubble{background:var(--accent); color:#fff; border-bottom-right-radius:4px;}
  .chat-bubble-row.theirs .chat-bubble{background:var(--card); color:var(--text); border:1px solid var(--border); border-bottom-left-radius:4px;}
  .chat-bubble.deleted{background:var(--bg) !important; color:var(--text-dim) !important; border:1px dashed var(--border); font-style:italic;}
  .chat-bubble-sender{font-size:11px; font-weight:700; color:var(--accent-dark); margin-bottom:2px;}
  .chat-bubble-time{display:block; text-align:right; font-size:10px; opacity:0.75; margin-top:3px;}
  .chat-system{
    align-self:center; background:rgba(127,127,127,0.18); color:var(--text-dim); font-size:12px;
    padding:6px 12px; border-radius:20px; text-align:center; max-width:90%;
  }
  .chat-system-time{display:block; font-size:10px; opacity:0.8; margin-top:2px;}

  /* message action menu (3-dot) — own messages only */
  .chat-msg-menu-wrap{position:relative; flex-shrink:0;}
  .chat-msg-dots{
    opacity:0.55; font-size:16px; padding:4px 6px; border-radius:6px; color:var(--text-dim);
    background:transparent; line-height:1;
  }
  .chat-msg-dots:hover, .chat-msg-dots:focus-visible{opacity:1; background:var(--bg);}
  .chat-msg-dropdown{
    position:absolute; bottom:100%; margin-bottom:4px; right:0; z-index:20;
    background:var(--card); border:2px solid var(--border); border-radius:10px;
    box-shadow:0 6px 18px rgba(0,0,0,0.2); overflow:hidden; min-width:150px;
  }
  .chat-bubble-row.theirs .chat-msg-dropdown{right:auto; left:0;}
  .chat-msg-dropdown button{
    display:block; width:100%; text-align:left; padding:10px 14px; font-size:14px; font-weight:600; color:var(--text);
  }
  .chat-msg-dropdown button:hover{background:var(--bg);}
  .chat-msg-dropdown button.danger{color:var(--red);}

  .chat-compose{display:flex; gap:8px; padding:10px; border-top:2px solid var(--border); flex-shrink:0; background:var(--card);}
  .chat-compose input{font-size:15px; padding:10px 12px; border-radius:20px;}
  .chat-send-btn{
    background:var(--accent); color:#fff; width:42px; height:42px; border-radius:50%; font-size:16px;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  .chat-send-btn:hover{background:var(--accent-dark);}
  .notif-empty{color:var(--text-dim); font-size:14px; text-align:center; padding:20px 12px;}

  .msg-toast{
    position:fixed; top:-100px; left:50%; transform:translateX(-50%);
    background:var(--text); color:#fff; padding:14px 22px; border-radius:12px;
    font-size:15px; font-weight:600; box-shadow:0 8px 26px rgba(0,0,0,0.28);
    z-index:500; max-width:90vw; cursor:pointer; transition:top 0.4s ease-in-out;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .msg-toast.show{ top:16px; }

  /* ---------- landing / auth ---------- */
  .center-wrap{max-width:480px; margin:40px auto; text-align:center;}
  .center-wrap h1{font-size:32px; color:var(--accent-dark); margin-bottom:8px;}
  .center-wrap .tag{color:var(--text-dim); font-size:19px; margin-bottom:30px;}

  .role-choices{display:flex; flex-direction:column; gap:16px;}
  .role-card{
    background:var(--card); border:3px solid var(--border);
    border-radius:14px; padding:26px 20px; text-align:center;
    font-size:24px; font-weight:700; color:var(--text);
    transition:border-color .15s;
  }
  .role-card:hover{border-color:var(--accent);}

  .auth-card{
    background:var(--card); border:3px solid var(--border); border-radius:14px;
    padding:26px 22px; text-align:left;
  }
  .auth-tabs{display:flex; gap:8px; margin-bottom:22px;}
  .auth-tab{
    flex:1; padding:12px 0; font-size:17px; font-weight:700; text-align:center;
    color:var(--text-dim); background:var(--bg); border-radius:8px; border:2px solid var(--border);
  }
  .auth-tab.active{color:#FFFFFF; background:var(--accent); border-color:var(--accent);}
  .field{margin-bottom:16px; text-align:left;}
  .field label{display:block; font-size:16px; font-weight:700; color:var(--text-dim); margin-bottom:6px;}
  .field-hint{font-size:14px; color:var(--text-dim); margin:-10px 0 14px;}
  .error-text{color:var(--red); font-size:16px; margin:2px 0 12px; font-weight:700;}
  .success-text{color:var(--green); font-size:16px; margin:2px 0 12px; font-weight:700;}
  .btn-primary{
    width:100%; background:var(--accent); color:#FFFFFF; font-weight:700;
    padding:16px; border-radius:10px; font-size:20px; margin-top:6px;
  }
  .btn-primary:hover{background:var(--accent-dark);}
  .btn-secondary{
    width:100%; background:var(--bg); color:var(--text); font-weight:700;
    padding:14px; border-radius:10px; font-size:18px; border:2px solid var(--border); margin-top:10px;
  }
  .btn-secondary:hover{border-color:var(--text-dim);}
  .logo-upload-btn{display:inline-block; text-align:center; width:auto; padding:12px 18px;}
  .logo-preview-row{display:flex; align-items:center; gap:16px; margin:8px 0 4px;}
  .logo-preview-img{
    width:64px; height:64px; object-fit:contain; border-radius:12px;
    background:#FFFFFF; border:2px solid var(--border); flex-shrink:0;
  }
  .logo-preview-empty{
    width:64px; height:64px; display:flex; align-items:center; justify-content:center;
    font-size:30px; border-radius:12px; border:2px dashed var(--border); flex-shrink:0;
  }
  .logo-preview-actions{display:flex; flex-direction:column; gap:8px;}
  .link-btn{background:none; border:none; color:var(--accent); font-weight:700; font-size:16px; text-decoration:underline; padding:6px 0;}
  .back-link{display:inline-block; margin-top:20px; color:var(--text-dim); font-size:17px; font-weight:700;}
  .back-link:hover{color:var(--text);}
  .welcome-name{font-size:24px; font-weight:700; color:var(--accent-dark); margin-bottom:4px;}

  /* ---------- password show/hide ---------- */
  .pw-wrap{position:relative;}
  .pw-wrap input{padding-right:52px;}
  .pw-toggle{
    position:absolute; right:6px; top:50%; transform:translateY(-50%);
    font-size:21px; padding:8px 10px; border-radius:6px; color:var(--text-dim);
  }
  .pw-toggle:hover{color:var(--text);}

  .recovery-box{
    background:var(--warn-bg); border:3px solid var(--warn); border-radius:12px;
    padding:20px; font-family:'Courier New', monospace; font-size:21px; font-weight:700;
    letter-spacing:1px; text-align:center; word-break:break-all; color:#5c4300; margin-bottom:16px;
  }
  .warn-box{
    background:var(--warn-bg); color:#5c4300; border-radius:10px; padding:14px 16px;
    font-size:15px; margin-bottom:18px; text-align:left; font-weight:600;
  }
  .credential-box{
    background:var(--bg); border:2px solid var(--border); border-radius:10px;
    padding:14px 16px; margin-bottom:12px; text-align:left;
  }
  .credential-box .k{font-size:13px; color:var(--text-dim); text-transform:uppercase; font-weight:700;}
  .credential-box .v{font-size:20px; font-weight:700; font-family:'Courier New', monospace; word-break:break-all;}

  .backup-zone{
    margin-top:26px; padding-top:20px; border-top:2px dashed var(--border);
  }
  .backup-zone-title{color:var(--text); font-weight:700; font-size:15px; text-transform:uppercase; letter-spacing:0.05em; margin-bottom:6px;}
  .backup-zone-text{color:var(--text-dim); font-size:14px; margin:0 0 12px;}
  .backup-actions{display:flex; gap:10px; flex-wrap:wrap; align-items:center;}
  .backup-preview{margin-top:6px;}

  .danger-zone{
    margin-top:26px; padding-top:20px; border-top:2px dashed var(--red-bg);
  }
  .danger-zone-title{color:var(--red); font-weight:700; font-size:15px; text-transform:uppercase; letter-spacing:0.05em; margin-bottom:6px;}
  .danger-zone-text{color:var(--text-dim); font-size:14px; margin:0 0 12px;}
  .btn-danger-full{
    width:100%; background:var(--red); color:#fff; font-weight:700;
    padding:14px; border-radius:10px; font-size:16px;
  }
  .btn-danger-full:hover{background:#8f2c22;}

  .banner-error{
    background:var(--red-bg); color:var(--red); border-radius:10px; padding:14px 18px;
    font-size:16px; font-weight:700; margin-bottom:18px; display:flex; align-items:center; justify-content:space-between; gap:12px;
  }
  .banner-warn{
    background:var(--warn-bg); color:var(--warn); border-radius:10px; padding:14px 18px;
    font-size:16px; font-weight:700; margin-bottom:18px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  }
  .banner-warn .btn-logout{background:var(--warn); flex-shrink:0;}

  /* ---------- retention gate (forced download-then-delete) ---------- */
  .gate-panel{
    background:var(--card); border:3px solid var(--red); border-radius:16px;
    padding:28px 24px; max-width:440px; width:100%; text-align:left;
    box-shadow:0 20px 50px rgba(0,0,0,0.35);
    animation:modal-pop-in .2s cubic-bezier(.2,.9,.3,1.2);
  }
  .gate-panel h2{font-size:22px; margin:0 0 12px; color:var(--red);}
  .gate-panel p{font-size:15px; color:var(--text-dim); margin:0 0 18px; line-height:1.5;}
  .gate-step{display:flex; align-items:center; gap:10px; margin-bottom:10px; font-weight:700; color:var(--text-dim);}
  .gate-step-num{
    width:26px; height:26px; border-radius:50%; background:var(--bg); border:2px solid var(--border); color:var(--text-dim);
    display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex-shrink:0;
  }
  .gate-step.done{color:var(--green);}
  .gate-step.done .gate-step-num{background:var(--green); border-color:var(--green); color:#fff;}
  .gate-panel .btn-danger-full[disabled]{opacity:0.5;}

  /* ---------- two-column dashboard layout ---------- */
  .dashboard-grid{display:grid; grid-template-columns:1fr; gap:24px; align-items:start;}
  @media (min-width:900px){
    .dashboard-grid{grid-template-columns:2fr 1fr;}
    .sidebar{position:sticky; top:20px;}
  }

  .summary-panel{
    background:var(--card); border:3px solid var(--border); border-radius:16px;
    padding:22px; display:flex; flex-direction:column; gap:14px;
  }
  .summary-panel h3{font-size:18px; color:var(--accent-dark); text-align:center; margin-bottom:2px;}
  .summary-badge{
    background:var(--bg); border:3px solid var(--border);
    border-radius:12px; padding:16px 18px; text-align:center;
  }
  .summary-badge .n{font-size:40px; font-weight:700; display:block;}
  .summary-badge .l{font-size:15px; color:var(--text-dim); font-weight:700;}
  .summary-badge.avail .n{color:var(--green);}
  .summary-badge.out .n{color:var(--red);}

  /* ---------- section / admin tabs ---------- */
  .section-head{display:flex; align-items:center; justify-content:space-between; margin:26px 0 14px; flex-wrap:wrap; gap:10px;}
  .section-head h2{font-size:22px; color:var(--accent-dark);}
  .admin-tabs{display:flex; gap:6px; background:var(--card); border:2px solid var(--border); border-radius:10px; padding:5px; flex-wrap:wrap;}
  .admin-tab{padding:9px 16px; font-size:15px; font-weight:700; border-radius:8px; color:var(--text-dim);}
  .admin-tab.active{background:var(--accent); color:#FFFFFF;}

  /* ---------- van list: ONE compact container ---------- */
  .fleet-container{
    background:var(--card); border:3px solid var(--border); border-radius:16px;
    padding:2px 18px;
  }
  .bay{
    border-bottom:2px solid var(--border);
    padding:14px 0; display:flex; flex-direction:column; gap:8px;
  }
  .bay:last-child{border-bottom:none;}
  .bay-name-row{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px;}
  .van-name{font-size:19px; font-weight:700;}
  .status-pill{
    font-size:13px; font-weight:700; padding:4px 12px; border-radius:20px;
  }
  .status-pill.available{background:var(--green-bg); color:var(--green);}
  .status-pill.out{background:var(--red-bg); color:var(--red);}
  .status-pill.arrived{background:var(--warn-bg); color:var(--warn);}
  .status-pill.departing{background:var(--accent-bg); color:var(--accent);}

  .bay-track{
    position:relative; height:70px; border-radius:10px; overflow:hidden;
    background:var(--track-bg); border:2px solid var(--border);
  }
  .road-strip{
    position:absolute; left:0; right:0; top:50%; height:3px; transform:translateY(-50%);
    background:repeating-linear-gradient(90deg, var(--track-dash) 0 18px, transparent 18px 36px);
  }
  .road-strip.scrolling{ animation: road-scroll 0.7s linear infinite; }
  .road-strip.scrolling.reversed{ animation-name: road-scroll-reverse; }
  @keyframes road-scroll{ from{background-position-x:0;} to{background-position-x:-36px;} }
  @keyframes road-scroll-reverse{ from{background-position-x:0;} to{background-position-x:36px;} }

  .status-dot{
    position:absolute; left:8px; top:8px; width:16px; height:16px; border-radius:50%;
    border:2px solid #FFFFFF; box-shadow:0 2px 4px rgba(0,0,0,0.25); z-index:2;
  }
  .status-dot.available{background:var(--green);}
  .status-dot.out{background:var(--red);}
  .status-dot.arrived{background:var(--warn);}
  .status-dot.departing{background:var(--accent);}

  .van-pos{
    position:absolute; top:50%; left:10px;
    transform:translateY(-50%) translateX(0);
    transition:transform 1.6s ease-in-out;
    will-change:transform;
  }
  .van-pos.driving{ transform:translateY(-50%) translateX(calc(var(--travel, 220px) / 2)); }
  .van-pos.arrived{ transform:translateY(-50%) translateX(var(--travel, 220px)); }

  .van-flip{
    display:block; transform:scaleX(1);
  }
  .van-flip.reversed{ transform:scaleX(-1); }

  .van-icon{
    display:block; width:98px; height:auto;
    filter:drop-shadow(0 3px 5px rgba(0,0,0,0.18));
  }
  .van-icon.shaking{ animation: van-shake 0.55s ease-in-out infinite; }
  @keyframes van-shake{
    0%,100%{ transform: translate(0,0) rotate(0deg); }
    25%{ transform: translate(-1.5px,-1px) rotate(-0.6deg); }
    50%{ transform: translate(1px,1px) rotate(0.5deg); }
    75%{ transform: translate(-1px,1.5px) rotate(-0.4deg); }
  }

  .driver-under{
    text-align:center; font-size:15px; font-weight:700; color:var(--text-dim);
  }
  .driver-under.assigned{color:var(--text);}
  .destination-line{text-align:center; font-size:13px; color:var(--text-dim); font-weight:600;}

  .bay-action-btn{
    font-size:18px; font-weight:700; padding:13px; border-radius:10px; width:100%;
    color:#FFFFFF;
  }
  .bay-action-btn.take{background:var(--green);}
  .bay-action-btn.bring{background:var(--red);}
  .bay-action-btn.arrive{background:var(--warn);}
  .bay-action-btn.depart{background:var(--accent);}
  .bay-action-btn:disabled{background:#C7C2B6; color:#8A8578; cursor:not-allowed;}

  /* ---------- out/in confirmation form ---------- */
  .out-form{
    background:var(--bg); border:2px dashed var(--border); border-radius:10px;
    padding:14px; display:flex; flex-direction:column; gap:8px;
  }
  .out-form label{font-size:14px; font-weight:700; color:var(--text-dim);}
  .out-form-title{font-size:16px; font-weight:700; color:var(--accent-dark); margin-bottom:2px;}
  .out-form-actions{display:flex; gap:10px; margin-top:4px;}
  .out-form-actions .bay-action-btn{flex:2;}
  .out-form-actions .icon-btn{flex:1; text-align:center;}

  /* ---------- history (collapsed by default) ---------- */
  .history-list{display:flex; flex-direction:column; gap:8px; margin-top:2px;}
  .history-entry{
    background:var(--bg); border:2px solid var(--border); border-radius:10px;
    padding:10px 14px; font-size:13px; display:flex; flex-direction:column; gap:2px;
  }
  .history-entry div{color:var(--text-dim); font-weight:600;}
  .h-tag{color:var(--accent) !important; font-size:11px; text-transform:uppercase; letter-spacing:0.05em;}

  /* ---------- admin controls on bay ---------- */
  .bay-admin{display:flex; gap:8px; flex-wrap:wrap;}
  .icon-btn{
    font-size:14px; font-weight:700; padding:8px 14px; border:2px solid var(--border); border-radius:8px;
    color:var(--text-dim); background:var(--bg);
  }
  .icon-btn:hover{color:var(--text); border-color:var(--text-dim);}
  .icon-btn.danger{color:var(--red); border-color:var(--red-bg);}
  .icon-btn.danger:hover{border-color:var(--red);}
  .icon-btn.primary-outline{color:var(--accent); border-color:var(--accent);}
  .bay-edit-form{display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end;}
  .bay-edit-form input{flex:1; min-width:130px; font-size:18px;}
  .bay-edit-form button{flex-shrink:0;}
  .bay-edit-form .field{flex:1; min-width:160px; margin-bottom:0;}
  .bay-edit-form .field-hint,.bay-edit-form .error-text,.bay-edit-form .success-text{flex-basis:100%; margin:-6px 0 0;}

  /* ---------- add van / drivers ---------- */
  .add-form{
    background:var(--card); border:3px dashed var(--border); border-radius:14px;
    padding:20px; display:flex; gap:14px; flex-wrap:wrap; align-items:flex-end; margin-top:18px;
  }
  .add-form .field{flex:1; min-width:160px; margin-bottom:0;}
  .add-form button{flex-shrink:0; padding:15px 22px; font-size:18px;}
  .add-form .field-hint,.add-form .error-text,.add-form .success-text{flex-basis:100%; margin:-6px 0 0;}

  .driver-row{
    display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px;
    background:var(--card); border:3px solid var(--border); border-radius:12px;
    padding:16px 20px; margin-bottom:12px;
  }
  .driver-row .name{font-size:20px; font-weight:700;}
  .driver-row .meta{font-size:15px; color:var(--text-dim); margin-top:2px;}
  .pin-reveal-prompt{margin-top:10px; max-width:260px;}
  .pin-reveal-prompt .field{margin-bottom:10px;}

  /* ---------- records tab ---------- */
  .records-toolbar{display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-bottom:16px;}
  .records-toolbar select{max-width:260px;}
  .btn-export{background:var(--accent-dark); color:#fff; font-weight:700; padding:14px 22px; border-radius:10px; font-size:17px;}
  .btn-export:hover{background:var(--accent);}
  .table-wrap{overflow-x:auto; border:3px solid var(--border); border-radius:14px; background:var(--card);}
  .records-table{width:100%; border-collapse:collapse; font-size:15px; min-width:680px;}
  .records-table th{background:var(--accent); color:#fff; text-align:left; padding:13px 14px; font-size:13px; text-transform:uppercase; letter-spacing:0.03em;}
  .records-table td{padding:12px 14px; border-top:2px solid var(--border);}
  .records-table tr:nth-child(even) td{background:var(--bg);}

  .empty-msg{color:var(--text-dim); font-size:18px; padding:24px 0; text-align:center;}
  .loading-msg{color:var(--text-dim); font-size:18px; text-align:center; padding:70px 0;}

  /* ---------- universal confirmation modal ---------- */
  .modal-overlay{
    position:fixed; inset:0; background:rgba(10,14,20,0.55); z-index:1000;
    display:flex; align-items:center; justify-content:center; padding:20px;
    animation:modal-fade-in .18s ease-out;
  }
  @keyframes modal-fade-in{ from{opacity:0;} to{opacity:1;} }
  .modal-box{
    background:var(--card); border:3px solid var(--border); border-radius:16px;
    padding:26px 24px; max-width:400px; width:100%; box-shadow:0 20px 50px rgba(0,0,0,0.35);
    animation:modal-pop-in .2s cubic-bezier(.2,.9,.3,1.2);
  }
  @keyframes modal-pop-in{ from{opacity:0; transform:scale(0.92) translateY(8px);} to{opacity:1; transform:scale(1) translateY(0);} }
  .modal-message{font-size:18px; font-weight:600; color:var(--text); margin:0 0 22px; line-height:1.4; text-align:center;}
  .modal-message b{color:var(--accent-dark);}
  .modal-actions{display:flex; gap:12px;}
  .modal-actions button{
    flex:1; padding:13px; border-radius:10px; font-size:16px; font-weight:700;
  }
  .modal-actions .modal-confirm-btn{background:var(--accent); color:#fff;}
  .modal-actions .modal-confirm-btn:hover{background:var(--accent-dark);}
  .modal-actions .modal-confirm-btn.danger{background:var(--red);}
  .modal-actions .modal-confirm-btn.danger:hover{background:#8f2c22;}
  .modal-actions .modal-cancel-btn{background:var(--bg); color:var(--text); border:2px solid var(--border);}
  .modal-actions .modal-cancel-btn:hover{border-color:var(--text-dim);}

  /* ---------- manual logo crop modal ---------- */
  .crop-modal-box{ max-width:360px; text-align:center; }
  .crop-viewport{
    position:relative; width:300px; height:300px; margin:0 auto;
    overflow:hidden; border-radius:12px; border:3px solid var(--border);
    background:repeating-conic-gradient(#00000012 0% 25%, transparent 0% 50%) 50% / 20px 20px;
    cursor:grab; touch-action:none;
  }
  .crop-viewport:active{ cursor:grabbing; }
  .crop-viewport img{
    position:absolute; max-width:none; max-height:none; user-select:none; pointer-events:none;
  }
  .crop-zoom-slider{ width:100%; margin-top:16px; accent-color:var(--accent); }

  /* Note: intentionally not disabling this for prefers-reduced-motion,
     since the van's ease is a core, explicitly-requested part of the UI. */