* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-content-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.14); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- App shell ---------- */
/* height (nem min-height) + overflow:hidden itt, hogy a .content legyen az EGYETLEN belsőleg
   görgethető terület — enélkül a flex-elemek (pl. a sidebar) csak a tényleges tartalom
   magasságáig nyúlnak, hosszú űrlapoknál pedig az egész oldal görgethetővé válik a
   sidebar-háttér "levágásával". */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-width);
  flex: none;
  background: var(--color-sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  overflow-y: auto;
  transition: width .18s ease;
}
html[data-sidebar-collapsed="true"] .sidebar { width: var(--sidebar-width-collapsed); padding: 22px 12px; }

.sidebar-brand-block { padding: 4px 4px 22px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.brand-link { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-mark {
  width: 44px; height: 30px; flex: none; border-radius: 8px; background: #fff;
  border: 1px solid var(--color-surface-border); padding: 3px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name {
  font-size: 22px; font-weight: 700; color: #fff; line-height: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-sub {
  display: block; margin-top: 7px; font-size: 11.5px; color: var(--color-sidebar-text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html[data-sidebar-collapsed="true"] .brand-name,
html[data-sidebar-collapsed="true"] .brand-sub { display: none; }
html[data-sidebar-collapsed="true"] .brand-mark { width: 30px; padding: 2px; }

.sidebar-toggle {
  flex: none; width: 30px; height: 30px; border-radius: 8px; border: none;
  background: transparent; color: var(--color-sidebar-text-muted);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-toggle:hover { background: var(--color-sidebar-hover); color: #fff; }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--color-sidebar-text-muted); font-size: 14.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden;
}
.nav-item svg { flex: none; }
.nav-item:hover { background: var(--color-sidebar-hover); color: #EDE7DF; }
.nav-item.active { background: var(--color-accent); color: #fff; font-weight: 600; }
.nav-item--disabled { color: #5C554C; cursor: default; }
.nav-item--disabled:hover { background: transparent; color: #5C554C; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  margin-left: auto; flex: none; font-size: 9.5px; font-weight: 600; letter-spacing: .04em;
  color: var(--color-sidebar-text-faint); background: var(--color-sidebar-hover);
  border-radius: 99px; padding: 2px 7px;
}
.btn-count {
  display: inline-block; margin-left: 6px; min-width: 18px; text-align: center; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--color-accent); border-radius: 99px; padding: 1px 6px; line-height: 1.35;
}
.btn--primary .btn-count { background: #fff; color: var(--color-accent); }
html[data-sidebar-collapsed="true"] .nav-label,
html[data-sidebar-collapsed="true"] .nav-badge { display: none; }

.sidebar-user {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 12px; background: var(--color-sidebar-user-bg);
}
.user-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--color-accent);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.user-info { line-height: 1.2; overflow: hidden; flex: 1; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11.5px; color: var(--color-sidebar-text-faint); }
.logout-form { flex: none; }
.logout-btn {
  width: 28px; height: 28px; border-radius: 8px; border: none; background: transparent;
  color: var(--color-sidebar-text-muted); display: flex; align-items: center; justify-content: center;
}
.logout-btn:hover { background: var(--color-sidebar-hover); color: #fff; }
html[data-sidebar-collapsed="true"] .user-info { display: none; }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  height: var(--topbar-height); flex: none; padding: 0 28px; background: var(--color-topbar-bg);
  border-bottom: 1px solid var(--color-surface-border);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.topbar-title h1 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.topbar-date { font-size: 12px; color: var(--color-text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 14px; flex: none; }

.search-form {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--color-surface-border);
  border-radius: 10px; padding: 9px 15px; width: 230px; color: var(--color-text-muted);
}
.search-form svg { flex: none; }
.search-form input {
  border: none; outline: none; font-size: 13px; width: 100%; font-family: inherit;
  background: transparent; color: var(--color-text);
}

.notif-bell { position: relative; }
.notif-bell-trigger {
  list-style: none; position: relative; width: 38px; height: 38px; border-radius: 10px;
  background: var(--color-sidebar-bg); color: #EDE7DF; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
}
.notif-bell-trigger::-webkit-details-marker { display: none; }
.notif-bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--color-accent); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--color-topbar-bg);
}
.notif-bell-panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: 320px; max-height: 420px; overflow-y: auto;
  background: var(--color-surface); border: 1px solid var(--color-surface-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); padding: 16px; z-index: 30;
}
.notif-bell-header { font-size: 13px; font-weight: 700; margin-bottom: 12px; }

.page-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.page-actions:empty { display: none; }

.content { flex: 1; overflow-y: auto; min-height: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 22px; }

/* ---------- Cards / KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--color-surface); border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg); padding: 18px;
}
.card--accent { background: var(--color-accent); border-color: var(--color-accent); box-shadow: 0 6px 20px rgba(221,74,30,.26); }
.card--dark { background: var(--color-sidebar-bg); border-color: var(--color-sidebar-bg); }
a.card { display: block; transition: transform .12s ease, box-shadow .12s ease; }
a.card:hover { box-shadow: 0 6px 20px rgba(40,30,20,.12); transform: translateY(-1px); }

.kpi-label { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--color-text-muted); }
.card--accent .kpi-label { color: #FAD9CC; }
.kpi-value { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 3px; }
.card--accent .kpi-value { color: #fff; }
.kpi-sub { font-size: 12.5px; font-weight: 500; color: var(--color-text-muted); }
.kpi-sub--danger { color: var(--color-danger); }
.kpi-sub--ok { color: var(--color-ok); }

.section-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .section-grid { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 20px; }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card-title { font-size: 15.5px; font-weight: 700; color: var(--color-text); }
.card--dark .card-title { color: #fff; }
.card-header-note { font-size: 12.5px; color: var(--color-text-muted); font-weight: 600; }

details.card > .card-header { cursor: pointer; list-style: none; }
details.card > .card-header::-webkit-details-marker { display: none; }
details.card > .card-header .card-title { display: flex; align-items: center; }
details.card > .card-header .card-title::before {
  content: ""; flex: none; width: 8px; height: 8px;
  border-right: 2px solid var(--color-text); border-bottom: 2px solid var(--color-text);
  transform: rotate(-45deg); transition: transform .15s ease; margin-right: 10px; margin-bottom: 1px;
}
details[open].card > .card-header .card-title::before { transform: rotate(45deg); margin-bottom: -2px; }

.bar-track { flex: 1; height: 8px; border-radius: 99px; background: #EDE7DF; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; }
.bar-fill--danger { background: var(--color-danger); }
.bar-fill--warn { background: var(--color-warn); }
.bar-fill--ok { background: var(--color-ok); }

/* ---------- Warning / maintenance lists ---------- */
.list-plain { display: flex; flex-direction: column; gap: 14px; }
.list-row { display: flex; align-items: flex-start; gap: 11px; }
a.list-row, a.list-row-block { color: inherit; }
a.list-row:hover .list-row-title, a.list-row-block:hover .list-row-title { color: var(--color-accent); }
.list-row-block { display: block; }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; }
.dot--danger { background: var(--color-danger); }
.dot--warn { background: var(--color-warn); }
.dot--ok { background: var(--color-ok); }
.list-row-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-sub { font-size: 12px; color: var(--color-text-muted); }
.list-row-due { flex: none; font-size: 11.5px; font-weight: 600; color: var(--color-text-secondary); }

.count-badge { font-size: 11.5px; font-weight: 700; color: #fff; background: var(--color-accent); border-radius: 99px; padding: 3px 9px; }

.empty-state { padding: 24px; text-align: center; color: var(--color-text-muted); font-size: 13.5px; }

/* ---------- Detail view ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 20px; }
.detail-item-label { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 3px; }
.detail-item-value { font-size: 13.5px; font-weight: 500; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-text-muted); padding: 10px 14px; border-bottom: 1px solid var(--color-surface-border);
  white-space: nowrap;
}
table.data-table td { padding: 12px 14px; border-bottom: 1px solid #F0EBE3; vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: #FAF8F4; }
table.data-table select, table.data-table input[type="number"] {
  font-family: inherit; font-size: 13px; padding: 6px 8px; border-radius: 6px;
  border: 1px solid var(--color-surface-border); background: #FCFBF9; color: var(--color-text);
}

.name-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--color-sidebar-bg); padding: 6px 13px; border-radius: 8px;
}
.name-pill:hover { background: var(--color-accent); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.badge--danger { color: var(--color-danger); background: var(--color-danger-soft); }
.badge--warn { color: var(--color-warn); background: var(--color-warn-soft); }
.badge--ok { color: var(--color-ok); background: var(--color-ok-soft); }
.badge--muted { color: var(--color-text-muted); background: #F4F0EA; }

/* ---------- Naptár jelmagyarázat + esemény-keret ---------- */
.calendar-legend { display: flex; flex-direction: column; gap: 10px; }
.calendar-legend-group { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.calendar-legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-secondary); }
.calendar-legend-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.calendar-legend-dot--outline { background: transparent; border: 2.5px solid; }
#fullcalendar-root .fc-event { border-width: 2px; }
#fullcalendar-root .fc-event.fc-event--urgent { border-width: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; padding: 10px 18px; border-radius: var(--radius-md);
  border: 1px solid transparent;
}
.btn--primary { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: #C43F17; }
.btn--secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-surface-border); }
.btn--secondary:hover { background: #F4F0EA; }
.btn--danger { background: var(--color-danger); color: #fff; }
.btn--danger:hover { background: #A32C16; }
.btn--sm { padding: 7px 13px; font-size: 12.5px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form-card { background: var(--color-surface); border: 1px solid var(--color-surface-border); border-radius: var(--radius-lg); padding: 24px; max-width: 760px; }
.form-field-active-toggle { display: flex; align-items: center; margin-bottom: 18px; }
.form-field-active-toggle label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--color-text); }
.form-field-active-toggle input { width: 18px; height: 18px; }
.form-section { margin-bottom: 22px; border-bottom: 1px solid var(--color-surface-border); padding-bottom: 4px; }
.form-section:last-of-type { border-bottom: none; }
.form-section-title {
  font-size: 16px; font-weight: 700; color: var(--color-text); margin-bottom: 12px;
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px;
}
.form-section-title::-webkit-details-marker { display: none; }
.form-section-title::before {
  content: ""; flex: none; width: 9px; height: 9px;
  border-right: 2px solid var(--color-text); border-bottom: 2px solid var(--color-text);
  transform: rotate(-45deg); transition: transform .15s ease; margin-bottom: 2px;
}
details[open] > .form-section-title::before { transform: rotate(45deg); margin-bottom: -2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary); }
.form-field input, .form-field select, .form-field textarea {
  font-family: inherit; font-size: 13.5px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-surface-border); background: #FCFBF9; color: var(--color-text);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--color-accent);
}
.month-day-widget { display: flex; gap: 8px; }
.month-day-widget select { flex: 1; min-width: 0; }
.form-errors { color: var(--color-danger); font-size: 12px; margin-top: 2px; }
.form-help { color: var(--color-text-muted); font-size: 11.5px; }
.checkbox-field { flex-direction: row; align-items: center; gap: 8px; }
.signature-block { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.signature-pad {
  width: 100%; max-width: 640px; height: 300px; border-radius: var(--radius-sm);
  border: 1px dashed var(--color-surface-border); background: #FCFBF9; touch-action: none; cursor: crosshair;
}

.formset-block { border-top: 1px solid var(--color-surface-border); margin-top: 18px; padding-top: 16px; }
.formset-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px 18px; padding: 16px 0; border-bottom: 1px solid #F0EBE3; align-items: start;
}
.formset-row .checkbox-field { align-self: center; }
.formset-row:last-child { border-bottom: none; }
.formset-add-btn { margin-top: 10px; }
@media (max-width: 640px) {
  .formset-row { grid-template-columns: 1fr; }
}

/* ---------- Alerts / messages ---------- */
.messages { display: flex; flex-direction: column; gap: 10px; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; }
.alert--success { background: var(--color-ok-soft); color: var(--color-ok); }
.alert--error { background: var(--color-danger-soft); color: var(--color-danger); }
.alert--info { background: var(--color-accent-soft); color: #B83C18; }
.alert--warning { background: var(--color-warn-soft); color: var(--color-warn); }

/* ---------- Login ---------- */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--color-sidebar-bg); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--color-surface); border-radius: var(--radius-xl);
  padding: 32px 30px; box-shadow: var(--shadow-pop);
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.auth-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.auth-subtitle { font-size: 13px; color: var(--color-text-muted); margin-bottom: 22px; }
.auth-card .form-field { margin-bottom: 14px; }
.auth-card .btn { width: 100%; margin-top: 8px; }

/* ---------- Empty / error pages ---------- */
.status-shell { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
.status-card { text-align: center; max-width: 420px; }
.status-code { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--color-accent); text-transform: uppercase; margin-bottom: 8px; }
.status-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.status-text { font-size: 13.5px; color: var(--color-text-muted); margin-bottom: 20px; }

/* ---------- Változási előzmények ---------- */
.history-timeline { display: flex; flex-direction: column; gap: 14px; }
.history-entry { padding-bottom: 14px; border-bottom: 1px solid #F0EBE3; }
.history-entry:last-child { border-bottom: none; padding-bottom: 0; }
.history-entry-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.history-entry-date { font-size: 12px; font-weight: 600; color: var(--color-text-secondary); }
.history-entry-user { font-size: 12px; color: var(--color-text-muted); }
.history-entry-changes { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--color-text-secondary); }
.history-entry-changes li { margin-bottom: 2px; }

/* ---------- Mobil fejléc + alsó tab-sáv (csak <720px-nél látszik) ---------- */
.mobile-header, .mobile-dock { display: none; }

.mobile-header {
  background: var(--color-sidebar-bg); color: #fff; padding: 18px 18px 14px; flex: none;
}
.mobile-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mobile-header-brand { display: flex; align-items: center; gap: 9px; }
.mobile-header-brand .brand-name { color: #fff; font-size: 16px; font-weight: 600; }
.mobile-header-top-actions { display: flex; align-items: center; gap: 10px; }
.mobile-header .notif-bell-trigger { background: #2C2823; width: 36px; height: 36px; }
/* a panel a sötét fejlécben van, de világos háttérrel — ne örökölje a fehér szövegszínt */
.mobile-header .notif-bell-panel { right: 0; left: auto; width: min(320px, 88vw); color: var(--color-text); }
.mobile-header-avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--color-accent);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.mobile-header-search {
  display: flex; align-items: center; gap: 8px; background: #2C2823; border-radius: 10px;
  padding: 9px 14px; margin-bottom: 14px; color: var(--color-sidebar-text-muted);
}
.mobile-header-search svg { flex: none; }
.mobile-header-search input {
  border: none; outline: none; background: transparent; color: #fff; font-family: inherit; font-size: 13px; width: 100%;
}
.mobile-header-greeting { font-size: 12.5px; color: var(--color-sidebar-text-faint); margin-bottom: 2px; }
.mobile-header-title { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }

.mobile-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: var(--color-sidebar-bg); box-shadow: 0 -6px 20px rgba(0,0,0,.18);
}

.mobile-tabbar {
  display: flex; flex-direction: column; width: 100%;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.mobile-tabbar-row { display: flex; width: 100%; }
.mobile-tabbar-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex: 1 1 0; min-width: 0;
  padding: 6px 2px; color: var(--color-sidebar-text-muted); font-size: 9.5px; font-weight: 600;
  border: none; background: none; text-decoration: none;
}
.mobile-tabbar-tab span {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mobile-tabbar-tab.active { color: #fff; }
.mobile-tabbar-tab.active svg { color: var(--color-accent); }
.mobile-tabbar-tab--disabled { color: #5C554C; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .app-shell { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
  .sidebar, .topbar { display: none; }
  .mobile-header { display: block; position: sticky; top: 0; z-index: 24; }
  .mobile-header--compact { padding-top: 10px; padding-bottom: 10px; }
  .mobile-header--compact .mobile-header-search,
  .mobile-header--compact .mobile-header-greeting { display: none; }
  .mobile-header--compact .mobile-header-top { margin-bottom: 6px; }
  .mobile-header--compact .mobile-header-title { font-size: 16px; }
  .mobile-dock { display: flex; }
  .mobile-tabbar { display: flex; }

  .main-area { min-height: 0; }
  /* az alsó menü tényleges magassága (mobile-nav.js méri) + levegő; JS nélkül biztonságos alapérték */
  .content { overflow-y: visible; padding: 14px; gap: 16px; padding-bottom: calc(var(--mobile-dock-height, 130px) + 20px); }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 26px; }
  .card { padding: 14px; }
  .form-card { padding: 16px; max-width: 100%; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 12px 14px; }
  table.data-table { font-size: 12.5px; }
  table.data-table th, table.data-table td { padding: 9px 10px; }
  .col-mobile-hide { display: none; }
  .maintenance-table { table-layout: fixed; }
  .maintenance-table .col-subject { width: 38%; }
  .maintenance-table .col-freq { width: 24%; }
  .maintenance-table .col-next { width: 38%; }
  .maintenance-table th, .maintenance-table td { overflow-wrap: break-word; }
  table.maintenance-table th { white-space: normal; }
  .btn-row { width: 100%; }
  .btn-row .btn { flex: 1; }
  .auth-card { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .formset-row { grid-template-columns: 1fr; }
  .mobile-header-title { font-size: 18px; }
}

/* ---------- Szabadságkérelmek: egymás alatti sorok (telefonon is olvasható) ---------- */
.leave-item { padding: 14px 0; border-bottom: 1px solid var(--color-surface-border); display: flex; flex-direction: column; gap: 8px; }
.leave-item:last-child { border-bottom: none; }
.leave-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.leave-item-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.leave-item-actions form { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.leave-item-actions input[type="text"] { min-width: 180px; flex: 1 1 180px; }

/* Jelenléti ív kezdőlap: nagy, egymás alatti gombok — kesztyűben, napsütésben is. */
.attendance-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.attendance-actions .btn {
  padding: 20px 24px;
  font-size: 18px;
  justify-content: center;
}

/* A `hidden` attribútum mindig rejtsen — egyes komponens-osztályok (pl.
   .form-field, .btn) saját display-e különben felülírná. */
[hidden] { display: none !important; }

/* ---------- Jelenléti ív: havi ív tömörebb elrendezése (UI-review 2026-09-25) ---------- */
.month-switcher {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px;
}
.month-switcher strong { font-size: 16px; text-align: center; flex: 1; }
.month-switcher .btn { flex: none; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 16px; }
.summary-value { font-size: 19px; font-weight: 700; color: var(--color-text); margin-top: 2px; }
.summary-alert {
  background: var(--color-warn-soft); color: var(--color-warn); font-weight: 700;
  border-radius: 10px; padding: 8px 12px; margin-bottom: 12px;
}
.list-toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-bottom: 8px; }
.day-card { margin-bottom: 6px; padding-top: 12px; padding-bottom: 12px; }
.day-card > .card-header { margin-bottom: 0; flex-wrap: wrap; row-gap: 4px; cursor: pointer; }
.day-card[open] > .card-header { margin-bottom: 12px; }
.day-card .card-title { font-size: 15px; }
.day-card-hours { flex-basis: 100%; font-size: 13px; color: var(--color-text-muted); }

@media (max-width: 720px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .month-switcher .btn { flex: none; }
  .list-toolbar .btn { flex: 1; }
}

/* ---------- Jelenléti ív almenü: 3 fix fül + "További ügyintézés" ---------- */
.subnav { margin-bottom: 16px; }
.subnav-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px;
  background: var(--color-surface, #fff); border: 1px solid var(--color-surface-border); border-radius: 12px; padding: 4px; }
.subnav-tab {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 6px 8px;
  border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--color-text); text-decoration: none; text-align: center;
}
.subnav-tab--active { background: var(--color-accent-soft, #FBEAE1); color: var(--color-accent); box-shadow: inset 0 -3px 0 var(--color-accent); }
.subnav-more { margin-top: 8px; }
.subnav-more > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--color-text-muted); padding: 6px 2px; }
.subnav-pending { color: var(--color-accent); }
.subnav-more-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.subnav-more-links .btn { justify-content: center; }

/* ---------- Dolgozók ívei: mobilon kétsoros lista, asztalon táblázat ---------- */
.overview-list { display: none; padding: 4px 14px; }
.overview-row { display: flex; flex-direction: column; gap: 3px; padding: 12px 0; border-bottom: 1px solid #F0EBE3; text-decoration: none; color: var(--color-text); }
.overview-row:last-child { border-bottom: none; }
.overview-row-name { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; }
.overview-row-meta { font-size: 13px; color: var(--color-text-muted); }
.overview-warn { color: var(--color-warn); font-weight: 700; }
.overview-danger { color: var(--color-danger); font-weight: 700; }
.overview-ok { color: var(--color-ok); font-weight: 700; }
@media (max-width: 720px) {
  .overview-list { display: block; }
  .overview-table { display: none; }
}
