/* RouteNest dark mode. Loaded last. Everything is scoped to html[data-theme=dark], so light mode is untouched. */
/* ---- theme switcher (both themes) ---- */
.theme-sw{display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--line);border-radius:999px;background:var(--card)}
.theme-sw button{all:unset;box-sizing:border-box;display:grid;place-items:center;width:30px;height:30px;border-radius:999px;cursor:pointer;color:var(--muted,#475467);transition:background .2s,color .2s}
.theme-sw button:hover{background:var(--p-soft,#ECF3F2);color:var(--ink,#101828)}
.theme-sw button[aria-pressed=true]{background:var(--p-soft,#ECF3F2);color:var(--p,#164B49);box-shadow:inset 0 0 0 1px var(--line)}
.theme-sw button:focus-visible{outline:2px solid #164B49;outline-offset:1px}
@media(max-width:700px){.theme-sw button{width:34px;height:34px}}
html.rn-theme-anim,html.rn-theme-anim *,html.rn-theme-anim *:before,html.rn-theme-anim *:after{transition:background-color .2s ease,color .2s ease,border-color .2s ease,fill .2s ease,stroke .2s ease!important}
@media(prefers-reduced-motion:reduce){html.rn-theme-anim,html.rn-theme-anim *{transition:none!important}}

/* ---- tokens ---- */
html[data-theme=dark]{color-scheme:dark;
  --bg:#0F1419;--card:#171E26;--surface:#202A33;--ink:#F1F5F9;--body:#F1F5F9;--muted:#B8C4D0;--faint:#94A3B8;
  --line:#303D47;--line2:#303D47;--field:#303D47;--p:#174747;--p-hover:#1D5656;--p-active:#143B3B;--p-soft:#203B3C;--p-soft2:#27484A;
  --ok:#4ADE80;--ok-bg:#153627;--warn:#FBBF24;--warn-bg:#392D16;--bad:#F87171;--bad-bg:#3B2026;--info:#60A5FA;--info-bg:#192F49;
  --accent:#80D5C9;--accent2:#80D5C9;--card2:#202A33;--hover:#26343D;--input:#131B22;--neutral:#A8B4C2;--neutral-bg:#29333D;
  --sh-card:none;--sh-modal:0 20px 48px rgba(0,0,0,.5);--shadow:none}
html[data-theme=dark] body,html[data-theme=dark] body.theme-company,html[data-theme=dark] body.theme-school,html[data-theme=dark] body.theme-admin,html[data-theme=dark] body.theme-field,html[data-theme=dark] body.theme-landing{
  --bg:#0F1419;--card:#171E26;--ink:#F1F5F9;--muted:#B8C4D0;--line:#303D47;--accent:#80D5C9;--accent2:#80D5C9;--p-soft:#203B3C;--p:#174747;--p2:#174747;--shadow:none;--kc:#80D5C9;
  background:#0F1419!important;color:#F1F5F9;color-scheme:dark}
html[data-theme=dark],html[data-theme=dark] body{background:#0F1419!important}
html[data-theme=dark] ::selection{background:#80D5C966;color:#F1F5F9}

/* ---- sidebar + header ---- */
html[data-theme=dark] body .shell .side{background:#171E26!important;border-inline-end:1px solid #303D47!important;color:#B8C4D0}
html[data-theme=dark] body .shell .side .brand,html[data-theme=dark] body .shell .side .brand b{color:#F1F5F9!important}
html[data-theme=dark] body .shell .side .brand small{color:#B8C4D0!important}
html[data-theme=dark] body .shell .side .brand{border-bottom-color:#303D47}
html[data-theme=dark] body .shell .side nav a{color:#B8C4D0}
html[data-theme=dark] body .shell .side nav a .ic{color:#94A3B8}
html[data-theme=dark] body .shell .side nav a:hover{background:#26343D;color:#F1F5F9}
html[data-theme=dark] body .shell .side nav a:hover .ic{color:#F1F5F9}
html[data-theme=dark] body .shell .side nav a.on{background:#203B3C!important;color:#80D5C9!important}
html[data-theme=dark] body .shell .side nav a.on .ic{color:#80D5C9!important}
html[data-theme=dark] body .shell .side-foot{background:#202A33!important;border-color:#303D47!important;color:#B8C4D0!important}
html[data-theme=dark] body .shell .side-foot small,html[data-theme=dark] body .shell .side-foot b{color:#B8C4D0!important}
html[data-theme=dark] .nav-sec{color:#94A3B8}
html[data-theme=dark] .topbar,html[data-theme=dark] .hdr-bar,html[data-theme=dark] body.theme-admin .topbar,html[data-theme=dark] body.theme-company .topbar,html[data-theme=dark] body.theme-school .topbar{background:#0F1419!important;border-bottom-color:#303D47!important;color:#F1F5F9}
html[data-theme=dark] .topbar h1,html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3{color:#F1F5F9}
html[data-theme=dark] .topbar small,html[data-theme=dark] small,html[data-theme=dark] .sub,html[data-theme=dark] h3.sec{color:#94A3B8}
html[data-theme=dark] .um-lang,html[data-theme=dark] .um-btn,html[data-theme=dark] .tools select,html[data-theme=dark] .tools .ghost{background:#171E26!important;color:#F1F5F9!important;border-color:#303D47!important}
html[data-theme=dark] .um-btn:hover{border-color:#80D5C9;box-shadow:none}
html[data-theme=dark] .um-btn .avatar,html[data-theme=dark] .avatar{background:#174747!important;color:#F1F5F9!important}
html[data-theme=dark] .um-id small,html[data-theme=dark] .um-caret,html[data-theme=dark] .um-drop svg{color:#B8C4D0}
html[data-theme=dark] .um-drop{background:#202A33;border-color:#303D47;box-shadow:0 12px 32px rgba(0,0,0,.5)}
html[data-theme=dark] .um-drop a:hover,html[data-theme=dark] .um-drop button.um-out:hover{background:#26343D;color:#80D5C9}
html[data-theme=dark] .um-drop button.um-out,html[data-theme=dark] .um-drop button.um-out svg{color:#F87171}
html[data-theme=dark] .um-drop button.um-out:hover{background:#3B2026;color:#F87171}
html[data-theme=dark] .menu-btn{background:#171E26;color:#F1F5F9}
html[data-theme=dark] .theme-school .banner .um-lang,html[data-theme=dark] .theme-school .banner .um-btn{background:#171E26!important;color:#F1F5F9!important}

/* ---- banners / hero ---- */
html[data-theme=dark] .theme-company .banner,html[data-theme=dark] .theme-school .banner,html[data-theme=dark] .hero-card,html[data-theme=dark] .theme-admin .hero-card,html[data-theme=dark] .theme-field .hdr{background:#174747!important;color:#F1F5F9!important;border:1px solid #303D47!important}
html[data-theme=dark] .hero-card h2,html[data-theme=dark] .hero-card p,html[data-theme=dark] .banner h1,html[data-theme=dark] .banner .b-text h1{color:#F1F5F9!important}
html[data-theme=dark] .hero-card small,html[data-theme=dark] .banner small,html[data-theme=dark] .b-text small{color:#80D5C9!important}

/* ---- cards, KPIs ---- */
html[data-theme=dark] .card,html[data-theme=dark] .kpi,html[data-theme=dark] .trip-card,html[data-theme=dark] .route-card,html[data-theme=dark] .map-card,html[data-theme=dark] .theme-company .kpi{background:#171E26!important;border:1px solid #303D47!important;box-shadow:none!important;color:#F1F5F9}
html[data-theme=dark] .theme-admin .kpi{background:#171E26!important}
html[data-theme=dark] .card:has(table),html[data-theme=dark] .card-h{border-color:#303D47!important;background:transparent}
html[data-theme=dark] .card-h b{color:#F1F5F9}
html[data-theme=dark] .kpi b,html[data-theme=dark] .kpi .k-v{color:#F1F5F9!important;text-shadow:none!important}
html[data-theme=dark] .kpi .k-l,html[data-theme=dark] .kpi small{color:#B8C4D0!important}
html[data-theme=dark] .kpi .k-ic,html[data-theme=dark] .kpi .k-icon,html[data-theme=dark] .kpi.t2 .k-ic,html[data-theme=dark] .kpi.t4 .k-ic{background:#203B3C!important;color:#80D5C9!important}
html[data-theme=dark] .kpi.k-amber b,html[data-theme=dark] .amt-unpaid{color:#FBBF24!important}
html[data-theme=dark] .kpi.k-amber .k-ic{background:#392D16!important;color:#FBBF24!important}
html[data-theme=dark] .empty-card,html[data-theme=dark] .empty{color:#94A3B8}
html[data-theme=dark] .empty-card .veh-svg{opacity:.35}

/* ---- buttons ---- */
html[data-theme=dark] button.pri,html[data-theme=dark] a.pri,html[data-theme=dark] button.sm.ok,html[data-theme=dark] .swal2-confirm{background:#80D5C9!important;color:#102C2D!important;border-color:#80D5C9!important}
html[data-theme=dark] button.pri:hover,html[data-theme=dark] a.pri:hover,html[data-theme=dark] button.sm.ok:hover{background:#9BE0D6!important;color:#102C2D!important}
html[data-theme=dark] button.sm,html[data-theme=dark] a.btn.sm,html[data-theme=dark] .btn.sm,html[data-theme=dark] button.ghost,html[data-theme=dark] .ghost,html[data-theme=dark] a.ghost,html[data-theme=dark] button.gray,html[data-theme=dark] .acts button,html[data-theme=dark] .acts a{background:#202A33;color:#F1F5F9;border:1px solid #303D47}
html[data-theme=dark] button.sm:hover,html[data-theme=dark] .btn.sm:hover,html[data-theme=dark] button.ghost:hover,html[data-theme=dark] .ghost:hover,html[data-theme=dark] .acts button:hover,html[data-theme=dark] .acts a:hover{background:#26343D!important;color:#F1F5F9!important;border-color:#3B4B57}
html[data-theme=dark] button.danger{background:#3B2026!important;color:#F87171!important;border-color:#5A2D35!important}
html[data-theme=dark] button:disabled,html[data-theme=dark] .pri:disabled{opacity:.5;cursor:not-allowed}
html[data-theme=dark] :is(button,a.btn,.um-btn,.menu-btn,summary,.paginate_button,[data-close],.rn-x):focus-visible,html[data-theme=dark] .theme-sw button:focus-visible{outline:2px solid #80D5C9;outline-offset:2px}
html[data-theme=dark] :is(nav a,.tabbar a,.um-drop a,.um-drop button):focus-visible{outline:2px solid #80D5C9}

/* ---- forms ---- */
html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea{background:#131B22!important;color:#F1F5F9!important;border-color:#303D47!important}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#94A3B8!important}
html[data-theme=dark] input:focus,html[data-theme=dark] select:focus,html[data-theme=dark] textarea:focus{border-color:#80D5C9!important;box-shadow:0 0 0 3px #80D5C933!important;outline:none}
html[data-theme=dark] input:disabled,html[data-theme=dark] select:disabled,html[data-theme=dark] textarea:disabled{background:#171E26!important;color:#94A3B8!important}
html[data-theme=dark] label{color:#B8C4D0}
html[data-theme=dark] input[type=checkbox],html[data-theme=dark] input[type=radio]{accent-color:#80D5C9}
html[data-theme=dark] input.is-invalid,html[data-theme=dark] select.is-invalid,html[data-theme=dark] textarea.is-invalid{border-color:#F87171!important}
html[data-theme=dark] .err,html[data-theme=dark] .invalid-feedback{color:#F87171}
html[data-theme=dark] select option{background:#171E26;color:#F1F5F9}

/* ---- tables / DataTables ---- */
html[data-theme=dark] table,html[data-theme=dark] table.dataTable{background:transparent!important;color:#F1F5F9}
html[data-theme=dark] thead th,html[data-theme=dark] table th{background:#202A33!important;color:#B8C4D0!important;border-color:#303D47!important}
html[data-theme=dark] tbody td,html[data-theme=dark] table td{border-color:#303D47!important;color:#F1F5F9;background:transparent!important}
html[data-theme=dark] tbody tr:hover,html[data-theme=dark] tbody tr:hover td,html[data-theme=dark] table tr:hover td{background:#26343D!important}
html[data-theme=dark] table.dataTable tbody tr{background:transparent!important}
html[data-theme=dark] .dataTables_wrapper .dataTables_length,html[data-theme=dark] .dataTables_wrapper .dataTables_filter,html[data-theme=dark] .dataTables_wrapper .dataTables_info,html[data-theme=dark] .dataTables_wrapper .dataTables_paginate{color:#B8C4D0!important}
html[data-theme=dark] .dataTables_wrapper .dataTables_paginate .paginate_button{background:#171E26!important;color:#F1F5F9!important;border:1px solid #303D47!important}
html[data-theme=dark] .dataTables_wrapper .dataTables_paginate .paginate_button.current,html[data-theme=dark] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{background:#203B3C!important;color:#80D5C9!important;border-color:#80D5C9!important}
html[data-theme=dark] .dataTables_wrapper .dataTables_paginate .paginate_button:hover{background:#26343D!important;color:#F1F5F9!important}
html[data-theme=dark] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled{opacity:.4!important}
html[data-theme=dark] .dataTables_empty{color:#94A3B8!important}
html[data-theme=dark] table.dataTable thead .sorting:before,html[data-theme=dark] table.dataTable thead .sorting:after,html[data-theme=dark] table.dataTable thead .sorting_asc:before,html[data-theme=dark] table.dataTable thead .sorting_desc:after{color:#B8C4D0}

/* ---- status pills ---- */
html[data-theme=dark] .pill,html[data-theme=dark] .badge{background:#29333D!important;color:#B8C4D0!important}
html[data-theme=dark] .pill.green,html[data-theme=dark] .badge.green,html[data-theme=dark] body .pill.green{background:#153627!important;color:#4ADE80!important}
html[data-theme=dark] .pill.orange,html[data-theme=dark] .badge.orange,html[data-theme=dark] body .pill.orange{background:#392D16!important;color:#FBBF24!important}
html[data-theme=dark] .pill.red,html[data-theme=dark] .badge.red,html[data-theme=dark] body .pill.red{background:#3B2026!important;color:#F87171!important}
html[data-theme=dark] .pill.blue,html[data-theme=dark] .badge.blue,html[data-theme=dark] body .pill.blue{background:#192F49!important;color:#60A5FA!important}
html[data-theme=dark] .pill.purple{background:#2A2447!important;color:#B7A7FF!important}
html[data-theme=dark] .pill.brand,html[data-theme=dark] .chip{background:#203B3C!important;color:#80D5C9!important}
html[data-theme=dark] .banner-alert{background:#3B2026!important;color:#F87171!important;border-color:#5A2D35!important}
html[data-theme=dark] .live{color:#4ADE80}

/* ---- menus, dialogs, tooltips, toasts ---- */
html[data-theme=dark] .acts-pop,html[data-theme=dark] .menu,html[data-theme=dark] .dropdown,html[data-theme=dark] [data-menu]{background:#202A33!important;border-color:#303D47!important;box-shadow:0 12px 32px rgba(0,0,0,.5)!important}
html[data-theme=dark] .acts-pop button,html[data-theme=dark] .acts-pop a,html[data-theme=dark] .menu a{color:#F1F5F9!important;border:0!important}
html[data-theme=dark] .acts-pop button:hover,html[data-theme=dark] .acts-pop a:hover,html[data-theme=dark] .menu a:hover{background:#26343D!important;color:#F1F5F9!important}
html[data-theme=dark] .acts-pop .mi svg{color:#B8C4D0}
html[data-theme=dark] .acts-pop button.danger,html[data-theme=dark] .acts-pop .mi.danger{color:#F87171!important}
html[data-theme=dark] .acts-pop button.danger:hover{background:#3B2026!important}
html[data-theme=dark] .rn-dialog,html[data-theme=dark] dialog{background:#171E26!important;color:#F1F5F9;border:1px solid #303D47;box-shadow:0 24px 60px rgba(0,0,0,.6)}
html[data-theme=dark] .rn-head{background:#171E26!important;border-bottom-color:#303D47!important}
html[data-theme=dark] .rn-head b,html[data-theme=dark] dialog h3,html[data-theme=dark] dialog .m-title{color:#F1F5F9!important}
html[data-theme=dark] .rn-x{color:#B8C4D0;background:transparent}
html[data-theme=dark] .rn-backdrop,html[data-theme=dark] dialog::backdrop{background:rgba(5,8,11,.65)}
html[data-theme=dark] .rn-toast{background:#202A33;color:#F1F5F9;border:1px solid #303D47;box-shadow:0 10px 30px rgba(0,0,0,.5)}
html[data-theme=dark] .rn-toast.bad{background:#3B2026;color:#F87171;border-color:#5A2D35}
html[data-theme=dark] .swal2-popup{background:#171E26!important;color:#F1F5F9!important;border:1px solid #303D47}
html[data-theme=dark] .swal2-title,html[data-theme=dark] .swal2-html-container{color:#F1F5F9!important}
html[data-theme=dark] .swal2-cancel{background:#202A33!important;color:#F1F5F9!important;border:1px solid #303D47!important}
html[data-theme=dark] .swal2-popup.swal2-toast{background:#202A33!important}
html[data-theme=dark] [title]{color-scheme:dark}

/* ---- charts (bars, donut, rings) ---- */
html[data-theme=dark] .bar,html[data-theme=dark] .hb-track,html[data-theme=dark] .road-bar{background:#29333D!important}
html[data-theme=dark] .bar i,html[data-theme=dark] .hb-track i,html[data-theme=dark] .road-bar>i,html[data-theme=dark] .bar-fill{background:#80D5C9!important}
html[data-theme=dark] .bars .bar-fill:nth-child(4n+2){background:#4E9B95!important}
html[data-theme=dark] .bars .bar-fill:nth-child(4n+3){background:#3B777B!important}
html[data-theme=dark] .bars .bar-fill:nth-child(4n){background:#A7C4C1!important}
html[data-theme=dark] .bar-lbl,html[data-theme=dark] .bar-val,html[data-theme=dark] .legend li,html[data-theme=dark] .ring-c span,html[data-theme=dark] .donut .d-bot{color:#B8C4D0!important}
html[data-theme=dark] .donut .d-top,html[data-theme=dark] .ring-c b{color:#F1F5F9!important}
html[data-theme=dark] svg text{fill:#B8C4D0}
html[data-theme=dark] svg line.grid,html[data-theme=dark] svg .gridline{stroke:#303D47}

/* ---- maps: real dark tiles come from the tile layer (RNTheme.tiles), never a CSS filter ---- */
html[data-theme=dark] .leaflet-tile,html[data-theme=dark] .leaflet-container img.leaflet-tile{filter:none!important}
html[data-theme=dark] .leaflet-container{background:#0F1419!important}
html[data-theme=dark] .leaflet-bar a{background:#202A33;color:#F1F5F9;border-color:#303D47}
html[data-theme=dark] .leaflet-bar a:hover{background:#26343D;color:#F1F5F9}
html[data-theme=dark] .leaflet-control-attribution{background:rgba(15,20,25,.8)!important;color:#B8C4D0!important}
html[data-theme=dark] .leaflet-control-attribution a{color:#80D5C9!important}
html[data-theme=dark] .leaflet-popup-content-wrapper,html[data-theme=dark] .leaflet-popup-tip{background:#202A33;color:#F1F5F9}
html[data-theme=dark] .leaflet-tooltip{background:#202A33;color:#F1F5F9;border-color:#303D47}
html[data-theme=dark] .map-card,html[data-theme=dark] #map{background:#0F1419}

/* ---- chat ---- */
html[data-theme=dark] .chat-list,html[data-theme=dark] .chat-pane,html[data-theme=dark] .chat-box{background:#171E26!important;border-color:#303D47!important}

/* ---- landing / login ---- */
html[data-theme=dark] body.theme-landing,html[data-theme=dark] .l-hero{background:#0F1419!important}
html[data-theme=dark] .l-hero{background:#174747!important}
html[data-theme=dark] .l-card,html[data-theme=dark] .l-login,html[data-theme=dark] .login-card{background:#171E26!important;color:#F1F5F9;border:1px solid #303D47}

/* ---- fixes from screenshot review ---- */
html[data-theme=dark] .theme-sw button[aria-pressed=true]{background:#203B3C;color:#80D5C9}
html[data-theme=dark] .theme-sw button:hover{background:#26343D;color:#F1F5F9}
html[data-theme=dark] .crumb,html[data-theme=dark] .t-title small,html[data-theme=dark] .topbar small{color:#94A3B8!important}
html[data-theme=dark] .brand .logo,html[data-theme=dark] .shell .side .brand .logo{background:#203B3C!important;color:#80D5C9!important;border-radius:10px}
html[data-theme=dark] .brand .logo svg,html[data-theme=dark] .banner .b-ic,html[data-theme=dark] .banner .b-ic svg{color:#80D5C9}

/* ---- row actions ---- */
html[data-theme=dark] td .acts button.sm,html[data-theme=dark] td .acts a,html[data-theme=dark] .acts button.sm,html[data-theme=dark] .acts a.sm,html[data-theme=dark] .acts button.acts-dots{background:#202A33!important;color:#F1F5F9!important;border:1px solid #303D47!important}
html[data-theme=dark] td .acts button.sm:hover,html[data-theme=dark] .acts button.sm:hover,html[data-theme=dark] td .acts a:hover{background:#26343D!important;border-color:#3B4B57!important;color:#F1F5F9!important}
html[data-theme=dark] td .acts button.danger,html[data-theme=dark] .acts button.danger{background:#3B2026!important;color:#F87171!important;border-color:#5A2D35!important}
html[data-theme=dark] td .acts button.danger:hover,html[data-theme=dark] .acts button.danger:hover{background:#4A2630!important}
html[data-theme=dark] td .acts button.ok,html[data-theme=dark] .acts button.ok{background:#80D5C9!important;color:#102C2D!important;border-color:#80D5C9!important}
html[data-theme=dark] .acts-pop button,html[data-theme=dark] .acts-pop a,html[data-theme=dark] table td .acts .acts-pop button,html[data-theme=dark] table td .acts .acts-pop a{background:none!important;border:0!important;color:#F1F5F9!important}
html[data-theme=dark] .acts-pop button:hover,html[data-theme=dark] .acts-pop a:hover{background:#26343D!important}
/* ---- chat ---- */
html[data-theme=dark] .chat-wrap,html[data-theme=dark] .chat-pane,html[data-theme=dark] .chat-list,html[data-theme=dark] .chat-msgs,html[data-theme=dark] .chat-placeholder{background:#171E26!important;border-color:#303D47!important;color:#B8C4D0}
html[data-theme=dark] .chat-list-h,html[data-theme=dark] .chat-pane-h{color:#F1F5F9;border-color:#303D47}
html[data-theme=dark] .chat-th{background:#171E26!important;border-bottom-color:#303D47!important;color:#F1F5F9}
html[data-theme=dark] .chat-th:hover{background:#26343D!important}
html[data-theme=dark] .chat-th.on{background:#203B3C!important}
html[data-theme=dark] .th-name{color:#F1F5F9}html[data-theme=dark] .th-sub,html[data-theme=dark] .th-tx{color:#B8C4D0}
html[data-theme=dark] .th-av{background:#174747;color:#F1F5F9}
html[data-theme=dark] .msg-b{background:#202A33!important;border-color:#303D47!important}
html[data-theme=dark] .msg.me .msg-b{background:#203B3C!important;border-color:#2F5A5B!important}
html[data-theme=dark] .msg-t,html[data-theme=dark] .msg.me .msg-t{color:#F1F5F9!important}
html[data-theme=dark] .msg-m,html[data-theme=dark] .msg.me .msg-m{color:#B8C4D0!important}
html[data-theme=dark] .chat-composer{background:#171E26!important;border-top-color:#303D47!important}
html[data-theme=dark] .chat-empty{color:#94A3B8}
html[data-theme=dark] td button.sm,html[data-theme=dark] td a.btn,html[data-theme=dark] td a.sm,html[data-theme=dark] .card button.sm:not(.pri):not(.ok):not(.danger),html[data-theme=dark] .card a.btn.sm{background:#202A33!important;color:#F1F5F9!important;border:1px solid #303D47!important;box-shadow:none!important}
html[data-theme=dark] td button.sm:hover,html[data-theme=dark] td a.btn:hover{background:#26343D!important}
html[data-theme=dark] td button.sm.ok{background:#80D5C9!important;color:#102C2D!important;border-color:#80D5C9!important}
html[data-theme=dark] td button.sm.danger{background:#3B2026!important;color:#F87171!important;border-color:#5A2D35!important}
html[data-theme=dark] .theme-admin .hero-card,html[data-theme=dark] .hero-card{box-shadow:none!important}

/* ---- landing / login / register ---- */
html[data-theme=dark] .l-card{background:#171E26!important;border:1px solid #303D47;box-shadow:0 24px 70px rgba(0,0,0,.5)}
html[data-theme=dark] .l-card h2,html[data-theme=dark] .l-card h3{color:#F1F5F9}
html[data-theme=dark] .l-card form label,html[data-theme=dark] .l-sub{color:#B8C4D0}
html[data-theme=dark] .l-card input{background:#131B22!important;color:#F1F5F9!important;border-color:#303D47!important}
html[data-theme=dark] .l-card input:focus{border-color:#80D5C9!important;box-shadow:0 0 0 3px #80D5C933!important}
html[data-theme=dark] .l-card button.pri{background:#80D5C9;color:#102C2D}
html[data-theme=dark] .l-card a{color:#80D5C9}
html[data-theme=dark] .l-demo,html[data-theme=dark] .l-demo p,html[data-theme=dark] .l-demo b,html[data-theme=dark] .l-demo small{color:#B8C4D0}
html[data-theme=dark] .role,html[data-theme=dark] button.role{background:#202A33!important;color:#F1F5F9!important;border:1px solid #303D47!important}
html[data-theme=dark] .role:hover{background:#26343D!important}
html[data-theme=dark] .l-err{background:#3B2026;color:#F87171;border-color:#5A2D35}
.l-top .theme-sw{background:rgba(247,246,242,.12);border-color:rgba(247,246,242,.35)}
.l-top .theme-sw button{color:#F7F6F2}
.l-top .theme-sw button:hover{background:rgba(247,246,242,.2);color:#fff}
.l-top .theme-sw button[aria-pressed=true]{background:#F7F6F2;color:#184E4A;box-shadow:none}
html[data-theme=dark] .l-top .theme-sw button[aria-pressed=true]{background:#80D5C9;color:#102C2D}
.l-top{flex-wrap:wrap}
.l-top .brand{margin-inline-end:auto}
@media(max-width:480px){.l-top .brand{flex:1 0 100%;margin-bottom:6px}.l-top .theme-sw button{width:34px;height:34px}}
html[data-theme=dark] .l-top select{background:rgba(247,246,242,.12)!important;color:#F7F6F2!important;border-color:rgba(247,246,242,.35)!important}

/* ---- narrow headers: the appearance selector sits on its own row so the page title never wraps per letter ---- */
@media(max-width:700px){
  html body .topbar{flex-wrap:wrap!important}
  html body .topbar .t-title{flex:1 1 0;min-width:140px}
  html body .topbar .umenu{flex:1 1 100%;order:5;display:flex;justify-content:flex-end;align-items:center;gap:8px}
  html body .topbar .umenu .um-lang{width:auto!important;min-width:76px!important}
}

/* ETA chip ("Waiting for GPS") */
html[data-theme=dark] .eta,html[data-theme=dark] .eta.wait,html[data-theme=dark] .trip-card .eta{background:#392D16!important;color:#FBBF24!important;border-color:#4a3a1c!important;box-shadow:none!important}

/* ---- final polish ---- */
html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea,html[data-theme=dark] .um-lang,html[data-theme=dark] .dataTables_wrapper select,html[data-theme=dark] .dataTables_wrapper input{border-color:#3D4B58!important}
html[data-theme=dark] input:focus,html[data-theme=dark] select:focus,html[data-theme=dark] textarea:focus{border-color:#80D5C9!important}
html[data-theme=dark] label,html[data-theme=dark] .lbl,html[data-theme=dark] .hint,html[data-theme=dark] .help,html[data-theme=dark] .crumb,html[data-theme=dark] .t-title small{color:#B8C4D0!important}
html[data-theme=dark] thead th,html[data-theme=dark] table th{background:#202A33!important;color:#B8C4D0!important}
html[data-theme=dark] tbody tr:hover,html[data-theme=dark] tbody tr:hover td,html[data-theme=dark] table tr:hover td{background:#202C35!important}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#94A3B8!important;opacity:1}
/* secondary + danger buttons */
html[data-theme=dark] button.danger,html[data-theme=dark] a.danger,html[data-theme=dark] button.sm.danger,html[data-theme=dark] .swal2-confirm.swal-danger{background:#F87171!important;color:#2A0F12!important;border-color:#F87171!important;font-weight:600}
html[data-theme=dark] button.danger:hover,html[data-theme=dark] button.sm.danger:hover,html[data-theme=dark] .swal2-confirm.swal-danger:hover{background:#FB8A8A!important}
html[data-theme=dark] button.sm,html[data-theme=dark] button.ghost,html[data-theme=dark] a.ghost{color:#F1F5F9}
html[data-theme=dark] button.sm:not(.pri):not(.ok):not(.danger),html[data-theme=dark] button.ghost{background:#202A33;border-color:#3D4B58}
html[data-theme=dark] button:disabled,html[data-theme=dark] .sm:disabled{background:#202A33!important;color:#94A3B8!important;border-color:#303D47!important;opacity:1;cursor:not-allowed}
html[data-theme=dark] .swal2-popup{border:1px solid #303D47;box-shadow:0 12px 32px rgba(0,0,0,.45)}
html[data-theme=dark] .swal2-title{color:#F1F5F9}
html[data-theme=dark] .swal2-html-container{color:#B8C4D0}
/* light mode: red destructive confirm */
.swal2-confirm.swal-danger{background:#B42318!important;color:#fff!important}
/* GPS status colors, one source: --st-live / --st-wait / --st-lost / --st-off. Text, dot and badge use the same variable. */
html[data-theme=dark]{--st-live:#4ADE80;--st-wait:#FBBF24;--st-lost:#F87171;--st-off:#94A3B8}
html[data-theme=dark] .live{color:var(--st-live)}html[data-theme=dark] .live i{background:var(--st-live)}
html[data-theme=dark] .live.wait{color:var(--st-wait)}html[data-theme=dark] .live.wait i{background:var(--st-wait)}
html[data-theme=dark] .live.lost{color:var(--st-lost)}html[data-theme=dark] .live.lost i{background:var(--st-lost);animation:none}
html[data-theme=dark] .live.off{color:var(--st-off)}html[data-theme=dark] .live.off i{background:var(--st-off)}
html[data-theme=dark] .eta.wait,html[data-theme=dark] .trip-card .eta.wait{color:var(--st-wait)!important}
html[data-theme=dark] .wait-n{color:var(--st-wait)}
/* Mobile hamburger in Dark Mode */
html[data-theme=dark] .menu-btn{background:#202A33!important;border:1px solid #3D4B58!important;box-shadow:none!important}
html[data-theme=dark] .menu-btn span{background:#E2E8F0!important}
html[data-theme=dark] .menu-btn:hover{background:#26323D!important}

/* Appearance selector. Desktop: the three inline icons (unchanged). */
.theme-sw .ts-trigger,.theme-sw .ts-l,.theme-sw .ts-i{display:none}
.ts-menu{display:contents}
/* Mobile (<=700px): one trigger icon with an anchored dropdown: Sun Light / Moon Dark / Monitor System. */
@media(max-width:700px){
  .topbar,.hdr-bar{z-index:1200!important}
  .menu-btn{z-index:1250!important}
  .theme-sw{position:relative;padding:0;gap:0;width:40px;height:40px;flex:0 0 40px;justify-content:center}
  .theme-sw .ts-trigger{all:unset;box-sizing:border-box;display:grid;place-items:center;width:38px;height:38px;border-radius:999px;cursor:pointer;color:var(--ink,#101828)}
  .ts-trigger:focus-visible{outline:2px solid #80D5C9;outline-offset:2px}
  html[data-theme-mode=light] .theme-sw .ts-i.ts-light,html[data-theme-mode=dark] .theme-sw .ts-i.ts-dark,html[data-theme-mode=system] .theme-sw .ts-i.ts-system{display:grid}
  .ts-menu{display:none;position:absolute;top:calc(100% + 6px);inset-inline-end:0;min-width:168px;max-width:calc(100vw - 24px);padding:6px;background:var(--card,#fff);border:1px solid var(--line,#E4E7EC);border-radius:14px;box-shadow:0 12px 32px rgba(0,0,0,.28);z-index:1300;flex-direction:column;gap:2px}
  .theme-sw.open .ts-menu{display:flex}
  .theme-sw .ts-menu button{display:flex;align-items:center;gap:10px;width:100%;height:44px;padding:0 12px;border-radius:10px;justify-content:flex-start;color:var(--ink,#101828)}
  .theme-sw .ts-l{display:inline;font-size:14px;font-weight:600}
  .theme-sw .ts-menu button[aria-pressed=true]{background:var(--p-soft,#ECF3F2);color:var(--p,#164B49);box-shadow:inset 0 0 0 1px var(--line)}
  html[data-theme=dark] .ts-trigger{color:#E2E8F0}
  html[data-theme=dark] .ts-menu{background:#202A33;border-color:#3D4B58}
  html[data-theme=dark] .theme-sw .ts-menu button{color:#E2E8F0}
  html[data-theme=dark] .theme-sw .ts-menu button[aria-pressed=true]{background:#203B3C;color:#80D5C9}
  html[data-theme=dark] .theme-sw .ts-menu button:hover{background:#26343D}
}
/* Confirmation dialog warning icon: 52 px */
.swal2-popup .swal2-icon{width:52px;height:52px;margin:1.4em auto .4em;border-width:3px}
.swal2-popup .swal2-icon .swal2-icon-content{font-size:2.2rem}
html[data-theme=dark] .chat-back{background:#202A33!important;border-color:#3D4B58!important;color:#F1F5F9!important}
html[data-theme=dark] .card-h a.ghost,html[data-theme=dark] .card-h .ghost{background:#202A33!important;color:#F1F5F9!important;border:1px solid #3D4B58!important}
html[data-theme=dark] .amt-unpaid .cur-sym{color:#94A3B8!important}
html[data-theme=dark] .card-h a.sm.ghost:before{background:currentColor!important;-webkit-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") no-repeat center/contain;mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") no-repeat center/contain}

html[data-theme=dark] button.icon.view{background:#1E2B33!important;border-color:#33444D!important;color:#8FE3D6!important}
html[data-theme=dark] button.icon.view:hover{background:#26343D!important}
html[data-theme=dark] .rn-detail dt,html[data-theme=dark] .rn-detail dd{border-color:#2C3A43}
html[data-theme=dark] .rn-detail dt{color:#9FB0B8}
html[data-theme=dark] .rn-detail dd{color:#F1F5F9}
html[data-theme=dark] .rn-detail h4{color:#8FE3D6}
