:root {
  --nav-h: 58px;
  --nav-gap: 8px;
  --nav-lift: 14px;
  --header-h: 56px;

  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e5e7eb;

  --text-main: #111827;
  --text-muted: #6b7280;

  --work-bg: #ff6e77;
  --work-text: #1f2937;

  --holiday-bg: #dcfce7;
  --holiday-text: #14532d;

  --car-bg: #fff476;
  --car-text: #5b3b00;

  --accent: #2563eb;

  --badge-bg: rgba(255, 255, 255, 0.84);
  --badge-border: rgba(17, 24, 39, 0.14);
  --badge-shadow: rgba(17, 24, 39, 0.10);
  --badge-ink: #334155;
  --badge-muted: #475569;
  --badge-accent-bg: rgba(37, 99, 235, 0.18);
  --badge-accent-ink: #1d4ed8;
  --badge-mark-bg: rgba(245, 158, 11, 0.24);
  --badge-mark-border: rgba(146, 64, 14, 0.28);
  --badge-mark-ink: #7c2d12;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --card: #111b2e;
  --border: #26364f;

  --text-main: #e5edf9;
  --text-muted: #9fb0c7;

  --work-bg: #a33758;
  --work-text: #fce7f3;

  --holiday-bg: #1a5a33;
  --holiday-text: #dcfce7;

  --car-bg: #6f611f;
  --car-text: #fff8cf;

  --accent: #60a5fa;

  --badge-bg: rgba(15, 23, 42, 0.72);
  --badge-border: rgba(148, 163, 184, 0.40);
  --badge-shadow: rgba(0, 0, 0, 0.35);
  --badge-ink: #dbeafe;
  --badge-muted: #cbd5e1;
  --badge-accent-bg: rgba(96, 165, 250, 0.25);
  --badge-accent-ink: #bfdbfe;
  --badge-mark-bg: rgba(251, 191, 36, 0.28);
  --badge-mark-border: rgba(253, 224, 71, 0.42);
  --badge-mark-ink: #fef3c7;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  /* NO SCROLL */
  overscroll-behavior: none;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto;
  background: var(--bg);
  color: var(--text-main);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(1100px 420px at 50% -120px, rgba(96, 165, 250, 0.14), transparent 62%),
    var(--bg);
}

main {
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-h) + var(--nav-gap) + var(--nav-lift) + env(safe-area-inset-bottom) + 12px);
  overflow: hidden;
  /* NO SCROLL */
}

/* ===== HEADER ===== */
.top {
  height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
}

.top strong {
  grid-column: 2;
  text-align: center;
  font-size: clamp(18px, 2.9vw, 28px);
  letter-spacing: 0.25px;
  line-height: 1.1;
  white-space: nowrap;
}

.top-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.top .prev-btn {
  grid-column: 1;
  justify-self: start;
}

.top button {
  appearance: none;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--accent);
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.10);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.top .nav-btn {
  border-radius: 18px;
  width: 62px;
  height: 52px;
  min-width: 62px;
  font-size: 32px;
}

.top .theme-btn {
  border-radius: 16px;
  width: 48px;
  height: 52px;
  min-width: 48px;
  font-size: 22px;
}

:root[data-theme="dark"] .top button {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.36);
}

/* ===== NAPNEVEK ===== */
.dow {
  padding: 2px 6px 4px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dow-cell {
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  color: var(--text-muted);
  padding: 4px 0 2px;
  line-height: 1;
}

/* ===== CALENDAR ===== */
.cal {
  flex: 1;
  min-height: 0;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  overflow: hidden;
  grid-auto-rows: 1fr;
  min-width: 0;
}

.day {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 4px 0;
  gap: 3px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  --day-num: var(--text-main);
  --day-meta: var(--text-muted);
  --badge-radius: 8px;
  --info-zone-h: 34px;
}

.day.pad {
  background: transparent;
  border: 1px dashed rgba(17, 24, 39, 0.10);
  cursor: default;
  box-shadow: none;
}

.day .num {
  font-size: clamp(22px, 4.8vw, 34px);
  font-weight: 900;
  line-height: 1;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.05);
  min-width: 2.05em;
  color: var(--day-num);
}

.day .wd {
  margin-top: 2px;
  font-size: clamp(11px, 2vw, 15px);
  font-weight: 900;
  line-height: 1;
  color: var(--day-meta);
}

/* alsó információ */
.day .info {
  margin-top: auto;
  min-width: 0;
  width: 100%;
  min-height: var(--info-zone-h);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 5px;
  color: var(--day-meta, var(--text-muted));
  text-align: center;
  font-weight: 900;
  line-height: 1.06;
}

.day .info:not(.hours):not(.private-info):not(.info-rest) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 5px 9px 6px;
  font-size: clamp(14px, 2.6vw, 18px);
  line-height: 1.08;
  border-radius: var(--badge-radius);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  box-shadow: 0 1px 2px var(--badge-shadow);
  max-width: 90%;
  min-height: 30px;
  color: var(--badge-ink);
  white-space: nowrap;
  overflow: visible;
}

.day .info.info-work {
  font-weight: 940;
}

.day .info.info-rest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  width: auto;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 5px 4px;
  border-radius: 999px;
  border: 1px solid var(--rest-badge-border, var(--badge-border));
  background: var(--rest-badge-bg, var(--badge-bg));
  box-shadow: 0 1px 2px var(--badge-shadow);
  font-size: clamp(10px, 1.9vw, 14px);
  font-weight: 900;
  line-height: 1.08;
  color: var(--rest-badge-ink, var(--badge-ink));
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.day .info.info-holiday {
  font-weight: 890;
}

.day .info.hours.modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 2px 8px;
}

.day .info.hours.modern .ico {
  font-size: clamp(21px, 3.5vw, 29px);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05em;
  height: 2.05em;
  border-radius: 999px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  box-shadow: 0 1px 2px var(--badge-shadow);
  color: var(--badge-ink);
  margin: 0 auto;
}

.day .info.hours.modern .txt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: auto;
  max-width: calc(100% - 2px);
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
  word-break: normal;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.day .info.hours.modern .txt .hline,
.day .info.hours.modern .txt .mline,
.day .info.hours.modern .txt .mark {
  display: block;
  width: auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  line-height: 1.1;
  color: var(--badge-ink);
  text-align: center;
}

.day .info.hours.modern .txt .hline {
  font-size: clamp(16px, 3vw, 21px);
  font-weight: 960;
}

.day .info.hours.modern .txt .mline {
  font-size: clamp(10px, 2vw, 13px);
  font-weight: 920;
  color: var(--badge-muted);
}

.day .info.hours.modern .txt .mline.zero {
  opacity: 0.82;
}

.day .info.hours.modern .txt .mline.emph {
  color: var(--badge-accent-ink);
  font-weight: 960;
}

.day .info.hours.modern .txt .mark {
  font-size: clamp(10px, 2vw, 13px);
  font-weight: 920;
  letter-spacing: 0;
}

.day .info.hours.modern .txt .mark.badge {
  padding: 1px 4px 2px;
  border-radius: 4px;
  color: var(--badge-mark-ink);
  background: var(--badge-mark-bg);
  border: 1px solid var(--badge-mark-border);
}

.day .info.hours.modern.marked {
  gap: 6px;
}

.day .info.hours.modern.marked .txt {
  margin-bottom: 0;
}

.day .info.private-info {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 2px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  color: var(--badge-ink);
}

.day .info.private-info .lock {
  font-size: clamp(20px, 3.2vw, 26px);
  line-height: 1;
  cursor: pointer;
}

.day .info.private-info .ptitle {
  max-width: calc(100% - 4px);
  font-size: clamp(10px, 2vw, 13px);
  font-weight: 930;
  line-height: 1.08;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day .info.private-info .ptime {
  font-size: clamp(10px, 1.9vw, 12px);
  font-weight: 880;
  line-height: 1.05;
  opacity: 0.9;
}

/* mobilon szorosabb rács, hogy mindig kiférjen a 7 oszlop */
@media (max-width: 430px) {
  :root { --header-h: 54px; }
  .dow { padding: 2px 4px 4px; gap: 3px; }
  .cal { padding: 4px; gap: 3px; }
  .top { padding: 0 6px; gap: 7px; }
  .top strong { font-size: 16px; }
  .top-right { gap: 5px; }
  .top .nav-btn { width: 56px; height: 46px; min-width: 56px; font-size: 29px; }
  .top .theme-btn { width: 42px; height: 46px; min-width: 42px; font-size: 20px; }
  .day { border-radius: 11px; padding: 6px 3px 0; gap: 3px; --info-zone-h: 33px; }
  .day .num { font-size: 23px; padding: 4px 9px; }
  .day .wd { font-size: 11px; }
  .day .info:not(.hours):not(.private-info):not(.info-rest) { font-size: 13px; padding: 4px 8px 5px; max-width: 90%; }
  .day .info.info-rest { font-size: 10px; padding: 3px 5px 4px; max-width: 100%; }
  .day .info.hours.modern { gap: 5px; padding: 0 1px 7px; }
  .day .info.hours.modern .ico { font-size: 20px; }
  .day .info.hours.modern .txt { gap: 1px; padding: 0; max-width: calc(100% - 2px); border-radius: 0; }
  .day .info.hours.modern .txt .hline { font-size: 15px; }
  .day .info.hours.modern .txt .mline { font-size: 11px; }
  .day .info.hours.modern .txt .mark { font-size: 10px; }
  .day .info.hours.modern .txt .mark.badge { padding: 1px 4px 2px; border-radius: 6px; }
  .day .info.private-info { padding: 0 1px 7px; gap: 2px; }
  .day .info.private-info .lock { font-size: 20px; }
  .day .info.private-info .ptitle { font-size: 10px; max-width: calc(100% - 2px); }
  .day .info.private-info .ptime { font-size: 10px; }
}

/* .hours pill már nem kell, mert a .info.hours egy saját "badge" */

/* kijelölés */
.day.selected {
  outline: 2px solid rgba(37, 99, 235, 0.76);
  outline-offset: -2px;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.10), 0 5px 10px rgba(37, 99, 235, 0.08);
}

.day.today.selected {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16), 0 7px 12px rgba(37, 99, 235, 0.10);
}

.day:hover {
  box-shadow: 0 8px 16px rgba(17, 24, 39, 0.08);
}

.day:active {
  transform: translateY(0.5px);
}

/* állapotok */
.day.work {
  background: var(--work-bg);
  --day-num: #9f1239;
  --day-meta: #8c1d2c;
  --badge-ink: #8c1d2c;
  --badge-muted: #9f1239;
  --badge-accent-ink: #7f1d1d;
}

.day.car {
  background: var(--car-bg);
  --day-num: #8a5405;
  --day-meta: #7c4a03;
  --badge-ink: #6b3f00;
  --badge-muted: #7c4a03;
  --badge-accent-ink: #7c2d12;
}

.day.holiday {
  background: var(--holiday-bg);
  --day-num: #14532d;
  --day-meta: #166534;
  --badge-ink: #14532d;
  --badge-muted: #166534;
  --badge-accent-ink: #14532d;
}

.day.private {
  background: #d6f3ef;
  --day-num: #0f766e;
  --day-meta: #0f766e;
  --badge-ink: #115e59;
  --badge-muted: #0f766e;
  --badge-accent-ink: #134e4a;
}

.day.rest {
  background: #ffffff;
  --day-num: #111827;
  --day-meta: #6b7280;
  --badge-ink: #334155;
  --badge-muted: #475569;
  --badge-accent-ink: #0f172a;
  --rest-badge-bg: rgba(255, 255, 255, 0.96);
  --rest-badge-border: rgba(148, 163, 184, 0.34);
  --rest-badge-ink: #475569;
}

:root[data-theme="dark"] .day.work {
  --day-num: #ffe4ee;
  --day-meta: #ffd5e2;
  --badge-ink: #ffe4ee;
  --badge-muted: #ffd5e2;
  --badge-accent-ink: #fef3f7;
}

:root[data-theme="dark"] .day.car {
  --day-num: #fff5d6;
  --day-meta: #ffe8a3;
  --badge-ink: #fff5d6;
  --badge-muted: #ffe8a3;
  --badge-accent-ink: #fff7d6;
}

:root[data-theme="dark"] .day.holiday {
  --day-num: #dcfce7;
  --day-meta: #bbf7d0;
  --badge-ink: #dcfce7;
  --badge-muted: #bbf7d0;
  --badge-accent-ink: #ecfdf5;
}

:root[data-theme="dark"] .day.private {
  background: #114047;
  --day-num: #d1fae5;
  --day-meta: #a7f3d0;
  --badge-ink: #d1fae5;
  --badge-muted: #99f6e4;
  --badge-accent-ink: #e6fffa;
}

:root[data-theme="dark"] .day.rest {
  background: #111b2e;
  --day-num: #e5edf9;
  --day-meta: #a8b9d2;
  --badge-bg: rgba(15, 23, 42, 0.72);
  --badge-border: rgba(148, 163, 184, 0.40);
  --badge-shadow: rgba(0, 0, 0, 0.35);
  --badge-ink: #0f172a;
  --badge-muted: #334155;
  --badge-accent-ink: #0f172a;
  --rest-badge-bg: #f8fbff;
  --rest-badge-border: rgba(15, 23, 42, 0.24);
  --rest-badge-ink: #475569;
}

.day.today {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.20), 0 10px 16px rgba(37, 99, 235, 0.14);
}

.day.today .num {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16), 0 1px 0 rgba(17, 24, 39, 0.05);
}

/* ===== MODAL (1 OSZLOP + NAGY IKONOK) ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 16px 12px calc(var(--nav-h) + var(--nav-lift) + 14px);
}

.modal.show {
  display: flex;
}

.sheet {
  width: min(560px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 24, 39, 0.10);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.22);
  padding: 14px;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease;
}

.modal.show .sheet {
  transform: translateY(0);
  opacity: 1;
}

.sheet::before {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 99px;
  background: rgba(17, 24, 39, 0.18);
  margin: 0 auto 10px;
}

.sheet h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

/* >>> Itt a lényeg: mindig 1 oszlop <<< */
.type-grid {
  display: grid;
  grid-template-columns: 1fr;
  /* 1 elem / sor */
  gap: 12px;
  margin-bottom: 12px;
}

.type-tile {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #fff;
  border-radius: 18px;

  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 14px;

  font-size: 16px;
  /* nagyobb szöveg */
  font-weight: 950;
  color: var(--text-main);

  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
  cursor: pointer;
}

.type-tile span {
  width: 46px;
  /* nagy ikon konténer */
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 22px;
  /* nagy ikon */
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.type-tile:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
}

.type-tile:active {
  transform: translateY(0.5px);
}

/* idő kiválasztó – 2 oszlop (hánytól/hányig) + egyetlen "Csak jelölés" */
.time-box {
  display: none;
  width: 100%;
  margin: 10px 0 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.08);
}

.time-box.show { display: block; }

.time-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.time-title {
  font-size: 16px;
  font-weight: 950;
  color: var(--text-main);
}

.btn-ghost {
  height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.16);
  background: rgba(255, 255, 255, 0.96);
  font-weight: 900;
  color: var(--text-main);
  cursor: pointer;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tlabel {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 950;
  color: var(--text-muted);
}

.time-box input[type="time"] {
  height: 52px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #fff;
  font-size: 18px;
  font-weight: 950;
  width: 100%;
}

.private-box {
  display: none;
  width: 100%;
  margin: 10px 0 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.08);
  min-width: 0;
  overflow: hidden;
}

.private-box.show {
  display: block;
}

.private-box .tlabel {
  min-width: 0;
}

.private-box input[type="text"],
.private-box input[type="time"],
.private-box textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #fff;
  color: var(--text-main);
  border-radius: 16px;
  font-size: 17px;
  font-weight: 850;
  padding: 10px 12px;
  outline: none;
}

.private-box input[type="time"] {
  appearance: none;
  -webkit-appearance: none;
  font-variant-numeric: tabular-nums;
  padding-right: 12px;
}

.private-box input[type="time"]::-webkit-datetime-edit,
.private-box input[type="time"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

.private-box input[type="time"]::-webkit-calendar-picker-indicator {
  margin-left: 4px;
}

.private-box textarea {
  min-height: 88px;
  resize: vertical;
}

.private-box input[type="text"]:focus,
.private-box input[type="time"]:focus,
.private-box textarea:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.btn-save {
  width: 100%;
  height: 52px;
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.06);
  color: var(--text-main);
  font-weight: 950;
  cursor: pointer;
}

.btn-save:active { transform: translateY(0.5px); }

.btn-danger {
  display: none;
  width: 100%;
  height: 46px;
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.btn-danger.show {
  display: block;
}

.btn-danger:active {
  transform: translateY(0.5px);
}

@media (max-width: 430px) {
  .time-grid { grid-template-columns: 1fr 1fr; }
  .private-box textarea { min-height: 82px; }
}

.cancel {
  width: 100%;
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.90);
  font-weight: 950;
  cursor: pointer;
}

/* ===== STATS ===== */
.stats {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "summary summary"
    "vacation sidejob"
    "balance balance";
  gap: 10px;
}

.stats .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.90));
  border: 1px solid rgba(17, 24, 39, 0.10);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
  padding: 12px 12px 11px;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}

.stats .card .kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stats .card .meta {
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  color: var(--text-muted);
  word-break: break-word;
}

.stats .card strong {
  display: block;
  font-size: clamp(20px, 3.8vw, 30px);
  font-weight: 950;
  letter-spacing: 0.1px;
  line-height: 1.05;
  word-break: break-word;
}

.stats .card.summary {
  grid-area: summary;
  border-color: rgba(37, 99, 235, 0.24);
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.16), rgba(37, 99, 235, 0.05) 58%, rgba(255, 255, 255, 0.98));
}

.stats .card.summary strong {
  font-size: clamp(23px, 5vw, 36px);
}

.stats .card.vacation { grid-area: vacation; }
.stats .card.sidejob { grid-area: sidejob; }
.stats .card.balance { grid-area: balance; }

.stats .card.sidejob strong,
.stats .card.balance strong {
  font-size: clamp(19px, 3.3vw, 28px);
}

.stats .meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.10);
  overflow: hidden;
}

.stats .meter > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
}

@media (max-width: 430px) {
  .stats { padding: 10px; gap: 8px; }
  .stats .card { border-radius: 16px; padding: 10px; }
  .stats .card strong { font-size: 22px; }
  .stats .card.summary strong { font-size: 25px; }
  .stats .card .meta { font-size: 12px; }
}

@media (min-width: 760px) {
  .stats {
    padding: 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "summary summary vacation sidejob"
      "summary summary balance balance";
    gap: 14px;
  }

  .stats .card { padding: 14px; gap: 8px; }
}

/* ===== SETTINGS ===== */
.settings {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.settings-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.90));
  border: 1px solid rgba(17, 24, 39, 0.10);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
  padding: 14px 12px;
  color: var(--text-main);
  overflow: hidden;
}

.settings-main {
  border-color: rgba(37, 99, 235, 0.24);
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.10), rgba(37, 99, 235, 0.04) 58%, rgba(255, 255, 255, 0.98));
}

.settings .kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-head {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.settings-head h2 {
  margin: 0;
  font-size: clamp(22px, 4.8vw, 30px);
  line-height: 1.04;
  font-weight: 950;
}

.settings-head p {
  margin: 0;
  font-size: 13px;
  font-weight: 760;
  color: var(--text-muted);
  line-height: 1.25;
}

.settings-alert {
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid rgba(22, 163, 74, 0.28);
  background: rgba(220, 252, 231, 0.9);
  color: #14532d;
  font-size: 13px;
  font-weight: 860;
  padding: 8px 10px;
}

.settings-form {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.settings-form label {
  font-size: 13px;
  font-weight: 860;
  color: var(--text-main);
}

.settings-form input[type="date"],
.settings-form input[type="number"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-main);
  font-size: 19px;
  font-weight: 880;
  padding: 0 12px;
  outline: none;
}

.settings-form input[type="date"] {
  font-size: clamp(16px, 4.6vw, 18px);
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 44px;
}

.settings-form input[type="date"]::-webkit-datetime-edit {
  white-space: nowrap;
  padding: 0;
}

.settings-form input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

.settings-form input[type="date"]::-webkit-calendar-picker-indicator {
  margin-left: 6px;
}

.settings-form input[type="date"]:focus,
.settings-form input[type="number"]:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.settings-form .hint {
  margin-top: -2px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.24;
  font-weight: 760;
}

.settings-form .input-wrap {
  position: relative;
  min-width: 0;
}

.settings-form .input-wrap input[type="number"] {
  padding-right: 62px;
}

.settings-form .input-wrap span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 860;
  color: var(--text-muted);
  pointer-events: none;
}

.settings-save {
  margin-top: 6px;
  appearance: none;
  border: 0;
  border-radius: 14px;
  height: 50px;
  background: linear-gradient(120deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.28);
  cursor: pointer;
}

.settings-save:active {
  transform: translateY(0.5px);
}

.settings-side {
  display: grid;
  gap: 10px;
}

.settings-side .row {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  padding: 10px 10px 9px;
  background: rgba(255, 255, 255, 0.76);
}

.settings-side .row span {
  font-size: 11px;
  font-weight: 820;
  color: var(--text-muted);
}

.settings-side .row strong {
  font-size: 18px;
  font-weight: 920;
  line-height: 1.1;
}

@media (max-width: 430px) {
  .settings { padding: 10px; gap: 8px; }
  .settings-card { border-radius: 16px; padding: 12px 10px; }
  .settings-form input[type="date"],
  .settings-form input[type="number"] { height: 46px; font-size: 18px; }
  .settings-form input[type="date"] { font-size: 16px; }
  .settings-save { height: 48px; font-size: 17px; }
}

@media (min-width: 760px) {
  .settings {
    padding: 18px;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
    gap: 14px;
  }
}

/* ===== TOAST ===== */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--nav-gap) + var(--nav-lift) + env(safe-area-inset-bottom) + 10px);
  transform: translateX(-50%) translateY(10px);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  max-width: min(92vw, 420px);
  text-align: center;
  z-index: 9999;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#toast.err {
  background: rgba(185, 28, 28, 0.92);
}

/* ===== BOTTOM NAV (KOMPAKT) ===== */
.bottom {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom) + var(--nav-gap) + var(--nav-lift));
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 4px 10px;
  z-index: 8000;
}

.bottom a {
  flex: 1 1 0;
  font-size: 23px;
  line-height: 1;
  text-decoration: none;
  color: var(--text-main);
  width: auto;
  height: calc(var(--nav-h) - 10px);
  min-height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.bottom a:active {
  background: rgba(37, 99, 235, 0.08);
}

:root[data-theme="dark"] .day.pad {
  border-color: rgba(148, 163, 184, 0.32);
}

:root[data-theme="dark"] .day .num {
  background: rgba(12, 22, 38, 0.74);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.50);
}

:root[data-theme="dark"] .sheet,
:root[data-theme="dark"] .time-box,
:root[data-theme="dark"] .private-box,
:root[data-theme="dark"] .type-tile,
:root[data-theme="dark"] .btn-ghost,
:root[data-theme="dark"] .cancel,
:root[data-theme="dark"] .stats .card {
  background: #101a2b;
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text-main);
}

:root[data-theme="dark"] .type-tile span {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.34);
}

:root[data-theme="dark"] .time-box input[type="time"] {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.34);
  color: var(--text-main);
}

:root[data-theme="dark"] .private-box input[type="text"],
:root[data-theme="dark"] .private-box input[type="time"],
:root[data-theme="dark"] .private-box textarea {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.34);
  color: var(--text-main);
}

:root[data-theme="dark"] .btn-danger {
  border-color: rgba(248, 113, 113, 0.46);
  background: rgba(185, 28, 28, 0.24);
  color: #fecaca;
}

:root[data-theme="dark"] .stats .card.summary {
  background: linear-gradient(145deg, rgba(96, 165, 250, 0.24), rgba(96, 165, 250, 0.08) 58%, rgba(15, 23, 42, 0.95));
}

:root[data-theme="dark"] .settings-card {
  background: #101a2b;
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text-main);
}

:root[data-theme="dark"] .settings-main {
  background: linear-gradient(145deg, rgba(96, 165, 250, 0.22), rgba(96, 165, 250, 0.08) 58%, rgba(16, 26, 43, 0.98));
}

:root[data-theme="dark"] .settings-alert {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(110, 231, 183, 0.36);
  color: #bbf7d0;
}

:root[data-theme="dark"] .settings-form input[type="date"],
:root[data-theme="dark"] .settings-form input[type="number"] {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.34);
  color: var(--text-main);
}

:root[data-theme="dark"] .settings-side .row {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(11, 18, 32, 0.56);
}

:root[data-theme="dark"] .bottom {
  background: rgba(16, 24, 39, 0.90);
  border-color: rgba(148, 163, 184, 0.26);
}

:root[data-theme="dark"] .bottom a {
  color: #e5edf9;
}

:root[data-theme="dark"] #toast {
  background: rgba(15, 23, 42, 0.92);
}

/* EXTRA KICSI TELEFON */
@media (max-width: 390px) {
  :root {
    --nav-h: 54px;
    --nav-gap: 6px;
    --nav-lift: 10px;
    --header-h: 52px;
  }

  .cal {
    padding: 5px;
    gap: 3px;
  }

  .dow {
    padding: 2px 5px 3px;
    gap: 3px;
  }

  .day {
    border-radius: 11px;
    padding: 6px 3px 0;
    gap: 3px;
    --info-zone-h: 32px;
  }

  .day .num {
    font-size: 22px;
    padding: 4px 8px;
  }

  .day .wd {
    font-size: 11px;
  }

  .day .info.hours.modern { padding: 0 1px; gap: 3px; }

  .day .info:not(.hours):not(.private-info):not(.info-rest) {
    font-size: 12px;
    padding: 4px 7px 5px;
    max-width: 88%;
  }
  .day .info.info-rest {
    font-size: 10px;
    padding: 3px 5px 4px;
    max-width: 100%;
  }

  .day .info.hours.modern .ico {
    font-size: 19px;
    width: 2em;
    height: 2em;
  }

  .day .info.hours.modern .txt {
    padding: 0;
    max-width: calc(100% - 2px);
    border-radius: 0;
  }

  .day .info.hours.modern .txt .hline {
    font-size: 14px;
    padding: 0;
  }

  .day .info.hours.modern .txt .mline {
    font-size: 10px;
    padding: 0;
  }

  .day .info.hours.modern .txt .mark {
    font-size: 9px;
    padding: 0;
  }

  .day .info.private-info { padding: 0 1px 6px; gap: 2px; }
  .day .info.private-info .lock { font-size: 18px; }
  .day .info.private-info .ptitle { font-size: 9px; max-width: calc(100% - 1px); }
  .day .info.private-info .ptime { font-size: 9px; }

  .top strong {
    font-size: 15px;
  }

  .top-right { gap: 5px; }
  .top .nav-btn { width: 56px; height: 46px; min-width: 56px; font-size: 29px; }
  .top .theme-btn { width: 42px; height: 46px; min-width: 42px; font-size: 20px; }

  /* modal is maradjon “nagy”, de ne legyen túl magas */
  .type-tile {
    font-size: 15px;
    padding: 12px 12px;
  }

  .type-tile span {
    width: 44px;
    height: 44px;
    font-size: 21px;
  }
}
