:root { --dock-width: 490px; --header-height: 52px; --footer-height: 58px; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { height: 100dvh; display: grid; grid-template-rows: var(--header-height) minmax(0, 1fr) var(--footer-height); background: #eaf0f3; }
body > main, .page-footer { display: none; }
.topbar { grid-row: 1; min-height: 0; height: 100%; padding: 8px 18px; gap: 18px; }
.brand { font-size: 1.4rem; }
.product-title { font-size: .82rem; }
.product-title span { display: none; }
#profile-info { color: #c4dcdf; }
#operation-layout { grid-row: 2; min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--dock-width); }
#map-stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; overflow: hidden; }
#map-stage .map-toolbar { position: static; margin: 0; border: 0; border-radius: 0; background: #f7fafb; padding: 8px 12px; min-height: 47px; gap: 8px; }
#map-stage .map-toolbar > div:first-child { display: none; }
.map-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 7px; }
#dock-toggle { margin-left: auto; }
#map-stage .map-wrap { min-height: 0; height: 100%; border: 0; border-radius: 0; }
#map { width: 100%; height: 100%; min-height: 0; border-radius: 0; }
.map-pane { display: none; }
.leaflet-control-attribution { max-width: 100%; font-size: 9px; }
.map-legend { position: absolute; bottom: 24px; left: 10px; right: auto; max-width: calc(100% - 20px); padding: 5px 8px; border: 1px solid #dce6e9; border-radius: 5px; background: #fffffff0; font-size: .66rem; }
#route-points { display: none; }
.map-instruction { top: 12px; left: 65px; right: 12px; font-size: .8rem; }
#operations-dock { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-left: 1px solid #cddce2; background: #f2f6f8; }
.dock-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.dock-heading .eyebrow { font-size: .6rem; letter-spacing: .13em; color: #7c909a; }
.dock-heading strong { color: #234957; font-size: 1rem; }
.workspace-nav { display: flex; flex-wrap: nowrap; flex-shrink: 0; overflow-x: auto; overflow-y: hidden; min-width: 0; margin: 0; padding: 0 8px; background: #fff; scrollbar-width: thin; }
.view-tab { flex: 0 0 auto; padding: 11px 10px; font-size: .77rem; white-space: nowrap; }
.nav-short { display: none; }
.workspace-tools { display: flex; flex-shrink: 0; gap: 7px; padding: 9px 12px; border-bottom: 1px solid #dce6eb; background: #f7fafb; }
.workspace-tools .button { font-size: .73rem; min-width: 0; }
.workspace-tools .active, .workspace-tools [aria-pressed='true'] { background: #dcefed; border-color: #89c1ba; }
#workspace-unread { padding: 1px 4px; border-radius: 4px; background: #dfebef; font-size: .65rem; }
#dock-content { flex: 1; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.workspace, .drivers-view, .zones-view, .documentation-view, #view-dispatch { position: static; display: block; width: auto; margin: 0; padding: 12px; height: auto; min-width: 0; }
.fleet-main, .drivers-main, .zones-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.records-panel, .driver-activity-section { box-shadow: none; }
.records-heading { padding: 13px; gap: 8px; }
.records-heading h1 { font-size: 1rem; }
.records-heading p { font-size: .75rem; line-height: 1.5; }
.records-scroll { max-height: 56dvh; overflow: auto; }
.records-table { font-size: .78rem; }
.records-table th, .records-table td { padding: 10px; font-size: .78rem; }
.records-table thead { position: sticky; top: 0; z-index: 3; }
.records-table .identity-cell { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 150px; box-shadow: 1px 0 #dde6ea; }
.records-table thead .identity-cell { z-index: 4; background: #f8fafb; }
.record-row[aria-selected='true'] .identity-cell { background: #ecf6f5; }
.fleet-records { min-width: 1010px; }
.fleet-records .identity-cell { width: 155px; }
.fleet-records .column-activity { width: 150px; }
.fleet-records .column-speed { width: 80px; }
.driver-records { min-width: 1010px; }
.fleet-records th, .fleet-records td, .driver-records th, .driver-records td { display: table-cell !important; }
.mobile-record-summary { display: none !important; }
.mobile-details-toggle { display: inline-flex; }
.fleet-search { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 7px; padding: 0 12px 10px; }
.fleet-search input, .fleet-search select { font-size: .78rem; }
#fleet-search-count { grid-column: 1 / -1; font-size: .67rem; color: #718995; }
#inspector-dock, #journal-dock, #demo-dock, #live-demo-panel { display: none; }
#inspector-dock > .detail-panel { display: none; position: static; width: auto; height: auto; max-height: none; margin: 12px; overflow: visible; box-shadow: none; }
body[data-dock-page='details'] #inspector-dock { display: block; }
body[data-dock-page='details'][data-inspector='fleet'] #fleet-details, body[data-dock-page='details'][data-inspector='drivers'] #driver-details, body[data-dock-page='details'][data-inspector='zones'] #zone-details { display: block !important; }
body[data-dock-page='journal'] #journal-dock, body[data-dock-page='demo'] #demo-dock, body[data-dock-page='demo'] #live-demo-panel:not([hidden]) { display: block; }
body:not([data-dock-page='list']) #dock-content > .workspace, body:not([data-dock-page='list']) #dock-content > .drivers-view, body:not([data-dock-page='list']) #dock-content > .zones-view, body:not([data-dock-page='list']) #dock-content > .documentation-view, body:not([data-dock-page='list']) #view-dispatch { display: none !important; }
.inspector-close { margin-bottom: 16px; }
#journal-dock { margin: 12px; }
#journal-dock .journal { padding: 13px; border-radius: 8px; border: 1px solid #dce6eb; }
#journal-dock .journal-heading { flex-wrap: wrap; gap: 8px; }
#journal-dock .event-list { height: auto; max-height: none; min-height: 150px; }
#demo-journal { margin: 12px; }
#demo-journal > h3 { margin: 20px 0 12px; }
#demo-journal .journal { padding: 13px; border: 1px solid #dce6eb; border-radius: 8px; background: #fff; }
#demo-journal .event-list { height: auto; max-height: none; min-height: 100px; }
#demo-journal .journal-heading { flex-wrap: wrap; gap: 8px; }
.workspace-empty { margin: 12px; padding: 20px; background: #fff; border: 1px solid #dce6eb; border-radius: 8px; }
.workspace-empty h2 { font-size: 1rem; }
.workspace-empty p { margin: 12px 0; font-size: .85rem; line-height: 1.7; }
.camera-bar { display: flex; align-items: center; flex-wrap: nowrap; min-width: 0; gap: 9px; padding: 7px 12px; border-top: 1px solid #d5e1e6; background: #f7fafb; }
.camera-bar strong { flex-shrink: 0; font-size: .78rem; color: #345b6b; }
.camera-bar select { width: 182px; flex: 0 1 182px; min-height: 32px; font-size: .78rem; }
.camera-bar .button { flex-shrink: 0; min-height: 32px; font-size: .75rem; }
#camera-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #5b7d83; font-size: .75rem; }
.camera-bar[data-paused='true'] #camera-status { color: #a4712c; }
.form-actions { position: sticky; bottom: 0; z-index: 8; margin-top: 12px; padding: 9px 0 3px; background: #fff; border-top: 1px solid #dfe8eb; }
.form-actions .button { margin: 0; }
.plan-section-title { margin-top: 24px; }
#stop-history-section { margin-top: 20px; }
#fleet-details[data-panel='plan'] .tachograph-panel, #fleet-details[data-panel='plan'] .driver-time { display: none; }
#panel-plan > h3:first-child { margin: 15px 0 8px; }
.event p { font-size: .78rem; }
.live-demo-panel { position: static; width: auto; max-height: none; margin: 12px; padding: 14px; }
.live-demo-heading { flex-wrap: wrap; gap: 10px; }
.live-demo-heading .demo-controls { width: 100%; flex-wrap: wrap; }
.zones-view .autonomy-fields { grid-template-columns: minmax(0, 1fr); }
.zones-view .autonomy-types { display: grid; gap: 9px; }
.zones-view .records-scroll { max-height: 300px; }
.zones-view h1 { font-size: 1rem; }
.documentation-view { background: transparent; }
.docs-hero { padding: 18px; }
.docs-navigation { position: static; }
.docs-hero h1 { font-size: 1.45rem; }
.docs-grid { grid-template-columns: minmax(0, 1fr); }
.docs-layout, .docs-hero { grid-template-columns: minmax(0, 1fr); }
.docs-navigation { max-height: none; }
.docs-navigation nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doc-section { padding: 18px; }
.docs-flow, .docs-adapter-diagram { grid-template-columns: minmax(0, 1fr); }
.demo-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tachograph-panel { padding: 12px; margin: 14px 0; border: 1px solid #dce6eb; border-radius: 7px; background: #f7fafb; }
.tachograph-panel h3 { margin-bottom: 9px; }
.tachograph-panel .hint { font-size: .74rem; line-height: 1.6; }
.card-badge { display: inline-block; margin-top: 4px; padding: 2px 5px; border-radius: 4px; color: #9d5e21; background: #fff1df; font-size: .67rem; }
.card-badge.ok { color: #2a725b; background: #e8f4ed; }
.tacho-status, .rest-reason { padding: 10px; border-radius: 5px; background: #edf4f7; color: #456773; font-size: .78rem; line-height: 1.7; }
.rest-reason { margin-top: 10px; background: #fff4df; color: #8c642d; }
.activity-card_wait { background: #ad7135; }
.simulation-bar { grid-row: 3; margin: 0; display: flex; flex-wrap: nowrap; min-width: 0; height: 100%; padding: 8px 14px; gap: 12px; overflow: auto hidden; border-top: 1px solid #cfdee4; background: #fff; scrollbar-width: thin; }
.simulation-bar > *, .playback { flex-shrink: 0; }
.clock-block { min-width: 155px; }
.clock-block .eyebrow { font-size: .6rem; }
.clock-block strong { font-size: .82rem; white-space: nowrap; }
.playback { flex-wrap: nowrap; align-items: center; gap: 7px; }
.speed-label span { display: none; }
.simulation-bar select { width: 145px; font-size: .75rem; }
.simulation-bar .button { min-height: 34px; font-size: .76rem; white-space: nowrap; }
.simulation-bar > .quiet { margin-left: auto; }
body.wide-dock { --dock-width: min(1000px, 68vw); }
body.map-only #operation-layout { grid-template-columns: minmax(0, 1fr); }
body.map-only #operations-dock { display: none; }
.toast { position: static; flex-shrink: 0; width: auto; max-width: none; margin: 0; left: auto; bottom: auto; transform: none; border-radius: 0; padding: 10px 14px; box-shadow: none; font-size: .82rem; line-height: 1.6; z-index: auto; }
.dispatch-card { padding: 16px; margin-bottom: 12px; border: 1px solid #dce6eb; border-radius: 8px; background: #fff; }
.dispatch-card h2 { font-size: 1rem; margin-bottom: 9px; }
.dispatch-card .field { margin-top: 13px; }
.dispatch-card .hint { margin: 8px 0 12px; }
.dispatch-status { padding: 10px; margin: 12px 0; background: #eaf5ef; color: #32715a; border-radius: 6px; font-size: .78rem; line-height: 1.6; }
.scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 16px; }
.catalog-list { max-height: 300px; overflow: auto; border: 1px solid #dde6eb; }
.catalog-list table { min-width: 370px; }
@media(max-width:1100px) and (min-width:701px) { :root { --dock-width: 420px; } .topbar { padding-inline: 12px; } .product-title { display: none; } }
@media(max-width:700px) {
  :root { --header-height: 44px; --footer-height: 53px; }
  .topbar { padding: 6px 12px; gap: 10px; flex-wrap: nowrap; }
  .brand { font-size: 1.25rem; }
  .product-title, .topbar-divider, .topbar-link { display: none; }
  .connection { width: auto; margin-left: auto; font-size: .63rem; white-space: nowrap; }
  #operation-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(205px, 40%) minmax(0, 1fr); }
  #operations-dock { border: 0; border-top: 1px solid #cadbe1; }
  .dock-heading { padding: 8px 12px; }
  .dock-heading .eyebrow { display: none; }
  .dock-heading strong { font-size: .85rem; }
  .workspace-tools { padding: 7px 10px; gap: 5px; }
  .workspace-tools .button { font-size: .68rem; padding: 6px 8px; }
  .workspace-nav { scrollbar-width: none; }
  .view-tab { font-size: .74rem; padding: 9px 10px; }
  .nav-full { display: none; } .nav-short { display: inline; }
  #map-stage .map-toolbar { padding: 5px 8px; min-height: 39px; }
  .map-actions { gap: 5px; }
  .map-actions .button { font-size: .65rem; min-height: 29px; padding: 5px 7px; }
  .map-actions .check-label { font-size: .65rem; }
  .map-legend { display: none; }
  .leaflet-control-zoom a { width: 25px; height: 25px; line-height: 25px; }
  .leaflet-control-attribution { font-size: 7px; }
  .workspace, .drivers-view, .zones-view, .documentation-view, #view-dispatch { padding: 8px; }
  #inspector-dock > .detail-panel { margin: 8px; padding: 14px; }
  .records-heading { padding: 11px; }
  .records-heading p { font-size: .69rem; }
  .records-scroll { max-height: none; }
  .fleet-search { grid-template-columns: minmax(0, 1fr) 110px; }
  .simulation-bar { padding: 6px 9px; gap: 8px; }
  .clock-block { min-width: 115px; }
  .clock-block strong { font-size: .72rem; }
  .clock-block .eyebrow { font-size: .55rem; }
  .simulation-bar .button { font-size: .7rem; padding-inline: 8px; }
  .simulation-bar select { width: 136px; font-size: .7rem; }
  body.wide-dock #operation-layout { grid-template-rows: 180px minmax(0, 1fr); }
  body.map-only #operation-layout { grid-template-rows: minmax(0, 1fr); }
  .dispatch-card { padding: 13px; }
  .docs-hero { padding: 14px; }
  .docs-hero h1 { font-size: 1.25rem; }
  .map-instruction { left: 43px; font-size: .7rem; padding: 8px; }
  .camera-bar { padding: 5px 8px; gap: 6px; }
  .camera-bar strong { font-size: .875rem; }
  .camera-bar select { flex-basis: 160px; width: 160px; font-size: .875rem; min-height: 36px; }
  .camera-bar .button { font-size: .875rem; padding-inline: 8px; min-height: 36px; }
  #camera-status { display: none; }
}
@media(max-height:520px) and (min-width:600px) {
  :root { --header-height: 40px; --footer-height: 48px; --dock-width: 370px; }
  #operation-layout { grid-template-columns: minmax(0, 1fr) var(--dock-width); grid-template-rows: minmax(0, 1fr); }
  .dock-heading { padding: 6px 10px; } .dock-heading .eyebrow { display: none; }
  .workspace-tools { padding-block: 5px; }
  body.wide-dock #operation-layout { grid-template-rows: minmax(0, 1fr); }
}
@media(max-width:420px) {
  .map-actions .check-label { font-size: 0; gap: 4px; }
  .map-actions .check-label::after { content: 'Rute'; font-size: .65rem; }
  #fit-route { font-size: 0; }
  #fit-route::after { content: 'Încadrează'; font-size: .65rem; }
}
.simulation-view { padding: 12px; min-width: 0; }
body:not([data-dock-page='list']) #view-simulation { display: none !important; }
.simulation-selection { padding: 0 4px; }
.simulation-view .field, .simulation-view .check-label { font-size: .875rem; line-height: 1.5; }
.simulation-view .hint { font-size: .8125rem; line-height: 1.65; }
.simulation-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 12px 0; gap: 3px; border: 1px solid #dbe5e9; border-radius: 6px; background: #fff; padding: 3px; }
.simulation-tabs .tab { min-width: 0; padding: 9px 4px; font-size: .8125rem; }
.simulation-tabs .active { background: #e5f3f1; border-radius: 4px; }
.simulation-subtitle { margin-top: 24px; }
.simulation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 8px; }
.simulation-record { margin-top: 14px; padding: 12px 0; border-top: 1px solid #e3eaed; }
.simulation-record strong { font-size: .875rem; }
.behavior-scores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.behavior-scores > div { min-width: 0; padding: 10px; border: 1px solid #dce8eb; border-radius: 6px; background: #f4f9fa; }
.behavior-scores span { display: block; font-size: .8125rem; line-height: 1.5; margin-bottom: 8px; }
.behavior-scores strong { font-size: 1rem; white-space: nowrap; }
.instruction-marker { display: grid; place-items: center; color: #fff; background: #526e9d; border: 2px solid #fff; border-radius: 5px; box-shadow: 0 1px 4px #12374745; font-size: 11px; font-weight: 700; }
.driver-records { min-width: 1320px; }
.table-column-toggle { margin: 8px 12px 12px; font-size: .875rem; }
button, summary, input, select { touch-action: manipulation; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #398d96; outline-offset: 2px; }
@media(max-width:700px) {
  body { height: 100dvh; }
  #operation-layout { grid-template-rows: minmax(180px, 32%) minmax(0, 1fr); }
  body.wide-dock #operation-layout { grid-template-rows: 0 minmax(0, 1fr); }
  body.wide-dock #map-stage { visibility: hidden; }
  body.map-only #map-stage { visibility: visible; }
  .dock-heading .button, .workspace-tools .button, .view-tab { min-height: 44px; font-size: .875rem; }
  .dock-heading strong { font-size: .9375rem; }
  .workspace-tools { padding: 4px 8px; }
  .view-tab { padding: 8px 11px; }
  .field input, .field select, .fleet-search input, .fleet-search select, #trip-window-km { font-size: 16px; min-height: 44px; }
  .records-heading p { font-size: .875rem; }
  #fleet-search-count { font-size: .8125rem; line-height: 1.5; }
  .records-panel:not(.all-columns) .fleet-records, .records-panel:not(.all-columns) .driver-records { min-width: 0; width: 100%; table-layout: fixed; }
  .records-panel:not(.all-columns) .fleet-records th, .records-panel:not(.all-columns) .fleet-records td, .records-panel:not(.all-columns) .driver-records th, .records-panel:not(.all-columns) .driver-records td { display: none !important; }
  .records-panel:not(.all-columns) .fleet-records :is(.identity-cell,.column-activity,.column-distance), .records-panel:not(.all-columns) .driver-records :is(.identity-cell,.column-activity,.column-available) { display: table-cell !important; width: auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; padding: 10px 7px; font-size: .875rem; }
  .records-panel:not(.all-columns) :is(.fleet-records,.driver-records) .identity-cell { width: 40%; position: static; }
  .records-panel:not(.all-columns) :is(.fleet-records,.driver-records) .column-activity { width: 33%; }
  .records-panel:not(.all-columns) .record-open { font-size: .9375rem; min-height: 44px; white-space: normal; }
  .records-panel:not(.all-columns) .fleet-records .mobile-record-summary { display: block !important; font-size: .8125rem; line-height: 1.5; }
  .table-column-toggle { display: inline-flex; min-height: 44px; }
  .trip-overview .button, .trip-overview .text-button, .context-details > summary { min-height: 44px; }
  .context-details > summary { display: flex; align-items: center; font-size: .9375rem; }
  .trip-overview .trip-summary > span:first-child, .trip-first strong { font-size: .9375rem; }
  .trip-kpis span { font-size: .875rem; }
  .trip-editor .two-fields { grid-template-columns: minmax(0, 1fr); }
  .trip-actions { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
@media(min-width:701px) { .table-column-toggle { display: none; } }
.plan-map-marker { display: grid; place-items: center; background: #fff; color: #536496; border: 2px solid #6877ab; border-radius: 50%; font-size: 14px; font-weight: 700; box-shadow: 0 2px 5px #15334333; }
@media(max-width:700px) {
  :root { --footer-height: calc(102px + env(safe-area-inset-bottom)); }
  .simulation-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 44px 44px; gap: 3px 6px; padding: 4px 8px max(4px, env(safe-area-inset-bottom)); overflow: hidden; }
  .simulation-bar .playback { display: contents; }
  .simulation-bar .clock-block { grid-row: 1; grid-column: 1 / 3; min-width: 0; }
  .simulation-bar .clock-block strong { font-size: .8125rem; }
  .simulation-bar #play { grid-row: 1; grid-column: 3; }
  .simulation-bar .speed-label { grid-row: 1; grid-column: 4; min-width: 0; }
  .simulation-bar select { width: 100%; min-width: 0; height: 44px; padding: 5px; font-size: 16px; }
  .simulation-bar [data-advance] { grid-row: 2; }
  .simulation-bar > #reset { grid-row: 2; grid-column: 4; margin: 0; }
  .simulation-bar .button { min-width: 0; min-height: 44px; padding: 5px 3px; font-size: .8125rem; white-space: normal; line-height: 1.35; }
}
@media(max-width:700px) { .simulation-view { padding: 8px; } .simulation-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .simulation-tabs .tab { font-size: .875rem; } .behavior-scores { grid-template-columns: minmax(0, 1fr); } .behavior-scores > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .behavior-scores span { margin: 0; } }
