/* Key2Drive – minimal, edel, grau */
:root{
  --bg:#121316;
  --panel:#1a1c20;
  --panel2:#16181c;
  --text:#e9e9ef;
  --muted:#a8acb7;
  --line:#2a2d35;
  --btn:#2b2e36;
  --btn2:#3a3e48;
  --good:#2ecc71;
  --bad:#ff5c5c;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:16px;
  --radius2:12px;
  font-synthesis-weight:none;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 500px at 20% 0%, #1b1f27 0%, var(--bg) 55%) fixed;
  color:var(--text);
}
.shell{
  max-width: 860px;
  margin: 18px auto 40px;
  padding: 14px;
}
.top{
  display:flex;
  gap:14px;
  align-items:stretch;
  justify-content:space-between;
  flex-wrap:wrap;
}
.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px 16px;
  background: linear-gradient(180deg, #1b1e26, #14161a);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 260px;
}
.logo{
  width:44px;height:44px;
  border-radius:14px;
  display:grid;place-items:center;
  background: linear-gradient(180deg, #2b2f38, #1d2027);
  border:1px solid var(--line);
  font-weight:800;
  letter-spacing:.5px;
}
.brand-name{font-weight:800; font-size:18px}
.brand-sub{color:var(--muted); font-size:12px; margin-top:2px}
.top-partner-btn{
  margin-left:auto;
  padding:10px 14px;
  font-size:13px;
  white-space:nowrap;
}
.car{
  flex: 1 1 360px;
  padding:14px 16px;
  background: linear-gradient(180deg, #1b1e26, #14161a);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.videoWrap{
  margin-bottom: 10px;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius2);
  background: #000;
}
#carVideo{
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  object-fit: cover;
  background: #000;
  cursor: pointer;
}
.video-toggle-btn{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.3);
  margin: 0;
  padding: 0;
  background: rgba(8, 10, 14, .52);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(3px);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.video-toggle-btn[hidden]{
  display:none !important;
}
.video-toggle-btn:hover{
  background: rgba(8, 10, 14, .64);
}
.video-toggle-btn:active{
  transform: translate(-50%, -50%) scale(.98);
}
.video-toggle-btn.is-playing{
  opacity: .82;
}
.video-toggle-icon{
  font-size: 26px;
  line-height: 1;
  transform: none;
}
.video-toggle-btn.is-playing .video-toggle-icon{
  transform: none;
  font-size: 22px;
}
.video-scrub-wrap{
  display: flex;
  align-items: center;
  border-radius: 999px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(18, 22, 28, .9);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.video-scrub-wrap[hidden]{
  display:none !important;
}
.video-seek{
  width: 100%;
  margin: 0;
  accent-color: #9fc8ff;
}
.video-seek:disabled{
  opacity: .45;
}
.car-title{font-weight:800; font-size:16px}
.car-meta{color:var(--muted); font-size:12px; margin-top:6px; line-height:1.35}
.actions{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:10px;
}
@media (max-width: 720px){
  .actions{grid-template-columns:1fr}
}
.plate-check-card{
  margin-top: 12px;
  padding: 16px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.plate-check-head p{
  margin:0 0 10px;
}
.plate-check-form{
  display:grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) auto;
  gap:10px;
  align-items:end;
}
.pc-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.pc-field span{
  color:var(--muted);
  font-size:12px;
}
.pc-field input{
  width:100%;
  padding:12px 12px;
  border-radius: var(--radius2);
  border:1px solid var(--line);
  background:#0f1014;
  color:var(--text);
  text-transform:uppercase;
}
.pc-prefix input{
  letter-spacing:.6px;
}
#pc_numbers{
  text-transform:none;
}
#btnPlateCheck{
  min-height:44px;
  white-space:nowrap;
}
.plate-check-meta{
  margin-top:10px;
}
.plate-check-meta strong{
  color:var(--text);
}
.plate-preview{
  margin-top:8px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px dashed #3a3f49;
  border-radius:999px;
  padding:6px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size:13px;
}
.panel{
  margin-top: 12px;
  padding: 16px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hidden{display:none}
.hint{
  color:var(--muted);
  padding:10px 12px;
  background:#111216;
  border:1px dashed #2d313a;
  border-radius: var(--radius2);
}
h2{margin:0 0 8px}
h3{margin:18px 0 8px}
.muted{color:var(--muted)}
.small{font-size:12px}

.btn{
  appearance:none;
  border:1px solid var(--line);
  background: linear-gradient(180deg, var(--btn2), var(--btn));
  color:var(--text);
  padding: 12px 14px;
  border-radius: var(--radius2);
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-weight:700;
  box-shadow: 0 8px 16px rgba(0,0,0,.25);
}
.btn:hover{filter:brightness(1.07)}
.btn:active{transform: translateY(1px)}
.btn-primary{
  background: linear-gradient(180deg, #404554, #2b2f3a);
}
.btn-call{
  border-color: rgba(46, 204, 113, .35);
  background: linear-gradient(180deg, rgba(46,204,113,.22), rgba(46,204,113,.10));
}
.btn.disabled, .btn:disabled{
  opacity:.45;
  cursor:not-allowed;
  text-decoration: line-through;
}
.navrow{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.callbox{
  margin-top: 12px;
  border:1px solid var(--line);
  border-radius: var(--radius2);
  overflow:hidden;
}
.callbox-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 12px;
  gap:12px;
  background: rgba(255,255,255,.02);
  border-top:1px solid var(--line);
}
.callbox-row:first-child{border-top:none}
.callbox-row.subtle{background: rgba(255,255,255,.01)}
.callbox-title{font-weight:800}
.callbox-sub{color:var(--muted); font-size:12px; margin-top:2px}

.checkgrid{
  display:grid;
  gap:10px;
}
.checkitem{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.02);
}
.checklabel{font-weight:700}
.checkopts{color:var(--muted); display:flex; gap:10px; align-items:center}
.checkopts input{accent-color:#7f8cff}

.status{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius2);
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.status.good{border-color: rgba(46,204,113,.35); background: rgba(46,204,113,.08)}
.status.bad{border-color: rgba(255,92,92,.35); background: rgba(255,92,92,.08)}
.plate-check-status.pending{border-color: rgba(126,165,255,.35); background: rgba(126,165,255,.08)}

.formgrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 720px){
  .plate-check-form{
    grid-template-columns: 1fr 1fr;
  }
  .pc-prefix{
    grid-column:1 / -1;
  }
  #btnPlateCheck{
    grid-column:1 / -1;
  }
  .formgrid{grid-template-columns:1fr}
}
.formgrid label{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.formgrid label span{color:var(--muted); font-size:12px}
.formgrid input, .formgrid textarea{
  padding:12px 12px;
  border-radius: var(--radius2);
  border:1px solid var(--line);
  background:#0f1014;
  color:var(--text);
}
.formgrid textarea{resize:vertical}
.formgrid .full{grid-column:1/-1}

.tablewrap{margin-top:12px; overflow:auto}
.table{
  width:100%;
  border-collapse: collapse;
  min-width: 520px;
}
.table th, .table td{
  text-align:left;
  padding:10px 10px;
  border-bottom:1px solid var(--line);
}
.table th{color:var(--muted); font-weight:800; font-size:12px}
.foot{margin-top:12px; text-align:center}
.staff-entry{
  margin-top:10px;
}
.staff-entry a{
  color:var(--muted);
  text-decoration:none;
  border-bottom:1px dashed rgba(255,255,255,.22);
  padding-bottom:2px;
}
.staff-entry a:hover{
  color:var(--text);
  border-bottom-color:rgba(255,255,255,.45);
}

.brand-wide{
  width:100%;
}

.page-title{
  margin:0 0 8px;
  font-size:22px;
}

.inventory-filter{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}

.inventory-filter label{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.inventory-filter label span{
  color:var(--muted);
  font-size:12px;
}

.inventory-filter input,
.inventory-filter select{
  padding:12px;
  border-radius: var(--radius2);
  border:1px solid var(--line);
  background:#0f1014;
  color:var(--text);
}

.inventory-filter-actions{
  display:flex;
  gap:10px;
  align-items:flex-end;
}

.inventory-meta-row{
  margin-top:10px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.inventory-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:10px;
}

.inventory-card{
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.02);
  padding:12px;
  display:grid;
  gap:10px;
}

.inventory-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.inventory-card-head h3{
  margin:0;
  font-size:15px;
}

.inventory-pill{
  border:1px solid var(--line);
  border-radius:999px;
  padding:4px 8px;
  font-size:11px;
  color:var(--muted);
}

.inventory-title{
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.inventory-facts{
  display:grid;
  gap:6px;
  color:var(--text);
  font-size:13px;
}

.inventory-actions{
  display:flex;
  justify-content:flex-start;
  align-items:center;
  gap:8px;
}

.inventory-empty{
  border:1px dashed var(--line);
  border-radius: var(--radius2);
  padding:14px;
  color:var(--muted);
  grid-column:1 / -1;
}

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

.admin-headline{
  margin:0;
}

.btn-delete-vehicle{
  padding:6px 10px;
  min-height:32px;
  font-size:12px;
  font-weight:600;
}

.wally-toggle-fab{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:10001;
  border-color: rgba(107, 229, 255, 0.45);
  background: linear-gradient(180deg, rgba(107,229,255,.28), rgba(107,229,255,.10));
  min-height:40px;
  padding:0 14px;
  border-radius:999px;
}

.wally-dock{
  position:fixed;
  right:16px;
  bottom:16px;
  width:214px;
  z-index:10000;
  user-select:none;
  -webkit-user-select:none;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform: translateY(8px) scale(.98);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.wally-dock.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:none;
}

.wally-widget{
  width:214px;
  display:grid;
  justify-items:center;
  gap:8px;
  background: transparent;
}

.wally-portrait{
  position: relative;
  width: 188px;
  height: 188px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(107, 229, 255, 0.24);
  background:
    radial-gradient(210px 210px at 50% 32%, rgba(107, 229, 255, 0.18), transparent 72%),
    rgba(255, 255, 255, 0.02);
}

.wally-pulse{
  position: absolute;
  width: 172px;
  height: 172px;
  border-radius: 999px;
  border: 1px solid rgba(107, 229, 255, 0.3);
  animation: wallyPulse 2.8s infinite ease-out;
}

.wally-svg{
  width: 158px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.3));
}

.w-line{
  stroke: #111;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.w-head,
.w-ear,
.w-eye-ring{
  fill:#fcfeff;
  stroke:#111;
  stroke-width:6;
}

.w-pupil{fill:#0d1318}
.w-highlight{fill:#fff}

.w-mouth-open{
  opacity:0;
  transform-box: fill-box;
  transform-origin:center;
}

.wally-portrait.is-speaking .w-mouth-smile{opacity:0}

.wally-portrait.is-speaking .w-mouth-open{
  opacity:1;
  animation:wallyTalkMouth .16s ease-in-out infinite alternate;
}

.w-eye-left-pupil,
.w-eye-right-pupil{
  transform-box: fill-box;
  transform-origin:center;
  transition: transform .22s ease;
}

.wally-portrait.is-speaking .w-eye-left-pupil,
.wally-portrait.is-speaking .w-eye-right-pupil{
  transition-duration:.12s;
}

.wally-portrait.is-speaking .w-blink{
  animation:wallyBlink 2.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin:center top;
}

.wally-portrait.is-listening{
  border-color: rgba(107, 229, 255, 0.55);
  box-shadow: 0 0 26px rgba(107, 229, 255, 0.24);
}

.wally-portrait.is-listening .w-eye-ring{
  stroke: #5ee4ff;
  filter: drop-shadow(0 0 8px rgba(94, 228, 255, 0.45));
}

.wally-portrait.is-thinking{
  border-color: rgba(255, 214, 140, 0.55);
  box-shadow:
    0 0 28px rgba(255, 214, 140, 0.16),
    0 0 0 1px rgba(255, 214, 140, 0.16) inset;
}

.wally-portrait.is-thinking::after{
  content:'';
  position:absolute;
  inset:-7px;
  border-radius:999px;
  border:1px solid rgba(255, 214, 140, 0.46);
  pointer-events:none;
  animation:wallyThinkingOrbit 1.5s ease-in-out infinite;
}

.wally-portrait.is-thinking .w-eye-ring{
  stroke:#ffd896;
  filter: drop-shadow(0 0 9px rgba(255, 214, 140, 0.30));
}

.wally-controls{
  width:auto;
  display:flex;
  justify-content:center;
}

#wallyBtnTalk{
  min-height:38px;
  padding:0 18px;
  border-radius:999px;
  border:1px solid rgba(167, 223, 255, 0.35);
  color:#eef8ff;
  background: rgba(255, 255, 255, 0.04);
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition: transform .14s ease, border-color .2s ease, background-color .2s ease;
}

#wallyBtnTalk:hover{
  border-color: rgba(107, 229, 255, 0.5);
  background: rgba(107, 229, 255, 0.14);
  transform: translateY(-1px);
}

#wallyBtnTalk[data-on="true"]{
  border-color: rgba(107, 229, 255, 0.65);
  background: linear-gradient(180deg, rgba(107, 229, 255, 0.25), rgba(107, 229, 255, 0.1));
}

.wally-hint{
  display:none;
  max-width: 210px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(107, 229, 255, 0.35);
  background: rgba(107, 229, 255, 0.10);
  color: #dff7ff;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}

.wally-hint.is-error{
  border-color: rgba(255, 92, 92, 0.35);
  background: rgba(255, 92, 92, 0.08);
  color: #ffd7d7;
}

.wally-drag-area{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:168px;
  cursor:grab;
  touch-action:none;
  background: transparent;
  z-index:9999;
}

.wally-dock.dragging .wally-drag-area{
  cursor:grabbing;
}

@keyframes wallyPulse{
  0% { transform: scale(0.88); opacity: 0.8; }
  70% { transform: scale(1.08); opacity: 0.16; }
  100% { transform: scale(1.08); opacity: 0; }
}

@keyframes wallyThinkingOrbit{
  0% { transform: scale(0.96); opacity: 0.38; }
  50% { transform: scale(1.02); opacity: 0.78; }
  100% { transform: scale(0.96); opacity: 0.38; }
}

@keyframes wallyTalkMouth{
  from { transform: scaleY(0.7); }
  to { transform: scaleY(1.45); }
}

@keyframes wallyEyeShift{
  0% { transform: translateX(0); }
  50% { transform: translateX(1px); }
  100% { transform: translateX(-1px); }
}

@keyframes wallyBlink{
  0%, 90%, 100% { transform: scaleY(0.01); opacity: 0; }
  93% { transform: scaleY(1); opacity: 1; }
  96% { transform: scaleY(1); opacity: 1; }
}

@media (max-width: 720px){
  .inventory-filter{
    grid-template-columns:1fr;
  }

  .inventory-filter-actions{
    align-items:stretch;
    flex-direction:column;
  }

  .wally-dock{
    width:198px;
    right:10px;
    bottom:10px;
  }

  .wally-toggle-fab{
    right:10px;
    bottom:10px;
  }

  .wally-widget{
    width:198px;
  }

  .wally-portrait{
    width:174px;
    height:174px;
  }

  .wally-pulse{
    width:160px;
    height:160px;
  }

  .wally-svg{
    width:146px;
  }

  .wally-drag-area{
    height:156px;
  }
}
