@import url('/shared/assets/fonts.css?v=20260907-fira-v1');
: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;
  --font-ui:"Fira Sans", "Fira Sans", "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-narrow:"Fira Sans Condensed", "Arial Narrow", "IBM Plex Sans Condensed", Arial, sans-serif;
}

*{box-sizing:border-box}

body{
  margin:0;
  background:linear-gradient(180deg,#eef4fb,#f8fafc 340px);
  font-family:var(--font-ui);
  color:var(--text);
}

body,
button,
input,
select,
textarea{
  font-family:var(--font-ui);
}

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

/* ==========================================================
   Horní lišta a navigace
   ========================================================== */

.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-family:var(--font-ui);
  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:"";
  display:inline-block;
  width:0;
  height:0;
  margin-left:8px;
  vertical-align:middle;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:5px solid currentColor;
  opacity:.7;
  transform:translateY(1px);
}

.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;
}

@media (hover:hover) and (pointer:fine){
  .main-nav .nav-group{
    position:relative;
  }

  .main-nav .nav-dropdown{
    top:100%;
    margin-top:0;
    padding-top:8px;
    display:none;
    z-index:9999;
  }

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

  .main-nav .nav-group:hover > .nav-trigger{
    background:#f1f5f9;
  }

  .main-nav .nav-group::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    top:100%;
    height:12px;
    z-index:9998;
  }

  .main-nav .nav-dropdown a{
    position:relative;
    z-index:10000;
  }
}

/* ==========================================================
   Základní layout
   ========================================================== */

.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;
}

.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;
}

.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:600;
  letter-spacing:-.045em;
}

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

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

/* ==========================================================
   Tlačítka a formuláře
   ========================================================== */

.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;
  color:#991b1b;
}

.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;
}

.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;
}

.compact{
  margin:0;
}

/* ==========================================================
   Šipky pro listování
   ========================================================== */

.month-nav{
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  padding:0;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  font-size:18px;
  font-weight:800;
  text-decoration:none;
  box-shadow:0 8px 16px rgba(15,23,42,.08);
  transform:none;
}

.month-nav:hover{
  background:#dbeafe;
  transform:translateY(-1px);
  box-shadow:0 10px 18px rgba(15,23,42,.11);
}

.month-nav.disabled,
.month-nav[aria-disabled="true"]{
  opacity:.35;
  pointer-events:none;
  cursor:default;
}

/* Fallback pro starší šipkové třídy */
.context-arrow,
.month-play,
.nav-play{
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  border-radius:14px;
  background:#e8eef6;
  color:#0f172a;
  display:inline-grid;
  place-items:center;
  font-size:0;
  line-height:1;
  text-decoration:none;
  border:0;
  padding:0;
  box-shadow:0 8px 16px rgba(15,23,42,.08);
  align-self:center;
  margin:0;
}

.context-arrow::before,
.month-play::before,
.nav-play::before{
  content:"";
  display:block;
  width:0;
  height:0;
}

.context-user-nav > .context-arrow:first-child::before,
.context-arrow.prev::before,
.month-play.prev::before,
.nav-play.prev::before{
  border-top:9px solid transparent;
  border-bottom:9px solid transparent;
  border-right:14px solid currentColor;
  border-left:0;
  transform:translateX(-1px);
}

.context-user-nav > .context-arrow:last-child::before,
.context-arrow.next::before,
.month-play.next::before,
.nav-play.next::before{
  border-top:9px solid transparent;
  border-bottom:9px solid transparent;
  border-left:14px solid currentColor;
  border-right:0;
  transform:translateX(1px);
}

.context-arrow:not(.disabled):hover,
.month-play:hover,
.nav-play:hover{
  background:#dbeafe;
  transform:translateY(-1px);
}

.context-arrow.disabled,
.nav-play.disabled{
  opacity:.35;
  pointer-events:none;
  cursor:default;
}

/* ==========================================================
   Zprávy
   ========================================================== */

.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;
}

/* ==========================================================
   Kalendář
   ========================================================== */

.calendar-card{
  padding:16px;
}

.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;
}

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

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

.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;
  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-family:var(--font-ui);
  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-family:var(--font-ui);
  font-size:33px;
  font-weight:600;
  letter-spacing:-.05em;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.82), 0 10px 18px rgba(15,23,42,.06);
}

.day[data-status="P"]{background:#ecfdf3;border-color:#b7e4c7}
.day[data-status="HO"]{background:#f0fdfa;border-color:#99f6e4}
.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[data-status="OCR"]{background:#fdf2f8;border-color:#f9a8d4}

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

.day[data-status="P"] .status-badge{background:var(--ok);color:white}
.day[data-status="HO"] .status-badge{background:#0d9488;color:white;font-size:26px;letter-spacing:-.06em}
.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[data-status="OCR"] .status-badge{background:#db2777;color:white;font-size:24px}

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

/* ==========================================================
   Tlačítka v kartě dne
   ========================================================== */

.choices,
.bottom-choices{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 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-ho{background:#ccfbf1;color:#0f766e}
.choice-d{background:#ffedd5;color:#9a3412}
.choice-sc{background:#e0f2fe;color:#075985}
.choice-zsc{background:#ede9fe;color:#5b21b6}
.choice-n{background:#fee2e2;color:#991b1b}
.choice-ocr{background:#fce7f3;color:#9d174d;grid-column:2;grid-row:3}

.clear-choice{
  grid-column:1;
  grid-row:3;
  background:#f1f5f9;
  color:#64748b;
  font-size:20px;
}

.clear-choice:hover{
  background:#fee2e2;
  color:#991b1b;
}

.meal-choice{
  grid-column:3;
  grid-row:3;
  width:100%;
  min-width:0;
  min-height:40px;
  height:auto;
  padding:8px 0;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#faf6d4;
  color:#808080;
  border:1px solid #d6b800;
  box-shadow:none;
  font-size:13px;
  font-weight:850;
  line-height:1;
  letter-spacing:-.02em;
}

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

.day[data-meal="1"] .meal-choice{
  background:#faf6d4;
  color:#808080;
  border-color:#d6b800;
}

.day:not([data-status="P"]):not([data-status="HO"]):not([data-status="SC"]):not([data-status="ZSC"]) .meal-choice{
  display:none;
}

.meal-icon{
  position:absolute;
  top:13px;
  right:13px;
  display:none;
  width:28px;
  height:28px;
  min-width:28px;
  min-height:28px;
  padding:0;
  border-radius:999px;
  border:1px solid rgba(153,27,27,.22);
  background:#ff0;
  color:#000;
  box-shadow:0 6px 14px rgba(15,23,42,.18);
  font-size:0;
  line-height:1;
  font-weight:800;
  place-items:center;
  z-index:4;
}

.meal-icon::before{
  content:"S";
  font-size:15px;
  line-height:1;
  font-weight:800;
  color:#000;
}

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

/* Starší varianta stravy – ponecháno jako fallback */
.meal-toggle{
  display:none;
  align-items:center;
  gap:7px;
  margin:9px 0 0;
  color:#334155;
  font-size:13px;
  font-weight:500;
}

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

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

/* ==========================================================
   Legenda a statistika
   ========================================================== */

.legend,
.summary{
  display:none;
}

.legend-summary-grid{
  display:grid;
  grid-template-columns:repeat(8, minmax(0, 1fr));
  gap:6px;
  margin-top:16px;
  font-family:var(--font-narrow);
  font-size:12px;
  line-height:1.1;
}

.legend-stat-item{
  display:flex;
  align-items:center;
  gap:5px;
  min-height:30px;
  min-width:0;
  padding:5px 7px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:#334155;
  white-space:nowrap;
  overflow:hidden;
}

.legend-code{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:24px;
  height:20px;
  padding:0 5px;
  border-radius:7px;
  font-size:12px;
  font-weight:850;
  letter-spacing:-.04em;
  background:#f1f5f9;
  color:#0f172a;
}

.legend-title{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:12px;
  font-weight:650;
  letter-spacing:-.035em;
}

.legend-count{
  flex:0 0 auto;
  margin-left:auto;
  color:#64748b;
  font-size:12px;
  font-weight:800;
}

.legend-stat-item.status-p .legend-code{background:#dcfce7;color:#166534}
.legend-stat-item.status-ho .legend-code{background:#ccfbf1;color:#0f766e}
.legend-stat-item.status-d .legend-code{background:#ffedd5;color:#9a3412}
.legend-stat-item.status-sc .legend-code{background:#e0f2fe;color:#075985}
.legend-stat-item.status-zsc .legend-code{background:#ede9fe;color:#5b21b6}
.legend-stat-item.status-n .legend-code{background:#fee2e2;color:#991b1b}
.legend-stat-item.status-ocr .legend-code{background:#fce7f3;color:#9d174d}

.legend-meal-item .legend-code{
  background:#ffe600;
  color:#000;
  border:1px solid #d6b800;
}

.legend-meal-item .legend-title{
  color:#991b1b;
  font-weight:700;
}

.legend-count.bump{
  animation:statBump .28s ease-out;
}

@keyframes statBump{
  0%{transform:scale(1)}
  55%{transform:scale(1.22);color:#2563eb}
  100%{transform:scale(1)}
}

/* ==========================================================
   Tabulky a správa
   ========================================================== */

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;
}

.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;
}

.missing-dates{
  display:inline-block;
  max-width:520px;
  line-height:1.6;
}

/* ==========================================================
   Reporty
   ========================================================== */

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

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

.report-month-form{
  display:flex;
  gap:12px;
  align-items:end;
  flex-wrap:wrap;
  margin-top:18px;
}

.report-month-form > div{
  min-width:220px;
}

.report-help{
  margin-top:12px;
  color:var(--muted);
  line-height:1.55;
}

.report-preview-wrap{
  position:relative;
  overflow-x:auto;
  overflow-y:auto;
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  isolation:isolate;
}

.report-preview-table{
  border-collapse:separate;
  border-spacing:0;
  width:max-content;
  min-width:100%;
  table-layout:fixed;
  font-family:var(--font-narrow);
  font-size:10px;
  letter-spacing:-.025em;
}

.report-preview-table th,
.report-preview-table td{
  font-family:var(--font-narrow);
  padding:4px 4px;
  min-width:31px;
  width:31px;
  max-width:31px;
  text-align:center;
  white-space:nowrap;
  border-bottom:1px solid var(--border);
  border-right:1px solid #edf2f7;
}

.report-preview-table th:first-child,
.report-preview-table td:first-child{
  min-width:184px;
  width:184px;
  max-width:184px;
  text-align:left;
  position:-webkit-sticky;
  position:sticky;
  left:0;
  background:#fff;
  background-clip:padding-box;
  z-index:2;
  box-shadow:1px 0 0 var(--border);
  font-family:var(--font-ui);
  letter-spacing:-.02em;
}

.report-preview-table thead th{
  background:#eaf1f8;
  font-weight:700;
}

.report-preview-table thead th:first-child{
  background:#eaf1f8;
  z-index:3;
}

.report-preview-table th small{
  font-size:8px;
  font-weight:500;
}

.report-empty-day{
  color:#cbd5e1;
}

/* ==========================================================
   Login a footer
   ========================================================== */

.login-body{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

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

.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%;
}

.login-title-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
}

.login-title-row h1{
  margin:0;
}

.login-logo, .app-footer-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 26px;
  border-radius: 0 10px 10px 0;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.05em;
  box-shadow: 0 6px 14px rgba(37,99,235,.18);
}

.login-card .login-submit{
  margin-top:18px;
}

.app-footer{
  width:100%;
  padding:18px 16px 24px;
  color:#64748b;
  font-size:13px;
}

.app-footer-inner{
  max-width:1220px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
}

.login-footer{
  padding-bottom:28px;
}

.login-footer .app-footer-inner{
  max-width:420px;
}

body:not(.login-body) .app-footer{
  margin-top:12px;
  border-top:1px solid rgba(217,225,236,.7);
  background:rgba(255,255,255,.42);
}

/* ==========================================================
   Responsivní zobrazení
   ========================================================== */

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

  .legend-summary-grid{
    grid-template-columns:repeat(4, minmax(0, 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;
  }

  .main-nav .nav-group::after{
    display:none;
  }

  .main-nav .nav-dropdown{
    margin-top:4px;
    padding-top:8px;
  }

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

  .main-nav .nav-group.open > .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;
  }

  .legend-summary-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:7px;
  }

  .legend-stat-item{
    min-height:32px;
  }
}

@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-weekdays,
  .day-placeholder{
    display:none;
  }

  .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,
  .meal-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%;
  }

  .context-user-nav{
    grid-template-columns:40px 1fr 40px;
  }

  .report-month-form > div,
  .report-month-form button{
    width:100%;
  }

  .report-preview-table{
    font-size:9.5px;
  }

  .report-preview-table th,
  .report-preview-table td{
    min-width:30px;
    width:30px;
    max-width:30px;
  }

  .report-preview-table th:first-child,
  .report-preview-table td:first-child{
    min-width:150px;
    width:150px;
    max-width:150px;
  }

  .login-card .login-submit{
    margin-top:20px;
  }

  .app-footer{
    padding-bottom:20px;
  }
}

@media(max-width:420px){
  .legend-summary-grid{
    grid-template-columns:1fr;
  }
}


/* ==========================================================
   FIX: soft-danger a strava bez HO
   ========================================================== */

/* Tlačítko Smazat měsíc má zůstat jemně růžové, i když má současně třídu danger. */
.btn.soft-danger,
button.soft-danger,
.btn.danger.soft-danger,
button.danger.soft-danger{
  background:#fee2e2 !important;
  color:#991b1b !important;
}

.btn.soft-danger:hover,
button.soft-danger:hover,
.btn.danger.soft-danger:hover,
button.danger.soft-danger:hover{
  background:#fecaca !important;
  color:#7f1d1d !important;
}

/* Strava je dostupná jen pro /, SC a ZSC. Pro HO se nenabízí. */
.day:not([data-status="P"]):not([data-status="SC"]):not([data-status="ZSC"]) .meal-choice{
  display:none !important;
}

/* Starší checkbox varianta stravy – také bez HO. */
.day[data-status="HO"] .meal-toggle{
  display:none !important;
}


/* ==========================================================
   Reporty: víkendy a svátky světle růžově
   ========================================================== */

.report-preview-table thead th.report-off-day,
.report-preview-table tbody td.report-off-day,
.report-preview-table thead th.report-holiday-day,
.report-preview-table tbody td.report-holiday-day{
  background:#fdf2f8 !important;
}


/* ==========================================================
   Přítomnost / manažerský přehled
   ========================================================== */

.presence-filter{
  display:grid;
  grid-template-columns:180px 180px minmax(240px, 1fr) auto;
  gap:12px;
  align-items:end;
  margin-top:18px;
}

.presence-filter input,
.presence-filter select{
  width:100%;
}

.presence-status-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
  margin-top:14px;
}

.presence-status-card{
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  padding:12px;
  min-width:0;
}

.presence-status-head{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}

.presence-status-code{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:26px;
  padding:0 7px;
  border-radius:8px;
  background:#f1f5f9;
  color:#0f172a;
  font-weight:850;
  letter-spacing:-.04em;
}

.presence-status-head strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:700;
}

.presence-status-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:30px;
  height:26px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid var(--border);
  color:#334155;
  font-weight:800;
}

.presence-user-list{
  display:flex;
  flex-direction:column;
  gap:5px;
  max-height:190px;
  overflow:auto;
  padding-right:4px;
}

.presence-user-list a{
  display:block;
  padding:6px 8px;
  border-radius:9px;
  background:#f8fafc;
  color:#172033;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.presence-user-list a:hover{
  background:#e8eef6;
}

.presence-empty{
  color:var(--muted);
  font-size:13px;
}

.presence-status-card.status-p .presence-status-code{background:#dcfce7;color:#166534}
.presence-status-card.status-ho .presence-status-code{background:#ccfbf1;color:#0f766e}
.presence-status-card.status-d .presence-status-code{background:#ffedd5;color:#9a3412}
.presence-status-card.status-sc .presence-status-code{background:#e0f2fe;color:#075985}
.presence-status-card.status-zsc .presence-status-code{background:#ede9fe;color:#5b21b6}
.presence-status-card.status-n .presence-status-code{background:#fee2e2;color:#991b1b}
.presence-status-card.status-ocr .presence-status-code{background:#fce7f3;color:#9d174d}
.presence-status-card.status-empty .presence-status-code{background:#f1f5f9;color:#64748b}

.presence-table td:first-child a{
  color:#172033;
  font-weight:650;
}

.presence-table td:first-child a:hover{
  color:var(--primary);
}

@media(max-width:780px){
  .presence-filter{
    grid-template-columns:1fr;
  }

  .presence-filter button{
    width:100%;
  }
}


/* ==========================================================
   Přítomnost – čitelnost v2
   ========================================================== */

.presence-filter-compact{
  grid-template-columns:360px 180px auto !important;
}

.presence-date-nav{
  display:grid;
  grid-template-columns:44px minmax(150px, 1fr) 44px;
  gap:8px;
  align-items:center;
}

.presence-date-nav input{
  width:100%;
}

.presence-status-grid{
  align-items:stretch;
}

.presence-status-card{
  min-height:128px;
  overflow:hidden;
}

.presence-status-head strong{
  font-size:14px;
  line-height:1.15;
}

.presence-user-list{
  max-height:190px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:13px;
  line-height:1.2;
}

.presence-user-item{
  display:block;
  padding:5px 7px;
  border-radius:8px;
  background:#f8fafc;
  color:#172033;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:13px;
  line-height:1.2;
}

.presence-user-select{
  width:100%;
  min-height:36px;
  margin-top:4px;
  font-size:13px;
  font-weight:650;
}

.presence-table-wrap{
  scroll-behavior:auto;
}

.presence-table{
  font-size:12px !important;
}

.presence-table th,
.presence-table td{
  min-width:42px !important;
  width:42px !important;
  max-width:42px !important;
  padding:5px 5px !important;
  font-size:12px !important;
}

.presence-table th:first-child,
.presence-table td:first-child{
  min-width:230px !important;
  width:230px !important;
  max-width:230px !important;
  font-size:12px !important;
  font-weight:700 !important;
}

.presence-table th.presence-today-day,
.presence-table td.presence-today-day{
  background:#dbeafe !important;
  box-shadow:inset 2px 0 0 #2563eb, inset -2px 0 0 #2563eb;
}

.presence-table thead th.presence-today-day{
  color:#1e40af !important;
  font-weight:850 !important;
}

@media(max-width:780px){
  .presence-filter-compact{
    grid-template-columns:1fr !important;
  }

  .presence-date-nav{
    grid-template-columns:44px 1fr 44px;
  }
}

@media(max-width:560px){
  .presence-table th:first-child,
  .presence-table td:first-child{
    min-width:180px !important;
    width:180px !important;
    max-width:180px !important;
  }
}


/* ==========================================================
   Portál interních aplikací
   ========================================================== */

.portal-shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.portal-login-wrap{
  min-height:calc(100vh - 90px);
  display:grid;
  place-items:center;
  padding:24px 16px;
}

.portal-card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
  gap:16px;
  margin-top:18px;
}

.portal-app-card{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-height:170px;
  padding:20px;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow);
  color:var(--text);
  transition:.15s ease;
}

.portal-app-card:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 36px rgba(15,23,42,.11);
}

.portal-app-icon{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:linear-gradient(135deg,#2563eb,#0d9488);
  color:#fff;
  font-size:18px;
  font-weight:850;
  letter-spacing:-.05em;
}

.portal-app-card h2{
  margin:0;
  font-size:22px;
}

.portal-app-card p{
  margin:0;
  color:var(--muted);
  line-height:1.45;
}

.portal-app-role{
  margin-top:auto;
  align-self:flex-start;
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:0 9px;
  border-radius:999px;
  background:#eef2ff;
  color:#3730a3;
  font-size:12px;
  font-weight:750;
}

.portal-topbar-link{
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:0 11px;
  border-radius:10px;
  background:#e8eef6;
  color:#0f172a !important;
  font-weight:650;
}

.portal-access-table select{
  min-width:150px;
}

.portal-muted-row{
  color:var(--muted);
  font-size:13px;
}


/* ==========================================================
   Logo OSŽ Portál
   ========================================================== */

.portal-brand{
  display:inline-flex;
  align-items:center;
  gap:12px;
}

.portal-logo{
  display:block;
  width:46px;
  height:46px;
  object-fit:contain;
}

.login-portal-logo{
  display:block;
  width:min(360px, 100%);
  height:auto;
  margin:0 auto 18px;
}

/* ==========================================================
   Matice přístupů
   ========================================================== */

.access-matrix-wrap{
  width:100%;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  margin-top:18px;
}

.access-matrix{
  width:max-content;
  min-width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
}

.access-matrix th,
.access-matrix td{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  border-right:1px solid #edf2f7;
  vertical-align:middle;
}

.access-matrix thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f8fafc;
  font-size:13px;
  font-weight:750;
  white-space:nowrap;
}

.access-matrix th:first-child,
.access-matrix td:first-child{
  position:sticky;
  left:0;
  z-index:1;
  min-width:300px;
  max-width:360px;
  background:#fff;
}

.access-matrix thead th:first-child{
  z-index:3;
  background:#f8fafc;
}

.access-matrix td:first-child strong{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.access-matrix td:first-child small{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.access-matrix .is-inactive{
  opacity:.55;
}

.check-cell{
  text-align:center;
  min-width:120px;
}

.check-only{
  display:inline-grid;
  place-items:center;
  margin:0;
  cursor:pointer;
}

.check-only input{
  width:22px;
  height:22px;
  cursor:pointer;
}

.check-only span{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
}

.form-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:16px;
}


/* ==========================================================
   Úprava vzhledu portálu – logo v hero kartě, patička
   ========================================================== */

.portal-brand{
  display:inline-flex;
  align-items:center;
  gap:0;
  font-weight:800;
  letter-spacing:-.04em;
}

.portal-brand .portal-logo{
  display:none !important;
}

.portal-hero-logo-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  margin:8px auto 18px;
}

.portal-hero-logo{
  display:block;
  width:min(420px, 100%);
  max-height:260px;
  object-fit:contain;
}

.portal-hero-logo-wrap + .eyebrow,
.portal-hero-logo-wrap + h1{
  display:none;
}

.login-portal-logo{
  content:url("/media/logo.png");
}

.app-footer{
  width:100%;
  padding:18px 16px 24px;
  color:#64748b;
  font-size:13px;
  margin-top:12px;
  border-top:1px solid rgba(217,225,236,.7);
  background:rgba(255,255,255,.42);
}

.app-footer-inner{
  max-width:1220px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
}

.app-footer-logo{
  width:24px;
  height:24px;
  display:block;
  object-fit:contain;
  border-radius:8px;
  flex:0 0 auto;
}

/* ==========================================================
   Portálová správa uživatelů
   ========================================================== */
.portal-users-table td,.portal-users-table th{white-space:nowrap}
.portal-user-form .grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.portal-user-form input{width:100%}
.portal-user-switches{display:flex;flex-wrap:wrap;gap:14px;margin:18px 0}
.portal-user-reminders-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin:12px 0}
.portal-user-reminders-row .muted{font-size:13px;line-height:1.45;margin:0}
.portal-user-reminders-row input[type="checkbox"]{flex-shrink:0}
.portal-check-row{display:inline-flex;align-items:center;gap:9px;margin:0;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:#fff;cursor:pointer;font-weight:650}
.portal-check-row input{width:20px;height:20px}
.danger-check{border-color:#fecaca;background:#fff7f7;color:#991b1b}
@media(max-width:780px){.portal-user-form .grid2{grid-template-columns:1fr}}

/* ==========================================================
   Vstupní stránka portálu – hero karta v2
   ========================================================== */

.portal-home-hero{
  max-width:960px;
  margin:30px auto 20px;
  padding:34px 38px;
  display:grid;
  grid-template-columns:250px minmax(0, 1fr);
  gap:34px;
  align-items:center;
  border:1px solid #d4e0ef;
  border-radius:18px;
  background:
    radial-gradient(circle at 15% 20%, rgba(37,99,235,.20), transparent 31%),
    radial-gradient(circle at 92% 18%, rgba(14,165,233,.16), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f3f8ff 48%, #eaf3ff 100%);
  box-shadow:0 24px 64px rgba(15,23,42,.10);
}

.portal-home-hero-logo{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:178px;
  padding:8px;
}

.portal-home-hero-logo img{
  display:block;
  width:min(225px, 100%);
  height:auto;
  object-fit:contain;
  filter:grayscale(1);
  opacity:.50;
}

.portal-home-hero-content{
  min-width:0;
}

.portal-home-hero h1{
  margin:0 0 12px;
  color:#1d4ed8;
  font-size:16px;
  line-height:1.2;
  font-weight:900;
  letter-spacing:.075em;
  text-transform:uppercase;
}

.portal-home-hero p{
  margin:0;
  color:#4f6178;
  font-size:15px;
  line-height:1.55;
}

.portal-home-info{
  margin:18px 0 12px;
  padding:14px 16px;
  display:grid;
  gap:8px;
  border:1px solid rgba(148,163,184,.35);
  border-radius:14px;
  background:rgba(255,255,255,.68);
  box-shadow:0 10px 24px rgba(15,23,42,.045);
}

.portal-home-info div{
  display:grid;
  grid-template-columns:130px minmax(0, 1fr);
  gap:10px;
  align-items:baseline;
}

.portal-home-info dt{
  margin:0;
  color:#64748b;
  font-size:13px;
  font-weight:800;
}

.portal-home-info dd{
  margin:0;
  color:#0f172a;
  font-size:14px;
  font-weight:750;
}

.portal-home-note{
  margin-top:6px !important;
  font-size:13px !important;
  color:#64748b !important;
}

.portal-section-title{
  max-width:960px;
  margin:0 auto 12px;
}

.portal-section-title h2{
  margin:0;
  color:#0f172a;
  font-size:20px;
  line-height:1.2;
  font-weight:850;
  letter-spacing:-.04em;
}

.portal-section-title p{
  margin:4px 0 0;
  color:#64748b;
  font-size:14px;
}

@media(max-width:820px){
  .portal-home-hero{
    margin:18px 14px 16px;
    padding:24px 20px;
    grid-template-columns:1fr;
    gap:14px;
  }

  .portal-home-hero-logo{
    min-height:0;
    justify-content:flex-start;
    padding:0;
  }

  .portal-home-hero-logo img{
    width:145px;
    max-height:118px;
  }

  .portal-home-hero h1{
    font-size:15px;
  }

  .portal-home-info{
    padding:12px 13px;
  }

  .portal-section-title{
    margin:0 14px 10px;
  }
}

@media(max-width:460px){
  .portal-home-hero{
    padding:20px 16px;
  }

  .portal-home-hero-logo img{
    width:126px;
  }

  .portal-home-hero p{
    font-size:14px;
  }

  .portal-home-info div{
    grid-template-columns:1fr;
    gap:2px;
  }

  .portal-home-info dt,
  .portal-home-info dd{
    font-size:13px;
  }
}

/* ==========================================================
   Portál – vizuální sjednocení aplikací v1
   ========================================================== */

:root{
  --app-ed:#2563eb;
  --app-rm:#db2777;
  --app-tasks:#f97316;
  --app-leave:#18599a;
  --app-evidence-zo:#7c3aed;
  --portal-ink:#0f172a;
  --portal-muted:#5b6b82;
}

/* Celé pozadí: shora tmavší, dolů světlejší. */
body{
  background:
    linear-gradient(180deg, #d7e4f3 0%, #eaf1f8 34%, #f8fafc 100%) !important;
  min-height:100vh;
}

/* Header zůstává bílý, ale na gradientu působí lehčeji. */
.portal-header{
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(10px);
  border-bottom:1px solid rgba(148,163,184,.34);
}

/* Hero karta: celistvě velmi světle šedá, gradient přesunut na pozadí stránky. */
.portal-home-hero{
  background:#f6f8fb !important;
  border-color:#d5dde8 !important;
  box-shadow:0 22px 56px rgba(15,23,42,.10) !important;
}

.portal-home-hero-logo img{
  opacity:.46;
}

.portal-home-info{
  background:rgba(255,255,255,.62) !important;
}

/* Dlaždice aplikací */
.apps-grid,
.portal-apps,
.app-grid{
  align-items:stretch;
}

.portal-app-card,
.app-card,
a.portal-app-card,
a.app-card{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  border:1px solid rgba(148,163,184,.32) !important;
  background:rgba(255,255,255,.92) !important;
  box-shadow:0 16px 36px rgba(15,23,42,.08);
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.portal-app-card::before,
.app-card::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
  background:var(--app-color, #2563eb);
  opacity:.95;
  z-index:-1;
}

.portal-app-card::after,
.app-card::after{
  content:"";
  position:absolute;
  inset:-42% -22% auto auto;
  width:190px;
  height:190px;
  border-radius:999px;
  background:color-mix(in srgb, var(--app-color, #2563eb) 16%, transparent);
  z-index:-1;
}

.portal-app-card:hover,
.app-card:hover,
a.portal-app-card:hover,
a.app-card:hover{
  transform:translateY(-2px);
  border-color:color-mix(in srgb, var(--app-color, #2563eb) 46%, #cbd5e1) !important;
  box-shadow:0 22px 46px rgba(15,23,42,.12);
}

.app-card--attendance,
.app-card--ed{
  --app-color:var(--app-ed);
}

.app-card--massages,
.app-card--rm{
  --app-color:var(--app-rm);
}

.app-card--tasks,
.app-card--up,
.app-card--úp{
  --app-color:var(--app-tasks);
}

.app-card--leave{
  --app-color:var(--app-leave);
}

.app-card--evidence_zo{
  --app-color:var(--app-evidence-zo);
}

/* Výraznější badge se zkratkou aplikace. */
.portal-app-card .app-icon,
.portal-app-card .portal-app-icon,
.portal-app-card .app-badge,
.app-card .app-icon,
.app-card .portal-app-icon,
.app-card .app-badge{
  width:44px !important;
  height:44px !important;
  min-width:44px !important;
  border-radius:14px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:var(--app-color, #2563eb) !important;
  color:#fff !important;
  font-size:16px !important;
  font-weight:950 !important;
  letter-spacing:-.04em !important;
  box-shadow:0 12px 26px color-mix(in srgb, var(--app-color, #2563eb) 34%, transparent) !important;
}

/* Pokud má badge starší třídu bez wrapperu. */
.portal-app-card > span:first-child,
.app-card > span:first-child{
  background:var(--app-color, #2563eb);
}

/* Prezentační oprávnění v patičce dlaždice. */
.portal-app-card .role-badge,
.portal-app-card .app-role,
.portal-app-card .badge,
.app-card .role-badge,
.app-card .app-role,
.app-card .badge{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:5px 10px;
  border-radius:999px;
  background:color-mix(in srgb, var(--app-color, #2563eb) 12%, #ffffff) !important;
  color:color-mix(in srgb, var(--app-color, #2563eb) 78%, #111827) !important;
  font-size:12px;
  font-weight:850;
  box-shadow:none;
}

.portal-app-card h2,
.portal-app-card h3,
.app-card h2,
.app-card h3{
  color:var(--portal-ink);
  letter-spacing:-.045em;
}

.portal-app-card p,
.app-card p{
  color:var(--portal-muted);
}

@supports not (background:color-mix(in srgb, red 10%, white)){
  .portal-app-card::after,
  .app-card::after{
    background:rgba(37,99,235,.08);
  }

  .app-card--rm::after{
    background:rgba(219,39,119,.08);
  }

  .app-card--tasks::after,
  .app-card--up::after,
  .app-card--úp::after{
    background:rgba(249,115,22,.08);
  }
}

@media(max-width:820px){
  body{
    background:linear-gradient(180deg, #d6e2f0 0%, #eef4fa 42%, #fbfdff 100%) !important;
  }

  .portal-home-hero{
    box-shadow:0 16px 38px rgba(15,23,42,.10) !important;
  }
}

/* ==========================================================
   Portál – hero karta propojená s dlaždicemi v2
   ========================================================== */

/* Hero karta je teď vizuálně bližší dlaždicím aplikací. */
.portal-home-hero{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  background:rgba(255,255,255,.94) !important;
  border:1px solid rgba(148,163,184,.34) !important;
  box-shadow:0 18px 42px rgba(15,23,42,.09) !important;
}

/* Barevná linka vlevo jako u aplikačních dlaždic, ale portálově víc neutrální. */
.portal-home-hero::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:6px;
  background:linear-gradient(180deg, var(--app-ed), var(--app-rm) 54%, var(--app-tasks));
  z-index:-1;
}

/* Stejný velký dekorativní oblouk/kruh jako na kartách aplikací. */
.portal-home-hero::after{
  content:"";
  position:absolute;
  top:-86px;
  right:-64px;
  width:255px;
  height:255px;
  border-radius:999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.42), transparent 42%),
    linear-gradient(135deg, rgba(37,99,235,.18), rgba(219,39,119,.13) 56%, rgba(249,115,22,.13));
  z-index:-1;
}

/* Druhý velmi jemný světelný prvek za logem. */
.portal-home-hero-logo{
  position:relative;
}

.portal-home-hero-logo::before{
  content:"";
  position:absolute;
  width:230px;
  height:150px;
  border-radius:999px;
  background:rgba(37,99,235,.06);
  filter:blur(16px);
  z-index:-1;
}

.portal-home-hero-logo img{
  filter:none !important;
  opacity:.58 !important;
  width:min(235px, 100%) !important;
}

.portal-home-info{
  background:#fff !important;
  border-color:rgba(148,163,184,.36) !important;
}

/* Dlaždice: ještě o trochu kompaktnější a čistší vazba na barevné badge. */
.portal-app-card,
.app-card,
a.portal-app-card,
a.app-card{
  background:rgba(255,255,255,.96) !important;
}

.portal-app-card .portal-app-icon,
.app-card .portal-app-icon{
  transform:translateZ(0);
}

.portal-app-card .portal-app-icon.portal-app-icon-image,
.app-card .portal-app-icon.portal-app-icon-image{
  width:80px !important;
  height:80px !important;
  min-width:80px !important;
  overflow:visible;
  background:transparent !important;
  box-shadow:none !important;
}

.portal-app-icon-image img{
  display:block;
  width:80px;
  height:80px;
  max-width:none;
  filter:drop-shadow(0 5px 6px rgba(15,23,42,.28));
}

/* Barevný prvek v hlavičce aplikací – stejná paleta jako na portálu. */
.osz-app-header{
  border-bottom-color:color-mix(in srgb, var(--app-color, #2563eb) 22%, #d9e3ef) !important;
}

.osz-app-header::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-1px;
  height:2px;
  background:linear-gradient(90deg, var(--app-color, #2563eb), transparent 42%);
  opacity:.75;
  pointer-events:none;
}

.osz-app-brand-mark{
  background:var(--app-color, #2563eb) !important;
  color:#fff !important;
  box-shadow:0 10px 22px color-mix(in srgb, var(--app-color, #2563eb) 34%, transparent) !important;
}

@media(max-width:820px){
  .portal-home-hero::after{
    top:-110px;
    right:-105px;
    width:240px;
    height:240px;
  }

  .portal-home-hero-logo::before{
    width:160px;
    height:90px;
  }

  .portal-home-hero-logo img{
    width:150px !important;
  }
}

@media(max-width:460px){
  .portal-home-hero::before{
    width:5px;
  }

  .portal-home-hero-logo img{
    width:132px !important;
  }
}

/* ==========================================================
   Fira Sans – sjednocení typografie
   ========================================================== */

html,
body,
button,
input,
select,
textarea{
  font-family:"Fira Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.card-title,
.page-title,
.section-title,
.panel-title,
.portal-home-hero h1,
.portal-section-title h2,
.portal-app-card h2,
.portal-app-card h3,
.app-card h2,
.app-card h3,
.osz-app-brand-title{
  font-family:"Fira Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-weight:700 !important;
}

/* ==========================================================
   Hero karta – velké kruhové motivy v ploše karty
   ========================================================== */

.portal-home-hero{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  background:#fff !important;
}

/* Zachováme levou portálovou linku, ale kruhy jsou jako u dlaždic:
   velké, přesahující okraje, s jemnou barevností. */
.portal-home-hero::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:6px;
  background:linear-gradient(180deg, var(--app-ed), var(--app-rm) 54%, var(--app-tasks));
  z-index:-1;
}

.portal-home-hero::after{
  content:"";
  position:absolute;
  width:330px !important;
  height:330px !important;
  right:-145px !important;
  top:-150px !important;
  border-radius:999px;
  background:rgba(37,99,235,.16) !important;
  z-index:-1;
}

.portal-home-hero-logo::before{
  content:"";
  position:absolute;
  width:300px !important;
  height:300px !important;
  left:-150px !important;
  bottom:-150px !important;
  border-radius:999px !important;
  background:rgba(219,39,119,.12) !important;
  filter:none !important;
  z-index:-1;
}

.portal-home-hero-logo::after{
  content:"";
  position:absolute;
  width:190px !important;
  height:190px !important;
  left:92px !important;
  top:-120px !important;
  border-radius:999px !important;
  background:rgba(249,115,22,.10) !important;
  z-index:-1;
}

.portal-home-hero-content::before{
  content:"";
  position:absolute;
  width:210px !important;
  height:210px !important;
  right:54px !important;
  bottom:-170px !important;
  top:auto !important;
  border-radius:999px !important;
  background:rgba(219,39,119,.09) !important;
  z-index:-1;
}

.portal-home-hero-content::after{
  content:"";
  position:absolute;
  width:145px !important;
  height:145px !important;
  right:-72px !important;
  bottom:26px !important;
  border-radius:999px !important;
  background:rgba(249,115,22,.10) !important;
  z-index:-1;
}

@media(max-width:820px){
  .portal-home-hero::after{
    width:250px !important;
    height:250px !important;
    right:-120px !important;
    top:-115px !important;
  }

  .portal-home-hero-logo::before{
    width:210px !important;
    height:210px !important;
    left:-110px !important;
    bottom:-110px !important;
  }

  .portal-home-hero-logo::after{
    width:135px !important;
    height:135px !important;
    left:86px !important;
    top:-86px !important;
  }

  .portal-home-hero-content::before{
    width:150px !important;
    height:150px !important;
    right:12px !important;
    bottom:-126px !important;
  }

  .portal-home-hero-content::after{
    width:105px !important;
    height:105px !important;
    right:-62px !important;
    bottom:34px !important;
  }
}

/* ==========================================================
   2FA – přihlášení a nastavení
   ========================================================== */

.twofa-card h1{
  margin:0 0 10px;
  font-size:24px;
  line-height:1.15;
  font-weight:700;
  letter-spacing:-.035em;
}

.twofa-card .muted{
  margin:0 0 18px;
}

.twofa-card input[name="code"]{
  text-align:center;
  letter-spacing:.28em;
  font-size:22px;
  font-weight:700;
}

.twofa-cancel{
  width:100%;
  margin-top:10px;
}

.twofa-secret-box{
  margin:16px 0;
  padding:14px 15px;
  border:1px solid rgba(148,163,184,.38);
  border-radius:14px;
  background:#fff;
}

.twofa-secret-box span{
  display:block;
  margin-bottom:6px;
  color:#64748b;
  font-size:13px;
  font-weight:700;
}

.twofa-secret-box strong{
  display:block;
  color:#0f172a;
  font-size:18px;
  line-height:1.45;
  word-break:break-word;
  letter-spacing:.12em;
}

.manual-link{
  color:#64748b;
  font-size:13px;
  line-height:1.45;
}

.manual-link a{
  color:#2563eb;
  font-weight:700;
  text-decoration:none;
}

.manual-link a:hover{
  text-decoration:underline;
}

/* ==========================================================
   Portál – kondenzovaná správa uživatelů
   ========================================================== */

.portal-users-page,
.portal-user-edit-page,
body:has(.portal-users-table),
body:has(.portal-user-form){
  --portal-condensed-font:"Fira Sans Condensed", "Fira Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Stránky uživatelů jsou informačně hustší, proto používají kondenzovaný řez. */
.portal-users-table,
.portal-users-table *,
.portal-user-form,
.portal-user-form *,
.portal-access-table,
.portal-access-table *{
  font-family:var(--portal-condensed-font) !important;
}

/* Kompaktnější tabulka uživatelů. */
.portal-users-table{
  width:100%;
  table-layout:auto;
  font-size:13px;
}

.portal-users-table th,
.portal-users-table td{
  padding:8px 9px !important;
  vertical-align:middle;
  line-height:1.22;
  white-space:nowrap;
}

.portal-users-table td:nth-child(3),
.portal-users-table td:nth-child(4){
  white-space:normal;
}

.portal-users-table .btn,
.portal-users-table a.btn,
.portal-users-table button{
  min-height:30px;
  padding:5px 8px !important;
  font-size:12px !important;
  line-height:1.15;
}

/* Kompaktnější editace uživatele. */
.portal-user-form{
  font-size:13.5px;
}

.portal-user-form .form-grid,
.portal-user-form .portal-form-grid{
  gap:10px 12px !important;
}

.portal-user-form label,
.portal-user-form .label{
  font-size:12px !important;
  line-height:1.15;
  font-weight:700;
}

.portal-user-form input,
.portal-user-form select,
.portal-user-form textarea{
  min-height:38px !important;
  padding:8px 10px !important;
  font-size:13.5px !important;
}

.portal-user-form .portal-check-row{
  min-height:36px;
  padding:7px 9px !important;
  gap:8px;
  line-height:1.2;
}

.portal-user-form .portal-check-row span{
  font-size:13px;
}

.portal-user-form .form-actions,
.portal-user-form .portal-form-actions{
  gap:8px !important;
}

.portal-user-form .btn,
.portal-user-form button,
.portal-user-form a.btn{
  min-height:36px;
  padding:7px 11px !important;
  font-size:13px !important;
}

/* Když je obrazovka užší, dovolíme tabulce vodorovný posun místo rozbití layoutu. */
.portal-table-wrap,
.table-wrap,
.card:has(.portal-users-table){
  overflow-x:auto;
}

/* Jemné zúžení běžných portálových karet ve správě, aby se obsah vešel. */
.portal-users-page .card,
.portal-user-edit-page .card,
.card:has(.portal-user-form),
.card:has(.portal-users-table){
  padding:18px !important;
}

@media(max-width:900px){
  .portal-users-table{
    font-size:12.5px;
  }

  .portal-users-table th,
  .portal-users-table td{
    padding:7px 8px !important;
  }

  .portal-user-form{
    font-size:13px;
  }
}

/* ==========================================================
   2FA – QR kód
   ========================================================== */

.twofa-qr-box{
  margin:18px 0 16px;
  padding:16px;
  border:1px solid rgba(148,163,184,.38);
  border-radius:16px;
  background:#fff;
  text-align:center;
  box-shadow:0 10px 24px rgba(15,23,42,.045);
}

.twofa-qr{
  width:212px;
  min-height:212px;
  margin:0 auto 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:12px;
  border:1px solid rgba(148,163,184,.32);
  border-radius:16px;
  background:#fff;
}

.twofa-qr img,
.twofa-qr canvas{
  display:block;
  width:188px !important;
  height:188px !important;
}

.twofa-qr-box p{
  margin:0;
  color:#64748b;
  font-size:13px;
  line-height:1.45;
  font-weight:600;
}

.twofa-qr-fallback{
  color:#64748b;
  font-size:13px;
  line-height:1.45;
  font-weight:600;
}

/* ==========================================================
   Portál – administrační toolbar / audit / zálohy
   ========================================================== */

.portal-admin-toolbar{
  gap:18px;
  align-items:flex-start;
}

.portal-inline-form{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.portal-inline-form label{
  font-size:13px;
  color:#64748b;
  font-weight:700;
}

.portal-inline-form select{
  min-height:38px;
  border:1px solid rgba(148,163,184,.45);
  border-radius:10px;
  padding:7px 10px;
  background:#fff;
}

.portal-section-title{
  margin:24px 0 12px;
  font-size:19px;
  color:#0f172a;
}

@media(max-width:720px){
  .portal-admin-toolbar{
    display:block;
  }

  .portal-admin-toolbar form{
    margin-top:14px;
    justify-content:flex-start;
  }

  .portal-inline-form{
    display:grid;
    grid-template-columns:1fr;
  }
}


/* ==========================================================
   Portál – nebezpečná zóna uživatele
   ========================================================== */

.portal-danger-zone{
  margin-top:44px;
  padding:0;
  border:1px solid rgba(148,163,184,.38);
  border-radius:14px;
  background:rgba(255,255,255,.56);
  overflow:hidden;
}

.portal-danger-zone summary{
  cursor:pointer;
  list-style:none;
  padding:13px 16px;
  color:#64748b;
  font-size:13px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.portal-danger-zone summary::-webkit-details-marker{
  display:none;
}

.portal-danger-zone summary::after{
  content:"Rozbalit";
  font-size:11px;
  font-weight:700;
  color:#94a3b8;
}

.portal-danger-zone[open] summary{
  border-bottom:1px solid rgba(148,163,184,.22);
  color:#7f1d1d;
  background:rgba(254,242,242,.42);
}

.portal-danger-zone[open] summary::after{
  content:"Sbalit";
  color:#b91c1c;
}

.portal-danger-zone-inner{
  padding:16px;
}

.portal-danger-zone p{
  max-width:760px;
  margin:0 0 14px;
  color:#7f1d1d;
  font-size:12.5px;
  line-height:1.45;
}

.portal-danger-zone form{
  max-width:760px;
}

.portal-danger-zone label{
  display:block;
  margin-bottom:7px;
  color:#7f1d1d;
  font-size:12.5px;
  font-weight:700;
}

.portal-danger-zone-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.portal-danger-zone input{
  min-height:36px;
  max-width:320px;
  border-color:rgba(148,163,184,.45);
  background:#fff;
}

.danger-button{
  min-height:36px;
  border:1px solid rgba(185,28,28,.35);
  border-radius:10px;
  padding:7px 12px;
  background:#fff;
  color:#991b1b;
  font-size:12.5px;
  font-weight:700;
  cursor:pointer;
}

.danger-button:hover{
  background:#fee2e2;
  border-color:rgba(185,28,28,.65);
}

@media(max-width:720px){
  .portal-danger-zone{
    margin-top:32px;
  }

  .portal-danger-zone-actions{
    display:grid;
    grid-template-columns:1fr;
  }

  .portal-danger-zone input{
    max-width:none;
  }
}

/* ==========================================================
   Portál – správa uživatelů v2
   ========================================================== */

.portal-users-page{
  overflow:visible;
}

.portal-users-head{
  position:sticky;
  top:72px;
  z-index:12;
  background:rgba(255,255,255,.9);
  backdrop-filter:blur(14px);
  margin:-22px -22px 18px;
  padding:18px 22px;
  border-bottom:1px solid rgba(214,224,238,.82);
  border-radius:16px 16px 0 0;
}

.portal-toolbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

.portal-user-stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}

.portal-user-stats > div{
  padding:12px 14px;
  border:1px solid rgba(214,224,238,.9);
  border-radius:14px;
  background:rgba(248,250,252,.72);
}

.portal-user-stats strong{
  display:block;
  font-size:22px;
  color:#0f172a;
  line-height:1;
}

.portal-user-stats span{
  display:block;
  margin-top:5px;
  color:#64748b;
  font-size:12px;
  font-weight:700;
}

.portal-users-filter{
  display:grid;
  grid-template-columns:2fr 1fr 1fr 1fr auto;
  gap:10px;
  align-items:end;
  padding:14px;
  margin-bottom:16px;
  border:1px solid rgba(214,224,238,.9);
  border-radius:16px;
  background:rgba(248,250,252,.72);
}

.portal-users-filter label{
  display:block;
  margin-bottom:5px;
  color:#64748b;
  font-size:12px;
  font-weight:700;
}

.portal-users-filter input,
.portal-users-filter select{
  width:100%;
  min-height:38px;
  border:1px solid rgba(148,163,184,.38);
  border-radius:10px;
  padding:8px 10px;
  background:#fff;
}

.portal-users-filter-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.portal-users-wrap{
  border-radius:16px;
}

.portal-users-table-refined{
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:13px;
}

.portal-users-table-refined th,
.portal-users-table-refined td{
  padding:9px 10px;
  vertical-align:middle;
}

.portal-users-table-refined td strong,
.portal-users-table-refined td span,
.portal-users-table-refined td small{
  display:block;
}

.portal-users-table-refined td small{
  margin-top:3px;
  color:#64748b;
  font-size:11.5px;
}

.portal-users-table-refined .btn.compact{
  min-height:30px;
  padding:6px 10px;
  font-size:12px;
}

.status-pill{
  display:inline-flex !important;
  width:max-content;
  align-items:center;
  justify-content:center;
  min-height:24px;
  padding:4px 8px;
  border-radius:999px;
  font-size:11.5px;
  font-weight:700;
  line-height:1;
  background:#f1f5f9;
  color:#475569;
}

.status-pill.ok{
  background:#dcfce7;
  color:#166534;
}

.status-pill.warn{
  background:#fef3c7;
  color:#92400e;
}

.status-pill.admin{
  background:#dbeafe;
  color:#1d4ed8;
}

.status-pill.muted{
  background:#f1f5f9;
  color:#64748b;
}

.portal-users-table-refined tr.is-inactive{
  opacity:.62;
}

@media(max-width:960px){
  .portal-users-head{
    position:static;
    margin:-18px -18px 16px;
    padding:16px 18px;
  }

  .portal-users-filter{
    grid-template-columns:1fr 1fr;
  }

  .portal-users-filter-actions{
    grid-column:1 / -1;
  }

  .portal-user-stats{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:620px){
  .portal-users-filter{
    grid-template-columns:1fr;
  }

  .portal-user-stats{
    grid-template-columns:1fr;
  }

  .portal-toolbar-actions{
    justify-content:flex-start;
  }
}

/* ==========================================================
   Portál – kompaktní audit
   ========================================================== */

.portal-audit-page{
  max-width:1040px;
  margin-left:auto;
  margin-right:auto;
}

.portal-audit-head{
  padding-bottom:12px;
}

.portal-audit-head h1{
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:31px;
  line-height:1.05;
  letter-spacing:-.035em;
}

.portal-audit-head .muted{
  font-size:13px;
}

.portal-audit-head .portal-inline-form{
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:12.5px;
}

.portal-audit-head .portal-inline-form select,
.portal-audit-head .portal-inline-form button{
  min-height:34px;
  padding-top:6px;
  padding-bottom:6px;
  font-size:12.5px;
}

.portal-audit-wrap{
  border-radius:14px;
}

.portal-audit-table{
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:12.5px;
  line-height:1.18;
}

.portal-audit-table th,
.portal-audit-table td{
  padding:7px 9px;
  vertical-align:top;
}

.portal-audit-table th{
  font-size:11.5px;
  font-weight:700;
  letter-spacing:.015em;
  color:#334155;
}

.portal-audit-table td:nth-child(1){
  width:138px;
  white-space:nowrap;
  color:#334155;
}

.portal-audit-table td:nth-child(2),
.portal-audit-table td:nth-child(3){
  width:135px;
  white-space:nowrap;
}

.portal-audit-table td:nth-child(4){
  width:150px;
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size:11px;
  color:#334155;
}

.portal-audit-table td:nth-child(5){
  min-width:260px;
}

.portal-audit-archive-table td:nth-child(4){
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:12.5px;
  color:#334155;
}

@media(max-width:900px){
  .portal-audit-page{
    max-width:none;
  }

  .portal-audit-head{
    display:block;
  }

  .portal-audit-head .portal-inline-form{
    margin-top:12px;
    justify-content:flex-start;
  }

  .portal-audit-wrap{
    overflow-x:auto;
  }

  .portal-audit-table{
    min-width:820px;
  }
}

/* ==========================================================
   Portál – lidštější audit a zálohy v2
   ========================================================== */

.audit-action-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:max-content;
  max-width:170px;
  min-height:23px;
  padding:4px 8px;
  border-radius:999px;
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:11px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  background:#f1f5f9;
  color:#475569;
}

.audit-action-pill.attendance{background:#dbeafe;color:#1d4ed8;}
.audit-action-pill.backup{background:#dcfce7;color:#166534;}
.audit-action-pill.audit{background:#fef3c7;color:#92400e;}
.audit-action-pill.user{background:#ede9fe;color:#6d28d9;}
.audit-action-pill.access{background:#e0f2fe;color:#0369a1;}
.audit-action-pill.security{background:#fef3c7;color:#92400e;}
.audit-action-pill.massages{background:#fce7f3;color:#be185d;}
.audit-action-pill.danger{background:#fee2e2;color:#991b1b;}

.portal-backup-page{
  max-width:1120px;
  margin-left:auto;
  margin-right:auto;
}

.portal-backup-head{
  align-items:flex-start;
}

.portal-backup-create{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.portal-backup-create input{
  min-height:38px;
  min-width:260px;
  border:1px solid rgba(148,163,184,.38);
  border-radius:10px;
  padding:8px 10px;
  background:#fff;
}

.portal-backup-stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}

.portal-backup-stats > div{
  padding:12px 14px;
  border:1px solid rgba(214,224,238,.9);
  border-radius:14px;
  background:rgba(248,250,252,.72);
}

.portal-backup-stats strong{
  display:block;
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:22px;
  line-height:1;
  color:#0f172a;
}

.portal-backup-stats span{
  display:block;
  margin-top:5px;
  color:#64748b;
  font-size:12px;
  font-weight:700;
}

.portal-backup-wrap{
  border-radius:16px;
}

.portal-backup-table{
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:12.5px;
  line-height:1.2;
}

.portal-backup-table th,
.portal-backup-table td{
  padding:8px 9px;
  vertical-align:top;
}

.portal-backup-table th{
  font-size:11.5px;
  font-weight:700;
}

.portal-backup-table td strong{
  display:block;
  font-size:12.5px;
}

.portal-backup-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  align-items:center;
}

.portal-backup-actions form{
  margin:0;
}

.btn.compact,
.danger-button.compact{
  min-height:30px;
  padding:6px 10px;
  font-size:12px;
}

@media(max-width:900px){
  .portal-backup-page{
    max-width:none;
  }

  .portal-backup-head{
    display:block;
  }

  .portal-backup-create{
    justify-content:flex-start;
    margin-top:12px;
  }

  .portal-backup-stats{
    grid-template-columns:1fr;
  }

  .portal-backup-wrap{
    overflow-x:auto;
  }

  .portal-backup-table{
    min-width:920px;
  }
}

@media(max-width:620px){
  .portal-backup-create{
    display:grid;
    grid-template-columns:1fr;
  }

  .portal-backup-create input{
    min-width:0;
    width:100%;
  }
}

/* ==========================================================
   Portál – systémový přehled
   ========================================================== */

.system-overview-page{
  max-width:1120px;
  margin-left:auto;
  margin-right:auto;
}

.system-overview-head{
  align-items:flex-start;
}

.system-kpi-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:10px;
  margin-bottom:16px;
}

.system-kpi{
  padding:13px 14px;
  border:1px solid rgba(214,224,238,.9);
  border-radius:15px;
  background:rgba(248,250,252,.76);
}

.system-kpi strong{
  display:block;
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:24px;
  line-height:1;
  color:#0f172a;
}

.system-kpi span{
  display:block;
  margin-top:6px;
  color:#64748b;
  font-size:11.5px;
  font-weight:700;
  line-height:1.25;
}

.system-two-col{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:14px;
  margin-bottom:14px;
}

.system-panel{
  padding:16px;
  border:1px solid rgba(214,224,238,.9);
  border-radius:16px;
  background:rgba(255,255,255,.82);
}

.system-panel h2{
  margin:0 0 12px;
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:20px;
  color:#0f172a;
}

.system-subtitle{
  margin-top:18px !important;
}

.system-check-list{
  display:grid;
  gap:8px;
}

.system-check-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 11px;
  border-radius:13px;
  background:#f8fafc;
  border:1px solid rgba(214,224,238,.75);
}

.system-check-row strong,
.system-check-row span{
  display:block;
}

.system-check-row strong{
  color:#0f172a;
  font-size:13px;
}

.system-check-row span{
  margin-top:3px;
  color:#64748b;
  font-size:12px;
}

.system-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:max-content;
  min-width:72px;
  min-height:24px;
  padding:4px 8px;
  border-radius:999px;
  font-size:11.5px;
  font-weight:800;
  white-space:nowrap;
}

.system-status.ok{
  background:#dcfce7;
  color:#166534;
}

.system-status.warn{
  background:#fef3c7;
  color:#92400e;
}

.system-backup-highlight{
  display:grid;
  gap:5px;
  padding:12px;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid rgba(214,224,238,.75);
}

.system-backup-highlight strong{
  color:#0f172a;
  font-size:13px;
}

.system-backup-highlight span{
  color:#64748b;
  font-size:12px;
}

.system-activity-table{
  font-family:"Fira Sans Condensed","Arial Narrow",Arial,sans-serif;
  font-size:12.5px;
  line-height:1.2;
}

.system-activity-table th,
.system-activity-table td{
  padding:7px 9px;
}

.system-activity-table td:nth-child(1){
  width:138px;
  white-space:nowrap;
}

.system-activity-table td:nth-child(2){
  width:140px;
  white-space:nowrap;
}

.system-activity-table td:nth-child(3){
  width:160px;
  white-space:nowrap;
}

@media(max-width:1100px){
  .system-kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:820px){
  .system-two-col{
    grid-template-columns:1fr;
  }

  .system-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .system-activity-wrap{
    overflow-x:auto;
  }

  .system-activity-table{
    min-width:760px;
  }
}

@media(max-width:560px){
  .system-kpi-grid{
    grid-template-columns:1fr;
  }
}

/* ==========================================================
   Portál – brand pill
   ========================================================== */

.brand-portal{
  display:inline-flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
  letter-spacing:-.035em;
}

.brand-portal .brand-logo{
  display:none;
}

.brand-osz{
  color:#0f172a;
  font-weight:800;
}

.brand-portal-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 5px 11px 7px;
  border-radius: 10px;
  background: linear-gradient(135deg,#2563eb,#1d4ed8);
  color: #fff;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(37,99,235,.22);
}

@media(max-width:560px){
  .brand-portal{
    gap:6px;
  }

  .brand-portal-pill{
    min-height:26px;
    padding:4px 9px 5px;
  }
}

/* ==========================================================
   Portál – dlaždice aplikací: popisy
   ========================================================== */

.portal-app-card p{
  font-size:13px;
  line-height:1.4;
  color:#64748b;
  font-weight:400;
}

/* ==========================================================
   Portál – budoucí aplikace
   ========================================================== */

.portal-app-card-future{
  position:relative;
  cursor:default;
  color:#64748b;
  background:linear-gradient(135deg,#f8fafc,#f1f5f9);
  border:1px dashed rgba(148,163,184,.44);
  box-shadow:0 8px 18px rgba(15,23,42,.035);
  opacity:.82;
  overflow:hidden;
}

.portal-app-card-future::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 18% 16%,rgba(255,255,255,.76),rgba(255,255,255,0) 34%),
    radial-gradient(circle at 82% 86%,rgba(148,163,184,.10),rgba(148,163,184,0) 32%);
  pointer-events:none;
}

.portal-app-card-future::after{
  content:"";
  position:absolute;
  right:16px;
  top:16px;
  width:8px;
  height:8px;
  border-radius:999px;
  background:#cbd5e1;
  opacity:.85;
}

.portal-app-card-future .portal-app-icon{
  background:linear-gradient(135deg,#cbd5e1,#94a3b8);
  color:#ffffff;
  box-shadow:none;
}

.portal-app-card-future h2,
.portal-app-card-future p,
.portal-app-card-future .portal-app-role{
  position:relative;
  z-index:1;
}

.portal-app-card-future h2{
  color:#475569;
}

.portal-app-card-future p{
  color:#94a3b8;
  font-size:12.5px;
  line-height:1.35;
}

.portal-app-card-future .portal-app-role{
  background:rgba(148,163,184,.12);
  color:#94a3b8;
  font-size:11px;
}

/* ==========================================================
   Přístupy k aplikacím – kompaktní sticky matice
   ========================================================== */

.portal-access-page,
.portal-access-page table,
.portal-access-page input,
.portal-access-page button,
.portal-access-page a{
  font-family:var(--font-narrow);
}

.portal-access-page{
  padding:18px;
}

.portal-access-page .portal-card-head{
  margin-bottom:10px;
}

.portal-access-page h1{
  margin:0 0 5px;
  font-size:28px;
  line-height:1.05;
}

.portal-access-page .muted{
  max-width:900px;
  margin:0;
  font-size:12.5px;
  line-height:1.35;
}

.portal-access-matrix-wrap{
  max-height:calc(100vh - 245px);
  min-height:360px;
  margin-top:13px;
  overflow:auto;
  border-radius:13px;
  overscroll-behavior:contain;
}

.portal-access-matrix{
  font-size:12.5px;
  line-height:1.18;
}

.portal-access-matrix th,
.portal-access-matrix td{
  padding:6px 8px;
}

.portal-access-matrix thead th{
  position:sticky;
  top:0;
  z-index:5;
  background:#f8fafc;
  font-size:11.5px;
  line-height:1.05;
  box-shadow:0 1px 0 var(--border), 0 6px 12px rgba(15,23,42,.04);
}

.portal-access-matrix th:first-child,
.portal-access-matrix td:first-child{
  min-width:230px;
  max-width:270px;
}

.portal-access-matrix thead th:first-child{
  z-index:7;
}

.portal-access-matrix td:first-child{
  z-index:3;
}

.portal-access-matrix th:nth-child(2),
.portal-access-matrix td:nth-child(2){
  min-width:66px;
  max-width:66px;
  text-align:center;
  white-space:nowrap;
}

.portal-access-matrix th:nth-child(3),
.portal-access-matrix td:nth-child(3){
  min-width:86px;
  max-width:86px;
  text-align:center;
  white-space:nowrap;
}

.portal-access-matrix td:first-child strong{
  font-size:13px;
}

.portal-access-matrix td:first-child small{
  font-size:11px;
  margin-top:1px;
}

.portal-access-app-head{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-width:72px;
  max-width:105px;
  overflow:hidden;
}

.portal-access-app-head > span:last-child{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.portal-access-app-code{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border-radius:7px;
  background:#e0edff;
  color:#1d4ed8;
  font-size:10.5px;
  font-weight:900;
  line-height:1;
}

.portal-access-matrix .check-cell{
  min-width:86px;
  max-width:105px;
  padding-left:6px;
  padding-right:6px;
}

.portal-access-matrix .check-cell.has-app-admin{
  min-width:102px;
  max-width:118px;
}

.portal-access-choice-group{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:22px;
}

.portal-access-matrix .check-only input{
  width:18px;
  height:18px;
  margin:0;
  accent-color:#2563eb;
}

.portal-access-page .notice,
.portal-access-page .alert{
  margin:10px 0 0;
  padding:8px 10px;
  font-size:12.5px;
}

.portal-access-actions{
  position:sticky;
  bottom:0;
  z-index:8;
  margin-top:10px;
  padding:10px 0 0;
  background:linear-gradient(180deg,rgba(244,246,249,0),rgba(244,246,249,.98) 30%);
}

.portal-access-actions button,
.portal-access-actions .btn{
  min-height:32px;
  padding:6px 11px;
  font-size:12.5px;
}

@media(max-width:900px){
  .portal-access-page{
    padding:14px;
  }

  .portal-access-matrix-wrap{
    max-height:calc(100vh - 225px);
  }

  .portal-access-matrix th:first-child,
  .portal-access-matrix td:first-child{
    min-width:190px;
    max-width:220px;
  }
}

/* ==========================================================
   Portál – sjednocené administrační záhlaví
   ========================================================== */

.portal-admin-page{
  max-width:1120px;
  margin-left:auto;
  margin-right:auto;
  padding:20px;
  border:1px solid rgba(214,224,238,.95);
  border-radius:16px;
  background:rgba(255,255,255,.94);
  box-shadow:var(--shadow);
}

.portal-admin-page .portal-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin:-20px -20px 16px;
  padding:18px 20px 16px;
  border-bottom:1px solid rgba(214,224,238,.82);
  border-radius:16px 16px 0 0;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(14px);
}

.portal-admin-page .portal-card-head h1{
  margin:0;
  font-family:var(--font-narrow);
  font-size:31px;
  line-height:1.03;
  letter-spacing:-.035em;
  font-weight:800;
}

.portal-admin-page .portal-card-head .eyebrow{
  margin-bottom:3px;
  font-family:var(--font-narrow);
  font-size:11.5px;
  font-weight:800;
}

.portal-admin-page .portal-toolbar-actions{
  flex:0 0 auto;
  align-self:center;
}

.portal-admin-page .portal-toolbar-actions .btn,
.portal-admin-page .portal-card-head button{
  min-height:34px;
  padding:7px 11px;
  font-family:var(--font-narrow);
  font-size:13px;
}

.portal-admin-page .portal-card-head .muted{
  display:none;
}

/* sjednocení starších speciálních hlaviček */
.portal-users-head,
.portal-audit-head,
.portal-backup-head,
.system-overview-head,
.portal-access-head,
.portal-user-edit-head{
  position:relative;
  top:auto;
  z-index:auto;
}

.portal-users-page .portal-users-head{
  margin:-20px -20px 16px;
  padding:18px 20px 16px;
  border-radius:16px 16px 0 0;
}

.portal-access-page{
  padding:20px;
}

.portal-access-page .portal-card-head{
  margin:-20px -20px 12px;
}

.portal-access-page h1{
  margin:0;
  font-size:31px;
}

.portal-access-matrix-wrap{
  max-height:calc(100vh - 260px);
}

.portal-access-actions{
  background:linear-gradient(180deg,rgba(244,246,249,0),rgba(244,246,249,.98) 30%);
}

@media(max-width:760px){
  .portal-admin-page{
    padding:16px;
  }

  .portal-admin-page .portal-card-head{
    display:block;
    margin:-16px -16px 14px;
    padding:15px 16px;
  }

  .portal-admin-page .portal-toolbar-actions{
    justify-content:flex-start;
    margin-top:12px;
  }
}

/* ==========================================================
   Hlavní stránka – nové logo OSŽ Portál
   ========================================================== */

.portal-home-hero{
  grid-template-columns:minmax(280px, 380px) minmax(0, 1fr);
  gap:30px;
}

.portal-home-hero-logo{
  min-height:230px;
  padding:0;
}

.portal-home-hero-logo img{
  width:min(380px, 100%);
  max-height:260px;
  object-fit:contain;
  filter:none;
  opacity:1;
  border-radius:12px;
}

@media(max-width:820px){
  .portal-home-hero{
    grid-template-columns:1fr;
    text-align:center;
  }

  .portal-home-hero-logo{
    min-height:auto;
  }

  .portal-home-hero-logo img{
    margin:0 auto;
    width:min(460px, 100%);
  }
}


/* ==========================================================
   Systémový přehled – verze portálu
   ========================================================== */

.system-kpi-version strong{
  font-size:17px;
  line-height:1.1;
  word-break:break-word;
}

/* ==========================================================
   Hlavní stránka – mobilní odsazení loga
   ========================================================== */

@media(max-width:820px){
  .portal-home-hero{
    padding-top:22px;
  }

  .portal-home-hero-logo{
    padding-top:10px;
  }
}

@media(max-width:520px){
  .portal-home-hero{
    padding-top:28px;
  }

  .portal-home-hero-logo{
    padding-top:14px;
  }
}

/* ==========================================================
   Hlavní stránka – logo jako pozadí hero karty
   ========================================================== */

.portal-home-hero{
  position:relative;
  overflow:hidden;
  grid-template-columns:1fr;
  min-height:335px;
  padding:34px 42px;
  isolation:isolate;
}

.portal-home-hero::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.28), rgba(255,255,255,.78) 58%, rgba(255,255,255,.92));
  pointer-events:none;
}

.portal-home-hero-logo{
  position:absolute;
  inset:6px 8px;
  z-index:-1;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  min-height:0;
  padding:0;
  pointer-events:none;
}

.portal-home-hero-logo img{
  width:min(760px, 72%);
  height:100%;
  max-height:none;
  object-fit:contain;
  object-position:left center;
  border-radius:0;
  opacity:.24;
  filter:none;
  mix-blend-mode:multiply;
}

.portal-home-hero-content{
  position:relative;
  z-index:1;
  width:min(520px, 100%);
  margin-left:auto;
}

@media(max-width:820px){
  .portal-home-hero{
    min-height:420px;
    padding:34px 20px 24px;
    text-align:left;
  }

  .portal-home-hero::after{
    background:
      linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.86) 52%, rgba(255,255,255,.96));
  }

  .portal-home-hero-logo{
    inset:8px 8px 10px;
    justify-content:center;
    padding:0;
  }

  .portal-home-hero-logo img{
    width:98%;
    height:100%;
    object-position:center top;
    opacity:.20;
  }

  .portal-home-hero-content{
    margin:190px 0 0;
    width:100%;
  }
}

@media(max-width:520px){
  .portal-home-hero{
    min-height:430px;
    padding:34px 16px 22px;
  }

  .portal-home-hero-logo{
    inset:6px;
  }

  .portal-home-hero-logo img{
    width:108%;
    opacity:.19;
  }

  .portal-home-hero-content{
    margin-top:185px;
  }
}

/* ==========================================================
   Portál – mobilní burger menu
   ========================================================== */

.portal-shell{
  overflow-x:hidden;
}

.mobile-menu-toggle{
  width:40px;
  height:40px;
  min-width:40px;
  padding:0;
  border:0;
  border-radius:12px;
  background:#e8eef6;
  color:#0f172a;
  box-shadow:none;
  align-items:center;
  justify-content:center;
}

.mobile-menu-toggle span,
.mobile-menu-toggle span::before,
.mobile-menu-toggle span::after{
  content:"";
  display:block;
  width:18px;
  height:2px;
  border-radius:999px;
  background:currentColor;
}

.mobile-menu-toggle span{
  position:relative;
}

.mobile-menu-toggle span::before,
.mobile-menu-toggle span::after{
  position:absolute;
  left:0;
}

.mobile-menu-toggle span::before{
  top:-6px;
}

.mobile-menu-toggle span::after{
  top:6px;
}

@media(max-width:780px){
  .portal-shell .topbar{
    width:100%;
    max-width:100vw;
    padding:10px 14px;
    gap:10px;
  }

  .portal-shell .brand{
    min-width:0;
  }

  .portal-shell .mobile-menu-toggle{
    display:inline-flex;
    margin-left:auto;
  }

  .portal-shell .main-nav{
    display:none !important;
    width:100%;
    max-width:100%;
    flex:0 0 100%;
    flex-direction:column !important;
    align-items:stretch !important;
    justify-content:flex-start !important;
    gap:6px;
    padding:8px 0 4px;
    overflow:hidden;
  }

  .portal-shell .main-nav.open{
    display:flex !important;
  }

  .portal-shell .nav-link{
    width:100%;
    display:flex;
    justify-content:flex-start;
    padding:10px 11px;
  }

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

  .portal-shell .nav-user span{
    min-width:0;
    max-width:calc(100vw - 120px);
  }
}

/* ==========================================================
   Portál – desktop šířka a hero logo
   ========================================================== */

@media(min-width:821px){
  .portal-shell .container{
    max-width:1180px;
  }

  .portal-home-hero{
    max-width:1180px;
    min-height:315px;
    margin:34px auto 22px;
    padding:34px 44px;
  }

  .portal-home-hero::after{
    background:
      linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.30) 42%, rgba(255,255,255,.84) 72%, rgba(255,255,255,.96));
  }

  .portal-home-hero-logo{
    inset:0 8px;
    justify-content:flex-start;
  }

  .portal-home-hero-logo img{
    width:min(820px, 68%);
    height:100%;
    opacity:.34;
    object-position:left center;
  }

  .portal-home-hero-content{
    width:min(500px, 48%);
    margin-left:auto;
  }

  .portal-card-grid{
    max-width:1180px;
    margin:20px auto 0;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:18px;
  }

  .portal-app-card{
    min-height:178px;
  }
}

@media(min-width:821px) and (max-width:1120px){
  .portal-card-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }

  .portal-home-hero-logo img{
    width:72%;
  }

  .portal-home-hero-content{
    width:min(500px, 54%);
  }
}

@media(max-width:820px){
  .portal-card-grid{
    max-width:none;
    grid-template-columns:repeat(auto-fit, minmax(230px, 1fr));
  }
}

/* ==========================================================
   Portál – hero poměr logo a text
   ========================================================== */

@media(min-width:821px){
  .portal-home-hero{
    display:grid;
    grid-template-columns:1fr 2fr;
    gap:26px;
    align-items:center;
    min-height:300px;
    padding:34px 44px;
  }

  .portal-home-hero::after{
    background:
      linear-gradient(90deg, rgba(255,255,255,.10), rgba(255,255,255,.30) 28%, rgba(255,255,255,.82) 54%, rgba(255,255,255,.96));
  }

  .portal-home-hero-logo{
    position:relative;
    inset:auto;
    z-index:1;
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:220px;
    padding:0;
  }

  .portal-home-hero-logo img{
    width:min(320px, 94%);
    height:auto;
    max-height:230px;
    object-fit:contain;
    object-position:center center;
    opacity:.42;
    filter:none;
    mix-blend-mode:multiply;
  }

  .portal-home-hero-content{
    position:relative;
    z-index:2;
    width:100%;
    max-width:560px;
    margin:0;
    justify-self:start;
  }
}

@media(min-width:1180px){
  .portal-home-hero-logo img{
    width:min(360px, 96%);
    max-height:250px;
  }
}

/* ==========================================================
   Portál – seskupené administrační menu
   ========================================================== */

.portal-shell .nav-trigger{
  box-shadow:none;
  font-family:var(--font-ui);
}

.portal-shell .nav-group.open > .nav-trigger{
  background:#f1f5f9;
}

@media(max-width:780px){
  .portal-shell .nav-group{
    width:100%;
  }

  .portal-shell .nav-trigger{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    color:#334155;
  }

  .portal-shell .nav-dropdown{
    position:static;
    min-width:0;
    margin:4px 0 8px;
    padding:6px;
    border-radius:12px;
    background:#f8fafc;
    box-shadow:none;
  }

  .portal-shell .nav-dropdown a{
    padding:10px 11px;
  }
}

/* ==========================================================
   Portál – předváděcí úklid
   ========================================================== */

.portal-empty-state{
  max-width:720px;
  margin:28px auto;
  text-align:center;
}

.portal-empty-state h2{
  margin:0 0 8px;
  font-size:22px;
}

@media(min-width:821px){
  .portal-card-grid{
    grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
  }
}


.twofa-remember-option{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  gap:8px;
  margin:6px 0 16px;
  color:#475467;
  font-family:"Fira Sans Condensed","Fira Sans",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:11.8px;
  line-height:1.05;
  font-weight:500;
  letter-spacing:-.01em;
  white-space:nowrap;
  cursor:pointer;
}

.twofa-remember-option input{
  width:19px;
  height:19px;
  margin:0;
  accent-color:#2563eb;
  flex:0 0 19px;
}

.twofa-remember-option span{
  display:block;
  min-width:0;
  white-space:nowrap;
  font-weight:500;
}

.portal-app-admin-check{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  margin:0;
  color:#1d4ed8;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
  cursor:pointer;
}

.portal-app-admin-check input{
  width:17px;
  height:17px;
  margin:0;
  accent-color:#2563eb;
}

.portal-app-admin-check span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:20px;
  padding:0 4px;
  border-radius:6px;
  background:#e0edff;
  color:#1d4ed8;
  font-size:10px;
  font-weight:900;
  line-height:1;
}

/* ==========================================================
   Portál – spravované odkazy v hero kartě
   ========================================================== */

.portal-home-links{
  position:relative;
  z-index:2;
  align-self:stretch;
  min-width:0;
  padding:18px;
  border:1px solid rgba(148,163,184,.38);
  border-radius:16px;
  background:rgba(255,255,255,.78);
  box-shadow:0 12px 30px rgba(15,23,42,.07);
  backdrop-filter:blur(7px);
}

.portal-home-links h2{
  margin:0 0 11px;
  color:#0f172a;
  font-size:18px;
  line-height:1.2;
}

.portal-home-links ul{
  display:grid;
  gap:7px;
  margin:0;
  padding:0;
  list-style:none;
}

.portal-home-links a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:38px;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(239,246,255,.88);
  color:#1d4ed8;
  font-weight:750;
  text-decoration:none;
}

.portal-home-links a:hover{
  background:#dbeafe;
  color:#1e40af;
}

.portal-home-links-empty{
  margin:0;
  color:#64748b;
  font-size:14px;
}

@media(min-width:821px){
  .portal-home-hero{
    grid-template-columns:minmax(210px, 1fr) minmax(360px, 2fr) minmax(220px, .9fr);
  }

  .portal-home-links{
    align-self:center;
    max-height:232px;
    overflow:auto;
  }
}

@media(max-width:820px){
  .portal-home-hero{
    min-height:0;
  }

  .portal-home-links{
    width:100%;
    margin-top:18px;
  }
}

/* ==========================================================
   Portál – formuláře správy odkazů
   ========================================================== */

.portal-links-page{
  max-width:1180px;
}

.portal-links-admin-section + .portal-links-admin-section{
  margin-top:28px;
  padding-top:24px;
  border-top:1px solid var(--border);
}

.portal-links-admin-section h2{
  margin:0 0 14px;
  font-size:20px;
}

.portal-links-admin-list{
  display:grid;
  gap:12px;
}

.portal-link-form{
  display:grid;
  grid-template-columns:minmax(150px, .8fr) minmax(260px, 2fr) 90px auto auto auto;
  gap:12px;
  align-items:end;
  padding:14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#f8fafc;
}

.portal-link-form label > span{
  display:block;
  margin-bottom:6px;
  color:#475569;
  font-size:12px;
  font-weight:750;
}

.portal-link-form input[type="text"],
.portal-link-form input[type="url"],
.portal-link-form input[type="number"],
.portal-link-form input:not([type]){
  width:100%;
}

.portal-link-check{
  display:flex;
  align-items:center;
  gap:6px;
  min-height:40px;
  color:#334155;
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
}

.portal-link-check input{
  width:17px;
  height:17px;
  margin:0;
  accent-color:#2563eb;
}

.portal-link-actions{
  display:flex;
  gap:7px;
}

.portal-link-actions button{
  min-height:40px;
}

@media(max-width:1050px){
  .portal-link-form{
    grid-template-columns:1fr 1fr 100px auto auto;
  }

  .portal-link-url-field{
    grid-column:span 2;
  }

  .portal-link-actions,
  .portal-link-form-new > button{
    grid-column:1 / -1;
    justify-self:start;
  }
}

@media(max-width:680px){
  .portal-link-form{
    grid-template-columns:1fr;
  }

  .portal-link-url-field,
  .portal-link-actions,
  .portal-link-form-new > button{
    grid-column:auto;
  }
}

/* ==========================================================
   Portál – povinná vstupní oznámení
   ========================================================== */

.portal-notices-page{
  max-width:1180px;
}

.portal-notices-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin:18px 0;
}

.portal-notice-editor{
  min-width:0;
  margin:0;
  padding:12px 14px 14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#f8fafc;
  font-family:var(--font-narrow);
}

.portal-notice-editor legend{
  padding:0 7px;
  color:#172033;
  font-size:16px;
  font-weight:750;
}

.portal-notice-editor > label:not(.portal-notice-active){
  display:block;
  margin:14px 0 6px;
  color:#475569;
  font-size:13px;
  font-weight:700;
}

.portal-notice-editor input[type="text"],
.portal-notice-editor input:not([type]),
.portal-notice-editor textarea{
  width:100%;
}

.portal-notice-editor textarea{
  min-height:76px;
  resize:vertical;
}

.portal-notice-active{
  display:flex;
  align-items:center;
  gap:7px;
  margin:0;
  font-weight:700;
  white-space:nowrap;
}

.portal-notice-active input{
  width:16px;
  height:16px;
  margin:0;
  accent-color:var(--primary);
}

.portal-app-config-topline{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  gap:12px;
  margin-bottom:10px;
}

.portal-app-version,
.portal-notice-fields label{
  display:grid;
  gap:4px;
  min-width:0;
  color:#475569;
  font-size:12px;
  font-weight:700;
}

.portal-app-config-editor input[type="text"],
.portal-app-config-editor textarea{
  min-width:0;
  padding:8px 10px;
  font-family:var(--font-narrow);
  font-size:14px;
  line-height:1.25;
}

.portal-notice-fields{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(130px,1fr);
  gap:8px 10px;
}

.portal-notice-message-field{
  grid-column:1 / -1;
}

.portal-app-config-note{
  margin:8px 0 0;
  color:#64748b;
  font-size:11px;
  line-height:1.3;
}

.portal-notice-body{
  min-height:100vh;
  overflow:hidden;
}

.portal-notice-backdrop{
  position:fixed;
  inset:0;
  z-index:10000;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(15,23,42,.68);
  backdrop-filter:blur(7px);
}

.portal-notice-modal{
  width:min(620px,100%);
  max-height:calc(100vh - 40px);
  overflow:auto;
  padding:28px;
  border:1px solid rgba(255,255,255,.5);
  border-radius:20px;
  background:#fff;
  box-shadow:0 28px 80px rgba(15,23,42,.34);
}

.portal-notice-target{
  margin-bottom:8px;
  color:var(--primary);
  font-size:13px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.portal-notice-modal h1{
  margin:0 0 18px;
  font-size:clamp(24px,4vw,34px);
  line-height:1.2;
}

.portal-notice-message{
  color:#334155;
  font-size:16px;
  line-height:1.65;
  overflow-wrap:anywhere;
}

.portal-notice-confirm-form{
  display:flex;
  justify-content:flex-end;
  margin-top:26px;
}

.portal-notice-confirm-form button{
  min-width:150px;
}

@media(max-width:760px){
  .portal-notices-grid{
    grid-template-columns:1fr;
  }

  .portal-notice-backdrop{
    align-items:end;
    padding:10px;
  }

  .portal-notice-modal{
    max-height:calc(100vh - 20px);
    padding:22px 18px;
    border-radius:18px;
  }

  .portal-notice-confirm-form button{
    width:100%;
  }

  .portal-app-config-topline,
  .portal-notice-fields{
    grid-template-columns:1fr;
  }

  .portal-notice-message-field{
    grid-column:auto;
  }

  .portal-notice-active{
    padding:3px 0;
  }
}

/* ==========================================================
   Portál – šest kompaktních dlaždic na široké obrazovce
   ========================================================== */

@media(min-width:1280px){
  .portal-card-grid{
    grid-template-columns:repeat(6, minmax(0, 1fr));
    gap:12px;
  }

  .portal-app-card{
    min-height:205px;
    gap:9px;
    padding:15px;
  }

  .portal-app-card h2{
    font-size:18px;
    line-height:1.16;
    letter-spacing:-.025em;
  }

  .portal-app-card p{
    font-size:12px;
    line-height:1.35;
  }
}
