:root {
  --bg: #f4f5fb;
  --bg-tint: #eef0f8;
  --surface: #ffffff;
  --surface-2: #f2f4fa;
  --border: #e5e8f0;
  --border-strong: #d6dae6;
  --text: #0d1425;
  --muted: #6a7488;
  --primary: #5b57eb;
  --primary-600: #4b46da;
  --primary-700: #3d38bd;
  --primary-soft: #ecebfe;
  --accent: #8b5cf6;
  --brand-grad: linear-gradient(135deg, #5b57eb 0%, #8b5cf6 55%, #a855f7 100%);
  --green: #12a150;
  --green-soft: #d7f5e3;
  --amber: #d97706;
  --amber-soft: #fdeecb;
  --red: #e5484d;
  --red-soft: #fde0e1;
  --gray-soft: #eef0f5;
  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 12px -2px rgba(16,24,40,.08);
  --shadow-md: 0 4px 8px -2px rgba(16,24,40,.06), 0 12px 28px -6px rgba(16,24,40,.14);
  --shadow-lg: 0 16px 40px -8px rgba(30,27,120,.24);
  --ring: 0 0 0 3px var(--primary-soft);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080b14; --bg-tint: #0d111c; --surface: #121828; --surface-2: #1a2132;
    --border: #262f43; --border-strong: #33405a;
    --text: #e8ebf3; --muted: #93a0b8;
    --primary: #8481ff; --primary-600: #726ef7; --primary-700: #6460ee;
    --primary-soft: #1f2340; --accent: #a78bfa;
    --brand-grad: linear-gradient(135deg, #6d69f5 0%, #8b5cf6 55%, #a855f7 100%);
    --green:#3ddc82; --green-soft:#0f3021; --amber:#f5a623; --amber-soft:#3a2a09;
    --red:#ff6b6f; --red-soft:#3a1618; --gray-soft:#1a2132;
    --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 8px 24px -6px rgba(0,0,0,.55);
    --shadow-lg: 0 20px 48px -10px rgba(0,0,0,.65);
    --ring: 0 0 0 3px rgba(132,129,255,.22);
  }
}
:root[data-theme="dark"] {
  --bg: #080b14; --bg-tint: #0d111c; --surface: #121828; --surface-2: #1a2132;
  --border: #262f43; --border-strong: #33405a;
  --text: #e8ebf3; --muted: #93a0b8;
  --primary: #8481ff; --primary-600: #726ef7; --primary-700: #6460ee;
  --primary-soft: #1f2340; --accent: #a78bfa;
  --brand-grad: linear-gradient(135deg, #6d69f5 0%, #8b5cf6 55%, #a855f7 100%);
  --green:#3ddc82; --green-soft:#0f3021; --amber:#f5a623; --amber-soft:#3a2a09;
  --red:#ff6b6f; --red-soft:#3a1618; --gray-soft:#1a2132;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px -6px rgba(0,0,0,.55);
  --shadow-lg: 0 20px 48px -10px rgba(0,0,0,.65);
  --ring: 0 0 0 3px rgba(132,129,255,.22);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-size: 15px; line-height: 1.5; letter-spacing: -0.011em;
}
::selection { background: var(--primary-soft); color: var(--primary-700); }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 15px; width: 100%; padding: 11px 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); outline: none; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 6px; letter-spacing: .01em; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1 1 0; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 17px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 14px;
  letter-spacing: -0.01em; box-shadow: 0 1px 2px rgba(30,27,120,.25), inset 0 1px 0 rgba(255,255,255,.14);
  transition: background .15s, transform .08s ease, box-shadow .15s, filter .15s;
}
.btn:hover { background: var(--primary-600); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px) scale(.99); box-shadow: var(--shadow-xs); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--muted); box-shadow: none; }
.btn.subtle { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.subtle:hover { background: var(--gray-soft); box-shadow: none; }
.btn.danger { background: var(--red); }
.btn.danger:hover { filter: brightness(.94); background: var(--red); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.green { background: var(--green); }
.btn.green:hover { background: var(--green); filter: brightness(.94); }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(60% 55% at 15% 10%, rgba(91,87,235,.20), transparent 60%),
    radial-gradient(55% 50% at 88% 20%, rgba(168,85,247,.18), transparent 60%),
    radial-gradient(70% 60% at 75% 95%, rgba(99,102,241,.16), transparent 62%),
    var(--bg);
}
.auth-wrap::before {
  content: ""; position: absolute; inset: -2px;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 26px 26px; color: var(--border); opacity: .5; pointer-events: none;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 40%, #000 30%, transparent 75%);
          mask-image: radial-gradient(70% 70% at 50% 40%, #000 30%, transparent 75%);
}
.auth-card {
  position: relative; width: 100%; max-width: 410px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 22px; padding: 34px 32px;
  box-shadow: var(--shadow-lg); animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand .logo {
  font-size: 24px; width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--brand-grad); border-radius: 13px; box-shadow: 0 6px 16px -4px rgba(91,87,235,.55), inset 0 1px 0 rgba(255,255,255,.3);
  filter: saturate(1.05);
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; letter-spacing: 0; }
.auth-card h1 { font-size: 21px; margin: 24px 0 4px; letter-spacing: -0.02em; }
.auth-card p.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.auth-switch button { background: none; border: none; color: var(--primary); font-weight: 600; }
.auth-switch button:hover { text-decoration: underline; }

/* ---------- Shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; padding: 11px 20px;
}
.topbar .brand .logo { width: 34px; height: 34px; font-size: 19px; border-radius: 10px; }
.topbar .user { display: flex; align-items: center; gap: 10px; font-size: 14px; position: relative; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-grad);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 8px -2px rgba(91,87,235,.5), inset 0 1px 0 rgba(255,255,255,.25);
}
.avatar-btn { background: none; border: none; padding: 0; line-height: 0; border-radius: 50%; transition: transform .1s; }
.avatar-btn:hover { transform: scale(1.08); }
.avatar-btn:active { transform: scale(.96); }

/* ---------- User dropdown menu ---------- */
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); min-width: 240px; padding: 6px;
  animation: rise .2s cubic-bezier(.2,.7,.2,1) both;
}
.um-header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.um-name { font-weight: 700; font-size: 14px; }
.um-email { font-size: 12px; color: var(--muted); margin-top: 1px; }
.um-divider { height: 1px; background: var(--border); margin: 4px 6px; }
.um-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  background: none; border: none; border-radius: 10px; font-size: 14px; font-weight: 500;
  color: var(--text); cursor: pointer; text-align: left; font-family: inherit;
  transition: background .12s;
}
.um-item:hover { background: var(--surface-2); }
.um-danger { color: var(--red); }
.um-danger:hover { background: var(--red-soft); }
/* Desktop: user-menu is still accessible via avatar click, desktop-only buttons visible */
@media (min-width: 561px) {
  .desktop-only { display: inline-flex !important; }
}
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 90px; animation: fade .4s ease both; }
.tabs {
  display: flex; gap: 4px; background: var(--surface-2); padding: 5px; border-radius: 13px;
  margin-bottom: 22px; flex-wrap: wrap; border: 1px solid var(--border); width: fit-content; max-width: 100%;
}
.tabs button {
  border: none; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px;
  padding: 8px 16px; border-radius: 9px; transition: color .15s, background .15s, box-shadow .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }
.tabs .badge-count { background: var(--brand-grad); color:#fff; border-radius: 999px; padding: 0 7px; font-size: 11.5px; font-weight: 700; margin-left: 6px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card .card-h {
  padding: 15px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px;
  letter-spacing: -0.01em; display:flex; align-items:center; justify-content:space-between; gap: 10px;
}
.card .card-b { padding: 18px; }
.grid { display: grid; gap: 18px; }
@media (min-width: 860px) { .grid.cols-2 { grid-template-columns: 340px 1fr; align-items: start; } }

.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.stat {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.stat::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: var(--brand-grad); opacity:.9; }
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat .n { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; letter-spacing: .01em; }
.badge.pending { background: var(--amber-soft); color: var(--amber); }
.badge.approved { background: var(--green-soft); color: var(--green); }
.badge.rejected { background: var(--red-soft); color: var(--red); }
.badge.cancelled { background: var(--gray-soft); color: var(--muted); }
.badge.override { background: var(--primary-soft); color: var(--primary); }

/* ---------- Lists ---------- */
.leave-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); transition: background .12s; }
.leave-item:last-child { border-bottom: none; }
.leave-item:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.leave-item .who { font-weight: 600; letter-spacing: -0.01em; }
.leave-item .meta { color: var(--muted); font-size: 13px; }
.leave-item .grow { flex: 1; min-width: 0; }
.leave-item .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 32px 10px; font-size: 14px; }
.type-dot { width: 9px; height: 9px; border-radius: 50%; display:inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent); }
.t-annual { background: var(--primary); color: var(--primary); }
.t-sick { background: var(--red); color: var(--red); }
.t-unpaid { background: var(--amber); color: var(--amber); }
.t-other { background: var(--muted); color: var(--muted); }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head .title { font-size: 18px; font-weight: 700; text-transform: capitalize; letter-spacing: -0.02em; }
.cal-nav { display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-cell { min-height: 92px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.cal-cell:hover { border-color: var(--border-strong); }
.cal-cell.out { opacity: .38; }
.cal-cell.today { border-color: var(--primary); box-shadow: var(--ring); }
.cal-cell.weekend { background: var(--surface-2); }
.cal-cell .dnum { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-cell.today .dnum { color: var(--primary); }
.cal-cell.over .dnum { color: var(--red); }
.chip { font-size: 11px; padding: 2px 6px; border-radius: 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.chip.approved { background: var(--green-soft); color: var(--green); }
.chip.pending { background: var(--amber-soft); color: var(--amber); border: 1px dashed var(--amber); }
.chip.more { color: var(--muted); font-weight: 500; }

/* ---------- Misc ---------- */
.inline-warn { background: var(--amber-soft); color: var(--amber); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 12px; border: 1px solid color-mix(in srgb, var(--amber) 22%, transparent); }
.inline-ok { background: var(--green-soft); color: var(--green); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 12px; border: 1px solid color-mix(in srgb, var(--green) 22%, transparent); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .03em; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.hstack { display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; z-index: 100; box-shadow: var(--shadow-lg); max-width: 90vw;
  animation: toastIn .35s cubic-bezier(.2,.8,.2,1) both;
}
.toast.err { background: var(--red); color: #fff; }

/* ---------- Meter (szabadságkeret) ---------- */
.meter { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(16,24,40,.08); }
.meter.big { height: 14px; }
.meter.mini { width: 120px; min-width: 120px; }
.meter > i { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.meter > i.warn { background: linear-gradient(90deg, #eab308, var(--amber)); }
.meter > i.over { background: linear-gradient(90deg, #f87171, var(--red)); }
.balance-num { font-weight: 800; letter-spacing: -0.02em; }
.balance-num.ok { color: var(--green); }
.balance-num.warn { color: var(--amber); }
.balance-num.over { color: var(--red); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(9,12,22,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .2s ease both; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); animation: rise .32s cubic-bezier(.2,.7,.2,1) both; }
.modal .m-h { padding: 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.modal .m-b { padding: 18px; }
.modal .m-f { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============ MOBIL (≤560px) ============ */
@media (max-width: 560px) {
  body { font-size: 15px; }
  .container { padding: 16px 10px 84px; }

  /* Topbar: csak logo + avatar, a többi a menüben */
  .topbar { padding: 8px 12px; }
  .topbar .user { gap: 6px; }
  .topbar .brand small { display: none; }
  .topbar .brand { gap: 8px; font-size: 17px; }
  .topbar .brand .logo { width: 32px; height: 32px; font-size: 17px; border-radius: 9px; }
  .desktop-only { display: none !important; }
  .avatar-btn .avatar { width: 34px; height: 34px; font-size: 13px; }
  .user-menu { min-width: 220px; }
  .btn.sm { padding: 5px 9px; font-size: 12px; }

  /* Tabs: vízszintesen görgethetők */
  .tabs {
    overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; width: 100%;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; padding: 7px 12px; font-size: 13px; white-space: nowrap; }

  /* Stats: 1 oszlop mobilon */
  .stats { grid-template-columns: 1fr; gap: 8px; margin-bottom: 14px; }
  .stat { padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
  .stat .n { font-size: 22px; }
  .stat .l { margin-top: 0; }
  .stat::before { width: 3px; }

  /* Sorok: wrap */
  .row { flex-wrap: wrap; }
  .row > * { flex: 1 1 100%; min-width: 0; }
  .row > .btn { flex: 1 1 100%; }

  /* Card padding kisebb */
  .card .card-h { padding: 12px 14px; font-size: 14px; }
  .card .card-b { padding: 14px; }

  /* Naptár sűrítése */
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 48px; padding: 3px; border-radius: 6px; }
  .cal-cell .dnum { font-size: 11px; }
  .chip { font-size: 9px; padding: 1px 4px; border-radius: 4px; margin-top: 2px; }
  .cal-dow { font-size: 10px; }
  .cal-head .title { font-size: 15px; }
  .cal-head { margin-bottom: 10px; }

  /* Leave items: wrap badges alá */
  .leave-item { flex-wrap: wrap; gap: 8px; padding: 10px 0; }
  .leave-item .grow { flex: 1 1 calc(100% - 30px); min-width: 0; }
  .leave-item .who { font-size: 14px; }
  .leave-item .meta { font-size: 12px; word-break: break-word; }
  .leave-item .actions { flex: 1 1 100%; }

  /* Grid: egyszerre 1 oszlop */
  .grid.cols-2 { grid-template-columns: 1fr; }

  /* Meter mini kisebb */
  .meter.mini { width: 80px; min-width: 80px; }

  /* Legend kisebb */
  .legend { gap: 10px; font-size: 11px; }

  /* Modal mobilra */
  .modal { max-width: 100%; border-radius: 14px; }
  .modal .m-h { padding: 14px; font-size: 15px; }
  .modal .m-b { padding: 14px; }

  /* Táblázatok → kártyás elrendezés */
  .table:not(.timeline-table) thead { display: none; }
  .table:not(.timeline-table), .table:not(.timeline-table) tbody { display: block; width: 100%; }
  .table:not(.timeline-table) tr {
    display: block; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; padding: 4px 12px; margin-bottom: 10px;
  }
  .table:not(.timeline-table) tr td {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 0; border-bottom: 1px solid var(--border); text-align: right;
  }
  .table:not(.timeline-table) tr td:last-child { border-bottom: none; }
  .table:not(.timeline-table) td::before {
    content: attr(data-label); flex: 0 0 auto; text-align: left;
    font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
  }
  .table:not(.timeline-table) td[data-label=""]::before { content: none; }
  .table:not(.timeline-table) td.cell-name { display: block; text-align: left; padding: 8px 0 6px; }
  .table:not(.timeline-table) td.cell-actions { justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
  .table:not(.timeline-table) td select, .table:not(.timeline-table) td input { min-width: 0 !important; }
  .table:not(.timeline-table) td .nm { width: 100%; }
  .table:not(.timeline-table) td .hstack { flex: 1 1 auto; justify-content: flex-end; }

  /* Timeline: horizontális scroll, kisebb cellák */
  .timeline-table .tl-name { min-width: 90px; max-width: 100px; font-size: 11px; padding: 4px 6px; }
  .timeline-table .tl-day { min-width: 22px; font-size: 9px; padding: 3px 0; }
  .timeline-table .tl-cell { height: 22px; }

  /* Form inputok kisebb padding */
  input, select, textarea { padding: 9px 11px; font-size: 14px; }

  /* Balance number */
  .balance-num { font-size: inherit; }

  /* Inline warnings */
  .inline-warn, .inline-ok { font-size: 12px; padding: 8px 10px; }

  /* Auth card kisebb padding */
  .auth-card { padding: 24px 20px; border-radius: 16px; }
  .auth-card h1 { font-size: 19px; margin: 18px 0 4px; }
  .auth-switch { font-size: 13px; }
}

/* ---------- Timeline (team overview) ---------- */
.timeline-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.timeline-table th, .timeline-table td { padding: 0; border: 1px solid var(--border); text-align: center; }
.timeline-table .tl-name { position: sticky; left: 0; z-index: 2; background: var(--surface); padding: 6px 10px; text-align: left; font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 120px; max-width: 150px; }
.timeline-table .tl-day { padding: 4px 0; font-size: 10px; font-weight: 700; color: var(--muted); min-width: 28px; }
.timeline-table .tl-day.we { background: var(--surface-2); color: var(--border-strong); }
.timeline-table .tl-day.today { color: var(--primary); background: var(--primary-soft); }
.timeline-table .tl-cell { height: 28px; transition: opacity .15s; }
.timeline-table .tl-cell.we { background: var(--surface-2); }
.timeline-table tbody tr:hover .tl-name { background: var(--bg-tint); }

/* ---------- Code (for CSV format hint) ---------- */
code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 13px; }

/* ==========================================================================
   ADMIN FELÜLET (2026-08-12) — széles konténer, listák, eszköztár, napló
   ========================================================================== */

.container.wide { max-width: 1320px; }

/* ---------- Szekció-cím ---------- */
.sec-head {
  display: flex; align-items: center; gap: 12px; margin: 28px 0 14px;
  font-weight: 700; font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em;
}
.sec-head::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Stat-sor ---------- */
.stats.four { grid-template-columns: repeat(4, 1fr); }
.stat-hot::before { background: linear-gradient(180deg, var(--amber), #f59e0b); }
.stat-hot .n { color: var(--amber); }
.stat .l .badge { vertical-align: middle; }
.grid.cols-even { grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .grid.cols-even { grid-template-columns: 1fr 1fr; } }

/* ---------- Eszköztár (kereső + szűrők) ---------- */
.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.toolbar .search { flex: 2 1 260px; }
.toolbar .filter { flex: 1 1 150px; }
.toolbar input, .toolbar select { padding: 8px 12px; font-size: 13.5px; background: var(--surface); }
.btn.active-filter { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

/* ---------- Összecsukható panel ---------- */
.panel { background: var(--bg-tint); border-bottom: 1px solid var(--border); }
.panel-in { padding: 16px 18px; animation: fade .18s ease both; }
.grid.cols-tools { grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 760px) { .grid.cols-tools { grid-template-columns: 1fr 1fr; } }

/* ---------- Dolgozó-lista ---------- */
.emp-list { padding: 2px 18px 12px; }
.emp-row {
  display: grid; align-items: center; gap: 4px 12px; padding: 11px 0;
  border-bottom: 1px solid var(--border);
  grid-template-columns: 34px minmax(0, 1.6fr) minmax(0, 1fr) 180px auto;
  grid-template-areas: "av main meta bal act";
  transition: background .12s;
}
.emp-row:last-child { border-bottom: none; }
.emp-row:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.emp-row.is-off { opacity: .6; }
.emp-row .ea { grid-area: av; }
.em-main { grid-area: main; min-width: 0; }
.em-meta { grid-area: meta; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-bal { grid-area: bal; display: flex; align-items: center; gap: 8px; }
.em-act { grid-area: act; display: flex; gap: 6px; justify-content: flex-end; }
.em-name { font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; padding: 2px 6px; border-radius: 5px; vertical-align: 1px;
}
.tag-admin { background: var(--primary-soft); color: var(--primary); }
.tag-off { background: var(--gray-soft); color: var(--muted); }

/* ---------- Modál kiegészítők ---------- */
/* Magas modál (pl. dolgozó szerkesztése) kis kijelzőn: a törzs görgethető,
   a fejléc és a gombsor mindig látszik — enélkül a Mentés gomb kicsúszik. */
.modal-back { overflow-y: auto; }
.modal { display: flex; flex-direction: column; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); }
.modal .m-h, .modal .m-f { flex: 0 0 auto; }
.modal .m-b { flex: 1 1 auto; overflow-y: auto; }
.modal.modal-wide { max-width: 560px; }
.modal .m-h .um-email { font-weight: 400; }
.m-sep { height: 1px; background: var(--border); margin: 16px 0 14px; }
.bal-list { display: grid; gap: 9px; }
.bal-line { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.bal-lbl { color: var(--muted); }
.btn.btn-dangerish { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.btn.btn-dangerish:hover { background: var(--red-soft); border-color: var(--red); }

/* ---------- Jóváhagyások ---------- */
.leave-item.ap-row { align-items: flex-start; }
.ap-row.has-conflict { box-shadow: inset 3px 0 0 var(--amber); padding-left: 11px; }
.ap-bal { display: inline-flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 12.5px; }
.ap-actions { align-self: center; }

/* ---------- Napló ---------- */
.log-list { padding: 2px 18px 6px; }
.log-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.log-row:last-child { border-bottom: none; }
.log-time { font-size: 12px; color: var(--muted); line-height: 1.4; }
.lg-d { display: block; }
.lg-t { font-weight: 700; color: var(--text); }
.log-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.log-detail { font-size: 12.5px; color: var(--muted); margin-top: 3px; word-break: break-word; }
.lg-k { font-weight: 600; color: var(--text); }
.lg-dot { opacity: .45; }
.log-more { padding: 12px 18px 16px; text-align: center; }

/* ---------- Timeline (csapatáttekintés) — újraírva ---------- */
.tl-scroll { padding: 0 !important; overflow-x: auto; border-radius: var(--radius); }
.timeline-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; table-layout: fixed; }
.timeline-table th, .timeline-table td { padding: 0; text-align: center; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.timeline-table tr > *:last-child { border-right: none; }
.timeline-table tbody tr:last-child > * { border-bottom: none; }
.timeline-table .tl-name {
  position: sticky; left: 0; z-index: 2; width: 170px; background: var(--surface);
  padding: 6px 12px; text-align: left; font-weight: 600; font-size: 12.5px;
  box-shadow: 1px 0 0 var(--border);
}
.timeline-table .tl-corner { z-index: 3; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tl-in { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-cnt {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); border-radius: 999px; padding: 1px 7px;
}
.timeline-table .tl-group th.tl-name,
.timeline-table .tl-group td {
  background: var(--surface-2); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.timeline-table .tl-group th.tl-name { padding: 4px 12px; }
.timeline-table .tl-day { width: 27px; padding: 4px 0; font-weight: 700; color: var(--muted); background: var(--surface); }
.tl-dw { display: block; font-size: 9px; font-weight: 600; opacity: .65; letter-spacing: .02em; }
.tl-dn { display: block; font-size: 11px; }
.timeline-table .tl-day.we { background: var(--surface-2); color: var(--border-strong); }
.timeline-table .tl-day.today { color: #fff; background: var(--primary); }
.timeline-table .tl-cell { position: relative; height: 30px; }
.timeline-table .tl-cell.we { background: var(--surface-2); }
.timeline-table .tl-cell.is-today { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.timeline-table .tl-cell > i { position: absolute; inset: 3px 1px; border-radius: 3px; }
.timeline-table tbody tr:hover .tl-name { background: var(--bg-tint); }
.timeline-table tbody tr:hover .tl-cell:not(.we) { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.lg-box { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; }

/* ============ MOBIL (≤560px) — admin felület ============ */
@media (max-width: 560px) {
  .stats.four { grid-template-columns: 1fr 1fr; }
  .stats.four .stat { display: block; padding: 12px 13px; }
  .stats.four .stat .n { font-size: 20px; }
  .stats.four .stat .l { font-size: 12px; }

  .toolbar { padding: 10px 12px; gap: 6px; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar .filter { flex: 1 1 calc(50% - 3px); }
  .panel-in { padding: 14px 12px; }

  /* Dolgozó-sor: 3 sávos elrendezés, csak a Szerkesztés gombbal */
  .emp-list { padding: 2px 12px 10px; }
  .emp-row {
    grid-template-columns: 34px 1fr auto;
    grid-template-areas:
      "av main main"
      ".  meta meta"
      ".  bal  act";
    gap: 3px 10px; padding: 12px 0;
  }
  .em-act .icon-only { display: none; }
  .em-bal { gap: 8px; }
  .em-meta { font-size: 12.5px; color: var(--muted); }

  /* Napló: idő fejlécként a sor tetején */
  .log-list { padding: 2px 12px 6px; }
  .log-row { grid-template-columns: 1fr; gap: 5px; }
  .log-time { display: flex; gap: 6px; align-items: baseline; }
  .lg-d { display: inline; }
  .log-line1 { font-size: 13.5px; }
  .log-more { padding: 12px; }

  /* Timeline mobilon: keskenyebb névsáv, görgethető napok */
  .timeline-table .tl-name { width: 118px; padding: 5px 8px; font-size: 11.5px; }
  .timeline-table .tl-group th.tl-name { padding: 3px 8px; }
  .tl-in { gap: 5px; }
  .tl-cnt { font-size: 9.5px; padding: 1px 5px; }
  .timeline-table .tl-day { width: 24px; }
  .timeline-table .tl-cell { height: 26px; }

  /* Jóváhagyás: gombok teljes sorban */
  .ap-actions { align-self: stretch; }
  .ap-bal { flex-wrap: wrap; }
}

/* ===== EGY JELSZÓ: SnailCargo-portálos belépés a belépőlapon ===== */
a.btn { text-decoration: none; }
.auth-card .sso-btn { width: 100%; color: var(--primary); border-color: var(--primary); font-weight: 600; }
.auth-card .sso-btn:hover { background: var(--surface-2); }
.sso-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-size: 12.5px; }
.sso-or::before, .sso-or::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.sso-hint { margin: 14px 0 0; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }
.sso-hint a { color: var(--primary); font-weight: 600; }
.sso-error { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); font-size: 13.5px; line-height: 1.45; }

/* ================= Felvételi adatlap ================= */
.ds-page { min-height: 100vh; padding-bottom: 110px; background:
  radial-gradient(900px 380px at 100% -80px, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%), var(--bg); }
.ds-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.ds-top-in { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ds-top .brand { font-size: 15px; gap: 9px; }
.ds-top .brand .logo { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
.ds-top .brand small { font-size: 11.5px; }
.ds-prog { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ds-prog-bar { width: 110px; height: 6px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; }
.ds-prog-bar i { display: block; height: 100%; width: 0; background: var(--brand-grad); border-radius: inherit; transition: width .35s cubic-bezier(.2,.7,.2,1); }
.ds-wrap { max-width: 760px; margin: 0 auto; padding: 22px 16px 0; }
.ds-hero { padding: 14px 4px 22px; animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.ds-kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }
.ds-hero h1 { font-size: clamp(26px, 6vw, 34px); letter-spacing: -0.03em; margin: 6px 0 8px; line-height: 1.1; }
.ds-hero p { margin: 0 0 14px; color: var(--muted); font-size: 15px; max-width: 58ch; }
.ds-prep { font-size: 13.5px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 13px; line-height: 1.55; }

.ds-sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 6px; margin-bottom: 14px; box-shadow: var(--shadow-xs); animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.ds-sec:nth-child(2) { animation-delay: .04s } .ds-sec:nth-child(3) { animation-delay: .08s } .ds-sec:nth-child(4) { animation-delay: .12s }
.ds-sec > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ds-sec h2 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }
.ds-num { font-size: 13px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 7px; background: var(--primary-soft); }
.ds-sec-admin { border-style: dashed; border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); background: color-mix(in srgb, var(--amber-soft) 28%, var(--surface)); }
.ds-sec-admin .ds-num { background: var(--amber-soft); color: var(--amber); }
.ds-note { margin: -4px 0 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.ds-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 600px) { .ds-grid { grid-template-columns: 1fr 1fr; } .ds-f.wide { grid-column: 1 / -1; } }
.ds-f { margin-bottom: 14px; min-width: 0; }
.ds-f[hidden], .ds-sec [hidden] { display: none !important; }
.ds-f > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ds-req { color: var(--red); margin-left: 3px; }
.ds-hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.ds-err { font-size: 12.5px; color: var(--red); font-weight: 600; margin-top: 5px; }
.ds-err:empty { display: none; }
.ds-f.has-err input, .ds-f.has-err select, .ds-f.has-err textarea { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.ds-f.has-err .ds-yn { box-shadow: 0 0 0 2px var(--red); }
.ds-f input[type=date] { min-height: 44px; }
.ds-f input[readonly] { background: var(--surface-2); color: var(--muted); }
.ds-yn { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); gap: 3px; }
.ds-yn label { position: relative; cursor: pointer; margin: 0; }
.ds-check input, .ds-same input, .ds-mode input, .ds-yn input { padding: 0; }
.ds-yn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ds-yn span { display: block; min-width: 76px; text-align: center; padding: 9px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); transition: background .15s, color .15s, box-shadow .15s; }
.ds-yn input:checked + span { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.ds-yn input:focus-visible + span { box-shadow: var(--ring); }
.ds-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; line-height: 1.45; }
.ds-check input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--primary); }
.ds-check-f { align-self: center; }
.ds-f > label.ds-check { display: flex; font-weight: 500; font-size: 14px; margin-bottom: 0; }
.ds-same { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin: -2px 0 7px; cursor: pointer; }
.ds-same input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }

.ds-children:empty { display: none; }
.ds-child { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 14px 40px 0 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.ds-child-n { font-weight: 800; color: var(--primary); padding-top: 27px; }
.ds-child-g { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 600px) { .ds-child-g { grid-template-columns: 1.4fr 1fr 1fr; } }
.ds-child-x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font-size: 18px; line-height: 1; }
.ds-child-x:hover { color: var(--red); border-color: var(--red); }

.ds-final { padding: 18px; }
.ds-consent.has-err span { color: var(--red); }
.ds-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.ds-bar-in { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ds-bar-in .ds-saved { margin-right: auto; font-size: 12.5px; }
.ds-bar-in .btn { min-width: 112px; }
body:has(.ds-bar) .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
@media (max-width: 480px) { .ds-bar-in .btn { flex: 1; min-width: 0; } .ds-bar-in .ds-saved { display: none; } .ds-prog-bar { width: 70px; } }

.ds-done { text-align: center; }
.ds-done-ic { width: 64px; height: 64px; margin: 4px auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; font-weight: 800; color: #fff; background: var(--green); box-shadow: 0 10px 24px -8px var(--green); animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }

.ds-mode { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .ds-mode { grid-template-columns: 1fr 1fr; } }
.ds-mode label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.ds-mode label:has(input:checked) { border-color: var(--primary); box-shadow: var(--ring); }
.ds-mode input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: var(--primary); }
.ds-mode small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.ds-share { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.ds-admin { padding-bottom: 80px; }
.ds-ahead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ds-atitle { flex: 1; min-width: 200px; }
.ds-atitle b { font-size: 18px; letter-spacing: -0.02em; margin-right: 6px; }
.ds-form-admin .ds-sec { animation: none; }
@media (min-width: 1000px) { .ds-form-admin { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: start; } }
.ds-row .em-bal { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* --- Adatlap-szerkesztő: szakaszok + élő A4-előnézet (a panel Autók mintájára) --- */
.ds-ed { padding-bottom: 40px; }
.ds-ed-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ds-ed-title { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ds-ed-title b { font-size: 19px; letter-spacing: -0.02em; }
.ds-ed-act { display: flex; gap: 8px; flex-wrap: wrap; }
.ds-ed-save { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ds-ed-save i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.ds-ed-save.busy i, .ds-ed-save.dirty i { background: var(--amber); }
.ds-ed-save.err i { background: var(--red); }
.ds-ed-save.err { color: var(--red); }
.ds-warn-chip[hidden], .ds-ed [hidden] { display: none !important; }
.ds-warn-chip { color: var(--amber) !important; border-color: color-mix(in srgb, var(--amber) 45%, var(--border-strong)) !important; }
.ds-ed-grid { display: grid; grid-template-columns: minmax(360px, 520px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ds-ed-meta { font-size: 12px; margin: 10px 2px 0; }

.ds-acc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; box-shadow: var(--shadow-xs); }
.ds-acc > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; cursor: pointer; list-style: none; user-select: none; border-radius: var(--radius-sm); }
.ds-acc > summary::-webkit-details-marker { display: none; }
.ds-acc > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.7px solid var(--muted); border-bottom: 1.7px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .15s; flex: none; margin-left: 2px; }
.ds-acc[open] > summary::after { transform: rotate(225deg) translate(-2px, -1px); }
.ds-acc > summary:hover { background: var(--surface-2); }
.ds-acc .ds-num { font-size: 11.5px; padding: 3px 7px; }
.ds-acc-t { font-weight: 700; min-width: 0; }
.ds-acc-c { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ds-acc-c.full { color: var(--green); }
.ds-acc-b { padding: 14px 14px 2px; border-top: 1px solid var(--border); }
.ds-acc-admin { border-style: dashed; border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); background: color-mix(in srgb, var(--amber-soft) 28%, var(--surface)); }
.ds-acc-admin .ds-num { background: var(--amber-soft); color: var(--amber); }
.ds-ed-form .ds-grid { gap: 0 12px; }
.ds-ed-form .ds-f { margin-bottom: 12px; }
.ds-ed-form input:not([type=checkbox]):not([type=radio]), .ds-ed-form select { padding: 9px 11px; font-size: 14px; }
.ds-ed-form .ds-f input[type=date] { min-height: 40px; }
.ds-ed-form .ds-yn span { min-width: 64px; padding: 7px 12px; font-size: 13.5px; }
@media (min-width: 600px) { .ds-ed-form .ds-child-g { grid-template-columns: 1fr; } }

.ds-prev { position: sticky; top: 82px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.ds-prev-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.ds-prev-t { margin-right: auto; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ds-prev-desk { flex: 1; overflow: auto; padding: 14px; background-color: var(--bg-tint);
  background-image: radial-gradient(color-mix(in srgb, var(--muted) 28%, transparent) 1px, transparent 1px); background-size: 16px 16px; }
.ds-prev-paper { margin: 0 auto; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.12), 0 14px 36px -8px rgba(16,24,40,.22); }
.ds-prev-paper iframe { display: block; width: 794px; height: 1123px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.ds-prev-jump { display: none; }
@media (max-width: 1060px) {
  .ds-ed-grid { grid-template-columns: minmax(0, 1fr); }
  .ds-prev { position: static; max-height: none; }
  .ds-prev-desk { overflow: visible; padding: 10px; }
  .ds-prev-jump { display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; padding: 10px 16px; border-radius: 999px;
    background: var(--text); color: var(--bg); font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow-lg); }
}

/* --- Adatlap: beállítások, továbbítás a könyvelésnek --- */
.ds-set .ds-form { max-width: 860px; }
.ds-set .ds-sec > header { margin-bottom: 14px; }
.ds-set code { font-size: 12.5px; background: var(--gray-soft); padding: 1px 5px; border-radius: 5px; }
.ds-tpl { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; resize: vertical; }
.ds-ph { margin-bottom: 14px; font-size: 13px; }
.ds-ph summary { cursor: pointer; font-weight: 600; }
.ds-ph-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; margin-top: 10px; }
.ds-ph-i { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font: inherit; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; cursor: pointer; }
.ds-ph-i:hover { border-color: var(--primary); }
.brand .logo .logo-letter { color: #fff; font-weight: 800; font-size: .95em; line-height: 1; }

/* ---------- Cégváltó ---------- */
.co-switch { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; max-width: 100%; overflow-x: auto; }
.co-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.co-switch button:hover { color: var(--text); }
.co-switch button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }

/* ---------- Bérjegyzék-feltöltés ---------- */
.ps-up-top { display: flex; gap: 14px; flex-wrap: wrap; }
.ps-up-top .field { flex: 0 1 190px; }
.ps-up-top .ps-up-file { flex: 1 1 280px; }
.ps-pick-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr); gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.ps-pick-row select { padding: 7px 10px; font-size: 13.5px; }
.ps-fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-st { font-size: 12.5px; color: var(--muted); }
.ps-st.ok { color: var(--green); } .ps-st.warn { color: var(--amber); } .ps-st.err { color: var(--red); }
@media (max-width: 640px) { .ps-pick-row { grid-template-columns: 1fr; gap: 4px; } }

.ds-fwd-note { font-size: 13px; line-height: 1.5; color: var(--amber); background: var(--amber-soft); border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 14px; }
