/* AllDrive Garage – alkalmazásfelület
   Színek: a semlegesek a tulajdonos munkalapjáról, a zöldek a hivatalos logóból. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext-wght.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/barlow-semi-condensed-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/barlow-semi-condensed-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --brand-700: #C2410C;
  --brand-600: #9A3412;
  --brand-500: #F26310;
  --brand-50: #FFF4EC;
  --ink-900: #15171B;
  --ink-800: #262A31;
  --gray-600: #5B636E;
  --gray-400: #A3ABB6;
  --gray-300: #C4CAD2;
  --gray-200: #E1E4E8;
  --gray-100: #F3F4F6;
  --white: #FFFFFF;
  --danger: #B42318;   --danger-bg: #FEF3F2;
  --warn: #93370D;     --warn-bg: #FFFAEB;
  --info: #364152;     --info-bg: #EEF2F6;
  --plate-eu: #1F4AA8;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head: "Barlow Semi Condensed", "Inter", sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(21, 23, 27, .06), 0 1px 3px rgba(21, 23, 27, .08);
  --shadow-lg: 0 12px 32px rgba(21, 23, 27, .16);
  --sidebar: 248px;
  --topbar: 64px;
  --tap: 40px;
}
@media (pointer: coarse) { :root { --tap: 44px; } }

*, *::before, *::after { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--gray-100); color: var(--ink-900); font: 15px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 .75rem; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--gray-600); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 15px; height: 15px; flex: none; }

/* ---------- Keret ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--ink-900); color: #D6DBD5; display: flex; flex-direction: column; padding: 20px 14px; z-index: 30; }
.sidebar-logo { display: block; padding: 4px 10px 22px; }
.sidebar-logo img { width: 150px; height: auto; max-height: 90px; object-fit: contain; object-position: left center; }
.sidebar-mark { display: none; width: 44px; height: 44px; margin: 0 auto; place-items: center; border: 1.5px solid var(--brand-500); border-radius: 10px; color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 18px; letter-spacing: .04em; }
.nav-label { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8B948C; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 8px 12px; border-radius: 8px; color: #D6DBD5; font-weight: 500; border-left: 3px solid transparent; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .08); color: #fff; border-left-color: var(--brand-500); }
.nav a.active .icon { color: var(--brand-500); }
.sidebar-foot { margin-top: auto; padding: 16px 10px 0; font-size: 12px; color: #8B948C; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--white); border-bottom: 1px solid var(--gray-200); }
.topbar-logo { display: none; }
.content { padding: 24px; max-width: 1280px; width: 100%; }

/* Gyorskereső */
.search { position: relative; flex: 1; max-width: 560px; }
.search input { width: 100%; height: 42px; padding: 0 14px 0 40px; border: 1px solid var(--gray-300); border-radius: 999px; background: var(--gray-100); }
.search input:focus { background: var(--white); border-color: var(--brand-500); outline: none; box-shadow: 0 0 0 3px rgba(242, 99, 16, .15); }
.search > .icon { position: absolute; left: 14px; top: 12px; color: var(--gray-600); }
.search-results { position: absolute; top: 48px; left: 0; right: 0; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; max-height: 70vh; overflow-y: auto; }
.search-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-600); }
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-900); }
.search-item:hover, .search-item.is-active { background: var(--brand-50); text-decoration: none; }
.search-item .sub { color: var(--gray-600); font-size: 13px; }
.search-empty { padding: 14px 10px; color: var(--gray-600); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 4px 8px 4px 4px; border: 0; background: none; border-radius: 999px; cursor: pointer; }
.user-btn:hover { background: var(--gray-100); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-900); color: #fff; font-size: 13px; font-weight: 600; }
.user-meta { text-align: left; line-height: 1.2; }
.user-meta strong { display: block; font-size: 14px; }
.user-meta span { font-size: 12px; color: var(--gray-600); }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; color: var(--ink-900); text-align: left; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--gray-100); text-decoration: none; }

/* ---------- Oldalfej ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { font-family: var(--font-head); font-weight: 600; font-size: 28px; letter-spacing: .01em; text-transform: uppercase; }
.page-head .lead { margin: 4px 0 0; color: var(--gray-600); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--gray-600); font-size: 14px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.title-row h1 { text-transform: none; letter-spacing: 0; } /* rekordnév (ügyfél, jármű): normál írásmód */

/* ---------- Gombok ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background-color .12s, border-color .12s; }
.btn-primary { background: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: var(--white); color: var(--ink-900); border-color: var(--gray-300); }
.btn-secondary:hover { border-color: var(--gray-600); }
.btn-ghost { background: transparent; color: var(--ink-900); }
.btn-ghost:hover { background: var(--gray-200); }
.btn-danger { background: var(--white); color: var(--danger); border-color: #F3C5C0; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
.btn .spinner { width: 16px; height: 16px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kártyák ---------- */
.card { background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--gray-200); }
.card-head h2 { font-family: var(--font-head); font-weight: 600; font-size: 17px; letter-spacing: .03em; text-transform: uppercase; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.grid > * { min-width: 0; }

.stat { padding: 18px 20px; }
.stat-label { font-size: 13px; color: var(--gray-600); font-weight: 500; }
.stat-value { margin-top: 4px; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; }

/* Adatlista */
.dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--gray-600); font-size: 14px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Táblázat ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-600); background: #F8F9FA; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-200); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.is-link { cursor: pointer; }
.table tbody tr.is-link:hover td { background: var(--brand-50); }
.table .r { text-align: right; }
.cell-title { font-weight: 600; color: var(--ink-900); }
.cell-sub { font-size: 13px; color: var(--gray-600); }

/* ---------- Címkék ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; background: var(--gray-200); color: var(--ink-800); white-space: nowrap; }
.badge-ok { background: var(--brand-50); color: var(--brand-700); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.plate { display: inline-flex; align-items: center; height: 26px; padding: 0 8px 0 13px; border: 1.5px solid var(--ink-900); border-radius: 4px; background: #fff linear-gradient(90deg, var(--plate-eu) 0 6px, transparent 6px); font-weight: 700; font-size: 13.5px; letter-spacing: .06em; white-space: nowrap; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.plate-lg { height: 36px; font-size: 19px; padding: 0 12px 0 18px; background: #fff linear-gradient(90deg, var(--plate-eu) 0 8px, transparent 8px); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Szűrősáv, lapozás ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--gray-200); }
.toolbar .input-search { flex: 1; min-width: 200px; max-width: 420px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--gray-200); border-radius: 9px; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; color: var(--ink-800); font-size: 14px; font-weight: 500; }
.tabs a.active { background: var(--white); box-shadow: var(--shadow); color: var(--ink-900); }
.tabs a:hover { text-decoration: none; }
.subnav { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--gray-200); overflow-x: auto; }
.subnav a { padding: 10px 14px; color: var(--gray-600); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a.active { color: var(--ink-900); border-bottom-color: var(--brand-700); }
.subnav a:hover { text-decoration: none; color: var(--ink-900); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--gray-200); font-size: 14px; color: var(--gray-600); }
.pager .btns { display: flex; gap: 6px; }

/* ---------- Űrlap ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.form-grid > * { grid-column: span 12; }
.span-6 { grid-column: span 6 !important; }
.span-4 { grid-column: span 4 !important; }
.span-5 { grid-column: span 5 !important; }
.span-2 { grid-column: span 2 !important; }
.span-9 { grid-column: span 9 !important; }
.span-3 { grid-column: span 3 !important; }
.span-8 { grid-column: span 8 !important; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--ink-800); }
.field .req { color: var(--danger); }
.field input:not([type=checkbox]):not([type=radio]):not([type=color]), .field select, .field textarea, .input { width: 100%; min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 8px; background: var(--white); }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(242, 99, 16, .15); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field-error { margin: 6px 0 0; color: var(--danger); font-size: 13px; font-weight: 500; }
.hint { margin: 6px 0 0; color: var(--gray-600); font-size: 13px; }
.check { display: flex !important; align-items: center; gap: 10px; min-height: var(--tap); font-weight: 500 !important; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-700); }
.form-section { padding: 20px; border-top: 1px solid var(--gray-200); }
.form-section:first-child { border-top: 0; }
.form-section h3 { margin-bottom: 14px; font-size: 15px; font-weight: 700; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--gray-200); background: #F8F9FA; border-radius: 0 0 12px 12px; }
.segmented { display: inline-flex; padding: 3px; background: var(--gray-200); border-radius: 9px; gap: 3px; }
.segmented label { margin: 0 !important; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--ink-800); cursor: pointer; }
.segmented input:checked + span { background: var(--white); box-shadow: var(--shadow); color: var(--ink-900); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand-500); }
.picker { position: relative; }
.picker-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 25; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; max-height: 280px; overflow-y: auto; }
.picker-list button { display: block; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; }
.picker-list button:hover, .picker-list button.is-active { background: var(--brand-50); }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 8px; background: var(--brand-50); }

/* ---------- Üres állapot, figyelmeztetés ---------- */
.empty { padding: 36px 20px; text-align: center; color: var(--gray-600); }
.empty .icon { width: 32px; height: 32px; margin: 0 auto 10px; color: var(--gray-400); }
.empty p { margin-bottom: 14px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-ok { background: var(--brand-50); color: var(--brand-700); }
.alert-info { background: var(--info-bg); color: var(--info); }

/* ---------- Dokumentumok ---------- */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.doc { position: relative; display: flex; flex-direction: column; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.doc-thumb { aspect-ratio: 4 / 3; background: var(--gray-100); display: grid; place-items: center; color: var(--gray-600); overflow: hidden; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-thumb .icon { width: 34px; height: 34px; }
.doc-meta { padding: 8px 10px; font-size: 13px; }
.doc-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.doc-actions { position: absolute; top: 6px; right: 6px; }
.doc-actions .btn { background: rgba(255, 255, 255, .92); }
.upload { display: grid; gap: 12px; padding: 16px; margin-bottom: 16px; border: 1px dashed var(--gray-300); border-radius: var(--radius); background: #F8F9FA; }
.upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Értesítések ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--ink-900); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; }
.toast .icon { margin-top: 1px; }
.toast-success .icon { color: #8FCB6E; }
.toast-error { background: var(--danger); }
.toast button { margin-left: auto; border: 0; background: none; color: inherit; opacity: .7; cursor: pointer; padding: 0; }

/* ---------- Belépés ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--gray-100); }
.auth-card.is-wide { max-width: 760px; }
.quote-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.quote-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--gray-200); display: block; }
.auth-card { width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 16px; box-shadow: var(--shadow); padding: 32px 28px; }
.auth-logo { width: 200px; height: auto; max-height: 120px; object-fit: contain; margin: 0 auto 26px; }
.auth h1 { font-family: var(--font-head); font-weight: 600; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 18px; text-align: center; }
.auth .field { margin-bottom: 14px; }
.auth .btn { width: 100%; }
.auth-links { margin-top: 16px; text-align: center; font-size: 14px; }
.auth .alert { margin-bottom: 16px; }

/* ---------- Mobil navigáció ---------- */
.bottom-nav { display: none; }
.menu-toggle { display: none; }
.backdrop { display: none; }

/* iPad: ikonsáv */
@media (max-width: 1199px) {
  .app { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding: 16px 10px; }
  .sidebar-logo { padding: 2px 4px 18px; }
  .sidebar-logo img { display: none; }
  .sidebar-mark { display: grid; }
  .nav-label, .nav a span, .sidebar-foot { display: none; }
  .nav a { justify-content: center; padding: 10px; border-left: 0; }
  .nav a.active { box-shadow: inset 3px 0 0 var(--brand-500); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .user-meta { display: none; }
}

/* Telefon: felső sáv + alsó navigáció */
@media (max-width: 767px) {
  body { font-size: 15px; }
  .app { display: block; padding-bottom: 72px; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; height: 100vh; height: 100dvh; overscroll-behavior: contain; transform: translateX(-100%); transition: transform .2s ease; padding: 20px 14px calc(20px + env(safe-area-inset-bottom)); }
  .sidebar.open { transform: none; }
  .sidebar.open ~ .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 25; overscroll-behavior: contain; touch-action: none; }
  .sidebar .sidebar-logo img { display: block; width: 150px; height: auto; }
  .sidebar .sidebar-mark { display: none; }
  .sidebar .nav-label, .sidebar .nav a span, .sidebar .sidebar-foot { display: revert; }
  .sidebar .nav a { justify-content: flex-start; padding: 8px 12px; }
  .topbar { padding: 0 12px; gap: 8px; height: 58px; }
  .topbar-logo { display: block; width: 92px; height: auto; flex: none; }
  .topbar-logo img { max-height: 50px; object-fit: contain; object-position: left center; }
  .search { max-width: none; }
  .search input { height: 40px; font-size: 16px; }
  .topbar .new-btn span { display: none; }
  .content { padding: 16px; }
  .page-head h1 { font-size: 24px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-3.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .grid-3.stats .stat { padding: 12px; }
  .grid-3.stats .stat-value { font-size: 22px; }
  .grid-3.stats .stat-label { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .span-6, .span-5, .span-4, .span-3, .span-8, .span-9 { grid-column: span 12 !important; }
  .span-2 { grid-column: span 6 !important; }
  .upload-row { grid-template-columns: 1fr; }
  .card-head, .card-body, .form-section { padding-left: 16px; padding-right: 16px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .toasts { left: 16px; right: 16px; bottom: 84px; width: auto; }
  .form-actions { position: sticky; bottom: 64px; }

  /* Táblázatból kártyalista */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px 16px; border-bottom: 1px solid var(--gray-200); }
  .table-cards td { padding: 2px 0; border: 0; }
  .table-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--gray-600); font-size: 13px; }
  .table-cards td.hide-sm { display: none; }

  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: 64px; padding-bottom: env(safe-area-inset-bottom); background: var(--white); border-top: 1px solid var(--gray-200); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--gray-600); font-size: 11px; font-weight: 600; cursor: pointer; }
  .bottom-nav a.active { color: var(--brand-700); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .icon { width: 22px; height: 22px; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .toasts, .page-head .actions { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}

/* ===================== 3. fázis: műhelyirányítás ===================== */
.text-danger { color: var(--danger); font-weight: 600; }

/* Választócímkék (jelölőnégyzet-csoport) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; margin: 0 !important; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip > span { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--gray-300); border-radius: 999px; background: var(--white); font-size: 14px; font-weight: 500; color: var(--ink-800); }
.chip input:checked + span { border-color: var(--brand-700); background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* Emelőnkénti napi nézet */
.board-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.board-day { margin-left: 8px; font-size: 15px; }
.board-wrap { overflow-x: auto; }
.board-closed { margin: 12px 16px 0; color: var(--warn); font-size: 14px; }
.board { display: flex; min-width: 640px; padding: 12px 16px 16px; }
.board.is-loading { opacity: .5; }
.board-times { flex: 0 0 52px; }
.board-time { font-size: 12px; color: var(--gray-600); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.board-col { flex: 1 1 0; min-width: 150px; border-left: 1px solid var(--gray-200); }
.board-col:last-child { border-right: 1px solid var(--gray-200); }
.board-head { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px; border-top: 3px solid var(--gray-300); border-bottom: 1px solid var(--gray-200); font-weight: 700; font-size: 14px; background: #F8F9FA; }
.board-body { position: relative; }
.board-slot { position: absolute; left: 0; right: 0; border: 0; border-top: 1px dashed #EEF0EC; background: transparent; padding: 0; cursor: pointer; }
.board-slot.hour { border-top: 1px solid var(--gray-200); }
.board-slot:hover { background: var(--brand-50); }
.board-slot[tabindex="-1"] { cursor: default; }
.board-slot[tabindex="-1"]:hover { background: transparent; }
.board-event { position: absolute; left: 4px; right: 4px; z-index: 2; display: flex; flex-direction: column; gap: 1px; padding: 5px 8px; border-radius: 7px; color: #fff; font-size: 12.5px; line-height: 1.3; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.18); text-decoration: none !important; }
.board-event:hover { filter: brightness(1.08); }
.be-top { display: flex; justify-content: space-between; gap: 6px; font-variant-numeric: tabular-nums; }
.be-top strong { letter-spacing: .04em; }
.be-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.be-muted { opacity: .85; }
.board-event.st-no_show, .fc-event.st-no_show { opacity: .45; text-decoration: line-through !important; }
.board-event.st-converted, .fc-event.st-converted { box-shadow: inset 4px 0 0 rgba(255,255,255,.65); }

/* FullCalendar az arculathoz igazítva */
.fc-wrap { padding: 12px 16px 16px; }
.fc { --fc-border-color: var(--gray-200); --fc-today-bg-color: #FFF4EC; --fc-now-indicator-color: var(--danger); --fc-non-business-color: rgba(231,235,228,.55); --fc-page-bg-color: #fff; --fc-neutral-bg-color: #F8F9FA; --fc-list-event-hover-bg-color: var(--brand-50); --fc-button-bg-color: #fff; --fc-button-border-color: var(--gray-300); --fc-button-text-color: var(--ink-900); --fc-button-hover-bg-color: var(--gray-100); --fc-button-hover-border-color: var(--gray-600); --fc-button-active-bg-color: var(--brand-50); --fc-button-active-border-color: var(--brand-700); font-size: 13.5px; }
.fc .fc-toolbar-title { font-family: var(--font-head); font-weight: 600; font-size: 20px; text-transform: uppercase; letter-spacing: .02em; }
.fc .fc-button { font-weight: 600; font-size: 13px; border-radius: 8px; box-shadow: none !important; text-transform: none; }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { color: var(--brand-700); }
.fc .fc-col-header-cell-cushion, .fc .fc-daygrid-day-number { color: var(--ink-900); font-weight: 600; text-decoration: none; }
.fc .fc-timegrid-slot-label { color: var(--gray-600); font-variant-numeric: tabular-nums; }
.fc .fc-event { border-radius: 6px; padding: 1px 3px; cursor: pointer; }
.fc .fc-timegrid-event .fc-event-time { font-weight: 600; }

/* Munkalap: folyamatjelző és státuszváltó */
.stepper { display: flex; gap: 4px; margin: 0 0 16px; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.stepper li { flex: 1 0 auto; min-width: 92px; padding: 8px 6px 0; border-top: 4px solid var(--gray-200); font-size: 12px; font-weight: 600; color: var(--gray-400); text-align: center; white-space: nowrap; }
.stepper li.done { border-top-color: var(--brand-500); color: var(--brand-700); }
.stepper li.current { border-top-color: var(--ink-900); color: var(--ink-900); }
.status-card { margin-bottom: 20px; }
.status-card .card-body { padding: 14px 20px; }
.status-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.status-note { margin-top: 12px; }
.input-sm { width: auto; min-height: 32px; padding: 4px 10px; font-size: 13px; border: 1px solid var(--gray-300); border-radius: 8px; background: var(--white); }
.status-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--gray-300); border-radius: 999px; background: var(--white); color: var(--ink-800); font-size: 13.5px; font-weight: 500; }
.status-chip strong { font-variant-numeric: tabular-nums; }
.status-chip.active { border-color: var(--ink-900); background: var(--ink-900); color: #fff; }
.status-chip:hover { text-decoration: none; border-color: var(--gray-600); }

/* Tételek */
.item-form { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); background: #F8F9FA; }
.items-table tr.labor td { background: #FCFDFB; }
.items-table tr.child td:first-child { padding-left: 32px; }
.state-toggle { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.state-toggle:hover { filter: brightness(.96); }

/* Idővonal, személyek, jóváhagyások */
.timeline { margin: 0; padding: 0 0 0 16px; list-style: none; border-left: 2px solid var(--gray-200); }
.timeline li { position: relative; display: grid; gap: 2px; padding: 0 0 14px 12px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 3px #fff; }
.timeline li:last-child { padding-bottom: 0; }
.tl-time { font-size: 12px; color: var(--gray-600); }
.people { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.people li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.checks li { display: flex; align-items: center; gap: 8px; color: var(--gray-600); }
.checks li::before { content: ""; width: 16px; height: 16px; border: 1.5px solid var(--gray-300); border-radius: 4px; flex: none; }
.checks li.on { color: var(--ink-900); font-weight: 500; }
.checks li.on::before { background: var(--brand-700) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--brand-700); }

/* Irányítópult */
.tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; color: inherit; text-decoration: none !important; }
.tile .icon { color: var(--brand-700); }
.tile-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile-label { font-size: 13px; color: var(--gray-600); font-weight: 500; line-height: 1.25; }
.tile.is-zero .tile-value, .tile.is-zero .icon { color: var(--gray-400); }
.tile:hover { border-color: var(--gray-300); }
.warn-card { margin-bottom: 20px; border-color: #F5D9A8; }
.warn-card .card-head h2 { display: flex; align-items: center; gap: 8px; color: var(--warn); }
.warn-list { margin: 0; padding: 8px 20px 14px 38px; }
.warn-list li { padding: 4px 0; }
.warn-list a { color: var(--ink-900); }
tr.is-own td { background: #FAFDF7; }
.hours-table td { vertical-align: middle; }
.hours-table .field { margin: 0; }
.conflicts .alert ul { margin: 6px 0 0; padding-left: 18px; }

@media (max-width: 1199px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .tile-value { font-size: 24px; }
  .board-nav { margin-left: 0; width: 100%; }
  .board-day { font-size: 14px; }
  .fc .fc-toolbar-title { font-size: 16px; }
  .fc-wrap { padding: 8px; }
  .stepper li { min-width: 84px; font-size: 11px; }
  .items-table tr.child td:first-child { padding-left: 16px; }
  .status-actions .btn { flex: 1 1 auto; }
}

/* ===================== 4. fázis: árazás, árajánlat ===================== */
.internal-col { background: #FAFAF7; color: var(--gray-600); }
.items-table th.internal-col { background: #F1F2EE; }
.field.internal label { color: var(--gray-600); }
.field.internal input { background: #FAFAF7; }
.totals-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 16px 20px; border-top: 1px solid var(--gray-200); background: #FCFDFB; border-radius: 0 0 12px 12px; }
.totals-panel dl { margin: 0; display: grid; gap: 6px; align-content: start; }
.totals-panel dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.totals-panel dt { color: var(--gray-600); }
.totals-panel dd { margin: 0; font-weight: 600; }
.totals-panel .grand { padding-top: 6px; border-top: 1px solid var(--gray-300); font-size: 16px; }
.totals-panel .grand dt { color: var(--ink-900); font-weight: 700; }
.totals-panel .grand dd { font-weight: 800; color: var(--brand-700); }
.totals-panel .sub { font-size: 13px; }
.totals-panel .internal-box { padding: 10px 12px; border: 1px dashed var(--gray-300); border-radius: 8px; background: #FAFAF7; }
@media (max-width: 767px) {
  .totals-panel { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
}
.wide-block { margin-bottom: 20px; }
.wide-block > .hint { margin: 8px 0 0; }

/* 5. fázis: alkatrészek, készlet, beszerzés */
.text-ok { color: var(--brand-700); }
.stock-figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 10px; }
.stock-figure strong { font-family: var(--font-display, inherit); font-size: 40px; line-height: 1; font-weight: 700; }
.adjust-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--gray-200); }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 10px 20px; border-top: 1px solid var(--gray-200); }
.link-list li:first-child { border-top: 0; }
.plain-list { margin: 6px 0 0; padding-left: 18px; }
.plain-list li { margin: 2px 0; }
.check-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.tiles-inline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tiles-inline > div { padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--white); }
.tiles-inline strong { display: block; font-size: 26px; line-height: 1.1; }
.tiles-inline span { color: var(--gray-600); font-size: 13px; }
.tiles-inline .is-bad strong { color: var(--danger); }
.input-num { width: 96px; text-align: right; }
.receive-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; border-top: 1px solid var(--gray-200); }
.receive-bar .receive-invoice { flex: 0 1 280px; margin: 0; }
.receive-bar .hint { flex-basis: 100%; margin: 0; }
.receive-col { background: #F6FAF2; }
tr.is-muted td { color: var(--gray-500, #8A918B); text-decoration: line-through; }
tr.is-muted td .badge { text-decoration: none; }
.order-step { margin-bottom: 20px; border-left: 4px solid var(--brand-600, #C2410C); }
.missing-parts { margin-bottom: 20px; }
.catalog-wrap { position: relative; }
.catalog-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto; background: var(--white); border: 1px solid var(--gray-300); border-radius: 10px; box-shadow: 0 10px 30px rgba(21, 24, 26, .14); }
.catalog-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; width: 100%; padding: 9px 12px; border: 0; border-top: 1px solid var(--gray-200); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.catalog-item:first-child { border-top: 0; }
.catalog-item:hover, .catalog-item:focus { background: var(--brand-50, #F1F7EC); outline: none; }
.link-btn { padding: 0; border: 0; background: none; color: var(--brand-700); font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 767px) {
  .tiles-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-list li { padding: 10px 16px; }
  .input-num { width: 130px; max-width: 60%; }
}
.icon-inline { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; }

/* 6. fázis: munkaidő */
.pulse-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-600); box-shadow: 0 0 0 0 rgba(194, 65, 12, .5); animation: adg-pulse 2s infinite; vertical-align: 1px; }
@keyframes adg-pulse { 0% { box-shadow: 0 0 0 0 rgba(194, 65, 12, .45); } 70% { box-shadow: 0 0 0 7px rgba(194, 65, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(194, 65, 12, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse-dot { animation: none; } }
.timer-card { margin-bottom: 20px; }
.timer-running { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; background: #F3F8EE; border-bottom: 1px solid var(--gray-200); }
.timer-clock { font-size: 34px; font-weight: 700; line-height: 1; color: var(--brand-700); min-width: 84px; }
.timer-what { display: flex; flex-direction: column; flex: 1 1 220px; min-width: 0; }
.timer-start { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.timer-start .field { margin: 0; flex: 1 1 220px; }
.timer-start .hint { flex-basis: 100%; margin: 0; }
.time-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-200); }
.time-summary .btn { margin-left: auto; }
tr.is-running td { background: #F6FAF2; }
.timer-pill { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 4px 0 12px; border: 1px solid #CFE3C2; border-radius: 999px; background: #F3F8EE; }
.timer-pill a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-900); }
.timer-pill-label { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.timer-pill button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-900); cursor: pointer; }
.timer-pill button:hover { background: #E3EFDA; }
.team-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.bar-cell { vertical-align: middle; }
.bar { display: block; height: 8px; min-width: 2px; border-radius: 4px; background: var(--brand-600); opacity: .75; }
.report-groups { margin: 0; padding: 0 12px; }
.dot-lg { width: 14px; height: 14px; }
.static-field { margin: 0; min-height: var(--tap, 44px); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (max-width: 767px) {
  .timer-pill-label { display: none; }
  .timer-clock { font-size: 28px; }
  .time-summary .btn { margin-left: 0; }
  .bar-cell { display: none; }
}
.table tfoot th { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink-900); }
.dropdown .is-danger { color: var(--danger); border-top: 1px solid var(--gray-200); border-radius: 0 0 8px 8px; margin-top: 4px; }

/* 7. fázis: pénzügy */
.month-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 16px; }
.month-nav strong { font-size: 17px; }
.month-nav-switch { display: inline-flex; gap: 6px; margin-left: auto; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.kpi span { color: var(--gray-600); font-size: 13px; }
.kpi strong { font-size: 24px; line-height: 1.15; }
.kpi em { font-style: normal; color: var(--gray-600); font-size: 12.5px; }
.kpi.is-positive strong { color: var(--brand-700); }
.kpi.is-negative strong, .text-danger-strong { color: var(--danger); }
.pl-table td { padding: 10px 20px; }
.pl-table .pl-indent { padding-left: 34px; color: var(--gray-600); }
.pl-table .pl-main td, .pl-table .pl-sub td { font-weight: 600; }
.pl-table .pl-sub td { background: #F8FAF6; }
.pl-table .pl-total td { font-weight: 700; font-size: 16px; border-top: 2px solid var(--ink-900); color: var(--brand-700); }
.pl-table .pl-total.is-negative td { color: var(--danger); }
.pl-info { border-top: 1px solid var(--gray-200); }
.text-warn { color: var(--warn); }
.cat-list { list-style: none; padding-left: 0; margin: 0; }
.cat-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--gray-200); }
.cat-list li:last-child { border-bottom: 0; }
.card-body.cat-list { padding: 10px 20px; }
.stat-big { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.stat-big span:first-child { color: var(--gray-600); font-size: 13px; }
.stat-big strong { font-size: 26px; }
.method p { margin: 0 0 8px; }
tr.is-current td { background: #F6FAF2; }
.pay-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border-bottom: 1px solid var(--gray-200); }
.pay-summary.dash-finance { grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 0; }
.pay-summary div { display: flex; flex-direction: column; gap: 2px; }
.pay-summary span { color: var(--gray-600); font-size: 13px; }
.pay-summary strong { font-size: 20px; }
.pay-summary .is-due strong { color: var(--danger); }
.pay-form { border-top: 1px solid var(--gray-200); }
@media (max-width: 1023px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .pay-summary, .pay-summary.dash-finance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month-nav-switch { margin-left: 0; }
  .kpi strong { font-size: 20px; }
}

/* Pénzügy 1.1: időszakválasztó, számítási alap jelölése, kassza */
.period-custom { margin: -6px 0 14px; padding: 0; border: 0; align-items: center; }
.period-basis { margin: -8px 0 14px; }
.basis { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.basis-gross { background: var(--brand-50); color: var(--brand-700); }
.basis-net { background: var(--info-bg); color: var(--info); }
.basis-mixed { background: var(--warn-bg); color: var(--warn); }
.pl-table .pl-head td { padding-top: 16px; padding-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-600); border-bottom: 0; }
.pl-table .pl-indent-row td:first-child { padding-left: 34px; color: var(--gray-600); }
.pl-table td:nth-child(2) { width: 1%; }
.cat-list li.cat-total { font-weight: 600; border-top: 1px solid var(--gray-300); border-bottom: 0; padding-top: 8px; }
.cash-balance strong { font-size: 30px; }
.cash-balance.is-negative strong { color: var(--danger); }
.cash-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cash-type { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: var(--white); font-weight: 600; cursor: pointer; min-height: var(--tap); }
.cash-type input { position: absolute; opacity: 0; pointer-events: none; }
.cash-type small { font-weight: 500; font-size: 12px; color: var(--gray-600); }
.cash-type-in:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-600); }
.cash-type-out:has(input:checked) { border-color: var(--danger); background: var(--danger-bg); box-shadow: inset 0 0 0 1px var(--danger); }
.cash-type:has(input:focus-visible) { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.field > .label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--ink-800); }
.input-lg { font-size: 20px; font-weight: 600; }
tr.is-reversal td { color: var(--gray-600); font-style: italic; }
.cash-table .text-danger strong, .cash-table .text-ok strong { color: inherit; }

.pay-cash-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cash-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cash-table td:last-child .btn { padding-left: 8px; padding-right: 8px; }

/* Beszerzés rögzítése (1.2): végösszeg, kasszalevonás, összesítés */
.buy-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--brand-50); }
.buy-total span { font-weight: 600; color: var(--ink-800); }
.buy-total strong { font-size: 22px; color: var(--brand-700); }
.buy-total em { flex-basis: 100%; font-style: normal; font-size: 12.5px; color: var(--gray-600); }
.buy-payment { margin-top: 18px; display: grid; gap: 12px; }
.buy-payment h4, .buy-summary h4, .pay-later h4 { margin: 0; font-size: 14px; }
.cash-deduct { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: var(--white); cursor: pointer; }
.cash-deduct input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--brand-600); }
.cash-deduct.is-on { border-color: var(--brand-600); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-600); }
.buy-summary { padding: 14px; border: 1px dashed var(--brand-600); border-radius: var(--radius-sm); background: #FBFDF9; }
.buy-summary .dl { margin: 10px 0 0; }
.buy-summary.is-short { border-color: var(--danger); background: var(--danger-bg); }
.buy-warning { margin: 10px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger); font-weight: 600; font-size: 13.5px; }
.pay-later { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--gray-200); }
.pay-later .cash-deduct { margin-top: 10px; }
.row-actions { margin-top: 4px; font-size: 12.5px; }
@media (max-width: 767px) {
  .pl-table td { padding: 8px 12px; }
  .pl-table .pl-indent-row td:first-child { padding-left: 22px; }
  .pl-table td:first-child { overflow-wrap: anywhere; }
}
.form-grid .row-start { grid-column-start: 1; }
.static-note { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--gray-100); font-size: 13.5px; }

/* Tulajdonosi egyenlegek (1.4) */
.kpi-link { color: inherit; text-decoration: none; transition: box-shadow .15s; }
.kpi-link:hover { box-shadow: var(--shadow-lg); }
.kpi-link em { color: var(--brand-700); }
.cash-check { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -6px 0 16px; }
.cash-types-sm .cash-type { padding: 8px 10px; font-size: 13.5px; }
.cash-type-none:has(input:checked) { border-color: var(--info); background: var(--info-bg); box-shadow: inset 0 0 0 1px var(--info); }
.cash-effects { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.effect { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--gray-100); color: var(--ink-800); white-space: nowrap; }
.effect.effect-cash { font-size: 13px; }
.effect.is-plus { background: var(--brand-50); color: var(--brand-700); }
.effect.is-minus { background: var(--danger-bg); color: var(--danger); }
.cash-preview { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--gray-100); font-size: 13.5px; display: grid; gap: 4px; }
.cash-preview.is-short { background: var(--danger-bg); }
.opening-form { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--gray-200); }
.opening-form h4 { margin: 0 0 8px; font-size: 14px; }
.cell-note { margin-top: 2px; font-size: 13px; color: var(--ink-800); }

/* Emelőtábla */
.bayboard { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.bb-card { --bb: var(--gray-300); position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 230px; padding: 18px 18px 18px 23px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.bb-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--bb); }
.bb-run { --bb: var(--info); }
.bb-wait { --bb: var(--warn); }
.bb-done { --bb: var(--brand-500); }
.bb-late { --bb: var(--danger); }
.bb-free { background: var(--gray-100); border: 2px dashed var(--gray-300); box-shadow: none; }
.bb-free::before { display: none; }
.bb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bb-name { font-family: var(--font-head); font-weight: 600; font-size: 18px; letter-spacing: .08em; text-transform: uppercase; }
.bb-main { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; color: inherit; text-decoration: none; }
.bb-main:hover .bb-car { text-decoration: underline; }
.bb-car { font-size: 17px; }
.bb-work { color: var(--gray-600); font-size: 14px; }
.bb-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; font-size: 14px; }
.bb-people { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-eta { font-weight: 600; color: var(--bb); white-space: nowrap; }
.bb-prog { height: 6px; border-radius: 3px; background: var(--gray-100); overflow: hidden; }
.bb-prog i { display: block; height: 100%; background: var(--bb); }
.bb-free-big { margin: auto 0; font-family: var(--font-head); font-weight: 600; font-size: 28px; color: var(--gray-400); }
.bb-next { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; color: var(--gray-600); text-decoration: none; }
.bb-free .bb-next { margin-top: auto; }

/* Szállítólevél beolvasása: szerkeszthető ellenőrző táblázat. */
.dn-table td { padding: 8px 10px; vertical-align: top; }
.dn-table th { padding: 10px; }
.dn-table .input-sm { width: 100%; }
.dn-table .dn-code { min-width: 130px; }
.dn-table .dn-name { min-width: 220px; }
.dn-table .dn-brand { min-width: 120px; margin-top: 4px; }
.dn-table .dn-qty { width: 70px; min-width: 70px; text-align: right; }
.dn-table td.nowrap select { width: auto; margin-left: 4px; }
.dn-table .dn-price { min-width: 96px; text-align: right; }
.dn-table .dn-vat { width: 56px; min-width: 56px; text-align: right; }
.dn-table .is-invalid { border-color: var(--danger); }
.dn-table tr.dn-skip td { background: #F8F9FA; }
.dn-table tr.dn-skip input:not([type=checkbox]), .dn-table tr.dn-skip select { color: var(--gray-600); }
