:root{
  --bg:#f4f6f9;
  --card:#ffffff;
  --text:#172033;
  --muted:#6b7280;
  --border:#d9e1ec;
  --primary:#2563eb;
  --danger:#dc2626;
  --ok:#16a34a;
  --warn:#d97706;
  --blue:#0284c7;
  --purple:#7c3aed;
  --shadow:0 14px 34px rgba(15,23,42,.08);
  --radius:16px;
}

*{box-sizing:border-box}

body{
  margin:0;
  background:linear-gradient(180deg,#eef4fb,#f8fafc 340px);
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color:var(--text);
}

a{color:var(--primary);text-decoration:none}

.topbar{
  min-height:64px;
  padding:0 22px;
  background:rgba(255,255,255,.9);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  position:sticky;
  top:0;
  z-index:30;
}

.brand{
  font-weight:760;
  font-size:21px;
  color:var(--text);
  letter-spacing:-.04em;
}

.mobile-menu-toggle{
  display:none;
}

.main-nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex:1;
}

.nav-link,
.nav-trigger{
  background:transparent;
  color:#334155;
  font-weight:520;
  border:0;
  padding:9px 11px;
  min-height:auto;
  border-radius:10px;
  cursor:pointer;
}

.nav-trigger::after{
  content:"▾";
  font-size:11px;
  margin-left:7px;
  color:#64748b;
}

.nav-group{
  position:relative;
}

.nav-dropdown{
  display:none;
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  min-width:210px;
  padding:8px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  box-shadow:var(--shadow);
  z-index:40;
}

.nav-group.open .nav-dropdown,
.nav-group:hover .nav-dropdown{
  display:block;
}

.nav-dropdown a{
  display:block;
  padding:10px 11px;
  border-radius:10px;
  color:#334155;
  font-weight:480;
}

.nav-dropdown a:hover,
.nav-link:hover,
.nav-trigger:hover{
  background:#f1f5f9;
}

.nav-user{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:8px;
  padding-left:12px;
  border-left:1px solid var(--border);
  color:#64748b;
  font-size:14px;
}

.nav-user span{
  max-width:180px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.container{
  max-width:1220px;
  margin:26px auto;
  padding:0 16px;
}

.footer{
  text-align:center;
  color:var(--muted);
  padding:28px;
}

.card,
.hero-card,
.context-bar{
  background:rgba(255,255,255,.94);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px;
  margin-bottom:18px;
}

.context-bar{
  position:sticky;
  top:64px;
  z-index:20;
  padding:12px 16px;
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(12px);
}

.context-bar strong{
  display:inline-block;
  margin:0 10px 0 4px;
  font-size:16px;
}

.context-label,
.context-bar small{
  color:var(--muted);
  font-size:13px;
}

.hero-main{
  display:flex;
  gap:18px;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
}

.eyebrow{
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.1em;
  font-weight:520;
  margin-bottom:5px;
}

h1,h2{
  margin:0 0 13px;
  letter-spacing:-.04em;
}

h1{
  font-size:34px;
  line-height:1.05;
  font-weight:760;
}

h2{
  font-size:23px;
  font-weight:690;
}

.hero-card p,
.muted{
  margin:0;
  color:var(--muted);
  font-weight:400;
}

.btn,
button{
  border:0;
  border-radius:11px;
  background:var(--primary);
  color:white;
  font-weight:620;
  padding:10px 14px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition:.15s;
  min-height:40px;
}

button:hover,
.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 9px 18px rgba(37,99,235,.16);
}

button:disabled,
.btn:disabled{
  opacity:.5;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

.btn.secondary,
button.secondary{
  background:#e8eef6;
  color:#0f172a;
}

.btn.danger,
button.danger{
  background:var(--danger);
}

.soft-danger{
  background:#fee2e2 !important;
  color:#991b1b !important;
}

.fill-btn{
  background:#dcfce7;
  color:#166534;
}

input,
select{
  border:1px solid var(--border);
  border-radius:11px;
  padding:10px 12px;
  background:#fff;
  font:inherit;
}

label{
  font-weight:500;
  display:block;
  margin:12px 0 6px;
}

.login-wrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:16px;
}

.login-card{
  width:min(420px,100%);
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:28px;
}

.login-card input,
.login-card button{
  width:100%;
}

.alert{
  padding:11px 13px;
  border-radius:12px;
  margin:12px 0;
  background:#fee2e2;
  color:#991b1b;
  font-weight:560;
}

.notice{
  padding:11px 13px;
  border-radius:12px;
  margin:12px 0;
  background:#eff6ff;
  color:#1e40af;
  font-weight:560;
}

.compact{margin:0}

.toolbar,
.bulk-actions,
.report-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.bulk-actions{
  margin-top:18px;
  padding:12px;
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:14px;
}

.legend{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  margin:18px 0 0;
}

.pill{
  border:1px solid var(--border);
  background:#fff;
  border-radius:999px;
  padding:7px 11px;
  font-weight:400;
  color:#4b5563;
}

.pill b{
  color:#111827;
  font-weight:650;
  margin-right:5px;
}

.summary{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  margin-top:13px;
}

.stat{
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  padding:9px 13px;
  min-width:68px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:13px;
}

.stat small{
  color:var(--muted);
  font-weight:560;
}

.stat strong{
  font-size:19px;
  line-height:1;
  font-weight:760;
}

.calendar-card{padding:16px}

.calendar{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:12px;
}

.day{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:13px;
  border:1px solid var(--border);
  border-radius:17px;
  background:#fff;
  padding:13px;
  transition:.18s;
  min-height:190px;
  overflow:hidden;
}

.day.weekend{
  background:#e5e7eb !important;
  border-color:#cbd5e1;
  color:#475569;
}

.day.holiday{
  outline:2px dashed rgba(220,38,38,.18);
  outline-offset:-5px;
}

.day.locked{opacity:.72}

.day.saved{
  transform:scale(1.02);
  box-shadow:0 14px 28px rgba(37,99,235,.16);
}

.day-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.date-num{
  font-size:24px;
  font-weight:720;
  line-height:1;
  letter-spacing:-.05em;
}

.wd{
  color:var(--muted);
  font-weight:400;
  margin-top:5px;
}

.holiday-name{
  font-size:11px;
  color:#991b1b;
  margin-top:7px;
  line-height:1.2;
}

.status-wrap{
  display:grid;
  gap:6px;
  justify-items:end;
}

.status-badge{
  min-width:70px;
  height:66px;
  padding:0 14px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:#f1f5f9;
  color:#1e293b;
  font-size:33px;
  font-weight:800;
  letter-spacing:-.08em;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.82), 0 10px 18px rgba(15,23,42,.06);
}

.meal-icon{
  display:none;
  width:30px;
  height:30px;
  border-radius:10px;
  place-items:center;
  background:#fff;
  border:1px solid var(--border);
  box-shadow:0 5px 10px rgba(15,23,42,.06);
}

.day[data-meal="1"] .meal-icon{
  display:grid;
}

.day[data-status="P"]{background:#ecfdf3;border-color:#b7e4c7}
.day[data-status="D"]{background:#fff7e8;border-color:#f8cf93}
.day[data-status="SC"]{background:#eef8ff;border-color:#a9d8f5}
.day[data-status="ZSC"]{background:#f5f0ff;border-color:#cdbdff}
.day[data-status="N"]{background:#fff1f1;border-color:#f6b4b4}

.day.weekend[data-status]{
  background:#e5e7eb !important;
}

.day[data-status="P"] .status-badge{background:var(--ok);color:white}
.day[data-status="D"] .status-badge{background:var(--warn);color:white}
.day[data-status="SC"] .status-badge{background:var(--blue);color:white;font-size:29px}
.day[data-status="ZSC"] .status-badge{background:var(--purple);color:white;font-size:25px}
.day[data-status="N"] .status-badge{background:var(--danger);color:white}

.day-controls{
  margin-top:auto;
  padding-top:10px;
  border-top:1px solid rgba(148,163,184,.28);
}

.choices{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:7px;
}

.choice{
  padding:8px 0;
  border:1px solid rgba(203,213,225,.92);
  color:#111827;
  border-radius:10px;
  font-weight:650;
  min-width:0;
  justify-content:center;
  min-height:40px;
  box-shadow:none;
}

.choice:hover{
  transform:none;
  box-shadow:none;
  filter:brightness(.98);
}

.choice-p{background:#dcfce7;color:#166534}
.choice-d{background:#ffedd5;color:#9a3412}
.choice-sc{background:#e0f2fe;color:#075985}
.choice-zsc{background:#ede9fe;color:#5b21b6}
.choice-n{background:#fee2e2;color:#991b1b}
.clear-choice{background:#f1f5f9;color:#64748b;font-size:20px}
.clear-choice:hover{background:#fee2e2;color:#991b1b}

.meal-toggle{
  display:none;
  align-items:center;
  gap:7px;
  margin:9px 0 0;
  color:#334155;
  font-size:13px;
  font-weight:500;
}

.day[data-status="SC"] .meal-toggle,
.day[data-status="ZSC"] .meal-toggle{
  display:flex;
}

.meal-toggle input{
  width:16px;
  height:16px;
}

table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border-radius:14px;
  overflow:hidden;
}

th,td{
  padding:11px;
  border-bottom:1px solid var(--border);
  text-align:left;
}

th{
  background:#f8fafc;
  font-weight:520;
}

.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.grid2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.report-filter{
  display:grid;
  grid-template-columns:repeat(2,minmax(180px,240px)) 1fr;
  gap:16px;
  align-items:end;
}

.user-pick{
  grid-column:1 / -1;
}

.check-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(210px,1fr));
  gap:8px;
  max-height:260px;
  overflow:auto;
  padding:8px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
}

.check-card{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  padding:8px;
  border-radius:10px;
  background:#f8fafc;
}

@media(max-width:1050px){
  .calendar{grid-template-columns:repeat(4,1fr)}
}

@media(max-width:780px){
  .mobile-menu-toggle{
    display:inline-flex;
    margin-left:auto;
    background:#e8eef6;
    color:#0f172a;
  }

  .topbar{
    align-items:center;
    flex-wrap:wrap;
  }

  .main-nav{
    display:none;
    width:100%;
    flex-direction:column;
    align-items:stretch;
    padding:8px 0 4px;
  }

  .main-nav.open{
    display:flex;
  }

  .nav-group,
  .nav-user{
    width:100%;
  }

  .nav-trigger,
  .nav-link{
    width:100%;
    justify-content:space-between;
    text-align:left;
    display:flex;
  }

  .nav-dropdown{
    position:static;
    display:none;
    min-width:0;
    box-shadow:none;
    margin:4px 0 8px;
    background:#f8fafc;
  }

  .nav-group.open .nav-dropdown{
    display:block;
  }

  .nav-group:hover .nav-dropdown{
    display:none;
  }

  .nav-group.open:hover .nav-dropdown{
    display:block;
  }

  .nav-user{
    border-left:0;
    border-top:1px solid var(--border);
    padding:10px 0 0;
    margin:6px 0 0;
    justify-content:space-between;
  }

  .context-bar{
    top:64px;
  }

  .calendar{grid-template-columns:repeat(2,1fr)}
  .hero-main{display:block}
  .toolbar{margin-top:16px}
  .toolbar input{flex:1;min-width:150px}
  .grid2{grid-template-columns:1fr}
  .report-filter{grid-template-columns:1fr}
}

@media(max-width:560px){
  .container{margin:16px auto;padding:0 10px}
  .hero-card,.card,.context-bar{padding:15px;border-radius:14px}
  .calendar-card{padding:10px}
  .calendar{grid-template-columns:1fr;gap:10px}
  .day{min-height:152px;border-radius:14px;padding:12px}
  .day-top{align-items:center}
  .status-badge{min-width:78px;height:58px;border-radius:14px;font-size:32px}
  .day[data-status="SC"] .status-badge{font-size:28px}
  .day[data-status="ZSC"] .status-badge{font-size:25px}
  .choice{min-height:42px;border-radius:9px}
  h1{font-size:30px}
  .bulk-actions,.toolbar{width:100%}
  .bulk-actions > button,.toolbar button{flex:1}
  .fill-btn,.soft-danger{width:100%}
}


/* v4 layout: kalendář vždy začíná pondělím a prázdná místa nejsou karty dnů */
.calendar-weekdays{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:12px;
  margin-bottom:8px;
  color:#64748b;
  font-size:12px;
  font-weight:650;
  text-align:center;
}

.day-placeholder{min-height:1px;}

/* v4: OČR a 3 řádky ovládání */
.choices{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:7px;
}

.choice-ocr{background:#fce7f3;color:#9d174d;}
.day[data-status="OCR"]{background:#fdf2f8;border-color:#f9a8d4;}
.day[data-status="OCR"] .status-badge{background:#db2777;color:white;font-size:24px;}

.clear-choice{grid-column:1;grid-row:3;}
.meal-choice{
  grid-column:2 / 4;
  grid-row:3;
  background:#fff7ed;
  color:#9a3412;
  border:1px solid #fed7aa;
  border-radius:10px;
  min-height:40px;
  box-shadow:none;
  font-weight:650;
}
.meal-choice:hover{transform:none;box-shadow:none;filter:brightness(.98);}
.day[data-meal="1"] .meal-choice{background:#ea580c;color:#fff;border-color:#ea580c;}
.day:not([data-status="P"]):not([data-status="SC"]):not([data-status="ZSC"]) .meal-choice{opacity:.55;}

.context-user-nav{
  display:grid;
  grid-template-columns:44px 1fr 44px;
  align-items:center;
  gap:10px;
}
.context-user-main{min-width:0;text-align:center;}
.context-user-main strong{display:block;margin:2px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.context-arrow{
  width:40px;
  height:40px;
  border-radius:11px;
  display:grid;
  place-items:center;
  background:#e8eef6;
  color:#0f172a;
  font-weight:800;
}
.context-arrow.disabled{opacity:.35;}
.missing-dates{display:inline-block;max-width:520px;line-height:1.6;}

@media(max-width:560px){
  .calendar-weekdays{display:none;}
  .day-placeholder{display:none;}
  .meal-choice{min-height:42px;border-radius:9px;}
  .context-bar{padding:10px 12px;}
  .context-user-nav{grid-template-columns:40px 1fr 40px;}
}
