/* Truck & Trace – közös stíluslap (az arculat a neXt flight CRM színeit követi). */
:root {
  --bg: #f4f7f5;
  --panel: #ffffff;
  --panel-2: #f7faf8;
  --text: #243027;
  --muted: #5f6d64;
  --line: #dfe6e1;
  --accent: #3f9e58;
  --accent-strong: #2f7d45;
  --accent-soft: rgba(63, 158, 88, 0.14);
  --danger: #c0392b;
  --danger-soft: rgba(192, 57, 43, 0.12);
  --warn: #a86f00;
  --warn-soft: rgba(196, 150, 30, 0.18);
  --info: #2f6f9f;
  --info-soft: rgba(47, 111, 159, 0.12);
  --jarmu: #4f6f86;
  --jarmu-uj: #3f9e58;
  --jarmu-bizonytalan: #d08a00;
  --map-bg: #eef2ef;
  --hely-szabad: #0f8a9a;
  --hely-szabad-soft: rgba(15, 138, 154, 0.2);
  --hely-foglalt: rgba(79, 111, 134, 0.22);
  --shadow: 0 10px 30px rgba(30, 45, 36, 0.12);
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1210;
    --panel: #151b18;
    --panel-2: #1b2320;
    --text: #e9efeb;
    --muted: #9aa9a2;
    --line: #29332d;
    --accent: #5fb776;
    --accent-strong: #7fcc93;
    --accent-soft: rgba(95, 183, 118, 0.16);
    --danger: #ef6a58;
    --danger-soft: rgba(239, 106, 88, 0.16);
    --warn: #e2b63f;
    --warn-soft: rgba(226, 182, 63, 0.18);
    --info: #6fa8d6;
    --info-soft: rgba(111, 168, 214, 0.16);
    --jarmu: #7f9db3;
    --jarmu-uj: #5fb776;
    --jarmu-bizonytalan: #e2b63f;
    --map-bg: #111815;
    --hely-szabad: #4cc6d6;
    --hely-szabad-soft: rgba(76, 198, 214, 0.22);
    --hely-foglalt: rgba(127, 157, 179, 0.24);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

a { color: var(--accent-strong); }

button, input, select { font: inherit; color: inherit; }

.rendszam {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.halvany { color: var(--muted); }

/* ---------------------------------------------------------------- gombok, mezők */
.gomb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  white-space: nowrap;
}
a.gomb { text-decoration: none; color: var(--text); }
.gomb:hover { border-color: var(--accent); }
.gomb:disabled { opacity: 0.5; cursor: default; }
.gomb.fo { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.gomb.fo:hover { background: var(--accent-strong); }
.gomb.veszely { color: var(--danger); border-color: var(--danger); }
.gomb.kicsi { min-height: 32px; padding: 4px 10px; font-size: 14px; }

.mezo { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.mezo label { font-size: 13px; color: var(--muted); }
.mezo input, .mezo select, input.kereso {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.mezo input[readonly] { background: transparent; color: var(--muted); border-style: dashed; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.uzenet { padding: 10px 12px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.uzenet.hiba { background: var(--danger-soft); color: var(--danger); }
.uzenet.ok { background: var(--accent-soft); color: var(--accent-strong); }

/* ---------------------------------------------------------------- belépés */
.belepes {
  max-width: 380px;
  margin: 10vh auto 40px;
  padding: 28px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.belepes h1 { font-size: 20px; margin: 14px 0 18px; }
.belepes .logo { height: 30px; width: auto; display: block; }
.belepes .gomb.fo { width: 100%; margin-top: 6px; }

/* ---------------------------------------------------------------- fejléc és fülek */
.fejlec {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.fejlec .logo { height: 22px; width: auto; flex: none; }
.fejlec .cim { font-weight: 700; white-space: nowrap; }
.fejlec .ter { flex: 1; min-width: 0; }
.fejlec select { min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); max-width: 220px; }
.fejlec .felhasznalo { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 200px; }

.fulek {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.fulek button {
  padding: 10px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
}
.fulek button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.tartalom { max-width: 1180px; margin: 0 auto; padding: 14px 16px 40px; }

/* ---------------------------------------------------------------- körsáv */
.korsav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.korsav .ido { font-weight: 600; }
.korsav .lepteto { display: flex; gap: 6px; margin-left: auto; }
.cimke {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.cimke.ok { background: var(--accent-soft); color: var(--accent-strong); }
.cimke.figy { background: var(--warn-soft); color: var(--warn); }
.cimke.hiba { background: var(--danger-soft); color: var(--danger); }
.cimke.info { background: var(--info-soft); color: var(--info); }

/* ---------------------------------------------------------------- kártyák, számok */
.szamok { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.szam { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.szam .ertek { font-size: 22px; font-weight: 700; }
.szam .nev { font-size: 13px; color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 14px; }
.panel h2 { font-size: 16px; margin: 0 0 10px; }
.panel h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }

/* ---------------------------------------------------------------- térkép */
.terkep-keret {
  position: relative;
  background: var(--map-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  touch-action: none;
}
.terkep-keret svg { display: block; width: 100%; height: 64vh; min-height: 320px; cursor: grab; user-select: none;
  -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.terkep-keret svg image { pointer-events: none; -webkit-user-drag: none; }
.terkep-keret svg.huzas { cursor: grabbing; }
.terkep-eszkozok { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; }
.terkep-eszkozok .gomb { min-width: 36px; padding: 4px 8px; box-shadow: var(--shadow); }
.terkep-lent { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px;
  color: var(--muted); }
.jelmagyarazat { display: flex; gap: 14px; flex-wrap: wrap; }
.jelmagyarazat span { display: inline-flex; align-items: center; gap: 6px; }
.jelmagyarazat i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.jelmagyarazat i.j-bent { background: var(--jarmu); }
.jelmagyarazat i.j-uj { background: var(--jarmu-uj); }
.jelmagyarazat i.j-bizonytalan { background: var(--jarmu); box-shadow: inset 0 0 0 2px var(--jarmu-bizonytalan); }
.jelmagyarazat i.j-szabad { background: var(--hely-szabad-soft); outline: 1px dashed var(--hely-szabad); outline-offset: -1px; }
.jelmagyarazat i.j-foglalt { background: var(--hely-foglalt); }

/* térkép + oldalsáv (keresés, foglaltság); keskeny kijelzőn az oldalsáv a térkép alá kerül */
.terkep-elrendezes { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.terkep-fo { min-width: 0; }
.terkep-oldalsav .panel { margin-bottom: 12px; }
.terkep-oldalsav .mezo { margin-bottom: 8px; }
.terkep-oldalsav h3:first-child { margin-top: 4px; }
.terkep-oldalsav .ures { padding: 6px 0; }
.terkep-oldalsav .lista .sor.ketoszlop { gap: 8px; padding: 6px 10px; min-height: 40px; }
.rendszam-gomb { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 0.03em; }
.foglaltsag-szamok { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.foglaltsag-szamok div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.foglaltsag-szamok b { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.foglaltsag-szamok span { font-size: 12px; color: var(--muted); }
.foglaltsag-szamok .szabad b { color: var(--hely-szabad); }
.foglaltsag-sav { display: block; height: 8px; border-radius: 4px; overflow: hidden; background: var(--hely-szabad-soft);
  border: 1px solid var(--hely-szabad); }
.foglaltsag-sav i { display: block; height: 100%; background: var(--jarmu); }
.foglaltsag-sav.kicsi { height: 6px; }
.sorok-foglaltsag button.sor { grid-template-columns: 44px minmax(0, 1fr) 60px; min-height: 38px; padding: 6px 10px; }
.sorok-foglaltsag .jobb { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.kapcsolo { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.kapcsolo input { width: 18px; height: 18px; }

svg .terulet { fill: var(--panel); stroke: var(--line); stroke-width: 0.4; }
svg .sor-vonal { stroke: var(--muted); stroke-width: 0.35; stroke-dasharray: 1.2 0.8; fill: none; }
svg .sor-jel { fill: var(--muted); font-size: 3.2px; font-weight: 700; }
svg .hely { pointer-events: none; }
svg .hely.foglalt { fill: var(--hely-foglalt); stroke: none; }
svg .hely.szabad { fill: var(--hely-szabad-soft); stroke: var(--hely-szabad); stroke-width: 0.45; stroke-dasharray: 1.4 0.8; }
svg.hatterrel .hely.foglalt { fill: rgba(20, 30, 40, 0.35); }
svg.hatterrel .hely.szabad { fill: rgba(76, 198, 214, 0.32); stroke: #7fe6f2; stroke-width: 0.55; }
svg .jarmu rect { fill: var(--jarmu); stroke: var(--panel); stroke-width: 0.25; cursor: pointer; }
svg .jarmu.uj rect { fill: var(--jarmu-uj); }
svg .jarmu.bizonytalan rect { stroke: var(--jarmu-bizonytalan); stroke-width: 0.7; }
svg .jarmu.kijelolt rect { stroke: var(--text); stroke-width: 0.8; }
svg .jarmu text { font-size: 2px; font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-weight: 700;
  fill: var(--text); paint-order: stroke; stroke: var(--panel); stroke-width: 0.6px; pointer-events: none; }
svg.hatterrel .jarmu text { fill: #fff; stroke: rgba(0, 0, 0, 0.75); }
svg.hatterrel .terulet { fill: none; }

/* ---------------------------------------------------------------- listák */
.sorcsoport { margin-bottom: 14px; }
.sorcsoport h3 { display: flex; align-items: baseline; gap: 8px; font-size: 15px; margin: 0 0 6px; }
.sorcsoport h3 .halvany { font-weight: 400; font-size: 13px; white-space: nowrap; }
.lista { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.lista li { border-top: 1px solid var(--line); }
.lista li:first-child { border-top: 0; }
.lista button.sor {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.lista .sor.ketoszlop { grid-template-columns: minmax(0, 1fr) auto; }
.lista button.sor:hover { background: var(--panel-2); }
.lista .sorszam { color: var(--muted); font-variant-numeric: tabular-nums; }
.lista .jobb { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
.ures { color: var(--muted); padding: 14px 0; }

.esemenyek h3 { margin-top: 0; }
.esemeny-csoport { margin-bottom: 14px; }

/* ---------------------------------------------------------------- jármű-részletek (oldalpanel / teljes képernyő) */
.reszlet-hatter { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40; }
.reszlet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  z-index: 41;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow-y: auto;
  padding: 16px;
}
.reszlet .fej { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.reszlet .fej .rendszam { font-size: 22px; }
.reszlet .fej .gomb { margin-left: auto; }
.reszlet img { display: block; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.reszlet img.kivagas { image-rendering: auto; width: 100%; max-width: 360px; }
.adatok { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 12px 0; font-size: 14px; }
.adatok dt { color: var(--muted); }
.adatok dd { margin: 0; }
.idovonal { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.idovonal li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.idovonal li:first-child { border-top: 0; }
.idovonal .mikor { color: var(--muted); white-space: nowrap; min-width: 92px; }

/* ---------------------------------------------------------------- javító */
.javitando { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.javitando .kartya { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.javitando img { width: 100%; border-radius: 6px; border: 1px solid var(--line); }
.javitando .muveletek { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.javitando .muveletek input { flex: 1; min-width: 110px; min-height: 32px; padding: 4px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel-2); text-transform: uppercase; }

/* ---------------------------------------------------------------- kezelés */
.racs-urlap { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; align-items: end; }
.racs-urlap .gomb-mezo { justify-content: flex-end; }
.racs-urlap .gomb-mezo .gomb { min-height: 40px; }
.lista .sor.statikus { cursor: default; }
.lista .sor.statikus:hover { background: none; }
.lista div.sor { display: grid; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; }
.felhasznalo-sor { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.muvelet-sor { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.muvelet-sor select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.link-doboz .link-sor { display: flex; gap: 6px; margin-top: 6px; }
.link-doboz input { flex: 1; min-width: 0; min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.tiltolista { margin-top: 16px; }

/* ---------------------------------------------------------------- táblázat (állapotoldal) */
.tabla-keret { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tabla th, table.tabla td { padding: 7px 10px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.tabla th { border-top: 0; color: var(--muted); font-weight: 600; background: var(--panel-2); }
table.tabla select { min-height: 28px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-2); font-size: 13px; }
table.tabla td.szam-oszlop, table.tabla th.szam-oszlop { text-align: right; font-variant-numeric: tabular-nums; }
.gondok { list-style: none; padding: 0; margin: 0; }
.gondok li { padding: 8px 10px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); margin-bottom: 6px;
  font-size: 14px; }

/* ---------------------------------------------------------------- keskeny kijelző */
@media (max-width: 1000px) {
  .fejlec .felhasznalo { display: none; }
  .terkep-elrendezes { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .fejlec { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .fejlec .cim { display: none; }
  .fejlec select { max-width: 160px; }
  .fulek { padding: 0 4px; gap: 0; }
  .fulek button { padding: 10px 8px; }
  .lista div.sor.statikus { grid-template-columns: minmax(0, 1fr); }
  .lista div.sor.statikus .jobb { justify-content: flex-start; flex-wrap: wrap; }
  .tartalom { padding: 12px 12px 32px; }
  .szamok { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .terkep-keret svg { height: 58vh; }
  .korsav .lepteto { margin-left: 0; width: 100%; }
  .korsav .lepteto .gomb { flex: 1; }
  .reszlet { width: 100%; border-left: 0; }
  .belepes { margin-top: 6vh; }
}
