
    :root{
      --bg:#f5f7fb;--panel:#fff;--text:#182230;--muted:#667085;--border:#e4e7ec;
      --primary:#6941c6;--primary2:#53389e;--success:#067647;--successbg:#ecfdf3;
      --warn:#b54708;--warnbg:#fffaeb;--danger:#b42318;--dangerbg:#fef3f2;
      --dark:#101828;--shadow:0 8px 24px rgba(16,24,40,.08);--radius:14px;
    }
    *{box-sizing:border-box}
    body{margin:0;font-family:Arial,Helvetica,sans-serif;color:var(--text);background:var(--bg)}
    button,input,select,textarea{font:inherit}
    button{cursor:pointer}
    .hidden{display:none!important}
    .topbar{position:sticky;top:0;z-index:30;background:#fff;border-bottom:1px solid var(--border)}
    .topbar-inner{max-width:1550px;margin:auto;padding:14px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px}
    .brand h1{margin:0;font-size:20px}.brand div{font-size:12px;color:var(--muted);margin-top:3px}
    .actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
    .refresh-label{font-size:11px;color:var(--muted)}
    .container{max-width:1550px;margin:auto;padding:20px}
    .stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
    .stat,.panel,.card{background:#fff;border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
    .stat{padding:17px}.stat-label{font-size:12px;color:var(--muted);margin-bottom:8px}.stat-value{font-size:30px;font-weight:700}
    .toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
    .tabs{display:flex;background:#e9eef7;border-radius:10px;padding:4px;gap:4px;flex-wrap:wrap}
    .tab{border:0;background:transparent;color:#344054;padding:9px 13px;border-radius:8px;font-weight:700}
    .tab.active{background:#fff;color:var(--primary);box-shadow:0 1px 3px rgba(16,24,40,.12)}
    .search{min-width:280px;flex:0 1 430px}
    input,select,textarea{width:100%;border:1px solid #d0d5dd;border-radius:8px;background:#fff;color:var(--text);outline:none}
    input,select{height:42px;padding:0 10px}textarea{padding:10px;min-height:85px;resize:vertical}
    input:focus,select:focus,textarea:focus{border-color:#b692f6;box-shadow:0 0 0 3px rgba(105,65,198,.12)}
    .panel{overflow:hidden}.table-wrap{overflow:auto}
    table{border-collapse:collapse;width:100%;min-width:1120px}
    th{background:#f9fafb;color:#475467;font-size:11px;text-align:left;padding:12px 13px;border-bottom:1px solid var(--border);white-space:nowrap}
    td{padding:12px 13px;border-bottom:1px solid #eef1f5;font-size:12px;vertical-align:middle}
    tbody tr:hover{background:#fbfcfe}.secondary{display:block;font-size:11px;color:var(--muted);margin-top:3px}
    .route{font-weight:700;white-space:nowrap}.status{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:10px;font-weight:800;white-space:nowrap}
    .status.transit{background:#eff4ff;color:#1849a9}.status.await{background:var(--warnbg);color:var(--warn)}
    .status.done{background:var(--successbg);color:var(--success)}.status.deleted{background:var(--dangerbg);color:var(--danger)}
    .btn{border:0;border-radius:8px;padding:9px 13px;font-weight:700}.btn:disabled{opacity:.55;cursor:not-allowed}
    .btn-primary{background:var(--primary);color:#fff}.btn-primary:hover{background:var(--primary2)}
    .btn-secondary{background:#fff;color:var(--primary);border:1px solid #d6bbfb}.btn-secondary:hover{background:#f4f3ff;border-color:#b692f6;color:var(--primary2)}
    .btn-success{background:var(--primary);color:#fff}.btn-success:hover{background:var(--primary2)}.btn-danger{background:var(--danger);color:#fff}
    /* Excel keeps its familiar green identity, tuned to sit naturally beside the purple theme. */
    #histExportBtn{background:#19765a;color:#fff;border-color:#19765a;box-shadow:0 1px 2px rgba(16,24,40,.08)}
    #histExportBtn:hover{background:#145f49;border-color:#145f49}
    #histExportBtn:focus{box-shadow:0 0 0 3px rgba(105,65,198,.16)}
    .btn-warn{background:var(--warn);color:#fff}.btn-sm{padding:7px 10px;font-size:11px}
    .empty,.loading{padding:45px 20px;text-align:center;color:var(--muted)}
    .live-loading{display:inline-flex;align-items:center;justify-content:center;gap:12px;text-align:left;max-width:520px}
    .live-loading-spinner{width:22px;height:22px;flex:0 0 22px;border:3px solid #e4e7ec;border-top-color:var(--primary);border-radius:50%;animation:tripStatusSpin .8s linear infinite}
    .live-loading-title{font-size:13px;font-weight:800;color:#344054;line-height:1.35}
    .live-loading-sub{font-size:11px;color:var(--muted);line-height:1.45;margin-top:3px}
    .modal-backdrop{position:fixed;inset:0;z-index:100;background:rgba(16,24,40,.58);display:none;align-items:center;justify-content:center;padding:18px}
    .modal-backdrop.show{display:flex}.modal{width:min(820px,100%);max-height:92vh;overflow:auto;background:#fff;border-radius:16px;box-shadow:0 24px 60px rgba(16,24,40,.25)}
    .modal.wide{width:min(1180px,100%)}.modal-header{padding:18px 20px;border-bottom:1px solid var(--border);display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
    .modal-title{margin:0;font-size:19px}.modal-sub{font-size:11px;color:var(--muted);margin-top:4px}.close{width:36px;height:36px;border-radius:8px;border:1px solid var(--border);background:#fff;font-size:20px}
    .modal-body{padding:20px}.modal-footer{padding:15px 20px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap}
    .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.field{display:flex;flex-direction:column;gap:6px}.field.full{grid-column:1/-1}
    label{font-size:11px;font-weight:700;color:#344054}.notice{padding:11px 13px;border-radius:9px;font-size:12px;margin-bottom:12px}
    .notice.info{background:#eff4ff;color:#1849a9}.notice.success{background:var(--successbg);color:var(--success)}.notice.error{background:var(--dangerbg);color:var(--danger)}
    .notice.attention{background:#fffaeb;color:#7a4f01;border:1px solid #fec84b;box-shadow:0 1px 3px rgba(181,71,8,.08)}
    .notice.checking{background:#fff7e8;color:#7a2e0e;border:1px solid #fdb022;box-shadow:0 2px 8px rgba(181,71,8,.10);padding:14px 15px}
    .notice-checking-row{display:flex;align-items:center;gap:11px}
    .notice-checking-spinner{width:19px;height:19px;flex:0 0 19px;border:2px solid rgba(181,71,8,.22);border-top-color:#b54708;border-radius:50%;animation:tripStatusSpin .8s linear infinite}
    .notice-checking-title{font-size:13px;font-weight:800;line-height:1.35}
    .notice-checking-sub{font-size:11px;font-weight:600;line-height:1.4;margin-top:3px;color:#93370d}
    @keyframes tripStatusSpin{to{transform:rotate(360deg)}}
    .summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:16px}.summary-item{border:1px solid var(--border);border-radius:9px;padding:10px;background:#fcfcfd}
    .summary-label{font-size:10px;color:var(--muted)}.summary-value{font-size:12px;font-weight:700;margin-top:4px;word-break:break-word}
    .action-box{border:1px solid var(--border);border-radius:12px;padding:15px;margin-top:12px}.action-box h3{margin:0 0 12px;font-size:15px}
    .dispatch-details-panel{background:#f7f5ff;border:1px solid #d6bbfb;border-radius:12px;padding:15px;margin:-1px -1px 14px;box-shadow:0 1px 4px rgba(105,65,198,.06)}
    .dispatch-details-panel h3{margin:0 0 12px;font-size:15px;color:#42307d}
    .stage-bridge-card{border:1px solid #abefc6;border-radius:14px;padding:17px;margin-top:12px;background:#f6fef9;box-shadow:0 2px 10px rgba(6,118,71,.08)}
    .stage-bridge-status{display:flex;align-items:center;gap:9px;color:#067647;font-size:14px;font-weight:800;line-height:1.35}
    .stage-bridge-check{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;border-radius:50%;background:#dcfae6;color:#067647;font-size:15px;font-weight:900}
    .stage-bridge-question{margin-top:14px;font-size:17px;font-weight:800;color:#101828;line-height:1.35}
    .stage-bridge-sub{margin-top:5px;font-size:11px;color:var(--muted);line-height:1.45}
    .stage-bridge-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:15px}
    .stage-bridge-actions .btn{min-width:110px;min-height:44px}
    .checkbox{display:flex;align-items:center;gap:8px;margin:12px 0;font-size:12px}.checkbox input{width:auto;height:auto}
    .manual-time-box{margin:10px 0;padding:11px;border:1px solid #d0d5dd;border-radius:10px;background:#fcfcfd}
    .manual-time-box .checkbox{margin:0}
    .manual-time-field{margin:10px 0 12px;padding:11px;border:1px solid #b2ddff;border-radius:10px;background:#f5fbff}
    .manual-time-hint{font-size:10px;color:var(--muted);margin-top:5px;line-height:1.4}
    .manual-action-row{display:flex;align-items:stretch;justify-content:flex-start;flex-wrap:wrap;gap:9px;margin-top:12px}
    .manual-action-row .btn{min-height:42px;white-space:nowrap;flex:0 0 auto}
    .manual-action-row .btn-main{min-width:168px;width:auto}
    .action-inline-notice{display:none;align-items:center;min-height:42px;max-width:430px;padding:9px 12px;border:1px solid #fda29b;border-radius:9px;background:var(--dangerbg);color:var(--danger);font-size:11px;font-weight:700;line-height:1.35}
    .action-inline-notice.show{display:flex}
    .btn-manual{background:#175cd3;color:#fff;border:1px solid #175cd3;min-width:190px;width:auto}
    .btn-manual:hover{background:#1849a9;border-color:#1849a9}
    .btn-manual.active{background:#0b4a6f;border-color:#0b4a6f;box-shadow:0 0 0 3px rgba(23,92,211,.14)}
    .history-controls{padding:14px;margin-bottom:14px;background:#fff;border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
    .filter-grid{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr)) auto auto;gap:10px;align-items:end}
    .filter-input-wrap{position:relative;width:100%}
    .filter-input-wrap input{padding-right:38px}
    .filter-clear{position:absolute;right:7px;top:50%;transform:translateY(-50%);width:26px;height:26px;padding:0;border:0;border-radius:50%;background:#f2f4f7;color:#667085;font-size:18px;font-weight:700;line-height:1;display:none;align-items:center;justify-content:center;z-index:2}
    .filter-clear:hover{background:#e4e7ec;color:#344054}
    .filter-clear:focus{outline:none;box-shadow:0 0 0 3px rgba(105,65,198,.12)}
    .filter-input-wrap input:not(:placeholder-shown)+.filter-clear{display:flex}
    .modal .filter-input-wrap input{padding-right:42px}
    .modal .filter-clear{width:28px;height:28px;right:7px;font-size:19px}
    .kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.kpi-card{background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow)}
    .kpi-label{font-size:11px;color:var(--muted);margin-bottom:8px}.kpi-value{font-size:25px;font-weight:700}.kpi-sub{font-size:10px;color:var(--muted);margin-top:6px}
    .kpi-breakdown{margin-top:12px;padding:16px}
    .kpi-breakdown-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
    .kpi-breakdown-title{font-size:14px;font-weight:800}
    .kpi-breakdown-note{font-size:10px;color:var(--muted);margin-top:4px}
    .kpi-breakdown-total{font-size:12px;font-weight:800;white-space:nowrap}
    .kpi-city-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 14px}
    .kpi-city-row{border:1px solid var(--border);border-radius:10px;padding:10px 11px;background:#fcfcfd}
    .kpi-city-line{display:flex;align-items:center;justify-content:space-between;gap:10px}
    .kpi-city-name{font-size:12px;font-weight:800;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
    .kpi-city-count{font-size:16px;font-weight:800;color:var(--primary);white-space:nowrap}
    .kpi-city-track{height:6px;border-radius:999px;background:#eaecf0;margin-top:8px;overflow:hidden}
    .kpi-city-fill{height:100%;border-radius:999px;background:var(--primary);min-width:3px}
    .manager-shell{display:grid;grid-template-columns:220px minmax(0,1fr);gap:14px}.manager-menu{padding:12px;height:max-content}.manager-menu button{width:100%;text-align:left;margin-bottom:7px}
    .manager-login{max-width:440px;margin:35px auto;padding:22px}.manager-login h2{margin-top:0}
    .manager-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:14px;border-bottom:1px solid var(--border)}
    .manager-filter{display:grid;grid-template-columns:minmax(220px,1fr) 180px auto auto;gap:9px;padding:14px;border-bottom:1px solid var(--border);align-items:center}
    .leg-card{border:1px solid var(--border);border-radius:12px;padding:14px;margin-bottom:12px;background:#fcfcfd}.leg-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
    .audit{max-height:260px;overflow:auto;border:1px solid var(--border);border-radius:10px}.audit-row{padding:9px 11px;border-bottom:1px solid #eef1f5;font-size:11px}.audit-row:last-child{border-bottom:0}
    .master-editor{display:grid;grid-template-columns:160px minmax(170px,1fr) minmax(170px,1fr) 170px 90px 90px auto;gap:8px;padding:12px;border-bottom:1px solid var(--border);align-items:end}
    .toast{position:fixed;right:18px;bottom:18px;z-index:300;background:#101828;color:#fff;padding:12px 14px;border-radius:9px;box-shadow:var(--shadow);display:none;max-width:430px;font-size:12px}.toast.show{display:block}
    .toast.toast-success{background:#067647;color:#fff;border:1px solid #05603a;box-shadow:0 8px 24px rgba(6,118,71,.22)}
    .toast.toast-error{background:#b42318;color:#fff;border:1px solid #912018;box-shadow:0 8px 24px rgba(180,35,24,.22)}
    .overlay{position:fixed;inset:0;z-index:250;background:rgba(245,247,251,.84);backdrop-filter:blur(2px);display:none;align-items:center;justify-content:center}
    .overlay.show{display:flex}.loader{background:#fff;border:1px solid var(--border);border-radius:14px;padding:20px 28px;box-shadow:var(--shadow);font-weight:700}
    .app-footer{max-width:1550px;margin:0 auto;padding:4px 20px 22px;text-align:center;color:var(--muted);font-size:11px}
    .app-footer strong{color:#475467;font-weight:700}
    /* =======================================================
       MOBILE EXPERIENCE
       The desktop layout stays unchanged. On phones the tables
       become touch-friendly cards instead of desktop grids.
       ======================================================= */
    @media(max-width:900px){
      html,body{max-width:100%;overflow-x:hidden}
      body{
        padding-bottom:env(safe-area-inset-bottom);
        -webkit-text-size-adjust:100%;
      }

      .topbar{position:sticky;top:0}
      .topbar-inner{
        padding:11px 12px;
        padding-top:calc(11px + env(safe-area-inset-top));
        display:grid;
        grid-template-columns:1fr;
        gap:10px;
        align-items:stretch;
      }
      .brand h1{font-size:18px;line-height:1.15}
      .brand div{font-size:10px}
      .actions{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:8px;
        width:100%;
      }
      .actions .btn{
        min-height:44px;
        width:100%;
      }
      .refresh-label{display:none}

      .container{padding:12px}
      .app-footer{padding:2px 12px calc(18px + env(safe-area-inset-bottom));font-size:10px}

      /* Compact KPI strip instead of three tall desktop cards. */
      .stats{
        grid-template-columns:repeat(3,minmax(0,1fr));
        gap:8px;
        margin-bottom:12px;
      }
      .stat{
        min-width:0;
        padding:11px 8px;
        border-radius:11px;
        box-shadow:none;
      }
      .stat-label{
        font-size:9px;
        line-height:1.2;
        min-height:22px;
        margin-bottom:4px;
      }
      .stat-value{font-size:23px}

      .toolbar{
        display:block;
        margin-bottom:12px;
      }

      /* Swipeable navigation tabs. */
      .tabs{
        width:calc(100vw - 24px);
        max-width:100%;
        overflow-x:auto;
        overflow-y:hidden;
        flex-wrap:nowrap;
        white-space:nowrap;
        padding:4px;
        margin-bottom:10px;
        -webkit-overflow-scrolling:touch;
        scrollbar-width:none;
      }
      .tabs::-webkit-scrollbar{display:none}
      .tab{
        flex:0 0 auto;
        min-height:42px;
        padding:9px 12px;
        font-size:12px;
      }

      .search{
        width:100%;
        min-width:0;
        max-width:none;
      }

      input,select{
        min-height:46px;
        height:46px;
        font-size:16px; /* prevents iOS auto zoom */
      }
      textarea{font-size:16px}
      .btn{min-height:42px}
      .btn-sm{min-height:40px;font-size:12px}

      .form-grid,.summary-grid{grid-template-columns:1fr}
      .summary-grid{gap:7px}
      .summary-item{padding:9px 10px}

      /* Filters: two columns where useful, full-width search/actions. */
      .filter-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:9px;
      }
      .filter-grid .field:nth-child(5){grid-column:1/-1}
      .filter-grid > .btn{width:100%}

      .history-controls{
        padding:10px;
        margin-bottom:10px;
        border-radius:12px;
      }

      /* KPI dashboard uses two compact columns. */
      .kpi-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:9px;
      }
      .kpi-card{
        padding:13px;
        border-radius:12px;
        box-shadow:none;
      }
      .kpi-card:nth-child(5){grid-column:1/-1}
      .kpi-value{font-size:22px}
      .kpi-city-list{grid-template-columns:1fr}
      .kpi-breakdown{padding:13px}

      /* Real mobile cards: no horizontal table scrolling. */
      .panel{overflow:visible;box-shadow:none}
      .table-wrap{overflow:visible}
      table{
        display:block;
        min-width:0!important;
        width:100%;
      }
      thead{display:none}
      tbody{
        display:block;
        width:100%;
      }
      tbody tr{
        display:block;
        width:100%;
        margin:0 0 10px;
        border:1px solid var(--border);
        border-radius:12px;
        background:#fff;
        overflow:hidden;
        box-shadow:0 3px 12px rgba(16,24,40,.05);
      }
      tbody tr:hover{background:#fff}
      tbody td{
        display:flex;
        width:100%;
        align-items:flex-start;
        justify-content:space-between;
        gap:14px;
        padding:9px 11px;
        border-bottom:1px solid #eef1f5;
        text-align:right;
        font-size:12px;
        word-break:break-word;
      }
      tbody td:last-child{border-bottom:0}
      tbody td::before{
        flex:0 0 38%;
        max-width:38%;
        text-align:left;
        color:var(--muted);
        font-size:9px;
        font-weight:800;
        letter-spacing:.02em;
        text-transform:uppercase;
        line-height:1.35;
      }
      tbody td > *{max-width:62%}
      tbody td .secondary{
        text-align:right;
        white-space:normal;
      }
      tbody td .route{
        white-space:normal;
        text-align:right;
      }
      tbody td .btn{
        max-width:none;
        width:100%;
      }
      tbody td:last-child::before{display:none}
      tbody td:last-child{padding:10px}

      /* Active trips labels */
      #activeRows td:nth-child(1)::before{content:"Fleet Ownership"}
      #activeRows td:nth-child(2)::before{content:"Trip Type"}
      #activeRows td:nth-child(3)::before{content:"Delivery Type"}
      #activeRows td:nth-child(4)::before{content:"Status"}
      #activeRows td:nth-child(5)::before{content:"Last Activity"}
      #activeRows td:nth-child(6)::before{content:"Route / Location"}
      #activeRows td:nth-child(7)::before{content:"Plate"}
      #activeRows td:nth-child(8)::before{content:"Truck"}
      #activeRows td:nth-child(9)::before{content:"Driver"}

      /* Completed trips labels */
      #completedRows td:nth-child(1)::before{content:"Fleet Ownership"}
      #completedRows td:nth-child(2)::before{content:"Initial Trip Type"}
      #completedRows td:nth-child(3)::before{content:"Trip Types"}
      #completedRows td:nth-child(4)::before{content:"Started"}
      #completedRows td:nth-child(5)::before{content:"Completed"}
      #completedRows td:nth-child(6)::before{content:"Route"}
      #completedRows td:nth-child(7)::before{content:"Plate"}
      #completedRows td:nth-child(8)::before{content:"Truck"}
      #completedRows td:nth-child(9)::before{content:"Driver"}
      #completedRows td:nth-child(10)::before{content:"Latest Delivery Type"}
      #completedRows td:nth-child(11)::before{content:"Legs"}
      #completedRows td:nth-child(12)::before{content:"Backload Count"}
      #completedRows td:nth-child(13)::before{content:"Free Trip Count"}
      #completedRows td:nth-child(14)::before{content:"Total Stopover (Hours)"}
      #completedRows td:nth-child(15)::before{content:"Trip Duration"}
      #completedRows td:nth-child(15){padding:9px 11px}
      #completedRows td:nth-child(15)::before{display:block}

      /* Activity Log labels */
      #activityRows td:nth-child(1)::before{content:"Date / Time"}
      #activityRows td:nth-child(2)::before{content:"User"}
      #activityRows td:nth-child(3)::before{content:"Action"}
      #activityRows td:nth-child(4)::before{content:"Trip"}
      #activityRows td:nth-child(5)::before{content:"Entity"}
      #activityRows td:nth-child(6)::before{content:"Field"}
      #activityRows td:nth-child(7)::before{content:"Old → New"}
      #activityRows td:nth-child(8)::before{content:"Details"}
      #activityRows td:nth-child(8){padding:9px 11px}
      #activityRows td:nth-child(8)::before{display:block}

      /* Manager trip database labels */
      #mgrTripRows td:nth-child(1)::before{content:"Trip"}
      #mgrTripRows td:nth-child(2)::before{content:"Status"}
      #mgrTripRows td:nth-child(3)::before{content:"Origin"}
      #mgrTripRows td:nth-child(4)::before{content:"Plate"}
      #mgrTripRows td:nth-child(5)::before{content:"Driver"}
      #mgrTripRows td:nth-child(6)::before{content:"Trip Type"}
      #mgrTripRows td:nth-child(7)::before{content:"Current Location"}
      #mgrTripRows td:nth-child(8)::before{content:"Updated"}

      /* Manager master data labels */
      #masterRows td:nth-child(1)::before{content:"Type"}
      #masterRows td:nth-child(2)::before{content:"Value"}
      #masterRows td:nth-child(3)::before{content:"Region"}
      #masterRows td:nth-child(4)::before{content:"Active"}
      #masterRows td:nth-child(5)::before{content:"Sort"}

      /* Manager vehicle labels */
      #vehicleRows td:nth-child(1)::before{content:"Plate Number"}
      #vehicleRows td:nth-child(2)::before{content:"Truck Type"}
      #vehicleRows td:nth-child(3)::before{content:"Fleet Ownership / Origin"}
      #vehicleRows td:nth-child(4)::before{content:"Driver Name"}
      #vehicleRows td:nth-child(5)::before{content:"Mobile Number"}
      #vehicleRows td:nth-child(6)::before{content:"Active"}
      #vehicleRows td:nth-child(7)::before{content:"Notes"}

      /* Manager routing labels */
      #routingRows td:nth-child(1)::before{content:"Destination"}
      #routingRows td:nth-child(2)::before{content:"Region"}
      #routingRows td:nth-child(3)::before{content:"To Email"}
      #routingRows td:nth-child(4)::before{content:"CC Email"}
      #routingRows td:nth-child(5)::before{content:"Destination WH CC"}
      #routingRows td:nth-child(6)::before{content:"Active"}

      /* Manager region mapping labels */
      #regionRows td:nth-child(1)::before{content:"Region"}
      #regionRows td:nth-child(2)::before{content:"Fleet Ownership"}
      #regionRows td:nth-child(3)::before{content:"Active"}
      #regionRows td:nth-child(4)::before{content:"Sort"}

      /* Empty/loading states should stay centered, not card label rows. */
      tbody td.empty,
      tbody td.loading{
        display:block;
        max-width:none;
        text-align:center;
        padding:28px 14px;
      }
      tbody td.empty::before,
      tbody td.loading::before{display:none}

      /* Full-screen mobile modals, native-app feel. */
      .modal-backdrop{
        padding:0;
        align-items:stretch;
        justify-content:stretch;
      }
      .modal,
      .modal.wide{
        width:100%;
        height:100dvh;
        max-height:100dvh;
        border-radius:0;
        box-shadow:none;
        display:flex;
        flex-direction:column;
      }
      .modal-header{
        position:sticky;
        top:0;
        z-index:3;
        background:#fff;
        padding:14px 13px;
        padding-top:calc(14px + env(safe-area-inset-top));
      }
      .modal-title{font-size:18px}
      .modal-body{
        flex:1 1 auto;
        overflow-y:auto;
        padding:13px;
        -webkit-overflow-scrolling:touch;
      }
      .modal-footer{
        position:sticky;
        bottom:0;
        z-index:3;
        background:#fff;
        padding:10px 12px;
        padding-bottom:calc(10px + env(safe-area-inset-bottom));
        display:grid;
        grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
      }
      .modal-footer .btn{width:100%;min-height:46px}
      .close{min-width:40px;min-height:40px}

      .action-box{padding:13px}
      .action-box > .btn{width:100%;min-height:48px}

      /* Manager becomes a horizontal segmented menu. */
      .manager-shell{grid-template-columns:1fr;gap:10px}
      .manager-menu{
        display:flex;
        overflow-x:auto;
        gap:7px;
        padding:8px;
        position:sticky;
        top:0;
        z-index:5;
        -webkit-overflow-scrolling:touch;
        scrollbar-width:none;
      }
      .manager-menu::-webkit-scrollbar{display:none}
      .manager-menu button{
        flex:0 0 auto;
        width:auto;
        min-width:max-content;
        margin:0;
        text-align:center;
      }
      .manager-login{
        margin:16px auto;
        padding:18px;
        box-shadow:none;
      }
      .manager-head{
        padding:11px 12px;
        flex-wrap:wrap;
      }
      .manager-head input{
        max-width:none!important;
        flex:1 1 100%;
      }
      .manager-filter{
        grid-template-columns:1fr 1fr;
        gap:9px;
        padding:10px;
      }
      .manager-filter > input{grid-column:1/-1}
      .manager-filter > .btn{width:100%}

      .master-editor{
        grid-template-columns:1fr;
        padding:10px;
      }
      #routingEditor{
        grid-template-columns:1fr!important;
      }

      .leg-card{
        padding:11px;
        border-radius:11px;
      }
      .leg-card .btn{width:100%;min-height:44px}

      .audit{max-height:none}
      .audit-row{font-size:11px;line-height:1.45}

      .toast{
        left:12px;
        right:12px;
        bottom:calc(12px + env(safe-area-inset-bottom));
        max-width:none;
        text-align:center;
      }
      .loader{
        max-width:calc(100vw - 34px);
        text-align:center;
      }
    }

    @media(max-width:430px){
      .container{padding:10px}
      .topbar-inner{padding-left:10px;padding-right:10px}
      .brand h1{font-size:17px}
      .stats{gap:6px}
      .stat{padding:10px 6px}
      .stat-value{font-size:21px}
      .stat-label{font-size:8.5px}
      .tabs{width:calc(100vw - 20px)}
      .filter-grid{grid-template-columns:1fr}
      .filter-grid .field:nth-child(5){grid-column:auto}
      .kpi-grid{grid-template-columns:1fr 1fr}
      tbody td::before{flex-basis:40%;max-width:40%}
      tbody td > *{max-width:60%}
    }
  
    /* =======================================================
       FORCED MOBILE MODE
       Some mobile browsers/WebView containers report a desktop-
       like viewport (~980px). JS adds body.mobile-ui based on
       device/touch characteristics so the phone layout is not
       dependent on @media width alone.
       ======================================================= */
    body.mobile-ui{overflow-x:hidden;padding-bottom:env(safe-area-inset-bottom)}
    body.mobile-ui .topbar-inner{
      padding:10px 10px;
      padding-top:calc(10px + env(safe-area-inset-top));
      display:grid;grid-template-columns:1fr;gap:9px;align-items:stretch
    }
    body.mobile-ui .brand h1{font-size:17px;line-height:1.15}
    body.mobile-ui .brand div{font-size:10px}
    body.mobile-ui .actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}
    body.mobile-ui .actions .btn{width:100%;min-height:44px}
    body.mobile-ui .refresh-label{display:none}
    body.mobile-ui .container{padding:10px;max-width:none;width:100%}
    body.mobile-ui .stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:10px}
    body.mobile-ui .stat{padding:10px 6px;border-radius:11px;box-shadow:none;min-width:0}
    body.mobile-ui .stat-label{font-size:8.5px;line-height:1.2;min-height:21px;margin-bottom:3px}
    body.mobile-ui .stat-value{font-size:21px}
    body.mobile-ui .toolbar{display:block;margin-bottom:10px}
    body.mobile-ui .tabs{
      display:flex;flex-wrap:nowrap;white-space:nowrap;overflow-x:auto;overflow-y:hidden;
      width:100%;max-width:100%;padding:4px;margin-bottom:9px;
      -webkit-overflow-scrolling:touch;scrollbar-width:none
    }
    body.mobile-ui .tabs::-webkit-scrollbar{display:none}
    body.mobile-ui .tab{flex:0 0 auto;min-height:42px;padding:9px 12px;font-size:12px}
    body.mobile-ui .search{width:100%;min-width:0;max-width:none}
    body.mobile-ui input,
    body.mobile-ui select{min-height:46px;height:46px;font-size:16px}
    body.mobile-ui textarea{font-size:16px}
    body.mobile-ui .btn{min-height:42px}
    body.mobile-ui .btn-sm{min-height:40px;font-size:12px}
    body.mobile-ui .form-grid,
    body.mobile-ui .summary-grid{grid-template-columns:1fr}
    body.mobile-ui .summary-grid{gap:7px}
    body.mobile-ui .filter-grid{grid-template-columns:1fr;gap:9px}
    body.mobile-ui .filter-grid .field:nth-child(5){grid-column:auto}
    body.mobile-ui .filter-grid > .btn{width:100%}
    body.mobile-ui .history-controls{padding:10px;margin-bottom:10px;border-radius:12px}
    body.mobile-ui .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    body.mobile-ui .kpi-card{padding:12px;border-radius:11px;box-shadow:none}
    body.mobile-ui .kpi-card:nth-child(5){grid-column:1/-1}
    body.mobile-ui .kpi-city-list{grid-template-columns:1fr}
    body.mobile-ui .kpi-breakdown{padding:12px}

    /* Convert every data table into vertical phone cards. */
    body.mobile-ui .panel{overflow:visible;box-shadow:none}
    body.mobile-ui .table-wrap{overflow:visible}
    body.mobile-ui table{display:block!important;min-width:0!important;width:100%!important}
    body.mobile-ui thead{display:none!important}
    body.mobile-ui tbody{display:block!important;width:100%!important}
    body.mobile-ui tbody tr{
      display:block!important;width:100%!important;margin:0 0 10px!important;
      border:1px solid var(--border)!important;border-radius:12px!important;
      background:#fff!important;overflow:hidden!important;
      box-shadow:0 3px 12px rgba(16,24,40,.05)!important
    }
    body.mobile-ui tbody td{
      display:flex!important;width:100%!important;max-width:none!important;
      align-items:flex-start!important;justify-content:space-between!important;
      gap:12px!important;padding:9px 11px!important;
      border-bottom:1px solid #eef1f5!important;text-align:right!important;
      font-size:12px!important;white-space:normal!important;word-break:break-word
    }
    body.mobile-ui tbody td:last-child{border-bottom:0!important}
    body.mobile-ui tbody td::before{
      flex:0 0 39%;max-width:39%;text-align:left;color:var(--muted);
      font-size:9px;font-weight:800;letter-spacing:.02em;text-transform:uppercase;line-height:1.35
    }
    body.mobile-ui tbody td > *{max-width:61%}
    body.mobile-ui tbody td .route{white-space:normal!important;text-align:right}
    body.mobile-ui tbody td .secondary{white-space:normal!important;text-align:right}
    body.mobile-ui tbody td:last-child::before{display:none}
    body.mobile-ui tbody td:last-child .btn{width:100%;max-width:none}

    body.mobile-ui #activeRows td:nth-child(1)::before{content:"Fleet Ownership"}
    body.mobile-ui #activeRows td:nth-child(2)::before{content:"Trip Type"}
    body.mobile-ui #activeRows td:nth-child(3)::before{content:"Delivery Type"}
    body.mobile-ui #activeRows td:nth-child(4)::before{content:"Status"}
    body.mobile-ui #activeRows td:nth-child(5)::before{content:"Last Activity"}
    body.mobile-ui #activeRows td:nth-child(6)::before{content:"Route / Location"}
    body.mobile-ui #activeRows td:nth-child(7)::before{content:"Plate"}
    body.mobile-ui #activeRows td:nth-child(8)::before{content:"Truck"}
    body.mobile-ui #activeRows td:nth-child(9)::before{content:"Driver"}

    body.mobile-ui #completedRows td:nth-child(1)::before{content:"Fleet Ownership"}
    body.mobile-ui #completedRows td:nth-child(2)::before{content:"Initial Trip Type"}
    body.mobile-ui #completedRows td:nth-child(3)::before{content:"Trip Types"}
    body.mobile-ui #completedRows td:nth-child(4)::before{content:"Started"}
    body.mobile-ui #completedRows td:nth-child(5)::before{content:"Completed"}
    body.mobile-ui #completedRows td:nth-child(6)::before{content:"Route"}
    body.mobile-ui #completedRows td:nth-child(7)::before{content:"Plate"}
    body.mobile-ui #completedRows td:nth-child(8)::before{content:"Truck"}
    body.mobile-ui #completedRows td:nth-child(9)::before{content:"Driver"}
    body.mobile-ui #completedRows td:nth-child(10)::before{content:"Latest Delivery Type"}
    body.mobile-ui #completedRows td:nth-child(11)::before{content:"Legs"}
    body.mobile-ui #completedRows td:nth-child(12)::before{content:"Backload Count"}
    body.mobile-ui #completedRows td:nth-child(13)::before{content:"Free Trip Count"}
    body.mobile-ui #completedRows td:nth-child(14)::before{content:"Total Stopover (Hours)"}
    body.mobile-ui #completedRows td:nth-child(15)::before{content:"Trip Duration"}
    body.mobile-ui #completedRows td:nth-child(15)::before{display:block}

    body.mobile-ui #activityRows td:nth-child(1)::before{content:"Date / Time"}
    body.mobile-ui #activityRows td:nth-child(2)::before{content:"User"}
    body.mobile-ui #activityRows td:nth-child(3)::before{content:"Action"}
    body.mobile-ui #activityRows td:nth-child(4)::before{content:"Trip"}
    body.mobile-ui #activityRows td:nth-child(5)::before{content:"Entity"}
    body.mobile-ui #activityRows td:nth-child(6)::before{content:"Field"}
    body.mobile-ui #activityRows td:nth-child(7)::before{content:"Old → New"}
    body.mobile-ui #activityRows td:nth-child(8)::before{content:"Details"}
    body.mobile-ui #activityRows td:nth-child(8)::before{display:block}

    body.mobile-ui #mgrTripRows td:nth-child(1)::before{content:"Trip"}
    body.mobile-ui #mgrTripRows td:nth-child(2)::before{content:"Status"}
    body.mobile-ui #mgrTripRows td:nth-child(3)::before{content:"Origin"}
    body.mobile-ui #mgrTripRows td:nth-child(4)::before{content:"Plate"}
    body.mobile-ui #mgrTripRows td:nth-child(5)::before{content:"Driver"}
    body.mobile-ui #mgrTripRows td:nth-child(6)::before{content:"Trip Type"}
    body.mobile-ui #mgrTripRows td:nth-child(7)::before{content:"Current Location"}
    body.mobile-ui #mgrTripRows td:nth-child(8)::before{content:"Updated"}

    body.mobile-ui #masterRows td:nth-child(1)::before{content:"Type"}
    body.mobile-ui #masterRows td:nth-child(2)::before{content:"Value"}
    body.mobile-ui #masterRows td:nth-child(3)::before{content:"Region"}
    body.mobile-ui #masterRows td:nth-child(4)::before{content:"Active"}
    body.mobile-ui #masterRows td:nth-child(5)::before{content:"Sort"}

    body.mobile-ui #vehicleRows td:nth-child(1)::before{content:"Plate Number"}
    body.mobile-ui #vehicleRows td:nth-child(2)::before{content:"Truck Type"}
    body.mobile-ui #vehicleRows td:nth-child(3)::before{content:"Fleet Ownership / Origin"}
    body.mobile-ui #vehicleRows td:nth-child(4)::before{content:"Driver Name"}
    body.mobile-ui #vehicleRows td:nth-child(5)::before{content:"Mobile Number"}
    body.mobile-ui #vehicleRows td:nth-child(6)::before{content:"Active"}
    body.mobile-ui #vehicleRows td:nth-child(7)::before{content:"Notes"}

    body.mobile-ui #routingRows td:nth-child(1)::before{content:"Destination"}
    body.mobile-ui #routingRows td:nth-child(2)::before{content:"Region"}
    body.mobile-ui #routingRows td:nth-child(3)::before{content:"To Email"}
    body.mobile-ui #routingRows td:nth-child(4)::before{content:"CC Email"}
    body.mobile-ui #routingRows td:nth-child(5)::before{content:"Destination WH CC"}
    body.mobile-ui #routingRows td:nth-child(6)::before{content:"Active"}

    body.mobile-ui #regionRows td:nth-child(1)::before{content:"Region"}
    body.mobile-ui #regionRows td:nth-child(2)::before{content:"Fleet Ownership"}
    body.mobile-ui #regionRows td:nth-child(3)::before{content:"Active"}
    body.mobile-ui #regionRows td:nth-child(4)::before{content:"Sort"}

    body.mobile-ui tbody td.empty,
    body.mobile-ui tbody td.loading{display:block!important;text-align:center!important;padding:28px 14px!important}
    body.mobile-ui tbody td.empty::before,
    body.mobile-ui tbody td.loading::before{display:none!important}

    /* Phone modals fill the screen and keep actions reachable. */
    body.mobile-ui .modal-backdrop{padding:0;align-items:stretch;justify-content:stretch}
    body.mobile-ui .modal,
    body.mobile-ui .modal.wide{
      width:100%!important;height:100dvh!important;max-height:100dvh!important;
      border-radius:0!important;box-shadow:none!important;display:flex;flex-direction:column
    }
    body.mobile-ui .modal-header{
      position:sticky;top:0;z-index:3;background:#fff;padding:13px;
      padding-top:calc(13px + env(safe-area-inset-top))
    }
    body.mobile-ui .modal-body{
      flex:1 1 auto;overflow-y:auto;padding:12px;-webkit-overflow-scrolling:touch
    }
    body.mobile-ui .modal-footer{
      position:sticky;bottom:0;z-index:3;background:#fff;padding:9px 10px;
      padding-bottom:calc(9px + env(safe-area-inset-bottom));
      display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr))
    }
    body.mobile-ui .modal-footer .btn{width:100%;min-height:46px}
    body.mobile-ui .action-box{padding:12px}
    body.mobile-ui .action-box > .btn{width:100%;min-height:48px}
    body.mobile-ui .manual-action-row{display:flex;align-items:center;justify-content:flex-start;gap:8px}
    body.mobile-ui .manual-action-row .btn{width:auto;min-width:0;min-height:46px;padding:9px 14px;font-size:12px;white-space:nowrap}
    body.mobile-ui .manual-action-row .btn-main{min-width:150px}
    body.mobile-ui .manual-time-box{padding:11px;background:#f9fafb}

    /* Manager: turn desktop sidebar into swipeable segmented navigation. */
    body.mobile-ui .manager-shell{grid-template-columns:1fr;gap:10px}
    body.mobile-ui .manager-menu{
      display:flex;overflow-x:auto;gap:7px;padding:8px;position:sticky;top:0;z-index:5;
      -webkit-overflow-scrolling:touch;scrollbar-width:none
    }
    body.mobile-ui .manager-menu::-webkit-scrollbar{display:none}
    body.mobile-ui .manager-menu button{flex:0 0 auto;width:auto;min-width:max-content;margin:0;text-align:center}
    body.mobile-ui .manager-login{margin:14px auto;padding:17px;box-shadow:none}
    body.mobile-ui .manager-head{padding:10px 11px;flex-wrap:wrap}
    body.mobile-ui .manager-head input{max-width:none!important;flex:1 1 100%}
    body.mobile-ui .manager-filter{grid-template-columns:1fr;gap:9px;padding:10px}
    body.mobile-ui .manager-filter > input{grid-column:auto}
    body.mobile-ui .manager-filter > .btn{width:100%}
    body.mobile-ui .master-editor{grid-template-columns:1fr;padding:10px}
    body.mobile-ui #routingEditor{grid-template-columns:1fr!important}
    body.mobile-ui .leg-card{padding:11px}
    body.mobile-ui .leg-card .btn{width:100%;min-height:44px}
    body.mobile-ui .toast{
      left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom));
      max-width:none;text-align:center
    }


    /* =======================================================
       v1.5.5 - ALIGNMENT + BALANCED READABILITY
       - Instructions always occupies the first action slot.
       - Update Trip always occupies the second action slot.
       - Button labels never wrap or become vertical.
       - Font sizes returned to a balanced desktop/mobile scale.
       ======================================================= */
    body{font-size:14px}
    .brand h1{font-size:20px}
    .brand div,.refresh-label{font-size:12px}
    .tab{font-size:13px}
    input,select,textarea{font-size:14px}
    th{font-size:12px;padding:12px 13px}
    td{font-size:13px;padding:12px 13px}
    .secondary{font-size:11.5px;line-height:1.35}
    .status{font-size:11px;padding:5px 9px}
    .btn{
      font-size:13px;
      white-space:nowrap;
      word-break:normal;
      overflow-wrap:normal;
      writing-mode:horizontal-tb;
    }
    .btn-sm{font-size:13px;padding:8px 11px}
    label{font-size:12px}
    .notice{font-size:13px;line-height:1.5}
    .modal-title{font-size:19px}
    .modal-sub{font-size:12px}
    .summary-label{font-size:11px}
    .summary-value{font-size:13px}
    .action-box h3{font-size:16px}
    .checkbox{font-size:13px}
    .manual-time-hint{font-size:11px}
    .kpi-label{font-size:12px}
    .kpi-sub{font-size:11px}
    .audit-row{font-size:12px}
    .toast{font-size:13px}

    .trip-row-actions{
      display:grid;
      grid-template-columns:164px 152px 116px;
      align-items:center;
      gap:9px;
      min-width:450px;
    }
    .trip-row-actions .instructions-btn,
    .trip-row-actions .driver-link-btn,
    .trip-row-actions .update-trip-btn,
    .trip-row-actions .instructions-slot-placeholder{
      width:100%;
      min-width:0;
      box-sizing:border-box;
    }
    .trip-row-actions .instructions-btn{grid-column:1}
    .trip-row-actions .instructions-slot-placeholder{
      grid-column:1;
      display:block;
      height:38px;
      visibility:hidden;
      pointer-events:none;
    }
    .trip-row-actions .driver-link-btn{grid-column:2;color:#175cd3;border-color:#b2ddff;background:#eff8ff}
    .trip-row-actions .driver-link-btn:hover{background:#dff1ff;border-color:#84caff;color:#1849a9}
    .trip-row-actions .update-trip-btn{grid-column:3}

    @media(max-width:900px){
      .brand h1{font-size:19px}
      .brand div{font-size:11px}
      .tab{font-size:13px}
      .stat-label{font-size:10px}
      .stat-value{font-size:23px}
      .btn{font-size:13px}
      .btn-sm{font-size:13px;min-height:42px}
      tbody td{font-size:13px;line-height:1.4;padding:10px 11px}
      tbody td::before{font-size:10px;line-height:1.35}
      tbody td .secondary{font-size:11.5px}
      .status{font-size:11px}
      .summary-label{font-size:11px}
      .summary-value{font-size:13px}
      label{font-size:12px}
      .modal-title{font-size:19px}
      .modal-sub{font-size:12px}
      .notice{font-size:13px}
      .trip-row-actions{
        grid-template-columns:minmax(0,1fr) minmax(0,1fr);
        width:100%;
        min-width:0;
        gap:8px;
      }
      .trip-row-actions .instructions-btn,
      .trip-row-actions .instructions-slot-placeholder{grid-column:1/-1}
      .trip-row-actions .driver-link-btn{grid-column:1}
      .trip-row-actions .update-trip-btn{grid-column:2}
      .trip-row-actions .btn{
        width:100%;
        max-width:none;
        padding-left:8px;
        padding-right:8px;
        font-size:clamp(11px,3.1vw,13px);
      }
      .trip-row-actions .instructions-slot-placeholder{height:0;display:none}
    }

    body.mobile-ui .brand h1{font-size:19px}
    body.mobile-ui .brand div{font-size:11px}
    body.mobile-ui .tab{font-size:13px}
    body.mobile-ui .stat-label{font-size:10px}
    body.mobile-ui .stat-value{font-size:23px}
    body.mobile-ui .btn{font-size:13px}
    body.mobile-ui .btn-sm{font-size:13px;min-height:42px}
    body.mobile-ui tbody td{font-size:13px!important;line-height:1.4;padding:10px 11px!important}
    body.mobile-ui tbody td::before{font-size:10px;line-height:1.35}
    body.mobile-ui tbody td .secondary{font-size:11.5px}
    body.mobile-ui .status{font-size:11px}
    body.mobile-ui .summary-label{font-size:11px}
    body.mobile-ui .summary-value{font-size:13px}
    body.mobile-ui label{font-size:12px}
    body.mobile-ui .modal-title{font-size:19px}
    body.mobile-ui .modal-sub{font-size:12px}
    body.mobile-ui .notice{font-size:13px}
    body.mobile-ui .trip-row-actions{
      display:grid;
      grid-template-columns:minmax(0,1fr) minmax(0,1fr);
      width:100%;
      max-width:none;
      min-width:0;
      gap:8px;
    }
    body.mobile-ui .trip-row-actions .instructions-btn,
    body.mobile-ui .trip-row-actions .instructions-slot-placeholder{grid-column:1/-1}
    body.mobile-ui .trip-row-actions .driver-link-btn{grid-column:1}
    body.mobile-ui .trip-row-actions .update-trip-btn{grid-column:2}
    body.mobile-ui .trip-row-actions .btn{
      width:100%;
      max-width:none;
      padding-left:8px;
      padding-right:8px;
      font-size:clamp(11px,3.1vw,13px);
      white-space:nowrap!important;
      word-break:normal!important;
      overflow-wrap:normal!important;
      writing-mode:horizontal-tb!important;
    }
    body.mobile-ui .trip-row-actions .instructions-slot-placeholder{height:0;display:none}

    /* v1.5.6 - compact inline header icon */
    .brand{display:flex;align-items:center;gap:11px;min-width:0}
    .brand-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:42px;color:var(--primary);margin:0}
    .brand-icon svg{display:block;width:42px;height:42px}
    .brand-copy{display:block;min-width:0}
    .brand-subtitle{display:block;font-size:12px;color:var(--muted);margin-top:3px;white-space:nowrap}
    @media(max-width:900px){
      .brand{gap:9px}
      .brand-icon{flex-basis:36px;width:36px;height:36px}
      .brand-icon svg{width:36px;height:36px}
      .brand-subtitle{font-size:10px;overflow:hidden;text-overflow:ellipsis;max-width:calc(100vw - 74px)}
    }
    body.mobile-ui .brand{gap:9px}
    body.mobile-ui .brand-icon{flex-basis:36px;width:36px;height:36px}
    body.mobile-ui .brand-icon svg{width:36px;height:36px}
    body.mobile-ui .brand-subtitle{font-size:10px;overflow:hidden;text-overflow:ellipsis;max-width:calc(100vw - 74px)}



    /* =======================================================
       v1.6.1 PREVIEW - ACTIVE TABLE LAYOUT
       Everything in this block is intentionally isolated so
       individual preview features can be removed later.
       ======================================================= */
    .refresh-meta{display:flex;flex-direction:column;align-items:flex-end;gap:2px;min-width:210px}
    .next-refresh{color:#6941c6;font-weight:700}
    .live-summary{grid-template-columns:repeat(4,minmax(0,1fr))}
    .stat-filter{appearance:none;text-align:left;color:inherit;font-family:inherit;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s}
    .stat-filter:hover{border-color:#d6bbfb;transform:translateY(-1px)}
    .stat-filter.selected{border-color:#9e77ed;box-shadow:0 0 0 3px rgba(105,65,198,.10),var(--shadow)}
    .attention-stat .stat-value{color:#b54708}
    .attention-stat.selected{border-color:#f79009;box-shadow:0 0 0 3px rgba(247,144,9,.10),var(--shadow)}
    .stat-hint{font-size:10px;color:var(--muted);margin-top:5px;font-weight:400}
    .movement-line{font-weight:700;line-height:1.45;white-space:normal}
    .movement-key{font-size:10px;color:#6941c6;text-transform:uppercase;letter-spacing:.03em;font-weight:800}
    .movement-arrow{color:#9e77ed;padding:0 3px;font-weight:900}
    .next-pending{color:var(--muted);font-weight:600}
    .activity-title{display:block;line-height:1.35}
    .duration-pill{display:inline-flex;margin-top:6px;padding:4px 7px;border-radius:999px;font-size:10px;font-weight:800;white-space:nowrap}
    .duration-pill.transit{background:#f4f3ff;color:#6941c6}
    .duration-pill.normal{background:#f2f4f7;color:#475467}
    .duration-pill.warn{background:#fffaeb;color:#b54708}
    .duration-pill.danger{background:#fef3f2;color:#b42318}
    .exception-list{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px;max-width:210px}
    .exception-badge{display:inline-flex;align-items:center;padding:3px 6px;border-radius:999px;font-size:9.5px;font-weight:800;line-height:1.25;white-space:nowrap}
    .exception-badge.danger{background:#fef3f2;color:#b42318}
    .exception-badge.info{background:#eff8ff;color:#175cd3}
    .exception-badge.purple{background:#f4f3ff;color:#6941c6}
    .exception-badge.green{background:#ecfdf3;color:#067647}
    .driver-arrival-alert{
      display:flex;flex-direction:column;gap:2px;margin-top:8px;padding:9px 11px;
      border:1.5px solid #84caff;border-radius:10px;background:#eff8ff;color:#175cd3;
      box-shadow:0 2px 8px rgba(23,92,211,.10);min-width:175px;max-width:230px
    }
    .driver-arrival-alert-title{font-size:11px;font-weight:900;line-height:1.25;letter-spacing:.01em}
    .driver-arrival-alert-time{font-size:10px;font-weight:700;color:#1849a9;line-height:1.3}
    .driver-arrival-row{background:linear-gradient(90deg,rgba(239,248,255,.95),rgba(255,255,255,0) 34%)}
    .driver-arrival-row td:first-child{box-shadow:inset 4px 0 0 #2e90fa}
    .attention-row{background:linear-gradient(90deg,rgba(255,250,235,.55),rgba(255,255,255,0) 28%)}
    .cell-stack{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0}
    .status-stack{gap:2px}
    .activity-stack{gap:1px}
    .instructions-btn{position:relative;overflow:visible}
    table{min-width:1230px}

    @media(max-width:900px){
      .actions .refresh-meta{grid-column:1/-1;display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:0;padding:0 2px}
      .refresh-label{display:inline!important;font-size:10px!important}
      .live-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
      .stat-hint{display:none}
      .movement-key{font-size:9px}
      tbody td .cell-stack{max-width:62%;align-items:flex-end;text-align:right}
      .exception-list{justify-content:flex-end;max-width:100%}
      .duration-pill{font-size:10px}
      table{min-width:0!important}
    }
    body.mobile-ui .actions .refresh-meta{grid-column:1/-1;display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:0;padding:0 2px}
    body.mobile-ui .refresh-label{display:inline!important;font-size:10px!important}
    body.mobile-ui .live-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px}
    body.mobile-ui .stat-hint{display:none}
    body.mobile-ui tbody td .cell-stack{max-width:61%;align-items:flex-end;text-align:right}
    body.mobile-ui .exception-list{justify-content:flex-end;max-width:100%}
    body.mobile-ui .movement-key{font-size:9px}


    /* =======================================================
       v1.6.20 ORIGIN NOTE LABEL
       Larger typography and touch targets, clearer mobile cards,
       easier forms, and pinch zoom support (viewport above).
       ======================================================= */
    body.mobile-ui{
      font-size:16px;
      line-height:1.45;
      -webkit-text-size-adjust:100%;
    }
    body.mobile-ui .topbar-inner{padding:12px 12px;padding-top:calc(12px + env(safe-area-inset-top));gap:11px}
    body.mobile-ui .brand{gap:10px}
    body.mobile-ui .brand h1{font-size:20px;line-height:1.2}
    body.mobile-ui .brand-subtitle,body.mobile-ui .brand div{font-size:11.5px;line-height:1.35}
    body.mobile-ui .brand-icon{flex-basis:40px;width:40px;height:40px}
    body.mobile-ui .brand-icon svg{width:40px;height:40px}
    body.mobile-ui .container{padding:12px}

    body.mobile-ui .actions{gap:9px}
    body.mobile-ui .actions .btn{min-height:48px;font-size:14px;padding:10px 12px}
    body.mobile-ui .refresh-label{font-size:11.5px!important}

    body.mobile-ui .tabs{gap:5px;padding:5px;margin-bottom:12px;scroll-snap-type:x proximity}
    body.mobile-ui .tab{
      min-height:48px;padding:11px 14px;font-size:14px;border-radius:9px;
      scroll-snap-align:start;touch-action:manipulation
    }

    body.mobile-ui .live-summary,
    body.mobile-ui .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px;margin-bottom:12px}
    body.mobile-ui .stat{padding:13px 11px;border-radius:13px}
    body.mobile-ui .stat-label{font-size:11.5px;line-height:1.3;min-height:0;margin-bottom:5px}
    body.mobile-ui .stat-value{font-size:27px;line-height:1.1}

    body.mobile-ui input,
    body.mobile-ui select{
      min-height:52px;height:52px;font-size:16px;padding:0 14px;border-radius:10px
    }
    body.mobile-ui textarea{
      min-height:112px;font-size:16px;line-height:1.5;padding:12px 14px;border-radius:10px
    }
    body.mobile-ui label{font-size:13.5px;line-height:1.3}
    body.mobile-ui .field{gap:7px}
    body.mobile-ui .filter-input-wrap input{padding-right:48px}
    body.mobile-ui .filter-clear{
      width:34px;height:34px;right:8px;font-size:21px;touch-action:manipulation
    }
    body.mobile-ui .search{font-size:16px}
    body.mobile-ui .history-controls{padding:12px;border-radius:14px;margin-bottom:12px}
    body.mobile-ui .filter-grid{gap:11px}

    body.mobile-ui .btn{min-height:48px;font-size:14.5px;padding:10px 14px;border-radius:10px;touch-action:manipulation}
    body.mobile-ui .btn-sm{min-height:46px;font-size:14px;padding:9px 12px}
    body.mobile-ui .close{width:44px;height:44px;min-width:44px;min-height:44px;font-size:24px;border-radius:10px}

    body.mobile-ui tbody tr{
      margin:0 0 12px!important;border-radius:14px!important;
      box-shadow:0 4px 14px rgba(16,24,40,.06)!important
    }
    body.mobile-ui tbody td{
      gap:14px!important;padding:12px 13px!important;font-size:14.5px!important;
      line-height:1.45!important;min-height:44px;align-items:center!important
    }
    body.mobile-ui tbody td::before{
      flex:0 0 36%;max-width:36%;font-size:11px;line-height:1.35;letter-spacing:.015em
    }
    body.mobile-ui tbody td > *{max-width:64%}
    body.mobile-ui tbody td .cell-stack{max-width:64%;gap:3px}
    body.mobile-ui tbody td .secondary{font-size:12.5px;line-height:1.4;margin-top:4px}
    body.mobile-ui .movement-line{font-size:14.5px;line-height:1.5}
    body.mobile-ui .movement-key{font-size:10.5px}
    body.mobile-ui .status{font-size:12px;padding:6px 10px}
    body.mobile-ui .duration-pill{font-size:11.5px;padding:5px 8px}
    body.mobile-ui .exception-badge{font-size:10.5px;padding:4px 7px}
    body.mobile-ui .driver-arrival-alert{
      width:100%;max-width:none;min-width:0;margin-top:8px;padding:10px 11px;
      border-width:2px;border-radius:11px;align-items:flex-end;text-align:right
    }
    body.mobile-ui .driver-arrival-alert-title{font-size:13px}
    body.mobile-ui .driver-arrival-alert-time{font-size:11.5px}
    body.mobile-ui .driver-arrival-row{
      background:#f5fbff!important;border-color:#84caff!important;
      box-shadow:0 4px 16px rgba(46,144,250,.12)!important
    }
    body.mobile-ui .driver-arrival-row td:first-child{box-shadow:inset 4px 0 0 #2e90fa}
    body.mobile-ui tbody td:last-child{padding:12px 13px!important}
    body.mobile-ui tbody td:last-child .btn{min-height:50px;font-size:14.5px}

    body.mobile-ui .trip-row-actions{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:9px}
    body.mobile-ui .trip-row-actions .btn{
      min-height:50px;font-size:13.5px!important;padding:9px 8px!important
    }
    body.mobile-ui .trip-row-actions .instructions-slot-placeholder{height:50px}

    body.mobile-ui .modal-header{padding:15px 14px;padding-top:calc(15px + env(safe-area-inset-top))}
    body.mobile-ui .modal-title{font-size:21px;line-height:1.25}
    body.mobile-ui .modal-sub{font-size:13px;line-height:1.4}
    body.mobile-ui .modal-body{padding:14px}
    body.mobile-ui .modal-footer{padding:11px 12px;padding-bottom:calc(11px + env(safe-area-inset-bottom));gap:9px}
    body.mobile-ui .modal-footer .btn{min-height:52px;font-size:15px}
    body.mobile-ui .form-grid,body.mobile-ui .summary-grid{gap:10px}
    body.mobile-ui .summary-item{padding:12px;border-radius:11px}
    body.mobile-ui .summary-label{font-size:12.5px;line-height:1.35}
    body.mobile-ui .summary-value{font-size:14.5px;line-height:1.45;margin-top:5px}
    body.mobile-ui .notice{font-size:14px;line-height:1.5;padding:12px 13px}
    body.mobile-ui .notice.checking{padding:14px 15px}
    body.mobile-ui .notice-checking-title{font-size:15px}
    body.mobile-ui .notice-checking-sub{font-size:13px;margin-top:4px}
    body.mobile-ui .notice-checking-spinner{width:22px;height:22px;flex-basis:22px}
    body.mobile-ui .action-box{padding:14px;border-radius:13px;margin-top:14px}
    body.mobile-ui .dispatch-details-panel{padding:14px;border-radius:12px;margin:-1px -1px 14px}
    body.mobile-ui .action-box h3{font-size:17px;line-height:1.3}
    body.mobile-ui .stage-bridge-card{padding:16px;border-radius:13px;margin-top:14px}
    body.mobile-ui .stage-bridge-status{font-size:15px}
    body.mobile-ui .stage-bridge-question{font-size:19px;margin-top:15px}
    body.mobile-ui .stage-bridge-sub{font-size:12.5px}
    body.mobile-ui .stage-bridge-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;width:100%}
    body.mobile-ui .stage-bridge-actions .btn{width:100%;min-width:0;min-height:50px;font-size:14px}
    body.mobile-ui .action-box > .btn{min-height:52px;font-size:15px}
    body.mobile-ui .checkbox{font-size:14.5px;line-height:1.4;gap:10px}
    body.mobile-ui .checkbox input{width:20px;height:20px;min-height:20px;flex:0 0 20px}
    body.mobile-ui .manual-time-box,body.mobile-ui .manual-time-field{padding:13px;border-radius:11px}
    body.mobile-ui .manual-time-hint{font-size:12px;line-height:1.45}
    body.mobile-ui .manual-action-row{display:grid;grid-template-columns:1fr;gap:9px;width:100%}
    body.mobile-ui .manual-action-row .btn,
    body.mobile-ui .manual-action-row .btn-main{width:100%;min-width:0;min-height:50px;font-size:14px}
    body.mobile-ui .action-inline-notice{width:100%;max-width:none;min-height:auto;padding:10px 12px;font-size:12px}

    body.mobile-ui .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
    body.mobile-ui .kpi-card{padding:14px;border-radius:13px}
    body.mobile-ui .kpi-label{font-size:12.5px;line-height:1.35}
    body.mobile-ui .kpi-value{font-size:25px}
    body.mobile-ui .kpi-sub{font-size:12px;line-height:1.4}
    body.mobile-ui .kpi-breakdown{padding:14px;border-radius:13px}
    body.mobile-ui .kpi-breakdown-title{font-size:16px}
    body.mobile-ui .kpi-breakdown-note{font-size:12px;line-height:1.4}
    body.mobile-ui .kpi-breakdown-total{font-size:13px}
    body.mobile-ui .kpi-city-row{padding:12px;border-radius:11px}
    body.mobile-ui .kpi-city-name{font-size:14px}
    body.mobile-ui .kpi-city-count{font-size:19px}

    body.mobile-ui .manager-menu{gap:8px;padding:9px}
    body.mobile-ui .manager-menu button{min-height:48px;font-size:14px;padding:10px 13px}
    body.mobile-ui .manager-head{padding:12px 13px;gap:10px}
    body.mobile-ui .manager-filter{gap:11px;padding:12px}
    body.mobile-ui .master-editor{gap:10px;padding:12px}
    body.mobile-ui .leg-card{padding:13px;border-radius:13px}
    body.mobile-ui .leg-card .btn{min-height:48px;font-size:14px}
    body.mobile-ui .audit-row{font-size:13.5px;line-height:1.5;padding:11px 12px}

    body.mobile-ui .toast{font-size:14px;line-height:1.45;padding:13px 14px;border-radius:11px}
    body.mobile-ui .loader{font-size:15px;line-height:1.45;padding:18px 20px}
    body.mobile-ui .app-footer{font-size:12px;line-height:1.4;padding-bottom:calc(20px + env(safe-area-inset-bottom))}

    @media(max-width:390px){
      body.mobile-ui .trip-row-actions{grid-template-columns:1fr}
      body.mobile-ui .trip-row-actions .instructions-slot-placeholder{display:none}
      body.mobile-ui .kpi-grid{grid-template-columns:1fr}
      body.mobile-ui .kpi-card:nth-child(5){grid-column:auto}
      body.mobile-ui tbody td::before{flex-basis:38%;max-width:38%}
      body.mobile-ui tbody td > *,body.mobile-ui tbody td .cell-stack{max-width:62%}
    }



    /* DUAL KPI TRUCK VISUALS - Trip level + Leg level */
    .kpi-truck-duo{
      display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
      margin-bottom:12px;
    }
    .kpi-truck-card{
      padding:16px 18px;overflow:hidden;position:relative;min-width:0;
      border-color:#ded3f6;background:linear-gradient(135deg,#fff 0%,#fbf9ff 58%,#f4efff 100%);
    }
    .kpi-truck-card.leg-level{
      border-color:#c9def8;background:linear-gradient(135deg,#fff 0%,#f8fbff 58%,#eef6ff 100%);
    }
    .kpi-truck-card::after{
      content:"";position:absolute;width:190px;height:190px;border-radius:50%;
      right:-78px;top:-112px;background:rgba(105,65,198,.055);pointer-events:none;
    }
    .kpi-truck-card.leg-level::after{background:rgba(46,144,250,.055)}
    .kpi-truck-copy{position:relative;z-index:1;min-width:0}
    .kpi-truck-top{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end}
    .kpi-truck-eyebrow{font-size:10px;letter-spacing:.12em;font-weight:800;color:var(--primary);text-transform:uppercase;margin-bottom:5px}
    .leg-level .kpi-truck-eyebrow{color:#175cd3}
    .kpi-truck-title{font-size:17px;font-weight:800;line-height:1.2}
    .kpi-truck-note{font-size:10.5px;color:var(--muted);line-height:1.42;margin-top:4px;max-width:390px}
    .kpi-truck-rate-row{display:flex;align-items:flex-end;gap:7px;justify-self:end;white-space:nowrap}
    .kpi-truck-rate{font-size:38px;line-height:.95;font-weight:900;letter-spacing:-.04em;color:var(--primary)}
    .leg-level .kpi-truck-rate{color:#175cd3}
    .kpi-truck-rate-label{font-size:9.5px;font-weight:700;color:#667085;padding-bottom:4px}
    .kpi-truck-stats{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
    .kpi-truck-chip{display:inline-flex;align-items:center;gap:4px;border:1px solid #e4dcf6;background:#fff;padding:5px 7px;border-radius:999px;font-size:9.8px;color:#475467;white-space:nowrap}
    .leg-level .kpi-truck-chip{border-color:#d1e4fa}
    .kpi-truck-chip strong{font-size:11px;color:var(--text)}
    .kpi-truck-chip.positive strong{color:var(--success)}
    .kpi-truck-visual{position:relative;z-index:1;min-width:0;margin-top:6px}
    .kpi-truck-svg{display:block;width:100%;height:auto;max-height:190px;overflow:visible}
    .kpi-truck-fill{transform-box:fill-box;transform-origin:left center;transform:scaleX(0);transition:transform .72s cubic-bezier(.2,.8,.2,1)}
    .kpi-truck-wheel{transform-box:fill-box;transform-origin:center}
    .kpi-truck-card.kpi-truck-energized .kpi-truck-wheel{animation:kpiWheelNudge .72s ease-out}
    @keyframes kpiWheelNudge{0%{transform:rotate(0deg)}100%{transform:rotate(35deg)}}
    .kpi-truck-scope{margin-top:7px;font-size:9.5px;color:#7f56d9;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
    .leg-level .kpi-truck-scope{color:#175cd3}

    @media(max-width:980px){
      .kpi-truck-duo{grid-template-columns:1fr}
      .kpi-truck-svg{max-height:215px}
    }
    body.mobile-ui .kpi-truck-duo{gap:10px;margin-bottom:10px}
    body.mobile-ui .kpi-truck-card{padding:14px;border-radius:13px}
    body.mobile-ui .kpi-truck-title{font-size:16.5px}
    body.mobile-ui .kpi-truck-note{font-size:11px}
    body.mobile-ui .kpi-truck-rate{font-size:34px}
    body.mobile-ui .kpi-truck-chip{font-size:10px;padding:5px 7px}
    body.mobile-ui .kpi-truck-svg{max-height:205px}
    @media(max-width:560px){
      .kpi-truck-top{display:block}
      .kpi-truck-rate-row{justify-content:flex-start;margin-top:10px}
      .kpi-truck-scope{white-space:normal}
    }

    /* BACKLOAD PERFORMANCE BY REGION */
    .kpi-region-card{
      margin-bottom:12px;padding:18px 20px;border-color:#e4e7ec;
      background:linear-gradient(180deg,#fff 0%,#fcfcfd 100%);
    }
    .kpi-region-head{
      display:flex;align-items:flex-start;justify-content:space-between;
      gap:16px;margin-bottom:14px;
    }
    .kpi-region-title{font-size:17px;font-weight:800;line-height:1.2}
    .kpi-region-note{font-size:10.5px;color:var(--muted);line-height:1.45;margin-top:4px}
    .kpi-region-legend{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
    .kpi-region-legend-item{
      display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:700;
      color:#475467;white-space:nowrap;
    }
    .kpi-region-dot{width:9px;height:9px;border-radius:999px;display:inline-block}
    .kpi-region-dot.trip{background:#6941c6}
    .kpi-region-dot.leg{background:#2e90fa}
    .kpi-region-list{display:grid;gap:10px}
    .kpi-region-row{
      border:1px solid #eaecf0;border-radius:13px;padding:12px 13px;background:#fff;
      transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
    }
    .kpi-region-row:hover{transform:translateY(-1px);border-color:#d0d5dd;box-shadow:0 4px 14px rgba(16,24,40,.05)}
    .kpi-region-row-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px}
    .kpi-region-name{font-size:12px;font-weight:850;letter-spacing:.02em;color:#101828}
    .kpi-region-top{
      display:inline-flex;align-items:center;gap:4px;border:1px solid #e9d7fe;background:#f9f5ff;
      color:#6941c6;padding:4px 7px;border-radius:999px;font-size:9px;font-weight:800;white-space:nowrap;
    }
    .kpi-region-metrics{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px}
    .kpi-region-metric{min-width:0}
    .kpi-region-metric-head{
      display:grid;grid-template-columns:70px minmax(0,1fr) auto;gap:9px;align-items:center;
    }
    .kpi-region-metric-label{font-size:10px;font-weight:800;color:#475467}
    .kpi-region-track{height:10px;border-radius:999px;background:#f2f4f7;overflow:hidden}
    .kpi-region-fill{height:100%;width:0;border-radius:inherit;transition:width .72s cubic-bezier(.2,.8,.2,1)}
    .kpi-region-fill.trip{background:linear-gradient(90deg,#9e77ed,#6941c6)}
    .kpi-region-fill.leg{background:linear-gradient(90deg,#84caff,#2e90fa)}
    .kpi-region-rate{font-size:13px;font-weight:900;min-width:44px;text-align:right;color:#101828}
    .kpi-region-detail{font-size:9.5px;color:#667085;margin-top:4px;padding-left:79px}
    .kpi-region-empty{padding:22px 12px;text-align:center;color:#667085;font-size:11px}
    .kpi-region-scope{margin-top:11px;font-size:9.5px;color:#667085;font-weight:650}
    body.mobile-ui .kpi-region-card{padding:14px;border-radius:13px;margin-bottom:10px}
    body.mobile-ui .kpi-region-row{padding:11px 12px}
    body.mobile-ui .kpi-region-title{font-size:16.5px}
    body.mobile-ui .kpi-region-note{font-size:11px}
    @media(max-width:760px){
      .kpi-region-head{display:block}
      .kpi-region-legend{justify-content:flex-start;margin-top:9px}
      .kpi-region-metrics{grid-template-columns:1fr}
      .kpi-region-metric-head{grid-template-columns:68px minmax(0,1fr) auto}
      .kpi-region-detail{padding-left:77px}
    }
    @media(max-width:430px){
      .kpi-region-metric-head{grid-template-columns:62px minmax(0,1fr) auto;gap:7px}
      .kpi-region-detail{padding-left:69px}
      .kpi-region-rate{font-size:12px;min-width:40px}
    }

  

    /* v1.6.x - clearer mobile form fields */
    @media(max-width:900px){
      input:not([type="checkbox"]):not([type="radio"]),
      select,
      textarea{
        border:1.5px solid #9fb6c9;
        background:#f7fafc;
        box-shadow:0 0 0 1px rgba(159,182,201,.10);
      }
      input:not([type="checkbox"]):not([type="radio"]):focus,
      select:focus,
      textarea:focus{
        border-color:#7aa2c2;
        background:#ffffff;
        box-shadow:0 0 0 3px rgba(122,162,194,.16);
      }
    }

    body.mobile-ui input:not([type="checkbox"]):not([type="radio"]),
    body.mobile-ui select,
    body.mobile-ui textarea{
      border:1.5px solid #9fb6c9;
      background:#f7fafc;
      box-shadow:0 0 0 1px rgba(159,182,201,.10);
    }
    body.mobile-ui input:not([type="checkbox"]):not([type="radio"]):focus,
    body.mobile-ui select:focus,
    body.mobile-ui textarea:focus{
      border-color:#7aa2c2;
      background:#ffffff;
      box-shadow:0 0 0 3px rgba(122,162,194,.16);
    }


    /* v1.6.60 - driver arrival self-service controls */
    .driver-arrival-card{margin:12px 0 14px;padding:14px;border:1px solid #b2ddff;border-radius:12px;background:#f5fbff}
    .driver-arrival-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
    .driver-arrival-title{font-size:14px;font-weight:800;color:#1849a9;line-height:1.35}
    .driver-arrival-sub{font-size:11px;color:#475467;line-height:1.45;margin-top:4px}
    .driver-arrival-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
    .driver-arrival-result{margin-top:10px;font-size:11px;color:#344054;line-height:1.45}
    .driver-arrival-result .btn{margin-top:8px;margin-right:6px}
    @media(max-width:900px){
      .driver-arrival-card{padding:13px}
      .driver-arrival-head{display:block}
      .driver-arrival-actions{display:grid;grid-template-columns:1fr}
      .driver-arrival-actions .btn,.driver-arrival-result .btn{width:100%;margin-right:0}
    }
    body.mobile-ui .driver-arrival-card{padding:13px}
    body.mobile-ui .driver-arrival-head{display:block}
    body.mobile-ui .driver-arrival-actions{display:grid;grid-template-columns:1fr}
    body.mobile-ui .driver-arrival-actions .btn,
    body.mobile-ui .driver-arrival-result .btn{width:100%;margin-right:0}



    /* v3.7 - Driver Arrival Link: presentation-only safety patch.
       renderActiveTrips(), loadDashboard() and loadBootstrap() remain untouched. */
    /* Driver Arrival button - restored to the previous light outlined design. */
    .trip-row-actions .driver-link-btn{
      background:#fff!important;
      border:1px solid #b2ddff!important;
      color:#4f46c6!important;
      box-shadow:0 1px 2px rgba(16,24,40,.05);
      font-size:0!important;
      display:inline-flex!important;
      align-items:center!important;
      justify-content:center!important;
      gap:7px!important;
    }
    .trip-row-actions .driver-link-btn::before{
      content:"";
      display:inline-block;
      width:16px;
      height:16px;
      flex:0 0 16px;
      background-repeat:no-repeat;
      background-position:center;
      background-size:16px 16px;
      background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='15' fill='%2325D366'/%3E%3Cpath fill='white' d='M23.4 8.7A10.2 10.2 0 0 0 7.3 21l-1.4 5.1 5.2-1.4a10.2 10.2 0 0 0 12.3-16zm-7.2 15.2c-1.6 0-3.1-.4-4.4-1.2l-.3-.2-3.1.8.8-3-.2-.3a8 8 0 1 1 7.2 3.9zm4.4-6c-.2-.1-1.4-.7-1.6-.8-.2-.1-.4-.1-.6.1-.2.2-.6.8-.8 1-.1.2-.3.2-.5.1-1.3-.6-2.2-1.2-3.1-2.3-.2-.2 0-.4.1-.5l.4-.5c.1-.2.2-.3.3-.5.1-.2 0-.4 0-.5-.1-.1-.6-1.5-.9-2-.2-.5-.5-.5-.6-.5h-.5c-.2 0-.5.1-.7.3-.2.2-1 1-1 2.4s1 2.8 1.2 3c.1.2 2 3.1 4.9 4.3.7.3 1.2.5 1.6.6.7.2 1.3.2 1.8.1.6-.1 1.4-.6 1.6-1.1.2-.6.2-1 .1-1.1-.1-.1-.3-.2-.5-.3z'/%3E%3C/svg%3E");
    }
    .trip-row-actions .driver-link-btn::after{
      content:"Driver Arrival Link";
      font-size:13px;
      line-height:1.2;
      white-space:nowrap;
    }
    .trip-row-actions .driver-link-btn:hover{
      background:#f7f9ff!important;
      border-color:#84caff!important;
      color:#4338ca!important;
    }
    .trip-row-actions .driver-link-btn:focus{
      box-shadow:0 0 0 3px rgba(79,70,198,.12)!important;
    }
    .trip-row-actions .driver-link-btn:disabled::after{content:"Preparing..."}

    /* Once the driver has reported arrival, the row already has driver-arrival-row.
       Hide only the quick-link button; do not change trip rendering logic. */
    .driver-arrival-row .trip-row-actions{
      grid-template-columns:164px 116px;
      min-width:289px;
    }
    .driver-arrival-row .trip-row-actions .driver-link-btn{display:none!important}
    .driver-arrival-row .trip-row-actions .update-trip-btn{grid-column:2}

    /* v3.8 - dedicated Driver Arrival share modal */
    .driver-share-modal .driver-share-route{padding:12px 13px;border:1px solid #d6e4ef;border-radius:10px;background:#f7fafc;font-size:13px;font-weight:800}
    .driver-share-modal .driver-share-status{margin-top:12px;padding:11px 12px;border:1px solid var(--border);border-radius:10px;background:#fcfcfd;font-size:12px;line-height:1.45}
    .driver-share-modal .driver-share-status.preparing{position:relative;padding:14px 14px 14px 46px;border-color:#b2ddff;background:#eff8ff;color:#175cd3;font-size:13px;font-weight:800;min-height:48px;display:flex;align-items:center}
    .driver-share-modal .driver-share-status.preparing::before{content:"";position:absolute;left:15px;top:50%;width:19px;height:19px;margin-top:-10px;border:2.5px solid rgba(23,92,211,.20);border-top-color:#175cd3;border-radius:50%;animation:tripStatusSpin .8s linear infinite}
    .driver-share-modal .driver-share-status.ready{border-color:#abefc6;background:#f6fef9;color:#067647}
    .driver-share-modal .driver-share-status.error{border-color:#fda29b;background:#fef3f2;color:#b42318}
    .driver-share-modal .driver-share-message{margin-top:12px;padding:12px;border:1px solid #d0d5dd;border-radius:10px;background:#f8fafc;white-space:pre-wrap;word-break:break-word;font-size:12px;line-height:1.55;color:#344054}
    .driver-share-modal .driver-share-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:14px}
    .driver-share-modal .driver-share-actions .btn{width:100%;min-height:44px}
    .driver-share-modal .driver-share-whatsapp{background:#20b96b!important;border:1px solid #159957!important;color:#fff!important;text-decoration:none;display:flex;align-items:center;justify-content:center;font-weight:800;border-radius:8px;padding:9px 13px}
    .driver-share-modal .driver-share-whatsapp:hover{background:#159957!important}
    .driver-share-modal .driver-share-whatsapp.disabled{opacity:.5;pointer-events:none}
    @media(max-width:700px){.driver-share-modal .driver-share-actions{grid-template-columns:1fr}}
    body.mobile-ui .driver-share-modal .driver-share-actions{grid-template-columns:1fr}

    @media(max-width:900px){
      .trip-row-actions .driver-link-btn::before{font-size:clamp(11px,3.1vw,13px)}
      .driver-arrival-row .trip-row-actions{grid-template-columns:1fr;min-width:0}
      .driver-arrival-row .trip-row-actions .update-trip-btn{grid-column:1}
    }
    body.mobile-ui .trip-row-actions .driver-link-btn::before{font-size:clamp(11px,3.1vw,13px)}
    body.mobile-ui .driver-arrival-row .trip-row-actions{grid-template-columns:1fr;min-width:0}
    body.mobile-ui .driver-arrival-row .trip-row-actions .update-trip-btn{grid-column:1}



    /* =======================================================
       v3.9.1 SAFE ACTION ALIGNMENT
       CSS ONLY — no trip loading/rendering JavaScript changed.
       ======================================================= */
    @media(min-width:901px){
      .trip-row-actions{
        display:flex!important;
        align-items:center!important;
        justify-content:flex-start!important;
        flex-wrap:nowrap!important;
        gap:9px!important;
        min-width:0!important;
        width:max-content!important;
      }
      .trip-row-actions .instructions-slot-placeholder,
      .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]{
        display:none!important;
      }
      .trip-row-actions .instructions-btn{
        flex:0 0 164px!important;
        width:164px!important;
      }
      .trip-row-actions .driver-link-btn{
        flex:0 0 152px!important;
        width:152px!important;
      }
      .trip-row-actions .update-trip-btn{
        flex:0 0 116px!important;
        width:116px!important;
      }
      .driver-arrival-row .trip-row-actions{
        display:flex!important;
        min-width:0!important;
        width:max-content!important;
      }
      .driver-arrival-row .trip-row-actions .driver-link-btn{
        display:none!important;
      }
    }

    @media(max-width:900px){
      .trip-row-actions,
      body.mobile-ui .trip-row-actions{
        display:grid!important;
        grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
        align-items:stretch!important;
        gap:8px!important;
        width:100%!important;
        min-width:0!important;
      }
      .trip-row-actions .instructions-slot-placeholder,
      body.mobile-ui .trip-row-actions .instructions-slot-placeholder{
        display:none!important;
      }
      .trip-row-actions .instructions-btn,
      body.mobile-ui .trip-row-actions .instructions-btn{
        grid-column:1/-1!important;
        width:100%!important;
      }
      .trip-row-actions .driver-link-btn,
      body.mobile-ui .trip-row-actions .driver-link-btn{
        grid-column:1!important;
        width:100%!important;
      }
      .trip-row-actions .update-trip-btn,
      body.mobile-ui .trip-row-actions .update-trip-btn{
        grid-column:2!important;
        width:100%!important;
      }
      .driver-arrival-row .trip-row-actions,
      body.mobile-ui .driver-arrival-row .trip-row-actions{
        grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
      }
      .driver-arrival-row .trip-row-actions .driver-link-btn,
      body.mobile-ui .driver-arrival-row .trip-row-actions .driver-link-btn{
        display:none!important;
      }
      .driver-arrival-row .trip-row-actions .instructions-btn,
      body.mobile-ui .driver-arrival-row .trip-row-actions .instructions-btn{
        grid-column:1!important;
      }
      .driver-arrival-row .trip-row-actions .update-trip-btn,
      body.mobile-ui .driver-arrival-row .trip-row-actions .update-trip-btn{
        grid-column:2!important;
      }
      .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]{
        display:none!important;
      }
      .trip-row-actions > .driver-link-btn[style*="visibility:hidden"] + .update-trip-btn{
        grid-column:1/-1!important;
      }
    }

    @media(max-width:390px){
      .trip-row-actions,
      body.mobile-ui .trip-row-actions{
        grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
      }
      .driver-arrival-row .trip-row-actions,
      body.mobile-ui .driver-arrival-row .trip-row-actions{
        grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
      }
    }


    /* =======================================================
       v3.9.2 VERTICAL ACTION STACK — CSS ONLY
       Keeps all trip-loading/rendering JavaScript unchanged.
       Order: Update Trip > Driver Arrival Link > Origin Note.
       Missing/unavailable actions remain visible in muted gray.
       ======================================================= */
    .trip-row-actions,
    body.mobile-ui .trip-row-actions{
      display:flex!important;
      flex-direction:column!important;
      align-items:stretch!important;
      justify-content:flex-start!important;
      flex-wrap:nowrap!important;
      gap:8px!important;
      width:200px!important;
      min-width:200px!important;
      max-width:200px!important;
    }

    .trip-row-actions .update-trip-btn,
    body.mobile-ui .trip-row-actions .update-trip-btn{
      order:1!important;
      width:100%!important;
      min-width:0!important;
      min-height:42px!important;
      grid-column:auto!important;
    }

    .trip-row-actions .driver-link-btn,
    body.mobile-ui .trip-row-actions .driver-link-btn{
      order:2!important;
      width:100%!important;
      min-width:0!important;
      min-height:42px!important;
      grid-column:auto!important;
      flex:0 0 auto!important;
    }

    .trip-row-actions .instructions-btn,
    body.mobile-ui .trip-row-actions .instructions-btn,
    .trip-row-actions .instructions-slot-placeholder,
    body.mobile-ui .trip-row-actions .instructions-slot-placeholder{
      order:3!important;
      width:100%!important;
      min-width:0!important;
      min-height:42px!important;
      grid-column:auto!important;
    }

    /* No origin note: keep a disabled-looking Origin Note button in place. */
    .trip-row-actions .instructions-slot-placeholder,
    body.mobile-ui .trip-row-actions .instructions-slot-placeholder{
      display:flex!important;
      visibility:visible!important;
      align-items:center!important;
      justify-content:center!important;
      height:42px!important;
      padding:8px 11px!important;
      border:1px solid #d0d5dd!important;
      border-radius:8px!important;
      background:#f2f4f7!important;
      color:#98a2b3!important;
      box-shadow:none!important;
      pointer-events:none!important;
      cursor:not-allowed!important;
      font-size:0!important;
      box-sizing:border-box!important;
    }
    .trip-row-actions .instructions-slot-placeholder::before,
    body.mobile-ui .trip-row-actions .instructions-slot-placeholder::before{
      content:"📌 Origin Note";
      font-size:13px;
      font-weight:700;
      line-height:1.2;
      white-space:nowrap;
      opacity:.72;
    }

    /* Driver link unavailable (not in transit): convert its placeholder into a muted button. */
    .trip-row-actions > .driver-link-btn[style*="visibility:hidden"],
    body.mobile-ui .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]{
      display:inline-flex!important;
      visibility:visible!important;
      align-items:center!important;
      justify-content:center!important;
      background:#f2f4f7!important;
      border-color:#d0d5dd!important;
      color:#98a2b3!important;
      box-shadow:none!important;
      pointer-events:none!important;
      cursor:not-allowed!important;
      opacity:1!important;
    }
    .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]::before,
    body.mobile-ui .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]::before{
      filter:grayscale(1)!important;
      opacity:.35!important;
    }
    .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]::after,
    body.mobile-ui .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]::after{
      color:#98a2b3!important;
      opacity:.78!important;
    }

    /* Driver has already reported arrival: keep the button visible but inactive-looking. */
    .driver-arrival-row .trip-row-actions .driver-link-btn,
    body.mobile-ui .driver-arrival-row .trip-row-actions .driver-link-btn{
      display:inline-flex!important;
      visibility:visible!important;
      background:#f2f4f7!important;
      border-color:#d0d5dd!important;
      color:#98a2b3!important;
      box-shadow:none!important;
      pointer-events:none!important;
      cursor:not-allowed!important;
      opacity:1!important;
    }
    .driver-arrival-row .trip-row-actions .driver-link-btn::before,
    body.mobile-ui .driver-arrival-row .trip-row-actions .driver-link-btn::before{
      filter:grayscale(1)!important;
      opacity:.35!important;
    }
    .driver-arrival-row .trip-row-actions .driver-link-btn::after,
    body.mobile-ui .driver-arrival-row .trip-row-actions .driver-link-btn::after{
      color:#98a2b3!important;
      opacity:.78!important;
    }

    @media(max-width:900px){
      .trip-row-actions,
      body.mobile-ui .trip-row-actions{
        width:100%!important;
        min-width:0!important;
        max-width:none!important;
        gap:9px!important;
      }
      .trip-row-actions .update-trip-btn,
      .trip-row-actions .driver-link-btn,
      .trip-row-actions .instructions-btn,
      .trip-row-actions .instructions-slot-placeholder,
      body.mobile-ui .trip-row-actions .update-trip-btn,
      body.mobile-ui .trip-row-actions .driver-link-btn,
      body.mobile-ui .trip-row-actions .instructions-btn,
      body.mobile-ui .trip-row-actions .instructions-slot-placeholder{
        min-height:48px!important;
      }
    }



    /* =======================================================
       v3.9.3 UNIFORM ACTION BUTTON DIMENSIONS — CSS ONLY
       Final override: equal width + equal fixed height for the
       three vertical trip actions on desktop and mobile.
       ======================================================= */
    .trip-row-actions,
    body.mobile-ui .trip-row-actions{
      width:200px!important;
      min-width:200px!important;
      max-width:200px!important;
      align-items:stretch!important;
      box-sizing:border-box!important;
    }

    .trip-row-actions .update-trip-btn,
    .trip-row-actions .driver-link-btn,
    .trip-row-actions .instructions-btn,
    .trip-row-actions .instructions-slot-placeholder,
    body.mobile-ui .trip-row-actions .update-trip-btn,
    body.mobile-ui .trip-row-actions .driver-link-btn,
    body.mobile-ui .trip-row-actions .instructions-btn,
    body.mobile-ui .trip-row-actions .instructions-slot-placeholder{
      width:100%!important;
      min-width:100%!important;
      max-width:100%!important;
      height:48px!important;
      min-height:48px!important;
      max-height:48px!important;
      flex:0 0 48px!important;
      margin:0!important;
      padding:0 12px!important;
      box-sizing:border-box!important;
      align-items:center!important;
      justify-content:center!important;
      line-height:1.2!important;
      white-space:nowrap!important;
      overflow:hidden!important;
      text-overflow:ellipsis!important;
      vertical-align:middle!important;
    }

    .trip-row-actions .update-trip-btn,
    .trip-row-actions .driver-link-btn,
    .trip-row-actions .instructions-btn,
    body.mobile-ui .trip-row-actions .update-trip-btn,
    body.mobile-ui .trip-row-actions .driver-link-btn,
    body.mobile-ui .trip-row-actions .instructions-btn{
      display:flex!important;
    }

    .trip-row-actions .instructions-slot-placeholder,
    body.mobile-ui .trip-row-actions .instructions-slot-placeholder{
      display:flex!important;
    }

    @media(max-width:900px){
      .trip-row-actions,
      body.mobile-ui .trip-row-actions{
        width:100%!important;
        min-width:0!important;
        max-width:none!important;
      }
      .trip-row-actions .update-trip-btn,
      .trip-row-actions .driver-link-btn,
      .trip-row-actions .instructions-btn,
      .trip-row-actions .instructions-slot-placeholder,
      body.mobile-ui .trip-row-actions .update-trip-btn,
      body.mobile-ui .trip-row-actions .driver-link-btn,
      body.mobile-ui .trip-row-actions .instructions-btn,
      body.mobile-ui .trip-row-actions .instructions-slot-placeholder{
        width:100%!important;
        min-width:100%!important;
        max-width:100%!important;
        height:50px!important;
        min-height:50px!important;
        max-height:50px!important;
        flex-basis:50px!important;
      }
    }


    /* =======================================================
       v3.9.4 UNIFORM ACTION STACK WIDTH — CSS ONLY
       Fixed visual width across all mobile trip cards.
       ======================================================= */
    @media(max-width:900px){
      .trip-row-actions,
      body.mobile-ui .trip-row-actions{
        width:230px!important;
        min-width:230px!important;
        max-width:230px!important;
        margin-left:auto!important;
        margin-right:0!important;
        align-self:flex-end!important;
      }
    }

    @media(max-width:390px){
      .trip-row-actions,
      body.mobile-ui .trip-row-actions{
        width:220px!important;
        min-width:220px!important;
        max-width:220px!important;
      }
    }


    /* =======================================================
       v3.9.5 FIXED ACTION COLUMN WIDTH + COMPACT HEIGHT — CSS ONLY
       Fixes the action-stack container itself so every trip uses
       exactly the same visual width, including forced mobile-ui.
       ======================================================= */
    body.mobile-ui #activeRows td:last-child{
      display:flex!important;
      justify-content:flex-end!important;
      align-items:flex-start!important;
    }
    body.mobile-ui #activeRows td:last-child > .trip-row-actions{
      width:200px!important;
      min-width:200px!important;
      max-width:200px!important;
      flex:0 0 200px!important;
      align-self:auto!important;
      margin-left:auto!important;
      margin-right:0!important;
      box-sizing:border-box!important;
    }
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .update-trip-btn,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .driver-link-btn,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .instructions-btn,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .instructions-slot-placeholder{
      width:100%!important;
      min-width:100%!important;
      max-width:100%!important;
      height:42px!important;
      min-height:42px!important;
      max-height:42px!important;
      flex:0 0 42px!important;
      padding:0 9px!important;
      margin:0!important;
      box-sizing:border-box!important;
    }

    @media(max-width:900px){
      #activeRows td:last-child{
        display:flex!important;
        justify-content:flex-end!important;
        align-items:flex-start!important;
      }
      #activeRows td:last-child > .trip-row-actions{
        width:200px!important;
        min-width:200px!important;
        max-width:200px!important;
        flex:0 0 200px!important;
        margin-left:auto!important;
        margin-right:0!important;
        box-sizing:border-box!important;
      }
      #activeRows td:last-child > .trip-row-actions .update-trip-btn,
      #activeRows td:last-child > .trip-row-actions .driver-link-btn,
      #activeRows td:last-child > .trip-row-actions .instructions-btn,
      #activeRows td:last-child > .trip-row-actions .instructions-slot-placeholder{
        width:100%!important;
        min-width:100%!important;
        max-width:100%!important;
        height:42px!important;
        min-height:42px!important;
        max-height:42px!important;
        flex:0 0 42px!important;
        padding:0 9px!important;
        margin:0!important;
        box-sizing:border-box!important;
      }
    }


    /* =======================================================
       v3.9.6 DRIVER LINK + FINAL ACTION WIDTH FIX — CSS ONLY
       except the visible quick-action label is now "Driver Link".
       ======================================================= */
    /* Use the real button text; do not generate a second label. */
    .trip-row-actions .driver-link-btn::after,
    body.mobile-ui .trip-row-actions .driver-link-btn::after{
      content:none!important;
      display:none!important;
    }
    .trip-row-actions .driver-link-btn,
    body.mobile-ui .trip-row-actions .driver-link-btn{
      font-size:13px!important;
      line-height:1.1!important;
    }

    /* Placeholder has no inner text, so give only the placeholder a label. */
    .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]::after,
    body.mobile-ui .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]::after{
      content:"Driver Link"!important;
      display:inline!important;
      font-size:13px!important;
      line-height:1.1!important;
      white-space:nowrap!important;
      color:#98a2b3!important;
    }

    /* Fix the actions TABLE CELL and the stack itself to one shared width. */
    #activeRows td:last-child{
      width:224px!important;
      min-width:224px!important;
      max-width:224px!important;
      box-sizing:border-box!important;
    }
    #activeRows td:last-child > .trip-row-actions,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions{
      width:200px!important;
      min-width:200px!important;
      max-width:200px!important;
      flex:0 0 200px!important;
      box-sizing:border-box!important;
      margin-left:auto!important;
      margin-right:auto!important;
      gap:7px!important;
    }

    #activeRows td:last-child > .trip-row-actions .update-trip-btn,
    #activeRows td:last-child > .trip-row-actions .driver-link-btn,
    #activeRows td:last-child > .trip-row-actions .instructions-btn,
    #activeRows td:last-child > .trip-row-actions .instructions-slot-placeholder,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .update-trip-btn,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .driver-link-btn,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .instructions-btn,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .instructions-slot-placeholder{
      width:200px!important;
      min-width:200px!important;
      max-width:200px!important;
      height:40px!important;
      min-height:40px!important;
      max-height:40px!important;
      flex:0 0 40px!important;
      padding:0 8px!important;
      margin:0!important;
      box-sizing:border-box!important;
      align-items:center!important;
      justify-content:center!important;
    }

    @media(max-width:900px){
      #activeRows td:last-child,
      body.mobile-ui #activeRows td:last-child{
        width:100%!important;
        min-width:100%!important;
        max-width:100%!important;
        display:flex!important;
        justify-content:flex-end!important;
        align-items:flex-start!important;
        box-sizing:border-box!important;
      }
      #activeRows td:last-child > .trip-row-actions,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions{
        width:220px!important;
        min-width:220px!important;
        max-width:220px!important;
        flex:0 0 220px!important;
        margin-left:auto!important;
        margin-right:0!important;
      }
      #activeRows td:last-child > .trip-row-actions .update-trip-btn,
      #activeRows td:last-child > .trip-row-actions .driver-link-btn,
      #activeRows td:last-child > .trip-row-actions .instructions-btn,
      #activeRows td:last-child > .trip-row-actions .instructions-slot-placeholder,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions .update-trip-btn,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions .driver-link-btn,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions .instructions-btn,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions .instructions-slot-placeholder{
        width:220px!important;
        min-width:220px!important;
        max-width:220px!important;
        height:40px!important;
        min-height:40px!important;
        max-height:40px!important;
        flex:0 0 40px!important;
      }
    }



    /* =======================================================
       v3.9.7 CONSISTENT ACTION CORNERS + MOBILE FULL WIDTH
       CSS ONLY — v3.9.6 remains the stable functional base.
       ======================================================= */
    /* Keep the three action controls visually identical in shape. */
    #activeRows .trip-row-actions .update-trip-btn,
    #activeRows .trip-row-actions .driver-link-btn,
    #activeRows .trip-row-actions .instructions-btn,
    #activeRows .trip-row-actions .instructions-slot-placeholder,
    body.mobile-ui #activeRows .trip-row-actions .update-trip-btn,
    body.mobile-ui #activeRows .trip-row-actions .driver-link-btn,
    body.mobile-ui #activeRows .trip-row-actions .instructions-btn,
    body.mobile-ui #activeRows .trip-row-actions .instructions-slot-placeholder{
      border-radius:10px!important;
      overflow:hidden!important;
    }

    /* On phones, let the action stack fill the card width instead of hugging the right edge. */
    @media(max-width:900px){
      #activeRows td:last-child,
      body.mobile-ui #activeRows td:last-child{
        width:100%!important;
        min-width:100%!important;
        max-width:100%!important;
        display:block!important;
        padding:10px 12px!important;
        box-sizing:border-box!important;
      }
      #activeRows td:last-child > .trip-row-actions,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions{
        width:100%!important;
        min-width:0!important;
        max-width:100%!important;
        flex:0 0 auto!important;
        margin:0!important;
        align-self:stretch!important;
        box-sizing:border-box!important;
      }
      #activeRows td:last-child > .trip-row-actions .update-trip-btn,
      #activeRows td:last-child > .trip-row-actions .driver-link-btn,
      #activeRows td:last-child > .trip-row-actions .instructions-btn,
      #activeRows td:last-child > .trip-row-actions .instructions-slot-placeholder,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions .update-trip-btn,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions .driver-link-btn,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions .instructions-btn,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions .instructions-slot-placeholder{
        width:100%!important;
        min-width:0!important;
        max-width:100%!important;
        border-radius:10px!important;
      }
    }

    /* Forced mobile mode can apply even when viewport width is desktop-like. */
    body.mobile-ui #activeRows td:last-child{
      width:100%!important;
      min-width:100%!important;
      max-width:100%!important;
      display:block!important;
      padding:10px 12px!important;
      box-sizing:border-box!important;
    }
    body.mobile-ui #activeRows td:last-child > .trip-row-actions{
      width:100%!important;
      min-width:0!important;
      max-width:100%!important;
      flex:0 0 auto!important;
      margin:0!important;
      align-self:stretch!important;
      box-sizing:border-box!important;
    }
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .update-trip-btn,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .driver-link-btn,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .instructions-btn,
    body.mobile-ui #activeRows td:last-child > .trip-row-actions .instructions-slot-placeholder{
      width:100%!important;
      min-width:0!important;
      max-width:100%!important;
      border-radius:10px!important;
    }


    /* =======================================================
       v3.9.9 ACTION ICON POLISH — CSS ONLY
       - Disabled Origin Note pin becomes grayscale.
       - Update Trip gets a white outline pencil SVG icon.
       Functional v3.9.7 base remains unchanged.
       ======================================================= */
    #activeRows .trip-row-actions .instructions-slot-placeholder::before,
    body.mobile-ui #activeRows .trip-row-actions .instructions-slot-placeholder::before{
      filter:grayscale(1)!important;
      opacity:.62!important;
    }

    #activeRows .trip-row-actions .update-trip-btn::before,
    body.mobile-ui #activeRows .trip-row-actions .update-trip-btn::before{
      content:"";
      display:inline-block;
      width:15px;
      height:15px;
      flex:0 0 15px;
      margin-right:7px;
      background:currentColor;
      vertical-align:-2px;
      -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
      mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
    }


    /* v5.1 - Trip Type sequence readability in Completed Trips */
    .trip-type-stack{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:130px;line-height:1.3}
    .trip-type-stack-item{font-weight:700;color:#344054;white-space:normal}
    .trip-type-stack-arrow{font-size:13px;font-weight:900;color:#9e77ed;line-height:1;text-align:center;padding-left:12px}
    body.mobile-ui .trip-type-stack{align-items:flex-end;text-align:right;min-width:0;max-width:100%}
    body.mobile-ui .trip-type-stack-arrow{padding-left:0;padding-right:12px}

    /* v5.2 - clearer Free Trip KPI summary */
    .free-trip-metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:2px 0 16px}
    .free-trip-metric{border:1px solid var(--border);border-radius:12px;background:#fcfcfd;padding:13px 14px;min-width:0}
    .free-trip-metric.primary{border-color:#abefc6;background:#f6fef9}
    .free-trip-metric-label{font-size:11px;font-weight:800;color:#475467;line-height:1.3}
    .free-trip-metric-value{font-size:26px;font-weight:800;color:#101828;margin-top:7px;line-height:1.05}
    .free-trip-metric.primary .free-trip-metric-value{color:#067647}
    .free-trip-metric-sub{font-size:10.5px;color:var(--muted);line-height:1.4;margin-top:6px}
    .free-trip-origin-title{margin-bottom:10px;font-weight:700;color:#475467}
    @media(max-width:900px){
      .free-trip-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
      .free-trip-metric{padding:12px}
      .free-trip-metric-value{font-size:23px}
      .free-trip-metric-sub{font-size:10px}
    }
    body.mobile-ui .free-trip-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    body.mobile-ui .free-trip-metric{padding:12px}
    body.mobile-ui .free-trip-metric-label{font-size:11.5px}
    body.mobile-ui .free-trip-metric-value{font-size:24px}
    body.mobile-ui .free-trip-metric-sub{font-size:10.5px}
    @media(max-width:430px){
      .free-trip-metric-grid{grid-template-columns:1fr}
    }


    /* =======================================================
       v5.5.3 TRIP NOTES + DRIVER ALERT STATUS-ONLY UI
       - Trip Notes remains a dedicated operational card.
       - Update Trip contains no note controls/content.
       - Driver Alert button is restored for IN_TRANSIT trips.
       - Driver Alert is status-only: no send/share/copy controls.
       ======================================================= */
    #activeRows .trip-row-actions,
    body.mobile-ui #activeRows .trip-row-actions{
      display:flex!important;
      flex-direction:column!important;
      align-items:stretch!important;
      justify-content:flex-start!important;
      gap:8px!important;
      width:200px!important;
      min-width:200px!important;
      max-width:200px!important;
    }
    #activeRows .trip-row-actions .update-trip-btn,
    #activeRows .trip-row-actions .driver-link-btn,
    #activeRows .trip-row-actions .instructions-btn,
    body.mobile-ui #activeRows .trip-row-actions .update-trip-btn,
    body.mobile-ui #activeRows .trip-row-actions .driver-link-btn,
    body.mobile-ui #activeRows .trip-row-actions .instructions-btn{
      width:100%!important;
      min-width:0!important;
      max-width:100%!important;
      height:42px!important;
      min-height:42px!important;
      max-height:42px!important;
      flex:0 0 42px!important;
      border-radius:10px!important;
      display:flex!important;
      align-items:center!important;
      justify-content:center!important;
      padding:0 12px!important;
      box-sizing:border-box!important;
      grid-column:auto!important;
      white-space:nowrap!important;
    }
    #activeRows .trip-row-actions .update-trip-btn,
    body.mobile-ui #activeRows .trip-row-actions .update-trip-btn{order:1!important}
    #activeRows .trip-row-actions .driver-link-btn,
    body.mobile-ui #activeRows .trip-row-actions .driver-link-btn{
      order:2!important;
      background:#eff8ff!important;
      border:1px solid #b2ddff!important;
      color:#175cd3!important;
      box-shadow:none!important;
    }
    #activeRows .trip-row-actions .driver-link-btn:hover{
      background:#dff1ff!important;
      border-color:#84caff!important;
      color:#1849a9!important;
    }
    #activeRows .trip-row-actions .instructions-btn,
    body.mobile-ui #activeRows .trip-row-actions .instructions-btn{
      order:3!important;
      background:#f4f3ff!important;
      border:1px solid #d6bbfb!important;
      color:#6941c6!important;
      box-shadow:none!important;
    }
    #activeRows .trip-row-actions .instructions-btn:hover{
      background:#ebe9fe!important;
      border-color:#b692f6!important;
      color:#53389e!important;
    }
    @media(max-width:900px){
      #activeRows td:last-child > .trip-row-actions,
      body.mobile-ui #activeRows td:last-child > .trip-row-actions{
        width:100%!important;
        min-width:0!important;
        max-width:100%!important;
      }
      #activeRows .trip-row-actions .update-trip-btn,
      #activeRows .trip-row-actions .driver-link-btn,
      #activeRows .trip-row-actions .instructions-btn,
      body.mobile-ui #activeRows .trip-row-actions .update-trip-btn,
      body.mobile-ui #activeRows .trip-row-actions .driver-link-btn,
      body.mobile-ui #activeRows .trip-row-actions .instructions-btn{
        width:100%!important;
        min-width:0!important;
        max-width:100%!important;
        height:48px!important;
        min-height:48px!important;
        max-height:48px!important;
        flex-basis:48px!important;
      }
    }

    .trip-notes-modal{width:min(760px,100%)}
    .trip-notes-trip-info{
      display:grid;
      grid-template-columns:repeat(3,minmax(0,1fr));
      gap:9px;
      margin-bottom:16px;
    }
    .trip-notes-info-item{
      min-width:0;
      padding:11px 12px;
      border:1px solid var(--border);
      border-radius:10px;
      background:#fcfcfd;
    }
    .trip-notes-info-item span{
      display:block;
      font-size:10px;
      font-weight:800;
      color:var(--muted);
      text-transform:uppercase;
      letter-spacing:.02em;
    }
    .trip-notes-info-item strong{
      display:block;
      margin-top:5px;
      font-size:12.5px;
      line-height:1.4;
      color:#344054;
      word-break:break-word;
    }
    .trip-note-log-section{
      padding:14px;
      border:1px solid #e4e7ec;
      border-radius:13px;
      background:#fff;
    }
    .trip-note-section-head{
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
      margin-bottom:11px;
    }
    .trip-note-section-title{font-size:15px;font-weight:800;color:#101828}
    .trip-note-section-sub{font-size:11px;color:var(--muted);line-height:1.4;margin-top:3px}
    .trip-note-count{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-width:30px;
      height:30px;
      padding:0 9px;
      border-radius:999px;
      background:#f4f3ff;
      color:#6941c6;
      font-size:12px;
      font-weight:900;
    }
    .trip-note-log{display:flex;flex-direction:column;gap:9px}
    .trip-note-entry{
      padding:12px 13px;
      border:1px solid #e4e7ec;
      border-radius:11px;
      background:#f9fafb;
    }
    .trip-note-entry.origin{
      border-color:#d6bbfb;
      background:#f7f5ff;
    }
    .trip-note-entry-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
    .trip-note-entry-label{font-size:11.5px;font-weight:900;color:#344054}
    .trip-note-entry.origin .trip-note-entry-label{color:#6941c6}
    .trip-note-entry-no{font-size:10px;font-weight:800;color:#98a2b3}
    .trip-note-entry-meta{margin-top:5px;font-size:10.5px;font-weight:700;color:#667085}
    .trip-note-entry-text{
      margin-top:8px;
      font-size:13px;
      line-height:1.6;
      color:#182230;
      white-space:pre-wrap;
      word-break:break-word;
    }
    .trip-note-empty{
      padding:20px 14px;
      border:1px dashed #d0d5dd;
      border-radius:10px;
      background:#fcfcfd;
      text-align:center;
      color:#667085;
      font-size:12px;
    }
    .trip-note-add-card{
      margin-top:14px;
      padding:14px;
      border:1px solid #d6bbfb;
      border-radius:13px;
      background:#f7f5ff;
      box-shadow:0 2px 8px rgba(105,65,198,.06);
    }
    .trip-note-add-title{font-size:15px;font-weight:800;color:#42307d}
    .trip-note-add-sub{margin-top:3px;font-size:11px;color:#6941c6;line-height:1.4}
    .trip-note-add-card textarea{
      margin-top:11px;
      min-height:92px;
      border-color:#c3b5fd;
      background:#fff;
    }
    .trip-note-add-footer{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      margin-top:10px;
    }
    .trip-note-add-notice{
      min-height:18px;
      flex:1 1 auto;
      font-size:11px;
      font-weight:700;
      color:#6941c6;
      line-height:1.35;
    }
    .trip-note-add-card .btn{min-width:120px}
    .driver-arrival-notification-only{margin-bottom:12px}

    @media(max-width:700px){
      .trip-notes-trip-info{grid-template-columns:1fr 1fr}
      .trip-note-add-footer{align-items:stretch;flex-direction:column}
      .trip-note-add-card .btn{width:100%}
    }
    @media(max-width:430px){
      .trip-notes-trip-info{grid-template-columns:1fr}
    }
    body.mobile-ui .trip-notes-trip-info{grid-template-columns:1fr 1fr}
    body.mobile-ui .trip-note-add-footer{align-items:stretch;flex-direction:column}
    body.mobile-ui .trip-note-add-card .btn{width:100%;min-height:48px}



    /* =======================================================
       v5.5.5 ACTIVE TRIP READABILITY
       - Delivery Type follows Trip Type in the main table.
       - Current navigation tab is unmistakably highlighted.
       - Empty Trip Notes and unavailable Driver Link are muted gray.
       ======================================================= */
    .tabs .tab.active{
      background:var(--primary)!important;
      color:#fff!important;
      box-shadow:0 3px 9px rgba(105,65,198,.24)!important;
      border:1px solid var(--primary)!important;
    }
    .tabs .tab.active:hover{
      background:var(--primary2)!important;
      color:#fff!important;
    }

    #activeRows .trip-row-actions .instructions-btn.note-empty,
    body.mobile-ui #activeRows .trip-row-actions .instructions-btn.note-empty{
      background:#f2f4f7!important;
      border-color:#d0d5dd!important;
      color:#667085!important;
      box-shadow:none!important;
    }
    #activeRows .trip-row-actions .instructions-btn.note-empty:hover,
    body.mobile-ui #activeRows .trip-row-actions .instructions-btn.note-empty:hover{
      background:#eaecf0!important;
      border-color:#b9c0cc!important;
      color:#475467!important;
    }

    #activeRows .trip-row-actions > .driver-link-btn[style*="visibility:hidden"],
    body.mobile-ui #activeRows .trip-row-actions > .driver-link-btn[style*="visibility:hidden"],
    #activeRows .driver-arrival-row .trip-row-actions .driver-link-btn,
    body.mobile-ui #activeRows .driver-arrival-row .trip-row-actions .driver-link-btn{
      display:flex!important;
      visibility:visible!important;
      background:#f2f4f7!important;
      border-color:#d0d5dd!important;
      color:#98a2b3!important;
      box-shadow:none!important;
      pointer-events:none!important;
      cursor:not-allowed!important;
      opacity:1!important;
    }
    #activeRows .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]::before,
    body.mobile-ui #activeRows .trip-row-actions > .driver-link-btn[style*="visibility:hidden"]::before,
    #activeRows .driver-arrival-row .trip-row-actions .driver-link-btn::before,
    body.mobile-ui #activeRows .driver-arrival-row .trip-row-actions .driver-link-btn::before{
      filter:grayscale(1)!important;
      opacity:.38!important;
    }


    /* =======================================================
       v5.5.7 MANAGER BULK SELECTION
       - Select All applies to currently displayed, non-deleted trips.
       - Bulk delete remains recoverable soft delete.
       ======================================================= */
    .manager-bulk-actions{
      display:flex;
      align-items:center;
      gap:10px;
      padding:10px 14px;
      border-bottom:1px solid var(--border);
      background:#fcfcfd;
      flex-wrap:wrap;
    }
    .manager-select-all{
      display:inline-flex;
      align-items:center;
      gap:7px;
      font-size:12px;
      font-weight:800;
      color:#344054;
      cursor:pointer;
      white-space:nowrap;
    }
    .manager-select-all input,
    .manager-trip-select-cell input{
      width:17px;
      height:17px;
      min-height:0;
      flex:0 0 17px;
      accent-color:var(--primary);
      cursor:pointer;
    }
    .manager-select-all input:disabled,
    .manager-trip-select-cell input:disabled{cursor:not-allowed}
    .manager-selected-count{
      min-width:76px;
      font-size:11px;
      font-weight:700;
      color:var(--muted);
    }
    #mgrDeleteSelectedBtn{margin-left:auto}
    .manager-trip-select-cell{
      display:flex;
      align-items:center;
      gap:8px;
      min-width:max-content;
    }

    @media(max-width:900px){
      .manager-bulk-actions{padding:10px;gap:8px}
      #mgrDeleteSelectedBtn{margin-left:0;width:100%}
    }
    body.mobile-ui .manager-bulk-actions{padding:10px;gap:8px}
    body.mobile-ui #mgrDeleteSelectedBtn{margin-left:0;width:100%}



    /* =======================================================
       v5.5.8 MANAGER DATE FILTER + SERVER PAGINATION
       - Trip Start period is filtered on the server.
       - Only one result page is sent to the browser.
       - Select Page remains intentionally page-scoped for safe bulk delete.
       ======================================================= */
    .manager-trip-filter{
      grid-template-columns:minmax(250px,1.6fr) 150px 150px 170px 110px auto auto;
      gap:9px;
      align-items:end;
    }
    .manager-trip-filter .field{min-width:0}
    .manager-deleted-filter{
      margin:0!important;
      min-height:42px;
      align-items:center;
      padding:0 4px;
      white-space:nowrap;
    }
    .manager-apply-btn{min-height:42px;white-space:nowrap}
    .manager-bulk-note{
      font-size:10px;
      color:var(--muted);
      line-height:1.35;
    }
    .manager-pagination{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      padding:9px 14px;
      border-bottom:1px solid var(--border);
      background:#fff;
      flex-wrap:wrap;
    }
    .manager-pagination-bottom{
      border-top:1px solid var(--border);
      border-bottom:0;
    }
    .manager-page-summary{
      font-size:11px;
      font-weight:800;
      color:#344054;
      white-space:nowrap;
    }
    .manager-page-summary span{color:var(--muted);font-weight:700}
    .manager-page-buttons{
      display:flex;
      align-items:center;
      gap:5px;
      flex-wrap:wrap;
    }
    .manager-page-btn{
      min-width:34px;
      height:34px;
      padding:0 9px;
      border:1px solid #d0d5dd;
      border-radius:7px;
      background:#fff;
      color:#344054;
      font-size:11px;
      font-weight:800;
      cursor:pointer;
    }
    .manager-page-btn:hover:not(:disabled){border-color:#b692f6;background:#f4f3ff;color:var(--primary2)}
    .manager-page-btn.active{
      background:var(--primary);
      border-color:var(--primary);
      color:#fff;
      cursor:default;
    }
    .manager-page-btn.nav{min-width:auto;padding:0 10px}
    .manager-page-btn:disabled{opacity:.38;cursor:not-allowed}
    .manager-page-gap{padding:0 2px;color:var(--muted);font-weight:800}

    /* Manager table: new Started column before Updated. */
    #mgrTripRows td:nth-child(8)::before{content:"Started"}
    #mgrTripRows td:nth-child(9)::before{content:"Updated"}
    body.mobile-ui #mgrTripRows td:nth-child(8)::before{content:"Started"}
    body.mobile-ui #mgrTripRows td:nth-child(9)::before{content:"Updated"}

    @media(max-width:1100px){
      .manager-trip-filter{
        grid-template-columns:repeat(3,minmax(0,1fr));
      }
      .manager-search-field{grid-column:1/-1}
      .manager-deleted-filter{align-self:end}
    }
    @media(max-width:900px){
      .manager-trip-filter{grid-template-columns:1fr 1fr!important}
      .manager-trip-filter .manager-search-field{grid-column:1/-1}
      .manager-trip-filter .manager-apply-btn{width:100%}
      .manager-pagination{padding:9px 10px;align-items:flex-start}
      .manager-page-buttons{width:100%}
      .manager-page-btn{min-height:38px;height:38px}
      .manager-bulk-note{width:100%}
    }
    body.mobile-ui .manager-trip-filter{grid-template-columns:1fr!important}
    body.mobile-ui .manager-trip-filter .manager-search-field{grid-column:auto}
    body.mobile-ui .manager-trip-filter .manager-apply-btn{width:100%}
    body.mobile-ui .manager-deleted-filter{min-height:42px}
    body.mobile-ui .manager-pagination{padding:9px 10px;align-items:flex-start}
    body.mobile-ui .manager-page-buttons{width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}
    body.mobile-ui .manager-page-btn{flex:0 0 auto;min-height:40px;height:40px}
    body.mobile-ui .manager-bulk-note{width:100%}




/* v0.3.0 Reference Data split: Locations (green) vs Operational Options (blue) */
.reference-block{margin:14px;border:1px solid var(--border);border-radius:14px;overflow:hidden;background:#fff}
.reference-block+.reference-block{margin-top:18px}
.reference-locations{border-color:#b7dfc8;background:#fbfffc}
.reference-locations>.manager-head{background:#eaf7ef;border-bottom-color:#cde8d8}
.reference-locations>.manager-head strong{color:#166534}
.reference-locations thead{background:#f1faf4}
.reference-options{border-color:#c7dcf1;background:#fbfdff}
.reference-options>.manager-head{background:#eaf3fb;border-bottom-color:#d2e4f4}
.reference-options>.manager-head strong{color:#1d4f7a}
.reference-options thead{background:#f1f7fd}
.notice.success-lite{background:#ecfdf3;border:1px solid #abefc6;color:#067647}
.location-editor{grid-template-columns:minmax(170px,1fr) minmax(170px,1fr) 160px 120px 100px 145px 120px 90px auto}
.option-editor{grid-template-columns:170px minmax(180px,1fr) minmax(180px,1fr) 90px 90px auto}
@media (max-width:1180px){.location-editor,.option-editor{grid-template-columns:repeat(2,minmax(0,1fr))}.location-editor .btn,.option-editor .btn{width:100%}}
@media (max-width:700px){.reference-block{margin:10px}.location-editor,.option-editor{grid-template-columns:1fr}}

/* =======================================================
   v0.4.0 - USERS & ROLE-BASED ACCESS
   ======================================================= */
body.auth-locked{overflow:hidden}
body.auth-locked>.topbar,
body.auth-locked>main,
body.auth-locked>.app-footer,
body.auth-locked>.overlay,
body.auth-locked>.toast{visibility:hidden}
.auth-gate{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;padding:22px;background:radial-gradient(circle at top left,#f4f3ff 0,#f8fafc 44%,#eef2f7 100%)}
.auth-gate.show{display:flex}
.auth-card{width:min(520px,100%);background:#fff;border:1px solid #e4e7ec;border-radius:20px;box-shadow:0 28px 80px rgba(16,24,40,.18);padding:26px}
.auth-brand{display:flex;align-items:center;gap:13px;padding-bottom:18px;margin-bottom:20px;border-bottom:1px solid #eaecf0}
.auth-brand-mark{display:grid;place-items:center;width:50px;height:50px;flex:0 0 50px;border-radius:15px;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;font-weight:900;font-size:16px;letter-spacing:.04em;box-shadow:0 8px 20px rgba(105,65,198,.2)}
.auth-brand h1{margin:0;font-size:20px;line-height:1.2}.auth-brand p{margin:4px 0 0;color:var(--muted);font-size:12px}
.auth-kicker{font-size:10px;letter-spacing:.12em;font-weight:900;color:var(--primary);margin-bottom:7px}.auth-card h2{margin:0 0 7px;font-size:24px}.auth-copy{margin:0 0 18px;color:var(--muted);font-size:12px;line-height:1.6}
.auth-card .field{margin-bottom:11px}.auth-submit{width:100%;min-height:46px;margin-top:5px}.auth-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.auth-form-grid .field.full{grid-column:1/-1}
.auth-message{min-height:18px;margin-top:12px;font-size:12px;font-weight:700;line-height:1.45}.auth-message.error{color:var(--danger)}.auth-message.success{color:var(--success)}.auth-message.info{color:#1849a9}
.auth-security-note{margin-top:18px;padding-top:13px;border-top:1px solid #eaecf0;text-align:center;color:#98a2b3;font-size:10px}
.auth-loading-panel{display:flex;min-height:300px;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:8px 6px 2px}
#authLoadingPanel:not(.hidden)~.auth-message{display:none}
.auth-loading-brand h1{margin:0;color:#1d2939;font-size:25px;line-height:1.2;letter-spacing:-.02em}.auth-loading-brand p{margin:7px 0 0;color:#667085;font-size:12px;font-weight:600}
.trip-route-loader{display:flex;align-items:center;width:min(330px,86%);margin:42px auto 30px}.trip-route-point{width:12px;height:12px;flex:0 0 12px;border:3px solid #6941c6;border-radius:50%;background:#fff;box-shadow:0 0 0 4px rgba(105,65,198,.09)}.trip-route-track{position:relative;display:block;flex:1;height:4px;margin:0 8px;border-radius:99px;background:linear-gradient(90deg,rgba(105,65,198,.2),rgba(105,65,198,.72),rgba(105,65,198,.2));overflow:visible}.trip-route-track:after{content:"";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(90deg,transparent,rgba(255,255,255,.82),transparent);transform:translateX(-100%);animation:utcRouteShimmer 1.8s ease-in-out infinite}.trip-route-truck{position:absolute;z-index:2;top:50%;left:0;display:grid;place-items:center;width:34px;height:26px;margin-top:-13px;font-size:21px;line-height:1;filter:drop-shadow(0 4px 5px rgba(16,24,40,.16));animation:utcTripDrive 2.8s ease-in-out infinite}
.auth-loading-copy strong{display:block;color:#344054;font-size:14px;font-weight:850}.auth-loading-status{position:relative;width:min(310px,80vw);height:20px;margin:7px auto 0;overflow:hidden;color:#98a2b3;font-size:11px}.auth-loading-status span{position:absolute;inset:0;opacity:0;transform:translateY(5px);animation:utcLoadingStatus 6s ease-in-out infinite}.auth-loading-status span:nth-child(2){animation-delay:2s}.auth-loading-status span:nth-child(3){animation-delay:4s}
.auth-loading-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;margin-top:38px;padding-top:14px;width:100%;border-top:1px solid #eaecf0;color:#98a2b3;font-size:9.5px;line-height:1.5}
@keyframes utcTripDrive{0%{left:0;transform:translateX(-5%)}50%{left:100%;transform:translateX(-95%)}100%{left:0;transform:translateX(-5%)}}@keyframes utcRouteShimmer{0%{transform:translateX(-100%)}55%,100%{transform:translateX(100%)}}@keyframes utcLoadingStatus{0%,8%{opacity:0;transform:translateY(5px)}15%,28%{opacity:1;transform:translateY(0)}34%,100%{opacity:0;transform:translateY(-5px)}}
@media(max-width:900px){.auth-loading-panel{min-height:100%;padding:20px 4px}.auth-loading-brand h1{font-size:27px}.auth-loading-brand p{font-size:12px}.trip-route-loader{width:min(340px,86vw);margin-top:48px}.auth-loading-footer{max-width:420px;margin-top:46px}}
@media(prefers-reduced-motion:reduce){.trip-route-truck,.trip-route-track:after,.auth-loading-status span{animation:none}.trip-route-truck{left:50%;transform:translateX(-50%)}.auth-loading-status span:first-child{opacity:1;transform:none}}
.user-account-btn{display:flex;align-items:center;gap:8px;min-height:40px;padding:5px 10px;border:1px solid #e4e7ec;border-radius:10px;background:#fff;color:var(--text);cursor:pointer}.user-account-btn:hover{border-color:#b692f6;background:#faf9ff}.user-account-avatar{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:#f4f3ff;color:var(--primary);font-size:8px}.user-account-copy{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.user-account-copy strong{font-size:11px;max-width:145px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-account-copy small{font-size:9px;color:var(--muted);margin-top:1px}
.role-guide{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;padding:13px;border-bottom:1px solid var(--border);background:#fafafa}.role-guide>div{border:1px solid var(--border);border-radius:10px;padding:10px;background:#fff}.role-guide strong{display:block;font-size:11px;color:#344054}.role-guide span{display:block;margin-top:4px;color:var(--muted);font-size:9.5px;line-height:1.4}
.user-editor{grid-template-columns:minmax(180px,1fr) 160px minmax(190px,1fr) 140px 95px minmax(210px,1fr) auto}.user-access-warning{display:block;margin-top:4px;color:var(--warn);font-size:10px;font-weight:700}.account-modal{width:min(620px,100%)}.account-section-title{font-size:13px;font-weight:800;margin-bottom:12px}.account-password-notice{min-height:18px;margin:10px 0;font-size:12px;font-weight:700}.account-password-notice.success{color:var(--success)}.account-password-notice.error{color:var(--danger)}.auth-required-backdrop{z-index:1100;background:rgba(16,24,40,.72)}
@media(max-width:1050px){.role-guide{grid-template-columns:1fr 1fr}.user-editor{grid-template-columns:1fr 1fr}.user-editor .btn{width:100%}}
@media(max-width:900px){.auth-gate{padding:0;align-items:stretch}.auth-card{width:100%;min-height:100dvh;border:0;border-radius:0;padding:22px 18px;display:flex;flex-direction:column;justify-content:center}.auth-form-grid{grid-template-columns:1fr}.auth-form-grid .field.full{grid-column:auto}.user-account-copy{display:none}.user-account-btn{padding:5px 8px}.role-guide{grid-template-columns:1fr 1fr}.user-editor{grid-template-columns:1fr}.user-editor .btn{width:100%}#userRows td:nth-child(1)::before{content:"User"}#userRows td:nth-child(2)::before{content:"Role"}#userRows td:nth-child(3)::before{content:"Status"}#userRows td:nth-child(4)::before{content:"Email"}#userRows td:nth-child(5)::before{content:"Last Login"}#userRows td:nth-child(6)::before{content:"Created"}}
body.mobile-ui .user-account-copy{display:none}body.mobile-ui .user-account-btn{padding:5px 8px}body.mobile-ui .role-guide{grid-template-columns:1fr}body.mobile-ui .user-editor{grid-template-columns:1fr}body.mobile-ui #userRows td:nth-child(1)::before{content:"User"}body.mobile-ui #userRows td:nth-child(2)::before{content:"Role"}body.mobile-ui #userRows td:nth-child(3)::before{content:"Status"}body.mobile-ui #userRows td:nth-child(4)::before{content:"Email"}body.mobile-ui #userRows td:nth-child(5)::before{content:"Last Login"}body.mobile-ui #userRows td:nth-child(6)::before{content:"Created"}

/* =======================================================
   v0.4.3 - BACKGROUND EMAIL QUEUE & CRON
   ======================================================= */
.email-queue-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:13px;border-bottom:1px solid var(--border);background:#fcfcfd}
.email-queue-stat{border:1px solid var(--border);border-radius:11px;padding:11px 12px;background:#fff;display:flex;align-items:center;justify-content:space-between;gap:10px}
.email-queue-stat span{font-size:11px;color:var(--muted);font-weight:700}.email-queue-stat strong{font-size:22px}
.email-queue-stat.pending{border-color:#f7d58b;background:#fffaf0}.email-queue-stat.pending strong{color:#b54708}
.email-queue-stat.processing{border-color:#b2ddff;background:#f5fbff}.email-queue-stat.processing strong{color:#175cd3}
.email-queue-stat.sent{border-color:#abefc6;background:#f6fef9}.email-queue-stat.sent strong{color:#067647}
.email-queue-stat.failed{border-color:#fda29b;background:#fff8f7}.email-queue-stat.failed strong{color:#b42318}
.email-queue-worker-note{margin:12px 14px 0}.email-queue-worker-note code{background:#eef2f6;padding:2px 5px;border-radius:5px;color:#344054}
.email-queue-filter{grid-template-columns:minmax(260px,1fr) 170px 140px auto}
.status.email-pending{background:var(--warnbg);color:var(--warn)}.status.email-processing{background:#eff8ff;color:#175cd3}.status.email-sent{background:var(--successbg);color:var(--success)}.status.email-failed{background:var(--dangerbg);color:var(--danger)}
.email-queue-error{display:block;max-width:360px;white-space:normal;line-height:1.4;color:#475467}
@media(max-width:1000px){.email-queue-summary{grid-template-columns:1fr 1fr}.email-queue-filter{grid-template-columns:1fr 1fr}.email-queue-filter .manager-search-field{grid-column:1/-1}}
@media(max-width:900px){
  .email-queue-summary{grid-template-columns:1fr 1fr;padding:10px}
  .email-queue-filter{grid-template-columns:1fr!important}.email-queue-filter .manager-search-field{grid-column:auto}
  #emailQueueRows td:nth-child(1)::before{content:"Created"}#emailQueueRows td:nth-child(2)::before{content:"Status"}#emailQueueRows td:nth-child(3)::before{content:"Trip / Leg"}#emailQueueRows td:nth-child(4)::before{content:"Destination"}#emailQueueRows td:nth-child(5)::before{content:"To"}#emailQueueRows td:nth-child(6)::before{content:"Attempts"}#emailQueueRows td:nth-child(7)::before{content:"Next Attempt"}#emailQueueRows td:nth-child(8)::before{content:"Sent"}#emailQueueRows td:nth-child(9)::before{content:"Last Error"}
}
body.mobile-ui .email-queue-summary{grid-template-columns:1fr 1fr;padding:10px}body.mobile-ui .email-queue-filter{grid-template-columns:1fr!important}body.mobile-ui #emailQueueRows td:nth-child(1)::before{content:"Created"}body.mobile-ui #emailQueueRows td:nth-child(2)::before{content:"Status"}body.mobile-ui #emailQueueRows td:nth-child(3)::before{content:"Trip / Leg"}body.mobile-ui #emailQueueRows td:nth-child(4)::before{content:"Destination"}body.mobile-ui #emailQueueRows td:nth-child(5)::before{content:"To"}body.mobile-ui #emailQueueRows td:nth-child(6)::before{content:"Attempts"}body.mobile-ui #emailQueueRows td:nth-child(7)::before{content:"Next Attempt"}body.mobile-ui #emailQueueRows td:nth-child(8)::before{content:"Sent"}body.mobile-ui #emailQueueRows td:nth-child(9)::before{content:"Last Error"}


/* =======================================================
   v0.4.4 - MANAGER SYSTEM HEALTH
   ======================================================= */
.system-health-overview{padding:14px;border-bottom:1px solid var(--border);background:#fcfcfd}
.system-health-overall{display:flex;align-items:center;gap:11px;border:1px solid var(--border);border-radius:12px;padding:13px 14px;background:#fff}
.system-health-overall-dot{width:12px;height:12px;border-radius:50%;flex:0 0 12px;background:#98a2b3;box-shadow:0 0 0 4px #f2f4f7}
.system-health-overall>div{display:flex;flex-direction:column;gap:3px}.system-health-overall strong{font-size:14px}.system-health-overall span:not(.system-health-overall-dot){font-size:11px;color:var(--muted)}
.system-health-overall.ok{border-color:#abefc6;background:#f6fef9}.system-health-overall.ok .system-health-overall-dot{background:#067647;box-shadow:0 0 0 4px #dcfae6}
.system-health-overall.warn{border-color:#fedf89;background:#fffaeb}.system-health-overall.warn .system-health-overall-dot{background:#dc6803;box-shadow:0 0 0 4px #fef0c7}
.system-health-overall.check{border-color:#fda29b;background:#fff8f7}.system-health-overall.check .system-health-overall-dot{background:#b42318;box-shadow:0 0 0 4px #fee4e2}
.system-health-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;margin-top:10px}
.system-health-metric{border:1px solid var(--border);border-radius:10px;padding:10px 11px;background:#fff;display:flex;align-items:center;justify-content:space-between;gap:10px}.system-health-metric span{font-size:10px;color:var(--muted);font-weight:700}.system-health-metric strong{font-size:20px;color:#344054}.system-health-metric.backup-time strong{font-size:12px;text-align:right}
.system-health-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px}
.system-health-card{border:1px solid var(--border);border-radius:11px;padding:12px;background:#fff}.system-health-card.ok{border-color:#d1fadf}.system-health-card.warn{border-color:#fedf89;background:#fffdf7}.system-health-card.check{border-color:#fda29b;background:#fffafa}
.system-health-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.system-health-card-head strong{font-size:12px}.system-health-detail{margin-top:7px;font-size:11px;color:#667085;line-height:1.5;white-space:normal;word-break:break-word}
.system-health-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 7px;border-radius:999px;font-size:9px;font-weight:900;letter-spacing:.04em}.system-health-badge.ok{background:#ecfdf3;color:#067647}.system-health-badge.warn{background:#fffaeb;color:#b54708}.system-health-badge.check{background:#fef3f2;color:#b42318}
.system-health-footer{padding:0 14px 14px;color:var(--muted);font-size:10px}.system-health-empty{grid-column:1/-1;padding:26px;text-align:center;color:var(--muted)}
@media(max-width:900px){.system-health-metrics{grid-template-columns:1fr 1fr}.system-health-grid{grid-template-columns:1fr;padding:10px}.system-health-overview{padding:10px}}
body.mobile-ui .system-health-metrics{grid-template-columns:1fr 1fr}body.mobile-ui .system-health-grid{grid-template-columns:1fr;padding:10px}


    /* v0.4.7 - server-side Activity Log + trip audit timeline */
    .activity-head .secondary{margin-top:4px}
    .activity-filter-grid{display:grid;grid-template-columns:150px 150px minmax(150px,1fr) minmax(180px,1fr) minmax(280px,2fr) 120px auto auto;gap:9px;padding:14px;border-bottom:1px solid var(--border);align-items:end}
    .activity-search-field{min-width:0}
    .audit-trip-link{border:0;background:transparent;color:var(--primary);padding:0;font:inherit;font-weight:800;text-decoration:underline;text-underline-offset:2px;cursor:pointer}
    .audit-trip-link:hover{color:var(--primary2)}
    .audit-action-pill{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#f4f3ff;color:#53389e;font-size:10px;font-weight:800;white-space:nowrap}
    .audit-timeline-modal{width:min(980px,100%)}
    .audit-timeline{display:flex;flex-direction:column;gap:0;padding:2px 0 8px}
    .audit-timeline-item{display:grid;grid-template-columns:30px minmax(0,1fr);gap:10px;min-height:86px}
    .audit-timeline-rail{position:relative;display:flex;justify-content:center}
    .audit-timeline-dot{position:relative;z-index:2;width:13px;height:13px;margin-top:18px;border:3px solid #9e77ed;border-radius:50%;background:#fff;box-shadow:0 0 0 4px #f4f3ff}
    .audit-timeline-line{position:absolute;top:31px;bottom:-18px;width:2px;background:#e9d7fe}
    .audit-timeline-card{margin:5px 0 13px;padding:12px 14px;border:1px solid var(--border);border-radius:12px;background:#fcfcfd}
    .audit-timeline-top{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px}
    .audit-timeline-top strong{color:#42307d;font-size:13px}.audit-timeline-top span{color:var(--muted);white-space:nowrap;font-size:11px}
    .audit-timeline-user{margin-top:4px;color:#667085;font-size:11px;font-weight:700}
    .audit-timeline-field{display:inline-flex;margin-top:8px;padding:3px 7px;border-radius:6px;background:#f2f4f7;color:#475467;font-size:10px;font-weight:800}
    .audit-timeline-change{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:8px;align-items:center;margin-top:8px;padding:8px 10px;border-radius:9px;background:#fff;border:1px solid #eaecf0;font-size:11px;word-break:break-word}
    .audit-timeline-change b{color:#9e77ed}.audit-timeline-details{margin-top:8px;font-size:12px;line-height:1.45;color:#344054}
    @media(max-width:1100px){.activity-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.activity-search-field{grid-column:1/-1}.activity-filter-grid>.btn{width:100%}}
    @media(max-width:700px){.activity-filter-grid{grid-template-columns:1fr 1fr;padding:10px}.activity-search-field{grid-column:1/-1}.audit-timeline-top{align-items:flex-start;flex-direction:column;gap:3px}.audit-timeline-change{grid-template-columns:1fr}.audit-timeline-change b{transform:rotate(90deg);justify-self:start}}
    body.mobile-ui .activity-filter-grid{grid-template-columns:1fr 1fr;padding:10px}
    body.mobile-ui .activity-search-field{grid-column:1/-1}
    body.mobile-ui .activity-filter-grid>.btn{width:100%}

/* =======================================================
   v0.4.8 - DATA QUALITY MONITOR
   Advisory-only checks. No automatic record changes.
   ======================================================= */
.data-quality-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:13px;border-bottom:1px solid var(--border);background:#fcfcfd}
.data-quality-stat{border:1px solid var(--border);border-radius:11px;padding:11px 12px;background:#fff;display:flex;align-items:center;justify-content:space-between;gap:10px}
.data-quality-stat span{font-size:11px;color:var(--muted);font-weight:700}.data-quality-stat strong{font-size:22px}
.data-quality-stat.critical{border-color:#fda29b;background:#fff8f7}.data-quality-stat.critical strong{color:#b42318}
.data-quality-stat.warning{border-color:#fedf89;background:#fffaeb}.data-quality-stat.warning strong{color:#b54708}
.data-quality-stat.info{border-color:#b2ddff;background:#f5fbff}.data-quality-stat.info strong{color:#175cd3}
.data-quality-stat.affected{border-color:#d6bbfb;background:#f9f5ff}.data-quality-stat.affected strong{color:#6941c6}
.data-quality-advisory{margin:12px 14px 0}
.data-quality-rules{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:12px 14px;border-bottom:1px solid var(--border)}
.data-quality-rule{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;border:1px solid var(--border);border-radius:10px;padding:9px 10px;background:#fff}
.data-quality-rule>div{display:flex;min-width:0;flex-direction:column;gap:2px}.data-quality-rule strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.data-quality-rule span:not(.data-quality-rule-badge){font-size:9px;color:var(--muted)}.data-quality-rule b{font-size:15px}
.data-quality-rule.critical{border-color:#fda29b}.data-quality-rule.warning{border-color:#fedf89}.data-quality-rule.info{border-color:#b2ddff}
.data-quality-rule-badge,.data-quality-severity{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;font-size:9px;font-weight:900;letter-spacing:.035em;padding:4px 7px;white-space:nowrap}
.data-quality-rule-badge.critical,.data-quality-severity.critical{background:#fef3f2;color:#b42318}
.data-quality-rule-badge.warning,.data-quality-severity.warning{background:#fffaeb;color:#b54708}
.data-quality-rule-badge.info,.data-quality-severity.info{background:#eff8ff;color:#175cd3}
.data-quality-filter{grid-template-columns:minmax(250px,1fr) 155px 180px 135px auto}
.data-quality-detail{display:block;max-width:480px;white-space:normal;line-height:1.45;color:#475467}
.data-quality-empty{grid-column:1/-1;padding:18px;text-align:center;color:var(--muted);font-size:11px}
@media(max-width:1100px){.data-quality-rules{grid-template-columns:1fr 1fr}.data-quality-filter{grid-template-columns:1fr 1fr}.data-quality-filter .manager-search-field{grid-column:1/-1}}
@media(max-width:900px){.data-quality-summary{grid-template-columns:1fr 1fr;padding:10px}.data-quality-rules{grid-template-columns:1fr;padding:10px}.data-quality-filter{grid-template-columns:1fr!important}.data-quality-filter .manager-search-field{grid-column:auto}}
body.mobile-ui .data-quality-summary{grid-template-columns:1fr 1fr;padding:10px}body.mobile-ui .data-quality-rules{grid-template-columns:1fr;padding:10px}body.mobile-ui .data-quality-filter{grid-template-columns:1fr!important}
body.mobile-ui #dataQualityRows td:nth-child(1)::before{content:"Severity"}body.mobile-ui #dataQualityRows td:nth-child(2)::before{content:"Category"}body.mobile-ui #dataQualityRows td:nth-child(3)::before{content:"Rule"}body.mobile-ui #dataQualityRows td:nth-child(4)::before{content:"Trip / Entity"}body.mobile-ui #dataQualityRows td:nth-child(5)::before{content:"Plate"}body.mobile-ui #dataQualityRows td:nth-child(6)::before{content:"Status"}body.mobile-ui #dataQualityRows td:nth-child(7)::before{content:"Details"}body.mobile-ui #dataQualityRows td:nth-child(8)::before{content:"Updated"}


/* v0.5.0 - Installable PWA */
.pwa-install-btn{border-color:#b692f6;background:#f4f3ff;color:#53389e}
.pwa-install-btn:hover{background:#ebe9fe;border-color:#9e77ed;color:#42307d}
body.mobile-ui .pwa-install-btn{width:100%}
@media(max-width:900px){.pwa-install-btn{width:100%}}
.pwa-ios-install-modal{width:min(600px,100%)}
.pwa-ios-install-steps{display:grid;gap:10px}
.pwa-ios-install-step{display:grid;grid-template-columns:38px minmax(0,1fr);gap:12px;align-items:flex-start;padding:13px;border:1px solid #e4e7ec;border-radius:12px;background:#fcfcfd}
.pwa-ios-step-number{width:36px;height:36px;border-radius:11px;background:#f4f3ff;color:#6941c6;display:grid;place-items:center;font-size:15px;font-weight:900}
.pwa-ios-install-step>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.pwa-ios-install-step strong{font-size:13px;color:#182230}
.pwa-ios-install-step small{font-size:11.5px;line-height:1.5;color:#667085}
.pwa-ios-install-step b{color:#344054}
.pwa-ios-share-icon{display:inline-grid;place-items:center;width:21px;height:21px;border:1px solid #b2ddff;border-radius:6px;background:#eff8ff;color:#175cd3;font-size:16px;font-weight:900;vertical-align:middle}
.pwa-ios-install-note{margin-top:13px;padding:12px 13px;border:1px solid #b2ddff;border-radius:11px;background:#eff8ff;color:#1849a9;font-size:11.5px;line-height:1.5}
@media(max-width:600px){.pwa-ios-install-step{grid-template-columns:34px minmax(0,1fr);padding:12px}.pwa-ios-step-number{width:32px;height:32px;border-radius:10px}.pwa-ios-install-step small,.pwa-ios-install-note{font-size:12px}}

/* =======================================================
   v0.5.1 - WEB PUSH NOTIFICATIONS
   ======================================================= */
.push-settings-btn{border-color:#b2ddff;color:#175cd3;background:#f5fbff}
.push-settings-btn:hover{background:#eff8ff;border-color:#84caff;color:#1849a9}
.push-settings-modal{width:min(720px,100%)}
.push-settings-status-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}
.push-status-card{border:1px solid var(--border);border-radius:11px;background:#fcfcfd;padding:12px;display:flex;flex-direction:column;gap:5px}
.push-status-card span{font-size:10px;color:var(--muted);text-transform:uppercase;font-weight:800;letter-spacing:.04em}
.push-status-card strong{font-size:13px;color:#344054;word-break:break-word}
.push-settings-notice{min-height:0;margin:10px 0 12px;padding:0;border-radius:10px;font-size:12px;font-weight:700;line-height:1.45}
.push-settings-notice.info,.push-settings-notice.success,.push-settings-notice.warn,.push-settings-notice.error{padding:11px 13px;border:1px solid transparent}
.push-settings-notice.info{background:#eff8ff;border-color:#b2ddff;color:#1849a9}
.push-settings-notice.success{background:var(--successbg);border-color:#abefc6;color:var(--success)}
.push-settings-notice.warn{background:#fffaeb;border-color:#fedf89;color:#93370d}
.push-settings-notice.error{background:var(--dangerbg);border-color:#fda29b;color:var(--danger)}
.push-preference-card{border:1px solid #d6bbfb;border-radius:12px;background:#faf9ff;padding:13px 14px}
.push-preference-card.disabled{opacity:.55;pointer-events:none}
.push-preference-title{font-size:12px;font-weight:800;color:#42307d;margin-bottom:6px}
.push-pref-row{display:flex;align-items:flex-start;gap:11px;padding:11px 0;border-bottom:1px solid #ebe5f7;cursor:pointer}
.push-pref-row:last-child{border-bottom:0}
.push-pref-row input{width:18px;height:18px;min-height:18px;flex:0 0 18px;margin:1px 0 0}
.push-pref-row span{display:flex;flex-direction:column;gap:3px}
.push-pref-row strong{font-size:12px;color:#344054}
.push-pref-row small{font-size:11px;color:var(--muted);font-weight:500;line-height:1.4}
.push-privacy-note{margin-top:11px;font-size:10.5px;line-height:1.45;color:var(--muted)}
.push-settings-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}

@media(max-width:900px){
  .push-settings-status-grid{grid-template-columns:1fr}
  .push-settings-actions{display:grid;grid-template-columns:1fr 1fr}
  .push-settings-actions .btn{width:100%}
}
@media(max-width:430px){
  .push-settings-actions{grid-template-columns:1fr}
}


/* =======================================================
   v0.5.2 - OPERATIONS COMMAND CENTER
   Visual-only command layer over the existing live Dashboard.
   No operational workflow or server-side trip logic changed.
   ======================================================= */
.operations-command-head{
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  margin-bottom:12px;padding:15px 17px;background:linear-gradient(135deg,#ffffff 0%,#faf9ff 100%);
  border:1px solid #e4e7ec;border-radius:14px;box-shadow:0 4px 16px rgba(16,24,40,.05)
}
.operations-command-copy{min-width:0}
.operations-command-eyebrow{font-size:10px;font-weight:900;letter-spacing:.12em;color:#6941c6;margin-bottom:4px}
.operations-command-title{font-size:18px;font-weight:900;color:#182230;line-height:1.2}
.operations-command-sub{font-size:11px;color:#667085;margin-top:4px;line-height:1.45}
.operations-command-status{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.operations-live-badge,.operations-sync-meta,.operations-focus-meta{
  display:inline-flex;align-items:center;min-height:31px;padding:6px 9px;border-radius:999px;
  font-size:10.5px;font-weight:800;white-space:nowrap
}
.operations-live-badge{background:#ecfdf3;color:#067647;border:1px solid #abefc6}
.operations-live-dot{width:7px;height:7px;border-radius:50%;background:#12b76a;margin-right:6px;box-shadow:0 0 0 3px rgba(18,183,106,.12)}
.operations-sync-meta{background:#f4f3ff;color:#53389e;border:1px solid #e9d7fe}
.operations-focus-meta{background:#fffaeb;color:#b54708;border:1px solid #fedf89}
.live-summary{grid-template-columns:repeat(5,minmax(0,1fr))}
.driver-arrival-stat .stat-value{color:#175cd3}
.driver-arrival-stat.selected{border-color:#53b1fd;box-shadow:0 0 0 3px rgba(46,144,250,.10),var(--shadow)}
.brand-icon{border-radius:10px;overflow:hidden;background:transparent!important;color:inherit!important}
.brand-icon-img{display:block;width:100%;height:100%;object-fit:cover;border-radius:10px}
@media(max-width:1180px) and (min-width:901px){
  .live-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){
  .operations-command-head{display:block;padding:13px;margin-bottom:10px}
  .operations-command-title{font-size:16px}
  .operations-command-sub{font-size:10.5px}
  .operations-command-status{justify-content:flex-start;margin-top:10px;gap:6px}
  .operations-live-badge,.operations-sync-meta,.operations-focus-meta{font-size:10px;min-height:29px;padding:5px 8px}
  .live-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .driver-arrival-stat{grid-column:1/-1}
}
body.mobile-ui .operations-command-head{display:block;padding:13px;margin-bottom:10px}
body.mobile-ui .operations-command-title{font-size:16px}
body.mobile-ui .operations-command-sub{font-size:10.5px}
body.mobile-ui .operations-command-status{justify-content:flex-start;margin-top:10px;gap:6px}
body.mobile-ui .operations-live-badge,
body.mobile-ui .operations-sync-meta,
body.mobile-ui .operations-focus-meta{font-size:10px;min-height:29px;padding:5px 8px}
body.mobile-ui .live-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.mobile-ui .driver-arrival-stat{grid-column:1/-1}

/* =======================================================
   v0.5.3 - Saved Filters / My Views
   Per-user live Operations Command Center preferences.
   ======================================================= */
.ops-view-bar{
  display:grid;
  grid-template-columns:minmax(160px,1fr) minmax(160px,1fr) minmax(160px,1fr) minmax(180px,auto) auto;
  gap:10px;
  align-items:end;
  margin:-3px 0 14px;
  padding:11px 12px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:0 2px 8px rgba(16,24,40,.04);
}
.ops-view-filter{min-width:0}
.ops-view-filter label{display:block;margin-bottom:6px}
.ops-view-current{
  align-self:center;
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:7px 11px;
  border-radius:999px;
  background:#f2f4f7;
  color:#475467;
  font-size:11px;
  font-weight:800;
  text-align:center;
}
.ops-view-current.matched{background:#f4f3ff;color:#53389e;border:1px solid #d6bbfb}
.ops-view-actions{display:flex;gap:7px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.my-views-count{display:inline-flex;min-width:19px;height:19px;padding:0 5px;align-items:center;justify-content:center;border-radius:999px;background:#f4f3ff;color:#53389e;font-size:10px;margin-left:4px}
.my-views-modal{width:min(900px,100%)}
.my-view-save-card{border:1px solid #d6bbfb;background:#faf9ff;border-radius:12px;padding:14px;margin-bottom:16px}
.my-view-save-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:11px}
.my-view-save-head strong{font-size:14px}
.my-view-save-grid{display:grid;grid-template-columns:minmax(240px,1fr) auto auto;gap:10px;align-items:end}
.my-view-default-check{margin:0 0 5px;white-space:nowrap}
.my-views-notice{min-height:18px;margin-top:9px;font-size:11px;font-weight:700}
.my-views-notice.success{color:#067647}.my-views-notice.error{color:#b42318}.my-views-notice.info{color:#175cd3}
.my-view-list-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:9px}
.my-views-list{display:grid;gap:9px}
.my-view-row{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:10px;align-items:center;border:1px solid var(--border);border-radius:11px;padding:11px;background:#fff}
.my-view-row.default{border-color:#d6bbfb;background:#fcfbff}
.my-view-star{width:34px;height:34px;border-radius:50%;border:1px solid #e4e7ec;background:#fff;color:#98a2b3;font-size:18px}
.my-view-star.active{border-color:#fdb022;background:#fffaeb;color:#dc6803}
.my-view-row-copy{min-width:0}.my-view-row-copy strong{display:block;font-size:13px}.my-view-row-copy span{display:block;color:#667085;font-size:11px;line-height:1.45;margin-top:3px}.my-view-row-copy small{display:block;color:#6941c6;font-size:10px;font-weight:700;margin-top:4px}
.my-view-row-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.my-view-order-btn{min-width:38px;padding-left:8px;padding-right:8px}
.my-view-empty{padding:24px 14px;text-align:center;color:#667085;border:1px dashed #d0d5dd;border-radius:10px;background:#fcfcfd;font-size:12px}

@media(max-width:1000px){
  .ops-view-bar{grid-template-columns:repeat(3,minmax(0,1fr))}
  .ops-view-current{grid-column:1/3}.ops-view-actions{grid-column:3;align-self:center}
}
@media(max-width:700px){
  .ops-view-bar{grid-template-columns:1fr 1fr;padding:10px;gap:8px}
  .ops-view-filter:nth-child(3){grid-column:1/-1}
  .ops-view-current{grid-column:1/-1;justify-content:flex-start;border-radius:9px}
  .ops-view-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr auto}
  .ops-view-actions .btn{width:100%}
  .my-view-save-grid{grid-template-columns:1fr}
  .my-view-default-check{margin:2px 0}
  .my-view-row{grid-template-columns:34px 1fr}
  .my-view-row-actions{grid-column:1/-1;justify-content:stretch;display:grid;grid-template-columns:1fr 1fr 42px 42px 1fr}
  .my-view-row-actions .btn{width:100%;min-width:0}
}
body.mobile-ui .ops-view-bar{grid-template-columns:1fr 1fr;padding:10px;gap:8px}
body.mobile-ui .ops-view-filter:nth-child(3){grid-column:1/-1}
body.mobile-ui .ops-view-current{grid-column:1/-1;justify-content:flex-start;border-radius:9px}
body.mobile-ui .ops-view-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr auto}
body.mobile-ui .ops-view-actions .btn{width:100%}
body.mobile-ui .my-view-save-grid{grid-template-columns:1fr}
body.mobile-ui .my-view-row{grid-template-columns:34px 1fr}
body.mobile-ui .my-view-row-actions{grid-column:1/-1;justify-content:stretch;display:grid;grid-template-columns:1fr 1fr 42px 42px 1fr}
body.mobile-ui .my-view-row-actions .btn{width:100%;min-width:0}

/* =======================================================
   v0.6.0 - Production Security & Resilience
   ======================================================= */
.system-health-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 14px 0;margin-top:2px}.system-health-section-head strong{font-size:13px}.system-health-section-head span{font-size:10px;color:var(--muted)}.system-health-section-head.core{border-top:1px solid var(--border);margin-top:4px;padding-top:14px}.system-security-metrics{padding:10px 14px 0;margin-top:0}.security-grid{padding-top:10px}.user-sessions-modal{width:min(980px,100%)}.user-sessions-table{min-width:800px}.user-sessions-table .status{margin-left:7px}.user-sessions-table td:last-child{white-space:nowrap}
@media(max-width:900px){
  .system-health-section-head{padding:10px 10px 0;align-items:flex-start;flex-direction:column;gap:3px}
  .system-security-metrics{padding:8px 10px 0}
  #userRows td:nth-child(7)::before{content:"Sessions"}
  #userSessionRows td:nth-child(1)::before{content:"Device"}
  #userSessionRows td:nth-child(2)::before{content:"IP"}
  #userSessionRows td:nth-child(3)::before{content:"Created"}
  #userSessionRows td:nth-child(4)::before{content:"Last Seen"}
  #userSessionRows td:nth-child(5)::before{content:"Expires"}
}
body.mobile-ui #userRows td:nth-child(7)::before{content:"Sessions"}
body.mobile-ui #userSessionRows td:nth-child(1)::before{content:"Device"}
body.mobile-ui #userSessionRows td:nth-child(2)::before{content:"IP"}
body.mobile-ui #userSessionRows td:nth-child(3)::before{content:"Created"}
body.mobile-ui #userSessionRows td:nth-child(4)::before{content:"Last Seen"}
body.mobile-ui #userSessionRows td:nth-child(5)::before{content:"Expires"}
.system-security-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:900px){.system-security-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:520px){.system-security-metrics{grid-template-columns:1fr}}
body.mobile-ui .system-security-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:520px){body.mobile-ui .system-security-metrics{grid-template-columns:1fr}}


/* =======================================================
   v0.6.0.1 - Interface Refinement
   - Removes the redundant Live Operations banner from HTML.
   - Keeps the signed-in user visible at the top-right on phones.
   - Gives Attention and Driver Arrival summary cards clear warning backgrounds.
   ======================================================= */
.attention-stat{
  background:linear-gradient(135deg,#fffbeb 0%,#fff4cc 100%);
  border-color:#fedf89;
}
.attention-stat .stat-label{color:#93370d;font-weight:800}
.attention-stat .stat-value{color:#b54708}
.attention-stat .stat-hint{color:#7a2e0e}
.attention-stat:hover{border-color:#fdb022}
.attention-stat.selected{border-color:#f79009;box-shadow:0 0 0 3px rgba(247,144,9,.12),var(--shadow)}

.driver-arrival-stat{
  background:linear-gradient(135deg,#eff8ff 0%,#dff1ff 100%);
  border-color:#b2ddff;
}
.driver-arrival-stat .stat-label{color:#1849a9;font-weight:800}
.driver-arrival-stat .stat-value{color:#175cd3}
.driver-arrival-stat .stat-hint{color:#1849a9}
.driver-arrival-stat:hover{border-color:#53b1fd}
.driver-arrival-stat.selected{border-color:#2e90fa;box-shadow:0 0 0 3px rgba(46,144,250,.12),var(--shadow)}

@media(max-width:900px){
  .topbar-inner{position:relative}
  .brand{padding-right:142px}
  #userAccountBtn{
    position:absolute;
    top:calc(11px + env(safe-area-inset-top));
    right:12px;
    z-index:3;
    max-width:132px;
    min-height:36px;
    padding:4px 7px;
    gap:6px;
    justify-content:flex-end;
    background:#fff;
    box-shadow:0 2px 8px rgba(16,24,40,.06)
  }
  #userAccountBtn .user-account-copy{display:flex!important;align-items:flex-end}
  #userAccountBtn .user-account-copy strong{max-width:96px;font-size:10.5px;text-align:right}
  #userAccountBtn .user-account-copy small{display:none}
  #userAccountBtn .user-account-avatar{width:19px;height:19px;flex:0 0 19px}
}
body.mobile-ui .topbar-inner{position:relative}
body.mobile-ui .brand{padding-right:142px}
body.mobile-ui #userAccountBtn{
  position:absolute;
  top:calc(12px + env(safe-area-inset-top));
  right:12px;
  z-index:3;
  max-width:132px;
  min-height:36px;
  padding:4px 7px;
  gap:6px;
  justify-content:flex-end;
  background:#fff;
  box-shadow:0 2px 8px rgba(16,24,40,.06)
}
body.mobile-ui #userAccountBtn .user-account-copy{display:flex!important;align-items:flex-end}
body.mobile-ui #userAccountBtn .user-account-copy strong{max-width:96px;font-size:10.5px;text-align:right}
body.mobile-ui #userAccountBtn .user-account-copy small{display:none}
body.mobile-ui #userAccountBtn .user-account-avatar{width:19px;height:19px;flex:0 0 19px}
.refresh-meta{min-width:0}

/* =======================================================
   v0.6.0.2 - Operational Summary Cards
   - Arrived = all trips already arrived and waiting for the next stage.
   - Awaiting Dispatch = only Arrived trips waiting 6 hours or more.
   - Returning to Origin = active vehicles currently heading back to source.
   ======================================================= */
.live-summary{grid-template-columns:repeat(6,minmax(0,1fr))}

/* Calm yellow: arrived and waiting for the next stage. */
.arrived-stat{
  background:linear-gradient(135deg,#fffbeb 0%,#fef3c7 100%);
  border-color:#fde68a;
}
.arrived-stat .stat-label{color:#854d0e;font-weight:800}
.arrived-stat .stat-value{color:#a16207}
.arrived-stat .stat-hint{color:#854d0e}
.arrived-stat:hover{border-color:#facc15}
.arrived-stat.selected{border-color:#eab308;box-shadow:0 0 0 3px rgba(234,179,8,.12),var(--shadow)}

/* Calm red: operational exception after six hours without dispatch. */
.attention-stat{
  background:linear-gradient(135deg,#fff5f5 0%,#ffe4e6 100%);
  border-color:#fecdd3;
}
.attention-stat .stat-label{color:#991b1b;font-weight:800}
.attention-stat .stat-value{color:#b42318}
.attention-stat .stat-hint{color:#991b1b}
.attention-stat:hover{border-color:#fda4af}
.attention-stat.selected{border-color:#f97066;box-shadow:0 0 0 3px rgba(240,68,56,.10),var(--shadow)}
.attention-row{background:linear-gradient(90deg,rgba(254,243,242,.72),rgba(255,255,255,0) 30%)}
.attention-row td:first-child{box-shadow:inset 4px 0 0 #f97066}

/* Calm green: vehicle is actively returning to Fleet Ownership / Origin. */
.return-origin-stat{
  background:linear-gradient(135deg,#ecfdf3 0%,#dcfae6 100%);
  border-color:#abefc6;
}
.return-origin-stat .stat-label{color:#05603a;font-weight:800}
.return-origin-stat .stat-value{color:#067647}
.return-origin-stat .stat-hint{color:#05603a}
.return-origin-stat:hover{border-color:#75e0a7}
.return-origin-stat.selected{border-color:#17b26a;box-shadow:0 0 0 3px rgba(18,183,106,.10),var(--shadow)}

@media(max-width:1180px) and (min-width:901px){
  .live-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){
  .live-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .driver-arrival-stat{grid-column:auto!important}
}
body.mobile-ui .live-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.mobile-ui .driver-arrival-stat{grid-column:auto!important}

/* =======================================================
   v0.6.0.5 - Compact Live Trip Cards
   Mobile active trips start collapsed with only:
   Last Activity + time, Plate, Driver, Trip Type, plus a small corner Details toggle.
   Expansion state lives only in the current page session.
   ======================================================= */
#activeRows .active-trip-compact-cell{display:none}

@media(max-width:700px){
  #activeRows .active-trip-compact-cell{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    padding:0!important;
    border-bottom:0!important;
    text-align:initial!important;
  }
  #activeRows .active-trip-compact-cell::before{display:none!important}
  #activeRows .active-trip-compact-cell > *{max-width:none!important;width:100%!important}

  #activeRows tr.trip-details-collapsed > td:not(.active-trip-compact-cell){display:none!important}
  #activeRows tr.trip-details-expanded > td:nth-child(5),
  #activeRows tr.trip-details-expanded > td:nth-child(6),
  #activeRows tr.trip-details-expanded > td:nth-child(7),
  #activeRows tr.trip-details-expanded > td:nth-child(8){display:none!important}

  #activeRows tr.trip-details-expanded > td:nth-child(2)::before{content:"Fleet Ownership"}
  #activeRows tr.trip-details-expanded > td:nth-child(3)::before{content:"Status"}
  #activeRows tr.trip-details-expanded > td:nth-child(4)::before{content:"Route / Location"}
  #activeRows tr.trip-details-expanded > td:nth-child(9)::before{content:"Delivery Type"}
  #activeRows tr.trip-details-expanded > td:nth-child(10)::before{content:"Truck"}
  #activeRows tr.trip-details-expanded > td:nth-child(11)::before{display:none!important}
}

body.mobile-ui #activeRows .active-trip-compact-cell{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  padding:0!important;
  border-bottom:0!important;
  text-align:initial!important;
}
body.mobile-ui #activeRows .active-trip-compact-cell::before{display:none!important}
body.mobile-ui #activeRows .active-trip-compact-cell > *{max-width:none!important;width:100%!important}
body.mobile-ui #activeRows tr.trip-details-collapsed > td:not(.active-trip-compact-cell){display:none!important}
body.mobile-ui #activeRows tr.trip-details-expanded > td:nth-child(5),
body.mobile-ui #activeRows tr.trip-details-expanded > td:nth-child(6),
body.mobile-ui #activeRows tr.trip-details-expanded > td:nth-child(7),
body.mobile-ui #activeRows tr.trip-details-expanded > td:nth-child(8){display:none!important}
body.mobile-ui #activeRows tr.trip-details-expanded > td:nth-child(2)::before{content:"Fleet Ownership"}
body.mobile-ui #activeRows tr.trip-details-expanded > td:nth-child(3)::before{content:"Status"}
body.mobile-ui #activeRows tr.trip-details-expanded > td:nth-child(4)::before{content:"Route / Location"}
body.mobile-ui #activeRows tr.trip-details-expanded > td:nth-child(9)::before{content:"Delivery Type"}
body.mobile-ui #activeRows tr.trip-details-expanded > td:nth-child(10)::before{content:"Truck"}
body.mobile-ui #activeRows tr.trip-details-expanded > td:nth-child(11)::before{display:none!important}

.active-trip-compact{
  padding:4px 0 0;
  background:#fff;
}
.compact-trip-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  min-height:48px;
  padding:11px 14px;
  border-bottom:1px solid #eef1f5;
}
.compact-trip-label{
  flex:0 0 36%;
  max-width:36%;
  padding-top:2px;
  color:var(--muted);
  font-size:10px;
  font-weight:850;
  letter-spacing:.025em;
  line-height:1.35;
  text-transform:uppercase;
  text-align:left;
}
.compact-trip-value{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:4px;
  color:#101828;
  font-size:14px;
  line-height:1.35;
  text-align:right;
  word-break:break-word;
}
.compact-trip-value strong{font-size:14.5px;font-weight:850}
.compact-trip-time{color:#667085;font-size:11.5px}
.compact-trip-plate{font-weight:850}
.driver-mobile-link{
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  color:#475467;
  font-size:12px;
  font-weight:750;
  text-decoration:none;
  white-space:nowrap;
}
.driver-mobile-link:hover,.driver-mobile-link:focus{color:#6941c6;text-decoration:underline}
body.mobile-ui .driver-mobile-link{font-size:13px;color:#6941c6}
.compact-trip-toggle-row{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  padding:5px 14px 8px;
}
.compact-trip-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  width:auto!important;
  max-width:none!important;
  min-height:0!important;
  margin:0!important;
  padding:2px 0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#6941c6!important;
  font:inherit;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1.2;
  cursor:pointer;
}
.compact-trip-toggle:hover,.compact-trip-toggle:focus-visible{
  background:transparent!important;
  color:#53389e!important;
  text-decoration:underline;
}
.compact-trip-toggle:focus-visible{
  outline:2px solid #b692f6;
  outline-offset:3px;
  border-radius:4px!important;
}
.compact-trip-chevron{
  display:inline-block;
  font-size:17px;
  font-weight:900;
  line-height:.8;
  transform:translateY(-1px);
}
body.mobile-ui .compact-trip-toggle{font-size:12.5px!important}

@media(min-width:701px){
  #activeRows .active-trip-compact-cell{display:none!important}
}


/* =======================================================
   v0.6.0.6 - Mobile Header & Live Trip Numbering
   - On phones, Alerts sits immediately left of the signed-in user
     and shows only the bell icon.
   - Compact live-trip cards get a visible 1, 2, 3... marker in
     the upper-left corner based on the current filtered order.
   ======================================================= */
.account-actions{
  display:flex;
  align-items:center;
  gap:9px;
}
.push-settings-icon{display:inline-block;line-height:1}
.push-settings-text{display:inline}

@media(max-width:900px){
  .brand{padding-right:190px}
  .account-actions{
    position:absolute;
    top:calc(11px + env(safe-area-inset-top));
    right:12px;
    z-index:4;
    display:flex;
    align-items:center;
    gap:6px;
  }
  .account-actions #userAccountBtn{
    position:static;
    top:auto;
    right:auto;
    z-index:auto;
    max-width:132px;
    min-height:36px;
  }
  .account-actions #pushSettingsBtn{
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    padding:0!important;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:10px;
    flex:0 0 36px;
    font-size:17px;
    line-height:1;
  }
  .account-actions #pushSettingsBtn.hidden{display:none!important}
  .account-actions #pushSettingsBtn .push-settings-text{display:none!important}
}

body.mobile-ui .brand{padding-right:190px}
body.mobile-ui .account-actions{
  position:absolute;
  top:calc(12px + env(safe-area-inset-top));
  right:12px;
  z-index:4;
  display:flex;
  align-items:center;
  gap:6px;
}
body.mobile-ui .account-actions #userAccountBtn{
  position:static;
  top:auto;
  right:auto;
  z-index:auto;
  max-width:132px;
  min-height:36px;
}
body.mobile-ui .account-actions #pushSettingsBtn{
  width:36px!important;
  min-width:36px!important;
  max-width:36px!important;
  height:36px!important;
  min-height:36px!important;
  padding:0!important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  flex:0 0 36px;
  font-size:17px;
  line-height:1;
}
body.mobile-ui .account-actions #pushSettingsBtn.hidden{display:none!important}
body.mobile-ui .account-actions #pushSettingsBtn .push-settings-text{display:none!important}

.active-trip-compact{position:relative}
.compact-trip-seq{
  display:none;
  position:absolute;
  top:11px;
  left:12px;
  z-index:2;
  width:23px;
  height:23px;
  border:1px solid #d0d5dd;
  border-radius:999px;
  background:#f2f4f7;
  color:#475467;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:850;
  line-height:1;
  box-shadow:0 1px 2px rgba(16,24,40,.05);
}
@media(max-width:700px){
  #activeRows .compact-trip-seq{display:inline-flex}
  #activeRows .compact-trip-activity .compact-trip-label{padding-left:29px}
}
body.mobile-ui #activeRows .compact-trip-seq{display:inline-flex}
body.mobile-ui #activeRows .compact-trip-activity .compact-trip-label{padding-left:29px}


/* =======================================================
   v0.6.0.7 - Modern Live Trips Table (desktop only)
   - One compact Actions menu replaces three permanent buttons.
   - Zebra rows + hover affordance improve horizontal scanning.
   - Operational columns are ordered by status/location priority.
   - A slim left status accent differentiates trip state.
   - Mobile compact cards remain unchanged.
   ======================================================= */
@media(min-width:901px){
  #activeView{
    border-color:#e1e7ef;
    border-radius:16px;
    box-shadow:0 10px 30px rgba(16,24,40,.055);
    background:#fff;
  }
  #activeView .table-wrap{overflow:auto;background:#fff}
  #activeView .active-trips-table{
    min-width:1280px!important;
    table-layout:fixed;
    border-collapse:separate;
    border-spacing:0;
  }
  #activeView .active-trips-table thead th{
    position:relative;
    background:#f7f9fc;
    color:#475467;
    padding:13px 14px;
    border-bottom:1px solid #dfe5ec;
    font-size:10.5px;
    font-weight:850;
    letter-spacing:.025em;
    text-transform:uppercase;
  }
  #activeView .active-trips-table thead th:not(:last-child)::after{
    content:"";
    position:absolute;
    right:0;
    top:30%;
    width:1px;
    height:40%;
    background:#e7ebf0;
  }
  #activeView .active-trips-table th:nth-child(1){width:8%}
  #activeView .active-trips-table th:nth-child(2){width:11%}
  #activeView .active-trips-table th:nth-child(3){width:17%}
  #activeView .active-trips-table th:nth-child(4){width:14%}
  #activeView .active-trips-table th:nth-child(5){width:10%}
  #activeView .active-trips-table th:nth-child(6){width:11%}
  #activeView .active-trips-table th:nth-child(7){width:10%}
  #activeView .active-trips-table th:nth-child(8){width:9%}
  #activeView .active-trips-table th:nth-child(9){width:5%}
  #activeView .active-trips-table th:nth-child(10){width:5%;text-align:center}

  #activeRows tr{
    background:#fff;
    transition:background-color .14s ease,box-shadow .14s ease;
  }
  #activeRows tr:nth-child(even){background:#f8fafc}
  #activeRows tr:hover{background:#f7f4ff!important}
  #activeRows tr > td:not(.active-trip-compact-cell){
    background:transparent!important;
    min-height:74px;
    padding:14px;
    border-bottom:1px solid #edf1f5;
    color:#263244;
    line-height:1.4;
  }
  #activeRows tr:last-child > td:not(.active-trip-compact-cell){border-bottom:0}
  #activeRows tr > td:nth-child(2){box-shadow:inset 4px 0 0 #84caff;padding-left:17px}
  #activeRows tr.status-arrived-row > td:nth-child(2){box-shadow:inset 4px 0 0 #fdb022}
  #activeRows tr.attention-row > td:nth-child(2){box-shadow:inset 4px 0 0 #f97066}
  #activeRows tr.driver-arrival-row > td:nth-child(2){box-shadow:inset 4px 0 0 #2e90fa}
  #activeRows tr.return-origin-row > td:nth-child(2){box-shadow:inset 4px 0 0 #32d583}

  #activeRows .status-stack{gap:6px}
  #activeRows .status{
    padding:5px 8px;
    font-size:9.5px;
    letter-spacing:.025em;
  }
  #activeRows .exception-list{gap:4px;margin-top:1px;max-width:160px}
  #activeRows .exception-badge{font-size:8.8px;padding:3px 6px}
  #activeRows .driver-arrival-alert{
    min-width:0;
    max-width:160px;
    padding:7px 8px;
    border-radius:8px;
    box-shadow:none;
  }
  #activeRows .driver-arrival-alert-title{font-size:9px}
  #activeRows .driver-arrival-alert-time{font-size:8.8px}

  #activeRows .movement-line{
    color:#344054;
    font-size:12.5px;
    font-weight:750;
    line-height:1.45;
  }
  #activeRows .movement-key{
    color:#667085;
    font-size:8.8px;
    font-weight:850;
    letter-spacing:.035em;
  }
  #activeRows .movement-arrow{color:#9e77ed;padding:0 4px}
  #activeRows .leg-order{font-size:10px;margin-top:5px}
  #activeRows .activity-title{font-size:12.5px;color:#182230;font-weight:850}
  #activeRows .activity-stack .secondary{font-size:10.5px;margin-top:3px}
  #activeRows .desktop-plate-cell strong{font-size:12.5px;color:#101828;letter-spacing:.01em}
  #activeRows .driver-name{font-size:12px;color:#182230}
  #activeRows .driver-mobile-link{font-size:10.5px;color:#667085;font-weight:650;margin-top:3px}
  #activeRows .desktop-origin-cell,
  #activeRows .desktop-trip-type-cell,
  #activeRows .desktop-delivery-cell,
  #activeRows .desktop-truck-cell{font-size:11.5px}
  #activeRows .desktop-actions-cell{text-align:center;overflow:visible}
  #activeRows .mobile-trip-actions{display:none!important}
  #activeRows .desktop-trip-actions{display:flex;align-items:center;justify-content:center}

  .trip-actions-trigger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    min-width:88px;
    height:34px;
    padding:0 9px;
    border:1px solid #d6dbe4;
    border-radius:9px;
    background:#fff;
    color:#475467;
    font-size:11px;
    font-weight:800;
    box-shadow:0 1px 2px rgba(16,24,40,.04);
    transition:border-color .14s,background .14s,color .14s,box-shadow .14s;
  }
  .trip-actions-trigger:hover,
  .trip-actions-trigger[aria-expanded="true"]{
    border-color:#b692f6;
    background:#f9f5ff;
    color:#6941c6;
    box-shadow:0 0 0 3px rgba(105,65,198,.08);
  }
  .trip-actions-dots{font-size:17px;line-height:1;transform:translateY(-1px)}
  .trip-actions-caret{font-size:10px;color:#98a2b3;margin-left:1px}
}

.trip-actions-popover{
  position:fixed;
  z-index:95;
  width:218px;
  padding:6px;
  border:1px solid #e0e5ec;
  border-radius:12px;
  background:#fff;
  box-shadow:0 18px 42px rgba(16,24,40,.18),0 2px 8px rgba(16,24,40,.08);
}
.trip-actions-menu-item{
  width:100%;
  display:grid;
  grid-template-columns:28px minmax(0,1fr);
  align-items:center;
  gap:9px;
  padding:9px 10px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#344054;
  text-align:left;
}
.trip-actions-menu-item:hover:not(:disabled),
.trip-actions-menu-item:focus-visible:not(:disabled){background:#f7f4ff;color:#53389e;outline:none}
.trip-actions-menu-item + .trip-actions-menu-item{margin-top:2px}
.trip-actions-menu-item .trip-action-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:8px;
  background:#f2f4f7;
  font-size:14px;
  font-weight:850;
}
.trip-actions-menu-item.primary .trip-action-icon{background:#f4f3ff;color:#6941c6}
.trip-actions-menu-item.driver .trip-action-icon{background:#eff8ff;color:#175cd3}
.trip-actions-menu-item.notes .trip-action-icon{background:#fffaeb;color:#b54708}
.trip-actions-menu-item strong{display:block;font-size:11.5px;line-height:1.25}
.trip-actions-menu-item small{display:block;margin-top:2px;color:#98a2b3;font-size:9.5px;line-height:1.25;font-weight:600}
.trip-actions-menu-item:disabled{opacity:.45;cursor:not-allowed}

@media(max-width:900px){
  #activeRows .desktop-trip-actions{display:none!important}
  #activeRows .mobile-trip-actions{display:flex!important}
}
body.mobile-ui #activeRows .desktop-trip-actions{display:none!important}
body.mobile-ui #activeRows .mobile-trip-actions{display:flex!important}

/* Tablet card labels for the v0.6.0.7 desktop column order. */
@media(max-width:900px) and (min-width:701px){
  #activeRows td:nth-child(2)::before{content:"Fleet Ownership"}
  #activeRows td:nth-child(3)::before{content:"Status"}
  #activeRows td:nth-child(4)::before{content:"Route / Location"}
  #activeRows td:nth-child(5)::before{content:"Last Activity"}
  #activeRows td:nth-child(6)::before{content:"Plate"}
  #activeRows td:nth-child(7)::before{content:"Driver"}
  #activeRows td:nth-child(8)::before{content:"Trip Type"}
  #activeRows td:nth-child(9)::before{content:"Delivery Type"}
  #activeRows td:nth-child(10)::before{content:"Truck"}
  #activeRows td:nth-child(11)::before{display:none!important}
}


/* =======================================================
   v0.6.0.8 - Responsive Live Trips Table polish
   - In Transit summary uses the previous calm blue treatment.
   - Driver Arrival summary moves to a calm neutral grey.
   - Desktop live trips table now fills the available width without
     forcing a horizontal scrollbar.
   - Actions column keeps comfortable right-edge breathing room.
   ======================================================= */

/* Calm blue: actively moving trips. */
.transit-stat{
  background:linear-gradient(135deg,#eff8ff 0%,#dff1ff 100%);
  border-color:#b2ddff;
}
.transit-stat .stat-label{color:#1849a9;font-weight:800}
.transit-stat .stat-value{color:#175cd3}
.transit-stat .stat-hint{color:#1849a9}
.transit-stat:hover{border-color:#53b1fd}
.transit-stat.selected{border-color:#2e90fa;box-shadow:0 0 0 3px rgba(46,144,250,.12),var(--shadow)}

/* Calm neutral grey: driver has reported arrival but Ops has not confirmed yet. */
.driver-arrival-stat{
  background:linear-gradient(135deg,#f8fafc 0%,#eef2f6 100%);
  border-color:#d0d5dd;
}
.driver-arrival-stat .stat-label{color:#344054;font-weight:800}
.driver-arrival-stat .stat-value{color:#475467}
.driver-arrival-stat .stat-hint{color:#667085}
.driver-arrival-stat:hover{border-color:#98a2b3}
.driver-arrival-stat.selected{border-color:#667085;box-shadow:0 0 0 3px rgba(102,112,133,.10),var(--shadow)}

@media(min-width:901px){
  /* Fit the desktop table to the browser instead of enforcing 1280px. */
  #activeView .table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:hidden!important;
    overflow-y:visible;
  }
  #activeView .active-trips-table{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
  }
  #activeView .active-trips-table th,
  #activeRows tr > td:not(.active-trip-compact-cell){
    box-sizing:border-box;
  }

  /* Slightly rebalance columns so headers/actions fit without overflow. */
  #activeView .active-trips-table th:nth-child(1){width:9%}
  #activeView .active-trips-table th:nth-child(2){width:10%}
  #activeView .active-trips-table th:nth-child(3){width:17%}
  #activeView .active-trips-table th:nth-child(4){width:14%}
  #activeView .active-trips-table th:nth-child(5){width:10%}
  #activeView .active-trips-table th:nth-child(6){width:11%}
  #activeView .active-trips-table th:nth-child(7){width:9%}
  #activeView .active-trips-table th:nth-child(8){width:8%}
  #activeView .active-trips-table th:nth-child(9){width:5%}
  #activeView .active-trips-table th:nth-child(10){width:7%;text-align:center}

  /* Let long operational text wrap naturally inside its own column. */
  #activeRows .desktop-origin-cell,
  #activeRows .desktop-route-cell,
  #activeRows .desktop-activity-cell,
  #activeRows .desktop-plate-cell,
  #activeRows .desktop-driver-cell,
  #activeRows .desktop-trip-type-cell,
  #activeRows .desktop-delivery-cell,
  #activeRows .desktop-truck-cell{
    min-width:0!important;
    overflow-wrap:anywhere;
  }
  #activeRows .movement-line,
  #activeRows .activity-title,
  #activeRows .driver-name,
  #activeRows .desktop-plate-cell strong{
    white-space:normal;
  }

  /* Driver Arrival now uses the neutral summary-card accent. */
  #activeRows tr.driver-arrival-row > td:nth-child(2){box-shadow:inset 4px 0 0 #98a2b3}
  #activeRows .driver-arrival-alert{
    background:#f2f4f7;
    border-color:#d0d5dd;
    color:#344054;
  }
  #activeRows .driver-arrival-alert-title{color:#344054}
  #activeRows .driver-arrival-alert-time{color:#667085}

  /* Keep Actions visually inside the table edge. */
  #activeView .active-trips-table thead th.actions-head{
    padding-left:10px;
    padding-right:18px;
  }
  #activeRows .desktop-actions-cell{
    padding-left:10px!important;
    padding-right:18px!important;
  }
  #activeRows .desktop-trip-actions{
    width:100%;
    justify-content:flex-end;
  }
  .trip-actions-trigger{
    width:100%;
    min-width:0;
    max-width:94px;
    padding-left:7px;
    padding-right:7px;
    gap:4px;
  }
}

/* Extra compression for narrower desktop browser windows while preserving the table layout. */
@media(min-width:901px) and (max-width:1180px){
  #activeView .active-trips-table thead th{padding-left:9px;padding-right:9px;font-size:9.5px}
  #activeRows tr > td:not(.active-trip-compact-cell){padding:11px 9px}
  #activeRows .desktop-actions-cell{padding-left:7px!important;padding-right:12px!important}
  #activeView .active-trips-table thead th.actions-head{padding-left:7px;padding-right:12px}
  .trip-actions-trigger{height:32px;font-size:10px;gap:3px;padding-left:5px;padding-right:5px}
  .trip-actions-dots{font-size:15px}
  .trip-actions-caret{font-size:9px}
}


/* =======================================================
   v0.6.0.10 - Fleet Ownership scoped Web Push preferences
   ======================================================= */
.push-scope-divider{height:1px;background:#d6bbfb;margin:10px 0 12px}
.push-all-ownerships{border-bottom:0;padding-bottom:8px}
.push-ownership-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:3px 0 8px;transition:opacity .15s ease}
.push-ownership-options.disabled{opacity:.5}
.push-ownership-row{display:flex;align-items:center;gap:9px;min-height:40px;padding:9px 10px;border:1px solid #e4e7ec;border-radius:10px;background:#fff;cursor:pointer;font-size:11px;font-weight:800;color:#344054}
.push-ownership-row:hover{border-color:#b692f6;background:#fcfbff}
.push-ownership-row input{width:17px;height:17px;min-height:17px;flex:0 0 17px;margin:0}
.push-ownership-row input:disabled{cursor:not-allowed}
.push-ownership-empty{grid-column:1/-1;padding:10px 11px;border:1px dashed #d0d5dd;border-radius:9px;background:#fcfcfd;color:var(--muted);font-size:10.5px;line-height:1.4}
.push-scope-hint{margin-top:8px;padding:9px 10px;border-radius:9px;background:#f4f3ff;color:#53389e;font-size:10.5px;line-height:1.45}
@media(max-width:620px){.push-ownership-options{grid-template-columns:1fr}}
body.mobile-ui .push-ownership-options{grid-template-columns:1fr}


/* =======================================================
   v0.6.0.13 - Mobile identity, trip numbering & clean footer
   ======================================================= */
.app-footer{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  flex-wrap:wrap;
  font-weight:700;
}
.app-footer .footer-separator{color:#98a2b3;font-weight:700}

@media(max-width:900px){
  .brand-subtitle{display:none!important}
}
body.mobile-ui .brand-subtitle{display:none!important}

@media(max-width:700px){
  #activeRows .compact-trip-seq{
    width:32px;
    height:32px;
    top:8px;
    left:10px;
    font-size:16px;
    font-weight:900;
  }
  #activeRows .compact-trip-activity .compact-trip-label{padding-left:39px}
}
body.mobile-ui #activeRows .compact-trip-seq{
  width:32px;
  height:32px;
  top:8px;
  left:10px;
  font-size:16px;
  font-weight:900;
}
body.mobile-ui #activeRows .compact-trip-activity .compact-trip-label{padding-left:39px}

/* v0.6.1.1 - Simple Driver PWA control */
.driver-link-card{margin:14px 0;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface-soft,#f8fafc)}
.driver-link-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.driver-link-card-head>div{display:flex;flex-direction:column;gap:3px}
.driver-link-card-head strong{font-size:14px;color:var(--text)}
.driver-link-card-head span{font-size:12px;color:var(--muted);line-height:1.45}
.driver-app-enroll-grid{display:grid;grid-template-columns:minmax(240px,1.15fr) minmax(220px,1fr) minmax(190px,.85fr) auto;gap:12px;align-items:end}
.driver-app-enroll-grid .field{min-width:0;margin:0}
.driver-link-create-btn{min-width:190px;white-space:nowrap}
.driver-link-vehicle-hint{margin-top:9px;font-size:12px;line-height:1.45;color:var(--muted)}
.driver-link-vehicle-hint.error-text{color:var(--danger,#b42318)}
.driver-app-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}
.driver-app-summary>div{border:1px solid var(--border);border-radius:12px;padding:13px 14px;background:var(--surface-soft,#f8fafc);display:flex;align-items:center;justify-content:space-between;gap:10px}
.driver-app-summary span{font-size:12px;color:var(--muted)}
.driver-app-summary strong{font-size:22px}
.driver-app-code{font-size:24px;letter-spacing:3px;font-variant-numeric:tabular-nums}
.driver-link-search-row{display:grid;grid-template-columns:minmax(260px,1fr) auto;gap:12px;align-items:end;margin-bottom:12px}
.driver-link-search-row .field{margin:0}
.driver-link-filter-grid{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:12px}
.driver-link-filter-grid .field{min-width:0;margin:0}
.driver-link-filter-grid select,.driver-link-search-row input,.driver-app-enroll-grid input{width:100%;box-sizing:border-box}
.driver-link-filter-count{margin-top:11px;padding-top:10px;border-top:1px solid var(--border);font-size:12px;color:var(--muted)}
.driver-link-table-wrap{margin-top:14px}
.driver-link-table td{vertical-align:top}
.driver-link-table td strong+.secondary,.driver-link-table td .status+.status,.driver-link-table td a+.secondary{display:block;margin-top:4px}
@media(max-width:1250px){.driver-app-enroll-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.driver-link-create-btn{width:100%;min-width:0}.driver-link-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){.driver-link-card{padding:13px}.driver-app-enroll-grid,.driver-link-filter-grid,.driver-link-search-row,.driver-app-summary{grid-template-columns:1fr}.driver-link-create-btn,.driver-link-search-row>.btn{width:100%}.driver-app-code{font-size:22px}}
