/* ==== basis ==== */
:root{
  color-scheme: dark;
  --bg: #0b1323;
  --surface: #0f1c33;
  --surface-2: #11203a;
  --border: #1f3358;
  --text: #eef2ff;
  --muted: #9fb3c8;
  --accent: #2b74ff;
  --accent-2: #6aa0ff;
  --bar-h: 96px;             /* PATCH-46b: hoger zodat logo van 72px past, zoals op Dockplanner */
  --ui-zoom: 1;            /* responsive page zoom (Chrome/Edge) */
  --radius: 12px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    radial-gradient(1200px 700px at -10% -15%, #0e2048 0%, transparent 55%),
    radial-gradient(1200px 700px at 110% 120%, #0a1b3f 0%, transparent 55%),
    var(--bg);
  color:var(--text);
  font: 14.5px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  zoom: var(--ui-zoom);
}

/* utility */
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.muted{ color: var(--muted); }

/* ==== top bar ==== */
.bar{
  position: sticky; top:0; z-index:200;
  height: var(--bar-h);
  padding: 8px 14px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:
    linear-gradient(180deg, rgba(30,52,96,.65), rgba(17,32,58,.92)),
    linear-gradient(90deg, #102446, #0b1a33);
  border-bottom:1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  overflow:hidden;
}
.brand{ display:flex; align-items:center; gap:10px; min-width:0; }
.brand-logo{ height:72px; width:auto; display:block; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.bar h1{ margin:0; font-size:16px; letter-spacing:.25px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.toolbar{ display:flex; align-items:center; gap:8px; flex-wrap:nowrap; white-space:nowrap; }
.toolbar input[type="date"]{
  height:32px; min-width: 170px;
  border-radius:8px; padding:4px 8px;
  background:var(--surface-2); border:1px solid var(--border); color:var(--text);
  font-size: 13px;
}
.toolbar input[type="date"]:focus{ border-color:var(--accent); box-shadow: 0 0 0 3px rgba(43,116,255,.15); outline:none; }

/* ==== container ==== */
.container{ width:100%; margin: 12px auto 32px; padding: 0 12px; }

/* ==== kaart / tabel ==== */
.card{
  background: linear-gradient(180deg, rgba(17,32,58,.65), rgba(15,28,50,.65));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  overflow: visible;
  padding: 10px;
}

/* Buttons */
.btn{
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color:#fff; border:none;
  padding:6px 10px;           /* compacter */
  border-radius: 10px; cursor:pointer; font-weight:600; font-size:13px;
  box-shadow: 0 6px 16px rgba(43,116,255,.35);
  line-height:1;
}
.btn.ghost{ background:transparent; border:1px solid var(--border); color:var(--text); box-shadow:none; }

/* mini buttons (kosten admin seeds) */
.btn.mini{ padding:4px 8px; border-radius:10px; font-size:12px; line-height:1; }
.btn.mini.ok{ }
.btn.mini.miss{ background:transparent; border:1px solid var(--border); color:var(--text); box-shadow:none; }


.btn:active{ transform: translateY(1px); }

/* ==== tabel ==== */
table{
  width:100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
thead th{
  position: sticky;
  top: calc(var(--bar-h) + 6px);
  z-index: 5;
  background: linear-gradient(180deg, rgba(28,51,96,.95), rgba(21,38,73,.98));
  padding: 8px;                       /* compacter */
  text-align:left; text-transform:uppercase; font-size:11.5px; letter-spacing:.2px;
  border-bottom:1px solid var(--border);
  white-space: nowrap;
}
tbody td{
  padding: 5px 6px;                   /* compacter */
  border-bottom:1px solid rgba(255,255,255,.06);
  vertical-align: middle;
}
tbody tr:nth-child(odd) td{ background:#0f1b30; }
tbody tr:nth-child(even) td{ background:#0d182a; }
tbody tr:hover td{ background:#13223d; }

/* inputs vullen cel maar compacter */
input, select, textarea{
  width:100%;
  height:32px;                         /* was 36px */
  background: var(--surface-2);
  color: var(--text);
  border:1px solid var(--border);
  border-radius:8px;
  padding:6px 8px;
  outline:none;
  font-size:14px;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

/* Force blue dropdown background for carrier select (also when rows are colored) */
select{ background: var(--surface-2); color: var(--text); }
select option, select optgroup{
  background:#102a5a;
  color:#ffffff;
}

input::placeholder{ color: var(--muted); }
input:focus, select:focus, textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43,116,255,.15);
}
textarea{ min-height: 32px; height: 32px; }

input[type="checkbox"]{
  width:18px; height:18px; accent-color: var(--accent);
  display:block; margin:0 auto;
}

/* delete-knop */
.delbtn{
  width:24px;height:24px;
  display:inline-grid;place-items:center;
  padding:0;margin:0 auto;
  border-radius:9999px;
  background:#7f1d1d;
  border:1px solid #ef4444;
  color:#fff;
  cursor:pointer;
}
.delbtn::before{content:"\2715";font-size:13px;line-height:1;}
.delbtn:hover{background:#991b1b;border-color:#f87171;}
.delbtn:focus-visible{outline:2px solid #f87171;outline-offset:2px;}

/* ==== kolombreedtes ==== */
.col-acties      { width:  4%; }
.col-vervoerder  { width: 6%; }
.col-dock        { width:  4%; }
.col-vertrektijd { width:  5.4%; }
.col-dload       { width:  7.2%; }
.col-dlos        { width:  7.2%; }
.col-tlos        { width:  5.4%; }
.col-losbest     { width: 11%; }
.col-losnr       { width:  6%; }
.col-trailer     { width:  3.5%; }
.col-laadvolg    { width:  14%; }
.col-pallets     { width:  4.5%; }
.col-opm         { width: 10%; }
.col-av          { width:  6%; }

/* uitlijning */
tbody td:nth-child(3)  input{ text-align:center; } /* Dock */
tbody td:nth-child(4)  input{ text-align:center; font-variant-numeric: tabular-nums; } /* Vertrektijd */
tbody td:nth-child(5)  input{ text-align:center; } /* Datum laden */
tbody td:nth-child(6)  input{ text-align:center; } /* Datum lossen */
tbody td:nth-child(7)  input{ text-align:center; font-variant-numeric: tabular-nums; } /* Tijd lossen */
tbody td:nth-child(9)  input{ text-align:center; } /* Losnummer */
tbody td:nth-child(10) input{ text-align:center; } /* Trailer */
tbody td:nth-child(11) input{ text-align:left; } /* Laadvolgorde (tekstveld) */
tbody td:nth-child(12) input{ text-align:center; } /* Pallets */

/* responsive kleine tweaks */

@media (max-width: 1280px){
  .toolbar input[type="date"]{ min-width: 150px; }
  .btn{ padding:5px 8px; font-size:12px; }
  .brand-logo{ height:60px; }
  .bar{ padding:8px 12px; }
}
@media (max-width: 1024px){
  body{ font-size:14px; }

/* ==== TPC responsive zoom (auto 'browser-zoom' feel) ==== */
@media (max-width: 1600px){
  :root{ --ui-zoom: .92; }
}
@media (max-width: 1440px){
  :root{ --ui-zoom: .85; }
}
@media (max-width: 1280px){
  :root{ --ui-zoom: .78; }
}
@media (max-width: 1100px){
  :root{ --ui-zoom: .72; }
}
/* ==== END responsive zoom ==== */
  .toolbar{ gap:6px; }
  .toolbar input[type="date"]{ height:30px; }
  thead th { padding:7px; font-size:11px; }
  tbody td { padding:4px 5px; }
}


/* TPC tweak: hide number spinners on focus */
input[type="number"].no-spin::-webkit-outer-spin-button,
input[type="number"].no-spin::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"].no-spin{
  -moz-appearance: textfield;
}


/* TPC: center header th */
thead th{
  text-align: center;
  vertical-align: middle;
}


/* TPC: hide number spinners on focus in dock & pallets columns */
tbody td:nth-child(3)  input[type="number"]:focus::-webkit-outer-spin-button,
tbody td:nth-child(3)  input[type="number"]:focus::-webkit-inner-spin-button,
tbody td:nth-child(12) input[type="number"]:focus::-webkit-outer-spin-button,
tbody td:nth-child(12) input[type="number"]:focus::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}
tbody td:nth-child(3)  input[type="number"]:focus,
tbody td:nth-child(12) input[type="number"]:focus{
  -moz-appearance: textfield; /* Firefox */
  appearance: textfield;      /* modern generic */
}


/* TPC: permanently hide number spinners for Dock (col 3) and Pallets (col 12) */
tbody td:nth-child(3)  input[type="number"],
tbody td:nth-child(12) input[type="number"]{
  -moz-appearance: textfield;  /* Firefox */
  appearance: textfield;       /* Standard */
}

/* ==== TPC: custom "datalist" combobox (dark dropdown) ==== */
.pc-combobox{ position:relative; width:100%; }
.pc-combobox__list{
  position:absolute;
  left:0; right:0;
  top: calc(100% + 6px);
  z-index: 9999;
  max-height: 340px;
  overflow:auto;
  padding: 6px;
  background: linear-gradient(180deg, rgba(28,51,96,.95), rgba(21,38,73,.98));
  border:1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0,0,0,.45);
}
.pc-combobox__item{
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-combobox__item:hover,
.pc-combobox__item.active{
  background: rgba(255,255,255,.10);
}
.pc-combobox__empty{
  padding: 8px 10px;
  color: var(--muted);
}

/* Chrome/Edge/Safari: remove spin buttons */
tbody td:nth-child(3)  input[type="number"]::-webkit-outer-spin-button,
tbody td:nth-child(3)  input[type="number"]::-webkit-inner-spin-button,
tbody td:nth-child(12) input[type="number"]::-webkit-outer-spin-button,
tbody td:nth-child(12) input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}


/* TPC: enhanced proposals list */
.proposal-item{ display:flex; align-items:center; justify-content:space-between; padding:8px 10px; border-bottom:1px solid var(--border); }
.proposal-col.right{ display:flex; align-items:center; gap:.5rem; }
.proposal-title{ font-weight:600; }
.proposal-meta{ font-size:12px; color: var(--muted); margin-top:2px; }


/* enforce same vert-green for combi rows */
tr.row.trow--vert > td,
tr.row.trow--vert.is-combi > td,
tr.row.is-combi.trow--vert > td {
  background-image: none !important;
  background: rgba(16,185,129,0.12) !important;
}


/* ==== PROPOSALS — nette uitlijning (label | waarde) ==== */
#proposalsSection .proposal-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:.5rem 1.25rem;
  align-items:start;
}
@media (max-width: 1400px){
  #proposalsSection .proposal-grid{
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}
#proposalsSection .proposal-grid > div{
  display:grid;
  grid-template-columns: 130px 1fr; /* label | value */
  align-items:center;
  gap:.25rem .5rem;
}
#proposalsSection .proposal-grid > div > strong{
  margin:0;
  white-space:nowrap;
  font-weight:600;
  color:var(--muted-foreground, #cbd5e1);
}
#proposalsSection .proposal-grid > div > div{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
/* ==== END PROPOSALS grid ==== */



/* ==== PROPOSALS — strakke kolomuitlijning ==== */
#proposalsSection .proposal-grid{
  display: grid;
  grid-template-columns: 130px minmax(0,1fr) 130px minmax(0,1fr) 130px minmax(0,1fr); /* label|waarde × 3 */
  column-gap: 16px;
  row-gap: 6px;
  align-items: center;
}
/* Zet elk item 'open' zodat label en waarde echte grid-items zijn */
#proposalsSection .proposal-grid > div{
  display: contents;
}
#proposalsSection .proposal-grid > div > strong{
  white-space: nowrap;
  font-weight: 600;
  color: var(--muted-foreground, #cbd5e1);
  text-align: left;
}
#proposalsSection .proposal-grid > div > div{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1400px){
  #proposalsSection .proposal-grid{
    grid-template-columns: 130px minmax(0,1fr) 130px minmax(0,1fr); /* 2 paren per rij */
  }
}
@media (max-width: 900px){
  #proposalsSection .proposal-grid{
    grid-template-columns: 130px minmax(0,1fr); /* 1 paar per rij */
  }
}
/* ==== END PROPOSALS ==== */



/* ==== PROPOSALS — vaste kolombreedtes voor perfecte uitlijning ==== */
#proposalsSection .proposal-grid{
  display: grid;
  grid-template-columns: 140px 360px 140px 360px 140px 1fr; /* label|waarde ×3 */
  column-gap: 16px;
  row-gap: 6px;
  align-items: center;
  width: 100%;
}
#proposalsSection .proposal-grid > div{ display: contents; }
#proposalsSection .proposal-grid > div > strong{
  white-space: nowrap; font-weight: 600; color: var(--muted-foreground, #cbd5e1);
}
#proposalsSection .proposal-grid > div > div{
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 1600px){
  #proposalsSection .proposal-grid{ grid-template-columns: 130px 300px 130px 300px 130px 1fr; }
}
@media (max-width: 1300px){
  #proposalsSection .proposal-grid{ grid-template-columns: 130px 1fr 130px 1fr; } /* 2 paren */
}
@media (max-width: 900px){
  #proposalsSection .proposal-grid{ grid-template-columns: 130px 1fr; } /* 1 paar */
}
/* ==== END PROPOSALS ==== */


/* Hide number input spinners (globally) */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }


/* === A/V modal & cell === */
.tpc-av-btn, .btn.tpc-av-btn{
  font-size: 14px; line-height: 1; padding: 6px 10px; border-radius: 8px;
}
.tpc-av-dialog .rowline{ display:flex; align-items:center; gap:12px; margin: 8px 0; }
.tpc-av-dialog input[type="checkbox"].chk-aang { accent-color: #ff9800; }
.tpc-av-dialog input[type="checkbox"].chk-vert { accent-color: #4caf50; }
.tpc-av-dialog label { display:flex; align-items:center; gap:8px; }
.tpc-av-dialog input[type="datetime-local"]{ padding:6px 8px; height: 32px; }


/* === A/V modal polished to match 'Trailers op het terrein' === */
.tpc-av-dialog .tpc-card { background: var(--panel, #0c1630); border: 1px solid var(--border, #1d2a4a); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.tpc-av-dialog .tpc-card__header h3 { margin: 0; }
.tpc-av-dialog .tpc-card__body, .tpc-av-dialog .tpc-card__header, .tpc-av-dialog .tpc-card__footer { color: var(--text, #e6edf6); }
.tpc-av-dialog label span { color: var(--text, #e6edf6); }
.tpc-av-dialog .rowline { gap: 12px; }
.tpc-av-dialog input[type="datetime-local"] { width: 260px; max-width: 100%; }
.tpc-av-dialog .tpc-actions { display:flex; justify-content:flex-end; gap:8px; }
.tpc-av-btn { display:inline-flex; align-items:center; justify-content:center; width:34px; height:30px; padding:0; }
td.col-av .av-cell, td:nth-last-child(1) .av-cell { display:flex; align-items:center; justify-content:center; }
