/* /assets/app.css */
/* === GlobalLink GPS — tokeny interfejsu (jedyne zrodlo prawdy) ===
   Pelny standard: docs/ui-standard.md. Nowe moduly MUSZA uzywac tych zmiennych,
   zamiast wpisywac kolory, rozmiary i odstepy na sztywno. */
:root{
  color-scheme:light;
  /* Marka — pomaranczowy WYLACZNIE jako subtelny akcent */
  --orange:#F58220;--orange-dark:#B45C0B;--orange-soft:rgba(245,130,32,.10);
  /* Baza neutralna */
  --bg:#F5F6F8;--ink:#202630;--dark:#202630;--muted:#667085;--line:#E4E7EC;
  /* Statusy — stosowane zgodnie ze znaczeniem danych */
  --green:#15966B;--red:#B42318;--amber:#B54708;--neutral:#667085;
  /* Powierzchnie (menu boczne i pasek gorny sa biale) */
  --sidebar:#FFFFFF;--sidebar-hover:#F2F4F7;
  /* Typografia */
  --font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --fs-help:12px;--fs-small:13px;--fs-body:14px;--fs-section:16px;--fs-head:18px;--fs-page:22px;
  /* Odstepy: 4 / 8 / 12 / 16 / 24 / 32 */
  --sp-1:4px;--sp-2:8px;--sp-3:12px;--sp-4:16px;--sp-5:24px;--sp-6:32px;
  /* Ksztalt i wysokosci kontrolek */
  --radius-control:8px;--radius-card:12px;--radius-pill:999px;--control-h:40px;
  --shadow-card:0 1px 2px rgba(16,24,40,.04);--shadow-pop:0 8px 24px rgba(16,24,40,.10);
  --focus-ring:0 0 0 3px rgba(245,130,32,.24);
  font-family:var(--font)
}
*{box-sizing:border-box;font-family:inherit}
body{margin:0;font:var(--fs-body)/1.5 var(--font);color:var(--ink);background:var(--bg)}
button,input,select,textarea,table,dialog,.leaflet-container,.leaflet-popup{font-family:var(--font)}
code,pre,kbd,samp{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
.ui-title-with-icon{display:flex;align-items:center;gap:10px}
.ui-icon{display:inline-grid;place-items:center;flex:0 0 auto;width:30px;height:30px;border-radius:var(--radius-control);background:var(--sidebar-hover);color:var(--muted)}
.ui-icon svg{display:block;width:18px;height:18px}
.ui-icon-online{background:#e8f5ef;color:#17845b}
.ui-icon-offline{background:#fbecea;color:#b7443e}
.ui-icon-profile{border-radius:50%}
.ui-menu-icon{width:22px;height:22px;border-radius:6px;background:transparent}
.ui-menu-icon svg{width:18px;height:18px}
button{border:0;border-radius:var(--radius-control);padding:10px 16px;cursor:pointer;font-size:var(--fs-body)}
.primary,.secondary,.danger,.login-card button{min-height:var(--control-h);font-weight:600}
.hidden{display:none!important}
.preloader{position:fixed;inset:0;z-index:99999;display:grid;place-items:center;background:rgba(244,246,249,.88);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);opacity:1;visibility:visible;transition:opacity .24s ease,visibility .24s ease}
.preloader.preloader-done{opacity:0;visibility:hidden;pointer-events:none}
.preloader-logo{display:block;width:170px;max-width:38vw;max-height:34vh;height:auto;object-fit:contain;filter:drop-shadow(0 12px 24px rgba(42,45,52,.16));animation:preloader-pulse 1.15s ease-in-out infinite}
@keyframes preloader-pulse{0%,100%{transform:scale(.96);opacity:.72}50%{transform:scale(1);opacity:1}}
@media(prefers-reduced-motion:reduce){.preloader-logo{animation:none}.preloader{transition:none}}
.login{min-height:100vh;display:grid;place-items:center;background:var(--bg)}
.login-card{width:min(430px,92vw);background:var(--surface,#fff);padding:var(--sp-6);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow-pop)}
.login-brand-logo{display:block;width:min(285px,100%);height:auto;margin:0 auto 14px;object-fit:contain}
.login-card .login-slogan{color:var(--muted);margin:0 0 var(--sp-5);text-align:center;font-size:var(--fs-section);font-weight:500}
label{display:grid;gap:var(--sp-2);margin:var(--sp-3) 0;color:var(--muted);font-size:var(--fs-small)}
input,select,textarea{width:100%;min-height:var(--control-h);border:1px solid var(--line);border-radius:var(--radius-control);padding:9px 12px;background:var(--surface,#fff);color:var(--ink);font-size:var(--fs-body)}
.login-card button,.primary{background:var(--orange);color:#fff;font-weight:700}
.primary:hover,.login-card button:hover{background:var(--orange-dark)}
.login-card button{width:100%;margin-top:10px}
.login-card .login-link{background:transparent;color:var(--orange-dark);font-weight:600;margin-top:12px;padding:7px;box-shadow:none}
.login-card .login-link:hover{background:var(--sidebar-hover);color:var(--orange-dark)}
.login-card h3{margin:2px 0 8px;text-align:center;color:var(--ink)}
.login-help{margin:0 0 18px;color:var(--muted);font-size:14px;line-height:1.45;text-align:center}
.login-message{margin-top:12px;color:#17845b;font-size:14px;line-height:1.4;text-align:center}
.login-card .error{margin-top:12px;text-align:center}
.login-card button:disabled{opacity:.6;cursor:wait}
.login-card .login-remember{display:flex;align-items:center;gap:9px;margin:11px 0 3px;color:#667085;font-size:14px;cursor:pointer}
.login-card .login-remember input{width:17px;height:17px;margin:0;accent-color:var(--orange)}
.login-privacy{margin-top:20px;padding-top:16px;border-top:1px solid var(--line);color:var(--muted);font-size:var(--fs-help);line-height:1.5;text-align:center}
.login-privacy a{color:var(--orange-dark);font-weight:600;text-decoration:none}
.login-privacy a:hover{text-decoration:underline}
.shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh;transition:grid-template-columns .22s ease}
.shell>aside{background:var(--sidebar);color:var(--ink);display:flex;flex-direction:column;border-right:1px solid var(--line)}
.brand{width:100%;height:72px;display:flex;align-items:center;justify-content:center;padding:12px 18px;border-radius:0;border-bottom:1px solid var(--line);background:transparent;color:inherit;cursor:pointer}
.brand:hover,.brand:focus-visible{background:var(--sidebar-hover)}
.brand-logo{display:block;width:100%;max-width:170px;height:44px;object-fit:contain}
.brand-icon{display:none;width:46px;height:46px;object-fit:contain}
.shell>aside nav{padding:18px 10px;display:grid;gap:5px}
.shell>aside nav button{display:flex;align-items:center;gap:10px;min-height:40px;background:transparent;color:var(--muted);text-align:left;font-size:var(--fs-body);padding:10px 14px;border-left:3px solid transparent;border-radius:0 var(--radius-control) var(--radius-control) 0}
.shell>aside nav button:hover{background:var(--sidebar-hover);color:var(--ink)}
.shell>aside nav button.active{background:var(--sidebar-hover);color:var(--ink);border-left-color:var(--orange);font-weight:600}
.shell>aside nav button span{margin-left:0}
.shell>aside nav button .nav-icon{display:block;flex:0 0 auto;width:20px;height:20px}
.shell>aside,.shell>aside nav button,.brand{transition:width .22s ease,padding .22s ease,background-color .16s ease}
@media(min-width:1025px){
  body.sidebar-collapsed .shell{grid-template-columns:76px 1fr}
  body.sidebar-collapsed .brand{padding:12px 8px}
  body.sidebar-collapsed .brand-logo,body.sidebar-collapsed .shell>aside nav span,body.sidebar-collapsed .aside-foot{display:none}
  body.sidebar-collapsed .brand-icon{display:block}
  body.sidebar-collapsed .shell>aside nav{padding-right:8px;padding-left:8px}
  body.sidebar-collapsed .shell>aside nav button{justify-content:center;padding-right:10px;padding-left:10px}
  body.sidebar-collapsed .shell>aside nav button .nav-icon{width:22px;height:22px}
}
.aside-foot{margin-top:auto;padding:var(--sp-4);color:var(--muted);border-top:1px solid var(--line)}
main{min-width:0}
header{height:72px;background:var(--surface,#fff);display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);padding:0 var(--sp-5);border-bottom:1px solid var(--line)}
.page-heading{display:flex;align-items:center;gap:8px;min-width:0;margin-right:auto;margin-left:0}
.page-heading-logo{display:block;flex:0 0 auto;width:28px;height:28px;object-fit:contain}
header h2{margin:0;min-width:0;overflow:hidden;color:var(--ink);font-size:var(--fs-page);font-weight:650;text-overflow:ellipsis;white-space:nowrap}
header>div{display:flex;align-items:center;gap:15px}
.live{color:var(--green)}
#content{width:100%;min-width:0;padding:var(--sp-5)}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--sp-4)}
.card,.panel{background:var(--surface,#fff);border:1px solid var(--line);border-radius:var(--radius-card);padding:var(--sp-5);box-shadow:var(--shadow-card)}
.card span{color:var(--muted);font-size:var(--fs-small)}
.card strong{display:block;font-size:28px;margin-top:var(--sp-2);color:var(--ink)}
.card.orange{border-top:2px solid var(--orange)}
.panel{margin-top:var(--sp-4)}
.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.panel h3{margin:0 0 var(--sp-4);color:var(--ink);font-size:var(--fs-section)}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:12px 14px;border-bottom:1px solid var(--line)}
th{font-size:var(--fs-help);color:var(--muted);text-transform:uppercase;font-weight:600;letter-spacing:.02em}
.badge{display:inline-block;padding:4px 10px;border-radius:var(--radius-pill);background:var(--sidebar-hover);color:var(--muted);font-size:var(--fs-help);font-weight:600}
.badge.online{background:#E6F4EE;color:#0B7A55}
.badge.offline{background:#FDECEA;color:#B42318}
.badge.inactive{background:var(--sidebar-hover);color:var(--muted)}
.secondary{background:var(--surface,#fff);color:var(--ink);border:1px solid var(--line)}
.danger{background:var(--red);color:#fff}
.danger:disabled{opacity:.45;cursor:not-allowed}
.danger-link{background:#FDECEA;color:var(--red)}
.error{color:var(--red);margin-top:10px}
dialog{border:1px solid var(--line);border-radius:var(--radius-card);padding:var(--sp-5);width:min(620px,92vw);color:var(--ink);box-shadow:var(--shadow-pop)}
dialog::backdrop{background:#0006}
.close{float:right;font-size:22px}
.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.device-form{display:grid;grid-template-columns:1fr 1fr;gap:4px 18px}
.device-form label{margin:7px 0}
.device-form textarea{resize:vertical}
.device-form .full{grid-column:1/-1}
.table-wrap{overflow:auto}
.client-parent{display:block;margin-top:5px;color:var(--muted);font-weight:400}
dialog.client-modal{width:min(900px,94vw);max-height:92vh;overflow:auto}
.client-modal>h3,#modal-body>h3{margin:0 40px 18px 0}
.client-form-section{padding:4px 0 18px;border-top:1px solid var(--line)}
.client-form-section h4{margin:var(--sp-4) 0 var(--sp-1);color:var(--ink);font-size:var(--fs-section)}
.client-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 22px}
.client-form-grid label{margin:8px 0}
.client-form-grid .full,.client-type{grid-column:1/-1}
.client-type{display:flex;align-items:center;gap:24px;border:0;padding:5px 0;margin:6px 0}
.client-type legend{float:left;margin-right:18px;color:#667085}
.client-type label{display:flex;align-items:center;gap:7px;margin:0;white-space:nowrap}
.client-type input{width:auto;accent-color:var(--orange)}
.required{color:var(--red)}
.device-toolbar,.row-actions{display:flex;align-items:center;gap:8px}
.device-name-link{background:transparent;color:var(--ink);font-weight:700;padding:4px 0;text-align:left}
.device-name-link:hover{color:var(--orange);text-decoration:underline}
.row-check{width:17px;height:17px;accent-color:var(--orange)}
input[readonly]{background:var(--surface-muted,#F5F6F8);color:var(--muted)}

.monitor-toolbar{display:flex;align-items:center;gap:10px;background:var(--surface,#fff);border:1px solid var(--line);border-radius:var(--radius-card);padding:12px 14px;margin-bottom:var(--sp-3);box-shadow:var(--shadow-card)}
.monitor-search-wrap{position:relative;flex:1;max-width:520px}
.monitor-search-wrap span{position:absolute;left:13px;top:50%;transform:translateY(-50%);opacity:.5}
.monitor-search-wrap input{padding-left:40px}
.monitor-toolbar select{width:210px}
.monitor-updated{color:var(--muted);font-size:12px;margin-left:auto;white-space:nowrap}
.monitor-toolbar .error{margin:0}
.monitor-layout{display:grid;grid-template-columns:350px 1fr;gap:14px}
.device-list{background:var(--surface,#fff);border:1px solid var(--line);border-radius:var(--radius-card);overflow:auto;height:calc(100vh - 168px);box-shadow:var(--shadow-card)}
.monitor-list-head{position:sticky;top:0;z-index:2;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:18px;border-bottom:1px solid var(--line)}
.monitor-list-head h3{margin:0}
.monitor-list-head span{display:grid;place-items:center;min-width:28px;height:28px;border-radius:var(--radius-pill);background:var(--sidebar-hover);color:var(--muted);font-weight:600}
.monitor-device{width:100%;display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:11px;border-radius:0;background:#fff;border-bottom:1px solid var(--line);padding:15px 16px;text-align:left}
.monitor-device:hover{background:var(--sidebar-hover)}
.monitor-device .status-dot{width:9px;height:9px;border-radius:50%;background:#667085}
.monitor-device.online .status-dot{background:var(--green);box-shadow:0 0 0 4px #15966b18}
.monitor-device.offline .status-dot{background:var(--red)}
.monitor-device-main,.monitor-device-data{display:grid;gap:5px}
.monitor-device-main{min-width:0}
.monitor-device-main b,.monitor-device-main small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.monitor-device small{color:var(--muted)}
.monitor-device-data{text-align:right}
.monitor-device-data b{font-size:13px}
.monitor-empty{padding:30px 18px;text-align:center;color:var(--muted)}
#map{height:calc(100vh - 168px);min-height:480px;border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow-card)}
.gl-map-icon{background:transparent;border:0}
.map-pin{position:relative;display:block;width:32px;height:32px;border:3px solid #fff;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:#667085;box-shadow:0 3px 12px #0005}
.map-pin i{position:absolute;width:10px;height:10px;border-radius:50%;background:#fff;left:8px;top:8px}
.map-pin.online{background:var(--green)}
.map-pin.offline{background:var(--red)}
.monitor-popup{min-width:285px}
.monitor-popup-title{font-size:16px;font-weight:800;margin-bottom:6px}
.monitor-popup-status{display:flex;align-items:center;gap:7px;color:var(--muted);margin-bottom:12px}
.monitor-popup-status span{width:8px;height:8px;border-radius:50%;background:#667085}
.monitor-popup-status.online span{background:var(--green)}
.monitor-popup-status.offline span{background:var(--red)}
.monitor-popup dl{display:grid;grid-template-columns:105px 1fr;gap:7px 12px;margin:0}
.monitor-popup dt{color:var(--muted)}
.monitor-popup dd{margin:0;font-weight:600}

@media(max-width:1000px){
  .grid{grid-template-columns:repeat(2,1fr)}
  .shell{grid-template-columns:76px 1fr}
  .brand{padding:12px 8px}
  .brand-logo,.shell>aside nav span,.aside-foot{display:none}
  .brand-icon{display:block}
  .monitor-layout{grid-template-columns:300px 1fr}
}
@media(max-width:760px){
  #content{padding:12px}
  .shell{grid-template-columns:1fr}
  .shell>aside{display:none;position:fixed;z-index:1000;inset:0 auto 0 0;width:240px}
  body.menu-open .shell>aside{display:flex}
  body.menu-open .brand-logo,body.menu-open .shell>aside nav span,body.menu-open .aside-foot{display:block}
  body.menu-open .brand-icon{display:none}
  header{padding:0 12px}
  header .live{display:none}
  .grid{grid-template-columns:1fr}
  .monitor-toolbar{align-items:stretch;flex-wrap:wrap}
  .monitor-search-wrap{max-width:none;flex-basis:100%}
  .monitor-toolbar select{width:auto;flex:1}
  .monitor-updated{width:100%;margin-left:0}
  .monitor-layout{grid-template-columns:1fr}
  .device-list{height:220px}
  #map{height:58vh;min-height:420px}
  table{display:block;overflow:auto}
  .device-form,.client-form-grid{grid-template-columns:1fr}
  .device-form .full,.client-form-grid .full,.client-type{grid-column:auto}
  .client-type{align-items:flex-start;flex-direction:column;gap:8px}
}


/* profile-menu-and-dark-theme */
.client-toolbar{display:flex;align-items:center;gap:9px}
.inline-check{display:flex!important;align-items:center;gap:9px;color:var(--ink)}
.inline-check input{width:17px;height:17px;accent-color:var(--orange)}
.form-help{color:var(--muted);margin:6px 0 0}
.header-actions{display:flex;align-items:center;min-width:0;gap:var(--sp-3)}
.header-company-logo{display:flex;align-items:center;justify-content:center;width:min(100px,9vw);height:38px;padding:4px 8px;border:1px solid var(--line);border-radius:9px;background:#fff}
.header-company-logo img{display:block;max-width:100%;max-height:30px;object-fit:contain}
.user-menu{position:relative}
.user-menu-button{display:flex;align-items:center;gap:9px;min-width:0;max-width:230px;background:transparent;color:var(--ink);padding:7px 10px}
.user-avatar{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:var(--sidebar-hover);color:var(--muted)}
.user-avatar svg{display:block;width:21px;height:21px}
.user-menu-button>span:nth-child(2){display:grid;gap:2px;min-width:0;text-align:left}.user-menu-button>span:nth-child(2) b,.user-menu-button>span:nth-child(2) small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.user-menu-button small{color:var(--muted);font-size:12px;font-weight:400}
.user-menu-button i{font-style:normal;color:var(--muted)}
.user-menu-popover{display:none;position:absolute;right:0;top:100%;z-index:1200;width:205px;padding:7px;background:#fff;border:1px solid var(--line);border-radius:11px;box-shadow:0 14px 35px #2026302b}
.user-menu:hover .user-menu-popover,.user-menu:focus-within .user-menu-popover{display:grid}
.user-menu-popover button{display:flex;align-items:center;gap:9px;background:transparent;color:var(--ink);text-align:left;padding:11px 12px}
.user-menu-popover button:hover{background:var(--sidebar-hover);color:var(--ink)}
:root[data-theme="dark"]{color-scheme:dark;--ink:#F5F6F8;--muted:#98A2B3;--line:#343A44;--bg:#14171C;--sidebar:#1B1F25;--sidebar-hover:#272C34;--dark:#F5F6F8}
:root[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
:root[data-theme="dark"] header,:root[data-theme="dark"] .panel,:root[data-theme="dark"] .card,:root[data-theme="dark"] .monitor-toolbar,:root[data-theme="dark"] .device-list,:root[data-theme="dark"] .monitor-list-head,:root[data-theme="dark"] .monitor-device,:root[data-theme="dark"] dialog,:root[data-theme="dark"] .user-menu-popover,:root[data-theme="dark"] .settings-card,:root[data-theme="dark"] .db-panel,:root[data-theme="dark"] .device-card-overlay,:root[data-theme="dark"] .device-card-header,:root[data-theme="dark"] .device-card-tabs,:root[data-theme="dark"] .device-card-body,:root[data-theme="dark"] .device-card-footer{background:#1B1F25;color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .shell>aside{background:var(--sidebar);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .brand,:root[data-theme="dark"] .aside-foot{border-color:var(--line)}
:root[data-theme="dark"] .shell>aside nav button{color:#98A2B3}
:root[data-theme="dark"] .shell>aside nav button.active,:root[data-theme="dark"] .shell>aside nav button:hover{background:var(--sidebar-hover);color:#F9A25D}
:root[data-theme="dark"] input,:root[data-theme="dark"] select,:root[data-theme="dark"] textarea{background:#14171C;color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] input[readonly]{background:#202630;color:#98A2B3}
:root[data-theme="dark"] label,:root[data-theme="dark"] .client-type legend{color:#667085}
:root[data-theme="dark"] th{color:#98A2B3}
:root[data-theme="dark"] .secondary,:root[data-theme="dark"] .badge{background:#272C34;color:#E7EAEF}
:root[data-theme="dark"] .device-name-link,:root[data-theme="dark"] .user-menu-button,:root[data-theme="dark"] .user-menu-popover button{color:var(--ink)}
:root[data-theme="dark"] .monitor-device:hover{background:#202630}
:root[data-theme="dark"] .settings-note,:root[data-theme="dark"] .settings-footer{background:#332a22;color:#f3c89f;border-color:#65462d}
:root[data-theme="dark"] .settings-card-head h3,:root[data-theme="dark"] .client-form-section h4{color:#F5F6F8}
:root[data-theme="dark"] .db-summary-card{background:#1B1F25;color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .db-model-row,:root[data-theme="dark"] .db-status-list button,:root[data-theme="dark"] .db-panel-head button{color:var(--ink)}
@media(max-width:760px){.header-company-logo,.user-menu-button>span:nth-child(2),.user-menu-button>i{display:none!important}.client-toolbar{align-items:stretch;flex-direction:column}}


/* GlobalLink commercial UI theme */
html{accent-color:var(--orange)}
body{letter-spacing:.01em}
a{color:var(--orange-dark);text-decoration:none}
a:hover{color:var(--orange-dark);text-decoration:underline}
button{transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--orange);outline-offset:2px}
input:focus,select:focus,textarea:focus{border-color:var(--orange);box-shadow:var(--focus-ring)}
input[type="checkbox"],input[type="radio"],input[type="range"],progress{accent-color:var(--orange)}
::selection{background:var(--orange-soft);color:var(--ink)}
.primary:hover{box-shadow:var(--shadow-card)}
.secondary:hover{background:var(--sidebar-hover);color:var(--ink)}
.close{background:transparent;color:var(--muted)}
.close:hover{background:var(--sidebar-hover);color:var(--ink)}
#menu{background:transparent;color:#202630}
header h2,.panel h3,.card strong{color:var(--ink)}
thead{background:var(--surface-muted,#F5F6F8)}
tbody tr{transition:background-color .14s ease}
tbody tr:hover{background:var(--sidebar-hover)}
.pagination,.pager{display:flex;align-items:center;gap:6px}
.pagination button,.pager button{min-height:36px;background:var(--surface,#fff);color:var(--ink);border:1px solid var(--line)}
.pagination button.active,.pager button.active{background:var(--orange);color:#fff;border-color:var(--orange)}
progress{overflow:hidden;border:0;border-radius:var(--radius-pill);background:var(--sidebar-hover)}
progress::-webkit-progress-bar{background:var(--sidebar-hover)}
progress::-webkit-progress-value{background:var(--orange)}
progress::-moz-progress-bar{background:var(--orange)}
.aside-foot{font-size:var(--fs-help);line-height:1.45;color:var(--muted);text-align:center}
.aside-foot small{display:grid;gap:2px}
.aside-foot a{color:var(--muted);font-weight:600}
.aside-foot a:hover{color:var(--orange-dark)}
.live{font-size:var(--fs-help);font-weight:600;color:var(--green)}
.leaflet-container a{color:var(--orange-dark)}
.leaflet-bar a,.leaflet-control-zoom a{color:var(--ink)!important}
.leaflet-bar a:hover,.leaflet-control-zoom a:hover{background:var(--sidebar-hover)!important;color:var(--ink)!important}

:root[data-theme="dark"]{--ink:#F5F6F8;--muted:#98A2B3;--line:#343A44;--bg:#14171C;--sidebar:#1B1F25;--sidebar-hover:#272C34}
:root[data-theme="dark"] thead,:root[data-theme="dark"] tbody tr:hover{background:#22262D}
:root[data-theme="dark"] .secondary,:root[data-theme="dark"] .pagination button,:root[data-theme="dark"] .pager button{background:#272C34;color:#E7EAEF}
:root[data-theme="dark"] .db-summary-card,:root[data-theme="dark"] .db-panel,:root[data-theme="dark"] .db-model-row,:root[data-theme="dark"] .db-status-list button,:root[data-theme="dark"] .db-map-status,:root[data-theme="dark"] .device-simple-panel,:root[data-theme="dark"] .telemetry-grid>div,:root[data-theme="dark"] .command-layout>aside,:root[data-theme="dark"] .command-layout>aside button,:root[data-theme="dark"] .wg-monitor-panel,:root[data-theme="dark"] .wg-device-row,:root[data-theme="dark"] .wg-selected-device,:root[data-theme="dark"] .wg-selected-actions button,:root[data-theme="dark"] .wg-map-tools button,:root[data-theme="dark"] .history-toolbar,:root[data-theme="dark"] .history-summary,:root[data-theme="dark"] .history-summary-grid>div,:root[data-theme="dark"] .history-stop-list button,:root[data-theme="dark"] .history-speed-legend,:root[data-theme="dark"] .history-player{background:#1B1F25;color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .db-summary-wave,:root[data-theme="dark"] .db-summary-card.devices .db-summary-wave,:root[data-theme="dark"] .db-summary-card.service .db-summary-wave,:root[data-theme="dark"] .wg-selected-location,:root[data-theme="dark"] .history-summary-meta{background:#22262D}
:root[data-theme="dark"] .db-donut:after{background:#1B1F25}
:root[data-theme="dark"] .db-summary-card>strong,:root[data-theme="dark"] .db-summary-title,:root[data-theme="dark"] .db-panel-head h3,:root[data-theme="dark"] .db-donut b,:root[data-theme="dark"] .db-model-row>span,:root[data-theme="dark"] .device-card-header h2,:root[data-theme="dark"] .device-fields label,:root[data-theme="dark"] .telemetry-grid b,:root[data-theme="dark"] .command-editor h3,:root[data-theme="dark"] .wg-panel-head h3,:root[data-theme="dark"] .wg-panel-head span b,:root[data-theme="dark"] .wg-device-copy b,:root[data-theme="dark"] .wg-device-side>b,:root[data-theme="dark"] .wg-selected-head h3,:root[data-theme="dark"] .wg-telemetry-item b,:root[data-theme="dark"] .wg-selected-location b,:root[data-theme="dark"] .history-summary header h3,:root[data-theme="dark"] .history-summary-grid b,:root[data-theme="dark"] .history-stop-list b{color:#F5F6F8}
:root[data-theme="dark"] .db-status-list button:hover,:root[data-theme="dark"] .db-map-status button:hover,:root[data-theme="dark"] .command-layout>aside button:hover,:root[data-theme="dark"] .command-layout>aside button.active,:root[data-theme="dark"] .wg-device-row.selected,:root[data-theme="dark"] .wg-selected-actions button:hover:not(:disabled),:root[data-theme="dark"] .history-stop-list button:hover{background:#272C34;color:#F9A25D}
:root[data-theme="dark"] .device-preview-image,:root[data-theme="dark"] .no-position,:root[data-theme="dark"] .empty-history,:root[data-theme="dark"] .wg-monitor-search,:root[data-theme="dark"] .history-map-state{background:#22262D;color:#98A2B3;border-color:var(--line)}


/* GUS REGON company lookup */
.client-gus-section{margin:10px 0 14px;padding:14px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface-muted,#F5F6F8)}
.client-gus-section>label{display:block;margin:0;color:var(--ink)}
.gus-lookup-row{display:grid;grid-template-columns:minmax(180px,1fr) auto;gap:10px;align-items:center;margin-top:7px}
.gus-lookup-row input{margin:0}
.gus-lookup-row button{white-space:nowrap}
.gus-lookup-message{display:block;min-height:18px;margin-top:7px;color:var(--muted);font-size:12px}
.gus-lookup-message.success{color:var(--green)}
.gus-lookup-message.error{color:var(--red)}
:root[data-theme="dark"] .client-gus-section{background:#14171C;border-color:var(--line)}
@media(max-width:620px){.gus-lookup-row{grid-template-columns:1fr}.gus-lookup-row button{width:100%}}

/* table selection action bars */
.table-action-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.table-selection-count{color:var(--muted);font-size:12px;white-space:nowrap}
.table-action-select{width:auto;min-width:165px;max-width:220px}
.client-list-filter{display:flex;align-items:center;gap:14px;padding:14px 0 16px;border-bottom:1px solid var(--line)}
.client-search-box{display:grid;grid-template-columns:42px minmax(220px,520px) 38px;align-items:center;width:min(100%,600px);min-height:44px;border:1px solid var(--line);border-radius:10px;background:var(--surface,#fff);transition:border-color .16s,box-shadow .16s}
.client-search-box:focus-within{border-color:var(--orange);box-shadow:var(--focus-ring)}
.client-search-box>span{display:grid;place-items:center;color:var(--muted)}
.client-search-box svg{width:18px;height:18px}
.client-search-box input{width:100%;height:42px;padding:0;border:0;background:transparent;color:var(--ink);outline:0}
.client-search-box input::placeholder{color:var(--muted)}
.client-search-box input::-webkit-search-cancel-button{display:none}
.client-search-box button{width:30px;height:30px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--muted);font-size:20px;line-height:1}
.client-search-box button:hover{background:var(--sidebar-hover);color:var(--ink)}
.client-filter-summary{color:var(--muted);font-size:12px;white-space:nowrap}
:root[data-theme="dark"] .client-search-box{background:var(--surface-soft,#22262D);border-color:var(--line)}
.client-preview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}
.client-preview-grid>div{display:grid;gap:5px;padding:14px;border:1px solid var(--line);border-radius:var(--radius-control);background:var(--surface-muted,#F5F6F8)}
.client-preview-grid span{color:var(--muted);font-size:12px}
.client-preview-grid strong{color:var(--ink);overflow-wrap:anywhere}
:root[data-theme="dark"] .client-preview-grid>div{background:#14171C;border-color:var(--line)}
@media(max-width:760px){.table-action-toolbar{width:100%;align-items:stretch}.table-selection-count{width:100%}.table-action-select{flex:1;max-width:none}.client-list-filter{align-items:stretch;flex-direction:column}.client-search-box{grid-template-columns:42px minmax(0,1fr) 38px;width:100%}.client-filter-summary{padding-left:2px}.client-preview-grid{grid-template-columns:1fr}}

.user-avatar {
  overflow: hidden;
}
.user-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-avatar .ui-icon {
  width: 21px;
  height: 21px;
}
.profile-assets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 12px 0 6px;
}
.profile-asset-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted, #F5F6F8);
}
.profile-asset-card > div:last-of-type {
  min-width: 0;
}
.profile-asset-card strong,
.profile-asset-card small {
  display: block;
}
.profile-asset-card small,
.profile-assets-help {
  color: var(--muted);
}
.profile-asset-card small {
  margin-top: 4px;
}
.profile-asset-preview {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface, #fff);
  color: var(--orange-dark);
}
.profile-asset-preview.avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
}
.profile-asset-preview.logo {
  width: 132px;
  height: 76px;
  border-radius: 12px;
  padding: 8px;
  color: var(--muted);
  font-size: var(--fs-help);
}
.profile-asset-preview img {
  display: block;
  width: 100%;
  height: 100%;
}
.profile-asset-preview.avatar img {
  object-fit: cover;
}
.profile-asset-preview.logo img {
  object-fit: contain;
}
.profile-asset-preview .ui-icon {
  width: 34px;
  height: 34px;
}
.profile-asset-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.profile-asset-actions button {
  padding: 8px 11px;
}
.profile-assets-help {
  margin: 0 0 18px;
  font-size: var(--fs-help);
}
:root[data-theme="dark"] .profile-asset-card,
:root[data-theme="dark"] .profile-asset-preview {
  background: var(--surface-accent);
  border-color: var(--line);
}
@media(max-width:760px) {
  .profile-assets-grid {
    grid-template-columns: 1fr;
  }
  .profile-asset-card {
    align-items: flex-start;
  }
  .profile-asset-preview.logo {
    width: 108px;
  }
}
@media(max-width:440px) {
  .profile-asset-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }
  .profile-asset-preview.avatar {
    width: 66px;
    height: 66px;
  }
  .profile-asset-preview.logo {
    width: 92px;
    height: 64px;
  }
}

/* Shared edit action button */
button.icon-action{display:inline-grid;place-items:center;width:38px;height:38px;min-width:38px;padding:0;border:1px solid var(--line);border-radius:var(--radius-control);background:var(--surface,#fff);color:var(--muted);line-height:1;vertical-align:middle;transition:background-color .15s,border-color .15s,color .15s}
button.icon-action .ui-icon{width:24px;height:24px;border-radius:6px;background:transparent;color:inherit}
button.icon-action .ui-icon svg{width:17px;height:17px}
button.icon-action:hover{border-color:var(--line-strong,#D0D5DD);background:var(--sidebar-hover);color:var(--ink)}
button.icon-action:focus-visible{outline:2px solid var(--orange,#F58220);outline-offset:2px}

/* 2FA */
.twofa-banner{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;
  padding:12px 16px;background:var(--surface,#fff);border:1px solid var(--line);border-left:3px solid var(--orange);border-radius:var(--radius-control);margin:var(--sp-3) var(--sp-4)}
.twofa-banner .twofa-banner-actions{display:flex;gap:8px}
:root[data-theme="dark"] .twofa-banner,:root:not([data-theme="light"]) .twofa-banner{background:#3a2f1c;border-color:#6b532a}
.twofa-box{display:flex;flex-direction:column;gap:10px}
.twofa-status.on{color:#17845b}
.twofa-qr{width:200px;height:200px;background:#fff;padding:8px;border-radius:8px}
.twofa-qr svg{width:100%;height:100%}
.twofa-secret code{font-size:15px;letter-spacing:1px}
.twofa-codes{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;list-style:none;padding:0;margin:8px 0}
.twofa-codes code{font-size:15px}
.twofa-enroll,.twofa-recovery{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.twofa-trusted,.twofa-trusted-empty{font-size:14px;color:var(--muted)}
.twofa-trusted{display:flex;flex-direction:column;gap:8px}
.twofa-trusted-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
.twofa-trusted-list li{display:flex;flex-direction:column;gap:2px;padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius-control);word-break:break-word}
.twofa-trusted-list small{color:var(--muted)}

/* /assets/device-card.css */
/* Karta pojazdu jest zwykłym widokiem systemu: renderuje się w #content — pod nagłówkiem
   (tytuł, Pomoc, dzwonek, użytkownik) i obok menu bocznego, dokładnie jak każda inna strona.
   Żadnego position:fixed przykrywającego panel. Strona przewija się normalnie. */
.device-card-overlay{position:relative;display:grid;gap:var(--sp-4);min-width:0;background:transparent;border:0;border-radius:0;overflow:visible}
.device-card-header{min-height:64px;display:flex;align-items:center;gap:14px;padding:14px 18px;border-bottom:1px solid var(--line);background:transparent}
.device-card-header>div:nth-child(2){display:block}
.device-card-header h2{margin:0 0 7px;color:#202630;font-size:22px}
.device-card-header p{margin:0;display:flex;flex-wrap:wrap;gap:28px;color:#667085;font-size:13px}
.device-card-header p b{font-weight:500}
.device-card-close{margin-left:auto;align-self:flex-start;background:transparent;color:#667085;font-size:30px;line-height:1;padding:4px 8px}
.device-card-body{padding:18px;background:#fff}
.device-card-footer{min-height:72px;display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:12px 18px;border-top:1px solid #E4E7EC;background:#fff;box-shadow:0 -8px 24px #2026300a}
.device-card-footer>span{margin-right:auto}
.device-card-footer button{min-width:92px}
.success-message{color:#08775a;font-weight:600}

.device-card-section{border-bottom:1px solid #E4E7EC;padding:4px 16px 20px;margin-bottom:16px}
.device-card-section h3,.device-simple-panel h3{display:flex;align-items:center;gap:8px;margin:0 0 16px;color:#667085;font-size:14px;font-weight:500}
.section-icon{color:#667085}
.device-mini-status{display:inline-grid;place-items:center;width:23px;height:23px;border-radius:6px;background:var(--sidebar-hover);color:var(--muted);font-size:13px}
.device-mini-status.communication{background:var(--sidebar-hover);color:var(--muted)}
.device-mini-status.online{background:#dff8e8;color:#0b9b56}
.device-mini-status.offline{background:#ffebe7;color:#cf3f2f}
.device-fields{display:grid;gap:18px 7vw}
.device-fields.two-columns{grid-template-columns:1fr 1fr}
.device-fields label{display:grid;grid-template-columns:minmax(155px,210px) minmax(180px,1fr);align-items:center;gap:12px;margin:0;text-align:right;color:#202630}
.device-fields input,.device-fields select{height:42px;background:#fff;border-color:#E4E7EC;color:#202630}
.device-fields input[readonly]{background:#F5F6F8;color:#667085}
.vehicle-columns{display:grid;grid-template-columns:1fr 1fr;gap:7vw}
.vehicle-columns>div>label{display:grid;grid-template-columns:150px minmax(200px,1fr);align-items:center;gap:12px;margin:0 0 16px;text-align:right}
.input-suffix{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px}
.input-suffix span{color:#667085}
.device-icon-field{margin:20px 0 0}
.device-icon-field>span,.vehicle-image-field>span{display:block;margin-bottom:9px;color:#202630}
.upload-inline{background:#fff;border:1px dashed #E4E7EC;color:#667085;padding:8px 12px}
.device-icon-field small,.vehicle-image-field small{display:block;color:#667085;margin:9px 0}
.device-icon-grid{display:flex;flex-wrap:wrap;gap:11px;margin-top:12px}
.device-icon-grid button{width:39px;height:39px;padding:5px;background:var(--sidebar-hover);color:var(--muted);border:2px solid transparent}
.device-icon-grid button:hover,.device-icon-grid button.selected{border-color:var(--orange);background:var(--sidebar-hover);color:var(--ink)}
.device-icon-grid svg,.device-icon-grid img{width:100%;height:100%;object-fit:contain}
.device-map-preview{width:min(490px,100%);margin:28px 0 0;border:1px solid #E4E7EC;border-radius:12px;padding:10px}
.device-map-preview>span{display:block;color:#667085;margin-bottom:8px}
#device-card-map{height:130px;border-radius:9px;overflow:hidden}
.vehicle-image-field{margin:20px 0 0}
.vehicle-image-upload{width:112px;height:96px;border:1px dashed #E4E7EC;background:#fff;color:#667085;font-size:35px;padding:6px;overflow:hidden}
.vehicle-image-upload img{width:100%;height:100%;object-fit:cover;border-radius:6px}
.text-danger{display:block;background:transparent;color:#b42318;padding:4px 0}
.device-notes{display:grid!important;grid-template-columns:150px 1fr!important;align-items:start!important;gap:12px;margin:26px 0 0!important;text-align:right}
.device-notes textarea{text-align:left}

.device-simple-panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-card);padding:var(--sp-5);box-shadow:var(--shadow-card)}
.device-simple-panel>p{color:#667085}
.device-simple-panel>label{max-width:650px}
.tracking-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:20px}
.tracking-head h3{margin-bottom:6px}
.tracking-head p{margin:0;color:#667085}
.toggle-label{display:flex!important;grid-template-columns:none!important;align-items:center!important;justify-content:flex-start;gap:10px!important;text-align:left!important;cursor:pointer}
.toggle-label input{display:none}
.toggle-label span{position:relative;width:42px;height:23px;border-radius:99px;background:#d4d0ca;transition:.2s}
.toggle-label span:after{content:"";position:absolute;width:17px;height:17px;left:3px;top:3px;border-radius:50%;background:#fff;transition:.2s;box-shadow:0 1px 4px #0003}
.toggle-label input:checked+span{background:var(--orange)}
.toggle-label input:checked+span:after{transform:translateX(19px)}
.telemetry-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;margin-bottom:18px}
.telemetry-grid>div{border:1px solid #E4E7EC;border-radius:10px;padding:15px;background:#F5F6F8}
.telemetry-grid span{display:block;color:#667085;font-size:12px;margin-bottom:7px}
.telemetry-grid b{color:#202630}
.device-live-map{height:460px;border-radius:12px;overflow:hidden;border:1px solid var(--line)}
.no-position{height:100%;display:grid;place-items:center;background:#F5F6F8;color:#667085}
.alarm-settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px 30px;max-width:760px}
.alarm-settings-grid>label:not(.toggle-label){display:grid;grid-template-columns:210px 170px;align-items:center;gap:10px}
.muted-note{margin-top:28px!important;font-size:13px}
.empty-history{padding:25px;text-align:center;background:#F5F6F8;border-radius:10px;color:#667085}
.card-history{margin-top:28px}

.command-layout{display:grid;grid-template-columns:300px minmax(0,1fr);min-height:520px;border-top:1px solid var(--line)}
.command-layout>aside{display:block;background:#fff;color:#202630;border-right:1px solid #E4E7EC;padding:12px 10px}
.command-layout>aside section{margin-bottom:12px}
.command-layout>aside h4{margin:0;padding:10px;color:#202630;font-size:13px}
.command-layout>aside button{display:block;width:100%;background:#fff;text-align:left;color:#667085;padding:10px 18px}
.command-layout>aside button:hover,.command-layout>aside button.active{background:var(--sidebar-hover);color:var(--ink)}
.command-editor{padding:28px 34px}
/* Na telefonie lista polecen zamienia sie w pole wyboru — 40+ pozycji nad formularzem to za duzo przewijania. */
.command-mobile-picker{display:none}
.command-editor h3{color:#202630;font-size:17px}
.command-editor p{color:#667085}
.command-editor label{max-width:420px}
.command-warning{margin-top:22px;padding:13px;border-radius:var(--radius-control);background:var(--surface-muted);border-left:3px solid var(--amber);color:var(--amber)}

.device-symbol{display:inline-grid;place-items:center;flex:0 0 auto;width:38px;height:38px;min-width:38px;min-height:38px;line-height:0;color:var(--muted);background:var(--sidebar-hover);border-radius:var(--radius-control);overflow:hidden}
.device-symbol svg,.device-symbol img{display:block;width:78%;height:78%;object-fit:contain}
.device-symbol.table{width:34px;height:34px}
.device-symbol.list{width:37px;height:37px}
.device-symbol.popup{width:44px;height:44px}
.device-symbol.header{width:48px;height:48px;color:var(--muted);background:var(--sidebar-hover)}
.device-symbol.picker{width:28px;height:28px}
.device-symbol.map{width:34px;height:34px;color:#fff;background:transparent}
.monitor-device{grid-template-columns:38px 9px minmax(0,1fr) auto}
.monitor-popup-heading{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.monitor-popup-heading .monitor-popup-status{margin-bottom:0}
.monitor-card-button{width:100%;margin-top:14px}
.gl-device-map-icon{background:transparent!important;border:0!important}
.device-map-symbol{position:relative;display:grid;place-items:center;width:44px;height:44px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:#4A4845;border:3px solid #fff;box-shadow:0 4px 14px #0005}
.device-map-symbol>.device-symbol{transform:rotate(45deg)}
.device-map-symbol>i{position:absolute;right:-2px;top:-2px;width:12px;height:12px;border-radius:50%;background:#667085;border:2px solid #fff}
.device-map-symbol.online{background:#4A4845}
.device-map-symbol.online>i{background:#36a87a}
.device-map-symbol.offline{background:#4A4845}
.device-map-symbol.offline>i{background:#d8645c}

@media(max-width:1100px){
  .device-fields.two-columns,.vehicle-columns{grid-template-columns:1fr;gap:18px}
  .telemetry-grid{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:760px){
  .device-card-header{padding:10px}
  .device-card-header p{gap:8px;display:grid}
  .device-card-tabs button{padding:13px 15px}
  .device-card-body{padding:12px 10px}
  .device-card-section{padding:4px 0 18px}
  .device-fields label,.vehicle-columns>div>label,.device-notes{grid-template-columns:1fr!important;text-align:left!important}
  .device-icon-field,.device-map-preview,.vehicle-image-field{margin-left:0}
  .telemetry-grid{grid-template-columns:repeat(2,1fr)}
  .alarm-settings-grid{grid-template-columns:1fr}
  .command-layout{grid-template-columns:1fr}
  .command-layout>aside{display:none}
  .command-mobile-picker{display:grid;gap:6px;margin-bottom:18px;font-weight:600}
  .command-editor{padding:20px 10px}
  .device-card-footer{padding:10px}
}


/* streamlined-card */
.field-help{margin:14px 0 0;color:#667085;font-size:12px}
.device-symbol.custom img{width:100%;height:100%;object-fit:cover}
.device-symbol.map.custom{padding:2px;background:#fff;border-radius:50%}
.device-symbol.preview{width:84px;height:84px;border-radius:18px}
.reminder-panel{width:100%}
.reminder-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:18px}
.reminder-panel-head h3{margin-bottom:6px}
.reminder-panel-head p{margin:0;color:#667085}
.reminder-add,.reminder-remove{display:grid;place-items:center;width:36px;height:36px;min-height:36px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);font-size:25px;line-height:1}
.reminder-row{display:grid;grid-template-columns:minmax(180px,1.1fr) minmax(200px,1fr) minmax(180px,1.1fr) 150px 38px;align-items:end;gap:14px;margin-bottom:12px}
.reminder-row label{display:grid;gap:7px;margin:0;color:#667085}
.reminder-row input,.reminder-row select{height:42px}
.reminder-email{display:grid;grid-template-columns:auto minmax(280px,520px);align-items:center;gap:18px;margin-top:28px;padding-top:20px;border-top:1px solid #E4E7EC}
.reminder-email .inline-check{margin:0}
dialog.device-preview-modal{width:min(880px,94vw)}
.device-preview-head{display:flex;align-items:center;gap:13px;margin:0 45px 18px 0}
.device-preview-head h3{margin:0 0 4px!important;font-size:21px}
.device-preview-head p{margin:0;color:#667085}
.device-preview-layout{display:grid;grid-template-columns:minmax(250px,360px) 1fr;gap:24px}
.device-preview-image{min-height:280px;display:grid;place-items:center;align-content:center;gap:12px;border:1px solid #E4E7EC;border-radius:14px;background:#F5F6F8;overflow:hidden;color:#667085}
.device-preview-image>img{width:100%;height:100%;max-height:360px;object-fit:cover}
.device-preview-data{display:grid;grid-template-columns:170px 1fr;align-content:start;gap:0;margin:0}
.device-preview-data dt,.device-preview-data dd{padding:10px 0;border-bottom:1px solid #E4E7EC}
.device-preview-data dt{color:#667085}
.device-preview-data dd{margin:0;font-weight:600}
:root[data-theme="dark"] .reminder-panel-head p,:root[data-theme="dark"] .field-help{color:#98A2B3}
:root[data-theme="dark"] .reminder-row label{color:#667085}
:root[data-theme="dark"] .reminder-email{border-color:var(--line)}
:root[data-theme="dark"] .device-preview-image{background:#14171C;border-color:var(--line)}
:root[data-theme="dark"] .device-preview-data dt,:root[data-theme="dark"] .device-preview-data dd{border-color:var(--line)}
@media(max-width:1000px){.reminder-row{grid-template-columns:1fr 1fr}.reminder-remove{align-self:end}.reminder-email{grid-template-columns:1fr}.field-help{margin-left:0}.device-preview-layout{grid-template-columns:1fr}}
@media(max-width:620px){.reminder-row{grid-template-columns:1fr}.device-preview-data{grid-template-columns:1fr}.device-preview-data dt{padding-bottom:2px;border-bottom:0}.device-preview-data dd{padding-top:2px}}

/* compact vehicle preview */
dialog.device-preview-modal{width:min(650px,94vw);max-height:min(760px,92dvh);overflow:auto}
.device-preview-head{display:flex;align-items:center;gap:14px;margin:0 42px 14px 0;min-width:0}
.device-preview-photo{flex:0 0 90px;width:90px;height:70px;display:grid;place-items:center;border:1px solid var(--line);border-radius:10px;background:var(--surface-muted);overflow:hidden}
.device-preview-photo>img{width:100%;height:100%;object-fit:cover}
.device-preview-photo .device-symbol{width:42px;height:42px}
.device-preview-identity{min-width:0}.device-preview-identity h3{margin:0 0 3px!important;color:var(--ink);font-size:20px;line-height:1.25;overflow-wrap:anywhere}.device-preview-identity>p{margin:0;color:var(--muted)}
.device-preview-statuses{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin-top:8px;color:var(--muted);font-size:12px}.device-preview-statuses b{color:var(--ink)}
.device-preview-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.device-preview-item{min-width:0;padding:12px 13px;border:1px solid var(--line);border-radius:10px;background:var(--surface-muted)}
.device-preview-item.full{grid-column:1/-1}.device-preview-item>span{display:block;margin-bottom:5px;color:var(--muted);font-size:12px}.device-preview-item>b{display:block;color:var(--ink);font-size:14px;line-height:1.4;overflow-wrap:anywhere}.device-preview-item>small{display:block;margin-top:4px;color:var(--muted);font-size:12px;line-height:1.35}
.device-preview-activity{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.device-preview-activity small{display:grid;gap:3px;min-width:0}.device-preview-activity em{color:var(--muted);font-size:12px;font-style:normal}.device-preview-activity b{color:var(--ink);font-size:14px;white-space:nowrap}
.device-preview-footer{display:flex;justify-content:flex-end;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
:root[data-theme="dark"] .device-preview-photo,:root[data-theme="dark"] .device-preview-item{background:var(--surface-muted);border-color:var(--line)}
@media(max-width:620px){dialog.device-preview-modal{width:min(94vw,470px);max-height:92dvh;padding:16px}.device-preview-head{gap:11px;margin:0 34px 12px 0}.device-preview-photo{flex-basis:64px;width:64px;height:48px;border-radius:8px}.device-preview-photo .device-symbol{width:32px;height:32px}.device-preview-identity h3{font-size:17px}.device-preview-identity>p{font-size:12px}.device-preview-statuses{gap:6px;margin-top:5px}.device-preview-grid{grid-template-columns:1fr;gap:8px}.device-preview-item.full{grid-column:auto}.device-preview-activity{grid-template-columns:1fr;gap:7px}.device-preview-activity small{display:flex;align-items:center;justify-content:space-between;gap:10px}.device-preview-activity b{white-space:normal}.device-preview-footer .primary{width:100%}}
/* vehicle-card-v2 */
.header-gps-status.online{color:#14845f}.header-gps-status.offline{color:#b7443e}.header-gps-status.inactive{color:#667085}
.vehicle-summary{display:grid;gap:22px}
.vehicle-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.vehicle-summary-card{position:relative;min-height:130px;padding:18px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface);overflow:hidden}
.vehicle-summary-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--muted)}
.vehicle-summary-card.ok:before{background:var(--green)}.vehicle-summary-card.approaching:before{background:var(--amber)}.vehicle-summary-card.urgent:before{background:var(--orange)}.vehicle-summary-card.overdue:before{background:var(--red)}
.vehicle-summary-card>span{display:block;margin-bottom:13px;color:var(--muted);font-size:12px}
.vehicle-summary-card>b{display:block;color:var(--ink);font-size:18px;line-height:1.35;overflow-wrap:anywhere}
.vehicle-summary-card>small{display:block;margin-top:8px;color:var(--muted);line-height:1.35}
.vehicle-activity-details{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.vehicle-activity-details small{display:grid;gap:2px;color:var(--muted);font-style:normal}.vehicle-activity-details em{font-size:12px;font-style:normal}.vehicle-activity-details strong{color:var(--ink);font-size:13px;font-weight:600}
.vehicle-upcoming-panel,.vehicle-summary-map,.vehicle-terms-panel{padding:22px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.vehicle-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.vehicle-section-head h3,.vehicle-summary-map h3{margin:0 0 5px;color:var(--ink);font-size:17px}
.vehicle-section-head p{margin:0;color:var(--muted)}
.vehicle-upcoming-list{display:grid;gap:8px}
.vehicle-upcoming-list button{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;padding:13px 10px;background:transparent;color:var(--ink);border-bottom:1px solid var(--line);text-align:left}
.vehicle-upcoming-list button:hover{background:var(--surface-accent)}
.vehicle-upcoming-list i{width:9px;height:9px;border-radius:50%;background:#667085}.vehicle-upcoming-list i.ok{background:#15966b}.vehicle-upcoming-list i.approaching{background:#d9a441}.vehicle-upcoming-list i.urgent{background:var(--orange)}.vehicle-upcoming-list i.overdue{background:#B45C0B}
.vehicle-upcoming-list span b,.vehicle-upcoming-list span small{display:block}.vehicle-upcoming-list span small{margin-top:3px;color:var(--muted)}.vehicle-upcoming-list strong{font-size:13px;color:var(--muted)}
.vehicle-summary-map .device-live-map{height:320px;margin-top:14px}
.vehicle-empty-state{padding:35px;text-align:center;border:1px dashed var(--line-strong);border-radius:10px;background:var(--surface-muted);color:var(--muted)}
.vehicle-visual-grid{display:grid;grid-template-columns:1fr 1fr;gap:7vw}.vehicle-visual-grid .device-icon-field,.vehicle-visual-grid .vehicle-image-field{margin:0}
.vehicle-terms-panel{width:100%}
.vehicle-term-list{display:grid;gap:12px}
.vehicle-term-card{position:relative;display:grid;grid-template-columns:4px minmax(220px,.9fr) minmax(330px,1.4fr) auto;align-items:center;gap:16px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface-muted)}
.vehicle-term-card>i{align-self:stretch;border-radius:4px;background:#667085}.vehicle-term-card.ok>i{background:#15966b}.vehicle-term-card.approaching>i{background:#d9a441}.vehicle-term-card.urgent>i{background:var(--orange)}.vehicle-term-card.overdue>i{background:#B45C0B}
.vehicle-term-main{display:flex;align-items:center;justify-content:space-between;gap:10px}.vehicle-term-main span:first-child{color:var(--muted);font-size:12px;text-transform:uppercase}.vehicle-term-main h4{margin:4px 0 0;color:var(--ink);font-size:16px}
.term-status{flex:0 0 auto;padding:5px 8px;border-radius:99px;background:var(--surface-soft);color:var(--muted);font-size:12px}.term-status.ok{background:#e4f5ed;color:#08775a}.term-status.approaching{background:#f8f0dc;color:#80601f}.term-status.urgent{background:#F2F4F7;color:#a74e08}.term-status.overdue{background:#fbe9e7;color:#a7332b}
.vehicle-term-details{display:grid;grid-template-columns:1fr 1fr;gap:10px 18px}.vehicle-term-details p{margin:0}.vehicle-term-details span,.vehicle-term-details b{display:block}.vehicle-term-details span{margin-bottom:4px;color:var(--muted);font-size:12px}.vehicle-term-details b{color:var(--ink);font-size:13px}
.vehicle-term-form{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.vehicle-term-form label{margin:8px 0}.vehicle-term-form .full{grid-column:1/-1}
.term-notification-options{display:grid;grid-template-columns:auto auto minmax(250px,1fr);align-items:end;gap:12px 22px;margin:14px 0 8px;padding:15px 16px;border:1px solid var(--line);border-radius:11px;background:var(--surface-muted)}
.term-notification-options legend{padding:0 7px;color:var(--ink);font-weight:700}
.term-notification-options .inline-check{align-self:center;margin:0}
.term-notification-options .term-email-address{margin:0}
.term-notification-options p{grid-column:1/-1;margin:2px 0 0;color:var(--muted);font-size:12px;line-height:1.45}
.term-notification-options input:disabled{cursor:not-allowed;opacity:.62}
.vehicle-term-form [data-term-mode][hidden]{display:none!important}
.vehicle-term-form select[name="term_basis"]:disabled{cursor:not-allowed;background:var(--surface-muted);color:var(--muted)}
#vehicle-term-basis-help{margin:5px 0 2px;padding:10px 12px;border-radius:8px;background:var(--surface-muted);color:var(--muted);font-size:12px;line-height:1.45}
dialog:has(#vehicle-term-form){width:min(820px,94vw)}
:root[data-theme="dark"] .device-card-overlay,:root[data-theme="dark"] .device-card-header,:root[data-theme="dark"] .device-card-tabs,:root[data-theme="dark"] .device-card-body,:root[data-theme="dark"] .device-card-footer,:root[data-theme="dark"] .device-simple-panel,:root[data-theme="dark"] .device-fields input,:root[data-theme="dark"] .device-fields select{background:var(--surface);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .device-card-header h2,:root[data-theme="dark"] .device-fields label,:root[data-theme="dark"] .vehicle-summary-card>b,:root[data-theme="dark"] .vehicle-section-head h3,:root[data-theme="dark"] .vehicle-summary-map h3{color:var(--ink)}
:root[data-theme="dark"] .device-card-tabs button{color:var(--muted)}:root[data-theme="dark"] .device-card-tabs button.active{color:#F9A25D}
:root[data-theme="dark"] .vehicle-summary-card,:root[data-theme="dark"] .vehicle-upcoming-panel,:root[data-theme="dark"] .vehicle-summary-map,:root[data-theme="dark"] .vehicle-terms-panel{background:var(--surface);border-color:var(--line)}
:root[data-theme="dark"] .vehicle-term-card,:root[data-theme="dark"] .vehicle-empty-state{background:var(--surface-muted);border-color:var(--line)}
:root[data-theme="dark"] .term-status.ok{background:#21483b;color:#91dec2}:root[data-theme="dark"] .term-status.approaching{background:#513821;color:#ffc07b}:root[data-theme="dark"] .term-status.overdue{background:#512c29;color:#ffaaa3}
@media(max-width:1180px){.vehicle-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.vehicle-term-card{grid-template-columns:4px 1fr auto}.vehicle-term-details{grid-column:2/-1}.vehicle-term-card>.row-actions{grid-column:2/-1;justify-content:flex-end}.vehicle-visual-grid{grid-template-columns:1fr}}
@media(max-width:700px){.term-notification-options{grid-template-columns:1fr}.term-notification-options p{grid-column:1}.vehicle-summary-grid{grid-template-columns:1fr}.vehicle-summary-card{min-height:105px}.vehicle-section-head{align-items:stretch;flex-direction:column}.vehicle-upcoming-list button{grid-template-columns:10px minmax(0,1fr)}.vehicle-upcoming-list strong{grid-column:2}.vehicle-term-card{grid-template-columns:4px minmax(0,1fr)}.vehicle-term-main,.vehicle-term-details,.vehicle-term-card>.row-actions{grid-column:2}.vehicle-term-main{align-items:flex-start;flex-direction:column}.vehicle-term-details{grid-template-columns:1fr}.vehicle-term-form{grid-template-columns:1fr}.vehicle-term-form .full{grid-column:auto}.vehicle-summary-map .device-live-map{height:240px}.device-card-header #device-card-header-icon{display:none}}
.summary-card-action{margin-top:12px;padding:0;border:0;background:transparent;color:var(--orange-dark);font-size:12px;font-weight:700;text-align:left}.summary-card-action:hover{text-decoration:underline}
.vehicle-history-filters{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}.vehicle-history-filters button{padding:8px 13px;border:1px solid var(--line);border-radius:99px;background:var(--surface-muted);color:var(--muted);font-size:12px}.vehicle-history-filters button.active{border-color:var(--orange);background:var(--sidebar-hover);color:var(--ink);font-weight:700}
.vehicle-history-table{width:100%;border-collapse:collapse}.vehicle-history-table th,.vehicle-history-table td{padding:12px 10px;border-bottom:1px solid var(--line);color:var(--ink);text-align:left;vertical-align:top}.vehicle-history-table th{color:var(--muted);font-size:12px;text-transform:uppercase}.vehicle-history-table td:first-child,.vehicle-history-table td:nth-child(3){white-space:nowrap}
:root[data-theme="dark"] .term-status.urgent{background:#513821;color:#ffc07b}:root[data-theme="dark"] .term-status.approaching{background:#47402f;color:#e5ca8a}
@media(max-width:700px){.vehicle-history-table th:nth-child(4),.vehicle-history-table td:nth-child(4){min-width:180px}.vehicle-history-panel .table-wrap{overflow-x:auto}.vehicle-term-card>.row-actions{flex-wrap:wrap;justify-content:flex-start}}/* mobile-vehicle-card-navigation */
.device-card-mobile-header,.device-card-section-trigger,.device-card-section-layer{display:none}
@media(max-width:1024px){
  .device-card-overlay{width:100%;max-width:100%;gap:var(--sp-3)}
  .device-card-header{min-height:58px;padding:6px 8px;border-bottom:1px solid var(--line)}
  .device-card-header>#device-card-header-icon,.device-card-header>div.device-card-heading,.device-card-header>.device-card-close{display:none!important}
  /* Menu główne ma teraz własny hamburger w nagłówku systemu — drugi w karcie byłby myłący. */
  .device-card-app-menu{display:none!important}
  .device-card-mobile-header{display:grid;flex:1 1 auto;width:100%;min-width:0;max-width:100%;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:0;overflow:hidden}
  .device-card-app-menu,.device-card-back{display:grid;width:44px;height:44px;min-width:44px;padding:0;place-items:center;border:0;border-radius:10px;background:transparent;color:var(--ink);font-size:23px;line-height:1}
  .device-card-back{font-size:27px}
  .device-card-app-menu:hover,.device-card-app-menu:focus-visible,.device-card-back:hover,.device-card-back:focus-visible{background:var(--surface-accent);color:var(--orange-dark)}
  .device-card-mobile-title{min-width:0;padding:0 6px}
  .device-card-mobile-title>b{display:block;overflow:hidden;color:var(--ink);font-size:15px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}
  .device-card-mobile-title>span{display:block;margin-top:2px;overflow:hidden;color:var(--muted);font-size:12px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}
  .device-card-mobile-title i{padding:0 3px;font-style:normal}
  .device-card-tabs{display:none}
  .device-card-section-trigger{display:flex;width:100%;min-height:48px;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:var(--surface);color:var(--ink);font-size:14px;font-weight:700;text-align:left}
  .device-card-section-trigger svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s ease}
  .device-card-section-trigger[aria-expanded="true"] svg{transform:rotate(180deg)}
  .device-card-body{min-width:0;max-width:100%;overflow-x:hidden;padding:12px 10px}
  .device-card-footer{min-width:0;min-height:64px;max-width:100vw;padding:8px 10px calc(8px + env(safe-area-inset-bottom,0));gap:8px;overflow-x:auto;overscroll-behavior-inline:contain}
  .device-card-footer button{min-height:44px;white-space:nowrap}
  .device-card-section-layer{position:fixed;z-index:12000;inset:0;display:flex;align-items:flex-end;justify-content:center;padding:0;background:rgba(24,23,22,.42);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease,visibility .2s ease}
  .device-card-section-layer.open{opacity:1;visibility:visible;pointer-events:auto}
  .device-card-section-sheet{width:100%;max-height:calc(100dvh - env(safe-area-inset-top,0) - 24px);padding:0 12px calc(12px + env(safe-area-inset-bottom,0));border:1px solid var(--line);border-width:1px 0 0;border-radius:18px 18px 0 0;background:var(--surface);box-shadow:0 -14px 40px rgba(0,0,0,.18);transform:translateY(105%);transition:transform .24s ease}
  .device-card-section-layer.open .device-card-section-sheet{transform:translateY(0)}
  .device-card-section-grab-zone{touch-action:pan-y}
  .device-card-section-handle{display:block;width:42px;height:4px;margin:8px auto 4px;border-radius:99px;background:var(--line-strong)}
  .device-card-section-sheet-head{display:flex;min-height:48px;align-items:center;justify-content:space-between;gap:12px}
  .device-card-section-sheet-head h3{margin:0;color:var(--ink);font-size:16px}
  .device-card-section-sheet-head button{display:grid;width:44px;height:44px;padding:0;place-items:center;background:transparent;color:var(--muted);font-size:26px;line-height:1}
  .device-card-section-list{display:grid;gap:3px}
  .device-card-section-list button{display:grid;width:100%;min-height:48px;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;padding:8px 12px;border:0;border-radius:10px;background:transparent;color:var(--ink);font-size:15px;text-align:left}
  .device-card-section-list button:hover,.device-card-section-list button:focus-visible{background:var(--surface-accent)}
  .device-card-section-list button.active{background:var(--surface-accent);color:var(--orange-dark);font-weight:700}
  .device-card-section-check{display:grid;width:24px;height:24px;place-items:center;color:var(--orange-dark);font-size:17px}
  .device-card-section,.device-simple-panel,.vehicle-upcoming-panel,.vehicle-summary-map,.vehicle-terms-panel{max-width:100%;box-sizing:border-box}
  .device-fields input,.device-fields select,.device-fields textarea,.vehicle-term-form input,.vehicle-term-form select,.vehicle-term-form textarea{max-width:100%}
  .command-pane,.command-layout,.command-editor,.vehicle-summary,.vehicle-summary-grid,.vehicle-term-list{min-width:0}
}
@media(max-width:430px){
  .device-card-header{padding-right:5px;padding-left:5px}
  .device-card-mobile-header{grid-template-columns:42px minmax(0,1fr)}
  .device-card-app-menu,.device-card-back{width:42px;height:44px;min-width:42px}
  .device-card-section-trigger{padding-right:12px;padding-left:12px}
  .device-card-body{padding-right:8px;padding-left:8px}
  .vehicle-summary{gap:12px}
  .vehicle-summary-grid{gap:10px}
  .vehicle-summary-card{min-height:auto;padding:14px}
  .vehicle-upcoming-panel,.vehicle-summary-map,.vehicle-terms-panel{padding:14px}
  .device-card-footer>span:empty{display:none}
}
:root[data-theme="dark"] .device-card-section-trigger,:root[data-theme="dark"] .device-card-section-sheet{background:var(--surface);color:var(--ink);border-color:var(--line)}
@media(prefers-reduced-motion:reduce){.device-card-section-layer,.device-card-section-sheet,.device-card-section-trigger svg{transition:none}}
.device-gps-assignment-actions{display:flex;align-items:end;gap:10px;flex-wrap:wrap;padding:4px 0}.device-gps-assignment-actions button{min-height:42px}@media(max-width:720px){.device-gps-assignment-actions{align-items:stretch}.device-gps-assignment-actions button{flex:1 1 auto}}


.vehicle-system-identity{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px}
.vehicle-system-identity label{display:grid;grid-template-columns:minmax(155px,210px) minmax(180px,1fr);align-items:center;gap:12px;margin:0;text-align:right;color:#202630}
.vehicle-system-identity label small{grid-column:2;text-align:left;color:#667085;font-size:12px;line-height:1.35;margin-top:-7px}
.vehicle-system-identity input[readonly]{background:#F5F6F8;color:#625e59;font-weight:600;border-color:#E4E7EC;cursor:not-allowed}
.vehicle-system-identity button{min-height:42px;white-space:nowrap}
:root[data-theme="dark"] .vehicle-system-identity label{color:var(--ink)}
:root[data-theme="dark"] .vehicle-system-identity input[readonly]{background:#202630;color:#E7EAEF;border-color:#434A55}
:root[data-theme="dark"] .vehicle-system-identity label small{color:var(--muted)}
@media(max-width:720px){.vehicle-system-identity{grid-template-columns:1fr}.vehicle-system-identity label{grid-template-columns:1fr;text-align:left}.vehicle-system-identity label small{grid-column:1;margin-top:-4px}.vehicle-system-identity button{width:100%}}

.vehicle-list-page{display:grid;gap:18px;min-width:0}
.vehicle-list-page>.panel{min-width:0;margin:0}
.vehicle-list-tabs::-webkit-scrollbar{display:none}
.vehicle-list-tabs button span{display:inline-flex;min-width:22px;justify-content:center;margin-left:5px;padding:1px 6px;border-radius:999px;background:var(--surface-muted,#E4E7EC);font-size:12px}
.vehicle-list-tabs button.active span{background:var(--orange);color:#fff}
:root[data-theme="dark"] .vehicle-list-tabs button{color:var(--muted)}
:root[data-theme="dark"] .vehicle-list-tabs button span{background:var(--surface-muted)}
:root[data-theme="dark"] .vehicle-list-tabs button.active{color:#F9A25D;background:var(--surface-accent)}
:root[data-theme="dark"] .vehicle-list-tabs button.active span{background:var(--orange);color:#242220}
@media(max-width:600px){.vehicle-list-page{gap:12px}.vehicle-list-tabs{padding:0 5px}.vehicle-list-tabs button{padding:13px 12px}}


/* vehicle list icon preview trigger */
.device-icon-preview-button{display:inline-grid;place-items:center;padding:0;border:0;border-radius:10px;background:transparent;color:inherit;cursor:pointer}
.device-icon-preview-button:hover{background:var(--sidebar-hover)}
.device-icon-preview-button:focus-visible{outline:3px solid rgba(245,130,32,.24);outline-offset:2px}


.archived-vehicle-notice{display:flex;align-items:center;gap:12px;margin:16px 18px 0;padding:12px 14px;border:1px solid var(--line);border-left:3px solid var(--orange);border-radius:10px;background:var(--surface-muted);color:var(--muted)}
.archived-vehicle-notice b{color:var(--text);white-space:nowrap}
.archived-vehicle-notice span{font-size:13px}
@media(max-width:700px){.archived-vehicle-notice{align-items:flex-start;flex-direction:column;gap:3px;margin:10px 12px 0}}

/* Compact vehicle cards on phones - desktop table remains unchanged. */
@media(max-width:760px){
  .vehicle-list-page>.panel{padding:14px}
  .vehicle-list-page .panel-head{display:grid;align-items:stretch;gap:12px}
  .vehicle-list-page .panel-head .ui-title-with-icon{margin:0}
  .vehicle-list-page .device-toolbar{display:flex;width:100%;align-items:stretch;gap:8px}
  .vehicle-list-page .device-toolbar select{min-width:0;flex:1 1 auto}
  .vehicle-list-page .device-toolbar button{flex:0 0 auto}
  .vehicle-list-table-wrap{overflow:visible}
  .vehicle-list-table{display:block!important;width:100%;min-width:0!important;overflow:visible!important}
  .vehicle-list-table thead{display:none}
  .vehicle-list-table tbody{display:grid;gap:10px}
  .vehicle-list-table tr{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
  .vehicle-list-table td{display:block;min-width:0;padding:8px 0;border:0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
  .vehicle-list-table td::before{content:attr(data-label);display:block;margin-bottom:4px;color:var(--muted);font-size:12px;font-weight:650;line-height:1.25}
  .vehicle-list-table .vehicle-select-cell,.vehicle-list-table .vehicle-preview-cell{position:absolute;z-index:1;top:12px;width:auto;padding:0;border:0}
  .vehicle-list-table .vehicle-select-cell{left:12px}
  .vehicle-list-table .vehicle-preview-cell{right:12px}
  .vehicle-list-table .vehicle-select-cell::before,.vehicle-list-table .vehicle-preview-cell::before,.vehicle-list-table .vehicle-name-cell::before,.vehicle-list-table .vehicle-code-cell::before{display:none}
  .vehicle-list-table .vehicle-name-cell{grid-column:1/-1;order:-3;padding:1px 44px 8px;border-bottom:0;font-size:15px}
  .vehicle-list-table .vehicle-code-cell{grid-column:1/-1;order:-2;padding:0 44px 10px;color:var(--muted);font-size:12px}
  .vehicle-list-table .vehicle-last-cell{grid-column:1/-1;border-bottom:0}
  .vehicle-list-table tr:has(.vehicle-empty-state){display:block;padding:18px}
  .vehicle-list-table tr:has(.vehicle-empty-state) td{padding:0;border:0}
  .vehicle-list-table .vehicle-empty-state{padding:8px}
}
@media(max-width:390px){
  .vehicle-list-page .device-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto}
  .vehicle-list-table tr{grid-template-columns:1fr}
  .vehicle-list-table td{grid-column:1/-1}
}
/* Sciezka nawigacji w widokach szczegolowych (standard: docs/ui-standard.md §6) */
.gl-breadcrumb{display:flex;align-items:center;gap:var(--sp-2);min-width:0;padding:0;color:var(--muted);font-size:var(--fs-small)}
.gl-breadcrumb button{min-height:auto;padding:0;background:transparent;color:var(--orange-dark);font-size:var(--fs-small);font-weight:600}
.gl-breadcrumb button:hover{text-decoration:underline}
.gl-breadcrumb b{min-width:0;overflow:hidden;color:var(--ink);font-weight:600;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:1024px){.gl-breadcrumb{padding:0}}

/* Karta pojazdu ma te sama strukture co lista: sciezka + pasek zakladek na poziomie
   strony, a tresc w zwyklym .panel (standard: docs/ui-standard.md §5 i §7). */
.device-card-panel{display:flex;flex-direction:column;min-width:0;margin:0;padding:0;overflow:hidden}
.device-card-panel>.device-card-header{border-bottom:1px solid var(--line)}
.device-card-body{background:transparent}
.device-card-footer{background:transparent;box-shadow:none}

/* /assets/monitor-v2.css */
.wg-monitor-content{position:relative;height:calc(100vh - 72px);padding:0!important;overflow:hidden}
.wg-monitor{position:relative;width:100%;height:100%;min-height:520px;background:#E4E7EC;overflow:hidden}
.wg-map{position:absolute!important;inset:0;width:100%;height:100%!important;min-height:0!important;border:0!important;border-radius:0!important;box-shadow:none!important}
.wg-monitor-panel{position:absolute;z-index:550;top:14px;bottom:14px;left:14px;width:376px;display:flex;flex-direction:column;background:#fff;border:1px solid #E4E7EC;border-radius:13px;box-shadow:0 8px 28px #2026302b;overflow:hidden;transition:transform .22s ease}
.wg-panel-head{display:flex;align-items:center;justify-content:space-between;padding:17px 17px 12px}
.wg-panel-head h3{margin:0 0 4px;font-size:17px;color:#202630}
.wg-panel-heading{display:grid;gap:4px}
.wg-panel-heading h3{margin:0;display:flex;min-width:0;align-items:center;flex-wrap:nowrap;white-space:nowrap}
.wg-panel-heading h3 .ui-icon{width:30px;height:30px}
.wg-panel-head span{font-size:12px;color:#667085}
.wg-panel-head span b{color:#202630}
.wg-panel-head>button{width:31px;height:31px;padding:0;border-radius:7px;background:#F5F6F8;color:#667085;font-size:24px;line-height:1}
.wg-monitor-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:3px;padding:0 12px 12px;border-bottom:1px solid #E4E7EC}
.wg-monitor-stats button{display:grid;gap:3px;padding:8px 2px;background:transparent;border:0;border-radius:8px;color:#667085}
.wg-monitor-stats button:hover,.wg-monitor-stats button.active{background:#F2F4F7;color:#B45C0B}
.wg-monitor-stats b{font-size:16px}
.wg-monitor-stats span{font-size:12px;white-space:nowrap}
.wg-monitor-search{display:grid;grid-template-columns:30px minmax(0,1fr) 42px;align-items:center;margin:12px;border:1px solid #E4E7EC;border-radius:8px;overflow:hidden;background:#F5F6F8}
.wg-monitor-search>span{display:grid;place-items:center;color:#667085}
.wg-monitor-search input{height:38px;padding:0 5px;border:0;background:transparent;font-size:12px}
.wg-monitor-search input:focus{outline:0}
.wg-monitor-search select{width:42px;height:38px;padding:0;border:0;border-left:1px solid #E4E7EC;border-radius:0;background:#fff;color:transparent;cursor:pointer}
.wg-monitor-search select:focus{outline:0}
.wg-device-list{flex:1;min-height:0;overflow:auto;border-top:1px solid #E4E7EC}
.wg-device-row{width:100%;display:grid;grid-template-columns:43px minmax(0,1fr) auto;gap:10px;align-items:center;padding:13px 14px;background:#fff;border:0;border-bottom:1px solid #E4E7EC;border-radius:0;text-align:left;color:#202630}
.wg-device-row:hover{background:#F5F6F8}
.wg-device-row.selected{position:relative;background:#F2F4F7}
.wg-device-row.selected:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#F58220}
.wg-device-icon{position:relative;display:grid;place-items:center}
.wg-device-icon>i{position:absolute;right:1px;bottom:2px;width:9px;height:9px;border:2px solid #fff;border-radius:50%;background:#667085}
.wg-device-row.online .wg-device-icon>i{background:#17845b}
.wg-device-row.offline .wg-device-icon>i{background:#b7443e}
.wg-device-copy{display:grid;gap:3px;min-width:0}
.wg-device-copy>span{display:flex;align-items:center;gap:7px;min-width:0}
.wg-device-copy b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:#202630}
.wg-device-copy em{padding:2px 5px;border-radius:9px;background:#E4E7EC;color:#667085;font-size:12px;font-style:normal}
.wg-device-copy em.online{background:#e6f7f1;color:#14724e}
.wg-device-copy em.offline{background:#fdeeee;color:#a93d38}
.wg-device-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#667085;font-size:12px}
.wg-device-side{display:grid;gap:5px;text-align:right;color:#667085;font-size:12px}
.wg-device-side>b{font-size:13px;color:#202630}
.wg-device-side>b small{font-size:12px;font-weight:500;color:#667085}
.wg-device-distance{color:#1b74e4;font-weight:700;white-space:nowrap}
:root[data-theme="dark"] .wg-device-distance{color:#6fa8ff}
.wg-monitor-panel>footer{display:grid;gap:3px;min-height:36px;padding:7px 13px;border-top:1px solid #E4E7EC;background:#F5F6F8;color:#667085;font-size:12px}
.wg-monitor-panel>footer .error{margin:0;color:#a93d38}
.wg-panel-open{display:none;position:absolute;z-index:551;left:14px;top:18px;width:35px;height:38px;padding:0;border-radius:8px;background:#fff;color:#667085;font-size:24px;box-shadow:0 5px 18px #20263026}
.wg-monitor.panel-collapsed .wg-monitor-panel{transform:translateX(calc(-100% - 24px))}
.wg-monitor.panel-collapsed .wg-panel-open{display:block}
.wg-selected-device{position:absolute;z-index:540;top:18px;left:406px;width:460px;background:#fff;border:1px solid #E4E7EC;border-radius:12px;box-shadow:0 8px 28px #2026302e;overflow:hidden}
.wg-selected-device.hidden{display:none}
.wg-selected-head{display:grid;grid-template-columns:46px minmax(0,1fr) 31px 31px;align-items:center;gap:9px;padding:12px 14px;border-bottom:1px solid #E4E7EC}
.wg-selected-head h3{margin:0;color:#202630;font-size:15px}
.wg-selected-head p{display:flex;align-items:center;gap:5px;margin:4px 0 0;color:#667085;font-size:12px}
.wg-selected-head p small{color:#667085}
.wg-selected-head>button{width:30px;height:30px;padding:0;border-radius:7px;background:transparent;color:#667085;font-size:18px}
.wg-selected-head>button:hover{background:#F5F6F8}
.wg-state-dot{width:8px;height:8px;border-radius:50%;background:#667085}
.wg-state-dot.online{background:#17845b}.wg-state-dot.offline{background:#b7443e}
.wg-selected-grid{display:grid;grid-template-columns:1fr 1fr;padding:6px 14px 9px}
.wg-telemetry-item{display:grid;grid-template-columns:29px minmax(0,1fr);align-items:center;gap:8px;min-height:48px;border-bottom:1px solid #E4E7EC}
.wg-telemetry-item:nth-last-child(-n+2){border-bottom:0}
.wg-telemetry-icon{display:grid;place-items:center;width:27px;height:27px;border-radius:7px;background:#F2F4F7;color:#B45C0B;font-size:12px;font-weight:800}
.wg-telemetry-item>span:last-child{display:grid;gap:2px;min-width:0}
.wg-telemetry-item small{color:#667085;font-size:12px}
.wg-telemetry-item b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#202630;font-size:12px}
.wg-selected-location{display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:8px;align-items:center;margin:0 14px 11px;padding:10px;border-radius:8px;background:#F5F6F8}
.wg-navigate{height:34px;padding:0 12px;border:1px solid #E4E7EC;border-radius:8px;background:#fff;color:#B45C0B;font-size:12px;font-weight:700;white-space:nowrap}
.wg-navigate:hover{border-color:#B45C0B;background:#F2F4F7}
:root[data-theme="dark"] .wg-navigate{background:#1B1F25;border-color:#343A44;color:#F9A25D}
.wg-selected-location>span{color:#B45C0B}
.wg-selected-location div{display:grid;gap:2px}
.wg-selected-location small{color:#667085;font-size:12px}
.wg-selected-location b{font-size:12px;color:#202630}
.wg-selected-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(68px,1fr));border-top:1px solid #E4E7EC}
.wg-selected-actions button{display:grid;place-items:center;gap:3px;padding:9px 5px;border:0;border-right:1px solid #E4E7EC;border-radius:0;background:#fff;color:#667085;font-size:12px}
.wg-selected-actions button:last-child{border-right:0}
.wg-selected-actions button:hover:not(:disabled){background:#F2F4F7;color:#B45C0B}
.wg-selected-actions button:disabled{opacity:.38;cursor:not-allowed}
.wg-selected-actions span{font-size:17px;color:#F58220}
.wg-map-tools{position:absolute;z-index:530;right:14px;top:14px;display:grid;gap:7px}
.wg-map-tools button{width:38px;height:38px;padding:0;border:1px solid #E4E7EC;border-radius:8px;background:#fff;color:#667085;font-size:17px;box-shadow:0 4px 15px #2026301f}
.wg-map-tools button svg{width:19px;height:19px}
.wg-map-tools #wg-locate.active{border-color:#1b74e4;color:#1b74e4}
.wg-map-tools #wg-locate.busy{color:#B45C0B;animation:wg-locate-pulse 1.1s ease-in-out infinite}
:root[data-theme="dark"] .wg-map-tools #wg-locate.active{border-color:#6fa8ff;color:#6fa8ff}
@keyframes wg-locate-pulse{50%{opacity:.45}}
.wg-me-icon .wg-me-dot{display:block;width:16px;height:16px;margin:3px;border:2.5px solid #fff;border-radius:50%;background:#1b74e4;box-shadow:0 0 0 1px #1b74e4,0 2px 8px #20263040}
.wg-map-legend{position:absolute;z-index:520;left:50%;bottom:14px;display:flex;gap:14px;transform:translateX(-50%);padding:7px 12px;border-radius:8px;background:#fffc;color:#667085;font-size:12px;box-shadow:0 3px 12px #20263017;backdrop-filter:blur(5px)}
.wg-map-legend span{display:flex;align-items:center;gap:5px}
.wg-map-legend i{width:8px;height:8px;border-radius:50%;background:#667085}
.wg-map-legend i.online{background:#17845b}.wg-map-legend i.offline{background:#b7443e}
.wg-map-tooltip{border:0!important;border-radius:6px!important;box-shadow:0 3px 12px #20263026!important;color:#202630!important;font-weight:700!important}
.wg-monitor .leaflet-control-zoom{margin-right:14px!important;margin-bottom:48px!important;border:0!important;box-shadow:0 4px 15px #2026301f!important}
.wg-monitor .leaflet-control-zoom a{border-color:#E4E7EC!important;color:#667085!important}
.wg-monitor .monitor-empty{display:grid;gap:6px;padding:35px 16px;color:#667085;font-size:12px}
.wg-monitor .monitor-empty b{color:#202630;font-size:13px}

@media(max-width:1180px){
  .wg-monitor-panel{width:330px}
  .wg-selected-device{left:360px;width:420px}
}
@media(max-width:900px){
  .wg-selected-device{top:auto;right:14px;bottom:14px;left:360px;width:auto}
}
@media(max-width:760px){
  .wg-monitor-content{height:calc(100vh - 72px)!important;padding:0!important}
  .wg-monitor{min-height:460px}
  .wg-monitor-panel{top:8px;bottom:8px;left:8px;width:min(340px,calc(100vw - 16px))}
  .wg-selected-device{right:8px;bottom:8px;left:8px;width:auto;max-height:52vh;overflow:auto}
  /* Karta przewija sie na telefonie — akcje zostaja przyklejone, zeby zawsze byly pod reka. */
  .wg-selected-actions{position:sticky;bottom:0;z-index:1;background:inherit}
  .wg-monitor:not(.panel-collapsed) .wg-selected-device{display:none}
  .wg-panel-open{left:8px;top:8px}
  .wg-map-tools{right:8px;top:8px}
  .wg-map-legend{display:none}
}

/* Professional monitoring filters 2026-08-02 */
.wg-monitor-filters{display:grid;gap:10px;padding:12px;border-top:1px solid var(--line,#ebe8e4);background:var(--surface,#fff)}
.wg-search-field{display:grid;grid-template-columns:38px minmax(0,1fr) 34px;align-items:center;min-height:43px;border:1px solid var(--line,#dcd8d2);border-radius:10px;background:var(--surface-soft,#F5F6F8);transition:border-color .16s,box-shadow .16s,background .16s}
.wg-search-field:focus-within{border-color:#F58220;background:var(--surface,#fff);box-shadow:0 0 0 3px rgba(245,130,32,.12)}
.wg-search-icon{display:grid;place-items:center;color:var(--muted,#667085)}
.wg-search-icon svg{width:18px;height:18px}
.wg-search-field input{width:100%;height:41px;padding:0;border:0;background:transparent;color:var(--text,#202630);font-size:12px;outline:0}
.wg-search-field input::placeholder{color:var(--muted,#667085)}
.wg-search-field input::-webkit-search-cancel-button{display:none}
.wg-search-clear{width:28px;height:28px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--muted,#667085);font-size:20px;line-height:1}
.wg-search-clear:hover{background:var(--surface-accent,#F2F4F7);color:var(--orange-dark,#B45C0B)}
.wg-filter-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:end}
.wg-status-filter,.wg-position-filter-group{display:grid;grid-template-rows:14px 38px;gap:5px;min-width:0}
.wg-status-filter>span,.wg-position-filter-group>span{color:var(--muted,#77716b);font-size:12px;font-weight:700;line-height:14px}
.wg-status-filter select{width:100%;height:38px;margin:0;padding:0 34px 0 11px;border:1px solid var(--line,#dcd8d2);border-radius:8px;background-color:var(--surface,#fff);color:var(--text,#202630);font-size:12px;font-weight:600;cursor:pointer}
.wg-status-filter select:focus{border-color:#F58220;outline:3px solid rgba(245,130,32,.12)}
.wg-position-filter{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;height:38px;margin:0;padding:0 10px;border:1px solid var(--line,#dcd8d2);border-radius:8px;background:var(--surface,#fff);color:var(--muted,#77716b);font-size:12px;font-weight:700;white-space:nowrap}
.wg-position-filter .ui-icon{width:23px;height:23px;background:transparent;color:inherit}
.wg-position-filter .ui-icon svg{width:15px;height:15px}
.wg-position-filter:hover,.wg-position-filter.active{border-color:#B45C0B;background:var(--surface-accent,#F2F4F7);color:var(--orange-dark,#B45C0B)}
.wg-filter-summary{display:flex;align-items:center;justify-content:space-between;min-height:20px;color:var(--muted,#667085);font-size:12px}
.wg-filter-summary button{padding:2px 0;border:0;background:transparent;color:var(--orange-dark,#B45C0B);font-size:12px;font-weight:700}
.wg-filter-summary button:hover{text-decoration:underline}
:root[data-theme="dark"] .wg-monitor-filters{background:var(--surface,#1B1F25);border-color:var(--line,#343A44)}
:root[data-theme="dark"] .wg-search-field,:root[data-theme="dark"] .wg-status-filter select,:root[data-theme="dark"] .wg-position-filter{background:var(--surface-soft,#22262D);border-color:var(--line,#343A44);color:var(--text,#E7EAEF)}
@media(max-width:380px){
  .wg-filter-controls{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .wg-position-filter{width:100%;gap:4px;padding:0 6px;font-size:12px}
  .wg-position-filter .ui-icon{width:20px;height:20px}
}
/* /assets/dashboard-v2.css */
.db-dashboard{display:grid;gap:14px}
.db-summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.db-summary-card{position:relative;min-height:176px;padding:20px 22px;overflow:hidden;border:1px solid #E4E7EC;border-radius:14px;background:#fff;color:#202630;text-align:left;box-shadow:0 5px 20px #20263008}
.db-summary-card:hover{transform:translateY(-1px);border-color:#E4E7EC;box-shadow:0 9px 25px #20263014}
.db-summary-title{position:relative;display:flex;align-items:center;gap:10px;font-size:16px;font-weight:800}
.db-summary-title .ui-icon{width:28px;height:28px}
.db-summary-title .ui-icon svg{width:17px;height:17px}
.db-summary-card>strong{position:relative;display:block;margin-top:17px;text-align:center;color:#202630;font-size:30px}
.db-summary-card>small{position:relative;display:block;margin-top:1px;text-align:center;color:#667085;font-size:12px}
.db-summary-card>em{position:absolute;top:61px;left:calc(50% + 33px);padding:3px 8px;border-radius:10px;background:#F5F6F8;color:#667085;font-size:12px;font-style:normal}
.db-summary-note{position:absolute;right:20px;bottom:16px;left:20px;display:flex;justify-content:space-between;color:#667085;font-size:12px}
.db-summary-note strong{color:#202630}.db-summary-note b{color:#F58220}
.db-summary-wave{display:none}

.db-main-grid{display:grid;grid-template-columns:1.02fr 1fr 1fr;gap:14px}
.db-panel{margin:0!important;padding:20px;background:#fff;border:1px solid #E4E7EC;border-radius:14px;box-shadow:0 5px 20px #20263008}
.db-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:14px}
.db-panel-head h3{margin:0;color:#202630;font-size:16px}
.db-panel-head h3 .ui-icon{width:28px;height:28px}
.db-panel-head h3 .ui-icon svg{width:17px;height:17px}
.db-panel-head p{margin:4px 0 0;color:#667085;font-size:12px}
.db-panel-head>button{padding:5px 8px;background:transparent;color:#F58220;font-size:12px}
.db-panel-head>button:hover{text-decoration:underline}
.db-actions{display:flex;min-height:300px;flex-direction:column}
.db-action-body{display:flex;flex:1;flex-direction:column;padding:18px 2px 0}
.db-action-body label{margin:0;color:#667085;font-size:12px}
.db-action-body select{margin-top:7px}
.db-action-copy{display:flex;align-items:center;gap:13px;padding:15px 0}
.db-action-copy h4{margin:0 0 5px;color:#202630;font-size:15px}
.db-action-copy p,.db-action-help{margin:0;color:#667085;font-size:12px;line-height:1.55}
.db-action-icon{display:grid;place-items:center;width:50px;height:50px;border-radius:12px;background:#F2F4F7;color:#F58220;font-size:22px}
.db-action-buttons{display:flex;justify-content:flex-end;gap:8px;margin-top:auto;padding-top:18px}
.db-action-buttons button{min-width:110px}
.db-empty{display:grid;min-height:140px;place-items:center;color:#667085;font-size:12px}
.db-status-content{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:16px;min-height:230px}
.db-donut{position:relative;width:154px;height:154px;margin:auto;padding:0;border-radius:50%}
.db-donut:after{content:"";position:absolute;inset:24px;border-radius:50%;background:#fff}
.db-donut>span{position:absolute;z-index:1;inset:0;display:grid;place-content:center;text-align:center}
.db-donut b{color:#202630;font-size:25px}.db-donut small{color:#667085;font-size:12px}
.db-status-list{display:grid;gap:8px}
.db-status-list button{display:grid;grid-template-columns:9px 1fr auto;align-items:center;gap:8px;padding:10px;background:#F5F6F8;color:#667085;text-align:left}
.db-status-list button:hover{background:#F2F4F7;color:#F58220}
.db-status-list i,.db-map-status i{width:8px;height:8px;border-radius:50%;background:#667085}
.db-status-list i.online,.db-map-status i.online{background:#17845b}
.db-status-list i.offline,.db-map-status i.offline{background:#b7443e}
.db-status-list span{font-size:12px}.db-status-list b{font-size:13px}
.db-model-list{display:grid}
.db-model-row{display:grid;grid-template-columns:1fr 40px;gap:5px 12px;align-items:center;padding:12px 2px;background:#fff;border-bottom:1px solid #E4E7EC;border-radius:0;text-align:left}
.db-model-row:hover b{color:#F58220}
.db-model-row>span{display:flex;justify-content:space-between;gap:8px;color:#202630}
.db-model-row small{color:#667085;font-weight:400}
.db-model-row em{color:#667085;font-size:12px;font-style:normal;text-align:right}
.db-model-row>i{grid-column:1/-1;height:5px;overflow:hidden;border-radius:4px;background:#E4E7EC}
.db-model-row>i span{display:block;height:100%;border-radius:4px;background:#F58220}
.db-activity-panel{display:flex;min-height:300px;flex-direction:column}
.db-activity-grid{display:grid;grid-template-columns:1fr 1fr;flex:1}
.db-activity-item{display:flex;min-width:0;flex-direction:column;justify-content:center;gap:9px;padding:14px 16px;border-right:1px solid #E4E7EC;border-bottom:1px solid #E4E7EC}
.db-activity-item:nth-child(2n){border-right:0}
.db-activity-item:nth-child(n+3){border-bottom:0}
.db-activity-item>span{display:flex;align-items:center;gap:8px;color:#667085}
.db-activity-item .ui-icon{width:28px;height:28px;background:#F2F4F7;color:#B45C0B}
.db-activity-item .ui-icon svg{width:16px;height:16px}
.db-activity-item small{font-size:12px}
.db-activity-item strong{color:#202630;font-size:24px;line-height:1.15;white-space:nowrap}
.db-map-panel{position:relative;padding-bottom:14px}
#dashboard-map{height:330px;border-radius:10px;background:#F5F6F8}
.db-map-status{position:absolute;right:28px;bottom:24px;z-index:500;display:flex;align-items:center;gap:4px;padding:4px;border-radius:8px;background:#fffe;box-shadow:0 4px 16px #2026301c}
.db-map-status button{display:flex;align-items:center;gap:5px;padding:7px 9px;background:transparent;color:#667085;font-size:12px}
.db-map-status button:hover{background:#F2F4F7;color:#F58220}.db-map-status b{color:#202630}

.db-alerts-panel{display:flex;min-height:300px;flex-direction:column;overflow:hidden}
.db-alerts-panel .db-panel-head{margin-bottom:5px}
.db-alerts-panel .db-panel-head h3{min-width:0;line-height:1.25}
.db-alerts-panel .db-panel-head>button{flex:0 0 auto;white-space:nowrap}
.db-alert-list{display:grid;flex:1;align-content:start}
.db-alert-row{position:relative;display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:46px;padding:8px 2px;border-bottom:1px solid #E4E7EC;border-radius:0;background:transparent;color:#202630;text-align:left}
.db-alert-row:last-child{border-bottom:0}
.db-alert-row:hover{background:#F2F4F7}
.db-alert-row.unread:before{content:"";position:absolute;top:50%;left:-7px;width:5px;height:5px;border-radius:50%;background:#F58220;transform:translateY(-50%)}
.db-alert-icon{display:grid;width:28px;height:28px;place-items:center;border-radius:8px;background:#F2F4F7;color:#B45C0B}
.db-alert-icon .ui-icon{width:17px;height:17px}
.db-alert-copy{display:block;min-width:0}
.db-alert-copy b,.db-alert-copy strong,.db-alert-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.db-alert-copy b{color:#202630;font-size:12px}
.db-alert-copy strong{margin-top:2px;color:#202630;font-size:12px}
.db-alert-copy small{margin-top:2px;color:#667085;font-size:12px;font-weight:400}
.db-alert-row time{color:#667085;font-size:12px;white-space:nowrap}
.db-alert-empty{display:grid;min-height:220px;place-content:center;justify-items:center;gap:10px;color:#667085;font-size:12px;text-align:center}
.db-alert-empty p{margin:0}
.db-alert-empty button{padding:6px 9px;background:transparent;color:#F58220;font-size:12px}
.db-alert-empty button:hover{text-decoration:underline}
:root[data-theme="dark"] .db-alert-row{color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .db-alert-row:hover{background:#272C34}
:root[data-theme="dark"] .db-alert-copy b,:root[data-theme="dark"] .db-alert-copy strong{color:#F5F6F8}
:root[data-theme="dark"] .db-alert-icon{background:#272C34;color:#F9A25D}
:root[data-theme="dark"] .db-activity-item{border-color:var(--line)}
:root[data-theme="dark"] .db-activity-item .ui-icon{background:#272C34;color:#F9A25D}
:root[data-theme="dark"] .db-activity-item strong{color:#F5F6F8}
@media(max-width:1200px){
  .db-main-grid{grid-template-columns:1fr 1fr}
  .db-models-panel{grid-column:1/-1}
  .client-dashboard-grid .db-models-panel{grid-column:auto}
  .client-dashboard-grid .db-activity-panel{grid-column:auto}
  .client-dashboard-grid .db-alerts-panel{grid-column:1/-1}
}
@media(max-width:900px){
  .db-summary-grid{grid-template-columns:1fr}
  .db-summary-card{min-height:150px}
}
@media(max-width:760px){
  .db-main-grid{grid-template-columns:1fr}
  .db-models-panel{grid-column:auto}
  .client-dashboard-grid .db-activity-panel{grid-column:auto}
  .client-dashboard-grid .db-alerts-panel{grid-column:auto}
  .db-alerts-panel .db-panel-head{flex-wrap:wrap}
  .db-alert-row{grid-template-columns:28px minmax(0,1fr)}
  .db-alert-row time{grid-column:2}
  .db-status-content{grid-template-columns:1fr}
  .db-actions{min-height:280px}
  .db-action-tabs{overflow:auto}
  .db-action-buttons{flex-direction:column}
  .db-action-buttons button{width:100%}
  #dashboard-map{height:380px}
  .db-map-status{right:16px;bottom:20px;left:16px;justify-content:center}
}

.db-dashboard-editorbar{display:flex;min-height:28px;align-items:center;justify-content:space-between;gap:12px}
.db-dashboard-editorbar>button,.db-dashboard-editorbar>div button{padding:5px 8px;background:transparent;color:#F58220;font-size:12px}
.db-dashboard-editorbar>button:hover,.db-dashboard-editorbar>div button:hover{text-decoration:underline}
.db-dashboard-editorbar>div{display:flex;align-items:center;gap:5px}
.db-dashboard-editorbar>div button.save{border:1px solid #F58220;background:#F58220;color:#fff;text-decoration:none}
.db-editor-hint{color:#667085;font-size:12px}
.client-widget-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));align-items:stretch;gap:14px}
.db-widget{position:relative;min-width:0}
.db-widget>.db-panel{box-sizing:border-box;height:100%}
.db-widget-medium{grid-column:span 2;min-height:300px}
.db-widget-small{grid-column:span 2;min-height:160px}
.db-widget-wide{grid-column:span 3;min-height:300px}.db-widget-large{grid-column:1/-1;min-height:390px}
.dashboard-editing .db-widget{cursor:grab;outline:1px dashed #E4E7EC;outline-offset:3px;border-radius:14px}
.dashboard-editing .db-widget:active{cursor:grabbing}
.dashboard-editing .db-widget>.db-panel{pointer-events:none;user-select:none}
.db-widget.dragging{opacity:.45}
.db-widget.drag-over{outline:2px solid #F58220;outline-offset:4px}
.db-widget-controls{position:absolute;z-index:610;top:7px;right:7px;display:flex;align-items:center;gap:2px;padding:3px;border:1px solid #E4E7EC;border-radius:8px;background:#fffc;box-shadow:0 3px 10px #20263014;pointer-events:auto}
.db-widget-controls button{display:grid;width:24px;height:24px;padding:0;place-items:center;background:transparent;color:#667085;font-size:13px}
.db-widget-controls button:hover{background:#F2F4F7;color:#B45C0B}
.db-widget-controls button.remove:hover{background:#FDECEA;color:#b7443e}
.db-drag-handle{padding:0 4px;color:#667085;font-size:14px;cursor:grab;letter-spacing:-3px}
.db-add-widget{display:grid;grid-column:span 2;min-height:160px;place-content:center;justify-items:center;gap:7px;border:1px dashed #E4E7EC;border-radius:14px;background:#F5F6F8;color:#667085}
.db-add-widget:hover{border-color:#F58220;background:#F2F4F7;color:#B45C0B}
.db-add-widget b{display:grid;width:38px;height:38px;place-items:center;border-radius:50%;background:#F2F4F7;color:#B45C0B;font-size:24px;font-weight:400}
.db-add-widget span{font-size:12px;font-weight:700}
.db-dashboard-empty{display:grid;min-height:220px;place-items:center;border:1px dashed #E4E7EC;border-radius:14px;background:#F5F6F8;color:#667085;font-size:12px}
.db-metric-panel{display:flex;min-height:160px;flex-direction:column}
.db-metric-panel .db-panel-head{margin-bottom:6px}
.db-metric-panel .db-panel-head h3{font-size:14px;line-height:1.25}
.db-metric-value{display:grid;flex:1;place-content:center;text-align:center}
.db-metric-value strong{color:#202630;font-size:30px;line-height:1.15}
.db-metric-value small{margin-top:6px;color:#667085;font-size:12px}
.db-last-route-panel{display:flex;min-height:300px;flex-direction:column}
.db-last-route{display:grid;gap:11px;align-content:start}
.db-last-route-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:8px;border-bottom:1px solid #E4E7EC}
.db-last-route-head strong{overflow:hidden;color:#202630;font-size:12px;text-overflow:ellipsis;white-space:nowrap}
.db-last-route-head time{color:#667085;font-size:12px;white-space:nowrap}
.db-last-route-place{display:grid;grid-template-columns:25px minmax(0,1fr);align-items:start;gap:8px;color:#667085;font-size:12px;line-height:1.4}
.db-last-route-place i{display:grid;width:22px;height:22px;place-items:center;border-radius:50%;background:#F2F4F7;color:#B45C0B;font-size:12px;font-style:normal;font-weight:800}
.db-last-route-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:2px}
.db-last-route-summary span{padding:9px;border-radius:9px;background:#F5F6F8}
.db-last-route-summary small,.db-last-route-summary b{display:block}
.db-last-route-summary small{color:#667085;font-size:12px}.db-last-route-summary b{margin-top:3px;color:#202630;font-size:13px}
.db-last-route-empty{display:grid;flex:1;place-items:center;color:#667085;font-size:12px}
.db-activity-item:first-child{grid-column:1/-1;border-right:0}.db-activity-item:nth-child(2){border-right:1px solid #E4E7EC;border-bottom:0}.db-activity-item:nth-child(3){border-right:0;border-bottom:0}
.db-operations-panel,.db-attention-panel{display:flex;min-height:300px;flex-direction:column;overflow:hidden}.db-operations-panel .db-panel-head,.db-attention-panel .db-panel-head{margin-bottom:6px}
.db-operation-list{display:grid;flex:1;align-content:start}.db-operation-row{display:grid;grid-template-columns:8px minmax(0,1fr) auto;align-items:center;gap:9px;min-height:43px;padding:7px 3px;border-bottom:1px solid #E4E7EC;border-radius:0;background:transparent;color:#202630;text-align:left}.db-operation-row:last-child{border-bottom:0}.db-operation-row:hover{background:#F2F4F7}.db-operation-row>i{width:7px;height:7px;border-radius:50%;background:#667085}.db-operation-row>i.ok{background:#17845b}.db-operation-row>i.approaching{background:#d9a441}.db-operation-row>i.urgent{background:#F58220}.db-operation-row>i.overdue{background:#b7443e}.db-operation-row>span,.db-operation-row>strong{min-width:0}.db-operation-row>span b,.db-operation-row>span small,.db-operation-row>strong,.db-operation-row>strong small{display:block}.db-operation-row>span b{overflow:hidden;color:#202630;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.db-operation-row>span small{margin-top:2px;overflow:hidden;color:#667085;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.db-operation-row>strong{color:#202630;font-size:12px;text-align:right;white-space:nowrap}.db-operation-row>strong small{margin-top:2px;color:#667085;font-size:12px;font-weight:400}.db-operations-empty,.db-attention-ok{display:grid;min-height:210px;place-content:center;justify-items:center;gap:5px;color:#667085;font-size:12px;text-align:center}.db-attention-ok b{color:#17845b;font-size:13px}.db-attention-ok small{color:#667085}.db-attention-count{display:grid;min-width:30px;height:30px;padding:0 7px;place-items:center;border-radius:99px;background:#F2F4F7;color:#B45C0B;font-size:15px}.db-attention-breakdown{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-bottom:6px}.db-attention-breakdown span{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:6px 7px;border-radius:7px;background:#F5F6F8;color:#667085;font-size:12px}.db-attention-breakdown b{color:#202630;font-size:12px}
.db-login-list{display:grid;flex:1;align-content:start}.db-login-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;min-height:43px;padding:7px 3px;border-bottom:1px solid #E4E7EC}.db-login-row:last-child{border-bottom:0}.db-login-platform{position:relative;display:grid;width:29px;height:29px;place-items:center;border-radius:8px;background:#F5F6F8;color:#4a4845}.db-login-platform svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.db-login-platform i{position:absolute;right:-2px;bottom:-2px;width:8px;height:8px;border:2px solid #fff;border-radius:50%;background:#667085}.db-login-platform i.online{background:#17845b}.db-login-platform i.offline{background:#a8a39d}.db-login-row>span:nth-child(2){min-width:0}.db-login-row b,.db-login-row small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.db-login-row b{color:#202630;font-size:12px}.db-login-row small{margin-top:2px;color:#667085;font-size:12px}.db-login-row strong{color:#6f6a65;font-size:12px;text-align:right;white-space:nowrap}.db-login-row strong.online{color:#17845b}.db-recent-logins .db-panel-head{margin-bottom:6px}:root[data-theme="dark"] .db-login-row{border-color:var(--line)}:root[data-theme="dark"] .db-login-platform{background:#22262D;color:#eeeae5}:root[data-theme="dark"] .db-login-platform i{border-color:#1B1F25}:root[data-theme="dark"] .db-login-row b{color:#F5F6F8}:root[data-theme="dark"] .db-login-row strong{color:#98A2B3}:root[data-theme="dark"] .db-login-row strong.online{color:#67c49d}
:root[data-theme="dark"] .db-operation-row{color:var(--ink);border-color:var(--line)}:root[data-theme="dark"] .db-operation-row:hover{background:#272C34}:root[data-theme="dark"] .db-operation-row>span b,:root[data-theme="dark"] .db-operation-row>strong,:root[data-theme="dark"] .db-attention-breakdown b{color:#F5F6F8}:root[data-theme="dark"] .db-attention-breakdown span{background:#22262D}:root[data-theme="dark"] .db-attention-count{background:#272C34;color:#F9A25D}:root[data-theme="dark"] .db-activity-item:nth-child(2){border-color:var(--line)}
.dashboard-widget-modal{width:min(660px,calc(100vw - 32px));max-height:min(760px,calc(100vh - 32px))}
.db-widget-options{display:grid;gap:7px;margin-top:16px}
.db-widget-option{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px;border:1px solid #E4E7EC;border-radius:10px;background:#fff}
.db-widget-option>span .ui-icon{width:30px;height:30px}
.db-widget-option div{min-width:0}.db-widget-option b,.db-widget-option small{display:block}
.db-widget-option b{color:#202630;font-size:12px}.db-widget-option small{margin-top:3px;color:#667085;font-size:12px;line-height:1.35}
.db-widget-option button{padding:6px 10px;font-size:12px}
.db-widget-options-empty{padding:35px 10px;color:#667085;font-size:12px;text-align:center}
:root[data-theme="dark"] .db-widget-controls{border-color:var(--line);background:#1B1F25ee}
:root[data-theme="dark"] .db-widget-controls button{color:#E4E7EC}
:root[data-theme="dark"] .db-add-widget,:root[data-theme="dark"] .db-dashboard-empty{border-color:var(--line);background:#1B1F25;color:#98A2B3}
:root[data-theme="dark"] .db-metric-value strong,:root[data-theme="dark"] .db-last-route-head strong,:root[data-theme="dark"] .db-last-route-summary b{color:#F5F6F8}
:root[data-theme="dark"] .db-last-route-head{border-color:var(--line)}
:root[data-theme="dark"] .db-last-route-summary span{background:#22262D}
:root[data-theme="dark"] .db-widget-option{border-color:var(--line);background:#1B1F25}
:root[data-theme="dark"] .db-widget-option b{color:#F5F6F8}
@media(max-width:1200px){
  .client-widget-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .db-widget-small,.db-widget-medium,.db-widget-wide,.db-add-widget{grid-column:auto}
  .db-widget-large{grid-column:1/-1}
}
@media(max-width:760px){
  .db-dashboard-editorbar{align-items:flex-start}
  .db-dashboard-editorbar>div{flex-wrap:wrap;justify-content:flex-end}
  .db-editor-hint{max-width:135px}
  .client-widget-grid{grid-template-columns:1fr}
  .db-widget-small,.db-widget-medium,.db-widget-wide,.db-widget-large,.db-add-widget{grid-column:auto}
  .db-widget-controls{right:5px;left:5px;justify-content:flex-end}
  .db-widget-option{grid-template-columns:30px minmax(0,1fr)}
  .db-widget-option button{grid-column:2;justify-self:start}
  .db-operation-row{grid-template-columns:8px minmax(0,1fr)}
  .db-operation-row>strong{grid-column:2;text-align:left;white-space:normal}
  .db-attention-breakdown{grid-template-columns:1fr}
}
.db-widget>.db-summary-card{width:100%;height:100%;min-height:160px}
.db-admin-attention-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-bottom:6px}
.db-admin-attention-stats span{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:6px 7px;border-radius:7px;background:#F5F6F8;color:#667085;font-size:12px}
.db-admin-attention-stats span:last-child{grid-column:1/-1}
.db-admin-attention-stats b{color:#202630;font-size:12px}
.db-admin-dashboard .db-summary-card{min-height:160px}
.db-admin-dashboard .db-widget-medium>.db-panel,.db-admin-dashboard .db-widget-wide>.db-panel{min-height:300px}
:root[data-theme="dark"] .db-admin-attention-stats span{background:#22262D}
:root[data-theme="dark"] .db-admin-attention-stats b{color:#F5F6F8}
@media(max-width:760px){.db-admin-attention-stats{grid-template-columns:1fr}.db-admin-attention-stats span:last-child{grid-column:auto}}
@media(max-width:760px){.db-login-row{grid-template-columns:34px minmax(0,1fr)}.db-login-row strong{grid-column:2;text-align:left;white-space:normal}}

/* Professional quick actions 2026-08-02 */
.db-actions{min-height:340px;overflow:hidden}
.db-actions-head{margin-bottom:12px}
.db-actions-head h3{display:flex;align-items:center;gap:9px}
.db-actions-head h3 .ui-icon{background:var(--surface-accent,#F2F4F7);color:var(--orange-dark,#B45C0B)}
.db-action-body{padding:16px 0 0}
.db-action-intro{display:flex;align-items:flex-start;gap:11px;margin-bottom:15px}
.db-action-intro>.ui-icon{width:38px;height:38px;flex:0 0 38px;background:var(--surface-accent,#F2F4F7);color:var(--orange-dark,#B45C0B)}
.db-action-intro>.ui-icon svg{width:19px;height:19px}
.db-action-intro h4{margin:1px 0 4px;color:var(--text,#202630);font-size:14px;line-height:1.3}
.db-action-intro p{margin:0;color:var(--muted,#77716b);font-size:12px;line-height:1.45}
.db-action-field{display:grid;gap:6px}
.db-action-field label{color:var(--text,#202630);font-size:12px;font-weight:700}
.db-action-field select{width:100%;margin:0;min-height:42px;background:var(--surface,#fff)}
.db-action-field small{color:var(--muted,#667085);font-size:12px;line-height:1.4}
.db-action-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:2px}
.db-action-choice{display:flex;align-items:center;gap:10px;min-height:76px;padding:12px;border:1px solid var(--line,#e3dfda);border-radius:10px;background:var(--surface,#fff);color:var(--text,#202630);text-align:left}
.db-action-choice:hover{border-color:#B45C0B;background:var(--surface-accent,#F2F4F7)}
.db-action-choice>.ui-icon{width:34px;height:34px;flex:0 0 34px;background:var(--surface-soft,#F5F6F8);color:var(--orange-dark,#B45C0B)}
.db-action-choice span{min-width:0;display:grid;gap:3px}
.db-action-choice b{font-size:12px}
.db-action-choice small{color:var(--muted,#77716b);font-size:12px;line-height:1.35}
.db-action-choice.primary-choice{border-color:#B45C0B;background:var(--surface-accent,#F2F4F7)}
.db-action-buttons{padding-top:14px}
.db-action-buttons button:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(.25)}
.db-action-refresh-info{display:flex;align-items:center;justify-content:space-between;padding:11px 13px;border:1px solid var(--line,#E4E7EC);border-radius:9px;background:var(--surface-soft,#F5F6F8);color:var(--muted,#77716b);font-size:12px}
.db-action-refresh-info strong{color:var(--text,#202630);font-size:13px}
@media(max-width:480px){
  .db-action-tabs{grid-template-columns:1fr 1fr}
  .db-action-choice-grid{grid-template-columns:1fr}
  .db-action-choice{min-height:68px}
}
/* /assets/history.css */
.history-content{height:calc(100vh - 72px);padding:0!important;overflow:hidden}
.history-page{position:relative;width:100%;height:100%;min-height:560px;background:#E4E7EC;overflow:hidden}
.history-map{position:absolute;inset:0;width:100%;height:100%;z-index:1}
.history-toolbar{position:absolute;z-index:650;top:12px;right:12px;left:12px;display:flex;align-items:center;gap:9px;min-height:58px;padding:9px 12px;border:1px solid #eadaca;border-radius:13px;background:#fffefa;box-shadow:0 6px 24px #20263022}
.history-toolbar select,.history-toolbar input{height:38px;border:1px solid #E4E7EC;border-radius:8px;background:#fff;padding:7px 9px;color:#202630;font-size:12px}
#history-device{width:240px;min-width:170px}
.history-range{display:flex;align-items:center;gap:5px;white-space:nowrap}
.history-range input{width:184px}
.history-range span{color:#667085}
.history-presets{display:flex;align-items:center;gap:2px;min-width:0}
.history-presets button{padding:8px 7px;background:transparent;color:#5f5b57;font-size:12px;white-space:nowrap}
.history-presets button:hover,.history-presets button.active{background:#F2F4F7;color:#d86513}
#history-load{height:38px;padding:8px 14px;white-space:nowrap}
#history-load:disabled{opacity:.55;cursor:wait}
.history-error{position:absolute;top:61px;left:255px;padding:4px 8px;border-radius:6px;background:#fff;color:#c13c32;font-size:12px;box-shadow:0 3px 10px #0001}
.history-error:empty{display:none}

.history-summary{position:absolute;z-index:620;top:83px;left:14px;width:330px;max-height:calc(100% - 178px);overflow:hidden;border:1px solid #e5e2de;border-radius:13px;background:#fff;box-shadow:0 7px 25px #20263024;transition:.2s}
.history-summary:empty{display:none}
.history-summary.collapsed{width:52px;height:52px}
.history-summary.collapsed>*{display:none}
.history-summary.collapsed:after{content:"\2630";display:grid;width:52px;height:52px;place-items:center;color:#B45C0B;font-size:20px;cursor:pointer}
.history-summary header{display:flex;align-items:center;justify-content:space-between;padding:15px 16px 11px;border-bottom:1px solid #E4E7EC}
.history-summary header h3{margin:0 0 3px;color:#202630;font-size:16px}
.history-summary header p{margin:0;color:#667085;font-size:12px}
.history-summary header button{width:29px;height:29px;padding:0;background:#F5F6F8;color:#667085;font-size:18px}
.history-summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:#E4E7EC}
.history-summary-grid>div{display:grid;gap:4px;padding:12px;background:#fff}
.history-summary-grid small{color:#667085;font-size:12px}
.history-summary-grid b{color:#202630;font-size:13px}
.history-summary-meta{display:grid;gap:5px;padding:10px 14px;background:#F2F4F7;color:#667085;font-size:12px}
.history-summary h4{margin:0;padding:12px 14px 8px;color:#4d4945;font-size:12px}
.history-stop-list{max-height:260px;overflow:auto;border-top:1px solid #E4E7EC}
.history-stop-list>p{margin:0;padding:18px;color:#667085;font-size:12px;text-align:center}
.history-stop-list button{width:100%;display:grid;grid-template-columns:27px 1fr;align-items:center;gap:9px;padding:9px 13px;border-bottom:1px solid #E4E7EC;border-radius:0;background:#fff;text-align:left}
.history-stop-list button:hover{background:#fff6ee}
.history-stop-list i{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#F2F4F7;color:#B45C0B;font-size:12px;font-style:normal;font-weight:800}
.history-stop-list span{display:grid;gap:2px}
.history-stop-list b{color:#202630;font-size:12px}
.history-stop-list small{color:#667085;font-size:12px}

.history-speed-legend{position:absolute;z-index:620;top:83px;right:14px;width:190px;padding:13px 15px;border:1px solid #E4E7EC;border-radius:12px;background:#fffe;box-shadow:0 5px 20px #2026301d;backdrop-filter:blur(5px)}
.history-speed-legend h4{margin:0 0 9px;color:#202630;font-size:12px}
.history-speed-legend span{display:flex;align-items:center;gap:9px;padding:6px 0;color:#667085;font-size:12px}
.history-speed-legend i{width:17px;height:8px;border-radius:3px}
.history-speed-legend i.green{background:#22a06b}
.history-speed-legend i.yellow{background:#d8a317}
.history-speed-legend i.red{background:#d64545}

.history-map-state{position:absolute;z-index:610;top:50%;left:50%;display:grid;gap:5px;transform:translate(-50%,-50%);min-width:250px;padding:18px 24px;border-radius:12px;background:#fffe;color:#667085;text-align:center;box-shadow:0 6px 22px #2026301b}
.history-map-state b{color:#4d4945}
.history-map-state.hidden{display:none}
.history-player{position:absolute;z-index:640;right:50%;bottom:16px;display:grid;grid-template-columns:42px minmax(260px,620px) 80px 145px 65px 58px;align-items:center;gap:10px;width:min(1010px,calc(100% - 40px));transform:translateX(50%);padding:10px 14px;border:1px solid #E4E7EC;border-radius:14px;background:#fffffff2;box-shadow:0 8px 28px #2026302d;backdrop-filter:blur(7px)}
.history-player.hidden{display:none}
.history-player>button{width:38px;height:38px;padding:0;background:#F58220;color:#fff;font-size:17px}
.history-player input[type=range]{width:100%;accent-color:#F58220}
.history-player>b{color:#B45C0B;font-size:12px;text-align:center}
.history-player>span{color:#4d4945;font-size:12px;white-space:nowrap}
.history-player>small{color:#667085;text-align:center}
.history-player>select{height:34px;padding:4px 7px;border:1px solid #E4E7EC;border-radius:8px;background:#fff;color:#202630}

.history-endpoint-wrapper,.history-stop-wrapper{background:transparent!important;border:0!important}
.history-endpoint{position:relative;display:grid;place-items:center;width:30px;height:30px;border:3px solid #fff;border-radius:50% 50% 50% 0;transform:rotate(-45deg);color:#fff;font-size:12px;font-weight:900;box-shadow:0 3px 11px #0005}
.history-endpoint.begin{background:#15966b}
.history-endpoint.end{background:#b7443e}
.history-endpoint-wrapper .history-endpoint{line-height:24px}
.history-endpoint-wrapper .history-endpoint::first-letter{transform:rotate(45deg)}
.history-stop-marker{position:relative;display:grid;place-items:center;width:28px;height:28px;border:3px solid #fff;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:#F58220;color:#fff;font-size:12px;font-weight:900;box-shadow:0 3px 11px #0004}
.history-endpoint>b,.history-stop-marker>b{position:relative;z-index:1;transform:rotate(45deg)}
.history-stop-marker:after,.history-endpoint:after{content:"";position:absolute;inset:0;transform:rotate(45deg)}
.history-stop-wrapper{color:#fff}
.history-stop-wrapper .history-stop-marker{line-height:22px}
.history-page .leaflet-control-zoom{margin-right:14px!important;margin-bottom:88px!important;border:0!important;box-shadow:0 4px 15px #2026301f!important}

@media(max-width:1450px){
  .history-toolbar{flex-wrap:wrap;padding-right:110px}
  .history-presets{order:3;flex-basis:100%}
  .history-summary,.history-speed-legend{top:126px}
  .history-summary{max-height:calc(100% - 220px)}
}
@media(max-width:1000px){
  .history-toolbar{padding-right:12px}
  #history-device{width:210px}
  .history-range input{width:165px}
  .history-speed-legend{display:none}
  .history-player{grid-template-columns:42px 1fr 70px 130px 54px}
  .history-player>select{display:none}
}
@media(max-width:760px){
  .history-content{height:calc(100vh - 72px)!important}
  .history-page{min-height:500px}
  .history-toolbar{top:6px;right:6px;left:6px;display:grid;grid-template-columns:1fr auto;gap:6px;padding:8px}
  #history-device{grid-column:1/-1;width:100%}
  .history-range{grid-column:1/-1}
  .history-range input{width:calc(50% - 12px)}
  .history-presets{grid-column:1/-1;overflow:auto}
  .history-presets button{padding:6px}
  #history-load{grid-column:1/-1}
  .history-error{position:static;grid-column:1/-1;box-shadow:none}
  .history-summary{top:190px;right:8px;left:8px;width:auto;max-height:42vh}
  .history-summary.collapsed{right:auto;width:52px}
  .history-player{right:8px;bottom:8px;left:8px;width:auto;transform:none;grid-template-columns:38px 1fr 70px;padding:8px}
  .history-player>span,.history-player>small,.history-player>select{display:none}
  .history-page .leaflet-control-zoom{margin-bottom:74px!important}
}

/* /assets/geofences.css */
.geofence-shell{display:grid;gap:16px}
.geofence-shell .panel{margin-top:0;background:var(--surface);color:var(--ink);border-color:var(--line)}
.geofence-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px}
.geofence-toolbar h3{margin:0 0 5px}
.geofence-toolbar p{margin:0;color:var(--muted);font-size:13px}
.geofence-toolbar-actions{display:flex;align-items:flex-end;gap:10px}
.geofence-client-filter{display:grid;gap:6px;min-width:230px;margin:0;color:var(--muted);font-size:12px}
.geofence-client-filter select,.geofence-toolbar-actions>.primary{height:42px;min-height:42px;margin:0}
.geofence-toolbar-actions>.primary:disabled{opacity:.5;cursor:not-allowed}
.geofence-workspace{position:relative;display:grid;grid-template-columns:minmax(300px,380px) minmax(0,1fr);gap:16px;min-height:600px}
.geofence-list,.geofence-map-card{min-width:0;padding:0;overflow:hidden}
.geofence-list{display:flex;flex-direction:column}
.geofence-list-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid var(--line)}
.geofence-list-head>span{color:var(--muted);font-size:12px}
.geofence-panel-toggle,.geofence-panel-open{display:none}
#geofence-list-body{overflow:auto;max-height:690px}
.geofence-item{border-bottom:1px solid var(--line);transition:background .16s ease}
.geofence-item:hover,.geofence-item.selected{background:var(--surface-accent)}
.geofence-item.disabled{opacity:.72}
.geofence-item-main{display:grid;width:100%;grid-template-columns:12px minmax(0,1fr) auto;gap:11px;align-items:center;padding:15px 16px;background:transparent;color:var(--ink);text-align:left;border:0;border-radius:0}
.geofence-item-main:hover{background:transparent}
.geofence-item-main>span:nth-child(2){display:grid;gap:3px;min-width:0}
.geofence-item-main strong,.geofence-item-main small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.geofence-item-main small{color:var(--muted);font-size:12px}
.geofence-color{width:10px;height:42px;border-radius:8px;background:var(--zone-color)}
.geofence-inside{display:grid;justify-items:center;min-width:46px}
.geofence-inside b{font-size:18px}
.geofence-item-meta{display:flex;gap:12px;padding:0 16px 10px 39px;color:var(--muted);font-size:12px}
.geofence-item-actions{display:flex;gap:7px;padding:0 16px 13px 39px}
.geofence-item-actions button{min-height:32px;padding:6px 10px;font-size:12px}
.geofence-map-card{padding:0}
.geofence-map{width:100%;height:100%;min-height:600px;background:var(--surface-soft)}
.geofence-empty{display:grid;gap:6px;padding:28px 18px;text-align:center;color:var(--muted)}
.geofence-empty strong{color:var(--ink)}
.geofence-events{padding:0;overflow:hidden}
.geofence-event{display:grid;width:100%;grid-template-columns:38px minmax(0,1fr) auto;gap:11px;align-items:center;padding:12px 18px;background:transparent;color:var(--ink);border:0;border-bottom:1px solid var(--line);border-radius:0;text-align:left}
.geofence-event:hover{background:var(--surface-accent)}
.geofence-event-icon{display:grid;width:34px;height:34px;place-items:center;color:var(--orange-dark);background:var(--orange-soft);border-radius:10px}
.geofence-event-icon .ui-icon{width:20px;height:20px}
.geofence-event>span:nth-child(2){display:grid;gap:2px}
.geofence-event small,.geofence-event time{color:var(--muted);font-size:12px}
.geofence-events-empty{padding:22px;color:var(--muted);text-align:center}
dialog.geofence-dialog{width:min(1050px,96vw);max-height:94vh;overflow:auto}
.geofence-editor h3{margin:0 0 18px}
.geofence-form-grid{display:grid;grid-template-columns:minmax(0,1fr) 180px;gap:14px}
.geofence-form-grid label,.geofence-form-section>label,#geofence-email-row{display:grid;gap:6px}
.geofence-form-grid .full{grid-column:1/-1}
.geofence-drawing{margin-top:16px;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.geofence-address-search{display:grid;gap:8px;padding:12px;background:var(--surface);border-bottom:1px solid var(--line)}
.geofence-address-search>label{font-size:12px;font-weight:600;color:var(--ink)}
.geofence-address-search>div:first-of-type{display:flex;gap:8px}
.geofence-address-search input{flex:1;min-width:0;margin:0}
.geofence-address-search button{min-width:92px;margin:0}
.geofence-address-results{display:grid;gap:6px}
.geofence-address-result{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;padding:9px 11px;background:var(--surface-muted);color:var(--ink);border:1px solid var(--line);border-radius:9px;text-align:left}
.geofence-address-result:hover,.geofence-address-result.selected{border-color:var(--orange);background:var(--surface-accent)}
.geofence-address-result span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.geofence-address-result small,.geofence-search-message,.geofence-search-source{color:var(--muted);font-size:12px}
.geofence-address-result small{flex:0 0 auto;color:var(--orange-dark);font-weight:600}
.geofence-search-source{padding:2px 3px}
.geofence-drawing-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:var(--surface-muted);border-bottom:1px solid var(--line);font-size:12px;color:var(--muted)}
.geofence-drawing-head>div{display:flex;gap:7px}
.geofence-drawing-head button{padding:6px 10px;min-height:30px;font-size:12px}
.geofence-editor-map{height:360px;background:var(--surface-soft)}
.geofence-form-section{display:grid;gap:12px;margin-top:16px;padding:15px;border:1px solid var(--line);border-radius:12px;background:var(--surface-muted)}
.geofence-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px}
.geofence-vehicle-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:190px;overflow:auto}
.geofence-vehicle-choice{display:flex;align-items:center;gap:9px;padding:9px 10px;background:var(--surface);border:1px solid var(--line);border-radius:9px}
.geofence-vehicle-choice>span{display:grid;gap:2px;min-width:0}
.geofence-vehicle-choice strong,.geofence-vehicle-choice small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.geofence-vehicle-choice small{color:var(--muted);font-size:12px}
.geofence-check-grid{display:flex;gap:20px;flex-wrap:wrap}
.geofence-schedule{display:grid;gap:7px}
.geofence-schedule-row{display:grid;grid-template-columns:minmax(145px,1fr) minmax(110px,.7fr) 100px 12px 100px;gap:8px;align-items:center;padding:8px 10px;background:var(--surface);border:1px solid var(--line);border-radius:9px}
.geofence-schedule-row input[type="time"]{min-width:0}
#geofence-email-row small{color:var(--muted)}
:root[data-theme="dark"] .geofence-shell .panel,
:root[data-theme="dark"] .geofence-vehicle-choice,
:root[data-theme="dark"] .geofence-schedule-row{background:var(--surface);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .geofence-form-section,
:root[data-theme="dark"] .geofence-drawing-head{background:var(--surface-muted)}
:root[data-theme="dark"] .geofence-item:hover,
:root[data-theme="dark"] .geofence-item.selected,
:root[data-theme="dark"] .geofence-event:hover{background:var(--surface-accent)}
@media(max-width:1024px){
  .geofence-workspace{grid-template-columns:330px minmax(0,1fr)}
}
@media(max-width:760px){
  .geofence-toolbar{align-items:flex-start;flex-direction:column}
  .geofence-toolbar-actions{width:100%;align-items:stretch;flex-direction:column}
  .geofence-client-filter{min-width:0;width:100%}
  .geofence-toolbar-actions>.primary{width:100%}
  .geofence-workspace{display:flex;min-height:0;overflow:visible;flex-direction:column;gap:12px}
  .geofence-map-card{order:1;height:clamp(320px,52dvh,480px);min-height:320px}
  .geofence-map{height:100%;min-height:320px}
  .geofence-list{position:static;z-index:auto;order:2;width:100%;max-width:none;background:var(--surface);border:1px solid var(--line);border-radius:13px;box-shadow:var(--shadow);transform:none!important;transition:none}
  .geofence-list-head{padding:13px 12px}
  .geofence-list-head>span{margin-left:auto}
  .geofence-panel-toggle,.geofence-panel-open{display:none!important}

  .geofence-workspace.panel-collapsed .geofence-list{transform:none}

  #geofence-list-body{max-height:none;overflow:visible}
  .geofence-item-actions{flex-wrap:wrap}
  .geofence-form-grid{grid-template-columns:1fr}
  .geofence-form-grid .full{grid-column:auto}
  .geofence-editor-map{height:42vh;min-height:310px}
  .geofence-vehicle-grid{grid-template-columns:1fr}
  .geofence-schedule-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .geofence-schedule-row input[type="time"]{width:100%}
  .geofence-schedule-row>span{display:none}
  .geofence-address-search>div:first-of-type{align-items:stretch;flex-direction:column}
  .geofence-address-search button{width:100%}
  .geofence-address-result{align-items:flex-start;flex-direction:column;gap:4px}
  .geofence-address-result span{white-space:normal}
  .geofence-drawing-head{align-items:flex-start;flex-direction:column}
  .geofence-event{grid-template-columns:36px minmax(0,1fr)}
  .geofence-event time{grid-column:2}
  dialog.geofence-dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border-radius:0}
}

/* /assets/drivers.css */
.drivers-head-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.drivers-title-block p,
.driver-modal-heading p {
  margin: 7px 0 0;
  color: var(--muted, #77736e);
}

.drivers-head-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.drivers-head-actions label {
  min-width: 240px;
  margin: 0;
}

.drivers-inactive-toggle {
  min-width: 0 !important;
  min-height: 44px;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.drivers-inactive-toggle input {
  width: 18px;
  height: 18px;
}

.drivers-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.drivers-summary article,
.driver-profile-grid article,
.driver-report-summary article,
.driver-style-metrics article,
.driver-assignment-card > div,
.driver-note,
.driver-score-info {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e1dc);
  border-radius: 14px;
  padding: 16px;
}

.drivers-summary span,
.driver-profile-grid span,
.driver-report-summary span,
.driver-style-metrics span,
.driver-assignment-card > div > span,
.driver-note > span {
  display: block;
  color: var(--muted, #77736e);
  font-size: .82rem;
  margin-bottom: 6px;
}

.drivers-summary strong {
  font-size: 1.65rem;
}

.drivers-list-panel .panel-head {
  align-items: center;
}

.drivers-table td:first-child small,
.drivers-table td:nth-child(2) small,
#driver-tab-content table td small {
  display: block;
  color: var(--muted, #77736e);
  margin-top: 4px;
}

.driver-name-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text, #202630);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.driver-name-link:hover {
  color: #c66c10;
}

.driver-inactive-row {
  opacity: .72;
}

#modal.drivers-dialog {
  width: min(960px, calc(100vw - 32px));
  max-width: 960px;
  max-height: calc(100vh - 32px);
  padding: 0;
}

#modal.drivers-detail-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
}

#modal.drivers-dialog #modal-body {
  padding: 28px;
}

.driver-modal-heading {
  padding-right: 34px;
  margin-bottom: 22px;
}

.driver-modal-heading h2,
.driver-detail-head h2 {
  margin: 0;
}

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

.driver-form label,
.driver-assignment-card label,
.driver-report-filters label {
  display: grid;
  gap: 6px;
}

.driver-schedule {
  border: 1px solid var(--border, #e5e1dc);
  border-radius: 14px;
  padding: 16px;
  margin: 18px 0;
}

.driver-schedule-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.driver-schedule-head small {
  color: var(--muted, #77736e);
}

.driver-schedule-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 120px 24px 120px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border, #eeeae6);
}

.driver-schedule-row label {
  display: flex;
  grid-auto-flow: column;
  justify-content: flex-start;
  align-items: center;
}

.driver-schedule-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.driver-detail-head {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 14px;
  padding-right: 36px;
}

.driver-detail-head p {
  margin: 4px 0 0;
  color: var(--muted, #77736e);
}

.driver-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #bd640b;
  background: #F2F4F7;
  font-weight: 800;
  font-size: 1.15rem;
}

.driver-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border, #e5e1dc);
  margin: 22px -28px 0;
  padding: 0 28px;
}

.driver-tabs button {
  flex: 0 0 auto;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted, #6e6a66);
  padding: 14px 12px 12px;
  font-weight: 650;
}

.driver-tabs button.active {
  color: #bd640b;
  border-bottom-color: #F58220;
}

#driver-tab-content {
  padding-top: 20px;
  min-height: 240px;
}

.driver-profile-grid,
.driver-report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.driver-profile-grid strong,
.driver-report-summary strong,
.driver-style-metrics strong {
  font-size: 1.08rem;
}

.driver-note {
  margin-top: 12px;
}

.driver-note p {
  margin: 0;
  white-space: pre-wrap;
}

.driver-assignment-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
}

.driver-assignment-card > div strong,
.driver-assignment-card > div small {
  display: block;
}

.driver-assignment-card > div strong {
  font-size: 1.15rem;
}

.driver-assignment-card > div small {
  color: var(--muted, #77736e);
  margin-top: 6px;
}

.driver-assignment-card form {
  border: 1px solid var(--border, #e5e1dc);
  border-radius: 14px;
  padding: 16px;
}

.driver-assignment-actions,
.driver-report-filters {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.driver-report-filters {
  justify-content: flex-start;
  margin: 0 0 16px;
}

.driver-report-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.driver-score-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
}

.driver-score {
  color: #fff;
  border-radius: 16px;
  padding: 20px;
  background: #4a4845;
}

.driver-score.good {
  background: #267a5d;
}

.driver-score.warning {
  background: #9a6817;
}

.driver-score.bad {
  background: #9a413c;
}

.driver-score span,
.driver-score p {
  display: block;
  color: rgba(255,255,255,.85);
}

.driver-score strong {
  display: block;
  font-size: 3rem;
  margin: 14px 0 8px;
}

.driver-score strong small {
  font-size: 1rem;
}

.driver-style-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.driver-score-info {
  margin: 14px 0;
  background: var(--surface-soft, #F5F6F8);
}

.driver-score-info p {
  margin: 8px 0;
}

.driver-score-info small {
  color: var(--muted, #77736e);
}

html[data-theme="dark"] .driver-avatar {
  background: #493425;
  color: #ffad5c;
}

html[data-theme="dark"] .driver-score-info {
  background: #302e2b;
}

@media (max-width: 900px) {
  .drivers-head-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .drivers-head-actions label {
    min-width: min(100%, 280px);
  }

  .drivers-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .driver-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .driver-score-row,
  .driver-assignment-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .drivers-summary {
    gap: 8px;
  }

  .drivers-summary article {
    padding: 13px;
  }

  .drivers-summary strong {
    font-size: 1.35rem;
  }

  #modal.drivers-dialog,
  #modal.drivers-detail-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  #modal.drivers-dialog #modal-body {
    padding: 20px 16px;
  }

  .driver-form-grid,
  .driver-profile-grid,
  .driver-report-summary,
  .driver-style-metrics {
    grid-template-columns: 1fr;
  }

  .driver-schedule-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .driver-schedule-row {
    grid-template-columns: 1fr 1fr;
  }

  .driver-schedule-row > span {
    display: none;
  }

  .driver-schedule-row label {
    grid-column: 1 / -1;
  }

  .driver-tabs {
    margin-left: -16px;
    margin-right: -16px;
    padding: 0 16px;
  }

  .driver-report-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .driver-report-filters label,
  .driver-report-filters button {
    width: 100%;
  }
}

.driver-list-head,
.drivers-list-title,
.driver-list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.driver-list-head {
  justify-content: space-between;
  flex-wrap: wrap;
}

.drivers-list-title h3 {
  margin: 0;
}

.driver-list-toolbar {
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.driver-list-toolbar .table-action-select {
  width: auto;
  min-width: 170px;
}

.driver-preview-cell {
  width: 72px;
  text-align: center;
}

.driver-preview-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border, #e5e1dc);
  border-radius: 10px;
  background: var(--surface-soft, #F5F6F8);
  color: var(--text, #202630);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.driver-preview-button:hover,
.driver-preview-button:focus-visible {
  border-color: #F58220;
  background: #F2F4F7;
  color: #c66c10;
  outline: none;
}

.driver-preview-button .ui-icon {
  width: 20px;
  height: 20px;
}

#modal.drivers-preview-dialog {
  width: min(780px, calc(100vw - 32px));
  max-width: 780px;
}

#modal.drivers-dialog .modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e5e1dc);
}

.driver-preview-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.driver-preview-identity h2,
.driver-preview-style h3 {
  margin: 0;
}

.driver-preview-identity p {
  margin: 5px 0 0;
  color: var(--muted, #77736e);
}

.driver-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.driver-preview-grid article,
.driver-preview-metrics article {
  background: var(--surface-soft, #F5F6F8);
  border: 1px solid var(--border, #e5e1dc);
  border-radius: 12px;
  padding: 13px 14px;
}

.driver-preview-grid span,
.driver-preview-metrics span {
  display: block;
  color: var(--muted, #77736e);
  font-size: .8rem;
  margin-bottom: 5px;
}

.driver-preview-style {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e5e1dc);
}

.driver-preview-style-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.driver-preview-style-head small {
  color: var(--muted, #77736e);
}

.driver-preview-score {
  font-size: 1.7rem;
  color: var(--text, #202630);
}

.driver-preview-score.good { color: #267a5d; }
.driver-preview-score.warning { color: #9a6817; }
.driver-preview-score.bad { color: #9a413c; }
.driver-preview-score small { font-size: .78rem; }

.driver-preview-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.driver-preview-metrics strong {
  font-size: 1.15rem;
}

html[data-theme="dark"] .driver-preview-button:hover,
html[data-theme="dark"] .driver-preview-button:focus-visible {
  background: #493425;
  color: #ffad5c;
}

@media (max-width: 700px) {
  .driver-list-toolbar {
    width: 100%;
    justify-content: stretch;
  }

  .driver-list-toolbar .table-selection-count {
    width: 100%;
  }

  .driver-list-toolbar .table-action-select,
  .driver-list-toolbar button {
    flex: 1 1 150px;
  }

  #modal.drivers-preview-dialog {
    width: 100vw;
    max-width: 100vw;
  }

  .driver-preview-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .driver-preview-head > .badge {
    grid-column: 2;
    justify-self: start;
  }

  .driver-preview-grid {
    grid-template-columns: 1fr;
  }

  .driver-preview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* mobile-driver-cards-v1 */
@media (max-width: 700px) {
  .drivers-head-actions,
  .drivers-head-actions label,
  .drivers-head-actions button {
    width: 100%;
  }

  .drivers-inactive-toggle {
    min-height: 38px;
  }

  .driver-list-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .driver-list-toolbar .table-selection-count {
    grid-column: 1 / -1;
  }

  .driver-list-toolbar .table-action-select {
    width: 100%;
    min-width: 0;
  }

  #drivers-list .table-wrap {
    overflow: visible;
  }

  #drivers-list .drivers-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  #drivers-list .drivers-table thead {
    display: none;
  }

  #drivers-list .drivers-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  #drivers-list .drivers-table tr {
    position: relative;
    display: grid;
    padding: 10px 12px;
    border: 1px solid var(--border, #e5e1dc);
    border-radius: 12px;
    background: var(--surface, #fff);
  }

  #drivers-list .drivers-table td {
    display: grid;
    grid-template-columns: minmax(92px, .7fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: auto;
    min-width: 0;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid var(--border, #e5e1dc);
    text-align: left;
    overflow-wrap: anywhere;
  }

  #drivers-list .drivers-table td::before {
    content: attr(data-label);
    color: var(--muted, #77736e);
    font-size: .78rem;
    font-weight: 600;
  }

  #drivers-list .drivers-table .driver-main-cell {
    padding-right: 38px;
  }

  #drivers-list .drivers-table .driver-select-cell {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    display: block;
    padding: 0;
    border: 0;
  }

  #drivers-list .drivers-table .driver-preview-cell {
    display: flex;
    justify-content: space-between;
    width: auto;
    padding-bottom: 0;
    border-bottom: 0;
  }

  #drivers-list .drivers-table .driver-preview-cell::before {
    content: attr(data-label);
    align-self: center;
  }
}

@media (max-width: 420px) {
  #drivers-list .drivers-table td {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
/* /assets/reports.css */
/* ================= RAPORTY =================
   Kolory wylacznie z tokenow motywu (theme/gps/tokens.css) — tryb ciemny dziala bez
   osobnych regul. Wspolne komponenty (zakladki .gl-tabs, kafle .gl-choice, przyciski,
   pola, tabela) pochodza z motywu; tu tylko uklad ekranu raportow. */

.reports-page{display:grid;gap:var(--sp-4)}
.reports-filter-card,.reports-result{margin:0}

/* ---------- pasek zakladek = naglowek karty ----------
   .reports-filter-card>.reports-tabs ma wyzsza specyficznosc niz .gl-tabs z motywu
   (motyw zeruje margines zakladek i laduje sie pozniej). */
.reports-filter-card>.reports-tabs{max-width:none;margin:calc(var(--sp-5) * -1) calc(var(--sp-5) * -1) 0;padding:0 var(--sp-3);border-radius:var(--radius-card) var(--radius-card) 0 0}
.reports-filter-card>.reports-tabs button{padding:15px 14px 13px;font-size:var(--fs-help)}
.reports-tabs .reports-tabs-all{display:inline-flex;align-items:center;gap:6px;color:var(--muted)}
/* .gl-tabs traktuje <span> w zakladce jako licznik (np. "Aktywne 23") — tu to ikona i napis */
.reports-tabs .reports-tabs-all span{min-width:0;margin:0;padding:0;border-radius:0;background:none;color:inherit;font:inherit}
.reports-tabs .reports-tabs-all .ui-icon{width:16px;height:16px}
.reports-tabs .reports-tabs-all .ui-icon svg{width:15px;height:15px}
.reports-tabs-sep{flex:0 0 1px;align-self:center;height:16px;margin:0 4px;background:var(--line)}

/* ---------- wybrany raport ----------
   .reports-filter-card .reports-chosen ... — wyzsza specyficznosc niz ".panel h3" z motywu
   (motyw laduje sie pozniej i dodawal margines, przez co tytul odjezdzal od opisu). */
.reports-filter-card .reports-chosen{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:14px;align-items:center;margin:var(--sp-5) 0}
.reports-filter-card .reports-chosen-icon .ui-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:var(--radius-control);background:var(--orange-soft);color:var(--orange)}
.reports-filter-card .reports-chosen-icon .ui-icon svg{width:22px;height:22px}
.reports-filter-card .reports-chosen h3{margin:0;padding:0;color:var(--ink);font-size:var(--fs-section);font-weight:650;line-height:1.3}
.reports-filter-card .reports-chosen p{margin:3px 0 0;max-width:780px;color:var(--muted);font-size:var(--fs-help);line-height:1.4}

/* ---------- filtry ---------- */
.reports-filter-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:var(--sp-3) var(--sp-4);align-items:end}
.reports-filter-grid label{margin:0}
.reports-hours{display:grid;grid-template-columns:1fr 1fr;gap:var(--sp-3)}
.reports-presets{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-2);margin-top:var(--sp-4);padding-top:var(--sp-4);border-top:1px solid var(--line)}
.reports-presets button{min-height:34px;padding:7px 12px;border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--surface);color:var(--text);font-size:var(--fs-small);font-weight:500}
.reports-presets button:hover{border-color:var(--line-strong);background:var(--surface-muted)}
.reports-presets button.active{border-color:var(--orange);background:var(--orange-soft);color:var(--orange-dark);font-weight:600}
.reports-presets button.reports-generate{min-height:var(--control-h);margin-left:auto;padding:0 22px;border-color:var(--orange);border-radius:var(--radius-control);background:var(--orange);color:#fff;font-size:var(--fs-body);font-weight:600}
.reports-presets button.reports-generate:hover{border-color:var(--orange-dark);background:var(--orange-dark)}
.reports-presets button.reports-generate:disabled{opacity:.7}

/* ---------- wynik ---------- */
.reports-result-head{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--sp-4);margin-bottom:var(--sp-4)}
.reports-result-head h3{margin:0 0 4px;font-size:var(--fs-section)}
.reports-result-head p{margin:0;color:var(--muted);font-size:var(--fs-help)}
.reports-export{display:flex;flex-wrap:wrap;gap:var(--sp-2)}
.reports-export button{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 14px}
.reports-export button svg{width:16px;height:16px}
.reports-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:1px;margin-bottom:var(--sp-4);overflow:hidden;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--line)}
.reports-meta>div{display:grid;gap:3px;padding:10px 14px;background:var(--surface-muted)}
.reports-meta small{color:var(--muted);font-size:var(--fs-small)}
.reports-meta b{color:var(--ink);font-size:var(--fs-body)}
.reports-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:var(--sp-3);margin:0 0 var(--sp-4)}
.reports-summary>div{display:grid;align-content:start;gap:6px;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-control);background:var(--surface)}
.reports-summary small{color:var(--muted);font-size:var(--fs-small);letter-spacing:.02em;text-transform:uppercase}
.reports-summary b{color:var(--ink);font-size:17px;font-weight:650;line-height:1.25;overflow-wrap:anywhere}
.reports-warning{margin:0 0 var(--sp-3);padding:10px 12px;border-radius:var(--radius-control);background:var(--amber-soft);color:var(--amber);font-size:var(--fs-help)}

/* ---------- narzedzia tabeli ---------- */
.reports-table-tools{display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);margin-bottom:var(--sp-2)}
.reports-table-tools>span{color:var(--muted);font-size:var(--fs-help)}
.reports-search{position:relative;display:block;width:min(320px,100%);margin:0}
.reports-search svg{position:absolute;top:50%;left:11px;width:16px;height:16px;color:var(--muted);transform:translateY(-50%);pointer-events:none}
.reports-search input{width:100%;min-height:36px;padding-left:34px}

/* ---------- tabela (bez wlasnego paska przewijania w pionie — przewija sie strona) ---------- */
.reports-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius-card)}
.reports-table{width:100%;min-width:760px;border-collapse:collapse}
.reports-table thead th{position:sticky;top:0;z-index:1;background:var(--surface-muted);white-space:normal;line-height:1.3;vertical-align:bottom}
.reports-table th.sortable button{display:inline;text-align:inherit;min-height:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-transform:inherit;letter-spacing:inherit;cursor:pointer}
.reports-table th.sortable button:hover{color:var(--orange-dark)}
.reports-table th[aria-sort="ascending"] button,.reports-table th[aria-sort="descending"] button{color:var(--orange-dark)}
.reports-table th,.reports-table td{padding:10px 12px}
.reports-table td{font-size:var(--fs-help);vertical-align:top}
.reports-table td:first-child{min-width:130px;color:var(--ink);font-weight:600}
.reports-table td.wide{min-width:220px}
.reports-table .numeric{text-align:right;font-variant-numeric:tabular-nums}
.reports-table td.numeric{white-space:nowrap}
.reports-table th.numeric{text-align:right}
.reports-table tfoot td{border-top:2px solid var(--line-strong);background:var(--surface-muted);color:var(--ink);font-weight:650}
.reports-no-match{padding:28px;text-align:center;color:var(--muted)}
.reports-map-button{min-height:30px;padding:0 10px;border:1px solid var(--line);background:var(--surface);color:var(--orange-dark);font-size:var(--fs-small);white-space:nowrap}
.reports-purpose-cell{min-width:220px}
.reports-purpose{width:100%;min-height:34px}
.reports-purpose.saved{border-color:var(--green)}
.reports-purpose.failed{border-color:var(--red)}

/* ---------- stany: pusty, ladowanie ---------- */
.reports-empty{display:grid;justify-items:center;gap:6px;padding:52px 20px;text-align:center;color:var(--muted)}
.reports-empty>.ui-icon{display:grid;place-items:center;width:48px;height:48px;margin-bottom:6px;border-radius:50%;background:var(--surface-muted);color:var(--muted)}
.reports-empty b{color:var(--ink);font-size:var(--fs-body)}
.reports-empty span{max-width:480px;font-size:var(--fs-help)}
.reports-spinner{width:30px;height:30px;margin-bottom:8px;border:3px solid var(--line);border-top-color:var(--orange);border-radius:50%;animation:reports-spin .8s linear infinite}
@keyframes reports-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.reports-spinner{animation:none}}
.report-map{height:min(62vh,520px);min-height:320px;border-radius:var(--radius-card)}

/* ---------- telefon ---------- */
@media(max-width:760px){
  .reports-filter-card>.reports-tabs{margin:calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) 0}
  .reports-filter-card .reports-chosen{margin:var(--sp-4) 0}
  .reports-filter-grid{grid-template-columns:1fr}
  .reports-presets button.reports-generate{width:100%;margin-left:0}
  .reports-result-head{flex-direction:column}
  .reports-export{width:100%}
  .reports-export button{flex:1;justify-content:center}
  .reports-table-tools{flex-direction:column;align-items:stretch}
  .reports-search{width:100%}
  .reports-summary{grid-template-columns:1fr 1fr}
  .reports-summary b{font-size:16px}
}

/* /assets/settings.css */
.settings-page{display:grid;gap:18px;max-width:none;min-width:0;margin:0;color:var(--text,#202630)}
.settings-tabs::-webkit-scrollbar{display:none}
.settings-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:22px;margin-bottom:18px;box-shadow:0 5px 20px #20263008}
.settings-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:15px}
.settings-card-head h3{margin:0 0 5px;color:#202630}
.settings-card-head p{margin:0;color:var(--muted)}
.settings-map-layout{display:grid;grid-template-columns:minmax(280px,430px) 1fr;gap:24px;align-items:stretch}
.settings-fields label,.settings-grid label,.settings-test label{margin:8px 0}
.settings-map-preview{min-height:270px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#E4E7EC}
.settings-preview-error{height:100%;display:grid;place-items:center;color:var(--red);padding:20px}
.settings-note{margin-top:14px;padding:12px;border-radius:9px;background:#F2F4F7;color:#76543b;font-size:13px}
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 22px}
.settings-switch{display:flex;align-items:center;gap:9px;margin:0;font-weight:700;white-space:nowrap}
.settings-switch input{display:none}
.settings-switch span{position:relative;width:46px;height:25px;border-radius:99px;background:#667085;transition:.2s}
.settings-switch span:after{content:"";position:absolute;width:19px;height:19px;left:3px;top:3px;border-radius:50%;background:#fff;box-shadow:0 2px 5px #0003;transition:.2s}
.settings-switch input:checked+span{background:var(--orange)}
.settings-switch input:checked+span:after{transform:translateX(21px)}
.settings-clear-password{display:flex!important;align-items:center;gap:9px;align-self:end;padding-bottom:11px}
.settings-clear-password input{width:17px;height:17px;accent-color:var(--orange)}
.settings-test{display:flex;align-items:flex-end;gap:12px;margin-top:12px;padding-top:16px;border-top:1px solid var(--line)}
.settings-test label{flex:1;max-width:420px}
.settings-footer{position:sticky;bottom:12px;z-index:5;display:flex;align-items:center;justify-content:flex-end;gap:14px;padding:13px 16px;border:1px solid #E4E7EC;border-radius:12px;background:#F2F4F7;box-shadow:0 8px 25px #3f2a1830}
.settings-footer span{margin-right:auto}
.settings-footer .success{color:var(--green);font-weight:700}
.settings-footer .error{color:var(--red)}
.settings-card td code{display:block;max-width:520px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:900px){
  .settings-map-layout,.settings-grid{grid-template-columns:1fr}
  .settings-map-preview{min-height:240px}
}
@media(max-width:650px){
  .settings-tabs{padding:0 5px}
  .settings-tabs button{padding:13px 12px}
  .settings-card{padding:15px}
  .settings-card-head,.settings-test{align-items:stretch;flex-direction:column}
  .settings-test label{max-width:none;width:100%}
  .settings-footer{bottom:6px}
}
.settings-cms-tabs::-webkit-scrollbar{display:none}
.settings-cms-tabs button:hover,.settings-cms-tabs button.active{border-bottom-color:var(--orange);background:var(--surface-accent);color:var(--orange-dark)}
.help-cms-card{border-radius:0 0 14px 14px}
.help-cms-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) 220px 180px auto;gap:10px;margin:16px 0}
.help-cms-bulk{display:flex;align-items:center;gap:10px;margin:0 0 12px}
.help-cms-bulk select{width:220px}
.help-cms-bulk span{color:var(--muted);font-size:13px}
.help-cms-table td:first-child,.help-cms-table th:first-child{width:40px;text-align:center}
.help-cms-table td:last-child,.help-cms-table th:last-child{width:52px;text-align:center}
.help-cms-title{display:block;border:0;background:transparent;color:var(--ink);padding:0;font-weight:700;text-align:left}
.help-cms-title:hover{color:var(--orange-dark)}
.help-cms-table td small{display:block;margin-top:3px;color:var(--muted);max-width:540px}
.help-cms-status{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:700}
.help-cms-status.status-published{background:var(--success-soft);color:var(--success)}
.help-cms-status.status-draft{background:var(--warning-soft);color:var(--warning)}
.help-cms-status.status-hidden{background:var(--surface-soft);color:var(--muted)}
#modal.help-cms-dialog{width:min(960px,calc(100vw - 32px));max-width:960px;max-height:calc(100dvh - 32px)}
#modal.help-cms-dialog #modal-body{min-width:0}
.help-cms-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.help-cms-form-grid .full{grid-column:1/-1}
.help-cms-form textarea{resize:vertical}
.help-cms-media{padding-top:14px;border-top:1px solid var(--line)}
.help-cms-media h4{margin:0 0 12px}
.help-cms-images{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-bottom:14px}
.help-cms-images figure{margin:0;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft)}
.help-cms-images img{display:block;width:100%;height:110px;object-fit:contain;border-radius:7px}
.help-cms-images figcaption{display:flex;justify-content:space-between;gap:6px;align-items:center;margin-top:7px;color:var(--muted);font-size:12px}
.help-cms-images figcaption button{border:0;background:transparent;color:var(--danger);padding:3px}
.help-cms-version-list{display:grid;gap:8px;margin:18px 0}
.help-cms-version-list article{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft)}
.help-cms-version-list small{display:block;color:var(--muted);margin-top:3px}
@media(max-width:920px){.help-cms-toolbar{grid-template-columns:1fr 1fr}.help-cms-toolbar input{grid-column:1/-1}}
@media(max-width:680px){
  .settings-cms-tabs{padding:0 5px}.settings-cms-tabs button{padding:12px 11px}
  .help-cms-card{padding:13px}.help-cms-toolbar{grid-template-columns:1fr}
  .help-cms-toolbar input{grid-column:auto}.help-cms-bulk{align-items:stretch;flex-wrap:wrap}.help-cms-bulk select{width:100%}
  .help-cms-form-grid{grid-template-columns:1fr}.help-cms-form-grid .full{grid-column:auto}
  .help-cms-table th:nth-child(5),.help-cms-table td:nth-child(5),.help-cms-table th:nth-child(6),.help-cms-table td:nth-child(6){display:none}
  #modal.help-cms-dialog{width:calc(100vw - 18px);max-height:calc(100dvh - 18px)}
}


/* Help CMS WYSIWYG editor */
.help-cms-editor-label{display:block;margin-bottom:7px;color:var(--ink);font-weight:600}
.help-cms-editor-shell{overflow:hidden;border:1px solid var(--line);border-radius:11px;background:var(--surface)}
.help-cms-editor-shell:focus-within{border-color:var(--orange);box-shadow:0 0 0 3px rgba(245,130,32,.12)}
.help-cms-editor-toolbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px;background:var(--surface-soft);border-bottom:1px solid var(--line)}
.help-cms-editor-group{display:flex;align-items:center;gap:3px;padding-right:6px;border-right:1px solid var(--line)}
.help-cms-editor-group:last-child{padding-right:0;border-right:0}
.help-cms-editor-history{margin-left:auto}
.help-cms-editor-button{display:grid;place-items:center;width:34px;height:32px;min-width:34px;padding:0;background:transparent;color:var(--ink);border:1px solid transparent;border-radius:7px;font:600 13px/1 Inter,Arial,sans-serif}
.help-cms-editor-button.wide{min-width:39px}.help-cms-editor-button.text{width:auto;padding:0 9px}.help-cms-editor-button.strong{font-weight:800}.help-cms-editor-button.italic{font-style:italic}.help-cms-editor-button.underline{text-decoration:underline}
.help-cms-editor-button:hover,.help-cms-editor-button:focus-visible{background:var(--surface-accent);color:var(--orange-dark);border-color:#efc49e;outline:0}
.help-cms-editor{min-height:330px;max-height:52vh;overflow:auto;padding:18px;background:var(--surface);color:var(--ink);font:400 15px/1.65 Inter,Arial,sans-serif;outline:0}
.help-cms-editor:empty:before{content:attr(data-placeholder);color:var(--muted);pointer-events:none}
.help-cms-editor h2{margin:20px 0 8px;font-size:22px;line-height:1.3}.help-cms-editor h3{margin:18px 0 7px;font-size:18px;line-height:1.35}.help-cms-editor h4{margin:16px 0 6px;font-size:16px}
.help-cms-editor p,.help-cms-editor div{margin:8px 0}.help-cms-editor ul,.help-cms-editor ol{margin:10px 0;padding-left:26px}.help-cms-editor li{margin:5px 0}
.help-cms-editor a{color:var(--orange-dark);text-decoration:underline}.help-cms-editor hr{margin:20px 0;border:0;border-top:1px solid var(--line)}.help-cms-editor blockquote{margin:14px 0;padding:10px 14px;background:var(--surface-accent);border-left:3px solid var(--orange);border-radius:0 8px 8px 0;color:var(--muted)}
.help-cms-editor-value{display:none}
.help-cms-editor-footer{display:flex;justify-content:space-between;gap:12px;padding:7px 11px;background:var(--surface-soft);color:var(--muted);border-top:1px solid var(--line);font-size:12px}
.help-cms-editor-footer .limit{color:var(--danger);font-weight:700}
:root[data-theme="dark"] .help-cms-editor-shell,:root[data-theme="dark"] .help-cms-editor,:root[data-theme="dark"] .help-cms-editor-toolbar,:root[data-theme="dark"] .help-cms-editor-footer{border-color:var(--line)}
@media(max-width:760px){.help-cms-editor-toolbar{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.help-cms-editor-toolbar::-webkit-scrollbar{display:none}.help-cms-editor-group{flex:0 0 auto}.help-cms-editor-history{margin-left:0}.help-cms-editor{min-height:260px;max-height:46vh;padding:14px}.help-cms-editor-footer span:first-child{display:none}.help-cms-editor-footer{justify-content:flex-end}}

/* Powiadomienia systemowe: wiersz = rodzaj powiadomienia + kanaly */
.settings-alert-matrix{display:grid;gap:var(--sp-2)}
.settings-alert-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto auto;gap:var(--sp-3);align-items:center;padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius-control);background:var(--surface-muted)}
.settings-alert-row b{display:block;color:var(--ink)}
.settings-alert-row small{display:block;margin-top:2px;color:var(--muted);font-size:var(--fs-help)}
.settings-alert-row .inline-check{margin:0;white-space:nowrap}
.settings-alert-hour{display:flex;align-items:center;gap:8px;margin:0;white-space:nowrap}
.settings-alert-hour select{min-width:100px}
.settings-alert-always{color:var(--muted);font-size:var(--fs-help);white-space:nowrap}
@media(max-width:900px){.settings-alert-row{grid-template-columns:1fr 1fr;align-items:start}.settings-alert-row>div{grid-column:1/-1}}

/* /assets/audit.css */
.audit-summary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.audit-summary-grid article{min-width:0;padding:16px 18px;border:1px solid var(--line);border-radius:13px;background:var(--surface);box-shadow:0 4px 16px rgba(43,42,40,.04)}
.audit-summary-grid span{display:block;color:var(--muted);font-size:12px;font-weight:600}.audit-summary-grid b{display:block;margin-top:6px;color:var(--ink);font-size:25px;line-height:1}
.audit-main-card{margin:0}.audit-card-head{align-items:center}.audit-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.audit-integrity{display:flex;flex-direction:column;justify-content:center;min-height:38px;padding:5px 11px;border-radius:9px;font-size:12px;font-weight:700}.audit-integrity small{font-size:12px;font-weight:500}
.audit-integrity.valid{background:var(--success-soft);color:var(--success)}.audit-integrity.invalid{background:var(--danger-soft);color:var(--danger)}
.audit-filters{display:grid;grid-template-columns:minmax(260px,1.7fr) repeat(3,minmax(145px,.8fr)) repeat(2,minmax(135px,.65fr)) auto;gap:10px;align-items:end;margin:18px 0;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}
.audit-filters label{margin:0;color:var(--muted);font-size:12px;font-weight:600}.audit-filters input,.audit-filters select{margin-top:6px;background:var(--surface)}
.audit-table-wrap{border:1px solid var(--line);border-radius:11px}.audit-table{min-width:1050px}.audit-table th:last-child,.audit-table td:last-child{width:52px;text-align:center}
.audit-table td{vertical-align:middle}.audit-table small{display:block;margin-top:3px;color:var(--muted);font-size:12px}.audit-row{cursor:pointer}.audit-row:hover td{background:var(--surface-accent)}.audit-row:focus-visible{outline:2px solid var(--orange);outline-offset:-2px}
.audit-category{font-weight:600;white-space:nowrap}.audit-badge{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}
.audit-severity-info,.audit-outcome-unknown{background:var(--surface-soft);color:var(--muted)}.audit-severity-warning{background:var(--warning-soft);color:var(--warning)}.audit-severity-error,.audit-severity-critical,.audit-outcome-failure,.audit-outcome-blocked{background:var(--danger-soft);color:var(--danger)}.audit-outcome-success{background:var(--success-soft);color:var(--success)}
.audit-empty{padding:34px!important;text-align:center;color:var(--muted)}.audit-loading{opacity:.65;pointer-events:none}
.audit-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 3px 0;color:var(--muted);font-size:12px}.audit-pagination>div{display:flex;align-items:center;gap:9px}.audit-pagination b{min-width:70px;text-align:center;color:var(--ink)}
.audit-retention-card{margin:0}.audit-retention-card summary{cursor:pointer;color:var(--ink);font-weight:700}.audit-retention-card>p{color:var(--muted);font-size:13px}.audit-settings-form{display:grid;grid-template-columns:repeat(4,minmax(160px,1fr));gap:12px}.audit-settings-form label{margin:0}.audit-settings-actions{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-end;gap:12px}.audit-settings-actions span{margin-right:auto}.audit-settings-actions .success{color:var(--success);font-weight:700}.audit-settings-actions .error{color:var(--danger)}
#audit-detail-dialog{width:min(820px,calc(100vw - 30px));max-width:820px}.audit-detail-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;padding-right:24px}.audit-detail-head small{color:var(--orange-dark);font-weight:700}.audit-detail-head h3{margin:5px 0 0}.audit-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:20px 0}.audit-detail-grid>div,.audit-metadata dl>div{padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft)}.audit-detail-grid .full{grid-column:1/-1}.audit-detail-grid dt,.audit-metadata dt{color:var(--muted);font-size:12px}.audit-detail-grid dd,.audit-metadata dd{margin:4px 0 0;overflow-wrap:anywhere;color:var(--ink);font-weight:600}.audit-hash{font-size:12px}.audit-metadata{margin:18px 0}.audit-metadata h4{margin:0 0 9px}.audit-metadata dl{display:grid;gap:7px}.audit-metadata dl>div{display:grid;grid-template-columns:180px 1fr;gap:10px}.audit-metadata dd{font-size:12px;font-weight:500}
:root[data-theme="dark"] .audit-summary-grid article,:root[data-theme="dark"] .audit-main-card,:root[data-theme="dark"] .audit-retention-card{background:var(--surface)}
@media(max-width:1200px){.audit-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.audit-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.audit-search{grid-column:span 2}.audit-settings-form{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.audit-summary-grid{display:flex;overflow-x:auto;padding-bottom:3px;scroll-snap-type:x mandatory}.audit-summary-grid article{flex:0 0 150px;scroll-snap-align:start}.audit-card-head{align-items:stretch}.audit-head-actions{justify-content:flex-start}.audit-integrity{width:100%}.audit-filters{grid-template-columns:1fr 1fr}.audit-search{grid-column:1/-1}.audit-filters button{width:100%}.audit-settings-form{grid-template-columns:1fr}.audit-settings-actions{grid-column:auto;align-items:stretch;flex-direction:column}.audit-pagination{align-items:stretch;flex-direction:column}.audit-pagination>div{justify-content:space-between}.audit-detail-grid{grid-template-columns:1fr}.audit-detail-grid .full{grid-column:auto}.audit-metadata dl>div{grid-template-columns:1fr}.audit-table th:nth-child(2),.audit-table td:nth-child(2),.audit-table th:nth-child(5),.audit-table td:nth-child(5),.audit-table th:nth-child(6),.audit-table td:nth-child(6){display:none}.audit-table{min-width:700px}}
/* /assets/backup.css */
.backup-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:18px;padding:18px}.backup-config,.backup-actions{min-width:0}.backup-config hr{border:0;border-top:1px solid var(--border,#e2dfda);margin:20px 0}.backup-config h4{margin:0 0 12px}.backup-state{display:inline-flex;padding:7px 10px;border-radius:999px;background:var(--surface-soft,#F5F6F8);color:var(--text-muted,#716d68);font-size:12px}.backup-state.ok{background:#e6f5ef;color:#187a57}.backup-state.fail{background:#fbe9e7;color:#a33d32}.backup-fingerprint-row{display:flex;gap:8px}.backup-fingerprint-row input{min-width:0;flex:1}.backup-last,.backup-warning{color:var(--text-muted,#716d68);font-size:13px}.backup-empty{padding:30px 14px;text-align:center;color:var(--text-muted,#716d68);background:var(--surface-soft,#F5F6F8);border-radius:10px}.backup-actions .table-wrap{margin-top:10px}.backup-actions td:first-child{word-break:break-all}.backup-warning{margin-top:12px}.backup-restore-alert{padding:14px;border:1px solid #d8a29c;background:#F2F4F7;color:#7d3028;border-radius:10px;margin:12px 0 18px}.backup-restore-alert p{margin:6px 0 0}.danger-outline{border:1px solid #b44b40;color:#9c382f;background:transparent}.danger{background:#a94036!important;color:#fff!important;border-color:#a94036!important}.form-message{min-height:20px;color:var(--accent,#F58220);font-size:13px;margin-top:10px}[data-theme="dark"] .backup-restore-alert{background:#412d2a;border-color:#75443d;color:#ffd8d3}@media(max-width:1050px){.backup-grid{grid-template-columns:1fr}}@media(max-width:680px){.backup-grid{padding:10px;gap:12px}.backup-fingerprint-row{flex-direction:column}.backup-actions .settings-card-head{align-items:flex-start}.backup-actions .settings-card-head button{width:100%}.backup-actions table{min-width:680px}}
/* /assets/access-admin.css */
.access-admin-grid{display:grid;gap:18px}
.access-role-card,.access-package-card{margin:0}
.access-tree-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;margin-top:16px}
.access-tree{min-width:0;margin:0;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft,#F5F6F8)}
.access-tree legend{padding:0 7px;font-weight:800;color:var(--text)}
.access-tree label{display:flex;align-items:center;gap:8px;margin:7px 0;font-weight:500}
.access-tree input,.inline-check input{width:17px;height:17px;accent-color:var(--orange)}
.access-vehicle-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;max-height:240px;overflow:auto;padding:10px;border:1px solid var(--line);border-radius:10px}
.access-vehicle-list label{display:flex;align-items:center;gap:7px;margin:0;padding:8px;border-radius:8px;background:var(--surface-soft,#F5F6F8)}
.access-vehicle-list small{color:var(--muted)}
.access-overrides{margin-top:16px;border:1px solid var(--line);border-radius:10px;padding:12px}
.access-overrides summary{cursor:pointer;font-weight:800}
.access-overrides label{display:grid;grid-template-columns:150px 1fr;align-items:center;gap:10px;margin-top:9px}
.access-overrides select{margin:0}
html[data-theme="dark"] .access-tree,html[data-theme="dark"] .access-vehicle-list label{background:#302e2b}
@media(max-width:650px){.access-tree-grid{grid-template-columns:1fr}.access-overrides label{grid-template-columns:1fr}.settings-tabs{overflow-x:auto;white-space:nowrap}.settings-tabs button{flex:0 0 auto}}

.client-users-panel{display:grid;gap:16px;min-height:260px}
.client-modal-tabs{margin-top:-4px}
.client-users-panel .settings-card-head{align-items:flex-start}
.client-users-panel .settings-card-head h4{margin:0 0 5px}
.client-users-panel .settings-card-head p{margin:0;color:var(--muted);max-width:720px}
.client-users-panel table{min-width:720px}
@media(max-width:650px){.client-users-panel .settings-card-head{display:grid;gap:12px}.client-users-panel .settings-card-head button{width:100%}}
.access-user-actions{display:flex;align-items:center;gap:7px;white-space:nowrap}
.access-generated-password{display:grid;grid-template-columns:minmax(220px,1fr) auto auto;gap:9px;align-items:center;margin-top:7px}
.access-generated-password input{margin:0;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-weight:700;letter-spacing:.04em}
@media(max-width:650px){.access-user-actions{align-items:stretch;flex-direction:column}.access-generated-password{grid-template-columns:1fr}.access-generated-password button{width:100%}}

/* /assets/notifications.css */
.notification-center{position:relative}
.notification-bell{position:relative;width:42px;height:42px;border:1px solid var(--line,#e4e1dc);border-radius:10px;background:var(--surface,#fff);color:#4b4946;display:grid;place-items:center;padding:0}
.notification-bell:hover,.notification-bell:focus-visible{color:#B45C0B;border-color:#F58220;background:#F2F4F7;outline:3px solid rgba(245,130,32,.12)}
.notification-bell svg{width:21px;height:21px}
.notification-badge{position:absolute;right:-6px;top:-7px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:#c7423a;color:#fff;border:2px solid var(--surface,#fff);font-size:12px;font-weight:700;line-height:16px;text-align:center}
.notification-popover{position:absolute;right:0;top:50px;width:min(430px,calc(100vw - 28px));max-height:min(650px,calc(100vh - 90px));overflow:hidden;border:1px solid var(--line,#e4e1dc);border-radius:14px;background:var(--surface,#fff);box-shadow:0 18px 55px rgba(43,42,40,.18);z-index:1400}
.notification-popover-head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--line,#e4e1dc)}
.notification-popover-head h3{margin:0;font-size:16px}
.notification-popover-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.notification-popover-head .notification-popover-actions button{border:1px solid transparent;border-radius:7px;padding:6px 8px;font-weight:600;white-space:nowrap}
.notification-popover-head .notification-popover-actions button[data-push-toggle]{border-color:#B45C0B;background:#F2F4F7;color:#B45C0B}
.notification-popover-head .notification-popover-actions button.notification-push-active{border-color:var(--line,#dedad4);background:var(--surface-muted,#F5F6F8);color:var(--muted,#6f6b66)}
.notification-popover-head .notification-popover-actions button:disabled{opacity:.55;cursor:wait}
body.theme-dark .notification-popover-head .notification-popover-actions button[data-push-toggle]{border-color:#694623;background:#322d28;color:#f2a356}
.notification-popover-head button{border:0;background:none;color:#B45C0B;padding:5px;font-size:12px}
.notification-list{max-height:540px;overflow:auto}
.notification-item{display:flex;gap:12px;padding:15px 17px;border-bottom:1px solid var(--line,#eee);background:var(--surface,#fff)}
.notification-item.unread{background:#F2F4F7}
.notification-item-icon{width:36px;height:36px;flex:0 0 36px;border-radius:9px;background:#F2F4F7;color:#d26d0b;display:grid;place-items:center}
.notification-item-icon .ui-icon{width:19px;height:19px}
.notification-item-body{min-width:0;flex:1}
.notification-item-body strong{display:block;font-size:13px;color:var(--text,#202630)}
.notification-vehicle{display:block;margin-top:3px;font-size:12px;color:#4c4844}
.notification-item-body p{margin:4px 0 6px;font-size:12px;line-height:1.45;color:var(--muted,#6f6b66)}
.notification-item-body small{color:#918b85;font-size:12px}
.notification-item-actions{display:flex;gap:10px;margin-top:8px;flex-wrap:wrap}
.notification-item-actions button{border:0;background:none;padding:0;color:#B45C0B;font-size:12px;font-weight:700}
.notification-empty{padding:35px 20px;text-align:center;color:var(--muted,#777)}
#notification-toasts{position:fixed;right:24px;top:82px;z-index:1800;display:flex;flex-direction:column;gap:10px;width:min(390px,calc(100vw - 32px))}
.notification-toast{position:relative;border:1px solid #f0d5b8;border-left:4px solid #F58220;border-radius:12px;background:var(--surface,#fff);box-shadow:0 14px 40px rgba(43,42,40,.18);padding:16px 42px 15px 17px;animation:notification-in .22s ease-out}
@keyframes notification-in{from{transform:translateX(20px);opacity:0}to{transform:none;opacity:1}}
.notification-toast-head{display:flex;align-items:center;gap:8px;color:#202630}
.notification-toast-head .ui-icon{color:#d36e0b;width:19px;height:19px}
.notification-toast p{margin:7px 0 10px;font-size:13px;line-height:1.45;color:var(--muted,#666)}
.notification-toast-close{position:absolute;right:10px;top:7px;border:0;background:none;font-size:22px;color:#888}
.notification-toast-map{border:0;border-radius:7px;background:#F58220;color:#fff;font-weight:700;padding:7px 10px}
.notification-rules-page .panel-head{align-items:flex-start}
.panel-subtitle{margin:5px 0 0;color:var(--muted,#777);font-size:13px}
.notification-rule-help{margin:16px 0;padding:12px 14px;border-radius:9px;background:#F2F4F7;color:#667085;font-size:13px}
.table-secondary{display:block;color:#8b857e;font-size:12px;font-weight:400;margin-top:4px}
.notification-channel{display:inline-block;padding:4px 7px;border-radius:6px;background:#efede9;color:#8c8781;font-size:12px}
.notification-channel.active{background:#F2F4F7;color:#B45C0B;font-weight:700}
.notification-status{border:0;border-radius:16px;padding:6px 10px;font-weight:700;font-size:12px}
.notification-status.enabled{background:#e4f4ed;color:#167856}
.notification-status.disabled{background:#efede9;color:#77716b}
.empty-table{text-align:center!important;padding:32px!important;color:#888}
.notification-rule-dialog{width:min(900px,calc(100vw - 30px));max-width:900px}
.notification-rule-form{padding:8px}
.notification-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:22px}
.notification-form-grid>label,.notification-condition-fields>label{display:flex;flex-direction:column;gap:7px;color:#625d58;font-size:13px}
.notification-condition-fields{grid-column:1/-1}
.notification-condition-fields>label{max-width:390px}
.notification-channels{display:flex;gap:24px;flex-wrap:wrap;margin:20px 0 8px;padding:14px 16px;border:1px solid var(--line,#e2dfda);border-radius:10px}
.notification-channels legend{font-weight:700;padding:0 6px}
.notification-channels label{display:flex;align-items:center;gap:7px}
.notification-schedule{display:grid;gap:7px}
.notification-schedule-row{display:grid;grid-template-columns:170px 135px 140px 140px;gap:12px;align-items:center;padding:10px 12px;background:#F5F6F8;border-radius:8px}
.notification-schedule-row label{display:flex;align-items:center;gap:7px;color:#625d58;font-size:12px}
.notification-schedule-row input[type=time]{min-width:100px;padding:7px}
.notification-day{font-weight:700}
.form-hint{margin:7px 0;color:#807a74;font-size:12px;line-height:1.45}
.notification-template-list{display:grid;gap:12px}
.notification-template-group{display:grid;gap:10px;margin-top:18px}
.notification-template-group:first-of-type{margin-top:0}
.notification-template-group>h4{margin:0;color:var(--ink);font-size:14px}
.notification-template-card{display:grid;grid-template-columns:1fr auto;gap:16px;align-items:center;padding:17px;border:1px solid var(--line,#e4e1dc);border-radius:11px;background:var(--surface,#fff)}
.notification-template-card h4,.notification-template-card h5{margin:0 0 5px;font-size:14px}
.notification-template-card p{margin:0;color:var(--muted,#777);font-size:12px}
.notification-template-editor{display:grid;gap:15px;padding:8px}
.notification-editor-toolbar{display:flex;gap:5px;flex-wrap:wrap;padding:8px;background:#F5F6F8;border:1px solid #dedad4;border-bottom:0;border-radius:9px 9px 0 0}
.notification-editor-toolbar button{min-width:34px;border:1px solid #d9d4ce;background:#fff;border-radius:5px;padding:6px 8px;color:#393633}
.notification-html-editor{min-height:260px;max-height:460px;overflow:auto;border:1px solid #dedad4;border-radius:0 0 9px 9px;padding:18px;background:#fff;color:#202630;line-height:1.55}
.notification-variable-list{display:flex;gap:6px;flex-wrap:wrap}
.notification-variable-list button{border:1px solid #B45C0B;background:#F2F4F7;color:#B45C0B;border-radius:14px;padding:5px 9px;font-family:monospace;font-size:12px}
.notification-preview-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.notification-preview-frame{width:100%;height:520px;border:1px solid #dedad4;border-radius:10px;background:#fff}
.notification-preview-popup{padding:16px;border-left:4px solid #F58220;background:#F2F4F7;border-radius:7px;color:#202630}
body.theme-dark .notification-item.unread,body.theme-dark .notification-rule-help{background:#322d28}
body.theme-dark .notification-schedule-row,body.theme-dark .notification-editor-toolbar{background:#302d29}
body.theme-dark .notification-html-editor{background:#fff;color:#202630}
.notification-select-col{width:42px;text-align:center!important}
.notification-select-col .row-check{width:17px;height:17px;accent-color:#F58220;cursor:pointer}
.notification-form-success{min-height:18px;color:#167856;font-size:13px;font-weight:700;margin-top:6px}
.notification-rules-page .client-toolbar{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
@media(max-width:760px){
  #notification-toasts{right:16px;top:72px}
  .notification-form-grid{grid-template-columns:1fr}
  .notification-schedule-row{grid-template-columns:1fr 1fr}
  .notification-preview-grid{grid-template-columns:1fr}
  .notification-popover{position:fixed;right:14px;top:65px}
}

@media(max-width:480px){.notification-popover-head{align-items:flex-start}.notification-popover-actions{flex-direction:column;align-items:flex-end;gap:3px}}


.notification-page{display:grid;gap:18px;max-width:100%;min-width:0;color:var(--text,#202630)}
.notification-page>.panel{min-width:0;margin-top:0}
.notification-page-tabs::-webkit-scrollbar{display:none}
.notification-history-list{margin-top:18px;border:1px solid var(--line,#e4e1dc);border-radius:12px;overflow:hidden}
.notification-history-list .notification-item{padding:17px 19px}
.notification-history-list .notification-item.selected{position:relative;background:var(--surface-accent,#F2F4F7);box-shadow:inset 4px 0 0 #F58220}
.notification-history-list .notification-item.selected:after{content:"Wybrane";align-self:flex-start;margin-left:auto;padding:4px 8px;border-radius:99px;background:#F58220;color:#fff;font-size:12px;font-weight:800}
:root[data-theme="dark"] .notification-history-list .notification-item.selected{background:var(--surface-accent,#272C34)}
@media(max-width:760px){.notification-page-tabs{padding:0 5px}.notification-page-tabs button{padding:13px 12px}.notification-history-page .panel-head{align-items:stretch;flex-direction:column}.notification-history-page .client-toolbar{justify-content:stretch}.notification-history-page .client-toolbar button{flex:1}.notification-history-list .notification-item.selected:after{display:none}}


.notification-event-check{display:flex;align-items:flex-start;padding-top:9px;flex:0 0 auto}
.notification-event-check input,.notification-select-all input{width:17px;height:17px;accent-color:#F58220;cursor:pointer}
.notification-select-all{display:flex;align-items:center;gap:7px;padding:8px 10px;border:1px solid var(--line,#dedad4);border-radius:8px;background:var(--surface,#fff);color:var(--text,#202630);font-size:12px;font-weight:700;white-space:nowrap}
.notification-item-actions .notification-delete-action{color:#b93c34}
.notification-history-toolbar{align-items:center}
@media(max-width:760px){.notification-history-toolbar{display:grid!important;grid-template-columns:1fr 1fr}.notification-history-toolbar .notification-select-all{justify-content:center}.notification-history-toolbar button{width:100%}.notification-event-check{padding-top:7px}}

/* Professional notification center 2026-08-02 */
.notification-popover{width:min(460px,calc(100vw - 28px));border-radius:16px;box-shadow:0 20px 60px rgba(43,42,40,.2)}
.notification-popover-head{display:block;padding:0;background:var(--surface,#fff)}
.notification-popover-heading{display:flex;align-items:center;gap:12px;padding:16px 18px 13px}
.notification-popover-title-icon{width:38px;height:38px;flex:0 0 38px;border-radius:10px;display:grid;place-items:center;background:var(--surface-accent,#F2F4F7);color:var(--orange-dark,#B45C0B)}
.notification-popover-title-icon svg{width:20px;height:20px}
.notification-popover-heading>div{min-width:0;flex:1}
.notification-popover-heading h3{margin:0;color:var(--text,#202630);font-size:16px;line-height:1.25}
.notification-popover-heading p{margin:3px 0 0;color:var(--muted,#77716b);font-size:12px;line-height:1.35}
.notification-popover-close{width:32px;height:32px;flex:0 0 32px;border:0!important;border-radius:8px!important;display:grid;place-items:center;padding:0!important;background:transparent!important;color:var(--muted,#77716b)!important;font-size:22px!important;font-weight:400!important;line-height:1}
.notification-popover-close:hover,.notification-popover-close:focus-visible{background:var(--surface-soft,#F5F6F8)!important;color:var(--text,#202630)!important;outline:2px solid rgba(245,130,32,.12)}
.notification-popover-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 18px 12px;border-top:1px solid var(--line,#E7EAEF);background:var(--surface-soft,#F5F6F8)}
.notification-popover-head .notification-popover-actions button{min-height:34px;border-radius:8px;padding:7px 11px;font-size:12px;line-height:1.2}
.notification-popover-head .notification-popover-actions .notification-push-button{border:1px solid #B45C0B;background:var(--surface-accent,#F2F4F7);color:var(--orange-dark,#B45C0B)}
.notification-popover-head .notification-popover-actions .notification-read-button{margin-left:auto;border:1px solid transparent;background:transparent;color:var(--orange-dark,#B45C0B)}
.notification-popover-head .notification-popover-actions .notification-read-button:hover{border-color:var(--line,#dedad4);background:var(--surface,#fff)}
.notification-list{max-height:520px;background:var(--surface,#fff)}
.notification-empty{min-height:205px;padding:34px 24px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--muted,#77716b)}
.notification-empty-icon{width:50px;height:50px;margin-bottom:14px;border-radius:50%;display:grid;place-items:center;background:var(--surface-soft,#F5F6F8);color:var(--muted,#77716b)}
.notification-empty-icon .ui-icon{width:23px;height:23px}
.notification-empty strong{display:block;color:var(--text,#202630);font-size:14px;line-height:1.3}
.notification-empty p{max-width:310px;margin:7px 0 0;font-size:12px;line-height:1.5}
.notification-loading{gap:10px}
.notification-loading-ring{width:28px;height:28px;border:3px solid var(--line,#e4e1dc);border-top-color:#F58220;border-radius:50%;animation:notification-loading-spin .8s linear infinite}
.notification-empty-error .notification-empty-icon{background:#fcebea;color:#b93c34;font-weight:800}
@keyframes notification-loading-spin{to{transform:rotate(360deg)}}
:root[data-theme="dark"] .notification-popover-head .notification-popover-actions .notification-push-button{border-color:#694623;background:#322d28;color:#f2a356}
@media(max-width:480px){
  .notification-popover{right:8px!important;width:calc(100vw - 16px)!important;border-radius:14px}
  .notification-popover-heading{padding:14px}
  .notification-popover-actions{display:grid;grid-template-columns:1fr;padding:10px 14px;gap:8px;align-items:stretch}
  .notification-popover-head .notification-popover-actions button{width:100%;margin:0!important}
  .notification-empty{min-height:180px;padding:28px 20px}
}
/* Admin notification rule filters 2026-08-02 */
.notification-rule-filters{display:grid;grid-template-columns:minmax(260px,1.8fr) repeat(5,minmax(130px,1fr));gap:10px;margin:0 0 16px;padding:14px;border:1px solid var(--line,#e4e1dc);border-radius:11px;background:var(--surface-soft,#F5F6F8)}
.notification-rule-filters label{display:grid;gap:6px;min-width:0;color:var(--muted,#716c67);font-size:12px;font-weight:700}
.notification-rule-filters input,.notification-rule-filters select{width:100%;min-width:0;height:40px;margin:0;padding:0 11px;border:1px solid var(--line,#dcd8d2);border-radius:8px;background:var(--surface,#fff);color:var(--text,#202630);font:inherit;font-size:12px;font-weight:500}
.notification-rule-filters input:focus,.notification-rule-filters select:focus{border-color:#F58220;outline:3px solid rgba(245,130,32,.12)}
.notification-rule-filter-summary{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;min-height:30px;color:var(--muted,#77716b);font-size:12px}
.notification-rule-filter-summary button{padding:7px 10px}
:root[data-theme="dark"] .notification-rule-filters{background:var(--surface-soft,#22262D);border-color:var(--line,#343A44)}
@media(max-width:1250px){.notification-rule-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.notification-rule-search{grid-column:span 2}}
@media(max-width:700px){.notification-rule-filters{grid-template-columns:1fr}.notification-rule-search{grid-column:auto}.notification-rule-filter-summary{align-items:stretch;flex-direction:column;gap:8px}.notification-rule-filter-summary button{width:100%}}
/* /assets/help.css */
.help-header-button{position:relative;display:flex;align-items:center;gap:7px;height:42px;padding:0 12px;background:transparent;color:var(--ink);border:1px solid var(--line);border-radius:11px;font-weight:600}
.help-header-button:hover,.help-header-button:focus-visible{background:var(--surface-accent);color:var(--orange-dark);border-color:#efc49e}
.help-header-button svg{width:20px;height:20px}
.help-hero,.help-panel{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--app-shadow)}
.help-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px}
.help-hero>div{display:flex;align-items:center;gap:15px}
.help-hero h3,.help-section-head h3{margin:0;color:var(--ink);font-size:21px}
.help-hero p,.help-section-head p{margin:5px 0 0;color:var(--muted)}
.help-hero>a{color:var(--orange-dark);font-weight:700;text-decoration:none}
.help-hero-icon{display:grid;place-items:center;flex:0 0 auto;width:48px;height:48px;border-radius:13px;background:var(--surface-accent);color:var(--orange-dark)}
.help-hero-icon svg{width:25px;height:25px}
.help-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:18px}
.help-card{position:relative;display:flex;min-height:178px;flex-direction:column;align-items:flex-start;gap:17px;padding:22px;background:var(--surface);color:var(--ink);text-align:left;border:1px solid var(--line);border-radius:14px;box-shadow:0 5px 20px rgba(43,42,40,.04);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.help-card:hover,.help-card:focus-visible{transform:translateY(-2px);background:var(--surface);border-color:#efbd91;box-shadow:0 12px 30px rgba(43,42,40,.10)}
.help-card-icon{display:grid;place-items:center;width:43px;height:43px;border-radius:12px;background:var(--surface-accent);color:var(--orange-dark)}
.help-card-icon svg{width:23px;height:23px}
.help-card-copy{display:grid;gap:8px;padding-right:20px}
.help-card-copy strong{font-size:17px;color:var(--ink)}
.help-card-copy small{color:var(--muted);font-size:13px;line-height:1.55}
.help-card-arrow{position:absolute;right:20px;bottom:19px;color:var(--orange-dark);font-size:25px;line-height:1}
.help-panel{padding:24px}
.help-section-head{display:flex;align-items:flex-start;gap:18px;padding-bottom:20px;border-bottom:1px solid var(--line)}
.help-back{display:flex;align-items:center;gap:6px;flex:0 0 auto;padding:8px 10px;background:var(--surface-soft);color:var(--ink);border-radius:9px;font-weight:600}
.help-back:hover{background:var(--surface-accent);color:var(--orange-dark)}
.help-guide-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin-top:20px}
.help-guide{display:flex;gap:13px;padding:18px;background:var(--surface-muted);border:1px solid var(--line);border-radius:12px}
.help-guide>span{display:grid;place-items:center;flex:0 0 auto;width:31px;height:31px;background:var(--surface-accent);color:var(--orange-dark);border-radius:9px;font-weight:800}
.help-guide h4{margin:2px 0 7px;color:var(--ink)}
.help-guide p{margin:0;color:var(--muted);font-size:13px;line-height:1.55}
.help-faq{display:grid;margin-top:20px;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.help-faq details+details{border-top:1px solid var(--line)}
.help-faq summary{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:17px 19px;background:var(--surface);color:var(--ink);cursor:pointer;font-weight:700;list-style:none}
.help-faq summary::-webkit-details-marker{display:none}
.help-faq summary:hover{background:var(--surface-muted)}
.help-faq summary span{color:var(--orange-dark);font-size:22px;font-weight:400;transition:transform .18s ease}
.help-faq details[open] summary span{transform:rotate(45deg)}
.help-faq details p{margin:0;padding:0 19px 18px;color:var(--muted);line-height:1.6}
.help-form-panel{}
.help-ticket-form{display:grid;gap:17px;margin-top:21px}
.help-ticket-form label{display:grid;gap:8px;font-weight:600}
.help-ticket-form textarea{min-height:180px;resize:vertical}
.help-form-message{min-height:20px;color:var(--muted)}
.help-form-message.success{padding:12px 14px;background:#e8f6f0;color:#146149;border-radius:9px}
.help-form-message.success button{display:inline;padding:0;background:transparent;color:inherit;text-decoration:underline}
.help-ticket-table{margin-top:20px}
.help-ticket-table table{min-width:850px}
.help-ticket-table td{vertical-align:top}
.help-ticket-table td small{display:block;max-width:580px;margin-top:5px;color:var(--muted);font-size:12px;line-height:1.45;white-space:normal}
.help-ticket-subject{min-width:310px}
.help-status,.help-status-select{display:inline-flex;align-items:center;min-height:30px;padding:5px 10px;border-radius:99px;font-size:12px;font-weight:700;white-space:nowrap}
.help-status-select{border:1px solid transparent}
.status-new{background:#F2F4F7;color:#B45C0B}
.status-in_progress{background:#fff7d6;color:#785c00}
.status-resolved{background:#e5f8f0;color:#08775a}
.status-closed{background:var(--surface-soft);color:var(--muted)}
.help-empty{padding:36px!important;color:var(--muted);text-align:center}
:root[data-theme="dark"] .help-header-button,:root[data-theme="dark"] .help-hero,:root[data-theme="dark"] .help-panel,:root[data-theme="dark"] .help-card,:root[data-theme="dark"] .help-faq summary{background:var(--surface);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .help-card:hover,:root[data-theme="dark"] .help-header-button:hover{background:var(--surface-accent);border-color:#765136}
:root[data-theme="dark"] .help-guide{background:var(--surface-muted);border-color:var(--line)}
:root[data-theme="dark"] .help-form-message.success,:root[data-theme="dark"] .status-resolved{background:#163c31;color:#6fd8b0}
:root[data-theme="dark"] .status-new{background:#4a3222;color:#f3ba83}
:root[data-theme="dark"] .status-in_progress{background:#4a4120;color:#e7cf69}
@media(max-width:1050px){.help-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.help-header-button{position:relative;display:grid;place-items:center;width:44px;height:44px;padding:0}.help-header-button span{display:none}.help-hero{align-items:flex-start;flex-direction:column;padding:18px}.help-grid{grid-template-columns:1fr;gap:12px;margin-top:12px}.help-card{min-height:142px;padding:18px}.help-panel{padding:16px}.help-section-head{gap:11px}.help-back span{display:none}.help-guide-grid{grid-template-columns:1fr}.help-ticket-form textarea{min-height:150px}}

.help-admin-head{justify-content:space-between}
.help-ticket-toolbar{display:flex;justify-content:flex-end;margin-top:18px}
.help-detail-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-bottom:18px;border-bottom:1px solid var(--line)}
.help-ticket-meta{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-top:18px}
.help-ticket-meta>div{display:grid;align-content:start;gap:5px;padding:14px;background:var(--surface-muted);border:1px solid var(--line);border-radius:11px}
.help-ticket-meta span,.help-ticket-meta small{color:var(--muted);font-size:12px}
.help-ticket-meta b{color:var(--ink);font-size:14px}
.help-ticket-message{margin-top:18px;padding:21px;background:var(--surface-muted);border:1px solid var(--line);border-radius:12px}
.help-ticket-message h3{margin:0 0 12px;color:var(--ink)}
.help-ticket-message p,.help-reply p{margin:0;color:var(--ink);line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.help-conversation{display:grid;gap:11px;margin-top:22px}
.help-conversation>h3{margin:0 0 3px;color:var(--ink);font-size:17px}
.help-reply{max-width:880px;padding:16px 18px;background:var(--surface-muted);border:1px solid var(--line);border-radius:12px}
.help-reply.admin{background:var(--surface-accent);border-color:#f1cfb1}
.help-reply>div{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:9px}
.help-reply time{color:var(--muted);font-size:12px}
.help-empty-replies{margin:0;padding:18px;color:var(--muted);background:var(--surface-muted);border-radius:10px}
.help-reply-form{display:grid;gap:13px;max-width:880px;margin-top:22px;padding-top:20px;border-top:1px solid var(--line)}
.help-reply-form label{display:grid;gap:8px;font-weight:700}
.help-reply-form textarea{min-height:140px;resize:vertical}
:root[data-theme="dark"] .help-ticket-meta>div,:root[data-theme="dark"] .help-ticket-message,:root[data-theme="dark"] .help-reply,:root[data-theme="dark"] .help-empty-replies{background:var(--surface-muted);border-color:var(--line)}
:root[data-theme="dark"] .help-reply.admin{background:var(--surface-accent);border-color:#765136}
@media(max-width:1050px){.help-ticket-meta{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.help-ticket-toolbar{justify-content:stretch}.help-ticket-toolbar button{width:100%}.help-detail-head{align-items:stretch;flex-direction:column}.help-detail-head .row-actions button{width:100%}.help-ticket-meta{grid-template-columns:1fr 1fr}.help-ticket-message{padding:17px}.help-reply{padding:14px}.help-reply>div{align-items:flex-start;flex-direction:column;gap:3px}}
@media(max-width:480px){.help-ticket-meta{grid-template-columns:1fr}}

.help-badge{position:absolute;right:-6px;top:-7px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:#c7423a;color:#fff;border:2px solid var(--surface,#fff);font-size:12px;font-weight:700;line-height:16px;text-align:center}

.help-ticket-filters{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.help-ticket-filters button{padding:8px 13px;background:var(--surface-soft);color:var(--muted);border:1px solid transparent;border-radius:9px}.help-ticket-filters button:hover{color:var(--orange-dark);background:var(--surface-accent)}.help-ticket-filters button.active{color:var(--orange-dark);background:var(--surface-accent);border-color:#efc49e;font-weight:700}.help-ticket-toolbar{align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}@media(max-width:760px){.help-ticket-filters{width:100%}.help-ticket-filters button{flex:1 1 auto}.help-ticket-toolbar>button{width:100%}}

/* Zgłoszenia: wyszukiwanie, nieprzeczytane wiadomości i załączniki */
.help-ticket-search{display:grid;grid-template-columns:repeat(6,minmax(130px,1fr));gap:12px;align-items:end;margin-top:20px;padding:16px;background:var(--surface-muted);border:1px solid var(--line);border-radius:12px}
.help-ticket-search label{display:grid;gap:7px;color:var(--muted);font-size:12px;font-weight:700}
.help-ticket-search input,.help-ticket-search select{width:100%;min-height:42px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:9px}
.help-ticket-search input:focus,.help-ticket-search select:focus{border-color:var(--orange);box-shadow:0 0 0 3px rgba(245,130,32,.12);outline:0}
.help-search-query{grid-column:span 2}
.help-search-actions{display:flex;gap:8px;grid-column:span 2}
.help-search-actions button{min-height:42px}
.help-ticket-row-unread td{background:color-mix(in srgb,var(--surface-accent) 58%,var(--surface))}
.help-ticket-row-unread td b,.help-ticket-row-unread .device-name-link{font-weight:800}
.help-ticket-subject-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.help-unread-dot{display:inline-block;flex:0 0 auto;width:9px;height:9px;background:var(--orange);border-radius:50%;box-shadow:0 0 0 3px rgba(245,130,32,.12)}
.help-unread-count{display:inline-flex;align-items:center;min-height:23px;padding:3px 8px;background:var(--orange);color:#fff;border-radius:99px;font-size:12px;font-weight:800;white-space:nowrap}
.help-attachment-field{display:grid;gap:8px;font-weight:700}
.help-attachment-field input[type="file"]{padding:10px;background:var(--surface);color:var(--ink);border:1px dashed var(--line);border-radius:10px}
.help-attachment-field input[type="file"]::file-selector-button{margin-right:10px;padding:8px 12px;background:var(--surface-accent);color:var(--orange-dark);border:1px solid #efc49e;border-radius:8px;font-weight:700;cursor:pointer}
.help-attachment-field small{color:var(--muted);font-size:12px;font-weight:400}
.help-attachment-list{display:grid;gap:7px;margin:15px 0 0;padding:0;list-style:none}
.help-attachment-list li{display:flex;align-items:center;gap:8px;max-width:680px;padding:9px 11px;background:var(--surface);border:1px solid var(--line);border-radius:9px}
.help-attachment-list a{min-width:0;color:var(--orange-dark);font-weight:700;text-decoration:none;overflow-wrap:anywhere}
.help-attachment-list a:hover{text-decoration:underline}
.help-attachment-list small{margin-left:auto;color:var(--muted);white-space:nowrap}
:root[data-theme="dark"] .help-ticket-row-unread td{background:color-mix(in srgb,var(--surface-accent) 60%,var(--surface))}
:root[data-theme="dark"] .help-ticket-search,:root[data-theme="dark"] .help-ticket-search input,:root[data-theme="dark"] .help-ticket-search select,:root[data-theme="dark"] .help-attachment-field input[type="file"],:root[data-theme="dark"] .help-attachment-list li{border-color:var(--line)}
@media(max-width:1200px){.help-ticket-search{grid-template-columns:repeat(3,minmax(0,1fr))}.help-search-query,.help-search-actions{grid-column:span 1}}
@media(max-width:760px){.help-ticket-search{grid-template-columns:1fr}.help-search-query,.help-search-actions{grid-column:1}.help-search-actions button{flex:1}.help-ticket-row-unread td{background:transparent}.help-ticket-row-unread{box-shadow:inset 4px 0 var(--orange)}.help-attachment-list li{align-items:flex-start;flex-wrap:wrap}.help-attachment-list small{width:100%;margin-left:27px}}



.help-instructions-panel{margin:0 auto}
.help-instructions-note{margin-top:18px;padding:13px 15px;background:var(--surface-accent);color:var(--ink);border:1px solid #f1cfb1;border-radius:10px;line-height:1.5}
.help-instructions-panel .help-guide-grid{grid-template-columns:1fr;}
.help-instructions-panel .help-guide{align-items:flex-start;padding:20px}
.help-guide-number{margin-top:1px}
.help-guide-copy{min-width:0;flex:1}
.help-guide-copy h4{font-size:17px}
.help-guide-intro{margin:0 0 10px!important;color:var(--ink)!important;font-size:14px!important}
.help-guide-copy ol{display:grid;gap:7px;margin:0;padding-left:22px;color:var(--muted);font-size:13px;line-height:1.55}
.help-guide-copy li::marker{color:var(--orange-dark);font-weight:700}
.help-guide-tip{margin-top:13px!important;padding:10px 12px;background:var(--surface);border-left:3px solid var(--orange);border-radius:0 8px 8px 0;color:var(--muted)!important}
.help-guide-tip b{color:var(--ink)}
:root[data-theme="dark"] .help-instructions-note{border-color:#765136}
:root[data-theme="dark"] .help-guide-tip{background:var(--surface-soft)}
@media(max-width:760px){.help-instructions-panel .help-guide{padding:16px;gap:11px}.help-guide-copy ol{padding-left:19px}.help-instructions-note{font-size:13px}}
.help-content-page{padding:0;overflow:hidden}
.help-topic-tabs::-webkit-scrollbar{display:none}
.help-content-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:24px 24px 20px;border-bottom:1px solid var(--line)}
.help-content-head h2{margin:0;color:var(--ink);font-size:22px;line-height:1.25}
.help-content-head p{max-width:760px;margin:6px 0 0;color:var(--muted);line-height:1.5}
.help-content-head .help-back{min-height:40px;white-space:nowrap;border:1px solid var(--line)}
.help-search{display:grid;grid-template-columns:minmax(190px,250px) minmax(320px,720px);gap:22px;align-items:end;padding:20px 24px;background:var(--surface-muted);border-bottom:1px solid var(--line)}
.help-search-copy{display:grid;gap:4px}
.help-search-copy label{color:var(--ink);font-weight:700}
.help-search-copy small{color:var(--muted);font-size:12px;line-height:1.4}
.help-search-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}
.help-search-field{position:relative;min-width:0}
.help-search-field .help-search-icon{position:absolute;z-index:1;left:13px;top:50%;display:grid;width:18px;height:18px;color:var(--muted);transform:translateY(-50%);pointer-events:none}
.help-search-field .help-search-icon svg{width:18px;height:18px}
.help-search input{width:100%;min-width:0;padding-left:41px;background:var(--surface)}
.help-search button{width:auto!important;min-width:104px;white-space:nowrap}
.help-search-result{margin:14px 24px 0;color:var(--muted)}
.help-content-page .help-guide-list,.help-content-page .help-faq-list{padding:20px 24px 28px}
.help-content-page .help-guide-item{display:grid;grid-template-columns:38px minmax(0,1fr);gap:14px;padding:20px 0;border-bottom:1px solid var(--line)}
.help-content-page .help-guide-item:last-child{border-bottom:0}
.help-content-page .help-guide-number{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--surface-accent);color:var(--orange-dark);font-weight:800}
.help-content-page .help-guide-item h3{margin:2px 0 6px}
.help-content-page .help-guide-item ol{margin:13px 0 0;padding-left:21px}
.help-content-page .help-guide-item li{margin:8px 0;line-height:1.55}
.help-content-images{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:16px}
.help-content-images figure{margin:0;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}
.help-content-images img{display:block;width:100%;height:auto;max-height:520px;object-fit:contain;border-radius:8px}
.help-content-images figcaption{padding:7px 3px 1px;color:var(--muted);font-size:12px}
.help-faq-item>div{padding:0 18px 16px}
.help-faq-groups{display:grid;gap:26px;padding:22px 24px 30px}
.help-faq-group{display:grid;gap:10px}
.help-faq-group-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.help-faq-group-head h3{margin:0;color:var(--ink);font-size:17px}
.help-faq-group-head>span{display:grid;place-items:center;min-width:29px;height:25px;padding:0 8px;background:var(--surface-accent);color:var(--orange-dark);border-radius:99px;font-size:12px;font-weight:800}
.help-faq-group-list{overflow:hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.help-faq-group-list .help-faq-item+.help-faq-item{border-top:1px solid var(--line)}
.help-faq-group-list summary{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;color:var(--ink);cursor:pointer;font-weight:700;list-style:none}
.help-faq-group-list summary::-webkit-details-marker{display:none}
.help-faq-group-list summary:hover{background:var(--surface-muted)}
.help-faq-toggle{display:grid;place-items:center;flex:0 0 auto;width:27px;height:27px;background:var(--surface-accent);color:var(--orange-dark);border-radius:8px;font-size:20px;font-weight:500;line-height:1;transition:transform .18s ease}
.help-faq-item[open] .help-faq-toggle{transform:rotate(45deg)}
.help-faq-group-list .help-faq-item>div{padding:0 18px 18px;color:var(--ink);line-height:1.6}
:root[data-theme="dark"] .help-faq-group-list{background:var(--surface);border-color:var(--line)}
@media(max-width:900px){.help-search{grid-template-columns:1fr;gap:12px}.help-search-controls{max-width:720px}}
@media(max-width:760px){.help-topic-tabs{padding:0 5px}.help-topic-tabs button{padding:13px 11px}.help-content-head{flex-direction:column-reverse;gap:14px;padding:18px 14px 16px}.help-content-head h2{font-size:20px}.help-content-head .help-back{min-height:36px}.help-content-head .help-back span{display:inline}.help-search{padding:14px}.help-search-controls{grid-template-columns:minmax(0,1fr) auto}.help-search button{min-width:86px;padding-inline:14px}.help-content-page .help-guide-list,.help-content-page .help-faq-list{padding:14px}.help-content-page .help-guide-item{grid-template-columns:30px minmax(0,1fr);gap:10px}.help-content-page .help-guide-number{width:28px;height:28px;border-radius:8px}.help-content-images{grid-template-columns:1fr}.help-faq-groups{gap:20px;padding:18px 14px 22px}.help-faq-group-list summary{align-items:flex-start;padding:14px}.help-faq-group-list .help-faq-item>div{padding:0 14px 15px}}

.help-global-result{display:grid;width:100%;gap:5px;padding:15px 17px;text-align:left;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:11px}
.help-global-result:hover{border-color:#efb47e;background:var(--surface-accent);transform:translateY(-1px)}
.help-global-result>span{color:var(--muted);font-size:12px}
.help-global-result>span b{color:var(--orange-dark)}
.help-global-result>strong{font-size:15px}
.help-global-result>small{display:-webkit-box;color:var(--muted);line-height:1.45;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.help-hero+.help-topic-tabs{margin-top:16px;border:1px solid var(--line);border-radius:12px}
@media(max-width:760px){.help-global-result{padding:13px}.help-hero+.help-topic-tabs{margin-top:12px}}


/* Formatted help content */
.help-rich-content{margin-top:13px;color:var(--ink);line-height:1.65;overflow-wrap:anywhere}
.help-rich-content h2{margin:22px 0 9px;color:var(--ink);font-size:21px;line-height:1.3}.help-rich-content h3{margin:19px 0 8px;color:var(--ink);font-size:17px;line-height:1.35}.help-rich-content h4{margin:16px 0 7px;color:var(--ink);font-size:15px}
.help-rich-content p,.help-rich-content div{margin:9px 0}.help-rich-content ul,.help-rich-content ol{margin:11px 0;padding-left:24px}.help-rich-content li{margin:7px 0}
.help-rich-content a{color:var(--orange-dark);font-weight:600;text-decoration:underline;text-underline-offset:2px}.help-rich-content hr{margin:22px 0;border:0;border-top:1px solid var(--line)}
.help-rich-content blockquote{margin:15px 0;padding:11px 14px;background:var(--surface-accent);border-left:3px solid var(--orange);border-radius:0 8px 8px 0;color:var(--muted)}
.help-faq-item .help-rich-content{margin-top:0}
@media(max-width:760px){.help-rich-content h2{font-size:19px}.help-rich-content h3{font-size:16px}.help-rich-content ul,.help-rich-content ol{padding-left:21px}}

/* /assets/billing.css */
.billing-page{display:grid;gap:18px;min-width:0;color:var(--text,#202630)}
.billing-panel{background:var(--surface,#fff);border:1px solid var(--line,#E4E7EC);border-radius:15px;padding:20px;box-shadow:0 8px 24px rgba(43,42,40,.05);min-width:0}
.billing-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.billing-panel-head h3{margin:0;font-size:18px}
.billing-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.billing-package-name{font-size:28px;font-weight:800;color:#F58220;margin-bottom:18px}
.billing-kv{display:grid;grid-template-columns:minmax(120px,1fr) auto;gap:11px 20px;align-items:center}
.billing-kv span{color:var(--muted,#667085)}
.billing-kv b{text-align:right}
.billing-price-main{display:grid;gap:5px;padding:14px 0 20px}
.billing-price-main span,.billing-price-main small{color:var(--muted,#667085)}
.billing-price-main strong{font-size:34px;line-height:1.1}
.billing-price-breakdown{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.billing-price-breakdown span{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;background:var(--surface-soft,#F5F6F8);border-radius:9px}
.billing-period{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:9px;padding:10px 12px;background:var(--surface-soft,#F5F6F8);border-radius:9px;font-size:14px}
.billing-period span{color:var(--muted,#667085)}
.billing-period b{color:var(--text,#202630);text-align:right}
.billing-calculation{display:grid;gap:8px;margin:0 0 14px}
.billing-calculation-row{display:grid;grid-template-columns:minmax(145px,.8fr) minmax(260px,1.5fr);align-items:center;gap:5px 18px;padding:11px 12px;border:1px solid var(--line,#e5e2df);border-radius:9px}
.billing-calculation-row span,.billing-calculation-row small{color:var(--muted,#667085)}
.billing-calculation-row b,.billing-calculation-row strong{text-align:right}
.billing-calculation-row small{grid-column:2;text-align:right}
.billing-calculation-row.billing-savings{border-color:rgba(242,140,40,.45);background:rgba(245,130,32,.08)}
.billing-calculation-row.billing-savings strong{color:#b85d08;font-size:17px}
.billing-actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}
.billing-actions button,.billing-dialog-actions button,.billing-panel button,.billing-inline-form button,.billing-product-form button{border:1px solid var(--line,#E4E7EC);background:var(--surface-soft,#F5F6F8);color:var(--text,#202630);border-radius:9px;padding:10px 15px;font:inherit;font-weight:600;cursor:pointer}
.billing-primary{background:#F58220!important;border-color:#F58220!important;color:#fff!important}
.billing-note{color:var(--muted,#667085);font-size:13px;line-height:1.5}
.billing-warning,.billing-error{padding:14px;border:1px solid #e6ad53;background:#fff7e8;color:#84500e;border-radius:10px}
.billing-empty,.billing-loading{padding:34px;text-align:center;color:var(--muted,#667085)}
.billing-table-wrap{overflow:auto;max-width:100%}
.billing-table{border-collapse:collapse;width:100%;min-width:720px;font-size:14px}
.billing-table th,.billing-table td{border-bottom:1px solid var(--line,#e5e2df);padding:12px;text-align:left;vertical-align:middle}
.billing-table th{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted,#667085);background:var(--surface-soft,#F5F6F8)}
.billing-status{display:inline-flex;padding:5px 9px;border-radius:999px;background:#eeece9;color:#605c58;font-size:12px;font-weight:700;white-space:nowrap}
.billing-status-active,.billing-status-paid,.billing-status-issued,.billing-status-sent{background:#e2f4ec;color:#137653}
.billing-status-overdue,.billing-status-failed,.billing-status-sync_error,.billing-status-canceled{background:#FDECEA;color:#a53b32}
.billing-status-expiring,.billing-status-pending_payment,.billing-status-pending,.billing-status-created{background:#fff2da;color:#965c0d}
.billing-name,.billing-link{color:#B45C0B!important;background:transparent!important;border:0!important;padding:0!important;text-decoration:none;font-weight:700;cursor:pointer}
.billing-link{display:inline-block;margin-right:9px}
.billing-small{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:7px 12px!important;
  border:1px solid var(--line,#E4E7EC)!important;
  border-radius:8px!important;
  background:var(--surface-soft,#F5F6F8)!important;
  color:var(--text,#202630)!important;
  font-size:12px!important;
  font-weight:600!important;
  line-height:1!important;
}
.billing-small:hover{border-color:#F58220!important;background:rgba(245,130,32,.12)!important;color:#a95200!important}
.billing-small.danger{border-color:#e7bbb6!important;background:#F2F4F7!important;color:#a53b32!important}
.billing-small.danger:hover{border-color:#a53b32!important;background:#a53b32!important;color:#fff!important}
.billing-dialog{min-width:min(760px,calc(100vw - 64px));max-width:920px;color:var(--text,#202630)}
.billing-dialog h3{margin:0 0 20px;font-size:21px}
.billing-form{display:grid;gap:16px}.billing-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px}
.billing-form label,.billing-inline-form label,.billing-product-form label{display:grid;gap:6px;color:var(--muted,#667085);font-size:13px}
.billing-form label.wide{grid-column:1/-1}
.billing-form label small{color:var(--muted,#667085);font-size:12px;font-weight:400}
.billing-form input,.billing-form select,.billing-form textarea,.billing-inline-form input,.billing-inline-form select,.billing-product-form input{width:100%;box-sizing:border-box;border:1px solid var(--line,#dcd8d3);border-radius:9px;background:var(--surface,#fff);color:var(--text,#202630);font:inherit;padding:10px 12px}
.billing-form textarea{min-height:72px;resize:vertical}
.billing-check{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center;align-self:end;padding:10px 0}
.billing-check input{width:auto!important}
.billing-dialog-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:10px}
.billing-order-total{display:grid;gap:8px;padding:14px;background:var(--surface-soft,#F5F6F8);border-radius:10px}
.billing-order-total span{display:flex;justify-content:space-between}.billing-order-total strong{font-size:20px;border-top:1px solid var(--line,#ddd);padding-top:10px}
.billing-order-total small{color:var(--muted,#667085);line-height:1.45}
.billing-pricing-sections,.billing-integrations{display:grid;gap:18px}
.billing-inline-form{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:12px;align-items:end;margin-bottom:18px}
.billing-products{display:grid;gap:9px}.billing-product-form{display:grid;grid-template-columns:minmax(130px,1fr) 160px 120px 130px auto;gap:12px;align-items:end;padding:12px;background:var(--surface-soft,#F5F6F8);border-radius:10px}
.billing-product-form>b{align-self:center}.billing-secret-state{display:flex;gap:12px;flex-wrap:wrap;margin:10px 0}
.billing-secret-state span{background:var(--surface-soft,#F5F6F8);border-radius:8px;padding:8px 11px;font-size:13px}
.billing-manual{border-top:1px solid var(--line,#ddd);padding-top:15px}
[data-theme="dark"] .billing-page{--surface:#22262D;--surface-soft:#3a3836;--line:#4c4946;--text:#F5F6F8;--muted:#bbb5af}
[data-theme="dark"] .billing-panel{box-shadow:none}
[data-theme="dark"] .billing-warning,[data-theme="dark"] .billing-error{background:#493a23;color:#ffdca7;border-color:#886438}
[data-theme="dark"] .billing-status{background:#474441;color:#d7d2ce}
[data-theme="dark"] .billing-status-active,[data-theme="dark"] .billing-status-paid,[data-theme="dark"] .billing-status-issued,[data-theme="dark"] .billing-status-sent{background:#214a3d;color:#9ee2c8}
[data-theme="dark"] .billing-status-overdue,[data-theme="dark"] .billing-status-failed,[data-theme="dark"] .billing-status-sync_error,[data-theme="dark"] .billing-status-canceled{background:#522e2b;color:#f2aaa3}
[data-theme="dark"] .billing-status-expiring,[data-theme="dark"] .billing-status-pending_payment,[data-theme="dark"] .billing-status-pending,[data-theme="dark"] .billing-status-created{background:#513f24;color:#f5cf8b}
@media(max-width:900px){.billing-summary-grid{grid-template-columns:1fr}.billing-inline-form{grid-template-columns:repeat(2,minmax(0,1fr))}.billing-product-form{grid-template-columns:1fr 1fr}.billing-product-form>b{grid-column:1/-1}}
@media(max-width:600px){.billing-period{display:grid}.billing-period b{text-align:left}.billing-calculation-row{grid-template-columns:1fr}.billing-calculation-row b,.billing-calculation-row strong,.billing-calculation-row small{text-align:left}.billing-calculation-row small{grid-column:1}.billing-page{gap:12px}.billing-tabs{padding:0 5px}.billing-tabs button{padding:13px 12px}.billing-panel{padding:15px;border-radius:12px}.billing-form-grid,.billing-inline-form{grid-template-columns:1fr}.billing-dialog{min-width:0;width:calc(100vw - 48px)}.billing-price-breakdown{grid-template-columns:1fr}.billing-actions{display:grid}.billing-actions button{width:100%}.billing-product-form{grid-template-columns:1fr}.billing-table{min-width:650px}.billing-package-name{font-size:24px}.billing-price-main strong{font-size:29px}}

.billing-refunded{display:block;margin-top:4px;color:var(--muted,#667085);font-weight:400;white-space:nowrap}

.billing-row-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap;white-space:nowrap}
[data-theme="dark"] .billing-small.danger{border-color:#74413c!important;background:#522e2b!important;color:#f2aaa3!important}
[data-theme="dark"] .billing-small.danger:hover{border-color:#d46b61!important;background:#a53b32!important;color:#fff!important}
.billing-dialog-wide{max-width:min(1180px,calc(100vw - 48px))}
.billing-log-table{max-height:min(62vh,620px)}
.billing-log-json{display:block;max-width:330px;white-space:normal;overflow-wrap:anywhere;font-size:12px;color:var(--muted,#667085)}
.billing-status-success{background:#e2f4ec;color:#137653}
.billing-status-error,.billing-status-rejected{background:#FDECEA;color:#a53b32}
[data-theme="dark"] .billing-status-success{background:#214a3d;color:#9ee2c8}
[data-theme="dark"] .billing-status-error,[data-theme="dark"] .billing-status-rejected{background:#522e2b;color:#f2aaa3}
@media(max-width:600px){.billing-dialog-wide{max-width:none}.billing-log-table{max-height:68vh}}
.billing-return-message{margin:0 0 14px;padding:12px 14px;border:1px solid var(--border,#ddd8d2);border-left:4px solid #F58220;border-radius:10px;background:var(--surface,#fff);color:var(--text,#202630);font-weight:600}
.billing-return-paid{border-left-color:#23835f}.billing-return-failed,.billing-return-canceled{border-left-color:#b8443c}.billing-return-pending,.billing-return-created{border-left-color:#d28a20}
.billing-package-change-notice{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:18px;padding:13px 15px;border:1px solid rgba(242,140,40,.45);border-radius:11px;background:rgba(245,130,32,.08)}
.billing-package-change-notice>div{display:grid;gap:3px}.billing-package-change-notice span{color:var(--muted,#667085);font-size:13px}.billing-package-change-notice button{border:1px solid var(--line,#E4E7EC);border-radius:8px;padding:8px 11px;background:var(--surface,#fff);color:var(--text,#202630);font:inherit;font-weight:600;cursor:pointer}
.billing-package-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}.billing-package-dialog-head h3{margin:0 0 5px}.billing-package-dialog-head p{margin:0;color:var(--muted,#667085)}.billing-package-dialog-head>button{border:1px solid var(--line,#E4E7EC);border-radius:8px;padding:8px 11px;background:var(--surface-soft,#F5F6F8);color:var(--text,#202630);font:inherit;cursor:pointer}
.billing-package-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:15px}.billing-package-card{display:flex;flex-direction:column;min-width:0;padding:17px;border:1px solid var(--line,#E4E7EC);border-radius:13px;background:var(--surface,#fff)}.billing-package-card.current{border-color:#F58220;box-shadow:inset 0 3px 0 #F58220}.billing-package-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.billing-package-card-head h4{margin:0;font-size:20px}.billing-package-card-head p{margin:5px 0 0;color:var(--muted,#667085);font-size:13px;line-height:1.4}.billing-package-card-head>span{padding:4px 7px;border-radius:999px;background:rgba(245,130,32,.12);color:#a95200;font-size:12px;font-weight:700}.billing-package-card-price{display:grid;gap:3px;margin:16px 0 12px;padding-bottom:13px;border-bottom:1px solid var(--line,#E4E7EC)}.billing-package-card-price strong{font-size:24px}.billing-package-card-price span{color:var(--muted,#667085);font-size:12px}.billing-package-card ul{display:grid;gap:7px;margin:0 0 10px;padding:0;list-style:none}.billing-package-card li{position:relative;padding-left:18px;font-size:13px;line-height:1.35}.billing-package-card li:before{content:'✓';position:absolute;left:0;color:#d66f0a;font-weight:800}.billing-package-card>small{color:var(--muted,#667085)}.billing-package-settlement{display:grid;gap:4px;margin-top:auto;padding:12px;border-radius:9px;background:var(--surface-soft,#F5F6F8)}.billing-package-settlement span,.billing-package-settlement small{color:var(--muted,#667085);font-size:12px}.billing-package-settlement b{font-size:17px}.billing-package-blocked{margin:10px 0 0;color:#9a5b0c;font-size:12px;line-height:1.4}.billing-package-card-action{margin-top:13px}.billing-package-card-action button{width:100%;border:1px solid var(--line,#E4E7EC);border-radius:9px;padding:10px 12px;background:var(--surface-soft,#F5F6F8);color:var(--text,#202630);font:inherit;font-weight:700;cursor:pointer}.billing-package-card-action button:disabled{cursor:not-allowed;opacity:.6}
[data-theme="dark"] .billing-package-card-head>span{color:#ffc184;background:rgba(242,140,40,.2)}[data-theme="dark"] .billing-package-blocked{color:#efbf83}
@media(max-width:900px){.billing-package-grid{grid-template-columns:1fr}.billing-package-card{min-height:0}}
@media(max-width:600px){.billing-package-change-notice,.billing-package-dialog-head{align-items:stretch;display:grid}.billing-package-change-notice button,.billing-package-dialog-head>button{width:100%}.billing-package-grid{gap:10px}.billing-package-card{padding:14px}}
/* Package comparison modal */
#modal.billing-package-modal-open{
  box-sizing:border-box;
  width:min(1160px,calc(100vw - 40px));
  max-width:none;
  height:min(790px,calc(100dvh - 40px));
  max-height:calc(100dvh - 40px);
  padding:0;
  overflow:hidden;
}
#modal.billing-package-modal-open>.close{display:none}
#modal.billing-package-modal-open #modal-body{width:100%;height:100%;min-width:0;overflow:hidden}
.billing-dialog.billing-package-dialog{
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  width:100%;
  height:100%;
  min-width:0;
  max-width:none;
  overflow:hidden;
}
.billing-package-dialog .billing-package-dialog-head{
  flex:0 0 auto;
  margin:0;
  padding:22px 24px 18px;
  border-bottom:1px solid var(--line,#E4E7EC);
}
.billing-package-dialog-scroll{
  flex:1 1 auto;
  min-height:0;
  padding:18px 24px;
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-gutter:stable;
}
.billing-package-dialog .billing-package-grid{margin:0;align-items:stretch}
.billing-package-dialog .billing-package-card{height:auto}
.billing-package-dialog-footer{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:14px 24px;
  border-top:1px solid var(--line,#E4E7EC);
  background:var(--surface,#fff);
}
.billing-package-dialog-footer span{color:var(--muted,#667085);font-size:13px}
.billing-package-dialog-footer button{
  min-width:104px;
  border:1px solid var(--line,#E4E7EC);
  border-radius:9px;
  padding:10px 16px;
  background:var(--surface-soft,#F5F6F8);
  color:var(--text,#202630);
  font:inherit;
  font-weight:600;
  cursor:pointer;
}
.billing-package-dialog-footer button:hover{border-color:#F58220;color:#b65e08}
@media(max-width:1000px){
  #modal.billing-package-modal-open{width:min(720px,calc(100vw - 32px));height:calc(100dvh - 32px);max-height:calc(100dvh - 32px)}
  .billing-package-dialog .billing-package-grid{grid-template-columns:1fr}
}
@media(max-width:600px){
  #modal.billing-package-modal-open{width:calc(100vw - 20px);height:calc(100dvh - 20px);max-height:calc(100dvh - 20px);border-radius:12px}
  .billing-package-dialog .billing-package-dialog-head{padding:18px 16px 14px}
  .billing-package-dialog-scroll{padding:14px 16px}
  .billing-package-dialog-footer{display:grid;padding:12px 16px}
  .billing-package-dialog-footer button{width:100%}
}
/* mobile-billing-cards-v1 */
.billing-page,
.billing-page > *,
#billing-view {
  max-width: 100%;
  min-width: 0;
}

.billing-tabs {
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.billing-tabs::-webkit-scrollbar {
  display: none;
}

@media (max-width: 700px) {
  .billing-panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .billing-kv {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
  }

  .billing-table-wrap:has(.billing-mobile-cards) {
    overflow: visible;
  }

  .billing-table.billing-mobile-cards {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .billing-mobile-cards thead {
    display: none;
  }

  .billing-mobile-cards tbody {
    display: grid;
    gap: 10px;
  }

  .billing-mobile-cards tr {
    display: grid;
    padding: 10px 12px;
    border: 1px solid var(--line, #e5e2df);
    border-radius: 12px;
    background: var(--surface, #fff);
  }

  .billing-mobile-cards td {
    display: grid;
    grid-template-columns: minmax(104px, .75fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: auto;
    min-width: 0;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid var(--line, #e5e2df);
    overflow-wrap: anywhere;
  }

  .billing-mobile-cards td:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .billing-mobile-cards td::before {
    content: attr(data-label);
    color: var(--muted, #667085);
    font-size: .78rem;
    font-weight: 600;
  }

  .billing-mobile-cards .billing-row-actions {
    justify-content: flex-start;
    white-space: normal;
  }

  .billing-mobile-cards .billing-row-actions button,
  .billing-mobile-cards td > .billing-small {
    width: auto;
  }

  .billing-mobile-cards .billing-empty-row {
    padding: 0;
  }

  .billing-mobile-cards .billing-empty-row td {
    display: block;
    padding: 18px 8px;
    border: 0;
    color: var(--muted, #667085);
    text-align: center;
  }

  .billing-mobile-cards .billing-empty-row td::before {
    content: none;
  }

  .billing-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .billing-dialog-actions button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .billing-tabs button {
    padding-right: 10px;
    padding-left: 10px;
  }

  .billing-kv {
    grid-template-columns: 1fr;
  }

  .billing-kv b {
    margin-bottom: 5px;
    text-align: left;
  }

  .billing-mobile-cards td {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.billing-status-processing{background:#F2F4F7;color:#9a550f}
.billing-status-completed{background:#e2f4ec;color:#137653}
[data-theme="dark"] .billing-status-processing{background:#513f24;color:#f5cf8b}
[data-theme="dark"] .billing-status-completed{background:#214a3d;color:#9ee2c8}

.billing-status-test{background:#F5F6F8;color:#434A55;border:1px solid #ddd8d2}
[data-theme="dark"] .billing-status-test{background:#3b3936;color:#e2ded8;border-color:#434A55}

.billing-integration-intro,.billing-callback-box{border:1px solid var(--border,#ddd8d2);background:var(--surface-soft,#f7f5f3);border-radius:12px;padding:14px 16px}.billing-integration-intro{display:grid;gap:5px}.billing-integration-intro strong{color:var(--text,#202630);font-size:15px}.billing-integration-intro p,.billing-callback-box small{margin:0;color:var(--muted,#667085);font-size:13px;line-height:1.5}.billing-callback-box{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;align-items:end}.billing-callback-box label{display:grid;gap:7px;font-size:13px}.billing-callback-box input{width:100%;min-width:0}.billing-callback-box small{grid-column:1/-1}@media(max-width:600px){.billing-callback-box{grid-template-columns:1fr}.billing-callback-box button{width:100%}.billing-callback-box small{grid-column:1}}
.billing-admin-tools{margin:18px 0;padding:18px;border:1px solid var(--border,#ddd8d2);border-radius:16px;background:var(--surface,#fff);box-shadow:0 8px 24px rgba(43,42,40,.05)}
.billing-admin-tools[hidden],.billing-admin-identity[hidden],.billing-admin-no-results[hidden],.billing-admin-filter-grid label[hidden]{display:none!important}
.billing-admin-tools-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:15px}
.billing-admin-tools-head h3{margin:0;color:var(--text,#202630);font-size:17px}.billing-admin-tools-head p{margin:5px 0 0;color:var(--muted,#667085);font-size:13px;line-height:1.45}
.billing-admin-result-count{flex:none;padding:6px 10px;border-radius:999px;background:var(--surface-soft,#F5F6F8);color:var(--muted,#667085);font-size:12px;font-weight:700}
.billing-admin-filter-grid{display:grid;grid-template-columns:minmax(260px,2fr) repeat(4,minmax(145px,1fr)) auto;gap:10px;align-items:end}
.billing-admin-filter-grid>label{display:grid;gap:6px;min-width:0;color:var(--muted,#667085);font-size:12px;font-weight:600}
.billing-admin-filter-grid input,.billing-admin-filter-grid select{width:100%;height:42px;min-width:0;border:1px solid var(--border,#ddd8d2);border-radius:10px;background:var(--surface,#fff);color:var(--text,#202630);font:inherit;font-size:13px;outline:none}
.billing-admin-filter-grid input:focus,.billing-admin-filter-grid select:focus{border-color:#F58220;box-shadow:0 0 0 3px rgba(245,130,32,.12)}
.billing-admin-search-field>div{position:relative}.billing-admin-search-field>div>span{position:absolute;left:12px;top:50%;width:17px;height:17px;transform:translateY(-50%);color:#8b8580;pointer-events:none}.billing-admin-search-field svg{width:17px;height:17px}.billing-admin-search-field input{padding-left:38px}
.billing-admin-clear{height:42px;padding:0 16px;border:1px solid var(--border,#ddd8d2);border-radius:10px;background:var(--surface-soft,#F5F6F8);color:var(--text,#202630);font-weight:700;white-space:nowrap}.billing-admin-clear:hover{border-color:#F58220;color:#b65f0e}
.billing-admin-identity{display:grid;grid-template-columns:minmax(150px,.8fr) minmax(0,3fr) auto;gap:16px;align-items:center;margin-top:15px;padding:14px;border:1px solid rgba(245,130,32,.24);border-radius:12px;background:rgba(242,140,40,.055)}
.billing-admin-identity-title{display:grid;gap:4px}.billing-admin-identity-title span{color:var(--muted,#667085);font-size:12px;text-transform:uppercase;letter-spacing:.04em}.billing-admin-identity-title strong{font-size:16px;color:var(--text,#202630)}
.billing-admin-identity dl{display:grid;grid-template-columns:repeat(7,minmax(90px,1fr));gap:12px;margin:0}.billing-admin-identity dl>div{min-width:0}.billing-admin-identity dt{margin-bottom:3px;color:var(--muted,#667085);font-size:12px;text-transform:uppercase;letter-spacing:.04em}.billing-admin-identity dd{margin:0;overflow:hidden;color:var(--text,#202630);font-size:12px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}
.billing-admin-identity>button{padding:9px 13px;border:1px solid #F58220;border-radius:9px;background:transparent;color:#bd650f;font-weight:700;white-space:nowrap}.billing-admin-identity>button:hover{background:#F58220;color:#fff}
.billing-admin-no-results{margin-top:14px;padding:12px;border-radius:10px;background:var(--surface-soft,#F5F6F8);color:var(--muted,#667085);text-align:center;font-size:13px}
[data-theme="dark"] .billing-admin-tools{background:var(--surface,#2f2e2c);box-shadow:0 8px 24px rgba(0,0,0,.18)}[data-theme="dark"] .billing-admin-filter-grid input,[data-theme="dark"] .billing-admin-filter-grid select{background:#333230}[data-theme="dark"] .billing-admin-identity{background:rgba(245,130,32,.08)}
@media(max-width:1280px){.billing-admin-filter-grid{grid-template-columns:minmax(240px,2fr) repeat(2,minmax(150px,1fr))}.billing-admin-clear{width:max-content}.billing-admin-identity{grid-template-columns:1fr auto}.billing-admin-identity dl{grid-column:1/-1;grid-template-columns:repeat(4,minmax(100px,1fr))}}
@media(max-width:720px){.billing-admin-tools{margin:12px 0;padding:14px}.billing-admin-tools-head{display:grid;gap:8px}.billing-admin-result-count{width:max-content}.billing-admin-filter-grid{grid-template-columns:1fr}.billing-admin-clear{width:100%}.billing-admin-identity{grid-template-columns:1fr}.billing-admin-identity dl{grid-template-columns:repeat(2,minmax(0,1fr))}.billing-admin-identity>button{width:100%}}
.billing-checkout-dialog{max-width:680px}.billing-checkout-head h3{margin:0 0 6px}.billing-checkout-head p{margin:0 0 18px;color:var(--muted,#667085);line-height:1.5}
.billing-legal-box{display:grid;grid-column:1/-1;gap:12px;padding:16px;border:1px solid var(--border,#ddd8d2);border-radius:12px;background:var(--surface-soft,#f7f5f3)}
.billing-legal-check{display:grid!important;grid-template-columns:20px minmax(0,1fr)!important;gap:10px!important;align-items:start;color:var(--text,#202630);font-size:13px;line-height:1.5}
.billing-legal-check input{width:18px!important;height:18px!important;margin:1px 0 0;accent-color:#F58220}
.billing-legal-check a,.billing-legal-box>p a{color:#b85f08;font-weight:700;text-decoration:none}.billing-legal-check a:hover,.billing-legal-box>p a:hover{text-decoration:underline}
.billing-legal-box>p{margin:2px 0 0;color:var(--muted,#667085);font-size:12px;line-height:1.55}
[data-theme="dark"] .billing-legal-box{background:var(--surface-soft,#383634)}
@media(max-width:600px){.billing-checkout-dialog{max-width:none}.billing-legal-box{padding:13px}.billing-legal-check{font-size:12px}.billing-checkout-head p{font-size:13px}}

/* /assets/legal.css */
.legal-page{display:grid;gap:18px}.legal-tabs{margin:0}.legal-tab-panel{display:grid;gap:16px}.legal-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.legal-section-head h2,.legal-section-head p{margin:0}.legal-section-head p{margin-top:5px;color:var(--muted,#6f6b66)}.legal-documents-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}.legal-document-card{display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:14px;padding:18px;border:1px solid var(--line,#E4E7EC);border-radius:14px;background:var(--card,#fff)}.legal-document-card h3,.legal-document-card p{margin:0}.legal-document-card p{margin-top:5px;color:var(--muted,#6f6b66);line-height:1.45}.legal-document-card small{display:block;margin-top:8px;color:var(--muted,#6f6b66)}.legal-document-card>a,.legal-link{color:var(--accent,#F58220);font-weight:600;text-decoration:none;background:none;border:0;padding:0;cursor:pointer}.legal-document-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:11px;background:var(--accent-soft,#F2F4F7);color:var(--accent,#F58220);font-weight:700}.legal-attention,.legal-admin-warning{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid #e8b579;border-radius:12px;background:#F2F4F7}.legal-attention span,.legal-admin-warning span{flex:1;color:var(--muted,#6f6b66)}.legal-admin-warning.complete{border-color:#b7ddcd;background:#f0faf6}.legal-table-wrap{overflow:auto;border:1px solid var(--line,#E4E7EC);border-radius:12px}.legal-table-wrap table{width:100%;border-collapse:collapse;min-width:720px}.legal-table-wrap th,.legal-table-wrap td{padding:12px;border-bottom:1px solid var(--line,#E4E7EC);text-align:left;vertical-align:top}.legal-table-wrap tbody tr:last-child td{border-bottom:0}.legal-badge{display:inline-flex;padding:5px 9px;border-radius:999px;background:#efeeec;color:#555}.legal-submitted,.legal-needs_information{background:#F2F4F7;color:#a75100}.legal-in_review{background:#fff7d8;color:#765d00}.legal-accepted,.legal-completed{background:#e7f7f0;color:#147855}.legal-rejected,.legal-canceled{background:#fdebea;color:#a63e36}.legal-dialog{width:min(760px,calc(100vw - 48px));display:grid;gap:16px}.legal-editor-dialog{width:min(980px,calc(100vw - 48px))}.legal-dialog h3,.legal-dialog p{margin:0}.legal-form{display:grid;gap:14px}.legal-form label{display:grid;gap:6px}.legal-form-row{display:flex;gap:18px;flex-wrap:wrap}.legal-dialog-actions{display:flex;justify-content:flex-end;gap:10px}.legal-request-summary{display:grid;gap:14px}.legal-request-summary dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0}.legal-request-summary dl div,.legal-original,.legal-message{padding:12px;border:1px solid var(--line,#E4E7EC);border-radius:11px;background:var(--card,#fff)}.legal-request-summary dt{font-size:12px;color:var(--muted,#6f6b66)}.legal-request-summary dd{margin:4px 0 0;font-weight:600}.legal-original p,.legal-message p{white-space:pre-wrap}.legal-messages{display:grid;gap:9px}.legal-message small{color:var(--muted,#6f6b66)}.legal-admin-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.legal-admin-settings .span-2{grid-column:1/-1}.legal-admin-documents{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px}.legal-admin-document{padding:18px;border:1px solid var(--line,#E4E7EC);border-radius:14px;background:var(--card,#fff)}.legal-admin-document h4{margin:0}.legal-admin-document p{color:var(--muted,#6f6b66)}.legal-admin-actions,.legal-admin-filter{display:flex;align-items:center;justify-content:flex-end;gap:10px}.legal-admin-filter{justify-content:flex-start;margin-bottom:12px}.legal-admin-filter input{max-width:520px}.legal-editor-toolbar{display:flex;flex-wrap:wrap;gap:8px;padding:10px;background:var(--surface,#F5F6F8);border-radius:10px}.legal-empty{padding:28px;text-align:center;color:var(--muted,#6f6b66)}
.legal-settings-section{margin-top:10px;padding-top:18px;border-top:1px solid var(--line,#E4E7EC)}.legal-settings-section h4,.legal-settings-section p{margin:0}.legal-settings-section p{margin-top:5px;color:var(--muted,#6f6b66);line-height:1.5}.legal-settings-form textarea{width:100%;resize:vertical;min-height:82px}
.login-card .login-legal-check{display:grid;grid-template-columns:18px 1fr;align-items:start;gap:9px;margin:8px 0;color:#667085;font-size:13px;line-height:1.4}.login-card .login-legal-check input{width:17px;height:17px;margin:1px 0 0;accent-color:var(--orange)}.login-card .login-legal-check a{color:#b85f08;font-weight:600}
@media(max-width:700px){.legal-section-head,.legal-attention,.legal-admin-warning{align-items:stretch;flex-direction:column}.legal-document-card{grid-template-columns:38px 1fr}.legal-document-card>a{grid-column:2}.legal-admin-settings{grid-template-columns:1fr}.legal-admin-settings .span-2{grid-column:auto}.legal-request-summary dl{grid-template-columns:1fr}.legal-dialog,.legal-editor-dialog{width:min(100%,calc(100vw - 28px))}.legal-dialog-actions{flex-direction:column-reverse}.legal-dialog-actions button{width:100%}.legal-admin-filter{align-items:stretch;flex-direction:column}.legal-admin-filter input{max-width:none}}

/* Final CMS legal document layout */
.legal-admin-documents{grid-template-columns:repeat(auto-fill,minmax(360px,1fr));align-items:stretch}
.legal-admin-document{display:grid;grid-template-rows:auto auto 1fr;gap:14px;min-width:0;height:100%;box-sizing:border-box}
.legal-admin-document-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;min-width:0}
.legal-admin-document-head h4{min-width:0;font-size:16px;line-height:1.4;overflow-wrap:anywhere}
.legal-document-version{flex:0 0 auto;color:var(--muted,#6f6b66);font-size:12px;white-space:nowrap}
.legal-admin-document-meta{display:flex;align-items:center;flex-wrap:wrap;gap:7px;color:var(--muted,#6f6b66);font-size:12px}
.legal-admin-document-meta>span{display:inline-flex;align-items:center;min-height:28px;padding:5px 9px;border-radius:999px;background:var(--surface-soft,#F5F6F8)}
.legal-admin-document-meta .legal-document-warning{background:var(--warning-soft,#fff3dc);color:var(--warning,#9a5b00);font-weight:700}
.legal-admin-actions{align-self:end;justify-content:space-between;padding-top:14px;border-top:1px solid var(--line,#E4E7EC)}
.legal-admin-actions .primary:disabled{opacity:.55;cursor:not-allowed}
#modal.legal-editor-modal{width:min(980px,calc(100vw - 32px));max-width:980px;max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box}
#modal.legal-editor-modal #modal-body{min-width:0;width:100%}
.legal-editor-dialog{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
.legal-editor-heading{display:grid;gap:5px;padding-right:36px}
.legal-editor-heading h3{font-size:20px;line-height:1.35}
.legal-editor-heading p{color:var(--muted,#6f6b66);line-height:1.45}
.legal-form,.legal-form>*{min-width:0}
.legal-editor-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.legal-editor-fields label{display:grid;gap:6px;min-width:0}
.legal-form-row{align-items:end;padding:14px;border:1px solid var(--line,#E4E7EC);border-radius:11px;background:var(--surface-soft,#F5F6F8)}
.legal-check{display:flex!important;grid-template-columns:none!important;align-items:center;gap:9px!important;min-height:42px}
.legal-check input{width:18px;height:18px;margin:0;accent-color:var(--orange,#F58220)}
.legal-audience-field{margin-left:auto;min-width:210px}
.legal-dialog-actions{padding-top:14px;border-top:1px solid var(--line,#E4E7EC)}
@media(max-width:700px){
  .legal-admin-documents{grid-template-columns:1fr}.legal-admin-actions{align-items:stretch;flex-direction:column}.legal-admin-actions button{width:100%}
  #modal.legal-editor-modal{width:calc(100vw - 18px);max-height:calc(100dvh - 18px);padding:16px}
  .legal-editor-fields{grid-template-columns:1fr}.legal-form-row{align-items:stretch;flex-direction:column}.legal-audience-field{width:100%;min-width:0;margin-left:0}
}
[data-theme="dark"] .legal-attention,[data-theme="dark"] .legal-admin-warning{background:#342b23;border-color:#795329}

/* User legal center - shared GlobalLink module layout */
.legal-page{min-width:0}
.legal-tabs{margin:0;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.legal-tabs::-webkit-scrollbar{display:none}
.legal-user-panel{display:grid;gap:18px;padding:20px;background:var(--surface,#fff);border:1px solid var(--line,#E4E7EC);border-radius:15px;box-shadow:0 8px 24px rgba(43,42,40,.05);min-width:0}
.legal-section-title{display:flex;align-items:flex-start;gap:12px;min-width:0}
.legal-section-title>div{min-width:0}
.legal-section-icon,.legal-empty-icon{display:grid;place-items:center;flex:0 0 auto;width:38px;height:38px;border-radius:11px;background:var(--accent-soft,#F2F4F7);color:var(--accent,#F58220)}
.legal-section-icon svg,.legal-empty-icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.legal-empty-state{display:grid;justify-items:center;gap:7px;padding:38px 20px;text-align:center;color:var(--muted,#6f6b66);border:1px dashed var(--line,#E4E7EC);border-radius:12px;background:var(--surface-soft,#F5F6F8)}
.legal-empty-state strong{color:var(--text,#202630);font-size:15px}
.legal-empty-state p{max-width:540px;margin:0;line-height:1.5}
.legal-documents-grid>.legal-empty-state{grid-column:1/-1}
[data-theme="dark"] .legal-user-panel{box-shadow:none}
[data-theme="dark"] .legal-empty-state{background:var(--surface-soft,#302e2b)}
@media(max-width:700px){.legal-page{gap:12px}.legal-tabs{padding:0 5px}.legal-tabs button{padding:13px 12px}.legal-user-panel{gap:15px;padding:15px;border-radius:12px}.legal-section-title{gap:10px}.legal-section-icon{width:34px;height:34px}.legal-empty-state{padding:30px 16px}.legal-section-head>.primary{width:100%}}

/* /assets/theme-responsive.css */
/* Tokeny powierzchni — neutralne. Zadnych bezowych ani pomaranczowych tel:
   akcent marki wchodzi wylacznie przez --orange w app.css. Patrz docs/ui-standard.md. */
:root{
  --text:#202630;--surface:#FFFFFF;--surface-muted:#F5F6F8;--surface-soft:#F0F2F5;
  --surface-accent:#F2F4F7;--header:#FFFFFF;--input:#FFFFFF;--line-strong:#D0D5DD;
  --overlay:rgba(16,24,40,.45);--app-shadow:0 8px 24px rgba(16,24,40,.10)
}
#menu{display:none}
.nav-close,.nav-overlay{display:none}
html,body{max-width:100%;overflow-x:hidden}
main,#content,.panel,.card,.table-wrap{min-width:0}

:root[data-theme="dark"]{
  --text:#F5F6F8;--surface:#1B1F25;--surface-muted:#22262D;--surface-soft:#272C34;
  --surface-accent:#272C34;--header:#1B1F25;--input:#14171C;--line-strong:#434A55;
  --overlay:rgba(8,8,8,.68);--app-shadow:0 10px 32px rgba(0,0,0,.28)
}
:root[data-theme="dark"] header h2,
:root[data-theme="dark"] .panel h3,
:root[data-theme="dark"] .card strong,
:root[data-theme="dark"] #menu{color:var(--ink)}
:root[data-theme="dark"] .preloader{background:rgba(29,28,27,.90)}
:root[data-theme="dark"] .login{background:linear-gradient(135deg,#1B1F25,#191817)}
:root[data-theme="dark"] .login-card{background:var(--surface);border-color:var(--line);box-shadow:0 30px 80px rgba(0,0,0,.38)}
:root[data-theme="dark"] .login-card .login-slogan,
:root[data-theme="dark"] .login-card .login-remember,
:root[data-theme="dark"] .login-privacy{color:var(--muted)}
:root[data-theme="dark"] .login-privacy{border-color:var(--line)}
:root[data-theme="dark"] .ui-icon:not(.ui-icon-online):not(.ui-icon-offline),
:root[data-theme="dark"] .user-avatar{background:var(--surface-accent);color:#F9A25D}
:root[data-theme="dark"] .close:hover{background:var(--surface-soft);color:var(--ink)}
:root[data-theme="dark"] .badge.online{background:#163c31;color:#6fd8b0}
:root[data-theme="dark"] .badge.offline{background:#472a28;color:#f0a49e}
:root[data-theme="dark"] .danger-link{background:#472a28;color:#f0a49e}

:root[data-theme="dark"] .notification-bell,
:root[data-theme="dark"] .notification-popover,
:root[data-theme="dark"] .notification-item,
:root[data-theme="dark"] .notification-toast,
:root[data-theme="dark"] .notification-template-card{background:var(--surface);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .notification-item.unread,
:root[data-theme="dark"] .notification-rule-help,
:root[data-theme="dark"] .notification-preview-popup{background:var(--surface-accent);color:var(--ink)}
:root[data-theme="dark"] .notification-item-body strong,
:root[data-theme="dark"] .notification-vehicle,
:root[data-theme="dark"] .notification-toast-head{color:var(--ink)}
:root[data-theme="dark"] .notification-schedule-row,
:root[data-theme="dark"] .notification-editor-toolbar,
:root[data-theme="dark"] .notification-channel{background:var(--surface-muted);color:var(--muted);border-color:var(--line)}
:root[data-theme="dark"] .notification-editor-toolbar button{background:var(--surface);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .notification-html-editor{background:var(--input);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .notification-variable-list button{background:var(--surface-accent);color:#F9A25D;border-color:#76502f}
:root[data-theme="dark"] .notification-preview-frame{border-color:var(--line)}

:root[data-theme="dark"] .device-fields input,
:root[data-theme="dark"] .device-fields select,
:root[data-theme="dark"] .upload-inline,
:root[data-theme="dark"] .vehicle-image-upload,
:root[data-theme="dark"] .device-subtabs button{background:var(--input);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .device-card-section,
:root[data-theme="dark"] .command-layout,
:root[data-theme="dark"] .command-layout>aside,
:root[data-theme="dark"] .command-layout>aside button{border-color:var(--line)}
:root[data-theme="dark"] .device-card-section h3,
:root[data-theme="dark"] .device-simple-panel h3,
:root[data-theme="dark"] .device-icon-field>span,
:root[data-theme="dark"] .vehicle-image-field>span,
:root[data-theme="dark"] .command-layout>aside h4{color:var(--ink)}
:root[data-theme="dark"] .reports-warning{background:#3d3523;color:#e6cd82}

:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip,
:root[data-theme="dark"] .leaflet-control-layers,
:root[data-theme="dark"] .leaflet-control-attribution,
:root[data-theme="dark"] .leaflet-bar a,
:root[data-theme="dark"] .leaflet-control-zoom a{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
:root[data-theme="dark"] .leaflet-bar a:hover,
:root[data-theme="dark"] .leaflet-control-zoom a:hover{background:var(--surface-accent)!important;color:#F9A25D!important}
:root[data-theme="dark"] .leaflet-control-attribution a{color:#F9A25D!important}

@media(max-width:1024px){
  .shell{display:block;min-height:100dvh}
  main{width:100%;min-height:100dvh}
  .shell>aside{display:flex;position:fixed;z-index:10000;top:0;bottom:0;left:0;width:min(80vw,320px);max-width:320px;height:100dvh;overflow:hidden;transform:translateX(-104%)!important;visibility:hidden!important;pointer-events:none;box-shadow:18px 0 42px rgba(43,42,40,.20);transition:transform .24s ease,visibility .24s ease}
  body.menu-open{overflow:hidden;touch-action:none}
  body.menu-open .shell>aside{display:flex;transform:translateX(0)!important;visibility:visible!important;pointer-events:auto}
  .nav-overlay{display:block;position:fixed;z-index:9990;top:0;right:0;bottom:0;left:min(80vw,320px);width:auto;height:auto;margin:0;padding:0;border:0;border-radius:0;background:var(--overlay);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .24s ease,visibility .24s ease}
  body.menu-open .nav-overlay{opacity:1;visibility:visible;pointer-events:auto}
  .nav-close{display:grid;position:absolute;z-index:2;top:10px;right:10px;width:42px;height:42px;padding:0;place-items:center;background:transparent;color:#667085;font-size:30px;line-height:1}
  .nav-close:hover,.nav-close:focus-visible{background:var(--sidebar-hover);color:var(--orange-dark)}
  .brand{flex:0 0 82px;height:82px;padding:10px 54px 10px 20px}
  .brand-logo{display:block!important;width:100%;max-width:190px;height:52px}
  .brand-icon{display:none!important}
  .shell>aside nav{display:flex;flex:1 1 auto;min-height:0;flex-direction:column;gap:4px;overflow-y:auto;overscroll-behavior:contain;padding:12px 10px}
  .shell>aside nav button{display:grid;grid-template-columns:26px minmax(0,1fr);align-items:center;gap:12px;min-height:48px;padding:10px 14px;font-size:15px}
  .shell>aside nav button span{display:block!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .shell>aside nav button .nav-icon{width:21px;height:21px}
  .aside-foot{display:block!important;flex:0 0 auto;margin-top:0;padding:11px 12px;font-size:12px;line-height:1.35}
  .aside-foot small{gap:1px}
  header{position:sticky;z-index:700;top:0;height:64px;padding:0 14px;background:var(--header)}
  #menu{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;padding:0;font-size:23px}
  .page-heading{min-width:0;margin:0 auto 0 8px;gap:7px}
  .page-heading-logo{width:23px;height:23px}
  header h2{min-width:0;margin:0;overflow:hidden;font-size:19px;text-overflow:ellipsis;white-space:nowrap}
  .header-actions{gap:8px}
  .live{display:none!important}
  #content{width:100%;padding:16px}
  dialog{width:min(680px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;padding:20px}
  .table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain}
  table{min-width:max-content}
  .leaflet-control-container{position:relative;z-index:400}
}

@media(max-width:760px){
  #content{padding:12px}
  header{height:60px;padding:0 9px}
  header h2{font-size:17px}
  .page-heading-logo{width:21px;height:21px}
  .header-actions{gap:4px}
  .notification-bell,.user-menu-button{display:grid;place-items:center;width:44px;height:44px;padding:0}
  .user-menu-button>span:nth-child(2),.user-menu-button>i{display:none}
  .user-menu-popover{position:fixed;top:58px;right:8px;width:min(230px,calc(100vw - 16px));z-index:1500}
  .notification-popover{position:fixed!important;top:58px!important;right:8px!important;width:calc(100vw - 16px)!important;max-height:calc(100dvh - 70px)!important}
  .panel,.card,.db-panel,.db-summary-card,.settings-card{padding:16px}
  .panel-head{align-items:flex-start;flex-wrap:wrap}
  .panel-head .client-toolbar,.device-toolbar,.row-actions,.form-actions{flex-wrap:wrap}
  .form-actions{position:sticky;bottom:0;padding:10px 0;background:var(--surface)}
  input,select,textarea{min-height:44px;font-size:16px}
  .client-toolbar{width:100%;align-items:stretch;flex-direction:column}
  .client-toolbar button,.device-toolbar button{min-height:44px}
  dialog.client-modal,.notification-rule-dialog,.dashboard-widget-modal{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:14px}
  .device-card-header h2{font-size:18px}
  .device-card-tabs{scrollbar-width:thin}
  .device-card-tabs button{min-height:46px}
  .device-card-footer{min-height:64px;overflow-x:auto}
  .device-card-footer button{min-width:max-content;min-height:44px}
  .settings-footer{bottom:6px;flex-wrap:wrap}
  .settings-footer button{min-height:44px}
  #notification-toasts{top:68px;right:8px;width:calc(100vw - 16px)}
}

@media(max-width:430px){
  .shell>aside{width:min(80vw,320px)}
  .nav-overlay{left:min(80vw,320px)}
  .brand{height:76px;flex-basis:76px;padding:9px 17px}
  .brand-logo{max-width:178px;height:48px}
  .shell>aside nav{padding:9px 8px}
  .shell>aside nav button{min-height:46px;padding:9px 12px}
  .aside-foot{padding:8px 10px}
  .db-summary-title,.db-panel-head h3{font-size:15px}
  .db-activity-item{padding:12px 10px}
  .db-activity-item strong{font-size:21px}
}

@media(prefers-reduced-motion:reduce){.shell>aside,.nav-overlay{transition:none}}
/* Module surfaces that must follow the selected theme */
:root[data-theme="dark"] .wg-panel-head>button,
:root[data-theme="dark"] .wg-monitor-panel>footer,
:root[data-theme="dark"] .wg-panel-open,
:root[data-theme="dark"] .wg-monitor-search select,
:root[data-theme="dark"] .history-summary header button,
:root[data-theme="dark"] .history-toolbar select,
:root[data-theme="dark"] .history-toolbar input,
:root[data-theme="dark"] .history-error,
:root[data-theme="dark"] .history-player>select{background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .wg-monitor-stats,
:root[data-theme="dark"] .wg-device-list,
:root[data-theme="dark"] .wg-monitor-panel>footer,
:root[data-theme="dark"] .wg-selected-actions,
:root[data-theme="dark"] .history-summary-grid,
:root[data-theme="dark"] .history-stop-list{border-color:var(--line)}
:root[data-theme="dark"] .wg-monitor-stats button,
:root[data-theme="dark"] .wg-device-row,
:root[data-theme="dark"] .wg-selected-actions button,
:root[data-theme="dark"] .history-stop-list button{color:var(--ink)}
:root[data-theme="dark"] .wg-device-row:hover,
:root[data-theme="dark"] .wg-device-row.selected,
:root[data-theme="dark"] .wg-monitor-stats button:hover,
:root[data-theme="dark"] .wg-monitor-stats button.active{background:var(--surface-accent)}
:root[data-theme="dark"] .settings-tabs,
:root[data-theme="dark"] .settings-card-head,
:root[data-theme="dark"] .settings-section{border-color:var(--line)}

@media(max-width:760px){
  .wg-monitor-content,.history-content{height:calc(100dvh - 60px)!important}
  .wg-monitor-panel{max-width:calc(100vw - 16px)}
  .wg-selected-device{max-width:calc(100vw - 16px)}
  .history-toolbar{max-height:184px;overflow-y:auto}
  .history-range{display:flex;min-width:0;align-items:center;gap:4px}
  .history-range input{min-width:0}
  .history-presets{display:flex;min-width:0;-webkit-overflow-scrolling:touch}
  .history-summary{top:196px}
  .settings-tabs,.device-subtabs{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .settings-tabs button,.device-subtabs button{flex:0 0 auto;min-height:44px}
  .reports-export{display:flex;flex-wrap:wrap}
  .reports-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .notification-schedule-row{min-width:0}
  .notification-schedule-row>*{min-width:0}
}
@media(max-width:430px){
  .history-range{display:grid;grid-template-columns:1fr auto 1fr}
  .history-range input{width:100%}
  .history-summary{top:202px}
  .notification-schedule-row{grid-template-columns:1fr}
  .reports-meta,.reports-summary{grid-template-columns:1fr}
  .telemetry-grid{grid-template-columns:1fr}
  .db-activity-grid{grid-template-columns:1fr 1fr}
  .db-last-route-summary{grid-template-columns:1fr}
}

/* Shared compact secondary navigation on phones. */
@media(max-width:760px){
  .billing-tabs,.notification-page-tabs,.settings-tabs,.vehicle-list-tabs{box-sizing:border-box;width:100%;max-width:100%;gap:2px;padding:0 5px;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .billing-tabs::-webkit-scrollbar,.notification-page-tabs::-webkit-scrollbar,.settings-tabs::-webkit-scrollbar,.vehicle-list-tabs::-webkit-scrollbar{display:none}
  .billing-tabs button,.notification-page-tabs button,.settings-tabs button,.vehicle-list-tabs button{flex:0 0 auto;min-height:46px;padding:12px 13px;border-left:0!important;font-size:13px;white-space:nowrap}
}

/* Tabs never use the sidebar active border. */
.billing-tabs button,.notification-page-tabs button,.settings-tabs button,.settings-cms-tabs button,.vehicle-list-tabs button,.device-subtabs button,.driver-tabs button,.help-topic-tabs button{border-left:0!important}

/* /theme/gps/tokens.css */
/* ============================================================
   MOTYW GPS — TOKENY. Jedyne zrodlo wartosci dla calego systemu.
   Nie wpisuj kolorow, rozmiarow ani odstepow na sztywno w modulach.
   ============================================================ */
:root{
  color-scheme:light;
  /* Marka — pomaranczowy WYLACZNIE jako subtelny akcent */
  --orange:#F58220;--orange-dark:#B45C0B;--orange-soft:rgba(245,130,32,.10);
  /* Baza neutralna */
  --bg:#F5F6F8;--ink:#202630;--dark:#202630;--muted:#667085;--line:#E4E7EC;--line-strong:#D0D5DD;
  /* Statusy — stosowane zgodnie ze znaczeniem danych */
  --green:#15966B;--red:#B42318;--amber:#B54708;--neutral:#667085;
  --green-soft:#E6F4EE;--red-soft:#FDECEA;--amber-soft:#FEF6EE;
  /* Powierzchnie (menu boczne i pasek gorny sa biale) */
  --surface:#FFFFFF;--surface-muted:#F5F6F8;--surface-soft:#F0F2F5;--surface-accent:#F2F4F7;
  --header:#FFFFFF;--input:#FFFFFF;--sidebar:#FFFFFF;--sidebar-hover:#F2F4F7;
  --text:#202630;--overlay:rgba(16,24,40,.45);
  /* Typografia */
  --font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --font-mono:ui-monospace,SFMono-Regular,Consolas,monospace;
  --fs-help:12px;--fs-small:13px;--fs-body:14px;--fs-section:16px;--fs-head:18px;--fs-page:22px;
  /* Odstepy: 4 / 8 / 12 / 16 / 24 / 32 */
  --sp-1:4px;--sp-2:8px;--sp-3:12px;--sp-4:16px;--sp-5:24px;--sp-6:32px;
  /* Ksztalt i wysokosci kontrolek */
  --radius-control:8px;--radius-card:12px;--radius-pill:999px;--control-h:40px;
  --shadow-card:0 1px 2px rgba(16,24,40,.04);--shadow-pop:0 8px 24px rgba(16,24,40,.10);
  --app-shadow:0 8px 24px rgba(16,24,40,.10);--focus-ring:0 0 0 3px rgba(245,130,32,.24)
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#14171C;--ink:#E7EAEF;--dark:#E7EAEF;--muted:#98A2B3;--line:#343A44;--line-strong:#434A55;
  --surface:#1B1F25;--surface-muted:#22262D;--surface-soft:#272C34;--surface-accent:#272C34;
  --header:#1B1F25;--input:#14171C;--sidebar:#1B1F25;--sidebar-hover:#272C34;
  --text:#E7EAEF;--overlay:rgba(8,8,8,.68);
  --orange-dark:#F9A25D;
  --green-soft:#163C31;--red-soft:#472A28;--amber-soft:#3D3523;
  --shadow-card:0 1px 2px rgba(0,0,0,.30);--shadow-pop:0 10px 32px rgba(0,0,0,.28);
  --app-shadow:0 10px 32px rgba(0,0,0,.28)
}

/* /theme/gps/base.css */
/* ============ MOTYW GPS — PODSTAWA ============ */
*{box-sizing:border-box;font-family:inherit}
html{accent-color:var(--orange)}
html,body{max-width:100%;overflow-x:hidden}
body{margin:0;font:var(--fs-body)/1.5 var(--font);color:var(--ink);background:var(--bg);letter-spacing:.01em}
button,input,select,textarea,table,dialog,.leaflet-container,.leaflet-popup{font-family:var(--font)}
code,pre,kbd,samp{font-family:var(--font-mono)}
a{color:var(--orange-dark);text-decoration:none}
a:hover{color:var(--orange-dark);text-decoration:underline}
::selection{background:var(--orange-soft);color:var(--ink)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,
textarea:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--orange);outline-offset:2px}
.hidden{display:none!important}

/* /theme/gps/layout.css */
/* ============ MOTYW GPS — UKLAD ============
   Pelna szerokosc okna. Menu boczne + pasek gorny + obszar tresci.
   Kazdy widok renderuje sie w #content. */
.shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh;transition:grid-template-columns .22s ease}
main{min-width:0}
/* Siatka ma tylko menu i tresc. Kazdy inny element wstawiony do #shell (baner, komunikat)
   zajmuje caly wiersz — inaczej wchodzil w kolumne menu i rozsypywal uklad. */
.shell>:not(aside):not(main){grid-column:1/-1}
main,#content,.panel,.card,.table-wrap{min-width:0}
#content{width:100%;min-width:0;padding:var(--sp-5)}

.shell>aside{background:var(--sidebar);color:var(--ink);display:flex;flex-direction:column;border-right:1px solid var(--line)}
.brand{width:100%;height:72px;display:flex;align-items:center;justify-content:center;padding:12px 18px;border-radius:0;border-bottom:1px solid var(--line);background:transparent;color:inherit;cursor:pointer}
.brand:hover,.brand:focus-visible{background:var(--sidebar-hover)}
.shell>aside nav{padding:18px 10px;display:grid;gap:5px}
aside nav button{display:flex;align-items:center;gap:10px;min-height:40px;padding:10px 14px;background:transparent;color:var(--muted);text-align:left;font-size:var(--fs-body);border-left:3px solid transparent;border-radius:0 var(--radius-control) var(--radius-control) 0}
aside nav button:hover{background:var(--sidebar-hover);color:var(--ink)}
aside nav button.active{background:var(--sidebar-hover);color:var(--ink);border-left-color:var(--orange);font-weight:600}
.aside-foot{margin-top:auto;padding:var(--sp-4);color:var(--muted);border-top:1px solid var(--line);font-size:var(--fs-help);text-align:center}

header{height:72px;display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);padding:0 var(--sp-5);background:var(--header);border-bottom:1px solid var(--line)}
header h2{margin:0;min-width:0;overflow:hidden;color:var(--ink);font-size:var(--fs-page);font-weight:650;text-overflow:ellipsis;white-space:nowrap}
.page-heading{display:flex;align-items:center;gap:var(--sp-2);min-width:0;margin-right:auto;margin-left:0}
.header-actions{display:flex;align-items:center;min-width:0;gap:var(--sp-3)}

/* /theme/gps/components.css */
/* ==================================================================
   MOTYW GPS — WSPOLNE KOMPONENTY
   Jedyne zrodlo wygladu zakladek, paneli, przyciskow, pol, tabel,
   etykiet, modali, sciezki nawigacji i paginacji.
   MODUL NIE DEFINIUJE WLASNYCH KOMPONENTOW — dopisuje klase tutaj.
   ================================================================== */

/* ---------- ZAKLADKI (jeden komponent dla calego systemu) ----------
   Kazdy modul mial wlasna implementacje (12 klas, ~94 reguly) i stan
   aktywny rozjechal sie miedzy ekranami. Ponizej JEDNA definicja. */
.gl-tabs,.vehicle-list-tabs,.device-card-tabs,.notification-page-tabs,
.settings-tabs,.settings-cms-tabs,.billing-tabs,.help-topic-tabs,
.legal-tabs,.driver-tabs,.db-action-tabs,.device-subtabs{
  display:flex!important;gap:var(--sp-1);max-width:100%;margin:0;padding:0 14px;
  overflow-x:auto;border:0;border-bottom:1px solid var(--line);
  border-radius:var(--radius-card) var(--radius-card) 0 0;background:var(--surface);
  grid-template-columns:none!important;scrollbar-width:none;-webkit-overflow-scrolling:touch
}
.gl-tabs::-webkit-scrollbar,.vehicle-list-tabs::-webkit-scrollbar,.device-card-tabs::-webkit-scrollbar,
.notification-page-tabs::-webkit-scrollbar,.settings-tabs::-webkit-scrollbar,.settings-cms-tabs::-webkit-scrollbar,
.billing-tabs::-webkit-scrollbar,.help-topic-tabs::-webkit-scrollbar,.legal-tabs::-webkit-scrollbar,
.driver-tabs::-webkit-scrollbar,.db-action-tabs::-webkit-scrollbar,.device-subtabs::-webkit-scrollbar{display:none}

.gl-tabs button,.vehicle-list-tabs button,.device-card-tabs button,.notification-page-tabs button,
.settings-tabs button,.settings-cms-tabs button,.billing-tabs button,.help-topic-tabs button,
.legal-tabs button,.driver-tabs button,.db-action-tabs button,.device-subtabs button{
  flex:0 0 auto;min-width:0;min-height:auto;padding:16px 18px;
  border:0;border-bottom:3px solid transparent;border-radius:0;background:transparent;
  color:var(--muted);font-size:var(--fs-body);font-weight:600;white-space:nowrap
}
.gl-tabs button:hover,.vehicle-list-tabs button:hover,.device-card-tabs button:hover,.notification-page-tabs button:hover,
.settings-tabs button:hover,.settings-cms-tabs button:hover,.billing-tabs button:hover,.help-topic-tabs button:hover,
.legal-tabs button:hover,.driver-tabs button:hover,.db-action-tabs button:hover,.device-subtabs button:hover{
  background:var(--sidebar-hover);color:var(--ink)
}
/* Aktywna zakladka: WYLACZNIE podkreslenie + grafit. Zadnych wypelnien. */
.gl-tabs button.active,.vehicle-list-tabs button.active,.device-card-tabs button.active,.notification-page-tabs button.active,
.settings-tabs button.active,.settings-cms-tabs button.active,.billing-tabs button.active,.help-topic-tabs button.active,
.legal-tabs button.active,.driver-tabs button.active,.db-action-tabs button.active,.device-subtabs button.active{
  border-bottom-color:var(--orange)!important;color:var(--ink)!important;
  background:transparent!important;font-weight:600!important
}
/* Licznik przy zakladce */
.gl-tabs button span,.vehicle-list-tabs button span,.notification-page-tabs button span,
.billing-tabs button span,.settings-tabs button span,.help-topic-tabs button span{
  display:inline-flex;min-width:22px;justify-content:center;margin-left:5px;padding:1px 6px;
  border-radius:var(--radius-pill);background:var(--sidebar-hover);color:var(--muted);font-size:var(--fs-help)
}
.gl-tabs button.active span,.vehicle-list-tabs button.active span,.notification-page-tabs button.active span,
.billing-tabs button.active span,.settings-tabs button.active span,.help-topic-tabs button.active span{
  background:var(--orange);color:#fff
}

/* ---------- PANELE I KARTY ---------- */
.card,.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-card);padding:var(--sp-5);box-shadow:var(--shadow-card)}
.panel{margin-top:var(--sp-4)}
.panel h3{margin:0 0 var(--sp-4);color:var(--ink);font-size:var(--fs-section)}
.panel-head{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-3)}
.card span{color:var(--muted);font-size:var(--fs-small)}
.card strong{display:block;margin-top:var(--sp-2);color:var(--ink);font-size:28px}

/* ---------- PRZYCISKI ---------- */
button{border:0;border-radius:var(--radius-control);padding:10px 16px;cursor:pointer;font-size:var(--fs-body);
  transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease}
.primary,.secondary,.danger{min-height:var(--control-h);font-weight:600}
.primary{background:var(--orange);color:#fff}
.primary:hover{background:var(--orange-dark);box-shadow:var(--shadow-card)}
.secondary{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.secondary:hover{background:var(--sidebar-hover);color:var(--ink)}
.danger{background:var(--red);color:#fff}
.danger:disabled{opacity:.45;cursor:not-allowed}
.danger-link{background:var(--red-soft);color:var(--red)}
.close{background:transparent;color:var(--muted)}
.close:hover{background:var(--sidebar-hover);color:var(--ink)}

/* ---------- POLA FORMULARZY ---------- */
input,select,textarea{width:100%;min-height:var(--control-h);padding:9px 12px;
  border:1px solid var(--line);border-radius:var(--radius-control);
  background:var(--input);color:var(--ink);font-size:var(--fs-body)}
input:focus,select:focus,textarea:focus{border-color:var(--orange);box-shadow:var(--focus-ring)}
input[readonly]{background:var(--surface-muted);color:var(--muted)}
label{display:grid;gap:var(--sp-2);margin:var(--sp-3) 0;color:var(--muted);font-size:var(--fs-small)}
.form-actions{display:flex;justify-content:flex-end;gap:var(--sp-2);margin-top:var(--sp-4)}

/* ---------- TABELE ---------- */
table{width:100%;border-collapse:collapse}
thead{background:var(--surface-muted)}
th,td{padding:12px 14px;border-bottom:1px solid var(--line);text-align:left}
th{color:var(--muted);font-size:var(--fs-help);font-weight:600;text-transform:uppercase;letter-spacing:.02em}
tbody tr{transition:background-color .14s ease}
tbody tr:hover{background:var(--sidebar-hover)}
.table-wrap{width:100%;overflow-x:auto}

/* ---------- ETYKIETY STATUSU ---------- */
.badge{display:inline-block;padding:4px 10px;border-radius:var(--radius-pill);
  background:var(--sidebar-hover);color:var(--muted);font-size:var(--fs-help);font-weight:600}
.badge.online{background:var(--green-soft);color:var(--green)}
.badge.offline{background:var(--red-soft);color:var(--red)}
.badge.inactive{background:var(--sidebar-hover);color:var(--muted)}

/* ---------- IKONY ---------- */
.ui-icon{display:inline-grid;place-items:center;flex:0 0 auto;width:30px;height:30px;
  border-radius:var(--radius-control);background:var(--sidebar-hover);color:var(--muted)}
.ui-icon svg{display:block;width:18px;height:18px}
.ui-menu-icon{width:22px;height:22px;border-radius:6px;background:transparent}

/* ---------- OKNA MODALNE ---------- */
dialog{border:1px solid var(--line);border-radius:var(--radius-card);padding:var(--sp-5);
  width:min(620px,92vw);background:var(--surface);color:var(--ink);box-shadow:var(--shadow-pop)}
dialog::backdrop{background:var(--overlay)}

/* ---------- SCIEZKA NAWIGACJI ---------- */
.gl-breadcrumb{display:flex;align-items:center;gap:var(--sp-2);min-width:0;padding:0;color:var(--muted);font-size:var(--fs-small)}
.gl-breadcrumb button{min-height:auto;padding:0;background:transparent;color:var(--orange-dark);font-size:var(--fs-small);font-weight:600}
.gl-breadcrumb button:hover{text-decoration:underline}
.gl-breadcrumb b{min-width:0;overflow:hidden;color:var(--ink);font-weight:600;text-overflow:ellipsis;white-space:nowrap}

/* ---------- PAGINACJA ---------- */
.pagination,.pager{display:flex;align-items:center;gap:var(--sp-1)}
.pagination button,.pager button{min-height:36px;background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.pagination button.active,.pager button.active{background:var(--orange);color:#fff;border-color:var(--orange)}

/* ---------- BRAK DANYCH (nigdy jako blad) ---------- */
.gl-empty,.vehicle-empty-state,.monitor-empty,.db-empty{padding:var(--sp-6);text-align:center;
  border:1px dashed var(--line-strong);border-radius:var(--radius-control);
  background:var(--surface-muted);color:var(--muted)}

@media(max-width:760px){
  .gl-tabs button,.vehicle-list-tabs button,.device-card-tabs button,.notification-page-tabs button,
  .settings-tabs button,.settings-cms-tabs button,.billing-tabs button,.help-topic-tabs button,
  .legal-tabs button,.driver-tabs button,.db-action-tabs button,.device-subtabs button{padding:13px 13px}
}

/* ---------- PRACA W KONCIE KLIENTA ----------
   Pas ostrzegawczy nad trescia: administrator musi widziec, ze dziala jako klient. */
.gl-impersonation-banner{display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:var(--sp-3);margin:var(--sp-4) var(--sp-5) 0;padding:12px 16px;
  border:1px solid var(--line);border-left:3px solid var(--amber);
  border-radius:var(--radius-control);background:var(--amber-soft);
  color:var(--ink);font-size:var(--fs-small)}
.gl-impersonation-banner b{color:var(--ink)}
@media(max-width:760px){.gl-impersonation-banner{margin:var(--sp-3) var(--sp-3) 0}}

/* ---------- KAFLE WYBORU (np. katalog raportow) ----------
   Siatka dopasowuje liczbe kolumn do szerokosci (bez @media): 1 na telefonie, 3-4 na komputerze. */
.gl-choice-group{margin:0 0 var(--sp-5)}
.gl-choice-group:last-child{margin-bottom:0}
.gl-choice-group h4{margin:0 0 var(--sp-3);color:var(--muted);font-size:var(--fs-small);font-weight:600;letter-spacing:.04em;text-transform:uppercase}
.gl-choice-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:var(--sp-3)}
.gl-choice{display:grid;grid-template-columns:42px minmax(0,1fr);gap:var(--sp-3);align-items:start;min-height:96px;margin:0;padding:var(--sp-4);border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface);color:var(--ink);text-align:left;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}
.gl-choice:hover,.gl-choice:focus-visible{border-color:var(--orange);box-shadow:var(--shadow-card)}
.gl-choice>.ui-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:var(--radius-control);background:var(--orange-soft);color:var(--orange)}
.gl-choice>.ui-icon svg{width:22px;height:22px}
.gl-choice b{display:block;margin-bottom:4px;color:var(--ink);font-size:var(--fs-body);font-weight:650}
.gl-choice small{display:block;color:var(--muted);font-size:var(--fs-help);line-height:1.45}
.gl-choice em{display:inline-block;margin-top:6px;color:var(--orange);font-size:var(--fs-small);font-style:normal;font-weight:600}

/* /theme/gps/responsive.css */
/* ============ MOTYW GPS — WIDOK MOBILNY ============
   PLIK GENEROWANY: python scripts/gen_theme_responsive.py — nie edytuj recznie.
   Ladowany jako OSTATNI plik motywu. layout.css / components.css ustawiaja wyglad
   bez @media i — jako pozniejsze — przykrywaly reguly telefonu/tabletu z plikow
   modulow. Tu przywracamy te reguly (tylko wlasciwosci ustawiane przez motyw),
   w oryginalnej kolejnosci ladowania. Kontrola: tests/test_theme_responsive.py */

@media(max-width:1000px){.shell{grid-template-columns:76px 1fr}}  /* app.css */
@media(max-width:1000px){.brand{padding:12px 8px}}  /* app.css */
@media(max-width:760px){#content{padding:12px}}  /* app.css */
@media(max-width:760px){.shell{grid-template-columns:1fr}}  /* app.css */
@media(max-width:760px){.shell>aside{display:none}}  /* app.css */
@media(max-width:760px){header{padding:0 12px}}  /* app.css */
@media(max-width:760px){.device-card-tabs button{padding:13px 15px}}  /* device-card.css */
@media(max-width:1024px){.device-card-tabs{display:none!important}}  /* device-card.css */
@media(max-width:600px){.vehicle-list-tabs{padding:0 5px}}  /* device-card.css */
@media(max-width:600px){.vehicle-list-tabs button{padding:13px 12px}}  /* device-card.css */
@media(max-width:1024px){.gl-breadcrumb{padding:0}}  /* device-card.css */
@media(max-width:480px){.db-action-tabs{grid-template-columns:1fr 1fr!important}}  /* dashboard-v2.css */
@media (max-width: 640px){.driver-tabs{padding:0 16px}}  /* drivers.css */
@media(max-width:650px){.settings-tabs{padding:0 5px}}  /* settings.css */
@media(max-width:650px){.settings-tabs button{padding:13px 12px}}  /* settings.css */
@media(max-width:680px){.settings-cms-tabs{padding:0 5px}}  /* settings.css */
@media(max-width:680px){.settings-cms-tabs button{padding:12px 11px}}  /* settings.css */
@media(max-width:650px){.settings-tabs{overflow-x:auto}}  /* access-admin.css */
@media(max-width:650px){.settings-tabs button{flex:0 0 auto}}  /* access-admin.css */
@media(max-width:760px){.notification-page-tabs{padding:0 5px}}  /* notifications.css */
@media(max-width:760px){.notification-page-tabs button{padding:13px 12px}}  /* notifications.css */
@media(max-width:760px){.help-topic-tabs{padding:0 5px}}  /* help.css */
@media(max-width:760px){.help-topic-tabs button{padding:13px 11px}}  /* help.css */
@media(max-width:600px){.billing-tabs{padding:0 5px}}  /* billing.css */
@media(max-width:600px){.billing-tabs button{padding:13px 12px}}  /* billing.css */
@media(max-width:700px){.legal-tabs{padding:0 5px}}  /* legal.css */
@media(max-width:700px){.legal-tabs button{padding:13px 12px}}  /* legal.css */
@media(max-width:1024px){.shell{display:block;min-height:100dvh}}  /* theme-responsive.css */
@media(max-width:1024px){.shell>aside{display:flex}}  /* theme-responsive.css */
@media(max-width:1024px){.brand{height:82px;padding:10px 54px 10px 20px}}  /* theme-responsive.css */
@media(max-width:1024px){.shell>aside nav{display:flex;gap:4px;padding:12px 10px}}  /* theme-responsive.css */
@media(max-width:1024px){.aside-foot{margin-top:0;padding:11px 12px;font-size:12px}}  /* theme-responsive.css */
@media(max-width:1024px){header{height:64px;padding:0 14px;background:var(--header)}}  /* theme-responsive.css */
@media(max-width:1024px){.page-heading{min-width:0;gap:7px}}  /* theme-responsive.css */
@media(max-width:1024px){header h2{min-width:0;margin:0;overflow:hidden;font-size:19px;text-overflow:ellipsis;white-space:nowrap}}  /* theme-responsive.css */
@media(max-width:1024px){.header-actions{gap:8px}}  /* theme-responsive.css */
@media(max-width:1024px){#content{width:100%;padding:16px}}  /* theme-responsive.css */
@media(max-width:1024px){dialog{width:min(680px,calc(100vw - 24px));padding:20px}}  /* theme-responsive.css */
@media(max-width:1024px){.table-wrap{width:100%;overflow-x:auto}}  /* theme-responsive.css */
@media(max-width:760px){#content{padding:12px}}  /* theme-responsive.css */
@media(max-width:760px){header{height:60px;padding:0 9px}}  /* theme-responsive.css */
@media(max-width:760px){header h2{font-size:17px}}  /* theme-responsive.css */
@media(max-width:760px){.header-actions{gap:4px}}  /* theme-responsive.css */
@media(max-width:760px){.panel{padding:16px}}  /* theme-responsive.css */
@media(max-width:760px){.card{padding:16px}}  /* theme-responsive.css */
@media(max-width:760px){.panel-head{align-items:flex-start}}  /* theme-responsive.css */
@media(max-width:760px){input{min-height:44px;font-size:16px}}  /* theme-responsive.css */
@media(max-width:760px){select{min-height:44px;font-size:16px}}  /* theme-responsive.css */
@media(max-width:760px){textarea{min-height:44px;font-size:16px}}  /* theme-responsive.css */
@media(max-width:760px){.device-card-tabs{scrollbar-width:thin}}  /* theme-responsive.css */
@media(max-width:760px){.device-card-tabs button{min-height:46px}}  /* theme-responsive.css */
@media(max-width:430px){.brand{height:76px;padding:9px 17px}}  /* theme-responsive.css */
@media(max-width:430px){.shell>aside nav{padding:9px 8px}}  /* theme-responsive.css */
@media(max-width:430px){.aside-foot{padding:8px 10px}}  /* theme-responsive.css */
@media(max-width:760px){.settings-tabs{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}}  /* theme-responsive.css */
@media(max-width:760px){.device-subtabs{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}}  /* theme-responsive.css */
@media(max-width:760px){.settings-tabs button{flex:0 0 auto;min-height:44px}}  /* theme-responsive.css */
@media(max-width:760px){.device-subtabs button{flex:0 0 auto;min-height:44px}}  /* theme-responsive.css */
@media(max-width:760px){.billing-tabs{max-width:100%;gap:2px;padding:0 5px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}}  /* theme-responsive.css */
@media(max-width:760px){.notification-page-tabs{max-width:100%;gap:2px;padding:0 5px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}}  /* theme-responsive.css */
@media(max-width:760px){.settings-tabs{max-width:100%;gap:2px;padding:0 5px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}}  /* theme-responsive.css */
@media(max-width:760px){.vehicle-list-tabs{max-width:100%;gap:2px;padding:0 5px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}}  /* theme-responsive.css */
@media(max-width:760px){.billing-tabs::-webkit-scrollbar{display:none}}  /* theme-responsive.css */
@media(max-width:760px){.notification-page-tabs::-webkit-scrollbar{display:none}}  /* theme-responsive.css */
@media(max-width:760px){.settings-tabs::-webkit-scrollbar{display:none}}  /* theme-responsive.css */
@media(max-width:760px){.vehicle-list-tabs::-webkit-scrollbar{display:none}}  /* theme-responsive.css */
@media(max-width:760px){.billing-tabs button{flex:0 0 auto;min-height:46px;padding:12px 13px;font-size:13px;white-space:nowrap}}  /* theme-responsive.css */
@media(max-width:760px){.notification-page-tabs button{flex:0 0 auto;min-height:46px;padding:12px 13px;font-size:13px;white-space:nowrap}}  /* theme-responsive.css */
@media(max-width:760px){.settings-tabs button{flex:0 0 auto;min-height:46px;padding:12px 13px;font-size:13px;white-space:nowrap}}  /* theme-responsive.css */
@media(max-width:760px){.vehicle-list-tabs button{flex:0 0 auto;min-height:46px;padding:12px 13px;font-size:13px;white-space:nowrap}}  /* theme-responsive.css */
