/* Classic Modern: scoped presentation layer. No Classic/Premium rules are changed. */
body.at-classic-modern { --atm-blue:#145cf0; --atm-ink:#122647; --atm-line:#dbe5f1; --atm-muted:#617590; --atm-green:#08a85b; background:#edf3fa; color:var(--atm-ink); }
.at-classic-modern #header.folded { height:62px; z-index:1030; }
.at-classic-modern #header.folded:before,
.at-classic-modern #header.folded .navbar-brand:before,
.at-classic-modern #header.folded .navbar-brand:after,
.at-classic-modern #header.folded .navbar-nav:before,
.at-classic-modern #header.folded .navbar-nav:after { display:none; }
.at-classic-modern #header .main-navbar { position:relative!important; min-height:62px; height:62px; margin:0; border:0; background:#fff!important; box-shadow:0 3px 18px rgba(20,50,90,.12); }
.at-classic-modern #header .main-navbar .container-fluid { display:flex; align-items:center; height:62px; padding:0 16px; }
.at-classic-modern #header .navbar-header { display:flex; align-items:center; float:none; min-width:0; }
.at-classic-modern #header .navbar-brand { display:flex; align-items:center; max-width:250px; height:58px; margin:0 0 0 12px; padding:9px 0; border:0!important; background:none!important; }
.at-classic-modern #header .navbar-brand img { max-width:185px; max-height:39px; object-fit:contain; }
.at-classic-modern #header .navbar-toggle { display:none!important; }
.atm-menu-toggle { display:none; }
.at-classic-modern .atm-menu-toggle { display:flex; align-items:center; gap:8px; height:40px; padding:0 14px; border:1px solid #dce7f4; border-radius:11px; background:#f4f8ff; color:#0f3f9e; font-size:13px; font-weight:700; box-shadow:0 2px 5px rgba(25,68,125,.07); }
.at-classic-modern .atm-menu-toggle:hover,.at-classic-modern .atm-menu-toggle:focus { background:#e6f0ff; outline:2px solid #b8d4ff; }
.at-classic-modern .atm-menu-toggle .icon { font-size:16px; }
.at-classic-modern #bs-header-navbar-collapse.collapse { display:none!important; }
.at-classic-modern.atm-menu-open #bs-header-navbar-collapse.collapse { display:block!important; position:fixed; top:62px; left:10px; width:min(340px,calc(100vw - 20px)); max-height:calc(100dvh - 73px); overflow-y:auto!important; padding:10px; margin:0; border:1px solid var(--atm-line); border-radius:0 0 16px 16px; background:#fff; box-shadow:0 18px 40px rgba(12,39,85,.25); z-index:2002; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav { display:block; float:none!important; width:100%; margin:0; padding:0; border:0!important; background:transparent!important; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li { display:block; float:none; width:100%; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li>a { display:flex; align-items:center; min-height:44px; padding:10px 12px; border-radius:9px; color:var(--atm-ink); font-weight:600; white-space:normal; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li>a:hover { background:#eff5ff; color:#1153ca; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li>a .icon { width:25px; flex:none; color:#1b62d5; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li>a .text { display:inline!important; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li>a .badge { position:static; margin-left:auto; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li>.dropdown-menu { position:static!important; float:none; width:100%; max-height:none; margin:0 0 6px; padding:3px 0 3px 16px; border:0; border-left:2px solid #b7d1fd; border-radius:0; box-shadow:none; background:#f8fbff; }
.at-classic-modern #bs-header-navbar-collapse .dropdown-menu>li>a { display:flex; align-items:center; gap:8px; padding:9px 12px; color:#264366; white-space:normal; }
.at-classic-modern #bs-header-navbar-collapse .dropdown-menu>li>a .icon { min-width:20px; }
.at-classic-modern #sidebar { width:360px; max-height:calc(100% - 70px); height:calc(100% - 70px); z-index:999; }
.at-classic-modern #sidebar.collapsed { width:0; }
.at-classic-modern #sidebar .sidebar-content { background:#f8fbff; border-right:1px solid var(--atm-line); box-shadow:3px 0 12px rgba(18,49,91,.07); }
.at-classic-modern #sidebar .nav-tabs { padding:7px 8px 0; border-bottom:1px solid var(--atm-line); background:#fff; }
.at-classic-modern #sidebar .nav-tabs>li>a { padding:11px 4px; border:0; border-bottom:3px solid transparent; color:#60718b; font-weight:700; }
.at-classic-modern #sidebar .nav-tabs>li.active>a { color:var(--atm-blue); border-bottom-color:var(--atm-blue); background:#f5f9ff; }
.at-classic-modern #sidebar .tab-pane-header { padding:10px 12px; background:#fff; border-bottom:1px solid var(--atm-line); }
.at-classic-modern #sidebar .tab-pane-header .form-control { height:39px; border:1px solid var(--atm-line); border-radius:10px; background:#f8fbff; box-shadow:none; }
.at-classic-modern #sidebar .tab-pane-header .btn { height:39px; border-radius:9px; }
.at-classic-modern #sidebar .group-heading { background:#eaf2ff; color:#173a6e; font-weight:700; }
.at-classic-modern #sidebar .group-list { display:block; background:#f8fbff; }
.at-classic-modern #sidebar .group-list>li[data-device-id] { display:grid; grid-template-columns:25px 55px minmax(0,1fr) auto; gap:7px; align-items:start; width:100%; min-height:124px; padding:10px 8px; margin:5px 0; border:1px solid var(--atm-line); border-left:3px solid transparent; border-radius:12px; background:#fff; box-shadow:0 2px 7px rgba(25,58,103,.05); }
.at-classic-modern #sidebar .group-list>li[data-device-id].active { border-left-color:var(--atm-blue); background:#edf5ff; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.checkbox { display:block; width:25px; padding:11px 0 0; margin:0; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.atm-vehicle-icon,
.at-classic-modern #sidebar .group-list>li[data-device-id]>.atm-vehicle-fallback { grid-column:2; display:flex; align-items:center; justify-content:center; width:54px; height:54px; object-fit:contain; border-radius:11px; background:#eef5ff; color:#2364ca; font-size:27px; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.name { display:block; width:auto; max-width:none; min-width:0; padding:0; overflow:visible; white-space:normal; cursor:pointer; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.name>[data-device=name] { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:800; color:#122b51; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.name>[data-device=time] { display:none; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.name>[data-device=time]:has(a) { display:block; }
.at-classic-modern .atm-times { display:flex; flex-direction:column; gap:2px; margin-top:3px; font-size:10px; line-height:1.28; color:#526a8a; }
.at-classic-modern .atm-times b { color:#254e83; font-weight:700; }
.at-classic-modern .atm-times time { white-space:nowrap; }
.at-classic-modern .atm-address { display:flex; gap:4px; align-items:flex-start; margin-top:4px; font-size:10px; line-height:1.25; color:#57708e; }
.at-classic-modern .atm-address>span { overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.at-classic-modern .atm-address .icon { flex:none; color:#e63e67; margin-top:1px; }
.at-classic-modern .atm-health { display:flex; flex-wrap:wrap; gap:3px; margin-top:6px; }
.at-classic-modern .atm-health>[data-atm-kind] { display:inline-flex; align-items:center; gap:2px; padding:2px 4px; border-radius:6px; border:1px solid #d9e2ee; background:#f1f4f8; color:#748397; font-size:10px; line-height:1.2; }
.at-classic-modern .atm-health>[data-atm-kind] small { font-size:8px; font-weight:700; }
.at-classic-modern .atm-health>[data-atm-state=on] { border-color:#b4e8cc; background:#e2f8eb; color:#07854e; }
.at-classic-modern .atm-health>[data-atm-state=off] { border-color:#ffd1d6; background:#fff0f1; color:#d93e54; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.details { display:flex; flex-direction:column; align-items:flex-end; gap:6px; width:auto; padding:0; white-space:nowrap; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.details>* { margin:0; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.details>[data-device=speed] { color:#1454b5; font-size:12px; font-weight:800; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.details>[data-device=detect_engine] { display:none; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.details>[data-device=status] { width:8px; height:8px; }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.details .btn-group { margin-top:auto; }
.at-classic-modern #map-controls .btn { width:38px; height:38px; line-height:38px; border-radius:9px; box-shadow:0 2px 9px rgba(24,47,82,.16); }
.at-classic-modern #bottombar { max-width:100%; }
.at-classic-modern.atm-menu-open::before { content:""; position:fixed; inset:62px 0 0; z-index:1020; background:rgba(9,29,61,.26); }
.at-classic-modern #widgets { width:max-content; max-width:100%; border-radius:16px 16px 0 0; box-shadow:0 -5px 24px rgba(15,40,78,.16); }
.at-classic-modern #widgets.collapsed .widgets-content { padding-top:0; padding-bottom:0; }
.at-classic-modern #widgets .widgets-content { padding:8px 10px 0; background:#f5f9ff; }
.at-classic-modern #widgets .widget { margin:0 4px 8px 0; border:1px solid var(--atm-line); border-radius:11px; overflow:hidden; background:#fff; box-shadow:0 2px 8px rgba(20,47,86,.05); }
.at-classic-modern #widgets .widget-heading { background:#f0f6ff; color:#163960; font-weight:700; }
.at-classic-modern #widgets .widget-title .icon { color:#0c9f68; }
.at-classic-modern #widgets .widget-body { background:#fff; }
.at-classic-modern #widgets .btn-collapse { right:24px; z-index:5; border-radius:10px 10px 0 0; }
@media (max-width:700px) {
  .at-classic-modern #header.folded,.at-classic-modern #header .main-navbar,.at-classic-modern #header .main-navbar .container-fluid { height:54px; min-height:54px; }
  .at-classic-modern #header .main-navbar .container-fluid { padding:0 8px; }
  .at-classic-modern #header .navbar-brand { max-width:135px; height:50px; margin-left:6px; }
  .at-classic-modern #header .navbar-brand img { max-width:125px; max-height:32px; }
  .at-classic-modern .atm-menu-toggle { width:39px; height:39px; justify-content:center; padding:0; }
  .at-classic-modern .atm-menu-label { display:none; }
  .at-classic-modern.atm-menu-open #bs-header-navbar-collapse.collapse { top:54px; }
  .at-classic-modern.atm-menu-open::before { top:54px; }
  .at-classic-modern #sidebar { width:min(88vw,360px); max-height:calc(100% - 54px); height:calc(100% - 54px); }
  .at-classic-modern #sidebar.collapsed { width:0; }
  .at-classic-modern #sidebar .btn-collapse { min-width:26px; min-height:54px; top:38%; }
  .at-classic-modern #sidebar .tab-pane-body { padding:4px; }
  .at-classic-modern #sidebar .group-list>li[data-device-id] { min-height:115px; }
  .at-classic-modern #widgets .widgets-content { max-height:36dvh; overflow-x:auto; overflow-y:auto; white-space:nowrap; }
  .at-classic-modern #widgets .widget { max-width:calc(100vw - 20px); }
  .at-classic-modern #widgets .btn-collapse { right:calc(50% - 24px); }
  .at-classic-modern #map-controls { right:4px; top:78px; }
  .at-classic-modern #map-controls .btn { width:37px; height:37px; line-height:37px; }
}
@media (max-width:390px) {
  .at-classic-modern #sidebar .group-list>li[data-device-id] { grid-template-columns:20px 43px minmax(0,1fr) auto; gap:4px; padding:8px 5px; }
  .at-classic-modern #sidebar .group-list>li[data-device-id]>.atm-vehicle-icon,
  .at-classic-modern #sidebar .group-list>li[data-device-id]>.atm-vehicle-fallback { width:42px; height:42px; }
  .at-classic-modern .atm-times,.at-classic-modern .atm-address { font-size:9px; }
}

/* Keep folded navigation closed until the three-line button opens it. */
body.at-classic-modern #header.folded #bs-header-navbar-collapse.collapse { display:none!important; }
body.at-classic-modern.atm-menu-open #header.folded #bs-header-navbar-collapse.collapse { display:block!important; height:auto!important; overflow-x:hidden!important; overflow-y:auto!important; }
.at-classic-modern .atm-menu-toggle { width:42px; height:42px; justify-content:center; padding:0; flex:none; font-size:19px; }
.at-classic-modern .atm-menu-label { display:none!important; }
.at-classic-modern .atm-menu-toggle .icon { font-size:20px; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li>a { height:auto!important; line-height:1.35!important; margin:2px 0; padding:8px 10px!important; border:1px solid transparent; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li>a:hover,
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li.open>a { border-color:#dbe9ff; background:#edf5ff; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li>a .icon { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; min-width:32px; margin-right:9px; border-radius:9px; background:#eaf2ff; color:#145cd0; font-size:17px; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li.language-selection>a .icon { background:#f5f8fc; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li.language-selection img { max-width:24px; max-height:20px; padding:0; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li.dropdown:not(.open)>.dropdown-menu { display:none!important; }
.at-classic-modern #bs-header-navbar-collapse .navbar-nav>li.dropdown.open>.dropdown-menu { display:block!important; }
.at-classic-modern #bs-header-navbar-collapse .dropdown-menu>li>a:hover { background:#e9f3ff; color:#0d55b7; }
.at-classic-modern #bs-header-navbar-collapse .dropdown-menu>li>a .icon { color:#2468c6; }

/* Status buttons only filter the Classic Modern list; native device actions stay intact. */
.at-classic-modern .atm-status-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin-top:9px; }
.at-classic-modern .atm-status-filters button { min-width:0; min-height:43px; padding:4px 2px; border:1px solid #d7e4f4; border-radius:9px; background:#f9fbff; color:#405b7e; font-size:10px; line-height:1.12; cursor:pointer; }
.at-classic-modern .atm-status-filters button span { display:block; margin-top:3px; color:#152e55; font-size:14px; font-weight:800; }
.at-classic-modern .atm-status-filters button[data-atm-filter=all] { border-color:#a9caff; color:#145cf0; }
.at-classic-modern .atm-status-filters button[data-atm-filter=moving] { border-color:#a5e8c4; color:#068b50; }
.at-classic-modern .atm-status-filters button[data-atm-filter=stopped] { border-color:#ffc2c9; color:#d13b4a; }
.at-classic-modern .atm-status-filters button[data-atm-filter=idle] { border-color:#f6dca9; color:#b56a0b; }
.at-classic-modern .atm-status-filters button[data-atm-filter=offline] { border-color:#d5dce7; color:#64738a; }
.at-classic-modern .atm-status-filters button[data-atm-filter=expired] { border-color:#dfc4ff; color:#7d43c7; }
.at-classic-modern .atm-status-filters button[aria-pressed=true] { box-shadow:inset 0 0 0 2px currentColor,0 2px 7px rgba(16,64,123,.08); background:#fff; }
.at-classic-modern #sidebar li.atm-filter-hidden { display:none!important; }

/* Keep native widgets, but shrink their tray to the configured widgets. */
.at-classic-modern #widgets .widgets-content { width:max-content; max-width:100%; overflow-x:auto; box-sizing:border-box; }
.at-classic-modern #widgets.collapsed { width:58px; box-shadow:none; }
.at-classic-modern #widgets.collapsed .widgets-content { display:none; }
.at-classic-modern #widgets .btn-collapse { display:flex; align-items:center; justify-content:center; width:48px; height:26px; right:12px; left:auto; bottom:100%; line-height:1; border:1px solid #cbdcf1; border-bottom:0; border-radius:12px 12px 0 0; background:#fff; color:#1657ac; box-shadow:0 -3px 10px rgba(18,55,104,.15); }
.at-classic-modern #widgets .btn-collapse:before,.at-classic-modern #widgets .btn-collapse:after { display:none!important; }
.at-classic-modern #widgets .btn-collapse i { display:block; width:9px; height:9px; margin-top:4px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); }
.at-classic-modern #widgets .btn-collapse i:before { content:none!important; }
.at-classic-modern #widgets.collapsed .btn-collapse i { margin-top:0; transform:rotate(225deg); }
.at-classic-modern #widgets .btn-collapse:hover,.at-classic-modern #widgets .btn-collapse:focus { background:#ebf4ff; outline:2px solid #bdd8ff; }
@media (max-width:700px) {
  .at-classic-modern #widgets .widgets-content { max-width:calc(100vw - 8px); }
  .at-classic-modern #widgets .btn-collapse { right:calc(50% - 24px); }
}
/* Classic Modern v1.3 reference header. Existing Classic/Premium headers stay unchanged. */
.at-classic-modern #header .main-navbar .container-fluid { gap:12px; min-width:0; }
.at-classic-modern #header .navbar-header { flex:none; }
.at-classic-modern .atm-top-search { display:flex; align-items:center; flex:1 1 420px; min-width:145px; max-width:540px; height:44px; margin:0 0 0 10px; border:1px solid #ccdff9; border-radius:11px; background:#f7faff; box-shadow:inset 0 1px 3px rgba(20,58,117,.06); overflow:hidden; }
.at-classic-modern .atm-top-search>.icon { flex:none; width:43px; text-align:center; color:#145cf0; font-size:18px; }
.at-classic-modern .atm-top-search input { flex:1; min-width:0; height:100%; padding:0 6px; border:0; outline:0; background:transparent; color:#17365e; font-size:13px; }
.at-classic-modern .atm-top-search input::placeholder { color:#58749d; opacity:1; }
.at-classic-modern .atm-top-search button { display:flex; align-items:center; justify-content:center; flex:none; width:49px; height:44px; padding:0; border:0; background:#1166f7; color:#fff; font-size:21px; cursor:pointer; }
.at-classic-modern .atm-top-search button:hover,.at-classic-modern .atm-top-search button:focus { background:#084fcb; outline:2px solid #91baff; }
.at-classic-modern .atm-top-actions { display:flex; align-items:center; gap:8px; margin-left:auto; white-space:nowrap; }
.at-classic-modern .atm-top-actions>a { display:flex; align-items:center; justify-content:center; gap:9px; min-width:102px; height:44px; padding:0 13px; border:1px solid #d0e0f5; border-radius:10px; background:#fff; color:#17345e; font-size:12px; font-weight:700; text-decoration:none; box-shadow:0 2px 8px rgba(18,62,125,.08); }
.at-classic-modern .atm-top-actions>a .icon { color:#1667e8; font-size:19px; }
.at-classic-modern .atm-top-actions>a:hover,.at-classic-modern .atm-top-actions>a:focus { border-color:#9dc7ff; background:#eef6ff; }
.at-classic-modern .atm-top-actions>a[data-atm-section=geofence] .icon { color:#0dad5d; }
.at-classic-modern .atm-top-actions>a[data-atm-section=routes] .icon { color:#8d31d3; }
.at-classic-modern .atm-top-actions>a.is-active { border-color:#1466f1; background:#1466f1; color:#fff; }
.at-classic-modern .atm-top-actions>a.is-active .icon { color:#fff; }
.at-classic-modern .atm-top-logout { display:flex; align-items:center; justify-content:center; flex:none; width:46px; height:46px; margin-left:5px; border-radius:50%; background:#ee132e; color:#fff; font-size:23px; text-decoration:none; box-shadow:0 3px 9px rgba(217,27,54,.25); }
.at-classic-modern .atm-top-logout:hover,.at-classic-modern .atm-top-logout:focus { background:#c81026; color:#fff; outline:2px solid #ffb6c0; }
.at-classic-modern .atm-drawer-shortcuts { display:none; }
.at-classic-modern .atm-top-search:focus-within { border-color:#6fa8ff; box-shadow:0 0 0 3px rgba(57,125,241,.13); }

/* The sidebar and widget handles use the same chevron language at every width. */
.at-classic-modern #sidebar>.btn-collapse { display:flex; align-items:center; justify-content:center; width:26px; height:52px; min-width:26px; min-height:52px; left:100%; right:auto; top:42%; line-height:1; border:1px solid #cbdcf1; border-left:0; border-radius:0 11px 11px 0; background:#fff; color:#1657ac; box-shadow:3px 0 10px rgba(18,55,104,.14); }
.at-classic-modern #sidebar>.btn-collapse:before,.at-classic-modern #sidebar>.btn-collapse:after { display:none!important; }
.at-classic-modern #sidebar>.btn-collapse i { display:block; width:9px; height:9px; margin-left:4px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(135deg); }
.at-classic-modern #sidebar>.btn-collapse i:before { content:none!important; }
.at-classic-modern #sidebar.collapsed>.btn-collapse i { margin-left:0; transform:rotate(315deg); }
.at-classic-modern #sidebar>.btn-collapse:hover,.at-classic-modern #sidebar>.btn-collapse:focus { background:#ebf4ff; outline:2px solid #bdd8ff; }
.at-classic-modern #widgets>.btn-collapse { right:12px; }

@media (min-width:701px) {
  .at-classic-modern #header.folded,.at-classic-modern #header .main-navbar,.at-classic-modern #header .main-navbar .container-fluid { height:70px; min-height:70px; }
  .at-classic-modern #header .navbar-brand { height:66px; }
  .at-classic-modern.atm-menu-open #bs-header-navbar-collapse.collapse { top:70px; }
  .at-classic-modern.atm-menu-open::before { inset:70px 0 0; }
}
@media (max-width:1190px) and (min-width:761px) {
  .at-classic-modern .atm-top-actions>a { min-width:44px; width:44px; padding:0; }
  .at-classic-modern .atm-top-actions>a>span:last-child { display:none; }
  .at-classic-modern .atm-top-search { margin-left:0; }
}
@media (max-width:760px) {
  .at-classic-modern #header .main-navbar .container-fluid { gap:7px; }
  .at-classic-modern .atm-top-actions { display:none; }
  .at-classic-modern .atm-top-search { margin-left:auto; max-width:none; }
  .at-classic-modern .atm-top-logout { width:40px; height:40px; margin-left:0; font-size:19px; }
  .at-classic-modern .atm-drawer-shortcuts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin:0 0 9px; padding:0 0 9px; border-bottom:1px solid #dce8f7; }
  .at-classic-modern .atm-drawer-shortcuts a { display:flex; align-items:center; gap:7px; min-height:39px; padding:7px 9px; border:1px solid #d9e6f5; border-radius:9px; background:#f7fbff; color:#174879; font-size:12px; font-weight:700; text-decoration:none; }
  .at-classic-modern .atm-drawer-shortcuts a .icon { color:#1269d8; font-size:17px; }
  .at-classic-modern .atm-drawer-shortcuts a:hover { background:#eaf4ff; }
  .at-classic-modern #sidebar>.btn-collapse { top:42%; width:26px; height:52px; min-width:26px; min-height:52px; }
  .at-classic-modern #widgets>.btn-collapse { right:12px; }
}
@media (max-width:480px) {
  .at-classic-modern .atm-top-search { flex:0 0 42px; min-width:42px; width:42px; height:40px; border-color:transparent; background:transparent; box-shadow:none; overflow:visible; }
  .at-classic-modern .atm-top-search>.icon,.at-classic-modern .atm-top-search input { display:none; }
  .at-classic-modern .atm-top-search button { width:42px; height:40px; border-radius:9px; font-size:19px; }
  .at-classic-modern.atm-search-open .atm-top-search { position:fixed; z-index:4; top:56px; left:8px; right:8px; width:auto; height:44px; border-color:#9ac6ff; background:#fff; box-shadow:0 5px 20px rgba(20,51,100,.25); }
  .at-classic-modern.atm-search-open .atm-top-search>.icon { display:block; }
  .at-classic-modern.atm-search-open .atm-top-search input { display:block; }
  .at-classic-modern.atm-search-open .atm-top-search button { height:43px; border-radius:0 9px 9px 0; }
  .at-classic-modern #header .navbar-brand { max-width:115px; }
  .at-classic-modern #header .navbar-brand img { max-width:107px; }
}
/* Classic Modern v1.4: keep History date/time controls and result timestamps within the sidebar. */
.at-classic-modern #history_tab #history-form .form-group .input-group { display:flex; width:100%; min-width:0; }
.at-classic-modern #history_tab #history-form .form-group .input-group>.datepicker { flex:1 1 auto; width:0; min-width:0; }
.at-classic-modern #history_tab #history-form .form-group .input-group>.input-group-btn { display:block; flex:0 0 92px; width:92px; min-width:92px; margin-left:5px; }
.at-classic-modern #history_tab #history-form .form-group .input-group>.input-group-btn .bootstrap-select,
.at-classic-modern #history_tab #history-form .form-group .input-group>.input-group-btn .form-control,
.at-classic-modern #history_tab #history-form .form-group .input-group>.input-group-btn .btn { width:100%!important; min-width:0; box-sizing:border-box; }
.at-classic-modern #history_tab #history-form .form-group .input-group>.input-group-btn .filter-option { overflow:hidden; text-overflow:ellipsis; }
.at-classic-modern #ajax-history .history td:last-child { min-width:0; }
.at-classic-modern #ajax-history .history td:last-child>.row:first-child { display:flex; flex-wrap:wrap; gap:3px 9px; margin:0; }
.at-classic-modern #ajax-history .history td:last-child>.row:first-child>.datetime,
.at-classic-modern #ajax-history .history td:last-child>.row:first-child>.duration { float:none!important; flex:1 1 100%; width:auto!important; min-width:0; padding:0; }
.at-classic-modern #ajax-history .history .datetime { display:flex; flex-wrap:wrap; gap:2px 5px; align-items:baseline; overflow-wrap:anywhere; }
.at-classic-modern #ajax-history .history .duration { display:flex; flex-wrap:wrap; gap:3px 6px; overflow-wrap:anywhere; }
.at-classic-modern #ajax-history .history td:last-child>.row:not(:first-child) { margin:4px 0 0; overflow-wrap:anywhere; }
.at-classic-modern #ajax-history .history td:last-child>.row:not(:first-child)>div { float:none; width:100%; padding:0; }
.at-classic-modern #ajax-history .history td:last-child>.row:not(:first-child) br { display:none; }

/* v1.5: keep the History date and time controls inside the sidebar at every width. */
.at-classic-modern #history_tab #history-form>.form-group:nth-child(2)>.col-xs-9,
.at-classic-modern #history_tab #history-form>.form-group:nth-child(3)>.col-xs-9 { min-width:0; padding-left:5px; padding-right:3px; }
.at-classic-modern #history_tab #history-form>.form-group:nth-child(2) .input-group,
.at-classic-modern #history_tab #history-form>.form-group:nth-child(3) .input-group { display:grid!important; grid-template-columns:minmax(0,1fr) 78px; gap:5px; width:100%; min-width:0; }
.at-classic-modern #history_tab #history-form>.form-group:nth-child(2) .input-group>.datepicker,
.at-classic-modern #history_tab #history-form>.form-group:nth-child(3) .input-group>.datepicker { display:block; width:100%!important; min-width:0; float:none; box-sizing:border-box; }
.at-classic-modern #history_tab #history-form>.form-group:nth-child(2) .input-group>.input-group-btn,
.at-classic-modern #history_tab #history-form>.form-group:nth-child(3) .input-group>.input-group-btn { display:block; width:78px!important; min-width:0!important; max-width:78px; margin:0; }
.at-classic-modern #history_tab #history-form .timeselect,
.at-classic-modern #history_tab #history-form .input-group-btn .bootstrap-select,
.at-classic-modern #history_tab #history-form .input-group-btn .bootstrap-select>.btn { width:100%!important; max-width:100%; min-width:0!important; box-sizing:border-box; }
.at-classic-modern #history_tab #history-form .input-group-btn .filter-option { max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Native Today History action; permissions remain the same as the dropdown action. */
.at-classic-modern #sidebar .group-list>li[data-device-id]>.details>.atm-history-play { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; min-width:28px; border:1px solid #bad1ff; border-radius:8px; background:#eaf2ff; color:#145cf0; cursor:pointer; font-size:12px; box-shadow:0 1px 4px rgba(20,92,240,.1); }
.at-classic-modern #sidebar .group-list>li[data-device-id]>.details>.atm-history-play:hover,
.at-classic-modern #sidebar .group-list>li[data-device-id]>.details>.atm-history-play:focus-visible { background:#145cf0; color:#fff; outline:2px solid #9bc0ff; }

/* Selection tail is cosmetic; preserve native History route and other map overlays. */
.at-classic-modern .leaf-device-tail { display:none!important; }
