/* ============================================================
   Správa SVJ — Hlavní stylesheet
   Design: světlý, moderní, funkční, přívětivý
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
  --primary:        #4361ee;
  --primary-light:  #c7d2fe;
  --primary-dark:   #3451db;
  --accent:         #06b6d4;
  --success:        #10b981;
  --success-light:  #bbf7d0;
  --warning:        #f59e0b;
  --warning-light:  #fde68a;
  --danger:         #f03e3e;
  --danger-light:   #fecaca;
  --purple:         #9c36b5;
  --purple-light:   #d8b4fe;
  --teal:           #0ca678;
  --teal-light:     #99f6e4;
  --gray-50:        #f8f9fc;
  --gray-100:       #f1f5f9;
  --gray-200:       #e2e8f0;
  --gray-300:       #cbd5e1;
  --gray-400:       #94a3b8;
  --gray-500:       #64748b;
  --gray-600:       #475569;
  --gray-700:       #334155;
  --gray-800:       #1e293b;
  --gray-900:       #0f172a;
  --white:          #ffffff;
  --sidebar-w:      240px;
  --topbar-h:       64px;
  --radius:         12px;
  --radius-lg:      12px;
  --radius-sm:      12px;
  --shadow-sm:      0 1px 4px rgba(67,97,238,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 16px rgba(67,97,238,.11);
  --shadow-lg:      0 10px 40px rgba(67,97,238,.14);
  --transition:     .2s ease;
  --font:           'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: #f3f6fd; color: var(--gray-700); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ---- SVG Icons ---- */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 0;
}
.svg-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}
.btn .svg-icon,
.btn .svg-icon svg { width: 16px; height: 16px; }
.stat-icon .svg-icon,
.stat-icon .svg-icon svg { width: 26px; height: 26px; }

/* ============================================================
   LAYOUT
   ============================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(170deg, #1e3a8a 0%, #312e81 100%);
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
  transition: width var(--transition), transform var(--transition);
}

.sidebar-logo {
  padding: 1rem 1rem 1rem 1.375rem;
  height: var(--topbar-h);
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo img {
  height: 26px;
  width: auto;
  max-width: 80px;
  display: block;
  margin-left: -4px;
}

.logo-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .55rem;
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
}

.logo-icon { font-size: 1.5rem; flex-shrink: 0; }
.logo-text {
  overflow: hidden;
  white-space: normal;
  line-height: 1.25;
  opacity: 1;
  transition: opacity var(--transition);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0 1rem .5rem;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Tenký scrollbar na tmavém pozadí */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.35); }

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .875rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: .9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  margin-right: .5rem;
}

.nav-item:hover {
  background: transparent;
  color: #fff;
}
.nav-item:hover .nav-icon {
  background: transparent;
  box-shadow: none;
  color: #fbbf24;
  opacity: 1;
}
.sidebar a, .sidebar a:hover { color: #fff; }

.nav-item.active {
  background: #f3f6fd;
  color: var(--primary);
  font-weight: 600;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  margin-right: 0;
}
.nav-item.active:hover,
.sidebar a.nav-item.active,
.sidebar a.nav-item.active:hover {
  background: #f3f6fd;
  color: var(--primary);
}

.nav-icon {
  flex-shrink: 0;
  opacity: .8;
  display: flex;
  align-items: center;
  height: 1.44rem; /* = nav-label font-size (.9rem) × line-height (1.6): udržuje výšku flex řádku konstantní i po skrytí labelu */
  border-radius: var(--radius-sm);
  transition: color var(--transition), opacity var(--transition);
}
.nav-item.active .nav-icon { opacity: 1; color: var(--primary); }
.nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-user {
  padding: 1rem 1.25rem 1rem 1.375rem;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.sidebar-user .user-avatar-sm {
  width: 32px;
  height: 32px;
  border-width: 1px;
}
.sidebar-user-icon { display: none; }

.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-size: .85rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .75rem; color: rgba(255,255,255,.55); }

/* ---- Main ---- */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 1.75rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 12px rgba(67,97,238,.06);
}

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: .5rem;
  color: var(--gray-500);
  border-radius: var(--radius-sm);
}

.topbar-menu-btn:hover { background: var(--gray-100); color: var(--gray-700); }

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.icon-btn {
  position: relative;
  background: none;
  border: none;
  padding: .5rem;
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  transition: all var(--transition);
}

.icon-btn:hover { background: var(--gray-100); color: var(--gray-700); }

.badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 18px;
  height: 22px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* ---- Notifications Dropdown ---- */
.notifications-wrap { position: relative; }

.notifications-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 340px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  max-height: 480px;
  overflow: hidden;
  z-index: 200;
}

.notifications-dropdown.open { display: flex; }

#notifList { overflow-y: auto; flex: 1; min-height: 0; }

.notif-header {
  padding: 1rem 1.25rem .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}

.notif-mark-all { font-size: .8rem; color: var(--primary); }
.notif-loading { padding: 1.5rem; text-align: center; color: var(--gray-400); font-size: .875rem; }

.notif-item {
  display: flex;
  gap: .75rem;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--gray-50);
  transition: background var(--transition);
  cursor: pointer;
}

.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #c7d9f5; }

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: .35rem;
}

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: .85rem; font-weight: 600; color: var(--gray-800); }
.notif-msg { font-size: .8rem; color: var(--gray-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: .75rem; color: var(--gray-400); margin-top: 2px; }
.notif-empty { padding: 2rem; text-align: center; color: var(--gray-400); font-size: .875rem; }

/* ---- User Menu ---- */
.user-menu-wrap { position: relative; }

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: none;
  border: none;
  padding: .4rem .6rem;
  border-radius: var(--radius);
  color: var(--gray-700);
  transition: background var(--transition);
}

.user-menu-btn:hover { background: var(--gray-100); }
.user-menu-name { font-size: .875rem; font-weight: 500; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 200;
}

.user-dropdown.open { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .625rem 1rem;
  color: var(--gray-700);
  font-size: .875rem;
  transition: background var(--transition);
}

.dropdown-item:hover { background: var(--gray-50); color: var(--gray-900); }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.text-danger:hover { background: var(--danger-light); }
.dropdown-divider { border: none; border-top: 1px solid var(--gray-200); margin: .25rem 0; }

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  padding: 2rem 2.25rem;
}

/* ---- Footer ---- */
.app-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--gray-200);
  background: var(--white);
  font-size: .8rem;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.footer-sep { opacity: .4; }
.footer-link { color: var(--gray-400); }
.footer-link:hover { color: var(--primary); }

/* ---- Sidebar Overlay (mobile) ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 99;
}

/* ---- Sidebar Pin Button ---- */
.sidebar-pin-btn {
  background: none;
  border: none;
  padding: 2px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.55);
  transition: all var(--transition);
  flex-shrink: 0;
  line-height: 0;
}
.sidebar-pin-btn:hover { background: none; color: #fff; }

/* ---- Sidebar Collapsed (desktop) ---- */
:root { --sidebar-collapsed-w: 62px; }

.sidebar,
.main-wrapper {
  transition: width var(--transition), margin-left var(--transition);
}

.app-layout.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-w, 56px);
  overflow: hidden;
}

.app-layout.sidebar-collapsed .sidebar-nav {
  overflow-y: auto;
  overflow-x: hidden;
}

.app-layout.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-collapsed-w, 56px);
}

.app-layout.sidebar-collapsed .nav-label,
.app-layout.sidebar-collapsed .sidebar-user-info {
  display: none;
}
.app-layout.sidebar-collapsed .logo-text {
  opacity: 0;
  pointer-events: none;
}

.app-layout.sidebar-collapsed .nav-item {
  justify-content: flex-start;
  padding: .625rem .875rem;
  gap: 0;
  margin-right: .5rem;
}

.app-layout.sidebar-collapsed .nav-item.active {
  background: transparent;
  color: #fff;
  border-radius: var(--radius-sm);
  margin-right: .5rem;
}
.app-layout.sidebar-collapsed .nav-item.active .nav-icon { color: #fbbf24; }
.app-layout.sidebar-collapsed .nav-item.active:hover { background: transparent; }

.app-layout.sidebar-collapsed .nav-icon { opacity: 1; }

.app-layout.sidebar-collapsed .sidebar-user {
  justify-content: flex-start;
  padding: 1rem 1rem 1rem 1.375rem;
}
.app-layout.sidebar-collapsed .sidebar-user .user-avatar-sm { display: none; }
.app-layout.sidebar-collapsed .sidebar-user .sidebar-user-icon { display: flex; }

.app-layout.sidebar-collapsed .sidebar-logo {
  padding: 1rem 0 1rem 1.375rem;
  height: var(--topbar-h);
  box-sizing: border-box;
  justify-content: flex-start;
  gap: 0;
}

.app-layout.sidebar-collapsed .sidebar-logo .sidebar-pin-btn {
  position: static;
  transform: none;
  padding: 2px;
}

.app-layout.sidebar-collapsed .sidebar-logo img {
  width: auto;
  height: 26px;
  max-width: 80px;
}

.app-layout.sidebar-collapsed .logo-link {
  justify-content: flex-start;
}

/* Tooltip for collapsed sidebar — rendered by JS as position:fixed element */
#sidebar-tooltip {
  position: fixed;
  background: #1e293b;
  color: #fff;
  font-size: .8rem;
  font-weight: 500;
  white-space: nowrap;
  padding: .35rem .7rem;
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
  z-index: 9999;
  box-shadow: var(--shadow);
}
#sidebar-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-right-color: #1e293b;
}

/* ============================================================
   KOMPONENTY
   ============================================================ */

/* ---- Cards ---- */
.card {
  background: var(--white);
  border: 1px solid rgba(67,97,238,.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #c7d2fe 0%, #ddd6fe 55%, #f5d0fe 100%);
  border-bottom: 1px solid #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  min-height: 56px;
}

.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.01em;
}

.card-body { padding: 1.75rem 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid #c7d2fe; background: #f5f3ff20; }

/* ---- Stats Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.125rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-card:has(.stat-icon.blue)   { background: linear-gradient(135deg, #dde8ff 0%, #fff 60%); border-color: #a5b4fc; }
.stat-card:has(.stat-icon.green)  { background: linear-gradient(135deg, #bbf7d0 0%, #fff 60%); border-color: #4ade80; }
.stat-card:has(.stat-icon.yellow) { background: linear-gradient(135deg, #fef08a 0%, #fff 60%); border-color: #fde047; }
.stat-card:has(.stat-icon.purple) { background: linear-gradient(135deg, #ede9fe 0%, #fff 60%); border-color: #c084fc; }
.stat-card:has(.stat-icon.red)    { background: linear-gradient(135deg, #fecaca 0%, #fff 60%); border-color: #f87171; }
.stat-card:has(.stat-icon.teal)   { background: linear-gradient(135deg, #99f6e4 0%, #fff 60%); border-color: #2dd4bf; }
.stat-card:has(.stat-icon.orange) { background: linear-gradient(135deg, #fed7aa 0%, #fff 60%); border-color: #fb923c; }

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue   { background: linear-gradient(135deg, #818cf8, #4361ee); color: #fff; }
.stat-icon.green  { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.stat-icon.yellow { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #713f12; }
.stat-icon.purple { background: linear-gradient(135deg, #a855f7, #9333ea); color: #fff; }
.stat-icon.red    { background: linear-gradient(135deg, #f87171, #ef4444); color: #fff; }
.stat-icon.teal   { background: linear-gradient(135deg, #2dd4bf, #0d9488); color: #fff; }

.stat-icon svg { width: 26px; height: 26px; }

.stat-value { font-size: 2rem; font-weight: 800; color: var(--gray-800); line-height: 1; letter-spacing: -.03em; }
.stat-label { font-size: .8rem; color: var(--gray-500); margin-top: .35rem; font-weight: 500; }

/* ---- Page Header ---- */
.page-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header-left h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -.025em;
  position: relative;
  padding-bottom: .5rem;
  display: inline-block;
}
.page-header-left h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2.25rem;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  border-radius: 99px;
}
.page-header-left p  { color: var(--gray-500); font-size: .875rem; margin-top: .5rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.15rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
  letter-spacing: -.01em;
}

.btn-primary   { background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%); color: #fff; box-shadow: 0 2px 8px rgba(67,97,238,.3); }
.btn-primary:hover  { background: linear-gradient(135deg, var(--primary-dark) 0%, #4f46e5 100%); color: #fff; box-shadow: 0 4px 12px rgba(67,97,238,.4); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover  { background: #059669; color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: #dc2626; color: #fff; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover  { background: #d97706; color: #fff; }
.btn-outline   { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover  { background: var(--primary-light); }
.btn-ghost     { background: transparent; color: var(--gray-600); }
.btn-ghost:hover    { background: var(--gray-100); color: var(--gray-800); }
.btn-sm        { padding: .55rem 1.15rem; font-size: .875rem; }
.btn-lg        { padding: .55rem 1.15rem; font-size: .875rem; }
.btn-icon      { padding: .5rem; }
.btn:disabled  { opacity: .55; cursor: not-allowed; }
.btn svg       { width: 16px; height: 16px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: .35rem;
}

label .required { color: var(--danger); margin-left: 2px; }

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
input[type=time],
input[type=datetime-local],
input[type=tel],
input[type=url],
select,
textarea {
  width: 100%;
  padding: .6rem .875rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.14);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
}

textarea { min-height: 120px; resize: vertical; }
select   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 16px; padding-right: 2.5rem; }

.form-hint { font-size: .78rem; color: var(--gray-400); margin-top: .3rem; }
.tooltip-wrap { position: relative; display: inline-flex; align-items: center; vertical-align: middle; line-height: 1; }
.tooltip-wrap .svg-icon svg { width: 14px; height: 14px; }
.tooltip-wrap .tooltip-text {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  padding: .5rem .75rem;
  background: var(--gray-800);
  color: var(--white);
  font-size: .72rem;
  font-weight: 400;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 200;
}
.tooltip-wrap .tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--gray-800);
}
.tooltip-wrap:hover .tooltip-text { opacity: 1; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: .3rem; }
.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
details.card > summary { border-radius: var(--radius, .75rem); }
details.card[open] > summary { border-radius: var(--radius, .75rem) var(--radius, .75rem) 0 0; border-bottom: 1px solid var(--gray-100); }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::marker { display: none; }
details.card > summary .chevron-icon { margin-left: auto; transition: transform .2s; flex-shrink: 0; }
details.card[open] > summary .chevron-icon { transform: rotate(180deg); }
.form-check input[type=checkbox] { width: auto; cursor: pointer; }
input[type=time]::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; filter: invert(40%); }
input[type=time]::-webkit-calendar-picker-indicator:hover { opacity: .9; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead th {
  background: #e0e7ff;
  color: var(--primary-dark);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 2px solid #a5b4fc;
  white-space: nowrap;
}

thead th.th-sort {
  cursor: pointer;
  user-select: none;
}
thead th.th-sort:hover { background: #c7d2fe; }
thead th.th-sort-asc,
thead th.th-sort-desc { background: #c7d2fe; }
.th-sort-icon { margin-left: .3em; font-size: .65em; opacity: .7; }

tbody td {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

.table-actions { display: flex; gap: .25rem; justify-content: flex-end; flex-wrap: nowrap; align-items: center; }
.table-actions form { display: contents; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: .15rem .6rem;
  border-radius: 4px;
  font-size: .625rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1.5px solid transparent;
  cursor: default;
}

.badge-blue   { background: #bfdbfe; color: #1e40af; border-color: #93c5fd; }
.badge-green  { background: #86efac; color: #14532d; border-color: #4ade80; }
.badge-yellow { background: #fef08a; color: #713f12; border-color: #fde047; }
.badge-orange { background: #fed7aa; color: #9a3412; border-color: #fb923c; }
.badge-red    { background: #fca5a5; color: #7f1d1d; border-color: #f87171; }
.badge-gray   { background: var(--gray-200); color: var(--gray-700); border-color: var(--gray-300); }
.badge-purple { background: #d8b4fe; color: #4c1d95; border-color: #c084fc; }
.badge-teal   { background: #5eead4; color: #134e4a; border-color: #2dd4bf; }

/* ---- Alerts ---- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .875rem 1rem;
  border-radius: var(--radius-lg);
  font-size: .875rem;
  margin-bottom: 1rem;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); color: #065f46; border-left: 4px solid var(--success); }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info    { background: var(--primary-light); color: var(--primary); border-left: 4px solid var(--primary); }

/* ---- Avatar ---- */
.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--gray-200);
}

/* ---- Badges (message types) ---- */
.msg-type-news      { background: var(--primary-light); color: var(--primary); }
.msg-type-notice    { background: var(--success-light); color: #065f46; }
.msg-type-urgent    { background: var(--danger-light);  color: #991b1b; }
.msg-type-minutes   { background: var(--gray-100);      color: var(--gray-600); }
.msg-type-financial { background: var(--warning-light); color: #92400e; }

/* ---- Progress Bar ---- */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
}

.progress-bar.blue   { background: var(--primary); }
.progress-bar.green  { background: var(--success); }
.progress-bar.yellow { background: var(--warning); }
.progress-bar.red    { background: var(--danger); }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none;
  border: none;
  padding: .75rem 1.25rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.tab-btn:hover { color: var(--gray-800); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  display: none;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-lg { max-width: 800px; }

/* ---- Lightbox ---- */
.modal-lightbox {
  background: rgba(0,0,0,.85);
  cursor: zoom-out;
}
.modal-lightbox img {
  max-width: min(90vw, 1200px);
  max-height: 88vh;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  object-fit: contain;
  display: block;
  cursor: default;
}
.modal-lightbox .lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}
.modal-lightbox .lightbox-close:hover { background: rgba(255,255,255,.3); }

.modal-header {
  padding: 1.125rem 1.5rem;
  background: linear-gradient(135deg, #c7d2fe 0%, #ddd6fe 55%, #f5d0fe 100%);
  border-bottom: 1px solid #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--primary-dark); }
.modal-close { background: none; border: none; padding: .35rem; color: var(--gray-400); border-radius: var(--radius-sm); transition: all var(--transition); }
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: .75rem; flex-shrink: 0; background: var(--gray-50); }

/* ---- Pagination ---- */
.pagination ul { display: flex; list-style: none; gap: .25rem; flex-wrap: wrap; }
.pagination li a, .pagination li.active a {
  display: block;
  padding: .4rem .7rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--gray-600);
  transition: all var(--transition);
}
.pagination li a:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.pagination li.active a { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.filter-bar input, .filter-bar select {
  width: auto;
  min-width: 160px;
}

/* ---- Vote / Hlasování ---- */
.vote-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.vote-card:hover { box-shadow: var(--shadow); }

.vote-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  background: linear-gradient(135deg, #f8f9fc 0%, #fff 100%);
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.vote-status-active .vote-card-header { background: linear-gradient(135deg, #d1fae5 0%, #fff 70%); border-bottom-color: #6ee7b7; }
.vote-status-closed .vote-card-header { background: linear-gradient(135deg, #eef2ff 0%, #fff 70%); border-bottom-color: #c7d2fe; }
.vote-status-draft  .vote-card-header { background: linear-gradient(135deg, #f8f9fc 0%, #fff 70%); }
.vote-status-cancelled .vote-card-header { background: linear-gradient(135deg, #ffe0e0 0%, #fff 70%); border-bottom-color: #fca5a5; }

.vote-card-body { padding: 1.25rem 1.5rem 1.5rem; }

.vote-status-active { border-left: 4px solid var(--success); }
.vote-status-draft  { border-left: 4px solid var(--gray-300); }
.vote-status-closed { border-left: 4px solid var(--primary); }
.vote-status-cancelled { border-left: 4px solid var(--danger); }

.vote-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); margin-bottom: .375rem; }
.vote-meta  { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; font-size: .8rem; color: var(--gray-500); }
.vote-meta .badge { font-size: .7rem; }

/* Statistiky hlasování v přehledu */
.vote-stats { display: flex; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.vote-stat  { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.vote-stat-label { font-size: .75rem; color: var(--gray-500); font-weight: 500; white-space: nowrap; }
.vote-stat-value { font-size: 1.15rem; font-weight: 700; color: var(--gray-800); line-height: 1.2; }
.vote-stat-progress { flex: 1; min-width: 140px; }
.vote-stat-progress .progress { margin-top: .375rem; }

.vote-option-btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: .9rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  margin-bottom: .5rem;
}

.vote-option-btn:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.vote-option-btn.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.vote-option-btn.voted-yes { border-color: var(--success); background: var(--success-light); color: #065f46; }
.vote-option-btn.voted-no  { border-color: var(--danger);  background: var(--danger-light);  color: #991b1b; }

.vote-countdown { font-size: .85rem; font-weight: 600; color: var(--warning); }

/* ---- Document List ---- */
.doc-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

.doc-item:last-child { border-bottom: none; }
.doc-item:hover { background: var(--gray-50); }
.doc-icon { font-size: 1.5rem; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; color: var(--gray-800); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: .78rem; color: var(--gray-400); margin-top: 2px; }
.doc-actions { display: flex; gap: .25rem; }

/* ---- Message Card ---- */
.msg-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.375rem 1.5rem;
  margin-bottom: 1.125rem;
  transition: box-shadow var(--transition);
}

.msg-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.msg-card.pinned { border-left: 4px solid var(--warning); background: linear-gradient(135deg, #fef3c7 0%, #fff 60%); }
.msg-card.urgent { border-left: 4px solid var(--danger);  background: linear-gradient(135deg, #ffe0e0 0%, #fff 60%); }

.msg-card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .625rem; }
.msg-card-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); }
.msg-card-meta  { font-size: .8rem; color: var(--gray-500); margin-top: .25rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.msg-card-body  { color: var(--gray-600); font-size: .9rem; line-height: 1.65; }

/* ---- Registry ---- */
.registry-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 600;
}

.reg-ok     { color: var(--success); }
.reg-alert  { color: var(--danger); }
.reg-unknown{ color: var(--gray-400); }

.reg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.reg-dot.ok      { background: var(--success); }
.reg-dot.alert   { background: var(--danger); }
.reg-dot.unknown { background: var(--gray-300); }

/* ---- Upload Drop Zone ---- */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--gray-400);
  cursor: pointer;
  transition: all var(--transition);
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.upload-zone svg { width: 32px; height: 32px; margin-bottom: .5rem; }
.upload-zone p { font-size: .9rem; margin-bottom: .25rem; }
.upload-zone span { font-size: .78rem; }

/* ---- Segmented source toggle (Zápisy / Stanovy) ---- */
.source-tabs {
  display: inline-flex;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  margin-bottom: .75rem;
}
.source-tab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .375rem .875rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: .83rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.source-tab:hover { color: var(--gray-700); background: rgba(0,0,0,.05); }
.source-tab.active {
  background: var(--white);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.source-tab svg { width: 14px; height: 14px; }

/* ---- Row Hover (seznam v kartě) ---- */
.row-hover {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .875rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  color: inherit;
  text-decoration: none;
  transition: background var(--transition);
}
.row-hover:last-child { border-bottom: none; }
.row-hover:hover { background: #f5f7ff; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-400); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-primary{ color: var(--primary); }
.text-sm     { font-size: .875rem; }
.text-xs     { font-size: .78rem; }
.text-bold   { font-weight: 700; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: .5rem; }

/* ---- @zmínky v diskuzích ---- */
.mention-dropdown {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
}
.mention-item { padding: .5rem .75rem; cursor: pointer; font-size: .875rem; color: var(--gray-700); }
.mention-item:hover, .mention-item.active { background: var(--primary-light); color: var(--primary-dark); }
.mention { color: var(--primary-dark); font-weight: 600; background: var(--primary-light); padding: 0 .3rem; border-radius: 4px; }
.gap-3 { gap: .75rem; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }


/* ---- Loading Spinner ---- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Toast Notifications ---- */
#toastContainer {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  background: var(--gray-800);
  color: #fff;
  padding: .875rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: .75rem;
  pointer-events: auto;
  animation: slideIn .3s ease;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(100%); opacity: 0; } }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #312e81 25%, #4f46e5 50%, #7c3aed 75%, #1e40af 100%);
  background-size: 400% 400%;
  animation: loginFluid 14s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}


.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.login-header {
  background: var(--white);
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--gray-100);
}

.login-header .logo { display: block; margin-bottom: 1rem; line-height: 0; }
.login-header .logo img { height: 56px; width: auto; max-width: 200px; border-radius: 10px; display: block; margin: 0 auto; mix-blend-mode: multiply; }
.login-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-header p  { font-size: .85rem; color: var(--gray-500); margin-top: .25rem; }

.login-body { padding: 2rem; }

.login-body .btn { width: 100%; justify-content: center; padding: .75rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ---- Page layouts ---- */
.svj-layout  { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: start; }
.cal-layout  { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.cal-nav-arrow { font-size: 1.5rem; line-height: 1; padding: .25rem .75rem; min-width: 2.5rem; justify-content: center; }

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3     { grid-template-columns: 1fr 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
  /* Tablet: kalendář nad sebou, ale obojí viditelné */
  .cal-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    width: var(--sidebar-w) !important; /* override collapsed width on mobile */
  }

  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .main-wrapper { margin-left: 0 !important; }
  .topbar-menu-btn { display: flex; }
  .sidebar-pin-btn { display: none; }

  /* disable tooltip on mobile */
  [data-tooltip]::after,
  [data-tooltip]::before { display: none !important; }
  .user-menu-name { display: none; }

  .main-content { padding: 1.25rem 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header .btn { align-self: flex-start; }

  .form-row, .form-row-3, .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .card-header { flex-direction: column; align-items: flex-start; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar input, .filter-bar select { width: 100%; }

  .notifications-dropdown {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100svh - var(--topbar-h));
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-left: none;
    border-right: none;
    border-top: none;
  }

  /* Mobil: SVJ detail — levý a pravý sloupec pod sebou */
  .svj-layout { grid-template-columns: 1fr; }
  /* Mobil: Kalendář — skryj mřížku, zobraz jen seznam událostí */
  .cal-grid-card { display: none; }
  .cal-layout { grid-template-columns: 1fr; }

  /* Mobil: sidebar má plnou šířku — vždy zobrazit popisky položek */
  .app-layout.sidebar-collapsed .nav-label,
  .app-layout.sidebar-collapsed .sidebar-user-info { display: block; }
  .app-layout.sidebar-collapsed .logo-text { opacity: 1; pointer-events: auto; }
  .app-layout.sidebar-collapsed .nav-item {
    justify-content: flex-start;
    padding: .625rem 1rem;
    gap: .75rem;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 1rem; }
  .main-content { padding: 1rem .75rem; }
  .modal-backdrop { padding: .75rem; }
}


/* =============================================
   WYSIWYG obsah
   ============================================= */
.prose-content { line-height: 1.75; color: var(--gray-700); }
.prose-content h1 { font-size: 1.6rem; font-weight: 700; margin: 1.25rem 0 .5rem; color: var(--gray-800); }
.prose-content h2 { font-size: 1.3rem; font-weight: 700; margin: 1rem 0 .4rem; color: var(--gray-800); }
.prose-content h3 { font-size: 1.1rem; font-weight: 600; margin: .875rem 0 .35rem; color: var(--gray-800); }
.prose-content p { margin-bottom: .75rem; }
.prose-content ul, .prose-content ol { padding-left: 1.5rem; margin-bottom: .75rem; }
.prose-content ul { list-style: disc; }
.prose-content ol { list-style: decimal; }
.prose-content li { margin-bottom: .25rem; }
/* Vnořené OL: úroveň 2 = a,b,c  úroveň 3 = aa,ab,ac... */
.prose-content ol ol:not(ol ol ol) { list-style-type: lower-alpha; counter-reset: pc-l2; }
.prose-content ol ol:not(ol ol ol) > li { counter-increment: pc-l2; }
.prose-content ol ol ol { list-style-type: none; counter-reset: pc-l3; }
.prose-content ol ol ol > li { counter-increment: pc-l3; }
.prose-content ol ol ol > li::before { content: counter(pc-l2, lower-alpha) counter(pc-l3, lower-alpha) ") "; }
.prose-content strong { font-weight: 700; }
.prose-content em { font-style: italic; }
.prose-content u { text-decoration: underline; }
.prose-content a { color: var(--primary); text-decoration: underline; }

/* =============================================
   PASSWORD TOGGLE
   ============================================= */

.input-password-wrap {
  position: relative;
}

.input-password-wrap input {
  padding-right: 2.5rem;
}

.btn-toggle-pw {
  position: absolute;
  right: .45rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: .25rem;
  color: var(--gray-400);
  cursor: pointer;
  line-height: 0;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.btn-toggle-pw:hover { color: var(--gray-600); }

/* =============================================
   OPRAVY A DOPLŇKY
   ============================================= */

/* Stat icon — SVG ikona správná velikost */
.stat-icon > .svg-icon,
.stat-icon > .svg-icon svg { width: 26px; height: 26px; }

/* Modal s formulářem — flex průhlednost formu umožní scrollování modal-body */
.modal > form { display: contents; }

/* Notifikace — tlačítko smazat jednu */
.notif-item { align-items: flex-start; }
.notif-clickable {
  display: flex;
  flex: 1;
  gap: .75rem;
  cursor: pointer;
  min-width: 0;
}
.notif-delete-btn {
  background: none;
  border: none;
  padding: .2rem .35rem;
  color: var(--gray-300);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  align-self: flex-start;
  margin-top: .1rem;
}
.notif-delete-btn:hover { background: var(--danger-light); color: var(--danger); }

/* Login page — fluid animace */
.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167,139,250,.35) 0%, transparent 70%);
  filter: blur(60px);
  top: -150px;
  left: -150px;
  animation: loginBlob1 18s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.4) 0%, transparent 70%);
  filter: blur(50px);
  bottom: -100px;
  right: -100px;
  animation: loginBlob2 22s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.login-card { position: relative; z-index: 1; }

@keyframes loginFluid {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes loginBlob1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(80px, 60px) scale(1.15); }
  66%       { transform: translate(20px, 120px) scale(.9); }
}
@keyframes loginBlob2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%       { transform: translate(-70px, -50px) scale(1.2); }
  70%       { transform: translate(-120px, 30px) scale(.85); }
}
