/* Betűtípus: HarmonyOS Sans (© Huawei Device Co., Ltd., HarmonyOS Sans Fonts License – módosítatlan fájlok, licenc: /fonts/harmonyos-sans/LICENSE.txt) */
@font-face { font-family: 'HarmonyOS Sans'; src: url('/fonts/harmonyos-sans/HarmonyOS_Sans_Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'HarmonyOS Sans'; src: url('/fonts/harmonyos-sans/HarmonyOS_Sans_Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'HarmonyOS Sans'; src: url('/fonts/harmonyos-sans/HarmonyOS_Sans_Bold.ttf') format('truetype'); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'HarmonyOS Sans'; src: url('/fonts/harmonyos-sans/HarmonyOS_Sans_Black.ttf') format('truetype'); font-weight: 800 950; font-style: normal; font-display: swap; }

:root {
  --bg: #07111f;
  --bg2: #0b1728;
  --card: #111f33;
  --card2: #16263d;
  --line: #263b55;
  --text: #f5f9ff;
  --muted: #95a8bf;
  --lime: #ccff00;
  --lime-soft: rgba(204, 255, 0, 0.14);
  --cyan: #00e5ff;
  --cyan-soft: rgba(0, 229, 255, 0.12);
  --orange: #ff9900;
  --orange-soft: rgba(255, 153, 0, 0.13);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.14);
  --photo-bg: linear-gradient(135deg, rgba(204,255,0,0.18), rgba(0,229,255,0.08));
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);

  /* Aliases for names some later sections referenced without ever defining
     them (ticket left-accent border). Defining them here fixes the missing
     accent color without changing any value #loginPage depends on. */
  --accent-blue: var(--cyan);
  --accent-orange: var(--orange);
  --danger: var(--red);
  --text-muted: var(--muted);

  /* ============================================================
     App visual-refresh tokens (added, never redefines the values above).
     #loginPage never references any --nx-* token, so it cannot be
     affected by anything below this line.
     ============================================================ */
  --nx-bg: #121A22;
  --nx-surface: #18232D;
  --nx-card: #1D2A35;
  --nx-hover: #243746;
  --nx-border: rgba(255,255,255,0.08);
  --nx-border-strong: rgba(255,255,255,0.16);
  --nx-text: #FFFFFF;
  --nx-text-muted: #AAB7C4;
  --nx-on-primary: #0c1710;
  --nx-primary: var(--lime);
  --nx-primary-soft: var(--lime-soft);
  --nx-warning: var(--orange);
  --nx-warning-soft: var(--orange-soft);
  --nx-danger: var(--red);
  --nx-danger-soft: var(--red-soft);
  --nx-info: var(--cyan);
  --nx-info-soft: var(--cyan-soft);

  --nx-space-1: 4px;
  --nx-space-2: 8px;
  --nx-space-3: 12px;
  --nx-space-4: 16px;
  --nx-space-5: 20px;
  --nx-space-6: 24px;
  --nx-space-7: 32px;
  --nx-space-8: 40px;

  --nx-radius-sm: 8px;
  --nx-radius-md: 12px;
  --nx-radius-lg: 16px;
  --nx-radius-xl: 20px;
  --nx-radius-pill: 999px;

  --nx-shadow-sm: 0 1px 3px rgba(0,0,0,0.30);
  --nx-shadow-md: 0 6px 20px rgba(0,0,0,0.28);
  --nx-shadow-lg: 0 18px 44px rgba(0,0,0,0.36);
  --nx-shadow-hover: 0 10px 26px rgba(0,0,0,0.34), 0 0 0 1px rgba(204,255,0,0.30);

  --nx-transition: 200ms ease;
  --nx-transition-fast: 120ms ease;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(circle at 15% 10%, rgba(204,255,0,0.10), transparent 28%),
    radial-gradient(circle at 85% 5%, rgba(0,229,255,0.12), transparent 26%),
    linear-gradient(180deg, #050b14 0%, var(--bg) 42%, #08111e 100%);
  color: var(--text);
  font-family: 'HarmonyOS Sans', Segoe UI, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}
button, input, select, textarea { font-family: inherit; }

.hidden { display: none !important; }
.small { font-size: 0.86rem; color: var(--muted); }
.muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ============================================================
   LOGIN PAGE — DO NOT EDIT THIS BLOCK.
   Byte-identical to the pre-redesign stylesheet. #loginPage must keep
   rendering exactly as before; nothing here should ever change.
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}
.login-card {
  width: 100%;
  max-width: 460px;
  background: rgba(17, 31, 51, 0.92);
  border: 1px solid rgba(204,255,0,0.22);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.login-top {
  padding: 28px;
  background: linear-gradient(135deg, rgba(204,255,0,0.10), rgba(0,229,255,0.08));
  border-bottom: 1px solid var(--line);
}
.brand-row { display: flex; align-items: center; gap: 14px; }
.logo-img { height: 52px; max-width: 280px; object-fit: contain; }
.login-card .logo-img { height: 96px; max-width: 420px; }
.logo-fallback { font-size: 1.25rem; font-weight: 900; letter-spacing: 0.08em; color: var(--lime); }
 .login-title { display: none; }
.login-subtitle { display: none; }
.login-form { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
/* ============================================================
   END LOGIN PAGE FREEZE BLOCK
   ============================================================ */

/* Shared base rules — #loginPage also relies on these exact values.
   Do not edit the declarations below; app-specific styling is layered on
   via the ".app-shell "/"#modalOverlay " scoped rules that follow each one,
   which can never match anything inside #loginPage. */
label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  background: #091322;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 1rem;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(204,255,0,0.12);
}
textarea { resize: vertical; min-height: 86px; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.input-grid.three { grid-template-columns: 1.3fr 1fr 1fr; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
  min-height: 42px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--lime); color: #07111f; box-shadow: 0 10px 28px rgba(204,255,0,0.17); }
.btn-wide { width: 100%; }
.error-box { display: none; background: var(--red-soft); border: 1px solid rgba(239,68,68,0.38); color: #ffd2d2; padding: 11px; border-radius: 12px; font-weight: 800; }
.success-box { display: none; background: var(--lime-soft); border: 1px solid rgba(204,255,0,0.38); color: var(--lime); padding: 11px; border-radius: 12px; font-weight: 800; }

/* App-only field / button / message-box styling. Every selector below is
   scoped under .app-shell or #modalOverlay, both of which are absent from
   #loginPage, so none of this can ever affect the login screen. */
.app-shell label, #modalOverlay label {
  color: var(--nx-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}
.app-shell input, .app-shell select, .app-shell textarea,
#modalOverlay input, #modalOverlay select, #modalOverlay textarea {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-md);
  color: var(--nx-text);
  transition: border-color var(--nx-transition), box-shadow var(--nx-transition);
}
.app-shell input:focus, .app-shell select:focus, .app-shell textarea:focus,
#modalOverlay input:focus, #modalOverlay select:focus, #modalOverlay textarea:focus {
  border-color: var(--nx-primary);
  box-shadow: 0 0 0 3px var(--nx-primary-soft);
}
.app-shell .btn, #modalOverlay .btn {
  border-radius: var(--nx-radius-md);
  transition: transform var(--nx-transition), box-shadow var(--nx-transition), background-color var(--nx-transition), border-color var(--nx-transition), opacity var(--nx-transition);
}
.app-shell .btn:hover, #modalOverlay .btn:hover { transform: translateY(-2px); box-shadow: var(--nx-shadow-hover); }
.app-shell .btn-primary, #modalOverlay .btn-primary {
  background: var(--nx-primary);
  color: var(--nx-on-primary);
  box-shadow: var(--nx-shadow-sm);
}
.app-shell .error-box, #modalOverlay .error-box {
  border-radius: var(--nx-radius-md);
  background: var(--nx-danger-soft);
  border-color: rgba(239,68,68,0.35);
  color: #ffb3b3;
}
.app-shell .success-box, #modalOverlay .success-box {
  border-radius: var(--nx-radius-md);
  background: var(--nx-primary-soft);
  border-color: rgba(204,255,0,0.35);
  color: var(--nx-primary);
}

.btn-cyan { background: var(--nx-info); color: var(--nx-on-primary); }
.btn-secondary { background: var(--nx-card); color: var(--nx-text); border: 1px solid var(--nx-border); }
.btn-warning { background: var(--nx-warning); color: #241505; }
.btn-danger { background: var(--nx-danger); color: white; }
.btn-ghost { background: transparent; color: var(--nx-text-muted); border: 1px solid var(--nx-border); }
.btn-small { padding: 8px 12px; min-height: 34px; font-size: 0.86rem; border-radius: var(--nx-radius-sm); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.app-shell {
  min-height: 100vh;
  background-color: var(--nx-bg);
  background-image: radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 3px 3px;
  color: var(--nx-text);
  display: flex;
  align-items: stretch;
}

/* Sidebar (also #headerActions — the existing mobile show/hide JS toggles
   the ".open" class on this exact element, so the drawer behavior below
   needs no script changes). */
.app-sidebar {
  width: 248px;
  flex: 0 0 248px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--nx-surface);
  border-right: 1px solid var(--nx-border);
  display: flex;
  flex-direction: column;
  padding: var(--nx-space-5) var(--nx-space-3);
  gap: var(--nx-space-5);
  z-index: 30;
}
.sidebar-brand { padding: 0 var(--nx-space-2) var(--nx-space-2); }
.sidebar-logo-img { height: 42px; max-width: 100%; object-fit: contain; }
.sidebar-nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar-nav-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: var(--nx-space-3); border-top: 1px solid var(--nx-border); }
.sidebar-nav-item {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: var(--nx-text-muted);
  box-shadow: none;
  font-weight: 800;
}
.sidebar-nav-item:hover { background: var(--nx-hover); color: var(--nx-text); transform: none; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; }

.mobile-menu-btn { display: none; }
.user-pill {
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  border-radius: var(--nx-radius-pill);
  padding: 8px 14px;
  color: var(--nx-text);
  font-weight: 800;
  white-space: nowrap;
}
.role-tag { color: var(--nx-primary); }

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 var(--nx-space-6);
  background: var(--nx-surface);
  border-bottom: 1px solid var(--nx-border);
}
.app-topbar-spacer { flex: 1 1 auto; }
.container { max-width: 1480px; margin: 0 auto; padding: var(--nx-space-6) var(--nx-space-4) 42px; width: 100%; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: var(--nx-space-4);
  margin-bottom: var(--nx-space-5);
}
.kpi-card {
  background: var(--nx-card);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-6);
  box-shadow: var(--nx-shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--nx-transition), box-shadow var(--nx-transition), border-color var(--nx-transition);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--nx-shadow-hover); border-color: var(--nx-border-strong); }
.kpi-card:before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--nx-info);
}
.kpi-card.ok:before { background: var(--nx-primary); }
.kpi-card.warn:before { background: var(--nx-warning); }
.kpi-card.danger:before { background: var(--nx-danger); }
/* Bento-grid: the first ("Felügyelt gépek") card is the hero tile. */
.kpi-card-hero { grid-column: span 2; display: flex; flex-direction: column; justify-content: center; }
.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--nx-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nx-hover);
  color: var(--nx-info);
  margin-bottom: var(--nx-space-3);
}
.kpi-icon svg { width: 20px; height: 20px; }
.kpi-card.ok .kpi-icon { background: var(--nx-primary-soft); color: var(--nx-primary); }
.kpi-card.warn .kpi-icon { background: var(--nx-warning-soft); color: var(--nx-warning); }
.kpi-card.danger .kpi-icon { background: var(--nx-danger-soft); color: var(--nx-danger); }
.kpi-label { margin: 0 0 7px; color: var(--nx-text-muted); text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.06em; font-weight: 900; }
.kpi-value {
  font-size: 2.05rem;
  font-weight: 950;
  line-height: 1;
  color: var(--nx-text);
  font-family: Consolas, 'SFMono-Regular', Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.kpi-card-hero .kpi-value { font-size: 2.7rem; }
.kpi-hint { margin-top: 6px; color: var(--nx-text-muted); font-size: 0.82rem; }
.kpi-distribution { margin-top: var(--nx-space-4); }
.kpi-distribution-bar { display: flex; width: 100%; height: 8px; border-radius: var(--nx-radius-pill); overflow: hidden; background: var(--nx-hover); }
.kpi-distribution-bar .seg { height: 100%; }
.kpi-distribution-bar .seg.ok { background: var(--nx-primary); }
.kpi-distribution-bar .seg.soon { background: var(--nx-warning); }
.kpi-distribution-bar .seg.expired { background: var(--nx-danger); }
.kpi-distribution-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 0.74rem; color: var(--nx-text-muted); flex-wrap: wrap; }

/* Weather KPI card — a small animated CSS "scene" per current condition,
   built with gradients/shapes only (no external images/services besides
   the one-shot Open-Meteo JSON fetch in fetchWeather()). */
.weather-card { position: relative; overflow: hidden; display: flex; align-items: flex-end; min-height: 132px; cursor: pointer; }
.weather-scene { position: absolute; inset: 0; overflow: hidden; }
.weather-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 100%); }
.weather-content { position: relative; z-index: 2; }
.weather-card .kpi-label, .weather-card .kpi-value, .weather-card .kpi-hint { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.45); }

.weather-card.scene-clear { background: linear-gradient(180deg, #3d8fd6 0%, #8fd3f4 100%); }
.weather-card.scene-partly { background: linear-gradient(180deg, #5c92c4 0%, #a9c9de 100%); }
.weather-card.scene-cloudy, .weather-card.scene-loading { background: linear-gradient(180deg, #64717f 0%, #8f9aa8 100%); }
.weather-card.scene-fog { background: linear-gradient(180deg, #8b97a2 0%, #b9c2cb 100%); }
.weather-card.scene-rain { background: linear-gradient(180deg, #354456 0%, #57687c 100%); }
.weather-card.scene-snow { background: linear-gradient(180deg, #7c93a6 0%, #cfd9e1 100%); }
.weather-card.scene-storm { background: linear-gradient(180deg, #1e2530 0%, #3a4655 100%); }

.wx-sun {
  position: absolute; top: 14px; right: 18px;
  width: 46px; height: 46px; border-radius: 999px;
  background: radial-gradient(circle, #fff6c9 0%, #ffd75e 60%, rgba(255,215,94,0) 72%);
  box-shadow: 0 0 26px 6px rgba(255,215,94,0.55);
  animation: wx-sun-pulse 4s ease-in-out infinite;
}
.wx-sun.small { width: 30px; height: 30px; top: 12px; right: 44px; }
@keyframes wx-sun-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: 0.9; } }

.wx-cloud {
  position: absolute; width: 70px; height: 24px; border-radius: 999px;
  background: rgba(255,255,255,0.85);
  box-shadow: 16px -10px 0 -2px rgba(255,255,255,0.85), -14px -4px 0 -4px rgba(255,255,255,0.7);
  animation: wx-drift 22s linear infinite;
}
.wx-cloud.dark { background: rgba(120,130,145,0.85); box-shadow: 16px -10px 0 -2px rgba(120,130,145,0.85), -14px -4px 0 -4px rgba(120,130,145,0.7); }
.wx-cloud.c1 { top: 18px; left: -20%; animation-duration: 22s; }
.wx-cloud.c2 { top: 46px; left: -40%; animation-duration: 28s; animation-delay: -8s; opacity: 0.8; }
.wx-cloud.c3 { top: 8px; left: -60%; animation-duration: 34s; animation-delay: -4s; opacity: 0.6; }
@keyframes wx-drift { from { transform: translateX(0); } to { transform: translateX(340px); } }

.wx-rain {
  position: absolute; inset: -20px -20px -20px 0; opacity: 0.55;
  background-image: repeating-linear-gradient(115deg, rgba(210,230,255,0.8) 0 2px, transparent 2px 14px);
  animation: wx-rain-fall 0.6s linear infinite;
}
@keyframes wx-rain-fall { from { background-position: 0 0; } to { background-position: -20px 24px; } }

.wx-snow {
  position: absolute; inset: 0; opacity: 0.85;
  background-image: radial-gradient(circle, #fff 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  animation: wx-snow-fall 6s linear infinite;
}
@keyframes wx-snow-fall { from { background-position: 0 0; } to { background-position: 20px 120px; } }

.wx-fog {
  position: absolute; left: -10%; width: 120%; height: 18px;
  background: rgba(255,255,255,0.35); filter: blur(3px); border-radius: 999px;
  animation: wx-fog-drift 12s ease-in-out infinite;
}
.wx-fog.f1 { top: 20px; animation-duration: 12s; }
.wx-fog.f2 { top: 42px; animation-duration: 16s; animation-delay: -4s; opacity: 0.7; }
.wx-fog.f3 { top: 62px; animation-duration: 14s; animation-delay: -8s; opacity: 0.5; }
@keyframes wx-fog-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(24px); } }

.wx-bolt {
  position: absolute; top: 30px; right: 40px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 20px solid #ffe873;
  animation: wx-flash 3s ease-in-out infinite;
}
@keyframes wx-flash { 0%, 92%, 100% { opacity: 0; } 94%, 97% { opacity: 1; } }

/* 7-day forecast modal (openWeatherForecast()) — reuses the same .wx-*
   scene shapes as the dashboard weather card, scaled down to fit. */
.forecast-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--nx-space-3); }
.forecast-day { position: relative; overflow: hidden; border-radius: var(--nx-radius-md); min-height: 150px; display: flex; align-items: flex-end; color: #fff; }
.forecast-day-scene { position: absolute; inset: 0; overflow: hidden; transform: scale(0.6); transform-origin: top right; }
.forecast-day-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.6) 100%); }
.forecast-day-content { position: relative; z-index: 2; padding: 10px; width: 100%; }
.forecast-day-label { font-weight: 900; font-size: 0.86rem; text-shadow: 0 1px 6px rgba(0,0,0,0.45); }
.forecast-day-desc { font-size: 0.74rem; opacity: 0.9; margin-top: 2px; text-shadow: 0 1px 6px rgba(0,0,0,0.45); }
.forecast-day-temps { margin-top: 6px; font-weight: 950; text-shadow: 0 1px 6px rgba(0,0,0,0.45); }
.forecast-day-temps .max { font-size: 1.15rem; }
.forecast-day-temps .min { font-size: 0.9rem; opacity: 0.75; margin-left: 6px; }
.forecast-day-precip { margin-top: 6px; font-size: 0.78rem; color: #d7ecff; text-shadow: 0 1px 6px rgba(0,0,0,0.45); }
.forecast-day.scene-clear { background: linear-gradient(180deg, #3d8fd6 0%, #8fd3f4 100%); }
.forecast-day.scene-partly { background: linear-gradient(180deg, #5c92c4 0%, #a9c9de 100%); }
.forecast-day.scene-cloudy { background: linear-gradient(180deg, #64717f 0%, #8f9aa8 100%); }
.forecast-day.scene-fog { background: linear-gradient(180deg, #8b97a2 0%, #b9c2cb 100%); }
.forecast-day.scene-rain { background: linear-gradient(180deg, #354456 0%, #57687c 100%); }
.forecast-day.scene-snow { background: linear-gradient(180deg, #7c93a6 0%, #cfd9e1 100%); }
.forecast-day.scene-storm { background: linear-gradient(180deg, #1e2530 0%, #3a4655 100%); }
@media (max-width: 760px) {
  .forecast-list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

.panel {
  background: var(--nx-card);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-6);
  box-shadow: var(--nx-shadow-sm);
}
.panel-title { margin: 0 0 12px; font-size: 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--nx-text); }
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: var(--nx-space-4); margin-bottom: var(--nx-space-5); }
.notification-list { display: grid; gap: 9px; }
.notification {
  padding: 12px 14px;
  border-radius: var(--nx-radius-md);
  border: 1px solid var(--nx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--nx-surface);
  transition: background-color var(--nx-transition-fast), border-color var(--nx-transition-fast);
}
.notification:hover { background: var(--nx-hover); }
.notification.danger { border-color: rgba(239,68,68,0.40); background: var(--nx-danger-soft); }
.notification.warning { border-color: rgba(255,153,0,0.40); background: var(--nx-warning-soft); }
.notification.ok { border-color: rgba(204,255,0,0.30); background: var(--nx-primary-soft); }
.notification-title { font-weight: 900; color: var(--nx-text); }
.notification-text { color: var(--nx-text-muted); font-size: 0.9rem; margin-top: 2px; }

.notification-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.notification-content { min-width: 0; }
.notification-photo {
  width: 54px;
  height: 42px;
  border-radius: var(--nx-radius-sm);
  overflow: hidden;
  border: 1px solid var(--nx-border);
  background: var(--nx-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.notification-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.notification-photo.placeholder span {
  color: var(--nx-primary);
  font-weight: 950;
  font-size: 1.2rem;
}
@media (max-width: 760px) {
  .notification-with-photo { align-items: stretch; }
  .notification-main { align-items: flex-start; }
  .notification-photo { width: 50px; height: 40px; }
}

.toolbar { display: flex; flex-direction: column; gap: 12px; margin: var(--nx-space-5) 0; }
.category-tools { display: none; }
.mobile-category-select { display: none; }
.categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  color: var(--nx-text-muted);
  padding: 9px 10px 9px 14px;
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  transition: background-color var(--nx-transition-fast), color var(--nx-transition-fast), border-color var(--nx-transition-fast);
}
.category-btn:hover { background: var(--nx-hover); color: var(--nx-text); }
.category-btn.active { background: var(--nx-primary); border-color: var(--nx-primary); color: var(--nx-on-primary); }
.category-btn.danger-filter.active { background: var(--nx-danger); border-color: var(--nx-danger); color: white; }
.category-name { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; overflow-wrap: anywhere; }
.category-count { flex: 0 0 auto; min-width: 26px; text-align: center; font-size: 0.78rem; font-weight: 900; padding: 2px 8px; border-radius: var(--nx-radius-pill); background: var(--nx-surface); color: var(--nx-text); }
.category-btn.active .category-count { background: rgba(0,0,0,0.18); color: inherit; }
.category-btn.category-all .category-name { color: var(--nx-info); }
.category-btn.category-all.active .category-name { color: inherit; }
.category-btn.danger-filter .category-name { color: var(--nx-danger); }
.category-btn.danger-filter.active .category-name { color: inherit; }
.search-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }

.machine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: var(--nx-space-4);
}
.machine-card-photo {
  width: 100%;
  height: 150px;
  border-radius: var(--nx-radius-md);
  overflow: hidden;
  margin-bottom: 13px;
  border: 1px solid var(--nx-border);
  background: var(--nx-hover);
  display: flex;
  align-items: center;
  justify-content: center;
}
.machine-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.machine-card-photo.placeholder span,
.machine-form-photo.placeholder span,
.machine-detail-photo.placeholder span {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--nx-primary);
  color: var(--nx-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  font-size: 1.8rem;
  font-family: Georgia, serif;
}

.machine-card {
  background: var(--nx-card);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-5);
  cursor: pointer;
  position: relative;
  transition: transform var(--nx-transition), border-color var(--nx-transition), box-shadow var(--nx-transition), background-color var(--nx-transition);
  min-height: 190px;
}
.machine-card:hover { transform: translateY(-4px); border-color: var(--nx-primary); background: var(--nx-hover); box-shadow: var(--nx-shadow-hover); }
.machine-card.expired { border-color: rgba(239,68,68,0.55); box-shadow: 0 0 0 1px rgba(239,68,68,0.20) inset; }
.machine-card.soon { border-color: rgba(255,153,0,0.55); }
.machine-card.inactive { opacity: 0.6; }
.card-top { display: flex; justify-content: space-between; gap: 12px; }
.machine-id { font-size: 1.24rem; color: var(--nx-info); font-weight: 950; margin: 0; font-family: Consolas, 'SFMono-Regular', Menlo, monospace; letter-spacing: 0.02em; }
.machine-name { margin: 4px 0 10px; color: var(--nx-text); font-weight: 800; }
.card-meta { color: var(--nx-text-muted); font-size: 0.92rem; line-height: 1.45; }
.status-dot { width: 12px; height: 12px; border-radius: 999px; flex: 0 0 auto; box-shadow: 0 0 10px currentColor; margin-top: 4px; }
.status-dot.ok { background: var(--nx-primary); color: var(--nx-primary); }
.status-dot.soon { background: var(--nx-warning); color: var(--nx-warning); animation: pulse-dot 2.2s ease-in-out infinite; }
.status-dot.expired { background: var(--nx-danger); color: var(--nx-danger); animation: pulse-dot 1.3s ease-in-out infinite; }
.status-dot.unknown { background: var(--nx-text-muted); color: var(--nx-text-muted); }
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}
.card-quick-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--nx-transition), transform var(--nx-transition);
  z-index: 2;
}
.machine-card:hover .card-quick-actions { opacity: 1; transform: translateY(0); }
.card-quick-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--nx-radius-md);
  border: 1px solid var(--nx-border);
  background: rgba(18,26,34,0.85);
  color: var(--nx-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--nx-transition-fast), border-color var(--nx-transition-fast), transform var(--nx-transition-fast);
}
.card-quick-btn svg { width: 16px; height: 16px; }
.card-quick-btn:hover { background: var(--nx-primary); color: var(--nx-on-primary); border-color: var(--nx-primary); transform: scale(1.08); }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.badge {
  border-radius: var(--nx-radius-pill);
  padding: 4px 10px;
  font-weight: 900;
  font-size: 0.76rem;
  border: 1px solid var(--nx-border);
  color: var(--nx-text-muted);
  background: var(--nx-hover);
}
.badge::before { margin-right: 4px; }
.badge.ok { background: var(--nx-primary-soft); color: var(--nx-primary); border-color: rgba(204,255,0,0.34); }
.badge.ok::before { content: '\25CF'; font-size: 0.6em; }
.badge.soon, .badge.warning { background: var(--nx-warning-soft); color: var(--nx-warning); border-color: rgba(255,153,0,0.34); }
.badge.soon::before, .badge.warning::before { content: '\25B2'; font-size: 0.6em; }
.badge.expired, .badge.danger { background: var(--nx-danger-soft); color: #ff9b9b; border-color: rgba(239,68,68,0.40); }
.badge.expired::before, .badge.danger::before { content: '\2715'; font-size: 0.65em; }
.badge.cyan { background: var(--nx-info-soft); color: var(--nx-info); border-color: rgba(0,229,255,0.28); }
.badge.cyan::before { content: '\25CF'; font-size: 0.6em; }
.badge.inactive { background: var(--nx-hover); color: var(--nx-text-muted); border-color: var(--nx-border); }
.badge.inactive::before { content: '\25CB'; font-size: 0.6em; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 14, 0.78);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-xl);
  box-shadow: var(--nx-shadow-lg);
}
.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--nx-surface);
  border-bottom: 1px solid var(--nx-border);
  padding: 16px 20px;
}
.modal-title { margin: 0; color: var(--nx-primary); font-size: 1.25rem; }
.modal-body { padding: 20px; }
.close-btn { background: transparent; border: 0; color: var(--nx-text-muted); font-size: 2rem; cursor: pointer; line-height: 1; transition: color var(--nx-transition-fast); }
.close-btn:hover { color: var(--nx-text); }
.section { border: 1px solid var(--nx-border); background: var(--nx-card); border-radius: var(--nx-radius-lg); padding: var(--nx-space-4); margin-bottom: var(--nx-space-4); }
.section.danger-section { border-color: rgba(239,68,68,0.40); background: var(--nx-danger-soft); }
.section-title { margin: 0 0 12px; color: var(--nx-info); font-size: 1.02rem; }

/* Modal action toolbar (machine detail): a neutral icon toolbar + a single
   primary CTA, with the destructive action tucked into an overflow menu
   instead of sitting as a loud button in the main row. */
.modal-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: var(--nx-space-4); flex-wrap: wrap; }
.modal-toolbar-icons { display: flex; align-items: center; gap: 4px; background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: var(--nx-radius-md); padding: 4px; }
.modal-toolbar-spacer { flex: 1 1 auto; }
.modal-toolbar-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--nx-radius-sm);
  border: 0;
  background: transparent;
  color: var(--nx-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--nx-transition-fast), color var(--nx-transition-fast);
}
.modal-toolbar-btn svg { width: 18px; height: 18px; }
.modal-toolbar-btn:hover { background: var(--nx-hover); color: var(--nx-text); }
.modal-toolbar .btn-primary svg { width: 16px; height: 16px; }
.modal-overflow { position: relative; }
.modal-overflow-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-md);
  box-shadow: var(--nx-shadow-lg);
  padding: 6px;
  z-index: 10;
}
.modal-overflow-menu.open { display: block; }
.modal-overflow-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: var(--nx-radius-sm);
  padding: 9px 10px;
  color: var(--nx-text);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.modal-overflow-item svg { width: 16px; height: 16px; flex: 0 0 auto; }
.modal-overflow-item:hover { background: var(--nx-hover); }
.modal-overflow-item.danger { color: #ff9b9b; }
.modal-overflow-item.danger:hover { background: var(--nx-danger-soft); }
.machine-detail-photo {
  width: 100%;
  height: 260px;
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--nx-border);
  background: var(--nx-hover);
  display: flex;
  align-items: center;
  justify-content: center;
}
.machine-detail-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.machine-form-photo {
  width: 170px;
  height: 120px;
  border-radius: var(--nx-radius-md);
  overflow: hidden;
  border: 1px solid var(--nx-border);
  background: var(--nx-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.machine-form-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.machine-photo-form-row { display: flex; gap: 14px; align-items: center; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.detail-item { background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: var(--nx-radius-md); padding: 12px; }
.detail-label { color: var(--nx-text-muted); font-size: 0.78rem; text-transform: uppercase; font-weight: 900; margin-bottom: 5px; }
.detail-value { font-weight: 900; color: var(--nx-text); font-family: Consolas, 'SFMono-Regular', Menlo, monospace; }
.task-list { display: grid; gap: 10px; }
.task-card { border: 1px solid var(--nx-border); background: var(--nx-surface); border-radius: var(--nx-radius-md); padding: 13px; }
.task-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.task-name { font-weight: 950; color: var(--nx-text); }
.task-meta { color: var(--nx-text-muted); font-size: 0.88rem; margin-top: 4px; }
.history-list { display: grid; gap: 9px; max-height: 340px; overflow: auto; }
.history-item { border-left: 4px solid var(--nx-info); background: var(--nx-surface); border-radius: var(--nx-radius-md); padding: 12px; border-top: 1px solid var(--nx-border); border-right: 1px solid var(--nx-border); border-bottom: 1px solid var(--nx-border); }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.history-photo { max-width: 100%; max-height: 210px; border-radius: var(--nx-radius-sm); margin-top: 8px; border: 1px solid var(--nx-border); }
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 9px; }
.history-photo-thumb { width: 100%; height: 92px; object-fit: cover; border-radius: var(--nx-radius-sm); border: 1px solid var(--nx-border); background: var(--nx-bg); display: block; transition: opacity var(--nx-transition-fast); }
.history-photo-thumb:hover { opacity: 0.85; }
.issue-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.issue-check { display: flex; align-items: center; gap: 8px; background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: var(--nx-radius-md); padding: 10px; cursor: pointer; }
.issue-check input { width: auto; }

.form-list { display: grid; gap: 10px; margin-top: 10px; }
.form-row-box { border: 1px solid var(--nx-border); background: var(--nx-surface); border-radius: var(--nx-radius-md); padding: 12px; }
.task-form-grid { display: grid; grid-template-columns: 1.5fr 0.7fr 0.9fr 0.7fr auto; gap: 8px; align-items: end; }
.filter-form-grid { display: grid; grid-template-columns: 1.2fr 1.2fr 0.6fr auto; gap: 8px; align-items: end; }
.checkbox-line { display: flex; align-items: center; gap: 8px; color: var(--nx-text-muted); font-weight: 800; }
.checkbox-line input { width: auto; }

@media (max-width: 1050px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .app-topbar { padding: 9px 12px; min-height: 0; }
  .mobile-menu-btn { display: inline-flex; width: auto !important; min-width: 44px; min-height: 38px; padding: 8px 12px; font-size: 1.15rem; }
  .app-sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, calc(100vw - 32px));
    height: 100vh;
    z-index: 60;
    box-shadow: var(--nx-shadow-lg);
  }
  .app-sidebar.open { display: flex; }
  .sidebar-nav-item, .sidebar-nav-item.user-pill { width: 100%; justify-content: flex-start; }
  .category-tools { display: grid; grid-template-columns: 1fr; }
  .mobile-category-select { display: block; }
  .categories { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-row { grid-template-columns: 1fr; }
  .input-grid, .input-grid.three, .detail-grid, .issue-grid { grid-template-columns: 1fr; }
  .task-form-grid, .filter-form-grid { grid-template-columns: 1fr; }
  .machine-grid { grid-template-columns: 1fr; }
  .machine-card-photo { height: 150px; }
  .machine-detail-photo { height: 200px; }
  .machine-photo-form-row { flex-direction: column; align-items: stretch; }
  .machine-form-photo { width: 100%; height: 180px; }
  .btn { width: 100%; }
  .mobile-menu-btn { width: auto !important; }
  .btn-row .btn { width: auto; }
}
@media (max-width: 460px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .login-title { font-size: 1.55rem; }
  .container { padding-left: 12px; padding-right: 12px; }
  .modal-body { padding: 12px; }
}

/* V9.0.2 mobile date/time field fix */
input[type="date"],
input[type="time"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.complete-date-field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
@media (max-width: 760px) {
  .modal-overlay { padding: 8px; }
  .modal {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    border-radius: var(--nx-radius-lg);
  }
  .modal-body, .section {
    max-width: 100%;
    overflow-x: hidden;
  }
  .input-grid > div, .detail-grid > div, .issue-grid > div {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  input, select, textarea {
    max-width: 100%;
    min-width: 0;
  }
  input[type="date"], input[type="time"] {
    font-size: 16px;
    padding: 11px 10px;
  }
  #scheduleDate, #scheduleTime {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}


/* V8.8 hibajegy rendszer */
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--nx-radius-md);
  padding: 13px;
}
.ticket-card.urgent { border-left-color: var(--accent-orange); box-shadow: 0 0 0 1px rgba(255,153,0,0.14) inset; }
.ticket-card.critical { border-left-color: var(--danger); box-shadow: 0 0 0 1px rgba(239,68,68,0.18) inset; }
.ticket-card.normal { border-left-color: var(--accent-blue); }
@media (max-width: 760px) {
  .ticket-card .history-head { align-items: flex-start; }
}

/* V8.8.2 logo cleanup */
.login-card .brand-row { justify-content: center; }
.logo-img-login { height: 98px; max-width: 430px; width: 100%; object-fit: contain; }
@media (max-width: 760px) {
  .logo-img-login { height: 82px; max-width: 310px; }
}

/* V9.0 - Ütemező / munkaterv */
.schedule-list {
  display: grid;
  gap: 10px;
}

.schedule-card {
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
  background: var(--nx-surface);
  padding: 13px;
}

.schedule-card.overdue,
.schedule-card.postponed {
  border-color: rgba(255, 153, 0, 0.45);
}

.schedule-card.in_progress {
  border-color: rgba(0, 229, 255, 0.45);
}

.schedule-card.done {
  border-color: rgba(204, 255, 0, 0.35);
  opacity: 0.82;
}

.schedule-card.cancelled {
  opacity: 0.55;
}

@media (max-width: 760px) {
  .schedule-card .history-head {
    align-items: flex-start;
    gap: 10px;
  }
  .schedule-card .history-head .btn {
    width: auto;
  }
}


/* V9.0.5 - dashboard további aktív ütemezett feladat */
.schedule-card-main {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}
.schedule-card-content { min-width: 0; }
.schedule-card-photo {
  width: 112px;
  height: 86px;
  border-radius: var(--nx-radius-md);
  overflow: hidden;
  border: 1px solid var(--nx-border);
  background: var(--nx-hover);
  display: flex;
  align-items: center;
  justify-content: center;
}
.schedule-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.schedule-mini { align-items: center; }
.schedule-mini-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.schedule-mini-photo {
  width: 58px;
  height: 44px;
  border-radius: var(--nx-radius-sm);
  overflow: hidden;
  border: 1px solid var(--nx-border);
  background: var(--nx-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.schedule-mini-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.schedule-card-photo.placeholder span,
.schedule-mini-photo.placeholder span {
  color: var(--nx-primary);
  font-weight: 950;
  font-size: 1.3rem;
}
@media (max-width: 760px) {
  .schedule-card-main {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
  }
  .schedule-card-photo {
    width: 86px;
    height: 72px;
    border-radius: 12px;
  }
  .schedule-mini {
    align-items: stretch;
  }
  .schedule-mini-main {
    align-items: flex-start;
  }
  .schedule-mini-photo {
    width: 52px;
    height: 42px;
  }
}

.all-schedule-dashboard {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.all-schedule-dashboard::-webkit-scrollbar { width: 8px; }
.all-schedule-dashboard::-webkit-scrollbar-thumb { background: var(--nx-hover); border-radius: 999px; }

/* V9.1 szűrőnyilvántartás és anyagigény */
.filter-list { display: grid; gap: 10px; }
.filter-card {
  border: 1px solid var(--nx-border);
  background: var(--nx-surface);
  border-radius: var(--nx-radius-md);
  padding: 13px;
}
.filter-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pro-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.material-form-grid { display: grid; grid-template-columns: 1.1fr 1.5fr .8fr 1fr 1fr auto; gap: 10px; align-items: end; }
.filter-demand-summary { display: grid; gap: 8px; }
.filter-demand-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--nx-border);
  background: var(--nx-surface);
  border-radius: var(--nx-radius-md);
  padding: 10px 12px;
}
@media (max-width: 760px) {
  .pro-filter-grid, .material-form-grid { grid-template-columns: 1fr; }
  .filter-head { align-items: flex-start; }
}

/* V9.1.1 munkalap fotógaléria nézegető */
.photo-thumb-btn {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
}
.photo-thumb-btn:focus-visible {
  outline: 2px solid var(--nx-primary);
  outline-offset: 2px;
  border-radius: var(--nx-radius-sm);
}
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.photo-lightbox.open { display: flex; }
.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 14, 0.90);
}
.photo-lightbox-panel {
  position: relative;
  width: min(1180px, 100%);
  max-height: 94vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--nx-bg);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-xl);
  box-shadow: var(--nx-shadow-lg);
  overflow: hidden;
}
.photo-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--nx-border);
  background: var(--nx-surface);
}
.photo-lightbox-title {
  color: var(--nx-primary);
  font-weight: 950;
  font-size: 1.02rem;
}
.photo-lightbox-counter {
  color: var(--nx-text-muted);
  font-size: 0.86rem;
  margin-top: 2px;
}
.photo-lightbox-close {
  border: 1px solid var(--nx-border);
  background: var(--nx-hover);
  color: var(--nx-text-muted);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--nx-transition-fast), border-color var(--nx-transition-fast);
}
.photo-lightbox-close:hover { color: var(--nx-text); border-color: var(--nx-primary); }
.photo-lightbox-body {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nx-bg);
  overflow: hidden;
}
.photo-lightbox-body img {
  max-width: 100%;
  max-height: calc(94vh - 160px);
  object-fit: contain;
  display: block;
}
.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 70px;
  border: 1px solid var(--nx-border);
  background: var(--nx-surface);
  color: var(--nx-primary);
  border-radius: var(--nx-radius-md);
  font-size: 3rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background-color var(--nx-transition-fast);
}
.photo-lightbox-nav.prev { left: 14px; }
.photo-lightbox-nav.next { right: 14px; }
.photo-lightbox-nav:hover { background: var(--nx-hover); }
.photo-lightbox-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--nx-border);
  background: var(--nx-surface);
}
.photo-lightbox-thumb {
  width: 70px;
  height: 52px;
  flex: 0 0 auto;
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-sm);
  overflow: hidden;
  padding: 0;
  background: var(--nx-bg);
  cursor: pointer;
  opacity: 0.68;
  transition: opacity var(--nx-transition-fast), border-color var(--nx-transition-fast);
}
.photo-lightbox-thumb.active {
  opacity: 1;
  border-color: var(--nx-primary);
  box-shadow: 0 0 0 2px var(--nx-primary-soft);
}
.photo-lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body.photo-lightbox-open { overflow: hidden; }
@media (max-width: 760px) {
  .photo-lightbox { padding: 8px; }
  .photo-lightbox-panel { border-radius: 16px; max-height: 96vh; }
  .photo-lightbox-header { padding: 10px 12px; }
  .photo-lightbox-body { min-height: 220px; }
  .photo-lightbox-body img { max-height: calc(96vh - 150px); }
  .photo-lightbox-nav {
    width: 42px;
    height: 58px;
    font-size: 2.3rem;
    border-radius: 12px;
  }
  .photo-lightbox-nav.prev { left: 8px; }
  .photo-lightbox-nav.next { right: 8px; }
  .photo-lightbox-thumb { width: 58px; height: 44px; }
}

/* V9.2.2 QR gépazonosítás és címke modul */
.qr-label-preview-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.qr-label-preview-canvas {
  display: block;
  width: min(100%, 860px);
  height: auto;
  border-radius: var(--nx-radius-xl);
  box-shadow: var(--nx-shadow-md);
  background: transparent;
}
@media (max-width: 760px) {
  .qr-label-preview-canvas {
    width: 100%;
  }
}

/* V10.2.4 - Jóváhagyott értesítések lapozás */
.approved-dashboard-meta {
  padding: 0 2px 4px;
}
.pager-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 6px;
  flex-wrap: wrap;
}
.pager-row .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}


/* Linotech fejlesztői lábléc: vékony, visszafogott sáv finom zöld felső vonallal */
.app-footer {
  position: relative;
  margin-top: 28px;
  background: var(--nx-bg);
  color: var(--nx-text-muted);
  border-top: 1px solid var(--nx-border);
  padding: 9px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.app-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  width: min(240px, 40%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--nx-primary), transparent);
}
.app-footer strong { color: var(--nx-text); font-weight: 700; letter-spacing: 0.06em; }
.app-footer-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--nx-primary); opacity: 0.7; }
.app-footer a {
  color: var(--nx-primary);
  text-decoration: none;
  font-weight: 600;
}
.app-footer a:hover { text-decoration: underline; }
@media (max-width: 760px) {
  .app-footer {
    margin-top: 18px;
    padding: 8px 12px;
    font-size: 0.72rem;
    gap: 8px;
  }
}

/* Command palette (Ctrl/Cmd+K) — lazily injected by ensureCommandPalette() */
.command-palette {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.command-palette.open { display: flex; }
.command-palette-backdrop { position: absolute; inset: 0; background: rgba(6,10,14,0.75); }
.command-palette-panel {
  position: relative;
  width: min(560px, 100%);
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-xl);
  box-shadow: var(--nx-shadow-lg);
  overflow: hidden;
}
.command-palette-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--nx-border);
  color: var(--nx-text-muted);
}
.command-palette-input-row svg { width: 20px; height: 20px; flex: 0 0 auto; }
.command-palette-input-row input {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 1rem;
  color: var(--nx-text);
}
.command-palette-input-row input:focus { box-shadow: none; }
.command-palette-results { max-height: 360px; overflow-y: auto; padding: 8px; }
.command-palette-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  border-radius: var(--nx-radius-md);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: var(--nx-text);
  transition: background-color var(--nx-transition-fast);
}
.command-palette-item:hover { background: var(--nx-hover); }
.command-palette-item-id { font-family: Consolas, 'SFMono-Regular', Menlo, monospace; color: var(--nx-info); font-weight: 800; }
.command-palette-item-name { flex: 1 1 auto; }
.command-palette-item-loc { color: var(--nx-text-muted); font-size: 0.82rem; }
.command-palette-empty { padding: 20px; text-align: center; color: var(--nx-text-muted); }
body.command-palette-open { overflow: hidden; }

/* Toast notifications — lazily injected by ensureToastContainer() */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  min-width: 240px;
  max-width: 360px;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-left: 4px solid var(--nx-primary);
  border-radius: var(--nx-radius-md);
  padding: 12px 16px;
  color: var(--nx-text);
  font-weight: 700;
  box-shadow: var(--nx-shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--nx-transition), transform var(--nx-transition);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-danger { border-left-color: var(--nx-danger); }
.toast-warn { border-left-color: var(--nx-warning); }

@media (max-width: 760px) {
  .command-palette { padding: 8vh 10px 10px; }
  .toast-container { right: 10px; bottom: 10px; left: 10px; }
  .toast { min-width: 0; max-width: none; }
}

/* ============================================================
   Naptár nézet (havi / periódus / heti, mobilon napi lista)
   ============================================================ */
.modal.modal-xl { width: min(1480px, 100%); max-height: 96vh; }
.cal-root, .cal-tip { --cal-task: var(--nx-info); --cal-filter: var(--nx-primary); --cal-ticket: var(--nx-warning); --cal-manual: #b58cff; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.cal-nav .btn { min-width: 38px; }
.cal-title { margin: 0 0 0 8px; font-size: 1.15rem; color: var(--nx-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-views { display: inline-flex; background: var(--nx-bg); border: 1px solid var(--nx-border); border-radius: var(--nx-radius-md); padding: 3px; }
.cal-views button { background: transparent; border: 0; color: var(--nx-text-muted); font-weight: 800; padding: 7px 14px; border-radius: var(--nx-radius-sm); cursor: pointer; }
.cal-views button.active { background: var(--nx-card); color: var(--nx-primary); box-shadow: var(--nx-shadow-sm); }
.cal-actions { display: flex; gap: 8px; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
#modalOverlay .cal-filters select { width: auto; min-width: 150px; max-width: 240px; padding: 7px 10px; font-size: 0.88rem; }
.cal-check { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; cursor: pointer; white-space: nowrap; }
#modalOverlay .cal-check input { width: 16px; height: 16px; padding: 0; margin: 0; accent-color: var(--nx-primary); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; font-size: 0.78rem; color: var(--nx-text-muted); }
.cal-lg { display: inline-flex; align-items: center; gap: 6px; }
.cal-lg::before { content: ''; width: 14px; height: 10px; border-radius: 3px; border-left: 4px solid var(--c, var(--nx-text-muted)); background: var(--nx-card); }
.cal-lg.k-task { --c: var(--cal-task); }
.cal-lg.k-filter { --c: var(--cal-filter); }
.cal-lg.k-ticket { --c: var(--cal-ticket); }
.cal-lg.k-manual { --c: var(--cal-manual); }
.cal-lg.lg-forecast::before { border: 1px dashed var(--nx-text-muted); background: transparent; }
.cal-lg.lg-overdue::before { background: var(--nx-danger-soft); border-left-color: var(--nx-danger); }
.cal-lg.lg-done::before { opacity: 0.45; }
.cal-lg.lg-postponed::before { background: repeating-linear-gradient(135deg, var(--nx-warning-soft) 0 3px, transparent 3px 6px); border-left-color: var(--nx-warning); }

.cal-overdue { border: 1px solid rgba(239,68,68,0.40); background: var(--nx-danger-soft); border-radius: var(--nx-radius-md); padding: 10px 12px; margin-bottom: 12px; }
.cal-overdue-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; color: #ffb4b4; }
.cal-overdue-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow: auto; }
.cal-overdue-list .cal-ev { max-width: 300px; }

.cal-grid { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); border: 1px solid var(--nx-border); border-radius: var(--nx-radius-md); overflow: hidden; background: var(--nx-border); gap: 1px; }
.cal-head { background: var(--nx-bg); color: var(--nx-text-muted); font-weight: 800; font-size: 0.82rem; text-align: center; padding: 8px 4px; }
.cal-head.is-weekend { color: rgba(170,183,196,0.65); }
.cal-gutter { background: var(--nx-bg); color: var(--nx-text-muted); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 8px; font-size: 0.74rem; font-weight: 800; line-height: 1.35; }
.cal-gutter span:first-child { color: var(--nx-info); }
.cal-day { background: var(--nx-card); min-height: 124px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background-color var(--nx-transition-fast), box-shadow var(--nx-transition-fast); }
.cal-grid-week .cal-day { min-height: 420px; }
.cal-day.is-weekend { background: #1a2631; }
.cal-day.is-out { background: var(--nx-surface); }
.cal-day.is-out .cal-day-num { opacity: 0.45; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--nx-primary); }
.cal-day.drop-target { background: var(--nx-hover); box-shadow: inset 0 0 0 2px var(--nx-info); }
.cal-day-head { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.cal-day-num { font-weight: 800; font-size: 0.86rem; color: var(--nx-text); }
.cal-day.is-past:not(.is-today) .cal-day-num { color: var(--nx-text-muted); }
.cal-day.is-today .cal-day-num { background: var(--nx-primary); color: var(--nx-on-primary); border-radius: var(--nx-radius-pill); padding: 1px 8px; }
.cal-period-start { font-size: 0.68rem; font-weight: 900; color: var(--nx-info); background: var(--nx-info-soft); border-radius: var(--nx-radius-pill); padding: 1px 6px; }
.cal-add { margin-left: auto; background: transparent; border: 1px solid transparent; color: var(--nx-text-muted); border-radius: 6px; width: 22px; height: 22px; line-height: 1; cursor: pointer; opacity: 0; font-weight: 900; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-add:hover { border-color: var(--nx-border-strong); color: var(--nx-primary); }
.cal-day-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-more { background: transparent; border: 0; color: var(--nx-info); font-size: 0.76rem; font-weight: 800; text-align: left; cursor: pointer; padding: 2px 4px; }

.cal-ev { --c: var(--nx-text-muted); background: var(--nx-surface); border: 1px solid var(--nx-border); border-left: 4px solid var(--c); border-radius: 6px; padding: 3px 6px; font-size: 0.76rem; line-height: 1.3; color: var(--nx-text); cursor: pointer; min-width: 0; transition: border-color var(--nx-transition-fast); }
.cal-ev:hover { border-color: var(--nx-border-strong); border-left-color: var(--c); }
.cal-ev[draggable="true"] { cursor: grab; }
.cal-ev.dragging { opacity: 0.4; }
.cal-ev.k-task { --c: var(--cal-task); }
.cal-ev.k-filter { --c: var(--cal-filter); }
.cal-ev.k-ticket { --c: var(--cal-ticket); }
.cal-ev.k-manual { --c: var(--cal-manual); }
.cal-ev-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev-title b { color: var(--nx-text); margin-right: 4px; }
.cal-ev-mid { color: var(--c); font-weight: 800; }
.cal-ev-sub { color: var(--nx-text-muted); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-grid-week .cal-ev, .cal-agenda .cal-ev { padding: 6px 8px; }
.cal-grid-week .cal-ev-title, .cal-agenda .cal-ev-title { white-space: normal; font-weight: 700; }
.cal-ev.is-forecast { background: transparent; border-style: dashed; opacity: 0.82; }
.cal-ev.is-forecast:hover { opacity: 1; }
.cal-ev.is-overdue { background: var(--nx-danger-soft); border-color: rgba(239,68,68,0.45); }
.cal-ev.is-overdue .cal-ev-sub { color: #ffb4b4; }
.cal-ev.st-done { opacity: 0.5; }
.cal-ev.st-done .cal-ev-title::before { content: "\2713\00a0"; color: var(--nx-primary); font-weight: 900; }
.cal-ev.st-cancelled { opacity: 0.4; text-decoration: line-through; }
.cal-ev.st-postponed:not(.is-overdue) { background: repeating-linear-gradient(135deg, var(--nx-warning-soft) 0 4px, transparent 4px 9px), var(--nx-surface); }
.cal-ev.st-in_progress .cal-ev-title::before { content: "\25B6\00a0"; color: var(--nx-info); font-size: 0.8em; }

.cal-agenda { display: grid; gap: 10px; }
.cal-agenda-day { border: 1px solid var(--nx-border); background: var(--nx-card); border-radius: var(--nx-radius-md); padding: 10px; display: grid; gap: 6px; }
.cal-agenda-day.is-today { border-color: var(--nx-primary); }
.cal-agenda-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cal-agenda-head span { color: var(--nx-info); font-size: 0.78rem; font-weight: 800; }

@media (max-width: 760px) {
  .cal-title { font-size: 1rem; margin-left: 4px; }
  .cal-actions { width: 100%; }
  .cal-actions .btn { flex: 1 1 0; }
  #modalOverlay .cal-filters select { flex: 1 1 calc(50% - 8px); min-width: 0; max-width: none; }
  .cal-overdue-list .cal-ev { max-width: 100%; flex: 1 1 100%; }
}

/* Gépen becsukható oldalsáv: keskeny ikonsáv, a feliratok tooltipként látszanak. */
@media (min-width: 761px) {
  .mobile-menu-btn { display: inline-flex; min-width: 40px; }
  .app-sidebar { transition: width var(--nx-transition), flex-basis var(--nx-transition), padding var(--nx-transition); }
  .app-shell.sidebar-collapsed .app-sidebar { width: 68px; flex-basis: 68px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }
  .app-shell.sidebar-collapsed .sidebar-brand { display: none; }
  .app-shell.sidebar-collapsed .sidebar-nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
  .app-shell.sidebar-collapsed .sidebar-nav-item span { display: none; }
}

/* Nyitott modal alatt ne görögjön az oldal. */
body.modal-open { overflow: hidden; }

/* Naptár mint önálló oldal */
.calendar-view { background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: var(--nx-radius-xl); padding: var(--nx-space-5); box-shadow: var(--nx-shadow-md); }
.cal-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cal-page-title { margin: 0; color: var(--nx-primary); font-size: 1.35rem; }
@media (max-width: 760px) {
  .calendar-view { padding: 12px; border-radius: var(--nx-radius-lg); }
  .cal-page-head .btn { width: auto; }
}

/* Naptár: ütemezésre váró tételek (nincs számolható dátumuk) */
.cal-backlog { border: 1px dashed var(--nx-border-strong); background: var(--nx-card); border-radius: var(--nx-radius-md); padding: 8px 12px; margin-bottom: 12px; }
.cal-backlog-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; background: transparent; border: 0; padding: 2px 0; color: var(--nx-text); text-align: left; cursor: pointer; font: inherit; }
.cal-backlog-caret { color: var(--nx-text-muted); width: 12px; }
.cal-backlog .cal-overdue-list { margin-top: 8px; }

/* Éves nézet: hetek oszlopokban, gépek sorokban */
.cal-y-wrap { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--nx-border); border-radius: var(--nx-radius-md); background: var(--nx-border); }
.cal-year { display: grid; grid-template-columns: 190px repeat(var(--weeks), minmax(36px, 1fr)); grid-auto-rows: 30px; gap: 1px; min-width: calc(190px + var(--weeks) * 37px); font-size: 0.74rem; }
.cal-y-corner, .cal-y-ph, .cal-y-wh, .cal-y-label { background: var(--nx-bg); color: var(--nx-text-muted); font-weight: 800; }
.cal-y-corner { grid-row: span 2; position: sticky; left: 0; top: 0; z-index: 4; display: flex; flex-direction: column; justify-content: center; padding: 0 10px; line-height: 1.5; }
.cal-y-corner b { color: var(--nx-info); }
.cal-y-ph { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: center; color: var(--nx-info); cursor: pointer; font-size: 0.8rem; }
.cal-y-ph:hover { background: var(--nx-hover); }
.cal-y-wh { position: sticky; top: 31px; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; cursor: pointer; }
.cal-y-wh b { color: var(--nx-text); font-size: 0.74rem; }
.cal-y-wh span { font-size: 0.64rem; font-weight: 700; }
.cal-y-wh:hover { background: var(--nx-hover); }
.cal-y-label { position: sticky; left: 0; z-index: 1; display: flex; align-items: baseline; gap: 6px; padding: 0 10px; overflow: hidden; white-space: nowrap; line-height: 30px; }
.cal-y-label[data-machine] { cursor: pointer; }
.cal-y-label[data-machine]:hover .cal-y-mid { color: var(--nx-primary); }
.cal-y-mid { color: var(--nx-text); }
.cal-y-sub { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cal-y-group { grid-column: 1 / -1; background: var(--nx-surface); color: var(--nx-primary); font-weight: 900; font-size: 0.76rem; display: flex; align-items: center; }
.cal-y-group span { position: sticky; left: 0; padding: 0 10px; }
.cal-y-cell { --c: var(--nx-text-muted); background: var(--nx-card); display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--nx-text); cursor: pointer; }
.cal-y-cell:hover { box-shadow: inset 0 0 0 2px var(--nx-info); }
.cal-y-cell.is-past { background: var(--nx-surface); }
.cal-y-cell.pw1, .cal-y-wh.pw1 { box-shadow: inset 2px 0 0 var(--nx-info-soft); }
.cal-y-wh.is-now { background: var(--nx-primary); }
.cal-y-wh.is-now b, .cal-y-wh.is-now span { color: var(--nx-on-primary); }
.cal-y-cell.is-now { box-shadow: inset 2px 0 0 var(--nx-primary), inset -2px 0 0 var(--nx-primary); }
.cal-y-cell.k-task { --c: var(--cal-task); }
.cal-y-cell.k-filter { --c: var(--cal-filter); }
.cal-y-cell.k-ticket { --c: var(--cal-ticket); }
.cal-y-cell.k-manual { --c: var(--cal-manual); }
.cal-y-cell.y-sched { background: var(--c); color: #0b1218; }
.cal-y-cell.y-forecast { background: transparent; box-shadow: inset 0 0 0 1px var(--c); outline: 1px dashed var(--c); outline-offset: -4px; color: var(--c); }
.cal-y-cell.y-done { background: var(--c); color: #0b1218; opacity: 0.45; }
.cal-y-cell.y-overdue { background: var(--nx-danger); color: #fff; }
.cal-y-label.is-total, .cal-y-cell.is-total { background: var(--nx-bg); }
.cal-y-label.is-total .cal-y-mid { color: var(--nx-info); }
.cal-y-cell.is-total.y-sched, .cal-y-cell.is-total.y-forecast, .cal-y-cell.is-total.y-done { background: var(--nx-bg); color: var(--nx-text); outline: 0; box-shadow: inset 0 -3px 0 var(--c); opacity: 1; }
.cal-y-cell.is-total.y-overdue { background: var(--nx-danger-soft); color: #ffb4b4; }

.cal-tip { position: fixed; z-index: 3000; width: 320px; max-width: calc(100vw - 16px); background: var(--nx-card); border: 1px solid var(--nx-border-strong); border-radius: var(--nx-radius-md); box-shadow: var(--nx-shadow-sm), 0 12px 32px rgba(0,0,0,0.45); padding: 10px 12px; pointer-events: none; display: grid; gap: 6px; font-size: 0.8rem; color: var(--nx-text); max-height: calc(100vh - 16px); overflow: hidden; }
.cal-tip-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cal-tip-head strong { color: var(--nx-info); }
.cal-tip-head span { color: var(--nx-text-muted); font-weight: 700; }
.cal-tip-machine { font-weight: 800; color: var(--nx-primary); }
.cal-tip-counts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.74rem; color: var(--nx-text-muted); }
.cal-tip-bad { color: #ffb4b4; font-weight: 800; }
.cal-tip-list { display: grid; gap: 4px; }
.cal-tip-foot { color: var(--nx-text-muted); font-size: 0.72rem; border-top: 1px solid var(--nx-border); padding-top: 6px; }
.cal-tip-photo { height: 150px; border-radius: var(--nx-radius-sm); overflow: hidden; background: var(--nx-surface); }
.cal-tip-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-tip-photo.placeholder { height: 56px; display: flex; align-items: center; justify-content: center; color: var(--nx-text-muted); font-weight: 900; font-size: 1.4rem; }
/* Heti nézetben minden nap "+" gombja mindig látszik. */
.cal-grid-week .cal-add { opacity: 1; width: 28px; height: 28px; font-size: 1.05rem; border-color: var(--nx-border-strong); background: var(--nx-surface); color: var(--nx-primary); }
.cal-grid-week .cal-add:hover { background: var(--nx-primary); color: var(--nx-on-primary); border-color: var(--nx-primary); }

/* "Gépek" oldal: a dashboard géprácsa KPI-k és panelek nélkül */
#dashboardView:not(.machines-only) .machines-page-head { display: none; }
#dashboardView.machines-only #kpiGrid, #dashboardView.machines-only .dashboard-grid { display: none; }
#dashboardView.machines-only .toolbar { margin-top: 0; }
