:root {
  /* Jimmy's Kebab márkaszínek (az utalvány dizájnja alapján: sötét tengerészkék + fehér) */
  --primary: #16213e;
  --primary-dark: #0c1424;
  --navy-light: #24314f;
  --green: #1e8449;
  --amber: #b9770e;
  --red: #c0392b;
  --blue: #2464a8;
  --bg: #f5f6f9;
  --card-bg: #ffffff;
  --border: #e0e2ea;
  --text: #1c2333;
  --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

a { color: var(--primary); }

/* --- Bal oldali menüsáv (sidebar) --- */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  flex-shrink: 0;
  padding: 0 8px;
}
.brand span { font-weight: 500; font-size: 0.68rem; text-transform: none; opacity: 0.6; letter-spacing: 0.01em; }
.brand.brand-topbar { color: var(--primary); padding: 0; }

.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
}
.sidenav a:hover { background: #eef0f5; }
.sidenav a.active { background: var(--primary); color: white; }

/* --- Fő tartalmi oszlop (topbar + content + footer) --- */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar-spacer { flex: 1; }

/* --- Hamburger menu + felhasznaloi legorduló --- */
.user-menu-wrap { position: relative; flex-shrink: 0; }
.menu-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
}
.menu-toggle:hover { background: #eef0f5; }
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--primary); border-radius: 2px; }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(12, 20, 36, 0.2);
  min-width: 190px;
  padding: 14px;
  z-index: 50;
  color: var(--text);
}
.user-dropdown.open { display: block; }
.user-dropdown-name { font-weight: 700; }
.user-dropdown-role { color: var(--muted); font-size: 0.8rem; margin-bottom: 12px; }
.user-dropdown .logout-link {
  display: block;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--red);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}
.user-dropdown .logout-link:hover { background: #a4321f; }

.content {
  max-width: 1200px;
  width: 100%;
  padding: 28px 24px 60px;
}

@media (max-width: 860px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
  }
  .sidenav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 20px 16px 40px; }
}

h1 { margin-top: 0; }
.section-title { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.auth-box {
  max-width: 400px;
  margin: 40px auto;
  background: var(--card-bg);
  padding: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; max-width: none; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 600; }
.form input, .form select {
  font-size: 1rem;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
}
.inline-input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; margin-right: 6px; }

/* --- CSV drag & drop feltoltozona (dolgozok tomeges felvitele) --- */
.csv-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.csv-dropzone:hover { border-color: var(--primary); background: #f2f4f8; }
.csv-dropzone.drag-over { border-color: var(--primary); background: #eef0f5; }
.csv-dropzone-text { margin: 0; color: var(--text); font-size: 0.95rem; }
.csv-dropzone-link { color: var(--primary); text-decoration: underline; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #e8eaf0; color: var(--text); }
.btn-danger { background: var(--red); color: white; }
.btn-small { padding: 6px 10px; font-size: 0.82rem; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; }
.alert-error { background: #fdecea; color: #922b21; border: 1px solid #f5c6cb; }
.alert-success { background: #eafaf1; color: #1e8449; border: 1px solid #b7e4c7; }
.alert-warning { background: #fef5e7; color: #9c640c; border: 1px solid #f5cb85; }

.link-box { background: #eef0f5; padding: 10px 14px; border-radius: 6px; word-break: break-all; margin: 10px 0; }

.link-copy-row { display: flex; gap: 10px; max-width: 640px; margin: 16px 0 4px; }
.link-field {
  flex: 1;
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #eef0f5;
  font-family: monospace;
}

.stat-cards { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 24px;
  min-width: 160px;
}
.stat-num { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--muted); font-size: 0.9rem; }

.quota-bar-wrap { max-width: 420px; margin: -6px 0 22px; }
.quota-bar { background: #e8eaf0; border-radius: 999px; height: 10px; overflow: hidden; }
.quota-bar-fill { background: var(--primary); height: 100%; border-radius: 999px; transition: width 0.2s ease; }

.date-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.date-list li {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: 8px; overflow: hidden; table-layout: auto; }
.table th, .table td { text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 0.92rem; vertical-align: middle; }
.table th { background: #eef0f5; font-weight: 700; }
.table th:first-child, .table td:first-child { width: 32px; text-align: center; padding-left: 16px; padding-right: 16px; }

/* --- Dolgozok tablazat: tagabb oszlopok, hogy ne csusszon ossze --- */
.dolgozok-table th:nth-child(2), .dolgozok-table td:nth-child(2) { min-width: 130px; }
.dolgozok-table th:nth-child(3), .dolgozok-table td:nth-child(3) { min-width: 200px; }
.dolgozok-table th:nth-child(6), .dolgozok-table td:nth-child(6) { min-width: 210px; }
.dolgozok-table th:nth-child(9), .dolgozok-table td:nth-child(9) { min-width: 260px; }

/* --- Kompakt, de szellos tipus/nyelv checkbox sor (dolgozok tablazat) --- */
.checkbox-inline-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-bottom: 8px; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.checkbox-inline label { font-size: 0.85rem; font-weight: 400; }
.types-form { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; row-gap: 10px; }
.types-form button { flex-shrink: 0; margin-left: 4px; }

/* --- Egy sorban egymas mellett megjeleno akcio-gombok/formok --- */
.actions-cell { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }

.badge { padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; display: inline-block; }
.badge-approved { background: #eafaf1; color: var(--green); }
.badge-rejected { background: #fdecea; color: var(--red); }
.badge-pending { background: #fef5e7; color: var(--amber); }
.badge-off { background: #e8f1fa; color: var(--blue); }
.badge-vacation { background: #fdecea; color: var(--red); }
.tag { color: var(--amber); font-size: 0.8rem; }

.footer { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 30px 0; }

/* --- Heti beosztas tablazat --- */
.schedule-table th, .schedule-table td { text-align: center; white-space: nowrap; }
.schedule-table td:first-child, .schedule-table th:first-child { text-align: left; white-space: normal; }

/* A "Dolgozó" (elso) es a "Cél / Ütemezve" (utolso) oszlop rogzitve marad
   vizszintes gorgetesnel is, hogy szeles (sok napos/uzletes) tablazatnal se
   csusszon ki a kepernyorol a legfontosabb informacio. */
.schedule-table td:first-child, .schedule-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card-bg);
  box-shadow: 2px 0 4px rgba(12, 20, 36, 0.06);
}
.schedule-table thead th:first-child { background: #eef0f5; z-index: 3; }

/* Csak azoknal a tablazatoknal rogzitjuk az utolso ("Cél / Ütemezve")
   oszlopot is, ahol tenyleg van ilyen (a Heti beosztás oldal fo tablaja) -
   a rovidebb (pl. Kezdolap-widget) tablaknal az utolso oszlop csak egy
   sima nap lenne, azt nem szeretnenk odaragasztani. */
.schedule-table-summary-col td:last-child, .schedule-table-summary-col th:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--card-bg);
  box-shadow: -2px 0 4px rgba(12, 20, 36, 0.06);
}
.schedule-table-summary-col thead th:last-child { background: #eef0f5; z-index: 3; }
.sched-select {
  font-size: 0.85rem;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: inherit;
}
.sched-select.sched-work { background: #eafaf1; color: var(--green); border-color: #b7e4c7; }
.sched-select.sched-off { background: #fdecea; color: var(--red); border-color: #f5c6cb; }
.sched-source-tag {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  cursor: help;
}
.sched-mismatch { color: var(--red); font-weight: 700; }

/* --- Uzletek/munkakorok szerinti attekinto beosztas tablazat --- */
.store-schedule-table th, .store-schedule-table td {
  text-align: center;
  vertical-align: middle;
  padding: 8px 10px;
}
.store-schedule-table th:first-child,
.store-schedule-table th:nth-child(2),
.store-schedule-table td.store-label,
.store-schedule-table td.type-label {
  text-align: left;
  white-space: nowrap;
}
.store-schedule-table td.store-label {
  font-weight: 700;
  background: #f6f7fb;
  border-right: 1px solid var(--border);
}
.store-schedule-table td.type-label {
  color: var(--muted);
  font-weight: 600;
  border-right: 1px solid var(--border);
}
.store-schedule-table td { min-width: 90px; }
/* Az uzletek egymastol jobban elkulonuljenek - minden uj uzlet-csoport
   elso sora egy hatarozottabb, sotetebb felso vonalat kap. */
.store-schedule-table tr.store-group-start td {
  border-top: 3px solid var(--primary-dark, #33415c);
}
.store-schedule-table tbody tr:first-child td {
  border-top: none;
}
.emp-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

/* --- Nezet-valto fulek (Sajat / Uzletenkent / Dolgozonkent) a kezdolapokon --- */
.view-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0 16px;
  border-bottom: 1px solid var(--border);
}
.view-tab {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px 999px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
}
.view-tab:hover { color: var(--primary); background: #f2f3f7; }
.view-tab.active { color: var(--primary); background: #eef0f5; box-shadow: inset 0 -3px 0 var(--primary); }

/* --- Calendar widget --- */
.calendar-request-wrap { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.calendar-form { min-width: 260px; }
#calendar-widget { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; width: 320px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-header button { background: none; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; padding: 4px 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: 0.75rem; color: var(--muted); font-weight: 700; padding-bottom: 4px; }
.cal-day { padding: 8px 0; border-radius: 6px; font-size: 0.85rem; cursor: default; color: #b8bcc8; }
.cal-day.empty { visibility: hidden; }
.cal-day.past { color: #c5c9d4; }
.cal-day.occupied { background: #dfe2ea; color: #767b8a; text-decoration: line-through; cursor: not-allowed; }
.cal-day.selectable { color: white; cursor: pointer; background: var(--green); user-select: none; }
.cal-day.selectable:hover { background: #166b3a; }
.cal-day.selected.type-off { background: var(--blue); color: white; font-weight: 700; }
.cal-day.selected.type-vacation { background: var(--red); color: white; font-weight: 700; }
.cal-day.drag-preview { background: #f3c9c2; color: var(--primary-dark); }
.cal-day.other-busy { box-shadow: inset 0 0 0 3px #e08e0b; }
.cal-day.occupied.other-busy { box-shadow: inset 0 0 0 3px #b9720a; }
.cal-day.selected.other-busy { box-shadow: inset 0 0 0 3px #7a4c00; }
.range-preview { font-size: 0.9rem; color: var(--muted); min-height: 20px; line-height: 1.6; }
.calendar-form #clearSelectionBtn { align-self: flex-start; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 18px; font-size: 0.85rem; color: var(--muted); }
.cal-legend-item { display: flex; align-items: center; gap: 6px; }
.cal-legend-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.cal-legend-swatch.legend-green { background: var(--green); }
.cal-legend-swatch.legend-blue { background: var(--blue); }
.cal-legend-swatch.legend-red { background: var(--red); }
.cal-legend-swatch.legend-grey { background: #dfe2ea; }
.cal-legend-swatch.legend-amber { background: var(--green); box-shadow: inset 0 0 0 3px #e08e0b; }

.cal-alert-box {
  position: relative;
  border: 3px solid var(--red);
  background: #fdecea;
  color: #922b21;
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 4px;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.5;
}
.cal-alert-badge {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 26px;
  height: 26px;
  background: var(--red);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  animation: cal-alert-pulse 1.4s infinite;
}
@keyframes cal-alert-pulse {
  0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.65); }
  70% { box-shadow: 0 0 0 12px rgba(192, 57, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

.cal-warn-box {
  position: relative;
  border: 2px solid #e08e0b;
  background: #fdf3e2;
  color: #7a4c00;
  border-radius: 10px;
  padding: 12px 16px 12px 34px;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.5;
}
.cal-warn-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 15px;
}
