@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Bebas+Neue&display=swap');

:root {
    --green-900: #0d3320;
    --green-800: #155230;
    --green-700: #1a6b3e;
    --green-600: #1e8049;
    --green-500: #25a35c;
    --green-400: #3dbd74;
    --green-300: #6dd49a;
    --green-200: #a7f3d0;
    --green-100: #d4f5e3;
    --green-50:  #f0fdf6;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50:  #f9fafb;
    --white: #ffffff;
    --red-500: #ef4444; --red-100: #fee2e2;
    --amber-600: #d97706; --amber-500: #f59e0b; --amber-100: #fef3c7;
    --blue-500: #3b82f6; --blue-100: #dbeafe;
    --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
    --shadow: 0 4px 16px rgba(0,0,0,.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.14);
    --shadow-green: 0 4px 20px rgba(30,128,73,.25);
    --radius: 10px; --radius-lg: 16px; --radius-xl: 24px;
    --font: 'Outfit', sans-serif;
    --font-display: 'Bebas Neue', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--gray-900); background: #f0fdf6; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
/* NAVBAR */
.navbar { background: var(--green-900); padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 70px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 20px rgba(0,0,0,.3); }
.navbar-brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.navbar-brand img { height: 52px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.navbar-brand-text { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .08em; color: var(--white); line-height: 1.1; }
.navbar-brand-text span { color: var(--green-300); display: block; font-size: 1rem; letter-spacing: .15em; }
.navbar-nav { display: flex; align-items: center; gap: .15rem; list-style: none; }
.navbar-nav a { color: rgba(255,255,255,.7); text-decoration: none; padding: .45rem 1rem; border-radius: 8px; font-size: .9rem; font-weight: 500; transition: all .15s; }
.navbar-nav a:hover, .navbar-nav a.active { background: rgba(255,255,255,.1); color: var(--white); }
.navbar-user { display: flex; align-items: center; gap: .75rem; font-size: .875rem; }
.navbar-user strong { color: var(--white); font-weight: 600; }
.navbar-version { color: rgba(255,255,255,.4); font-size: .75rem; }

/* LAYOUT */
.layout { display: flex; flex: 1; padding-left: 248px; }
.sidebar { width: 248px; background: var(--white); border-right: 1px solid var(--gray-200); padding: 1.75rem 0; flex-shrink: 0; position: fixed; top: 70px; left: 0; height: calc(100vh - 70px); overflow-y: auto; z-index: 50; }
.sidebar-inner { display: flex; flex-direction: column; min-height: 100%; }
.sidebar-section { margin-bottom: 1.1rem; }
.sidebar-title { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gray-400); padding: 0 1.25rem .3rem; }
.sidebar-nav { list-style: none; }
.sidebar-nav a { display: flex; align-items: center; gap: .6rem; padding: .4rem 1.25rem; color: var(--gray-600); text-decoration: none; font-size: .925rem; font-weight: 500; transition: all .12s; border-left: 3px solid transparent; margin: 0; }
.sidebar-nav a:hover { background: var(--green-50); color: var(--green-700); border-left-color: var(--green-300); }
.sidebar-nav a.active { background: var(--green-50); color: var(--green-700); border-left-color: var(--green-500); font-weight: 600; }
/* Navigační ikony – duotone „chip" (jemně zelený čtvereček + maskovaná ikona) */
.nav-ico {
    flex: none; width: 30px; height: 30px; border-radius: 9px;
    display: inline-grid; place-items: center;
    background: var(--green-50);
    box-shadow: inset 0 0 0 1px var(--green-100);
    transition: background .14s ease, box-shadow .14s ease, transform .14s ease;
}
.nav-ico::before {
    content: ""; width: 18px; height: 18px;
    background: var(--green-600);
    -webkit-mask: var(--ni) center / 18px 18px no-repeat;
            mask: var(--ni) center / 18px 18px no-repeat;
    transition: background .14s ease;
}
.sidebar-nav a:hover .nav-ico {
    background: var(--green-100);
    box-shadow: inset 0 0 0 1px var(--green-300);
}
.sidebar-nav a:hover .nav-ico::before { background: var(--green-700); }
.sidebar-nav a.active .nav-ico {
    background: var(--green-600);
    box-shadow: inset 0 0 0 1px var(--green-600);
    transform: translateY(-1px);
}
.sidebar-nav a.active .nav-ico::before { background: #fff; }
.main { flex: 1; padding: 2rem 2.5rem; overflow: auto; }

/* PAGE HEADER */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 2rem; }
.page-title { font-family: var(--font-display); font-size: 2.4rem; color: var(--green-900); letter-spacing: .04em; line-height: 1.1; }
.page-subtitle { color: var(--gray-500); font-size: .9rem; margin-top: .3rem; }
.page-subtitle a { color: var(--green-600); text-decoration: none; }

/* CARDS */
.card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); overflow: hidden; }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--gray-100); font-weight: 600; font-size: .975rem; color: var(--gray-800); display: flex; align-items: center; justify-content: space-between; background: var(--gray-50); }
.card-body { padding: 1.5rem; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.2rem; border-radius: var(--radius); font-family: var(--font); font-size: .9rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: all .15s; line-height: 1.4; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-600); color: var(--white); box-shadow: var(--shadow-green); }
.btn-primary:hover { background: var(--green-700); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--red-100); color: #991b1b; }
.btn-danger:hover { background: var(--red-500); color: var(--white); }
.btn-success { background: var(--green-100); color: var(--green-800); }
.btn-success:hover { background: var(--green-500); color: var(--white); }
.btn-blue { background: var(--blue-100); color: #1e40af; border: 1px solid #bfdbfe; }
.btn-blue:hover { background: var(--blue-500); color: var(--white); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.5); }
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: var(--white); }
.btn-sm { padding: .3rem .8rem; font-size: .825rem; border-radius: 6px; }
.btn-lg { padding: .8rem 2rem; font-size: 1.05rem; border-radius: var(--radius-lg); }

/* AKČNÍ IKONY (detail / editace / mazání) – tiché ikony + barevný hover */
.action-btn {
  width: 34px; height: 34px; padding: 0; flex: 0 0 auto;
  border: none; border-radius: 50%; background: transparent;
  color: #8a978e; display: inline-grid; place-items: center;
  cursor: pointer; text-decoration: none; transition: all .15s ease; line-height: 0;
}
.action-btn:hover { transform: scale(1.12); }
.action-btn:active { transform: scale(1.02); }
.action-btn--detail:hover { background: #e3f2e9; color: #067647; box-shadow: 0 2px 8px rgba(6,118,71,.25); }
.action-btn--edit:hover   { background: #dbeafe; color: #2563eb; box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.action-btn--delete:hover { background: #fee2e2; color: #dc2626; box-shadow: 0 2px 8px rgba(220,38,38,.25); }
.action-btn--hide:hover   { background: var(--gray-100); color: var(--gray-700); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.action-btn:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
.action-group { display: inline-flex; gap: 2px; align-items: center; }

/* KARTY SYNCHRONIZACE (Aktualizace) – jednotná výška, tlačítko dole */
.sync-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 1.25rem; align-items: stretch; }
.sync-card { display: flex; flex-direction: column; }
.sync-card .card-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: .75rem; }
.sync-stats { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--gray-600); }
.sync-stats b { color: var(--gray-900); font-weight: 700; }
.sync-desc { margin: 0; font-size: .8rem; color: var(--gray-500); line-height: 1.45; }
.sync-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; padding-top: .5rem; }
.sync-foot .btn { width: 100%; justify-content: center; white-space: normal; line-height: 1.3; text-align: center; }
.sync-row { display: flex; gap: .5rem; align-items: center; }
.sync-note { font-size: .78rem; color: var(--amber-600); line-height: 1.35; }
.sync-status { font-size: .8rem; color: var(--gray-500); min-height: 1.15em; word-break: break-word; }
.action-group form { display: inline; margin: 0; }
/* Na dotykových zařízeních větší cíl */
@media (hover: none) { .action-btn { width: 40px; height: 40px; } }

/* FORMS */
.form-group { margin-bottom: 1.35rem; }
.form-label { display: block; font-size: .875rem; font-weight: 600; color: var(--gray-700); margin-bottom: .45rem; }
.form-control { width: 100%; padding: .6rem 1rem; border: 1.5px solid var(--gray-300); border-radius: var(--radius); font-family: var(--font); font-size: .95rem; color: var(--gray-900); background: var(--white); transition: border-color .15s, box-shadow .15s; outline: none; }
.form-control:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(37,163,92,.15); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* TABLES */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .925rem; }
thead th { background: var(--gray-50); padding: .75rem 1.1rem; text-align: left; font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--gray-500); border-bottom: 2px solid var(--gray-200); }
tbody td { padding: .85rem 1.1rem; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); vertical-align: middle; }
tbody tr:hover { background: var(--green-50); }
tbody tr:last-child td { border-bottom: none; }

/* ALERTS */
.alert { padding: .9rem 1.2rem; border-radius: var(--radius); font-size: .925rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: .6rem; border-left: 4px solid; }
.alert-success { background: var(--green-50); color: var(--green-800); border-color: var(--green-500); }
.alert-danger { background: var(--red-100); color: #991b1b; border-color: var(--red-500); }
.alert-warning { background: var(--amber-100); color: #92400e; border-color: var(--amber-500); }
.alert-info { background: var(--blue-100); color: #1e40af; border-color: var(--blue-500); }

/* BADGES */
.badge { display: inline-block; padding: .22rem .65rem; border-radius: 999px; font-size: .73rem; font-weight: 700; letter-spacing: .03em; }
.badge-green { background: var(--green-100); color: var(--green-800); }
.badge-blue { background: var(--blue-100); color: #1e40af; }
.badge-red { background: var(--red-100); color: #991b1b; }
.badge-amber { background: var(--amber-100); color: #92400e; }
.badge-gray { background: var(--gray-100); color: var(--gray-700); }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem; border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--green-500); }
.stat-label { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-400); margin-bottom: .5rem; }
.stat-value { font-family: var(--font-display); font-size: 2.6rem; color: var(--green-900); letter-spacing: .02em; line-height: 1; }
.stat-sub { font-size: .825rem; color: var(--gray-500); margin-top: .35rem; }
.stat-card.accent { background: var(--green-900); border-color: var(--green-800); }
.stat-card.accent::before { background: var(--green-400); }
.stat-card.accent .stat-label { color: var(--green-300); }
.stat-card.accent .stat-value { color: var(--white); }
.stat-card.accent .stat-sub { color: rgba(255,255,255,.45); }

/* HERO */
.hero { background: var(--green-900); color: var(--white); padding: 5rem 2rem 7rem; text-align: center; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 60px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60'%3E%3Cpath fill='%23f0fdf6' d='M0,30 C240,60 480,0 720,30 C960,60 1200,0 1440,30 L1440,60 L0,60 Z'/%3E%3C/svg%3E") no-repeat bottom; background-size: cover; }
.hero-logo { width: 110px; height: auto; margin: 0 auto 1.5rem; display: block; filter: drop-shadow(0 4px 16px rgba(0,0,0,.4)); }
.hero-badge { display: inline-block; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: var(--green-300); padding: .25rem .9rem; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1rem; }
.hero-title { font-family: var(--font-display); font-size: 4.5rem; letter-spacing: .04em; line-height: 1; }
.hero-title span { color: var(--green-400); }
.hero-sub { font-size: 1.1rem; opacity: .7; margin-top: .75rem; font-weight: 300; }
.hero-actions { margin-top: 2.5rem; display: flex; gap: 1rem; justify-content: center; }

/* LOGIN */
.login-wrap { height: calc(100vh - 140px); display: flex; align-items: center; justify-content: center; background: var(--green-900); padding: 1rem; overflow: hidden; }
.login-card { background: var(--white); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 3rem; width: 100%; max-width: 440px; position: relative; z-index: 1; }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo img { height: 90px; width: auto; margin-bottom: 1rem; }
.login-logo h1 { font-family: var(--font-display); font-size: 1.9rem; letter-spacing: .06em; color: var(--green-900); }
.login-logo p { color: var(--gray-500); font-size: .9rem; margin-top: .2rem; }

/* FOOTER */
footer { background: var(--green-900); color: rgba(255,255,255,.4); text-align: center; padding: 1.75rem; font-size: .825rem; }
/* Patička odsazená o šířku menu jen na stránkách se sidebarem (ne na veřejné úvodní stránce) */
body:has(.sidebar) footer { margin-left: 248px; }
footer a { color: var(--green-400); text-decoration: none; }

/* PUBLIC PAGE */
.public-content { width: 100%; max-width: 1100px; margin: 0 auto; padding: 3rem 2rem; }
.hero { width: 100%; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.feature-card { background: var(--white); border-radius: var(--radius-lg); padding: 2rem; border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); text-align: left; transition: transform .2s, box-shadow .2s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon { width:54px; height:54px; border-radius:50%; display:flex; align-items:center; justify-content:center; margin-bottom:1.1rem; flex-shrink:0; }
.feature-title { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: .04em; color: var(--green-900); margin-bottom: .85rem; }
.feature-desc { color: var(--gray-500); font-size: .925rem; line-height: 1.6; }
.feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.feature-list li { font-size: .875rem; color: var(--gray-600); padding-left: 1.25rem; position: relative; line-height: 1.4; }
.feature-list li::before { content: '✓'; position: absolute; left: 0; color: var(--green-500); font-weight: 700; font-size: .8rem; top: .05rem; }

/* TOGGLE SWITCH */
.sw-toggle { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .875rem; color: var(--gray-700); font-weight: 500; }
.sw-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-track { width: 36px; height: 20px; border-radius: 999px; background: var(--gray-300); flex-shrink: 0; position: relative; transition: background .15s; }
.sw-toggle input:checked + .sw-track { background: var(--green-500); }
.sw-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; pointer-events: none; }
.sw-toggle input:checked + .sw-track .sw-thumb { transform: translateX(16px); }

/* UTILITY */
.text-muted { color: var(--gray-500); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; } .align-center { align-items: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.fw-bold { font-weight: 700; } .w-100 { width: 100%; }

/* WEEKLY ATTENDANCE GRID */
.week-nav { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.week-nav__label { font-weight: 600; color: var(--gray-700); font-size: .95rem; margin: 0 .25rem; }
.att-week-table { min-width: 700px; border-collapse: collapse; width: 100%; font-size: .85rem; }
.att-week-table th { padding: .75rem .5rem; text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); border-bottom: 2px solid var(--gray-200); background: var(--gray-50); border-right: 1px solid var(--gray-200); }
.att-week-table td { padding: .75rem .55rem; border-bottom: 2px solid var(--gray-200); border-right: 1px solid var(--gray-100); vertical-align: top; }
.att-week-table tbody tr:hover { background: transparent; }
.att-week-table tr:last-child td { border-bottom: none; }
.att-week-table th:last-child, .att-week-table td:last-child { border-right: none; }
.att-group-col { text-align: left !important; min-width: 150px; }
.att-day-col { min-width: 140px; }
.att-day-date { font-weight: 400; color: var(--gray-400); font-size: .78rem; display: block; margin-top: .1rem; }
.att-day--today { background-color: #dcfce7 !important; }
.att-week-table th.att-day--today { background-color: var(--green-600) !important; color: #fff !important; }
.att-week-table th.att-day--today .att-day-date { color: rgba(255,255,255,.75) !important; }
.att-group-name { font-weight: 600; font-size: .875rem; vertical-align: middle !important; white-space: nowrap; color: var(--gray-800); }
.att-day-cell { min-width: 140px; }
.att-slot { display: flex; flex-direction: column; justify-content: space-between; padding: .65rem .7rem; border-radius: 6px; margin-bottom: .4rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; width: 100%; text-align: left; font-family: inherit; background: none; transition: filter .12s; height: 86px; }
.att-slot:last-child { margin-bottom: 0; }
.att-slot--filled { background: #f0fdf4; border-color: #bbf7d0; color: inherit; }
.att-slot--filled:hover { filter: brightness(.95); }
.att-slot--open { background: var(--gray-50); border-color: var(--gray-200); color: inherit; }
.att-slot--open:hover { filter: brightness(.97); }
.att-slot--planned { background: var(--gray-50); border-color: var(--gray-200); color: inherit; }
.att-slot--planned:hover { filter: brightness(.97); }
.att-slot--future { display: flex; flex-direction: column; justify-content: space-between; padding: .65rem .7rem; border-radius: 6px; margin-bottom: .4rem; background: var(--gray-50); border: 1px solid var(--gray-200); opacity: .45; height: 86px; }
.att-slot--future:last-child { margin-bottom: 0; }
.att-time { font-size: .82rem; font-weight: 700; color: var(--gray-700); }
.att-slot--future .att-time { color: var(--gray-500); }
.att-type { font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-400); }
.att-badge { font-size: .65rem !important; padding: .1rem .4rem !important; align-self: flex-start; }
.att-empty { color: var(--gray-300); font-size: .8rem; display: block; text-align: center; padding: .25rem 0; }

/* Slot statistics */
.att-slot-stat { display: flex; align-items: center; gap: .3rem; }
.att-ss-label { font-size: .68rem; color: var(--gray-400); }
.att-ss-num     { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 2px 6px; border-radius: 3px; background: #dcfce7; color: #15803d; font-weight: 700; font-size: .75rem; }
.att-ss-excused   { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 2px 6px; border-radius: 3px; background: #dbeafe; color: #1e40af; font-weight: 700; font-size: .75rem; }
.att-ss-unexcused { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 2px 6px; border-radius: 3px; background: #fee2e2; color: #991b1b; font-weight: 700; font-size: .75rem; }
.att-ss-total { color: var(--gray-600); font-size: .78rem; font-weight: 600; }

/* Week footer (summary + legend) */
.att-week-footer { margin-top: 1rem; }
.att-week-summary { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.5rem; font-size: .875rem; color: var(--gray-600); }
.att-week-summary-sep { width: 1px; height: 16px; background: var(--gray-200); }
.att-summary-filled { color: var(--green-600); }
.att-summary-open { color: var(--gray-500); }
.att-legend-item { display: flex; align-items: center; gap: .35rem; white-space: nowrap; font-size: .8rem; color: var(--gray-600); }
.att-legend-dot { display: inline-block; width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.att-legend-dot--present { background: #dcfce7; border: 1.5px solid #86efac; }
.att-legend-dot--excused { background: #dbeafe; border: 1.5px solid #93c5fd; }
.att-legend-dot--unexcused { background: #fee2e2; border: 1.5px solid #fca5a5; }
.att-form { display: block; margin: 0 0 .3rem; padding: 0; }
.att-form:last-child { margin-bottom: 0; }
.att-form .att-slot { margin-bottom: 0; }

/* ATTENDANCE TILES */
.att-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 1rem; padding: 1.25rem; }
.att-tile { background: var(--white); border: 2px solid var(--gray-200); border-radius: var(--radius); padding: 1.1rem 1rem .75rem; cursor: pointer; user-select: none; transition: border-color .12s, background .12s; position: relative; min-height: 145px; display: flex; flex-direction: column; gap: .3rem; -webkit-tap-highlight-color: transparent; }
.att-tile:hover:not(.att-tile--present) { border-color: var(--gray-400); background: var(--gray-50); }
.att-tile--present { background: var(--green-50); border-color: var(--green-400); }
.att-tile--present:hover { border-color: var(--green-500); }
.att-tile-check { position: absolute; top: .55rem; right: .6rem; width: 22px; height: 22px; border-radius: 50%; background: var(--gray-200); display: flex; align-items: center; justify-content: center; font-size: .72rem; color: transparent; transition: all .12s; flex-shrink: 0; }
.att-tile--present .att-tile-check { background: var(--green-500); color: var(--white); }
.att-tile-name { font-weight: 700; font-size: .95rem; color: var(--gray-900); line-height: 1.25; padding-right: 1.6rem; }
.att-tile-name span { font-weight: 400; }
.att-tile-year { font-size: .72rem; color: var(--gray-400); }
.att-tile input[type="checkbox"] { display: none; }

/* Tile colors */
.att-tile--omluveno   { background: #eff6ff; border-color: var(--blue-500); }
.att-tile--neomluveno { background: var(--red-100); border-color: var(--red-500); }
.att-tile--omluveno:hover   { filter: brightness(.97); }
.att-tile--neomluveno:hover { filter: brightness(.97); }

/* Excuse pill buttons */
.att-tile-excuses { display: flex; gap: .35rem; margin-top: auto; padding-top: .45rem; border-top: 1px solid var(--gray-100); }
.att-tile--present .att-tile-excuses { display: none; }
.att-excuse-btn { flex: 1; border: 1.5px solid var(--gray-200); background: transparent; border-radius: 5px; font-size: .72rem; font-weight: 700; color: var(--gray-400); padding: .5rem .1rem; cursor: pointer; font-family: inherit; transition: all .1s; line-height: 1.2; text-align: center; min-height: 36px; }
.att-excuse-btn:hover { border-color: var(--gray-400); color: var(--gray-600); }
.att-excuse-btn.att-excuse-o.active { background: #dbeafe; border-color: var(--blue-500); color: #1e40af; }

/* Color swatch for admin settings */
.color-swatch { display:inline-block; width:14px; height:14px; border-radius:3px; vertical-align:middle; margin-right:.25rem; border:1px solid rgba(0,0,0,.12); }
.att-excuse-btn.att-excuse-n.active { background: var(--red-100); border-color: var(--red-500); color: #991b1b; }

/* Attendance stats row */
.att-stats-row { display: flex; border-bottom: none; }
.att-stat { flex: 1; text-align: center; padding: .9rem .5rem .75rem; border-right: 1px solid var(--gray-100); }
.att-stat:last-child { border-right: none; }
.att-stat-num { font-family: var(--font-display); font-size: 1.8rem; line-height: 1; color: var(--gray-600); display: block; letter-spacing: .02em; }
.att-stat small { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-400); font-weight: 700; display: block; margin-top: .15rem; }
.att-stat--present   .att-stat-num { color: var(--green-600); }
.att-stat--excused   .att-stat-num { color: var(--blue-500); }
.att-stat--unexcused .att-stat-num { color: var(--red-500); }
.att-stat--absent    .att-stat-num { color: var(--gray-400); }
.att-stat-denom { font-size: 1.1rem; color: var(--gray-300); font-family: var(--font); font-weight: 400; }

/* ČSPS Statistiky */
.csps-pool-btn { background: transparent; border: none; padding: .25rem .65rem; border-radius: 4px; font-size: .8rem; cursor: pointer; color: var(--gray-500); }
.csps-pool-btn.active { background: var(--white); color: var(--gray-800); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.csps-disc-btn { background: var(--gray-100); border: 1px solid var(--gray-200); padding: .2rem .55rem; border-radius: 4px; font-size: .78rem; cursor: pointer; color: var(--gray-600); }
.csps-disc-btn.active { background: var(--green-600); border-color: var(--green-600); color: #fff; font-weight: 600; }
.csps-disc-btn:hover:not(.active) { background: var(--gray-200); }

/* Terminová listina */
.tl-month-row td { background: var(--gray-50); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-500); padding: .45rem 1rem; border-bottom: 1px solid var(--gray-200); }
.tl-elapsed td { opacity: .55; }
.tl-title-link { color: var(--green-700); text-decoration: none; font-weight: 600; }
.tl-title-link:hover { text-decoration: underline; }
.form-control-sm { padding: .3rem .55rem; font-size: .82rem; }

/* Sticky save bar */
.att-save-bar { position: sticky; bottom: 0; background: var(--white); border-top: 1px solid var(--gray-200); padding: .9rem 1.25rem; display: flex; gap: .75rem; align-items: center; z-index: 10; box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
.att-autosave-status { font-size: .85rem; color: var(--gray-400); }
.att-autosave--saving { color: var(--gray-500); }
.att-autosave--saved  { color: var(--green-600); font-weight: 600; }
.att-autosave--error  { color: var(--red-500); font-weight: 600; }

@media (max-width: 640px) {
    .att-tiles { grid-template-columns: repeat(2, 1fr); gap: .65rem; padding: .85rem; }
    .att-tile { min-height: 150px; padding: 1rem .9rem .7rem; }
    .att-tile-name { font-size: 1rem; }
    .att-tile-year { font-size: .75rem; }
    .att-excuse-btn { padding: .55rem .1rem; font-size: .73rem; min-height: 38px; }
    .att-save-bar { padding: .75rem 1rem; }
    .att-slot { padding: .55rem .65rem; }
    .att-time { font-size: .85rem; }
}

/* ══════════════════════════════════════
   RESPONSIVE
   1024px — hamburger drawer (tablety, menší laptopy)
   768px  — card tabulky, kompaktní mobile
   480px  — malé telefony
══════════════════════════════════════ */

/* Hamburger — skrytý na desktopu */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: .35rem .5rem;
    color: var(--white);
    border-radius: 6px;
    transition: background .15s;
    line-height: 1;
}
.navbar-toggle:hover { background: rgba(255,255,255,.1); }

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    z-index: 199;
}

/* Plan grid (detail skupiny) */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }

/* Měsíční kalendář — scroll wrapper */
.cal-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal-wrap-inner { min-width: 560px; }

/* Rychlé akce */
.quick-actions { display: flex; flex-direction: column; gap: .75rem; }

/* Mobilní view docházky — skryto na desktopu */
.att-mobile-view { display: none; }

/* Dashboard — events + quick actions */
.dashboard-grid { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; align-items: start; }

/* ── 1100px: dashboard grid → single column ── */
@media (max-width: 1100px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ── 1024px: hamburger + drawer layout ── */
@media (max-width: 1024px) {

    body { overflow-x: hidden; }

    /* Navbar — jeden řádek: [☰ logo ........... jméno role odhlásit] */
    .navbar {
        height: auto;
        min-height: 56px;
        flex-wrap: nowrap;
        padding: .4rem 1rem;
        gap: .5rem;
    }
    .navbar-brand { flex: 1; min-width: 0; }
    .navbar-toggle { display: flex; align-items: center; flex-shrink: 0; margin-right: .75rem; }
    .navbar--auth .navbar-nav { display: none; }
    .navbar-nav { flex-wrap: wrap; }
    .navbar-user {
        display: flex;
        flex-shrink: 0;
        gap: .4rem;
        align-items: center;
    }
    .navbar-user strong {
        font-size: .8rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 120px;
    }

    /* Sidebar → slide-in drawer (top/height nastavuje JS) */
    .sidebar {
        position: fixed;
        top: 96px;
        left: 0;
        height: calc(100vh - 96px);
        z-index: 200;
        transform: translateX(-260px);
        transition: transform .25s ease;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0,0,0,.15);
    }
    .sidebar.is-open { transform: translateX(0); }
    /* V drawer režimu žádné fixování vnitřku – roluje celý drawer */
    .sidebar-inner { position: static; max-height: none; overflow: visible; display: block; }
    .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity .25s; }
    .sidebar-overlay.is-open { opacity: 1; pointer-events: auto; }

    /* Sidebar drawer — větší dotyková plocha */
    .sidebar { padding: 1rem 0; }
    .sidebar-section { margin-bottom: 1rem; }
    .sidebar-title { padding: 0 1.25rem .35rem; font-size: .7rem; }
    .sidebar-nav a { padding: .8rem 1.25rem; font-size: 1rem; margin: 0; }

    .layout { display: block; padding-left: 0; }
    .main { padding: 1.25rem; overflow-x: hidden; }
    body:has(.sidebar) footer { margin-left: 0; }

    .page-header { flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
    .page-title { font-size: 1.8rem; }
    .form-row { grid-template-columns: 1fr; gap: .75rem; }

    .hero { padding: 3rem 1rem 5rem; }
    .hero-title { font-size: 2.8rem; }
    .hero-actions { flex-direction: column; align-items: center; gap: .75rem; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .card-header { flex-wrap: wrap; gap: .5rem; }
    .public-content { padding: 1.5rem 1rem; }
    .login-card { padding: 2rem 1.5rem; }
    .login-wrap { align-items: flex-start; padding-top: 2rem; }
    .plan-grid { grid-template-columns: 1fr; }

    .week-nav { gap: .35rem; }
    .week-nav__label { font-size: .85rem; order: -1; width: 100%; text-align: center; }

    /* Rychlé akce — tlačítka vedle sebe, větší dotyková plocha */
    .quick-actions { flex-direction: row; flex-wrap: wrap; gap: .65rem; }
    .quick-actions .btn { padding: .7rem 1.1rem; font-size: .95rem; }

    /* Inline 2-column grids → single column on tablet/mobile */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:340px 1fr"],
    [style*="grid-template-columns:280px 1fr"],
    [style*="grid-template-columns:2fr 1fr"],
    [style*="grid-template-columns:1fr 320px"],
    [style*="grid-template-columns:1fr 220px"],
    [style*="grid-template-columns:1fr 400px"] {
        grid-template-columns: 1fr !important;
    }
}

/* ── 768px: card tabulky + kompaktní mobile ── */
@media (max-width: 768px) {

    .main { padding: .875rem; }
    .page-title { font-size: 1.6rem; }

    /* Card transformation pro běžné tabulky */
    .table-wrap:not(.att-week-wrap) { overflow-x: visible; }
    .table-wrap:not(.att-week-wrap) table { display: block; }
    .table-wrap:not(.att-week-wrap) thead  { display: none; }
    .table-wrap:not(.att-week-wrap) tbody  { display: block; }
    .table-wrap:not(.att-week-wrap) tbody tr {
        display: block;
        margin-bottom: .65rem;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        overflow: hidden;
        background: var(--white);
        box-shadow: var(--shadow-sm);
    }
    .table-wrap:not(.att-week-wrap) tbody tr:hover { background: var(--white); }
    .table-wrap:not(.att-week-wrap) tbody td {
        display: flex;
        align-items: flex-start;
        gap: .65rem;
        padding: .5rem .9rem;
        border-bottom: 1px solid var(--gray-100);
        font-size: .875rem;
        border-radius: 0;
    }
    .table-wrap:not(.att-week-wrap) tbody td:last-child { border-bottom: none; }
    .table-wrap:not(.att-week-wrap) tbody td[data-label]::before {
        content: attr(data-label);
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .05em;
        text-transform: uppercase;
        color: var(--gray-400);
        min-width: 82px;
        flex-shrink: 0;
        padding-top: .18rem;
        line-height: 1.5;
    }
    /* Buňky bez popisku a S akčním prvkem (tlačítko/form/select) — doprava, šedý pruh */
    .table-wrap:not(.att-week-wrap) tbody td:not([data-label]):has(.btn, button, form, select) {
        justify-content: flex-end;
        padding: .4rem .75rem;
        background: var(--gray-50);
        flex-wrap: wrap;
        gap: .35rem;
    }
    /* Datové buňky bez popisku (bez akčního prvku) — normální řádek vlevo */
    .table-wrap:not(.att-week-wrap) tbody td:not([data-label]) {
        justify-content: flex-start;
    }

    /* Docházka — denní navigátor */
    .att-week-wrap { overflow-x: visible; }
    .att-week-table { min-width: unset !important; width: 100%; }
    .att-week-table .col-hidden { display: none; }
    .att-mobile-day-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: .6rem 1rem;
        background: var(--gray-50);
        border-bottom: 1px solid var(--gray-200);
        gap: .5rem;
    }
    .att-mobile-day-label {
        font-weight: 600;
        font-size: .9rem;
        color: var(--gray-700);
        text-align: center;
        flex: 1;
    }
    .att-mobile-day-label small {
        display: block;
        font-size: .75rem;
        font-weight: 400;
        color: var(--gray-400);
    }
    .att-group-col, .att-day-col, .att-day-cell { min-width: unset !important; }

    /* Přepnutí desktop ↔ mobilní view docházky */
    .att-desktop-card { display: none; }
    .att-mobile-view  { display: block; }

    /* Group tabs */
    .att-group-tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: .5rem;
        padding: .65rem;
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        margin-bottom: .65rem;
    }
    .att-group-tabs::-webkit-scrollbar { display: none; }
    .att-group-btn {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        gap: .4rem;
        padding: .65rem 1rem;
        border: 1px solid var(--gray-200);
        border-radius: 6px;
        background: var(--white);
        color: var(--gray-700);
        font-size: .9rem;
        font-weight: 500;
        cursor: pointer;
        transition: background .15s, color .15s, border-color .15s;
    }
    .att-group-btn.is-active {
        background: var(--green-600);
        color: var(--white);
        border-color: var(--green-600);
    }
    .att-group-btn-count {
        font-size: .7rem;
        background: rgba(0,0,0,.08);
        border-radius: 999px;
        padding: .05rem .4rem;
        font-weight: 600;
    }
    .att-group-btn.is-active .att-group-btn-count { background: rgba(255,255,255,.25); }

    /* Day cards */
    .att-mob-day {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        margin-bottom: .5rem;
        overflow: hidden;
    }
    .att-mob-day--today { border-color: var(--green-400); }
    .att-mob-day-hd {
        display: flex;
        align-items: center;
        gap: .5rem;
        padding: .6rem .9rem;
        background: var(--gray-50);
        border-bottom: 1px solid var(--gray-100);
    }
    .att-mob-day--today .att-mob-day-hd {
        background: var(--green-50);
        border-bottom-color: var(--green-200);
    }
    .att-mob-day-hd strong { font-size: 1rem; color: var(--gray-800); min-width: 2ch; }
    .att-mob-day-date { font-size: .82rem; color: var(--gray-400); }
    .att-mob-day-slots {
        padding: .5rem .75rem;
        display: flex;
        flex-wrap: wrap;
        gap: .5rem;
        min-height: 2.75rem;
        align-items: flex-start;
    }

    /* Nadcházející události — 2 buňky na řádek (Den+Čas / Skupina+Typ) */
    .table-wrap:not(.att-week-wrap) .events-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .table-wrap:not(.att-week-wrap) .events-table tbody td {
        display: block;
        border-bottom: none;
        padding: .55rem .9rem;
    }
    .table-wrap:not(.att-week-wrap) .events-table tbody td[data-label]::before {
        display: block;
        min-width: unset;
        padding-top: 0;
        margin-bottom: .15rem;
    }
    .table-wrap:not(.att-week-wrap) .events-table tbody td:nth-child(odd) {
        border-right: 1px solid var(--gray-100);
    }
    .table-wrap:not(.att-week-wrap) .events-table tbody td:nth-child(3),
    .table-wrap:not(.att-week-wrap) .events-table tbody td:nth-child(4) {
        border-top: 1px solid var(--gray-100);
    }
}

/* ── 480px: malé telefony ── */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.2rem; }
    .page-title { font-size: 1.4rem; }
    .main { padding: .65rem; }
    .navbar-brand-text { font-size: 1.2rem; }
    .navbar-brand-text span { font-size: .85rem; }
    /* Na malých telefonech schovej jméno — badge + odhlásit zůstanou */
    .navbar-user strong { display: none; }
}

/* Odkaz na přehled verzí (pata sidebaru) – decentní hover */
.version-link { transition: opacity .15s ease; }
.version-link:hover { opacity: .85; }
.version-link:hover .vl-sub { text-decoration: underline; }
