/* Minimal, werkstatt-tauglich, touchscreen-freundlich */
:root{
  --red:#e11b22;
  --bg:#f4f6fb;
  --card:#ffffff;
  --ink:#0f172a;
  --muted:#475569;
  --line:#e2e8f0;
  --blue:#1f4fbf;
  --blue2:#2b63ff;
  --green:#16a34a;
  --orange:#f59e0b;
  --shadow: 0 8px 30px rgba(2,6,23,.10);
  --radius: 16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color:var(--ink);
  background:var(--bg);
}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  left:0; right:0; width:100%;
  background:rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}

.brand{display:flex; gap:10px; align-items:center;}
.logo{
  width:36px; height:36px; border-radius:10px;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  box-shadow: var(--shadow);
}
.title{font-weight:800; letter-spacing:.2px}
.subtitle{font-size:12px; color:var(--muted)}

.top-actions{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.top-actions > .ghost:not(.smallpill){
  width:42px;
  height:42px;
  padding:0;
}
.sync-dot{
  width:42px;
  height:42px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  background:#fff;
  box-shadow: var(--shadow);
  cursor:pointer;
  touch-action:manipulation;
}
.sync-dot::after{
  content:'';
  width:16px;
  height:16px;
  border-radius:999px;
  background: currentColor;
  box-shadow: 0 0 0 1px rgba(15,23,42,.14);
}
.sync-dot.green{color: rgba(22,163,74,.95)}
.sync-dot.orange{color: rgba(234,179,8,.95)}
.sync-dot.red{color: rgba(220,38,38,.95)}
button{
  border:1px solid var(--line);
  background:#fff;
  color:var(--ink);
  border-radius:12px;
  padding:10px 12px;
  font-weight:400;
  cursor:pointer;
  touch-action: manipulation;
}
button,
.smallpill,
.iconbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
button.big{padding:16px 14px; font-size:16px}
button.primary{
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color:#fff;
  border-color: transparent;
  font-weight:700;
}
button.ghost{
  background:transparent;
}
button.ghost.warning{
  background:#fff7ed;
  border-color:#fdba74;
  color:#9a3412;
}

button:active{transform: translateY(1px)}
.container{max-width:1100px; margin: 18px auto; padding:0 14px 40px;}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}
h1{margin: 0 0 10px 0; font-size:22px}
p{margin:8px 0}
.muted{color:var(--muted)}
.small{font-size:12px}
.req{color:#dc2626; font-weight:800}
.hidden{display:none !important}

.banner{
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
  padding:10px 12px;
  border-radius:12px;
  margin-bottom:12px;
}

.form-row{margin:10px 0}
label{display:block; font-size:13px; font-weight:700; margin-bottom:6px}
input{
  width:100%;
  padding:12px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  font-size:16px;
}
input:disabled{background:#f8fafc; color:var(--muted)}
.form-actions{display:flex; justify-content:flex-start; gap:10px; margin-top:14px; flex-wrap:wrap}
.form-actions .primary{order:0}
.form-actions .ghost{order:1}

.grid2{display:grid; gap:10px; grid-template-columns: repeat(2, minmax(0,1fr));}
@media (max-width: 640px){ .grid2{grid-template-columns:1fr} }

.hint{
  margin-top:14px;
  padding:12px;
  border:1px dashed var(--line);
  border-radius:12px;
  color:var(--muted);
  font-size:13px;
}

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

.pinseg-input{
  text-align:center;
  font-size:22px;
  font-weight:900;
  padding:12px 0;
}

.list .item.active{
  border-color: rgba(31,79,191,.35);
  background: rgba(31,79,191,.06);
  box-shadow: inset 0 0 0 1px rgba(31,79,191,.10);
}

.segmented{
  display:flex;
  gap:8px;
}
.seg{
  flex:1;
  padding:10px 12px;
  border-radius:12px;
  background:#fff;
}
.seg.active{
  background: rgba(31,79,191,.10);
  border-color: rgba(31,79,191,.35);
}

.row{display:flex; align-items:center}
.between{justify-content:space-between}
.gap{gap:10px}
.wrap{flex-wrap:wrap}

.vehicle-area{
  display:grid;
  gap:14px;
  grid-template-columns: repeat(2, minmax(0,1fr));
  margin-top:10px;
}
@media (max-width: 900px){ .vehicle-area{grid-template-columns:1fr} }

.vehicle-col{
  padding:8px;
  width:100%;
  max-width:760px;
  margin:0 auto;
}
.vehicle-title{font-weight:800; margin: 2px 0 8px 0}
.vehicle{
  position:relative;
  height:320px;
  border:1px solid var(--line);
  border-radius:16px;
  background: #f8fafc;
  overflow:hidden;
}
.vehicle-silhouette{
  position:absolute; inset:30px 90px 30px 90px;
  border-radius: 70px;
  border:2px solid rgba(15,23,42,.35);
  background: rgba(15,23,42,.03);
}
.moto-silhouette{
  position:absolute; inset:30px 120px 30px 120px;
  border-radius: 30px;
  border:2px solid rgba(15,23,42,.35);
  background: rgba(15,23,42,.03);
}

.pos{
  width:26px; height:26px;
  border-radius:6px;
  background: rgba(31,79,191,.85);
  border:2px solid rgba(15,23,42,.15);
  position:absolute;
  cursor:pointer;
}
.pos.done{ background: rgba(22,163,74,.95); }
.pos:active{ transform: scale(.98); }

.pos-vl{ left:26px; top:72px}
.pos-vr{ right:26px; top:72px}
.pos-hl{ left:26px; bottom:72px}
.pos-hr{ right:26px; bottom:72px}

.pos-v{ left:40px; top:70px}
.pos-h{ left:40px; bottom:70px}

.legend{margin-top:10px; color:var(--muted); font-size:13px}
.badge{display:inline-block; width:14px; height:14px; border-radius:4px; vertical-align:middle; margin-right:6px; border:1px solid rgba(15,23,42,.12)}
.badge.red{background: var(--red)}
.badge.green{background: rgba(22,163,74,.9)}

.table-wrap{overflow:auto; border:1px solid var(--line); border-radius:14px; margin-top:10px}
.tbl{width:100%; border-collapse:collapse; min-width:960px; background:#fff}
.tbl th,.tbl td{padding:10px 10px; border-bottom:1px solid var(--line); text-align:left; font-size:14px; vertical-align:middle}
.tbl th{background:#f8fafc; font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted)}
.tbl .col-status{white-space:nowrap; min-width:118px;}
.tbl .col-pos{width:164px; min-width:164px;}
.tbl .col-actions{width:132px; min-width:132px; white-space:nowrap;}
.status-pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px; border-radius:12px;
  border:1px solid var(--line); font-weight:750; font-size:12px;
}
.dot{width:10px; height:10px; border-radius:3px}
.dot.green{background: rgba(22,163,74,.9)}
.dot.yellow{background: rgba(234,179,8,.9)}
.pos-buttons{display:flex; gap:6px; flex-wrap:wrap; min-width:154px;}
.posbtn{
  width:34px; height:34px;
  border-radius:10px;
  border:1px solid rgba(15,23,42,.12);
  background: var(--red);
  padding:0;
}
.posbtn.done{ background: rgba(22,163,74,.95); }
.posbtn:disabled{opacity:.25}

.empty{margin:14px 0; padding:14px; border:1px dashed var(--line); border-radius:12px; color:var(--muted)}

.modal,.img-modal{
  position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
  padding:14px; background: rgba(2,6,23,.55); z-index:50;
}
.modal-card,.img-modal-card{
  width:min(720px, 100%);
  background:#fff; border-radius:18px; padding:14px;
  border:1px solid rgba(255,255,255,.2);
  box-shadow: var(--shadow);
}
.img-modal{
  padding:18px;
}
.img-modal-card{
  width:min(1100px, 100%);
  max-width:100%;
  max-height:calc(100vh - 36px);
  overflow:auto;
}
.img-modal-card img{
  display:block;
  width:auto;
  max-width:100%;
  max-height:calc(100vh - 130px);
  margin:12px auto 0;
  object-fit:contain;
}
@media (max-width: 640px){
  .img-modal{
    align-items:flex-start;
    padding:8px;
  }
  .img-modal-card{
    width:100%;
    max-height:calc(100dvh - 16px);
    padding:10px;
    border-radius:14px;
  }
  .img-modal-card img{
    max-height:calc(100dvh - 88px);
    margin-top:10px;
  }
}
.camera-step{margin-top:10px}
.preview-wrap{
  width:100%;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:#0b1220;
}
.preview-wrap img{width:100%; display:block; max-height: 56vh; object-fit:contain}
.strong{font-weight:850}

.viewer-grid{
  display:grid; gap:12px;
  grid-template-columns: repeat(4, minmax(0,1fr));
  margin-top:12px;
}
@media (max-width: 900px){ .viewer-grid{grid-template-columns: repeat(2, minmax(0,1fr));} }
.viewer-tile{
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px;
  background:#fff;
}
.viewer-tile .poslabel{font-weight:900; margin-bottom:8px}
.viewer-tile img{
  width:100%; height:170px; object-fit:cover;
  border-radius:12px;
  border:1px solid var(--line);
  background:#f8fafc;
  cursor:pointer;
}
.viewer-tile .actions{display:flex; gap:8px; margin-top:8px; flex-wrap:wrap}


/* --- Kennzeichen (Plate Widget) --- */
.plate{
  border:1px solid var(--line);
  border-radius: 14px;
  padding:10px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.plate-top{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-bottom:10px;
}
.plate-eu{
  display:inline-flex; align-items:center; justify-content:center;
  width:44px; height:26px; border-radius:8px;
  background: var(--blue);
  color:#fff; font-weight:900; letter-spacing:.04em;
  border:1px solid rgba(255,255,255,.2);
}
.plate-boxes{
  display:flex; gap:8px; flex-wrap:wrap;
  padding:10px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--line);
  min-height:54px;
  outline:none;
}
.plate-box{
  min-width:28px;
  padding:10px 10px;
  border-radius:10px;
  border:1px solid rgba(15,23,42,.12);
  background:#f8fafc;
  text-align:center;
  font-weight:900;
  font-size:18px;
}
.plate-caret{
  width:10px;
  border-radius:10px;
  background: rgba(31,79,191,.25);
  border:1px solid rgba(31,79,191,.25);
  animation: blink 1s infinite;
}
@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:.2} }

/* --- Mobile tuning (Galaxy S23 u.ä.) --- */
@media (max-width: 420px){
  .topbar{padding:10px 10px}
  .container{margin: 12px auto; padding: 0 10px 28px}
  .card{padding:12px}
  h1{font-size:20px}
  button{padding:10px 10px; border-radius:12px}
  .top-actions{gap:6px}
  .top-actions > .ghost:not(.smallpill),
  .sync-dot{
    width:38px;
    height:38px;
    border-radius:12px;
  }
  .smallpill{
    height:38px;
    padding:0 8px;
  }
  .top-actions .ghost .appicon,
  .smallpill .appicon{
    width:25px;
    height:25px;
  }
  .vehicle-area{grid-template-columns:1fr}
  .vehicle{height:260px}
  .vehicle-silhouette{inset:26px 70px 26px 70px}
  .moto-silhouette{inset:26px 90px 26px 90px}
  input{font-size:16px}
}

.sr{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}


/* Plate country picker */
.plate-countries{display:flex; gap:6px; flex-wrap:wrap}
.cbtn{
  padding:6px 8px;
  border-radius:10px;
  font-weight:850;
  font-size:12px;
  background:#fff;
}
.cbtn.active{
  background: rgba(31,79,191,.10);
  border-color: rgba(31,79,191,.35);
}

.plate-boxes{position:relative}
.plate-boxes{position:relative}
.plate-input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:none;
  outline:none;
  background:transparent;
  opacity:0.02;          /* keep focusable + keyboard */
  color:#0f172a;
  caret-color:#0f172a;
  font-size:16px;        /* avoid zoom on iOS */
  padding:10px;
  z-index:2;
}

/* Type icons */
.typicon{font-size:18px; line-height:1}

/* Portrait-first: avoid wide tables; show cards on small screens */
.jobcards{display:none; gap:10px; margin-top:10px}
.jobcard{
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  background:#fff;
}
.jobcard .top{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}
.jobcard .top-left{min-width:0}
.jobcard .top-right{display:flex; flex-direction:column; align-items:flex-end; gap:8px}
.jobcard .kz{font-weight:950; font-size:18px}
.jobcard .meta{color:var(--muted); font-size:12px; margin-top:6px}
.jobcard .card-bottom{display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:10px}
.jobcard .pos-slot{min-width:0}
.jobcard .card-actions{display:flex; gap:8px; align-items:center; justify-content:flex-end; flex-direction:row; flex-wrap:nowrap}
.iconbtn{
  width:34px; height:34px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.12);
  background:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
}
.iconbtn:active{transform: translateY(1px)}

.appicon{
  width:30px;
  height:30px;
  flex:0 0 30px;
  display:block;
}

.iconbtn .appicon,
.top-actions .ghost .appicon,
.smallpill .appicon{
  width:30px;
  height:30px;
}

.smallpill{
  padding:8px 10px;
}

@media (max-width: 780px){
  .table-wrap{display:none}
  .jobcards{display:grid}
.topbar .top-actions{justify-content:flex-end}
}

@media (max-width: 1024px) and (orientation: portrait){
  .container{
    padding:0 12px 32px;
  }

  .topbar{
    align-items:flex-start;
    gap:12px;
  }

  .brand{
    min-width:0;
    flex:1 1 auto;
  }

  .brand > div{
    min-width:0;
  }

  .top-actions{
    justify-content:flex-end;
    gap:6px;
    flex:0 0 auto;
  }

  #viewList .row.gap.wrap{
    align-items:stretch;
  }

  #viewList #searchInput{
    flex:1 1 100%;
    min-width:0;
  }

  #viewList #btnNew{
    flex:1 1 100%;
  }

  .table-wrap{
    display:none;
  }

  .jobcards{
    display:grid;
  }

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



.logoimg{
  height:34px;
  width:auto;
  display:block;
  -webkit-user-drag:none;
  user-select:none;
}

.brand-logo-link,
.brand > a,
.site-brand > a{
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--red);
  border-radius:10px;
  padding:4px;
}
.brand{gap:12px}

.settings-user-actions{
  justify-content:flex-end;
}

.settings-user-actions .iconbtn{
  flex:0 0 auto;
}

@media (max-width: 640px){
  #viewSettings .list .item{
    align-items:flex-start;
    flex-direction:row;
    flex-wrap:wrap;
  }

  .settings-user-actions{
    width:100%;
    justify-content:flex-end;
    gap:8px;
  }

  .settings-user-actions .ghost:not(.warning){
    flex:0 1 auto;
  }

  .settings-user-actions .btn-role,
  .settings-user-actions .btn-pin,
  .settings-user-actions .btn-unlock{
    min-height:38px;
    padding:8px 12px;
  }

  .settings-user-actions .btn-delete{
    margin-left:0;
  }

  #viewSettings .form-actions{
    row-gap:8px;
  }

  .settings-stats{
    grid-template-columns:1fr;
  }
}

.settings-user-modal-card{
  width:min(420px, 100%);
}

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

.settings-stat-card{
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--card);
  padding:12px;
}

.settings-stat-head{
  display:block;
}

.settings-stat-label{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.settings-stat-body{
  display:flex;
  align-items:baseline;
  justify-content:flex-end;
  min-height:34px;
  margin-top:4px;
}

.settings-stat-value{
  font-size:24px;
  line-height:1;
}

.settings-stat-bar{
  margin-top:10px;
  width:100%;
  height:12px;
  border-radius:999px;
  background:#e2e8f0;
  overflow:hidden;
}

.settings-stat-fill{
  display:block;
  height:100%;
  border-radius:999px;
}

.settings-stat-fill.is-blue{ background:linear-gradient(90deg, #1f4fbf, #2b63ff); }
.settings-stat-fill.is-slate{ background:linear-gradient(90deg, #475569, #64748b); }
.settings-stat-fill.is-green{ background:linear-gradient(90deg, #15803d, #22c55e); }
.settings-stat-fill.is-orange{ background:linear-gradient(90deg, #d97706, #f59e0b); }

.dialog-status{
  min-height:20px;
  margin-top:8px;
}

.dialog-status.is-error{
  color:#b91c1c !important;
  background:#fef2f2;
  border:1px solid #fecaca;
  border-radius:12px;
  padding:8px 10px;
}

.dialog-status.is-info{
  color:#1e3a8a !important;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  border-radius:12px;
  padding:8px 10px;
}

.add-user-foreman{
  display:flex;
  width:100%;
  margin-bottom:0;
  align-items:flex-start;
  justify-content:flex-start;
  white-space:normal;
  font-weight:650;
  gap:0;
  padding-top:4px;
}
.add-user-foreman input[type="checkbox"]{
  width:22px;
  height:22px;
  margin:0;
}

#previewComment,
#reasonModalInput{
  width:100%;
  min-width:100%;
  max-width:100%;
  resize:vertical;
}

/* Country-specific plate framing (simple prototype) */
.plate{ position:relative }
.plate::before{
  content:'';
  position:absolute;
  left:10px; top:48px;
  width:44px; height:54px;
  border-radius:10px;
  background: var(--blue);
}
.plate[data-country="NL"]::before{ background:#1f4fbf; }
.plate[data-country="B"]::before{ background:#1f4fbf; }
.plate[data-country="L"]::before{ background:#1f4fbf; }
.plate[data-country="F"]::before{ background:#1f4fbf; }
.plate[data-country="CH"]::before{ background:#1f4fbf; }
.plate[data-country="A"]::before{ background:#1f4fbf; }
.plate[data-country="UA"]::before{ background:#1f4fbf; }
/* Keep content above */
.plate-top, .plate-boxes{position:relative; z-index:1}


.vehicle-area{
  grid-template-columns: 1fr;
}

.vehicle-col{
  display:block !important;
}

.vehicle-auto, .vehicle-moto{
  background: #f8fafc url('./assets/vehicle-combined.png') center/contain no-repeat;
  height:420px;
}

.vehicle-auto .vehicle-silhouette,
.vehicle-moto .moto-silhouette{
  display:none;
}

/* Precise hotspot alignment (percent based for scaling) */
.vehicle-auto .pos-vl{ left: 10%; top: 28%; }
.vehicle-auto .pos-vr{ right: 10%; top: 28%; }
.vehicle-auto .pos-hl{ left: 10%; bottom: 20%; }
.vehicle-auto .pos-hr{ right: 10%; bottom: 20%; }

.vehicle-moto .pos-v{ left: 73%; top: 28%; }
.vehicle-moto .pos-h{ left: 73%; bottom: 20%; }

.vehicle .pos{
  width:56px; height:56px;
  border-radius:14px;
  background: var(--red);
  border:3px solid rgba(15,23,42,.18);
  box-shadow: 0 10px 26px rgba(2,6,23,.20);
  position:absolute;
  cursor:pointer;
}


/* 4-type segmented */
.segmented.seg4 .seg{flex:1}

/* Generic vehicle image container */
.vehicle-area{grid-template-columns:1fr}
.vehicle-generic{
  background:#fff;
  background-position:center;
  background-repeat:no-repeat;
  background-size:auto 74%;
  height:420px;
  width:100%;
  max-width:760px;
  margin:0 auto;
}
.vehicle-generic[data-typ="auto"]{ background-image:url('./assets/auto.png'); }
.vehicle-generic[data-typ="motorrad"]{ background-image:url('./assets/moto.png'); }
.vehicle-generic[data-typ="anhaenger1"]{ background-image:url('./assets/trailer1.png'); }
.vehicle-generic[data-typ="anhaenger2"]{ background-image:url('./assets/trailer2.png'); }

/* Hide all hotspots; enable per type */
.vehicle-generic .pos{ display:none; }
.vehicle-generic[data-typ="auto"] .pos-vl,
.vehicle-generic[data-typ="auto"] .pos-vr,
.vehicle-generic[data-typ="auto"] .pos-hl,
.vehicle-generic[data-typ="auto"] .pos-hr{ display:block; }

.vehicle-generic[data-typ="motorrad"] .pos-v,
.vehicle-generic[data-typ="motorrad"] .pos-h{ left: 18%; bottom: 22%; }

.vehicle-generic[data-typ="anhaenger1"] .pos-l,
.vehicle-generic[data-typ="anhaenger1"] .pos-r{ display:block; }

.vehicle-generic[data-typ="anhaenger2"] .pos-vl,
.vehicle-generic[data-typ="anhaenger2"] .pos-vr,
.vehicle-generic[data-typ="anhaenger2"] .pos-hl,
.vehicle-generic[data-typ="anhaenger2"] .pos-hr{ display:block; }

/* Hotspot positions tuned */
.vehicle-generic[data-typ="auto"] .pos-vl{ left: 10%; top: 30%; }
.vehicle-generic[data-typ="auto"] .pos-vr{ right: 10%; top: 30%; }
.vehicle-generic[data-typ="auto"] .pos-hl{ left: 10%; bottom: 20%; }
.vehicle-generic[data-typ="auto"] .pos-hr{ right: 10%; bottom: 20%; }

.vehicle-generic[data-typ="motorrad"] .pos-v{ left: 18%; top: 30%; }
.vehicle-generic[data-typ="motorrad"] .pos-h{ left: 18%; bottom: 22%; }

.vehicle-generic[data-typ="anhaenger1"] .pos-l{ left: 18%; top: 55%; }
.vehicle-generic[data-typ="anhaenger1"] .pos-r{ right: 18%; top: 55%; }

.vehicle-generic[data-typ="anhaenger2"] .pos-vl{ left: 16%; top: 45%; }
.vehicle-generic[data-typ="anhaenger2"] .pos-vr{ right: 16%; top: 45%; }
.vehicle-generic[data-typ="anhaenger2"] .pos-hl{ left: 16%; bottom: 18%; }
.vehicle-generic[data-typ="anhaenger2"] .pos-hr{ right: 16%; bottom: 18%; }


/* Centering tweak: the cropped PNGs have asymmetric whitespace */
.vehicle-generic[data-typ="auto"]{ background-position: 50% center; }
.vehicle-generic[data-typ="motorrad"]{ background-position: 50% center; }
.vehicle-generic[data-typ="anhaenger1"]{ background-position: 50% center; }
.vehicle-generic[data-typ="anhaenger2"]{ background-position: 50% center; }


/* auto-center-narrow */
@media (max-width: 420px){
  .vehicle-generic[data-typ="auto"]{
    background-position: 52% center;
  }
}

.badge.blue{background: rgba(31,79,191,.85)}

.typsvg{
  width:34px;
  height:34px;
  color: currentColor;
}
.segmented .seg{
  min-height:58px;
}

/* Type selector icons (use small images for consistency) */
.typeimg{
  width:42px;
  height:42px;
  object-fit:contain;
  display:block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 10px rgba(2,6,23,.12));
}
.segmented.seg4 .seg{
  padding:10px 6px;
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* portrait-center-all */
@media (max-width: 420px){
  .vehicle-generic{ background-position: 50% center !important; }
}

.vehicle .pos.done{ background: rgba(22,163,74,.95) !important; }

/* Enforce preview button order without leaving the common form-actions system */
.preview-actions{
  margin-top:12px;
}

#viewCapture .preview-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-start;
  gap:10px;
}

#btnUsePhoto{ order:1; }
#btnPickAgain{ order:2; }
#btnRetake{ order:3; }


/* === FINAL OVERRIDES (fix moto hotspots) === */
.vehicle-generic .pos{ display:none; } /* reset */
.vehicle-generic[data-typ="auto"] .pos-vl,
.vehicle-generic[data-typ="auto"] .pos-vr,
.vehicle-generic[data-typ="auto"] .pos-hl,
.vehicle-generic[data-typ="auto"] .pos-hr{ display:block; }

.vehicle-generic[data-typ="motorrad"] .pos-v,
.vehicle-generic[data-typ="motorrad"] .pos-h{ display:block; }

.vehicle-generic[data-typ="anhaenger1"] .pos-l,
.vehicle-generic[data-typ="anhaenger1"] .pos-r{ display:block; }

.vehicle-generic[data-typ="anhaenger2"] .pos-vl,
.vehicle-generic[data-typ="anhaenger2"] .pos-vr,
.vehicle-generic[data-typ="anhaenger2"] .pos-hl,
.vehicle-generic[data-typ="anhaenger2"] .pos-hr{ display:block; }

/* Place motorcycle hotspots left beside the bike */
.vehicle-generic[data-typ="motorrad"] .pos-v{ left: 14%; top: 30%; }
.vehicle-generic[data-typ="motorrad"] .pos-h{ left: 14%; bottom: 22%; }


/* Keep all vehicle types visually consistent (no auto-specific scaling) */

.seg[data-typ="auto"] .typeimg{
  transform: scale(0.75);
  transform-origin: center;
}

/* Kennzeichen segmented input (smartphone-friendly) */
.kzseg{
  display:flex;
  align-items:center;
  gap:8px;
}
.kzpart, .kznum, .kzfull{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 12px;
  font-size:18px;
  font-weight:900;
  text-transform:uppercase;
  background:#fff;
  min-width:0;
}
.kzpart{ width: 28%; text-align:center; }
.kznum{ flex:1; text-align:center; }
.kzdash{ font-weight:900; opacity:.6; }
.kzfull{ width:100%; }
.kzfull::placeholder{ text-transform:none; }

@media (max-width: 420px){
  .kzpart, .kznum, .kzfull{ font-size:18px; padding:12px 10px; }
}


/* === FINAL AUTO CENTER/SIZE (beats generic portrait rules) === */
.vehicle-generic[data-typ="auto"]{ background-size:auto 76% !important; }
.vehicle-generic[data-typ="motorrad"]{ background-size:auto 72% !important; }
.vehicle-generic[data-typ="anhaenger1"]{ background-size:auto 70% !important; }
.vehicle-generic[data-typ="anhaenger2"]{ background-size:auto 72% !important; }
@media (max-width: 420px){
  .vehicle-generic[data-typ="auto"]{ background-size:auto 70% !important; }
  .vehicle-generic[data-typ="motorrad"]{ background-size:auto 66% !important; }
  .vehicle-generic[data-typ="anhaenger1"]{ background-size:auto 64% !important; }
  .vehicle-generic[data-typ="anhaenger2"]{ background-size:auto 66% !important; }
}

.smallpill{
  height:42px;
  border-radius:12px;
  padding:0 10px;
}
.list{ display:flex; flex-direction:column; gap:10px; }
.list .item{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background:#fff;
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
}
.list .item .name{ font-weight:900; }

#loginCredentials .form-actions{
  margin-top:16px;
}

.tenant-admin-access-seg{
  justify-content:flex-start;
  gap:8px;
}

.tenant-admin-access-seg .pinseg-input{
  width:48px;
  min-width:48px;
  height:48px;
  padding:0;
}


/* Viewer actions (bottom-right like positions page) */
.viewer-actions{
  margin-top:12px;
  justify-content:flex-start;
}
.viewer-actions .primary{order:0}
.viewer-actions .ghost{order:1}

.table-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:nowrap;
}

.brand-logo-link .logoimg{
  height:34px;
  width:auto;
}

@media (max-width: 640px){
  .top-actions{
    display:grid;
    grid-template-columns: repeat(4, 38px);
    grid-auto-rows: 38px;
    justify-content:end;
    justify-items:end;
    align-items:start;
    gap:6px;
  }
  #btnInstall{ grid-column:1; grid-row:1; }
  #btnHome{ grid-column:2; grid-row:1; }
  #btnSettings{ grid-column:3; grid-row:1; }
  #syncDot{ grid-column:4; grid-row:1; }
  #userBadge{
    grid-column:1 / span 3;
    grid-row:2;
    width:100%;
    justify-content:flex-start;
  }
  #btnLogout{ grid-column:4; grid-row:2; }
  .topbar{
    align-items:flex-start;
  }
  .brand{
    align-items:center;
  }
  .brand > div{
    padding-top:0;
    min-height:38px;
    display:flex;
    flex-direction:column;
    justify-content:center;
  }
  .title{
    font-size:16px;
    line-height:1.1;
    white-space:nowrap;
  }
  .subtitle{
    margin-top:2px;
    line-height:1.15;
  }
  .top-actions > .ghost:not(.smallpill),
  .sync-dot{
    width:38px !important;
    height:38px !important;
    border-radius:12px;
  }
  .smallpill{
    height:38px !important;
    padding:0 8px !important;
  }
  .top-actions .ghost .appicon,
  .smallpill .appicon{
    width:25px !important;
    height:25px !important;
    flex-basis:25px !important;
  }
}
