/* H&H Logistics – App Layout
   Topbar mit Markenakzent, 3-Spalten-Layout, Map-HUD,
   Login-Overlay, Modals, Toasts.
*/

/* ── App-Shell ─────────────────────────────────────── */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Brand Accent Bar (über Topbar) ────────────────── */
.brand-bar {
  height: var(--accent-h);
  background: linear-gradient(90deg, var(--hh-blue) 0%, var(--hh-blue) 65%, var(--hh-red) 65%, var(--hh-red) 100%);
  flex-shrink: 0;
}

/* ── Topbar ────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}
.topbar-left  { display: flex; align-items: center; gap: 22px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Logo block */
.brand {
  display: flex; align-items: center; gap: 11px;
  padding-right: 18px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-logo {
  height: 30px; width: auto;
  display: block;
}
.brand-text {
  display: flex; flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.01em;
  color: var(--text1);
}
.brand-name em {
  font-style: normal;
  color: var(--hh-red);
  font-weight: 800;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text3);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Top stats (chips) */
.top-stats {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.top-stats::-webkit-scrollbar { display: none; }
.top-stat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text2);
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.top-stat:hover { background: var(--bg4); border-color: var(--border-strong); }
.top-stat .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.top-stat b {
  color: var(--text1);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  margin-left: 2px;
}

/* Right-side icons */
.tb-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text2);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s;
  user-select: none;
}
.tb-icon:hover { background: var(--bg3); color: var(--text1); }
.tb-icon .nbadge {
  position: absolute;
  top: 4px; right: 4px;
  font-size: 9px;
  padding: 1px 5px;
  min-width: 16px;
}
.tb-divider {
  width: 1px; height: 24px;
  background: var(--border);
  margin: 0 4px;
}

.tb-user {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-2);
  background: var(--bg3);
  font-size: 12px;
}
.tb-user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hh-blue), var(--hh-blue-600));
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: .02em;
}
.tb-user-name { color: var(--text1); font-weight: 600; }
.tb-user-role { color: var(--text3); font-size: 10px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }

.clock {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text1);
  padding: 6px 10px;
  background: var(--bg3);
  border-radius: var(--r-2);
  min-width: 80px;
  text-align: center;
}

/* Live indicator dot */
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: liveBlink 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, .2);
}

/* ── Main 3-column layout ──────────────────────────── */
.main {
  display: grid;
  grid-template-columns: var(--left-w) 1fr var(--right-w);
  flex: 1;
  min-height: 0;
  position: relative;
  transition: grid-template-columns .28s cubic-bezier(.2,.8,.2,1);
}
.main.left-collapsed   { grid-template-columns: 0 1fr var(--right-w); }
.main.right-collapsed  { grid-template-columns: var(--left-w) 1fr 0; }
.main.left-collapsed.right-collapsed { grid-template-columns: 0 1fr 0; }

.left, .right {
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.main.left-collapsed  .left  { transform: translateX(-100%); pointer-events: none; }
.main.right-collapsed .right { transform: translateX(100%);  pointer-events: none; }

/* ── Left Sidebar ──────────────────────────────────── */
.left {
  background: var(--bg1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.left-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.left-head-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.left-head-row h2 {
  flex: 1; min-width: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text3);
  display: flex; align-items: center; gap: 8px;
  margin: 0;
}
.left-head-row h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.left-head .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text1);
  font-weight: 700;
  letter-spacing: 0;
}
.filters {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.vlist {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* ── Map area ──────────────────────────────────────── */
.map-wrap {
  position: relative;
  background: var(--bg0);
  overflow: hidden;
}
#map { width: 100%; height: 100%; }

/* Tile filter for slightly muted feel */
.leaflet-tile-pane { filter: saturate(.94) contrast(.98); }

.leaflet-control-zoom        { display: none !important; }
.leaflet-control-attribution {
  background: rgba(255,255,255,.78) !important;
  font-size: 10px !important;
  color: var(--text3) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
}
.leaflet-control-attribution a { color: var(--hh-blue) !important; }

/* Map HUD */
.map-hud {
  position: absolute;
  bottom: 16px; left: 16px;
  display: flex; gap: 8px;
  z-index: 1000;
}
.chip {
  background: rgba(255,255,255, .96);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--r-2);
  font-size: 12px;
  color: var(--text2);
  display: flex; align-items: center; gap: 7px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}
.chip b { font-family: var(--font-mono); color: var(--text1); font-weight: 700; }

.map-zoom {
  position: absolute;
  bottom: 44px; right: 16px;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  z-index: 1000;
}
.zbtn {
  width: 36px; height: 36px;
  background: transparent;
  color: var(--text1);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.zbtn:hover { background: var(--bg3); }
.zbtn + .zbtn { border-top: 1px solid var(--border); }

/* Map legend (klein, dezent oben links) */
.map-legend {
  position: absolute;
  top: 16px; left: 16px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text2);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  display: none;
  max-width: 240px;
}
.map-legend.show { display: block; }
.map-legend-title {
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text3);
  margin-bottom: 8px;
}
.map-legend-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.map-legend-row .dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block;
}

.map-tools {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 6px;
}
.map-tool-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  cursor: pointer;
  font-size: 14px;
  color: var(--text2);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.map-tool-btn:hover { background: var(--bg3); color: var(--text1); }
.map-tool-btn.on { background: var(--hh-blue); color: #fff; border-color: var(--hh-blue); }

/* ── Right Sidebar ─────────────────────────────────── */
.right {
  background: var(--bg1);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.r-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
}
.r-head h2 {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text1);
}
.r-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 0 4px;
}
.r-tabs::-webkit-scrollbar { display: none; }
.r-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
.r-body .empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  color: var(--text3);
  font-size: 13px;
  flex-direction: column;
  gap: 8px;
}
.r-body .empty .arrow {
  font-size: 20px;
  color: var(--hh-blue);
}

/* ── Login Overlay ─────────────────────────────────── */
/* ── Login Overlay (Design-System-konform) ─────────── */
.login-overlay {
  position: fixed; inset: 0;
  background: var(--bg0);
  z-index: 9999;
  display: flex;
  overflow: hidden;
}

.login-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  width: 100%;
  height: 100%;
}

.login-hero {
  position: relative;
  overflow: hidden;
  padding: 56px 64px;
  color: #fff;
  display: flex; flex-direction: column;
  justify-content: space-between;
  /* 3-Stop-Gradient mit Markenrot-Bleed (kanonisch aus dem UI Kit) */
  background:
    linear-gradient(135deg,
      rgba(11, 27, 51, .92) 0%,
      rgba(27, 79, 158, .85) 70%,
      rgba(220, 31, 38, .60) 100%);
}
.login-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: linear-gradient(135deg, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(135deg, #000, transparent 70%);
}
.login-hero > * { position: relative; z-index: 1; }

.login-brand {
  display: flex; align-items: center; gap: 14px;
}
.login-brand img {
  height: 56px; width: auto;
  background: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
.login-brand-text {
  display: flex; flex-direction: column;
}
.login-brand-text .name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.login-brand-text .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, .78);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: 4px;
}

.login-headline {
  max-width: 560px;
}
.login-headline h1 {
  font-family: var(--font-ui);
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
  margin: 0 0 18px;
}
.login-headline h1 em {
  font-style: normal;
  /* Cream/peach für gute Lesbarkeit auf dem dunkelblau-roten Hero */
  color: #FFD7A8;
}
.login-headline p {
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .9);
  margin: 0 0 30px;
  max-width: 480px;
}

/* Vertical feature list with rounded square icons (UI Kit canonical) */
.login-features {
  display: flex; flex-direction: column;
  gap: 12px;
}
.login-feat {
  display: flex; align-items: center; gap: 14px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .92);
}
.login-feat strong { font-weight: 700; }
.login-feat-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.login-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  color: rgba(255, 255, 255, .65);
  font-family: var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.login-foot .live { display: inline-flex; align-items: center; gap: 8px; }
.login-foot .live::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: #76F39A;
  box-shadow: 0 0 0 0 rgba(118, 243, 154, .6);
  animation: pulseDot 2s infinite;
}

/* ── Form pane ─────────────────────────────────────── */
.login-form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 56px;
  background: var(--bg1);
}
.login-box {
  width: 100%; max-width: 380px;
}
.login-box h2 {
  font-family: var(--font-ui);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text1);
  margin: 0 0 6px;
}
.login-box .sub {
  font-size: 14px;
  color: var(--text3);
  margin: 0 0 28px;
}
.login-field {
  margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.login-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
}
.login-field input {
  padding: 12px 14px;
  font-size: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-family: inherit;
  color: var(--text1);
}
.login-field input:focus {
  border-color: var(--hh-blue);
  box-shadow: var(--ring);
  background: var(--bg1);
}
.login-actions {
  margin-top: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.login-submit {
  width: 100%;
  padding: 12px 18px;
  font-size: 14px; font-weight: 700;
  background: var(--hh-blue); color: #fff;
  border: 0;
  border-radius: var(--r-2);
  cursor: pointer;
  letter-spacing: .02em;
  /* Brand-Shadow gemäß UI Kit */
  box-shadow: 0 2px 8px rgba(27, 79, 158, .25);
  transition: background .15s, transform .04s, box-shadow .15s;
}
.login-submit:hover {
  background: var(--hh-blue-600);
  box-shadow: 0 4px 14px rgba(27, 79, 158, .32);
}
.login-submit:active { transform: translateY(1px); }

.login-error {
  display: none;
  background: var(--red-d);
  color: var(--red);
  border: 1px solid rgba(220, 31, 38, .25);
  font-size: 12px;
  padding: 9px 12px;
  border-radius: var(--r-2);
  margin-top: 12px;
}

.login-demo {
  margin-top: 22px;
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text2);
}
.login-demo-title {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.login-demo-row {
  display: flex; justify-content: space-between;
  padding: 2px 0;
}
.login-demo-row span:first-child { color: var(--hh-blue); font-weight: 700; }
.login-demo-row span:last-child  { color: var(--text2); }

/* ── Modal Overlay ─────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .35);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  animation: fadeIn .15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.modal-head h2 {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text1);
  display: flex; align-items: center; gap: 10px;
}
.modal-head h2 .accent {
  width: 4px; height: 18px;
  background: var(--hh-blue);
  border-radius: 2px;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--r-2);
  background: var(--bg3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text2);
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--red-d); color: var(--red); }

/* ── Notification Dropdown ─────────────────────────── */
.notif-dropdown {
  position: fixed;
  top: calc(var(--topbar-h) + var(--accent-h) + 8px);
  right: 16px;
  width: 400px;
  max-height: 520px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-lg);
  z-index: 8000;
  overflow: hidden;
  animation: modalIn .18s cubic-bezier(.2,.8,.2,1);
}
.notif-dropdown-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .12em;
  display: flex; justify-content: space-between; align-items: center;
}

/* ── Toasts ────────────────────────────────────────── */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
#toastContainer { z-index: 10000; }
.toast {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--r-2);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text1);
  box-shadow: var(--shadow-md);
  animation: slideIn .25s cubic-bezier(.2,.8,.2,1);
  min-width: 280px;
  max-width: 380px;
}
.toast.success { border-left-color: var(--green); }
.toast.warning { border-left-color: var(--orange); }
.toast.error   { border-left-color: var(--red); }
.toast.info    { border-left-color: var(--hh-blue); }

/* ── Hide elements with display:none inline (Leaflet uses style.display) ── */
.hidden { display: none !important; }

/* ── Topbar-Toggle-Buttons (immer sichtbar) ────────── */
.topbar-toggle {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: var(--r-2);
  background: var(--bg3);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text1);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: background .15s, color .15s, border-color .15s;
}
.topbar-toggle:hover {
  background: var(--hh-blue);
  border-color: var(--hh-blue);
  color: #fff;
}
.topbar-toggle.active {
  background: var(--hh-blue);
  border-color: var(--hh-blue);
  color: #fff;
}

/* ── Sidebar-Toggle-Buttons (in Headern) ───────────── */
.sidebar-toggle {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: var(--r-2);
  background: var(--bg3);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar-toggle:hover {
  background: var(--hh-blue);
  border-color: var(--hh-blue);
  color: #fff;
}
.sidebar-toggle i { font-size: 12px; }
.r-head .sidebar-toggle { margin-right: 4px; }

/* ── Floating Expand-Handles (sichtbar im Collapsed-State) ── */
.sidebar-expand {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
  width: 36px; height: 88px;
  background: var(--hh-blue);
  border: 0;
  cursor: pointer;
  color: #fff;
  display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(27, 79, 158, .35);
  transition: background .15s, transform .15s, box-shadow .15s, width .15s;
  font-size: 14px;
  animation: expandHintPulse 2.2s ease-out 0.4s 2;
}
.sidebar-expand:hover {
  background: var(--hh-blue-600);
  width: 44px;
  box-shadow: 0 6px 20px rgba(27, 79, 158, .45);
}
.sidebar-expand:active { transform: translateY(-50%) scale(.96); }
.sidebar-expand i { font-size: 16px; }

.sidebar-expand.left  {
  left: 0;
  border-radius: 0 var(--r-3) var(--r-3) 0;
}
.sidebar-expand.right {
  right: 0;
  border-radius: var(--r-3) 0 0 var(--r-3);
}
.main.left-collapsed  .sidebar-expand.left  { display: inline-flex; }
.main.right-collapsed .sidebar-expand.right { display: inline-flex; }

@keyframes expandHintPulse {
  0%   { box-shadow: 0 4px 14px rgba(27, 79, 158, .35), 0 0 0 0 rgba(27, 79, 158, .55); }
  70%  { box-shadow: 0 4px 14px rgba(27, 79, 158, .35), 0 0 0 14px rgba(27, 79, 158, 0); }
  100% { box-shadow: 0 4px 14px rgba(27, 79, 158, .35), 0 0 0 0 rgba(27, 79, 158, 0); }
}

/* ═══════════════════════════════════════════════════════════════
   Sub-Navigation (Live · Übersicht · Karten)
   ═══════════════════════════════════════════════════════════════ */
.subnav {
  display: flex;
  gap: 4px;
  margin-left: 16px;
  padding: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}
.subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.subnav-btn i { font-size: 12px; opacity: .8; }
.subnav-btn:hover { background: var(--bg4); color: var(--text1); }
.subnav-btn.on {
  background: var(--bg1);
  color: var(--hh-blue);
  box-shadow: var(--shadow-sm);
}
.subnav-btn.on i { opacity: 1; }
@media (max-width: 1024px) {
  .subnav-btn span { display: none; }
  .subnav-btn { padding: 6px 10px; }
}

/* ═══════════════════════════════════════════════════════════════
   Single-Column Layout (overview.php, cards.php) — fluid full-width
   ═══════════════════════════════════════════════════════════════ */
.main-single {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(12px, 2vw, 24px);
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}
.page-toolbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text1);
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}
.page-toolbar h1 .count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  font-family: var(--font-mono);
}
/* Suche: wächst frei auf verfügbare Breite, knickt bei Bedarf in eigene Zeile */
.page-toolbar .search {
  flex: 1 1 240px;
  min-width: 0;
}
.page-toolbar .filters {
  padding: 0;
  border: none;
  margin-left: auto;
  flex-wrap: wrap;
}

.page-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px clamp(12px, 2vw, 24px);
  background: var(--bg0);
  width: 100%;
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════
   Cards Grid (cards.php) — entkoppelte Fahrzeug-Karten
   ═══════════════════════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  /* min(280px, 100%) verhindert Overflow auf schmalen Viewports */
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 12px;
  width: 100%;
}
.cards-grid .vc {
  /* Sidebar-Card war full-width via Block-Layout; im Grid füllt sie ihre Cell */
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
.cards-grid .vc:hover { transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════════════
   Overview Table (overview.php) — strukturierte Liste
   ═══════════════════════════════════════════════════════════════ */
.ovw-table-wrap {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  /* horizontal scrollen statt clippen, wenn Tabelle breiter wird */
  overflow-x: auto;
  overflow-y: visible;
  box-shadow: var(--shadow-sm);
  width: 100%;
}
.ovw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ovw-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg3);
  color: var(--text2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.ovw-table thead th:hover { background: var(--bg4); color: var(--text1); }
.ovw-table thead th .sort-ind {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  color: var(--hh-blue);
  opacity: 0;
}
.ovw-table thead th.sort-asc .sort-ind,
.ovw-table thead th.sort-desc .sort-ind { opacity: 1; }
.ovw-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s ease;
  cursor: pointer;
}
.ovw-table tbody tr:hover { background: var(--bg3); }
.ovw-table tbody tr:last-child { border-bottom: none; }
.ovw-table tbody td {
  padding: 12px;
  color: var(--text1);
  vertical-align: middle;
}
.ovw-table tbody td.mono { font-family: var(--font-mono); font-weight: 600; }
.ovw-table tbody td.muted { color: var(--text3); }
.ovw-table tbody td.num { font-family: var(--font-mono); text-align: right; }
.ovw-table tbody tr.late td.eta { color: var(--red); font-weight: 600; }
.ovw-table .ampel-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.ovw-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text3);
  font-size: 14px;
}

/* ── Position cell ──────────────────────────────────────── */
.ovw-table .ovw-position { max-width: 240px; line-height: 1.3; }
.ovw-pos-street { color: var(--text1); font-weight: 500; }
.ovw-pos-city   { color: var(--text3); font-size: 11px; margin-top: 1px; }
.ovw-pos-coords { font-size: 11px; }

/* ── Online indicator (dot + bar) ───────────────────────── */
.ovw-online { display: inline-flex; align-items: center; gap: 6px; }
.ovw-online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(22,163,74,.18);
}
.ovw-online-dot.off {
  background: var(--text3);
  box-shadow: none;
}
.ovw-online-bar {
  width: 36px; height: 8px; border-radius: 2px;
  background: var(--bg4);
}
.ovw-online-bar.on {
  background: linear-gradient(90deg, var(--green) 0%, var(--mint) 100%);
}
.ovw-online.off { opacity: .55; }

/* ── Update timestamp cell ──────────────────────────────── */
.ovw-update { line-height: 1.25; font-size: 12px; }
.ovw-update-age { color: var(--text3); }

/* ── Empfang / GPS signal bars ──────────────────────────── */
.ovw-signal { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.ovw-signal-num { font-size: 12px; color: var(--text2); min-width: 18px; text-align: right; }
.ovw-signal-bars { display: inline-flex; align-items: flex-end; gap: 1px; height: 12px; }
.ovw-signal-bars .sb {
  width: 3px; background: var(--bg4); border-radius: 1px;
}
.ovw-signal-bars .sb-1 { height: 4px; }
.ovw-signal-bars .sb-2 { height: 7px; }
.ovw-signal-bars .sb-3 { height: 10px; }
.ovw-signal-bars .sb-4 { height: 12px; }
.ovw-signal.weak .sb.on { background: var(--orange); }
.ovw-signal.ok   .sb.on { background: var(--yellow); }
.ovw-signal.good .sb.on { background: var(--green); }
.ovw-signal.none .ovw-signal-num { color: var(--text3); }

/* ── Bewegungs-/Halt-Status (prompt.md Hysterese + Klassifizierung) ── */
.ovw-motion {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text2);
  white-space: nowrap;
}
.ovw-motion-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text3);
}
.ovw-motion-since { color: var(--text3); font-weight: 500; margin-left: 4px; }
.ovw-motion.moving { color: var(--green); }
.ovw-motion.moving .ovw-motion-dot {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(22,163,74,.18);
  animation: ovw-pulse 1.6s ease-in-out infinite;
}
@keyframes ovw-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(22,163,74,.18); }
  50%      { box-shadow: 0 0 0 5px rgba(22,163,74,.05); }
}
.ovw-motion.stopped { color: var(--text2); }

/* Halt-Klassen — eskalierende Farbgebung von harmlos zu Wochenruhe */
.ovw-stop-verkehrshalt   .ovw-motion-dot { background: var(--cyan); }
.ovw-stop-verkehrshalt                   { color: var(--cyan); }
.ovw-stop-pause_kurz     .ovw-motion-dot { background: var(--yellow); }
.ovw-stop-pause_kurz                     { color: var(--yellow); }
.ovw-stop-unterbrechung  .ovw-motion-dot { background: var(--yellow); }
.ovw-stop-unterbrechung                  { color: var(--yellow); }
.ovw-stop-teilpause      .ovw-motion-dot { background: var(--orange); }
.ovw-stop-teilpause                      { color: var(--orange); }
.ovw-stop-pause_voll     .ovw-motion-dot { background: var(--orange); }
.ovw-stop-pause_voll                     { color: var(--orange); }
.ovw-stop-tagesruhe_red  .ovw-motion-dot { background: var(--purple); }
.ovw-stop-tagesruhe_red                  { color: var(--purple); }
.ovw-stop-tagesruhe      .ovw-motion-dot { background: var(--purple); }
.ovw-stop-tagesruhe                      { color: var(--purple); }
.ovw-stop-wochenruhe_red .ovw-motion-dot { background: var(--blue); }
.ovw-stop-wochenruhe_red                 { color: var(--blue); }
.ovw-stop-wochenruhe     .ovw-motion-dot { background: var(--blue); }
.ovw-stop-wochenruhe                     { color: var(--blue); }

/* ── Tür-Status ── */
.ovw-door {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  color: var(--text2);
}
.ovw-door.open   { color: var(--orange); }
.ovw-door.closed { color: var(--text3); }
.ovw-door i { font-size: 13px; }

/* ── Tank / AdBlue Mini-Bar ── */
.ovw-level {
  display: inline-flex; align-items: center; gap: 6px;
  justify-content: flex-end;
  font-family: var(--font-mono);
}
.ovw-level-num {
  font-size: 12px; font-weight: 600;
  min-width: 32px; text-align: right;
  color: var(--text1);
}
.ovw-level-bar {
  display: inline-block;
  width: 40px; height: 6px;
  background: var(--bg4); border-radius: 3px;
  overflow: hidden;
}
.ovw-level-bar > span {
  display: block; height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width .25s ease;
}
.ovw-level.low  .ovw-level-num { color: var(--orange); }
.ovw-level.low  .ovw-level-bar > span { background: var(--orange); }
.ovw-level.crit .ovw-level-num { color: var(--red); font-weight: 700; }
.ovw-level.crit .ovw-level-bar > span { background: var(--red); }

/* ── Benutzerverwaltung (users.php + Self-Service-Passwort) ──────── */
/* Buttons: gleiche Form wie .asg-btn, aber ohne den "asg-"-Prefix —
   damit sie auch außerhalb der Assignments-Seite funktionieren.       */
.btn-primary,
.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  border-radius: var(--r-2);
  border: 1px solid;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, transform .04s;
  font-family: inherit;
}
.btn-primary {
  background: var(--hh-blue); color: #fff;
  border-color: var(--hh-blue);
  box-shadow: 0 1px 2px rgba(27,79,158,.18);
}
.btn-primary:hover    { background: var(--hh-blue-600); border-color: var(--hh-blue-600); }
.btn-primary:disabled { background: var(--bg4); border-color: var(--border-strong); color: var(--text3); cursor: not-allowed; }
.btn-secondary {
  background: var(--bg1); color: var(--text2);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg4); color: var(--text1); }

/* Formular-Felder (Modals) */
.form-row {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.form-row > label {
  font-size: 12px; font-weight: 600;
  color: var(--text2);
  letter-spacing: .02em;
}
.form-row small.muted { font-size: 11px; color: var(--text3); margin-top: 2px; }
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=password],
.form-row select {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg1);
  color: var(--text1);
  padding: 9px 11px;
  border-radius: var(--r-2);
  font-size: 13px;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--hh-blue);
  box-shadow: var(--ring);
}
.form-row input:disabled { background: var(--bg3); color: var(--text3); cursor: not-allowed; }
.checkbox-row {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text1);
  cursor: pointer;
  user-select: none;
}
.checkbox-row input { width: 16px; height: 16px; cursor: pointer; }
.form-actions {
  display: flex; justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Passwort-Input mit Vorschlags-Button */
.usr-pw-input {
  display: flex; align-items: stretch; gap: 6px;
}
.usr-pw-input input { flex: 1; min-width: 0; font-family: var(--font-mono); }
.usr-pw-suggest {
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  width: 38px; cursor: pointer;
  border-radius: var(--r-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.usr-pw-suggest:hover { background: var(--hh-blue-50); color: var(--hh-blue); }

/* Fehler-Banner im Modal */
.usr-err {
  background: var(--red-d);
  color: var(--red);
  border: 1px solid rgba(220,31,38,.25);
  border-radius: var(--r-2);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 8px;
}

/* "Sie"-Marker in der Tabelle für eigene Zeile */
.usr-me-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px; font-weight: 700;
  background: var(--hh-blue-50); color: var(--hh-blue);
  border-radius: 999px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.usr-sess.on {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--green-d); color: var(--green);
  border-radius: 999px;
}

/* ── Standort-Modal (overview.php) ─────────────────────────────────── */
.ovw-loc-modal {
  width: min(1100px, 92vw);
  max-height: 92vh;
  display: flex; flex-direction: column;
  padding: 18px;
}
.ovw-loc-body {
  display: flex; flex-direction: column;
  gap: 10px;
  flex: 1; min-height: 0;
}
.ovw-loc-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--r-2);
  font-size: 13px;
  color: var(--text2);
}
.ovw-loc-meta b { color: var(--text1); font-weight: 600; }
.ovw-loc-meta .mono { font-family: var(--font-mono); font-size: 12px; }

.ovw-loc-controls {
  display: flex; align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ovw-loc-legend {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text2);
  margin-left: 10px;
}
.ovw-loc-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.ovw-loc-legend-dot.current { background: var(--hh-blue); box-shadow: 0 0 0 3px rgba(27,79,158,.18); }
.ovw-loc-legend-dot.stop    { background: var(--orange);  box-shadow: 0 0 0 3px rgba(234,88,12,.16); }

.ovw-loc-map {
  flex: 1 1 360px;
  min-height: 360px;
  border-radius: var(--r-3);
  overflow: hidden;
  border: 1px solid var(--border);
  z-index: 0;       /* unter Modal-Header bleiben */
}

.ovw-loc-list {
  flex: 0 0 auto;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--bg2);
}
.ovw-loc-stops {
  list-style: none;
  margin: 0; padding: 0;
}
.ovw-loc-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}
.ovw-loc-item:last-child { border-bottom: 0; }
.ovw-loc-item:hover { background: var(--bg3); }
.ovw-loc-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
}
.ovw-loc-text { min-width: 0; }
.ovw-loc-addr {
  font-size: 13px; color: var(--text1);
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ovw-loc-when { font-size: 11px; }
.ovw-loc-dur {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
}
.ovw-loc-empty {
  padding: 24px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
}

/* Karten-Pins (Leaflet DivIcons) ──────────────────────────────────── */
.ovw-loc-pin {
  position: relative;
  width: 22px; height: 22px;
  pointer-events: auto;
}
.ovw-loc-pin .dot {
  position: absolute; inset: 4px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.ovw-loc-pin.current .dot { background: var(--hh-blue); }
.ovw-loc-pin.current .pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(27,79,158,.22);
  animation: ovw-loc-pulse 1.6s ease-out infinite;
}
@keyframes ovw-loc-pulse {
  0%   { transform: scale(.5); opacity: .9; }
  100% { transform: scale(2.0); opacity: 0; }
}
.ovw-loc-pin.stop {
  width: 26px; height: 26px;
}
.ovw-loc-pin.stop .dot {
  inset: 0;
  background: var(--orange);
}
.ovw-loc-pin.stop .num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  font-family: var(--font-mono);
}

@media (max-width: 700px) {
  .ovw-loc-modal { padding: 12px; }
  .ovw-loc-map   { min-height: 280px; }
  .ovw-loc-list  { max-height: 180px; }
  .ovw-loc-meta  { font-size: 12px; }
  .ovw-loc-legend { margin-left: 0; }
}

/* ── Aktionen-Spalte ── */
.ovw-table .ovw-actions-th { width: 1%; white-space: nowrap; cursor: default; text-align: right; }
.ovw-table .ovw-actions-th:hover { background: var(--bg3); color: var(--text2); }
.ovw-table td.ovw-actions { white-space: nowrap; text-align: right; }

.ovw-act-group {
  display: inline-flex; align-items: center; gap: 4px;
  justify-content: flex-end;
}
.ovw-act {
  appearance: none; border: 1px solid var(--border);
  background: var(--bg1); color: var(--text2);
  width: 30px; height: 30px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .04s;
  text-decoration: none;
  font-size: 12px;
}
.ovw-act:hover {
  background: var(--bg3); color: var(--text1);
  border-color: var(--border-strong);
}
.ovw-act:active { transform: scale(.95); }
.ovw-act:disabled {
  opacity: .4; cursor: not-allowed;
}
.ovw-act.primary {
  background: var(--hh-blue); color: #fff; border-color: var(--hh-blue-600);
}
.ovw-act.primary:hover {
  background: var(--hh-blue-600);
}

/* ── Popover (Status-/More-Menü an Aktions-Buttons) ── */
.ovw-popover {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  max-width: 280px;
  padding: 6px;
  font-size: 13px;
  animation: ovw-pop-in .12s ease-out;
}
@keyframes ovw-pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ovw-pop-head {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text3);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.ovw-pop-body { display: flex; flex-direction: column; gap: 2px; }
.ovw-pop-item {
  appearance: none; border: 0; background: transparent;
  text-align: left; cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text1); font-size: 13px;
  text-decoration: none;
  transition: background .1s;
}
.ovw-pop-item:hover { background: var(--bg3); }
.ovw-pop-item i { color: var(--text3); width: 14px; text-align: center; }

/* ── Responsive Breakpoints ──────────────────────────────────────────
   lg-Hide (≤1280)  : Empfang/km/h/Tank/AdBlue/Tür/Tages-km
   md-Hide (≤960)   : Fahrzeug-Modell/Bewegung/Update/Lenkzeit
   sm-Hide (≤640)   : Position
   ≤640 zusätzlich  : Tabelle wird zur Stacked-Card-Liste.
*/
@media (max-width: 1280px) {
  .ovw-table .col-hide-lg { display: none; }
}
@media (max-width: 960px) {
  .ovw-table .col-hide-md { display: none; }
  .page-toolbar .filters  { margin-left: 0; flex-basis: 100%; overflow-x: auto; }
}
@media (max-width: 640px) {
  .ovw-table .col-hide-sm { display: none; }

  /* Stacked-Card-Layout: Tabelle wird zur Liste. data-label aus rowHTML
     liefert die Mini-Beschriftung links, der Wert steht rechts. */
  .ovw-table-wrap { border: 0; background: transparent; box-shadow: none; }
  .ovw-table, .ovw-table thead, .ovw-table tbody,
  .ovw-table tr, .ovw-table th, .ovw-table td { display: block; width: 100%; }
  .ovw-table thead { display: none; }
  .ovw-table tr.ovw-row {
    background: var(--bg1);
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
    padding: 8px 4px 4px;
  }
  .ovw-table tr.ovw-row:hover { background: var(--bg1); }
  .ovw-table tbody td {
    border-bottom: 1px dashed var(--border);
    padding: 8px 12px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    text-align: right;
  }
  .ovw-table tbody td:last-child { border-bottom: 0; }
  .ovw-table tbody td.num        { text-align: right; }
  .ovw-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--text3);
    text-align: left;
  }
  /* Plate als Card-Heading — größer, ohne Label, oben */
  .ovw-table tbody td.ovw-cell-plate {
    font-size: 16px; padding: 6px 12px 10px;
    justify-content: flex-start;
    border-bottom: 1px solid var(--border);
  }
  .ovw-table tbody td.ovw-cell-plate::before { display: none; }

  /* Aktionen-Zeile bekommt eigene Breite, Buttons rechts gruppiert */
  .ovw-table tbody td.ovw-actions {
    background: var(--bg2);
    border-bottom: 0;
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 0 0 var(--r-3) var(--r-3);
  }
  .ovw-act { width: 36px; height: 36px; font-size: 13px; }

  .page-toolbar h1   { font-size: 18px; }
  .page-toolbar .search { width: 100%; flex-basis: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   Assignments Page (assignments.php)
   ═══════════════════════════════════════════════════════════════ */
.asg-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  width: 100%;
  overflow: hidden;
}
.asg-card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.asg-card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text1);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.asg-card-head h2 i { color: var(--hh-blue); margin-right: 6px; }
.asg-hint { color: var(--text3); font-size: 12px; }

.asg-create {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  padding: 16px 18px;
  align-items: end;
}
.asg-create label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
  min-width: 0;
}
.asg-create select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  background: var(--bg1);
  color: var(--text1);
  font-size: 13px;
  font-family: var(--font-ui);
  width: 100%;
  cursor: pointer;
}
.asg-create select:focus {
  outline: 2px solid var(--hh-blue);
  outline-offset: -1px;
  border-color: var(--hh-blue);
}
@media (max-width: 720px) {
  .asg-create { grid-template-columns: 1fr; }
}

.asg-summary {
  display: flex;
  gap: 8px;
  padding: 0 18px 14px;
  flex-wrap: wrap;
}
.asg-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text2);
  font-size: 12px;
}
.asg-pill b { color: var(--text1); font-family: var(--font-mono); font-weight: 700; }

.asg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r-2);
  border: 1px solid var(--border-strong);
  background: var(--bg1);
  color: var(--text1);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.asg-btn:hover { background: var(--bg4); }
.asg-btn:active { transform: translateY(1px); }
.asg-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  background: var(--bg3);
}
.asg-btn-primary {
  background: var(--hh-blue);
  border-color: var(--hh-blue);
  color: #fff;
}
.asg-btn-primary:hover { background: var(--hh-blue-600); border-color: var(--hh-blue-600); }
.asg-btn-primary:disabled { background: var(--bg4); border-color: var(--border-strong); color: var(--text3); }
.asg-btn-danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
  height: 32px;
  font-size: 12px;
}
.asg-btn-danger:hover { background: var(--red-d); }

.asg-pin-input {
  width: 80px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  background: var(--bg1);
  color: var(--text1);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .15em;
  transition: border-color .15s ease, background .3s ease;
}
.asg-pin-input:focus {
  outline: none;
  border-color: var(--hh-blue);
  background: var(--hh-blue-50);
}
.asg-pin-input.asg-pin-saved {
  background: var(--green-d);
  border-color: var(--green);
}

/* Toolbar create-buttons (rechts neben der Suche) */
.asg-toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

/* Stift-Icon-Button */
.asg-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  color: var(--text2);
}
.asg-btn-icon:hover { color: var(--hh-blue); border-color: var(--hh-blue); }

/* Aktivieren-Button (grün) */
.asg-btn-success {
  background: transparent;
  border-color: var(--green);
  color: var(--green);
  height: 32px;
  font-size: 12px;
}
.asg-btn-success:hover { background: var(--green-d); }

/* Aktiv / Inaktiv Pills */
.asg-active-pill, .asg-inactive-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.asg-active-pill   { background: var(--green-d);  color: var(--green); }
.asg-inactive-pill { background: var(--bg4);       color: var(--text3); }

.asg-row-inactive td { opacity: .55; }
.asg-row-inactive .asg-active-pill,
.asg-row-inactive .asg-inactive-pill { opacity: 1; }

/* Kollabierbare Sektionen */
.asg-card-head-toggle {
  cursor: pointer;
  user-select: none;
  position: relative;
}
.asg-card-head-toggle:hover { background: var(--bg3); }
.asg-toggle-icon {
  margin-left: auto;
  color: var(--text3);
  font-size: 12px;
  transition: transform .2s ease;
}
.asg-card-head-toggle.asg-collapsed .asg-toggle-icon { transform: rotate(-90deg); }
.asg-collapsible {
  max-height: 4000px;
  overflow: hidden;
  transition: max-height .25s ease;
}
.asg-collapsible.asg-collapsed { max-height: 0; }

/* Modal-Form-Layout */
.modal-form {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}
.modal-form-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
.modal-form-row.two { grid-template-columns: 1fr 1fr; }
.modal-form-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
  min-width: 0;
}
.modal-form-row label em {
  color: var(--red);
  font-style: normal;
}
.modal-form-row label em.muted {
  color: var(--text3);
  font-weight: 500;
}
.modal-form-row input,
.modal-form-row select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  background: var(--bg1);
  color: var(--text1);
  font-size: 13px;
  font-family: var(--font-ui);
  width: 100%;
  box-sizing: border-box;
}
.modal-form-row input:focus,
.modal-form-row select:focus {
  outline: 2px solid var(--hh-blue);
  outline-offset: -1px;
  border-color: var(--hh-blue);
}
.modal-form-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text1);
  cursor: pointer;
  user-select: none;
}
.modal-form-toggle input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--hh-blue);
  cursor: pointer;
}
.modal-form-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.modal-form-error {
  background: var(--red-d);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--r-2);
  padding: 8px 12px;
  font-size: 12px;
}
@media (max-width: 600px) {
  .modal-form-row.two { grid-template-columns: 1fr; }
}

/* ── Mobile-Overlay-Backdrop ───────────────────────── */
.sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  backdrop-filter: blur(2px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.main.backdrop-active .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1280px) {
  :root { --left-w: 280px; --right-w: 420px; }
  .login-split { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

/* Tablet: Sidebars als Overlay über der Karte (statt Push-Layout) */
@media (max-width: 1024px) {
  .top-stats { display: none; }

  .main {
    /* Karte nimmt volle Breite, Sidebars liegen darüber */
    grid-template-columns: 1fr;
    transition: none;
  }
  /* Karte explizit in die erste (und einzige) Grid-Spalte */
  .map-wrap { grid-column: 1; grid-row: 1; }

  .left, .right {
    position: absolute;
    top: 0; bottom: 0;
    width: var(--left-w);
    max-width: 380px;
    z-index: 1080;
    box-shadow: var(--shadow-lg);
    grid-column: unset;
    grid-row: unset;
  }
  .left  { left: 0;  transform: translateX(-105%); }
  .right { right: 0; transform: translateX(105%); }

  .main.left-expanded  .left  { transform: translateX(0); pointer-events: auto; }
  .main.right-expanded .right { transform: translateX(0); pointer-events: auto; }

  /* Floating-Handles in der Tablet-/Mobile-Ansicht nicht nötig — Topbar reicht */
  .sidebar-expand { display: none !important; }
}

@media (max-width: 768px) {
  :root { --left-w: 92vw; --right-w: 92vw; }
  .left, .right { max-width: 360px; }
  .clock, .brand-text { display: none; }
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar-right { gap: 6px; }
  .tb-user { padding: 4px 6px; }
  .tb-user-name, .tb-user-role { display: none; }
}
