/* ============================================================
   app.css — základní styly pro Sbírka Odznaků
   Funkční design bez externích závislostí (no framework)
   ============================================================ */

/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:   #4A90D9;
    --primary-d: #2f6fa8;
    --success:   #27ae60;
    --danger:    #e74c3c;
    --warning:   #f39c12;
    --info:      #3498db;
    --bg:        #f0f2f5;
    --surface:   #ffffff;
    --border:    #dde1e7;
    --text:      #2c3e50;
    --muted:     #7f8c9a;
    --radius:    8px;
    --shadow:    0 2px 8px rgba(0,0,0,.10);
    --sidebar-w: 220px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-d); }
h1 { font-size: 1.8rem; margin-bottom: .5rem; }
h2 { font-size: 1.35rem; margin-bottom: .4rem; }
h3 { font-size: 1.1rem; margin-bottom: .3rem; }
p  { margin-bottom: .75rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* === Buttons === */
.btn {
    display: inline-block;
    padding: .45rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    background: var(--border);
    color: var(--text);
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn-primary { background: var(--primary);   color: #fff; border-color: var(--primary); }
.btn-success { background: var(--success);   color: #fff; border-color: var(--success); }
.btn-danger  { background: var(--danger);    color: #fff; border-color: var(--danger);  }
.btn-sm      { padding: .25rem .7rem; font-size: .8rem; }
.btn-lg      { padding: .65rem 1.6rem; font-size: 1rem; }

/* === Alerts / Flash messages === */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-left: 4px solid currentColor;
}
.alert-success { background: #eafaf1; color: #1a6e3c; }
.alert-info    { background: #eaf4fb; color: #1a5276; }
.alert-warning { background: #fef9e7; color: #7d5a00; }
.alert-danger, .alert-error { background: #fdf2f0; color: #922b21; }

/* === Forms === */
.form-group { margin-bottom: 1rem; }
label { display: block; font-weight: 500; margin-bottom: .3rem; color: var(--text); }
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], textarea, select {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74,144,217,.15);
}
textarea { min-height: 100px; resize: vertical; }
.error { color: var(--danger); font-size: .85rem; margin-top: .25rem; }

/* Nette form error */
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }

/* === Container === */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* === Cards === */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* === Table === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.data-table th, .data-table td {
    padding: .65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th { background: #f7f8fa; font-weight: 600; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fbfd; }

/* === Stats grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-card h3 { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .4rem; }
.stat-number { font-size: 2.2rem; font-weight: 700; color: var(--primary); display: block; }
.stat-card--warning .stat-number { color: var(--warning); }
.stat-card--success .stat-number { color: var(--success); }

/* === Badge card === */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.badge-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: transform .15s, box-shadow .15s;
}
.badge-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.badge-card--earned { border-color: #FFD700; background: #fffdf0; }
.badge-card__icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; color: #fff;
    margin: 0 auto .5rem;
    background: var(--primary);
}
.badge-card__name { font-weight: 600; font-size: .9rem; }
.badge-card__date { font-size: .78rem; color: var(--muted); display: block; margin-top: .25rem; }
.badge-card__reason { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.badge-card__actions { margin-top: .5rem; display: flex; gap: .4rem; justify-content: center; }

/* === Theme card === */
.theme-card--hidden { display: none !important; }

.theme-card__header {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex: 1;
    flex-wrap: wrap;
}
.theme-card__header h3 { margin: 0; flex: 1; }

.theme-status-badge {
    font-size: .75rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 99px;
    white-space: nowrap;
}
.theme-status-badge--active   { background: #d1fae5; color: #065f46; }
.theme-status-badge--draft    { background: #f3f4f6; color: #6b7280; }
.theme-status-badge--archived { background: #fee2e2; color: #991b1b; }

.theme-deadline { font-size: .82rem; color: var(--muted); margin: .25rem 0 0; }

.themes-archived-toggle {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    cursor: pointer;
    color: var(--muted);
    white-space: nowrap;
}
.themes-archived-toggle input { cursor: pointer; accent-color: var(--primary); }

.page-header__right { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

.theme-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    margin-bottom: .75rem;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.theme-card--draft    { border-left-color: var(--muted); }
.theme-card--active   { border-left-color: var(--success); }
.theme-card--archived { border-left-color: var(--border); opacity: .7; }
.theme-card h3 { margin: 0; flex: 1; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.theme-card--grid { flex-direction: column; align-items: flex-start; }

/* === Status badges === */
.status-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.status-badge--draft    { background: #eee;    color: var(--muted); }
.status-badge--active   { background: #eafaf1; color: var(--success); }
.status-badge--archived { background: #f0f0f0; color: #999; }
.badge-status { font-size: .78rem; color: var(--muted); }

/* === Review bulk toolbar === */
.review-bulk-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    padding: .65rem 1rem;
    box-shadow: var(--shadow);
    margin-bottom: .85rem;
}
.review-bulk-bar__filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    flex: 1;
}
.review-bulk-bar__label {
    font-size: .82rem;
    color: var(--muted);
    white-space: nowrap;
    margin-right: .25rem;
}
.review-no-results {
    text-align: center;
    color: var(--muted);
    padding: 1rem 0;
}

/* === Submission card === */
.submission-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    margin-bottom: .75rem;
    border-left: 4px solid var(--warning);
}
.submission-card:has(.submission-checkbox:checked) {
    border-left-color: var(--success);
    background: color-mix(in srgb, var(--success) 6%, var(--surface));
}
.submission-checkbox-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: .25rem;
}
.submission-checkbox {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    accent-color: var(--success);
}
.submission-info { flex: 1; }
.submission-info time { display: block; font-size: .82rem; color: var(--muted); }
.submission-actions { display: flex; gap: .5rem; }
.submission-queue { margin-top: 1rem; }

/* === Task list === */
.task-list { margin-top: 1rem; }
.task-item {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--border);
}
.task-item--online   { border-left-color: var(--primary); }
.task-item--personal { border-left-color: var(--warning); }
.task-item__header   { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .4rem; }
.task-item__name     { font-weight: 600; }
.task-type-badge {
    font-size: .75rem; padding: .1rem .45rem;
    border-radius: 20px; background: #eaf4fb; color: var(--info);
    white-space: nowrap;
}
.task-item--personal .task-type-badge { background: #fef9e7; color: var(--warning); }
.submission-status {
    margin-left: auto; font-size: .8rem; font-weight: 600; padding: .15rem .5rem;
    border-radius: 20px;
}
.submission-status--approved { background: #eafaf1; color: var(--success); }
.submission-status--submitted { background: #eaf4fb; color: var(--info); }
.submission-status--rejected  { background: #fdf2f0; color: var(--danger); }

/* === Progress bar === */
.progress-bar { height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; margin-bottom: .25rem; }
.progress-bar__fill { height: 100%; background: var(--success); border-radius: 4px; transition: width .3s; }
.theme-progress { margin: .5rem 0; font-size: .85rem; color: var(--muted); }

/* === Page header === */
.page-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; flex: 1; }

/* === Filter tabs === */
.filter-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-tabs .tab {
    padding: .35rem .9rem; border-radius: 20px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: .85rem; color: var(--muted); transition: all .15s;
}
.filter-tabs .tab:hover, .filter-tabs .tab.active {
    background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none;
}

/* === Empty state === */
.empty-state, .empty-collection {
    text-align: center; padding: 3rem 1rem; color: var(--muted);
}
.empty-state p, .empty-collection p { font-size: 1.05rem; margin-bottom: 1rem; }
.badge-grid__empty { grid-column: 1/-1; text-align: center; padding: 2rem; color: var(--muted); }

/* === Child card === */
.child-card {
    background: var(--surface); border-radius: var(--radius);
    padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem;
}

/* === Proof preview === */
.proof-preview { margin: 1rem 0; }
.proof-preview img { max-width: 100%; max-height: 400px; border-radius: var(--radius); box-shadow: var(--shadow); }

/* === Blockquote === */
blockquote {
    border-left: 3px solid var(--primary);
    padding: .5rem 1rem; margin: 1rem 0;
    background: #f7f9fc; border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--muted);
}

/* === Student ranking === */
.student-ranking { list-style: none; margin-top: .5rem; }
.student-ranking li {
    display: flex; align-items: center; gap: .75rem;
    padding: .5rem .75rem; background: var(--surface);
    border-radius: var(--radius); margin-bottom: .4rem; box-shadow: var(--shadow);
}
.rank { font-size: 1.1rem; font-weight: 700; color: var(--primary); min-width: 2rem; }
.complexity { margin-left: auto; font-size: .85rem; color: var(--muted); }

/* ============================================================
   FRONT LAYOUT
   ============================================================ */
.front-layout .navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .75rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.front-layout .navbar-brand { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.front-layout .navbar-nav { margin-left: auto; display: flex; gap: 1rem; }
.front-layout main.container { padding-top: 2.5rem; padding-bottom: 3rem; }

.hero { text-align: center; padding: 3rem 1rem 2rem; }
.hero h1 { font-size: 2.5rem; margin-bottom: .75rem; }
.hero .lead { font-size: 1.15rem; color: var(--muted); margin-bottom: 1.5rem; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.feature-card { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); text-align: center; }
.feature-card h3 { margin-bottom: .5rem; }

.footer { border-top: 1px solid var(--border); text-align: center; padding: 1.25rem; color: var(--muted); font-size: .85rem; margin-top: 3rem; }

/* Auth */
.auth-container { max-width: 400px; margin: 3rem auto; background: var(--surface); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-container h1 { margin-bottom: 1.5rem; }

/* ============================================================
   SIDEBAR LAYOUTS (Admin / Teacher)
   ============================================================ */
.admin-layout, .teacher-layout {
    display: flex; min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: #1e2535;
    color: #c5cde8;
    display: flex; flex-direction: column;
    flex-shrink: 0;
    position: fixed; top: 0; left: 0; height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    padding: 1.25rem 1rem;
    font-weight: 700; font-size: 1rem;
    color: #fff; border-bottom: 1px solid #2d3551;
}
.sidebar-nav { flex: 1; padding: .5rem 0; }
.sidebar-nav .nav-link {
    display: block; padding: .6rem 1.2rem;
    color: #9aa4c0; font-size: .9rem;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link.active {
    background: #2d3551; color: #fff; text-decoration: none;
    border-left-color: var(--primary);
}
.sidebar-footer { padding: .75rem 1rem; border-top: 1px solid #2d3551; font-size: .85rem; }
.sidebar-footer a { color: #9aa4c0; }

.admin-main, .teacher-main {
    margin-left: var(--sidebar-w);
    flex: 1; display: flex; flex-direction: column; min-width: 0;
}
.admin-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: .75rem 1.5rem; display: flex; align-items: center; justify-content: flex-end; font-size: .9rem; color: var(--muted); box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.admin-content, .page-content { padding: 1.5rem; }

/* ============================================================
   STUDENT LAYOUT
   ============================================================ */
.student-layout { display: flex; flex-direction: column; min-height: 100vh; }

.student-header {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.student-header .header-brand { font-weight: 700; font-size: 1rem; color: var(--text); }
.header-nav { display: flex; gap: 1rem; }
.header-nav a { font-size: .9rem; color: var(--muted); }
.header-nav a:hover { color: var(--primary); }
.header-user { margin-left: auto; font-size: .88rem; color: var(--muted); display: flex; gap: .75rem; align-items: center; }
.student-main { padding: 1.5rem; flex: 1; max-width: 1000px; width: 100%; margin: 0 auto; }

.recent-badges, .my-themes, .recent-activity, .available-themes { margin-top: 1.75rem; }
.badge-strip { display: flex; gap: .75rem; flex-wrap: wrap; margin: .75rem 0; }
.badge-mini { background: var(--surface); border-radius: var(--radius); padding: .4rem .75rem; box-shadow: var(--shadow); font-size: .85rem; font-weight: 600; border: 1px solid #FFD700; }
.theme-mini { display: flex; align-items: center; gap: 1rem; background: var(--surface); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .5rem; box-shadow: var(--shadow); }
.theme-mini strong { flex: 1; }

/* ============================================================
   PARENT LAYOUT
   ============================================================ */
.parent-layout { display: flex; flex-direction: column; min-height: 100vh; }
.parent-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1.5rem; }
.parent-header .header-brand { font-weight: 700; color: var(--text); }
.parent-main { padding: 1.5rem; max-width: 900px; margin: 0 auto; width: 100%; }

/* ============================================================
   ENROLL BANNER
   ============================================================ */
.enroll-banner {
    background: linear-gradient(135deg, #eaf4fb, #dbeeff);
    border: 1px solid #b8d8f7;
    border-radius: var(--radius); padding: 1.25rem 1.5rem;
    margin: 1rem 0; text-align: center;
}
.enroll-banner p { margin-bottom: .75rem; color: var(--text); font-size: 1rem; }

/* === Notification panel === */
.notification-panel { position: relative; }
.notification-bell { background: none; border: none; cursor: pointer; font-size: 1.1rem; position: relative; }
.notification-badge {
    position: absolute; top: -6px; right: -8px;
    background: var(--danger); color: #fff;
    border-radius: 50%; font-size: .65rem; width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}

/* === Weekly summary === */
.weekly-summary { background: linear-gradient(135deg, #eafaf1, #d5f0e3); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }

/* === Review actions === */
.review-actions { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-top: 1.5rem; }
.reject-form { flex: 1; min-width: 280px; }

/* === Analytics === */
.class-filter { margin-bottom: 1.5rem; display: flex; align-items: center; gap: .75rem; }
.class-filter select { max-width: 250px; }
.chart-container { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.chart-title { margin-bottom: 1rem; }

/* === Form with preview === */
.form-with-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .form-with-preview { grid-template-columns: 1fr; } }
#badge-preview { min-height: 120px; }

/* === Upload dropzone === */
.file-upload-control .upload-dropzone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 2rem; text-align: center; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.file-upload-control .upload-dropzone:hover { border-color: var(--primary); background: #f0f7ff; }
.upload-dropzone__icon { font-size: 2rem; display: block; margin-bottom: .5rem; }

/* === Add task section === */
.add-task { background: #f7f9fb; border-radius: var(--radius); padding: 1.1rem; margin-top: 1.25rem; }
.enrolled-students { margin-top: 1.75rem; }
.theme-tasks { margin-top: 1.25rem; }

/* === Misc === */
.deadline { color: var(--warning); font-size: .85rem; }
.personal-task-info { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.badge-count { background: var(--primary); color: #fff; border-radius: 20px; padding: .15rem .65rem; font-size: .82rem; font-weight: 600; }
.link-small { font-size: .82rem; }
.section-title { margin-bottom: 1rem; margin-top: 1.5rem; }
.students-in-class { margin-top: 1.75rem; }
.manual-award { margin-top: 1.75rem; }

/* === Earned badges panel (Review/detail) === */
.earned-badges-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.earned-badges-panel__title {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .85rem;
    font-size: 1.05rem;
}
.earned-badges-panel__count {
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    padding: .1rem .6rem;
    font-size: .8rem;
    font-weight: 600;
}
.earned-badges-panel__empty { color: var(--muted); font-size: .9rem; }
.earned-badges-panel__list {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}
.earned-badge {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: #f7f9fb;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .5rem .85rem .5rem .55rem;
}
.earned-badge__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.earned-badge__icon img { width: 100%; height: 100%; object-fit: cover; }
.earned-badge__info { display: flex; flex-direction: column; }
.earned-badge__name { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.earned-badge__date { font-size: .78rem; color: var(--muted); }

/* === Theme detail full-width box === */
.theme-detail-box {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem 2rem;
    width: 100%;
}
.theme-detail-box__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.theme-detail-box__header h1 { margin: 0; flex: 1; }
.theme-detail-box__description { color: var(--muted); margin-bottom: 1.25rem; }

/* === Earned badges in theme detail === */
.theme-earned-badges {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.theme-earned-badges h2 { margin-bottom: .75rem; }
.theme-earned-badges__list { display: flex; flex-wrap: wrap; gap: .6rem; }
.badge-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
    overflow: hidden;
    cursor: default;
    flex-shrink: 0;
}
.badge-circle img { width: 100%; height: 100%; object-fit: cover; }
.badge-circle--sm { width: 28px; height: 28px; font-size: .85rem; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.badge-circle--lg { width: 60px; height: 60px; font-size: 1.6rem; box-shadow: 0 3px 10px rgba(0,0,0,.22); }

/* === Theme card badges strip === */
.theme-card__badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 .25rem; }

/* === Badge category tag (teacher edit page) === */
.badge-category-tag {
    display: inline-block;
    padding: .25rem .7rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}
.badge-category-tag--legendary { background: #fff8e1; border-color: #f4c430; color: #7a6000; }
.badge-category-tag--peer      { background: #e8f4fd; border-color: #3498db; color: #1a5276; }
.badge-category-tag--achievement { background: #eafaf1; border-color: #27ae60; color: #1a6035; }

/* === Achievement rules form === */
.achievement-rules { background: #eafaf1; padding: 1.25rem; border-radius: 8px; margin-top: 1rem; }
.achievement-rules h2 { margin-bottom: .5rem; }
.achievement-rules__info { color: var(--muted); margin-bottom: 1rem; }

/* === Peer info box === */
.peer-info { background: #e8f4fd; padding: 1.25rem; border-radius: 8px; margin-top: 1rem; }
.peer-info h2 { margin-bottom: .5rem; }

/* === Nominations page === */
.nominations-page { max-width: 760px; margin: 0 auto; }
.nominations-page h1 { margin-bottom: 1.5rem; }

.nomination-form-section { background: var(--surface); padding: 1.5rem; border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.07); margin-bottom: 2rem; }
.nomination-form-section h2 { margin-bottom: 1rem; }

/* Nomination card — voting list */
.nomination-list { display: flex; flex-direction: column; gap: .85rem; }
.nomination-card {
    display: grid;
    grid-template-columns: 60px 1fr 120px;
    gap: 1rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.2rem;
}
.nomination-card--votable { border-color: var(--primary); }
.nomination-card__badge { justify-self: center; }
.nomination-card__title { font-size: .95rem; margin-bottom: .25rem; }
.nomination-card__reason { color: var(--muted); font-style: italic; font-size: .85rem; margin: .25rem 0; }
.nomination-card__meta { font-size: .78rem; color: var(--muted); }
.nomination-card__vote { text-align: center; }

/* Vote count display */
.vote-count { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.vote-count__current { color: var(--primary); font-size: 1.2rem; }
.vote-count__divider, .vote-count__required { color: var(--muted); }
.vote-count__label { font-size: .75rem; color: var(--muted); display: block; font-weight: 400; }

/* Vote progress bar */
.vote-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-bottom: .6rem; }
.vote-bar__fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s ease; }

.vote-btn { width: 100%; }
.vote-done { font-size: .8rem; color: var(--muted); }

/* badge-circle--md size */
.badge-circle--md { width: 44px; height: 44px; font-size: 1.2rem; }

/* My nominations section */
.my-nominations { margin-top: 2rem; }
.my-nominations h2 { margin-bottom: 1rem; }
.table--compact td, .table--compact th { padding: .45rem .75rem; }

/* Peer CTA on theme detail */
.peer-nominations-cta { margin: 1rem 0; }

/* Page header row (title + action button inline) */
.page-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header-row h1 { margin: 0; }

/* Nominations table (teacher review) */
.nominations-table th, .nominations-table td { padding: .5rem .75rem; }
.nomination-row--awarded { background: #f0fff4; }
.nomination-row--rejected { background: #fff5f5; opacity: .7; }
.nominations-info { color: var(--muted); margin-bottom: 1.5rem; }

/* Back button */
.btn-back { display: inline-block; margin-bottom: 1rem; color: var(--primary); text-decoration: none; font-size: .9rem; }
.btn-back:hover { text-decoration: underline; }

/* ============================================================
   Sbírka odznaků — tabulkový view s filtry
   ============================================================ */

/* Toolbar: filtry vlevo, řazení vpravo */
.collection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

/* Filtrovací tlačítka */
.collection-filters { display: flex; gap: .4rem; flex-wrap: wrap; }

.filter-btn {
    display: inline-block;
    padding: .35rem .85rem;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s, background .15s, color .15s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn--active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Barvy per kategorie */
.filter-btn--standard  { border-color: #f39c12; }
.filter-btn--standard.filter-btn--active  { background: #f39c12; border-color: #f39c12; color: #fff; }
.filter-btn--legendary { border-color: #9b59b6; }
.filter-btn--legendary.filter-btn--active { background: #9b59b6; border-color: #9b59b6; color: #fff; }
.filter-btn--peer      { border-color: #27ae60; }
.filter-btn--peer.filter-btn--active      { background: #27ae60; border-color: #27ae60; color: #fff; }
.filter-btn--achievement { border-color: #e74c3c; }
.filter-btn--achievement.filter-btn--active { background: #e74c3c; border-color: #e74c3c; color: #fff; }

/* Řazení */
.collection-sort { display: flex; gap: .4rem; }

.sort-btn {
    display: inline-block;
    padding: .35rem .8rem;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    transition: background .15s, color .15s;
}
.sort-btn:hover { background: var(--bg); color: var(--text); }
.sort-btn--active { background: var(--bg); border-color: var(--primary); color: var(--primary); }

/* Tabulka */
.collection-table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.collection-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.collection-table thead {
    background: var(--bg);
    border-bottom: 2px solid var(--border);
}
.collection-table th {
    padding: .7rem 1rem;
    text-align: left;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}
.collection-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.collection-table tbody tr:last-child td { border-bottom: none; }
.collection-table tbody tr:hover { background: #f8f9fb; }

/* Odkaz řazení v hlavičce */
.sort-link { color: var(--muted); text-decoration: none; font-weight: 700; }
.sort-link:hover { color: var(--primary); }

/* Badge cell — ikona + text */
.badge-cell { display: flex; align-items: center; gap: .85rem; }
.badge-cell__text { display: flex; flex-direction: column; gap: .15rem; }
.badge-cell__name { font-weight: 700; font-size: .95rem; }
.badge-cell__desc { font-size: .78rem; color: var(--muted); }
.badge-cell__reason { font-size: .78rem; color: var(--muted); font-style: italic; }

/* badge-circle--sm */
.badge-circle--sm { width: 36px; height: 36px; font-size: 1rem; flex-shrink: 0; }

/* Body */
.points-badge {
    display: inline-block;
    background: #fff9e6;
    color: #c07000;
    border: 1px solid #f0cc60;
    border-radius: 12px;
    padding: .2rem .6rem;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Zdroj */
.source-tag {
    display: inline-block;
    border-radius: 12px;
    padding: .2rem .6rem;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}
.source-tag--peer    { background: #eaf7ee; color: #1e7e34; }
.source-tag--task    { background: #e8f4fd; color: #1a5276; }
.source-tag--manual  { background: #f5eef8; color: #6c3483; }

/* Prázdný stav v tabulce */
.empty-collection-row {
    text-align: center;
    color: var(--muted);
    padding: 2.5rem 1rem !important;
    font-size: .95rem;
}
.empty-collection-row a { margin-left: .5rem; }

/* Téma v tabulce sbírky */
.theme-link { color: var(--primary); text-decoration: none; font-size: .82rem; white-space: nowrap; }
.theme-link:hover { text-decoration: underline; }
.col-theme { max-width: 180px; }

/* ============================================================
   Souhrnná tabulka odznaků (badge-summary)
   ============================================================ */
.badge-summary-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.badge-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-row {
    border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-row:hover { background: #f8f9fb; }

.summary-name {
    padding: .6rem 1rem;
    font-size: .88rem;
    font-weight: 600;
    white-space: nowrap;
    width: 220px;
    vertical-align: middle;
}

.summary-circles {
    padding: .5rem .5rem;
    vertical-align: middle;
}

.summary-circles .badge-circle--xs {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 3px;
}

.summary-count {
    padding: .5rem 1rem .5rem .25rem;
    text-align: right;
    font-size: .85rem;
    color: var(--muted);
    white-space: nowrap;
    vertical-align: middle;
}

/* XS kolečko — 26 × 26 px */
.badge-circle--xs {
    width: 26px;
    height: 26px;
    font-size: .7rem;
}

/* "+X" přesah */
.summary-extra {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 0 .5rem;
    font-size: .75rem;
    font-weight: 700;
    color: var(--muted);
    height: 26px;
    margin-left: 2px;
}

/* ============================================================
   Teacher — seznam žáků (StudentCollection)
   ============================================================ */
.student-list-table { width: 100%; }
.student-list-table th, .student-list-table td { padding: .7rem 1rem; vertical-align: middle; }
.student-list-row:hover { background: #f8f9fb; }

.student-list-name {
    display: flex;
    align-items: center;
    gap: .85rem;
}
.student-email { display: block; font-size: .78rem; color: var(--muted); }

/* Avatar — kruh s iniciálami */
.student-avatar {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: .03em;
}
.student-avatar--lg { width: 52px; height: 52px; font-size: 1.1rem; }

/* Hlavička detailu žáka */
.student-header { display: flex; align-items: center; gap: 1rem; }
.student-header h1 { margin: 0; }

/* Statistické pills v tabulce */
.stat-pill {
    display: inline-block;
    padding: .25rem .7rem;
    border-radius: 12px;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
}
.stat-pill--badges { background: #e8f4fd; color: #1a5276; }
.stat-pill--points { background: #fff9e6; color: #c07000; }

.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ============================================================
   Teacher — průměr třídy (StudentCollection/default)
   ============================================================ */

/* Summary bar nad tabulkou */
.class-avg-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #f0f4ff;
    border: 1px solid #d0d9f5;
    border-radius: 10px;
    padding: .6rem 1.1rem;
    margin-bottom: 1rem;
    font-size: .88rem;
    flex-wrap: wrap;
}
.class-avg-label {
    font-weight: 700;
    color: #3a4a8a;
    margin-right: .25rem;
}
.class-avg-stat {
    font-weight: 600;
    color: #2c3e50;
}
.class-avg-stat--badges { color: #1a5276; }
.class-avg-stat--points { color: #c07000; }
.class-avg-sep { color: var(--muted); }
.class-avg-count { color: var(--muted); font-size: .82rem; margin-left: auto; }

/* Delta indikátor u každého žáka */
.avg-delta {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 10px;
    margin-left: .35rem;
    white-space: nowrap;
    vertical-align: middle;
}
.avg-delta--above { background: #e6f9ef; color: #1a7a42; }
.avg-delta--below { background: #fdecea; color: #a93226; }
.avg-delta--neutral { background: #f2f3f4; color: #7f8c8d; letter-spacing: .03em; }

/* Řádek průměru v tfoot tabulky */
.student-list-avg-row {
    border-top: 2px solid #dde3f0;
    background: #f7f9ff;
}
.student-list-avg-row td { padding: .65rem 1rem; }
.avg-row-label {
    font-weight: 700;
    color: #3a4a8a;
    font-size: .88rem;
}
.stat-pill--avg {
    background: #eaedf8;
    color: #3a4a8a;
}

/* ============================================================
   Summary tabulka — verze s průměrem třídy (Teacher/detail)
   ============================================================ */

/* Rozšíření tabulky o nové sloupce */
.badge-summary-table--with-avg { width: 100%; }

.summary-thead th {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    padding: .35rem .6rem .45rem;
    border-bottom: 1px solid #e8eaf0;
}
.summary-col-header { text-align: center; white-space: nowrap; }

/* Průměr třídy — pill */
.class-avg-pill {
    display: inline-block;
    background: #eaecf5;
    color: #3a4a8a;
    border-radius: 10px;
    padding: .2rem .55rem;
    font-size: .8rem;
    font-weight: 700;
}

/* Delta tagy */
.summary-delta { text-align: center; white-space: nowrap; }
.summary-delta-tag {
    display: inline-block;
    border-radius: 10px;
    padding: .2rem .55rem;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}
.summary-delta-tag--above   { background: #e6f9ef; color: #1a7a42; }
.summary-delta-tag--below   { background: #fdecea; color: #a93226; }
.summary-delta-tag--neutral { background: #f2f3f4; color: #7f8c8d; }

/* Zarovnání číselných/indikátorových sloupců na střed */
.badge-summary-table--with-avg .summary-count,
.badge-summary-table--with-avg .summary-class-avg,
.badge-summary-table--with-avg .summary-circles { text-align: center; }

/* ============================================================
   Breadcrumbs — sdílené pro Student i Teacher modul
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .84rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb__sep { color: #c8cdd5; font-size: .9em; }
.breadcrumb__current { color: #2c3e50; font-weight: 600; }

/* ============================================================
   Teacher — sekce ručního udělení odznaku (Themes/detail)
   ============================================================ */
.manual-award {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e8eaf0;
}
.manual-award h2 { margin-bottom: 1rem; }
.manual-award__form {
    background: #f8f9fb;
    border: 1px solid #e2e6ee;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    max-width: 520px;
}

/* ============================================================
   Oblíbené odznaky — Badges/default (save) + Dashboard (quick award)
   ============================================================ */

/* Tlačítko hvězdičky na kartě odznaku */
.btn-fav {
    background: #fffbe6;
    border: 1px solid #f5c518;
    color: #c07000;
    font-size: .9rem;
}
.btn-fav:hover { background: #f5c518; color: #fff; }

/* Zvýraznění aktivní karty (po kliknutí na ⭐) */
.badge-card--selected {
    outline: 2px solid #f5c518;
    outline-offset: 2px;
}

/* Sekce pro uložení oblíbeného (Badges/default) */
.fav-save-section {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 2px solid #f5c518;
}
.fav-save-section h2 { margin-bottom: .4rem; }
.fav-save-section__hint {
    color: var(--muted);
    font-size: .88rem;
    margin-bottom: 1rem;
}
.fav-save-section__form {
    background: #fffbe6;
    border: 1px solid #f5e07a;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    max-width: 520px;
}

/* Dashboard — sekce oblíbených */
.fav-dashboard-section { margin-top: 2rem; }
.fav-dashboard-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.fav-dashboard-section__header h2 { margin: 0; }

/* Empty state */
.fav-empty-state {
    background: #f9f9fb;
    border: 1px dashed #ccc;
    border-radius: 10px;
    padding: 1.5rem;
    color: var(--muted);
    font-size: .92rem;
}
.fav-empty-state a { color: var(--primary); }

/* Řada karet oblíbených */
.fav-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Karta oblíbeného odznaku */
.fav-card {
    background: #fff;
    border: 1px solid #e2e6ee;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.fav-card__header {
    display: flex;
    align-items: center;
    gap: .7rem;
}
.fav-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.fav-card__name {
    font-size: .92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fav-card__remove {
    color: #bbb;
    font-size: 1.2rem;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}
.fav-card__remove:hover { color: #e74c3c; }

.fav-card__note {
    font-size: .8rem;
    color: var(--muted);
    font-style: italic;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Formulář rychlého udělení uvnitř karty */
.fav-card__form {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: auto;
}
.fav-card__select {
    width: 100%;
    padding: .35rem .55rem;
    border: 1px solid #d0d5df;
    border-radius: 6px;
    font-size: .84rem;
    background: #f8f9fb;
}
.fav-card__submit { width: 100%; justify-content: center; }

/* ==========================================================================
   Dashboard — nový design oblíbených (letter-nav + multiselect + badge grid)
   ========================================================================== */

/* Letter navigation — iPad-friendly */
.fav-letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.1rem;
}
.fav-letter-btn {
    padding: .55rem 1.05rem;
    min-width: 2.8rem;
    text-align: center;
    border: 1px solid #d0d5df;
    border-radius: 8px;
    background: #f4f6fa;
    color: var(--text);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    line-height: 1.5;
}
.fav-letter-btn:hover {
    background: #e8eaf0;
    border-color: #b0b8cc;
}
.fav-letter-btn--active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Header nad student listem — tlačítko Vybrat vše */
.fav-student-list-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .4rem;
}

/* Student multiselect list — iPad-friendly */
.fav-student-list {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: .85rem;
}
.fav-student-pill {
    padding: .55rem 1.2rem;
    border: 1.5px solid #d0d5df;
    border-radius: 22px;
    background: #fff;
    color: var(--text);
    font-size: .92rem;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    user-select: none;
    line-height: 1.5;
}
.fav-student-pill:hover {
    background: #f0f4ff;
    border-color: var(--primary);
}
.fav-student-pill--selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}
.fav-student-pill--selected:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Selection hint */
.fav-selection-hint {
    font-size: .82rem;
    color: var(--muted);
    margin: 0 0 1.3rem 0;
    transition: color .2s;
}
.fav-selection-hint--active {
    color: var(--primary);
    font-weight: 600;
}

/* Badge tile grid — vedle sebe, iPad-friendly */
.fav-badge-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}
.fav-badge-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1rem .9rem .85rem;
    width: 130px;
    flex-shrink: 0;
    background: #fff;
    border: 1.5px solid #e2e6ee;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .1s;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.fav-badge-tile:hover {
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(59,130,246,.18);
    transform: translateY(-2px);
}
.fav-badge-tile:active {
    transform: translateY(0);
}
.fav-badge-tile__circle {
    pointer-events: none;
}
.fav-badge-tile__name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    word-break: break-word;
    pointer-events: none;
}
.fav-badge-tile__remove {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 1rem;
    color: #ccc;
    text-decoration: none;
    line-height: 1;
    z-index: 2;
    transition: color .15s;
}
.fav-badge-tile__remove:hover { color: #e74c3c; }

/* ==========================================================================
   Vzorová fotka úkolu — srovnání s důkazem žáka (Review/detail)
   ========================================================================== */

/* Srovnávací panel — vedle sebe, nebo single (jen jedno z fotek) */
.proof-comparison {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
    margin: 1.2rem 0 1.5rem;
}
.proof-comparison--single {
    /* single foto — nepotřebuje flex, jen blok */
    display: block;
}

/* Jeden panel (vzor nebo důkaz) */
.proof-panel {
    flex: 1 1 280px;
    min-width: 220px;
    max-width: 480px;
    background: #f8f9fb;
    border: 1px solid #e2e6ee;
    border-radius: 10px;
    overflow: hidden;
}
.proof-panel--task {
    border-color: #b8d4f8;
    background: #f0f6ff;
}
.proof-panel--student {
    border-color: #b8ddb8;
    background: #f0fff0;
}
.proof-panel__label {
    padding: .55rem .9rem;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid #e2e6ee;
}
.proof-panel--task .proof-panel__label { color: #2563eb; border-color: #b8d4f8; }
.proof-panel--student .proof-panel__label { color: #16a34a; border-color: #b8ddb8; }
.proof-panel img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    background: #fff;
}

/* Miniatury ve výpisu úkolů tématu */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}
.task-item__thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e6ee;
    flex-shrink: 0;
    margin-top: .15rem;
}

/* Aktuální vzorová fotka na stránce editace úkolu */
.task-current-image {
    margin-bottom: 1.2rem;
    display: inline-block;
}
.task-current-image__label {
    font-weight: 600;
    margin-bottom: .4rem;
    font-size: .9rem;
}
.task-current-image__img {
    display: block;
    max-width: 260px;
    max-height: 200px;
    object-fit: contain;
    border: 1px solid #e2e6ee;
    border-radius: 8px;
    background: #f8f9fb;
    padding: 4px;
}
.task-current-image__hint { margin-top: .35rem; font-size: .8rem; }

/* ==========================================================================
   Karta hodiny — Student Dashboard (3 sekce)
   ========================================================================== */

.lesson-card-header {
    margin-bottom: 1.5rem;
}
.lesson-card-header h1 {
    margin: 0;
    font-size: 1.6rem;
}

/* Sekce karty hodiny */
.lesson-section {
    background: #fff;
    border: 1px solid #e2e6ee;
    border-radius: 14px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

/* Barevné levé okraje podle sekce */
.lesson-section--intro   { border-left: 4px solid #60a5fa; }
.lesson-section--content { border-left: 4px solid #34d399; }
.lesson-section--outro   { border-left: 4px solid #f59e0b; }

/* Nadpis sekce */
.lesson-section__title {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0;
    padding: .9rem 1.1rem;
    font-size: 1.05rem;
    font-weight: 700;
    background: #f8f9fb;
    border-bottom: 1px solid #e2e6ee;
}
.lesson-section--intro   .lesson-section__title { background: #eff6ff; border-color: #bfdbfe; }
.lesson-section--content .lesson-section__title { background: #f0fdf4; border-color: #bbf7d0; }
.lesson-section--outro   .lesson-section__title { background: #fffbeb; border-color: #fde68a; }

/* Číslo sekce */
.lesson-section__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    font-size: .82rem;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}
.lesson-section--intro   .lesson-section__num { background: #60a5fa; }
.lesson-section--content .lesson-section__num { background: #34d399; }
.lesson-section--outro   .lesson-section__num { background: #f59e0b; }

/* Tělo sekce */
.lesson-section__body {
    padding: 1rem 1.1rem;
}
.lesson-section__body--empty {
    min-height: 3.5rem;
    color: var(--muted);
    font-size: .88rem;
    font-style: italic;
}

/* Prázdný stav */
.lesson-empty {
    color: var(--muted);
    font-size: .9rem;
    margin: 0;
    padding: .5rem 0;
}
.lesson-empty--sm { font-size: .82rem; padding: .25rem 0 .25rem 1rem; }

/* Téma v sekci náplně hodiny */
.lesson-theme {
    margin-bottom: 1.1rem;
}
.lesson-theme:last-child { margin-bottom: 0; }

.lesson-theme__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.lesson-theme__name {
    font-size: .98rem;
    font-weight: 700;
    margin: 0;
}
.lesson-theme__name a {
    color: var(--text);
    text-decoration: none;
}
.lesson-theme__name a:hover { color: var(--primary); text-decoration: underline; }
.lesson-theme__deadline {
    font-size: .78rem;
    color: var(--muted);
    background: #fff3cd;
    border-radius: 4px;
    padding: .15rem .45rem;
}

/* Seznam úkolů */
.lesson-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.lesson-task {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .65rem;
    border-radius: 8px;
    background: #f8f9fb;
    border: 1px solid #eaedf3;
    font-size: .88rem;
    transition: background .15s;
}
.lesson-task--done    { background: #f0fdf4; border-color: #bbf7d0; }
.lesson-task--pending { background: #fffbeb; border-color: #fde68a; }
.lesson-task--rejected{ background: #fff5f5; border-color: #fecaca; }

.lesson-task__status {
    font-size: 1rem;
    flex-shrink: 0;
    width: 1.3rem;
    text-align: center;
}
.lesson-task__name {
    flex: 1;
    font-weight: 500;
}
.lesson-task--done .lesson-task__name {
    color: var(--muted);
    text-decoration: line-through;
}
.lesson-task__type {
    font-size: .9rem;
    flex-shrink: 0;
    opacity: .7;
}
.lesson-task__btn {
    flex-shrink: 0;
    margin-left: auto;
}

/* Tlačítko peer nominace */
.btn-peer {
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .65rem 1.4rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    transition: background .15s, box-shadow .15s;
}
.btn-peer:hover {
    background: #6d28d9;
    box-shadow: 0 3px 10px rgba(124,58,237,.25);
}

/* Malé tlačítko */
.btn-xs {
    padding: .2rem .6rem;
    font-size: .78rem;
    border-radius: 5px;
}

/* ==========================================================================
   Reflexe — sekce 3 dashboardu žáka
   ========================================================================== */

.reflection-wrap {
    margin-bottom: 1.4rem;
}

/* Kategorie-filtry */
.reflection-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .85rem;
}
.refl-tab {
    padding: .38rem .9rem;
    border: 1.5px solid #d0d5df;
    border-radius: 20px;
    background: #f4f6fa;
    color: var(--text);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    line-height: 1.4;
}
.refl-tab:hover {
    background: #e8eaf0;
    border-color: #b0b8cc;
}
.refl-tab--active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

/* Textarea */
.refl-textarea {
    width: 100%;
    min-height: 6rem;
    padding: .7rem .85rem;
    border: 1.5px solid #d0d5df;
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
    line-height: 1.55;
    resize: vertical;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    margin-bottom: .85rem;
}
.refl-textarea:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}

/* Výpis vět */
.refl-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}
.refl-prompt {
    padding: .4rem .9rem;
    background: #fff;
    border: 1.5px solid #e2e6ee;
    border-radius: 8px;
    font-size: .83rem;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    line-height: 1.45;
    transition: background .15s, border-color .15s, color .15s;
}
.refl-prompt:hover {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}
.refl-empty {
    color: var(--muted);
    font-size: .85rem;
    margin: 0;
    font-style: italic;
}

/* Formulář reflexe */
.refl-form {
    margin-bottom: 0;
}
/* Řádek s výběrem tématu (pouze při více aktivních tématech) */
/* Řádek s výběrem tématu */
.refl-theme-row {
    margin-bottom: .75rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.refl-theme-row__label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Toggle-buttony pro témata */
.refl-theme-btns {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.refl-theme-toggle {
    display: inline-block;
    cursor: pointer;
    user-select: none;
}
/* Skryjeme skutečný checkbox */
.refl-theme-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}
/* Pill styl */
.refl-theme-toggle span {
    display: inline-block;
    padding: .42rem 1rem;
    border: 1.5px solid #d0d5df;
    border-radius: 22px;
    background: #f4f6fa;
    color: var(--text);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.4;
    transition: background .15s, border-color .15s, color .15s;
}
.refl-theme-toggle:hover span {
    background: #e8eaf0;
    border-color: #b0b8cc;
}
/* Aktivní (zaškrtnutý) stav — amber */
.refl-theme-toggle input[type="checkbox"]:checked + span {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}
.refl-form__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: .55rem;
    margin-bottom: .85rem;
}
.refl-submit-btn {
    min-width: 110px;
}

/* Historie odevzdaných reflexí */
.refl-history {
    margin-top: 1.1rem;
    padding: .85rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    margin-bottom: .75rem;
}
.refl-history__title {
    font-size: .88rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 .6rem 0;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.refl-history__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.refl-history__item {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .5rem .65rem;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 7px;
    font-size: .87rem;
    line-height: 1.45;
}
.refl-history__theme {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    border-radius: 4px;
    padding: .1rem .45rem;
    align-self: flex-start;
}
.refl-history__text {
    color: var(--text);
}
.refl-history__date {
    font-size: .75rem;
    color: var(--muted);
    align-self: flex-end;
}

/* Nominace — oddělená od reflexe */
.reflection-nominations {
    padding-top: .85rem;
    border-top: 1px solid #f0d0a0;
    margin-top: .2rem;
}

/* =========================================================
   Stránka reflexí — student (filtr + seznam)
   ========================================================= */
.refl-page-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1.2rem;
}
.refl-filter-btn {
    padding: .38rem .9rem;
    border: 1.5px solid #d0d5df;
    border-radius: 20px;
    background: #f4f6fa;
    color: var(--text);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    line-height: 1.4;
}
.refl-filter-btn:hover {
    background: #e8eaf0;
    border-color: #b0b8cc;
}
.refl-filter-btn--active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}
.refl-page-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.refl-page-item {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .75rem 1rem;
    background: #fff;
    border: 1px solid #e2e6ee;
    border-radius: 10px;
}
.refl-page-item__text {
    margin: 0;
    font-size: .93rem;
    color: var(--text);
    line-height: 1.55;
}

/* =========================================================
   Stránka reflexí — učitel (search + tabulka)
   ========================================================= */
.refl-search-form {
    margin-bottom: 1.4rem;
}
.refl-search-wrap {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}
.refl-search-input {
    flex: 1;
    min-width: 220px;
    padding: .5rem .85rem;
    border: 1.5px solid #d0d5df;
    border-radius: 8px;
    font-size: .93rem;
    font-family: inherit;
    background: #fff;
    transition: border-color .15s;
}
.refl-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.refl-teacher-table-wrap {
    overflow-x: auto;
}
.refl-teacher-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.refl-teacher-table th {
    background: #f4f6fa;
    padding: .55rem .85rem;
    text-align: left;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    border-bottom: 2px solid #e2e6ee;
    white-space: nowrap;
}
.refl-teacher-row td {
    padding: .65rem .85rem;
    border-bottom: 1px solid #f0f0f5;
    vertical-align: top;
}
.refl-teacher-row:last-child td { border-bottom: none; }
.refl-teacher-row:hover td { background: #fafafa; }
.refl-teacher-row__student {
    white-space: nowrap;
    font-weight: 600;
    color: var(--text);
}
.refl-teacher-row__theme { white-space: nowrap; }
.refl-teacher-row__text {
    color: var(--text);
    line-height: 1.5;
    max-width: 520px;
}
.refl-teacher-row__date {
    white-space: nowrap;
    font-size: .8rem;
    color: var(--muted);
    text-align: right;
}
.page-title-count {
    font-size: .88rem;
    color: var(--muted);
    font-weight: 400;
    margin-left: .5rem;
}

/* ================================================================
   AI ANALÝZY REFLEXÍ — sekce na stránce Reflexe (učitel)
   ================================================================ */
.ai-analyses {
    margin-top: 2.5rem;
    border-top: 2px solid #e2e6ee;
    padding-top: 1.5rem;
}
.ai-analyses__header {
    margin-bottom: 1.25rem;
}
.ai-analyses__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 .25rem;
}
.ai-analyses__subtitle {
    font-size: .85rem;
    color: var(--muted);
    margin: 0;
}

/* Karta jedné AI analýzy */
.ai-analysis-card {
    background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.ai-analysis-card__meta {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    margin-bottom: .85rem;
    flex-wrap: wrap;
}
.ai-analysis-card__theme {
    font-weight: 700;
    font-size: 1rem;
    color: #92400e;
}
.ai-analysis-card__date {
    font-size: .78rem;
    color: #b45309;
}
.ai-analysis-card__model {
    font-family: monospace;
    font-size: .75rem;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 0 .35em;
    color: #78350f;
}
.ai-analysis-card__body {
    font-size: .92rem;
    line-height: 1.65;
    color: var(--text);
    white-space: pre-wrap;
}
/* Zvýraznění nadpisů oddílů (emoji + CAPS) */
.ai-analysis-card__body br + br {
    display: block;
    margin-top: .6rem;
}

/* ================================================================
   DEACTIVATE FORM — inline formulář pro deaktivaci tématu
   ================================================================ */
.deactivate-form {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.deactivate-form__ai-check {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.deactivate-form__ai-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #f59e0b;
}
.deactivate-form__ai-check span {
    transition: color .15s;
}
.deactivate-form__ai-check:has(input:checked) span {
    color: #92400e;
    font-weight: 600;
}

/* ================================================================
   TOPBAR — horní lišta v teacher layoutu
   ================================================================ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: .6rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    min-height: 52px;
}

/* ================================================================
   USER DROPDOWN — rozklikávací menu s jménem uživatele
   ================================================================ */
.user-dropdown {
    position: relative;
    display: inline-block;
}
.user-dropdown__trigger {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: none;
    border: 1px solid #e2e6ee;
    border-radius: 8px;
    padding: .38rem .75rem;
    cursor: pointer;
    font-size: .88rem;
    font-family: inherit;
    color: var(--text);
    transition: background .15s, border-color .15s;
}
.user-dropdown__trigger:hover,
.user-dropdown__trigger:focus-visible {
    background: #f4f6fa;
    border-color: #c8cfe0;
    outline: none;
}
.user-dropdown__avatar {
    font-size: 1rem;
    line-height: 1;
}
.user-dropdown__name {
    font-weight: 600;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-dropdown__caret {
    font-size: .7rem;
    color: var(--muted);
    transition: transform .2s;
}
.user-dropdown.is-open .user-dropdown__caret {
    transform: rotate(180deg);
}

/* Menu */
.user-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e2e6ee;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    z-index: 500;
    overflow: hidden;
}
.user-dropdown.is-open .user-dropdown__menu {
    display: block;
    animation: dropdownIn .15s ease;
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.user-dropdown__item {
    display: block;
    padding: .6rem 1rem;
    font-size: .88rem;
    color: var(--text);
    text-decoration: none;
    transition: background .12s;
}
.user-dropdown__item:hover {
    background: #f4f6fa;
}
.user-dropdown__item--danger {
    color: #dc2626;
}
.user-dropdown__item--danger:hover {
    background: #fff5f5;
}
.user-dropdown__divider {
    height: 1px;
    background: #e9ecef;
    margin: .25rem 0;
}

/* ================================================================
   SETTINGS PAGE — stránka nastavení účtu
   ================================================================ */
.settings-page {
    max-width: 500px;
}
.settings-page h1 {
    margin-bottom: 1.5rem;
}
.settings-card {
    background: #fff;
    border: 1px solid #e2e6ee;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.settings-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 .4rem;
    color: var(--text);
}
.settings-card__hint {
    font-size: .83rem;
    color: var(--muted);
    margin: 0 0 1.1rem;
}
.settings-card__form .form-group {
    margin-bottom: .85rem;
}

/* ================================================================
   TAG CHIPS — soukromé zápisky učitele (Review detail + Notes)
   ================================================================ */

/* Karta */
.submission-tags {
    background: #fff;
    border: 1.5px solid #e9c840;
    border-top: 4px solid #e9c840;
    border-radius: 12px;
    margin: 2rem 0;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(180,140,0,.08);
}

/* Hlavička karty */
.submission-tags__header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1.25rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fff8d6 100%);
    border-bottom: 1px solid #f0e080;
}
.submission-tags__icon {
    font-size: 1.15rem;
    line-height: 1;
}
.submission-tags__title {
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
    color: #7a5c00;
    flex: 1;
}
.submission-tags__private {
    display: inline-flex;
    align-items: center;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    font-size: .68rem;
    font-weight: 700;
    border-radius: 20px;
    padding: .15rem .55rem;
    text-transform: uppercase;
    letter-spacing: .07em;
}
.submission-tags__all-link {
    font-size: .82rem;
    color: #b45309;
    text-decoration: none;
    font-weight: 500;
    padding: .25rem .65rem;
    border: 1px solid #f0c040;
    border-radius: 6px;
    background: #fff;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.submission-tags__all-link:hover {
    background: #fef3c7;
    color: #92400e;
}

/* Tělo karty */
.submission-tags__body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Sekce uvnitř */
.submission-tags__section {
    padding: .75rem 0;
    border-bottom: 1px solid #f5e8a0;
}
.submission-tags__section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}
.submission-tags__section:first-of-type {
    padding-top: 0;
}
.submission-tags__label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .7rem;
    font-weight: 700;
    color: #b45309;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .55rem;
    background: #fef3c7;
    border: 1px solid #f0d060;
    border-radius: 4px;
    padding: .1rem .45rem;
}
.submission-tags__footer {
    padding: .6rem 1.25rem;
    background: #fffbeb;
    border-top: 1px solid #f0e080;
}
.submission-tags__hint {
    font-size: .8rem;
    color: #a0845c;
    margin: 0;
}

/* Chips kontejner */
.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    min-height: 1.8rem;
    align-items: center;
}
.tag-chips__empty {
    font-size: .83rem;
    color: #b0a060;
    font-style: italic;
}

/* Jeden chip */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #fef9c3;
    border: 1px solid #d97706;
    color: #78350f;
    border-radius: 20px;
    padding: .25rem .8rem;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(180,120,0,.1);
}
.tag-chip--sm {
    font-size: .78rem;
    padding: .15rem .55rem;
    box-shadow: none;
}
.tag-chip--assigned {
    background: #fde68a;
    border-color: #d97706;
    color: #78350f;
}
.tag-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #b45309;
    text-decoration: none;
    font-size: .85rem;
    line-height: 1;
    border-radius: 50%;
    background: rgba(180,80,0,.1);
    transition: background .15s, color .15s;
}
.tag-chip__remove:hover {
    background: #fca5a5;
    color: #dc2626;
}

/* Rychlé přidání — suggestion pills */
.tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}
.tag-suggestion-pill {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: #fff;
    border: 1.5px solid #d97706;
    color: #92400e;
    border-radius: 20px;
    padding: .28rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, transform .1s, box-shadow .15s;
    white-space: nowrap;
    cursor: pointer;
}
.tag-suggestion-pill:hover {
    background: #fde68a;
    border-color: #b45309;
    color: #78350f;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(180,120,0,.2);
}

/* Formulář pro přidání tagu */
.tag-add {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: wrap;
    gap: .5rem;
}
.tag-add input[type="text"] {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: .38rem .8rem;
    font-size: .88rem;
    width: 220px;
    transition: border-color .15s, box-shadow .15s;
}
.tag-add input[type="text"]:focus {
    outline: none;
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217,119,6,.15);
}

/* ================================================================
   NOTES PAGE — přehled zápisků (nový design s letter-nav + pills)
   ================================================================ */
.notes-filter-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.notes-filter-panel__section {
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.notes-filter-panel__section:last-child {
    border-bottom: none;
}
.notes-filter-panel__label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .55rem;
}
.notes-letter-nav {
    margin-bottom: .5rem;
}
.notes-student-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    min-height: 2rem;
}

/* Téma pills */
.notes-theme-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.notes-theme-pill {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--border);
    color: var(--text);
    border-radius: 20px;
    padding: .28rem .85rem;
    font-size: .83rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    font-family: inherit;
}
.notes-theme-pill:hover {
    background: #eef2ff;
    border-color: var(--primary);
    color: var(--primary);
}
.notes-theme-pill--active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.notes-count {
    font-size: .88rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.notes-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}
.notes-empty p {
    margin-bottom: 1rem;
}

.notes-no-results {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-style: italic;
}

.notes-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.notes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.notes-table th,
.notes-table td {
    padding: .7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.notes-table thead tr {
    background: var(--bg);
}
.notes-table th {
    font-weight: 700;
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.notes-table tbody tr:last-child td {
    border-bottom: none;
}
.notes-table tbody tr:hover {
    background: #fffbf0;
}
.notes-row__student strong {
    display: block;
}
.notes-row__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}
.notes-row__date {
    white-space: nowrap;
    color: var(--muted);
    font-size: .85rem;
}
.notes-row__action {
    white-space: nowrap;
}

/* ================================================================
   LIGHTBOX — rozkliknutelné náhledy obrázků
   ================================================================ */
.lb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: lbFadeIn .2s ease;
}
.lb-overlay--visible {
    display: flex;
}
@keyframes lbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.lb-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    max-width: min(92vw, 1100px);
    max-height: 92vh;
    animation: lbScaleIn .2s ease;
}
@keyframes lbScaleIn {
    from { transform: scale(.93); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.lb-img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 4rem);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.lb-caption {
    color: rgba(255,255,255,.85);
    font-size: .9rem;
    text-align: center;
    max-width: 600px;
}
.lb-close {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 2.6rem;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.15);
    border: 1.5px solid rgba(255,255,255,.35);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
    backdrop-filter: blur(4px);
    z-index: 10000;
}
.lb-close:hover {
    background: rgba(255,255,255,.28);
    border-color: rgba(255,255,255,.7);
    transform: scale(1.1);
}

/* Styl pro obrázky s lightbox triggerem — kurzor + hover efekt */
a[data-lightbox] {
    display: block;
    cursor: zoom-in;
}
a[data-lightbox] img {
    transition: opacity .15s, transform .15s;
}
a[data-lightbox]:hover img {
    opacity: .9;
    transform: scale(1.02);
}

/* ================================================================
   Review navigace (předchozí / další odevzdání)
   ================================================================ */
.review-nav {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .6rem 1rem;
    margin-bottom: 1.4rem;
}
.review-nav--bottom {
    margin-top: 2rem;
    margin-bottom: 0;
}
.review-nav__back {
    font-size: .85rem;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
}
.review-nav__back:hover {
    color: var(--primary);
}
.review-nav__center {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 auto;
}
.review-nav__spacer {
    /* zrcadlí šířku __back pro symetrii */
    min-width: 60px;
}
.review-nav__arrow {
    display: inline-flex;
    align-items: center;
    padding: .35rem .9rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: #fff;
    white-space: nowrap;
}
.review-nav__arrow:hover {
    background: var(--primary);
    color: #fff;
}
.review-nav__arrow--disabled {
    border-color: #dee2e6;
    color: #adb5bd;
    background: #fff;
    cursor: default;
    pointer-events: none;
}
.review-nav__position {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text);
    padding: 0 .5rem;
    white-space: nowrap;
}
.review-nav__history-badge {
    font-size: .82rem;
    color: var(--text-muted);
    background: #e9ecef;
    border-radius: 20px;
    padding: .25rem .75rem;
}

/* ================================================================
   Stránkování (pagination)
   ================================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.pagination__info {
    font-size: .85rem;
    color: var(--text-muted);
}
.pagination__pages {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
}
.pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 .6rem;
    border-radius: 7px;
    font-size: .87rem;
    font-weight: 500;
    text-decoration: none;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text);
    transition: background .12s, border-color .12s, color .12s;
}
.pagination__btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination__btn--active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    cursor: default;
    pointer-events: none;
}

/* ================================================================== */
/* Oblíbené odznaky — výpis na stránce Badges                         */
/* ================================================================== */
.fav-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .75rem;
    margin-bottom: 1.75rem;
}
.fav-list__item {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    background: #fff;
    border: 1.5px solid #fde68a;
    border-radius: 12px;
    padding: 1rem 1rem .8rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .15s, border-color .15s;
}
.fav-list__item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,.1);
    border-color: #f5c518;
}
.fav-list__badge {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}
.fav-list__info {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
}
.fav-list__name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fav-list__note {
    font-size: .8rem;
    color: var(--muted);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.fav-list__footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #fef3c7;
    padding-top: .6rem;
    margin-top: auto;
}
.fav-list__empty {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1.25rem;
    padding: .75rem 1rem;
    background: #fafafa;
    border: 1.5px dashed var(--border);
    border-radius: 10px;
}
.fav-save-section__sub {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 .75rem;
    color: var(--text);
    padding-top: .25rem;
    border-top: 1px solid var(--border);
}

/* ================================================================== */
/* Semafor — žák (widget v sekci Úvod do hodiny)                      */
/* ================================================================== */
.traffic-widget {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px dashed var(--border);
}
.traffic-widget__label {
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
    margin: 0;
}
.traffic-widget__lights {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}
.traffic-light {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
    padding: .75rem 1.25rem;
    border-radius: 12px;
    border: 2.5px solid transparent;
    background: #f5f5f5;
    transition: transform .12s, box-shadow .12s, border-color .12s;
    cursor: pointer;
    min-width: 110px;
}
.traffic-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.traffic-light__dot {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: block;
    transition: box-shadow .12s;
}
.traffic-light--red   .traffic-light__dot { background: #ef4444; }
.traffic-light--orange .traffic-light__dot { background: #f97316; }
.traffic-light--green  .traffic-light__dot { background: #22c55e; }

.traffic-light--red.traffic-light--active {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 4px rgba(239,68,68,.15);
}
.traffic-light--orange.traffic-light--active {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: 0 0 0 4px rgba(249,115,22,.15);
}
.traffic-light--green.traffic-light--active {
    border-color: #22c55e;
    background: #f0fdf4;
    box-shadow: 0 0 0 4px rgba(34,197,94,.15);
}
.traffic-light--active .traffic-light__dot {
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.traffic-light__label {
    font-size: .78rem;
    font-weight: 500;
    color: var(--text);
    text-align: center;
}

/* ================================================================== */
/* Semafor — učitel (přehled na dashboardu)                           */
/* ================================================================== */
.traffic-overview {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 2px solid var(--border);
}
.traffic-overview__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}
.traffic-group {
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid var(--border);
}
.traffic-group--red    { border-color: #fca5a5; }
.traffic-group--orange { border-color: #fdba74; }
.traffic-group--green  { border-color: #86efac; }
.traffic-group__title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    font-weight: 700;
    padding: .6rem 1rem;
    margin: 0;
}
.traffic-group--red    .traffic-group__title { background: #fef2f2; color: #b91c1c; }
.traffic-group--orange .traffic-group__title { background: #fff7ed; color: #c2410c; }
.traffic-group--green  .traffic-group__title { background: #f0fdf4; color: #15803d; }
.traffic-group__count {
    margin-left: auto;
    background: rgba(0,0,0,.08);
    border-radius: 20px;
    padding: .1rem .55rem;
    font-size: .8rem;
}
.traffic-group__students {
    display: flex;
    flex-direction: column;
    background: #fff;
}
.traffic-student {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 1rem;
    border-top: 1px solid var(--border);
    font-size: .88rem;
}
.traffic-student:first-child { border-top: none; }
.traffic-student__name { font-weight: 500; color: var(--text); }
.traffic-student__time { color: var(--muted); font-size: .8rem; }

/* ================================================================== */
/* Polling — banner nových odevzdání                                  */
/* ================================================================== */
.new-submissions-banner {
    background: #fef3c7;
    border: 1.5px solid #f59e0b;
    border-radius: 10px;
    padding: .65rem 1.1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
    font-weight: 500;
    color: #92400e;
    animation: fadeInDown .3s ease;
}
.new-submissions-banner a {
    color: #b45309;
    font-weight: 700;
    text-decoration: underline;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Teacher accordion (student dashboard) ---- */
.teacher-accordion { display: flex; flex-direction: column; gap: .5rem; }
.teacher-accordion__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    background: var(--card-bg, #fff);
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text, #1f2937);
    text-align: left;
    transition: background .15s, border-color .15s;
}
.teacher-accordion__toggle:hover { background: var(--hover-bg, #f9fafb); border-color: var(--primary, #6366f1); }
.teacher-accordion__toggle--open  { border-color: var(--primary, #6366f1); background: var(--hover-bg, #f9fafb); }
.teacher-accordion__name { flex: 1; }
.teacher-accordion__meta { font-size: .82rem; font-weight: 400; color: var(--muted, #6b7280); }
.teacher-accordion__arrow {
    font-size: 1.2rem;
    line-height: 1;
    transition: transform .2s;
    color: var(--muted, #6b7280);
}
.teacher-accordion__toggle--open .teacher-accordion__arrow { transform: rotate(90deg); }
.teacher-accordion__body { padding: .5rem 0 .25rem; }

/* === Výrazné tlačítko "Vybrat soubor" na stránce odevzdání úkolu === */
.proof-file-input {
    display: block;
    width: 100%;
    padding: .5rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: #f7faff;
    font-size: .95rem;
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.proof-file-input:hover,
.proof-file-input:focus {
    border-color: var(--primary);
    background: #eef5ff;
    outline: none;
}
.proof-file-input::file-selector-button {
    display: inline-block;
    padding: .6rem 1.4rem;
    margin-right: 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.proof-file-input::file-selector-button:hover {
    background: var(--primary-d);
}

/* === Lightbox — zadání tématu (Dashboard žáka) === */

/* Název tématu jako tlačítko */
.theme-modal-trigger {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: color .15s, text-decoration-color .15s;
}
.theme-modal-trigger:hover {
    color: var(--primary-d);
    text-decoration-color: var(--primary-d);
}

/* Overlay */
.theme-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 900;
    backdrop-filter: blur(2px);
}

/* Modal box */
.theme-modal {
    position: fixed;
    inset: 0;
    z-index: 901;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
}
.theme-modal[hidden] { display: none; }
.theme-modal__box {
    pointer-events: all;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,.22);
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem 2rem 1.5rem;
    position: relative;
    animation: modal-in .18s ease;
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* Křížek */
.theme-modal__close {
    position: absolute;
    top: .9rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: .2rem .5rem;
    border-radius: 6px;
    transition: background .12s, color .12s;
}
.theme-modal__close:hover { background: #f0f2f5; color: var(--text); }

/* Obsah */
.theme-modal__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: .6rem;
    padding-right: 2.5rem;
}
.theme-modal__deadline {
    font-size: .9rem;
    color: var(--warning);
    margin-bottom: 1rem;
}
.theme-modal__description {
    font-size: .95rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #f7f9fb;
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}
.theme-modal__no-desc {
    color: var(--muted);
    font-style: italic;
    margin-bottom: 1.25rem;
}
.theme-modal__footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: right;
}

/* Zákaz scrollu stránky při otevřeném modalu */
body.modal-open { overflow: hidden; }

/* Název úkolu jako modal trigger — inline varianta */
.lesson-task__name.theme-modal-trigger {
    font-size: inherit;
    font-weight: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--primary);
    color: var(--text);
}
.lesson-task__name.theme-modal-trigger:hover {
    color: var(--primary);
    text-decoration-style: solid;
}

/* Klikatelný řádek úkolu */
.lesson-task--clickable { cursor: pointer; }
.lesson-task--clickable:hover { background: #f0f6ff; border-radius: var(--radius); }

/* Info ikona v kroužku */
.lesson-task__info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    font-style: normal;
    flex-shrink: 0;
    margin-left: .25rem;
    vertical-align: middle;
    line-height: 1;
}

/* === Drag & drop pořadí úkolů (Teacher/Themes/detail) === */
.task-item__handle {
    cursor: grab;
    font-size: 1.2rem;
    color: var(--muted);
    padding: 0 .4rem;
    flex-shrink: 0;
    user-select: none;
    line-height: 1;
}
.task-item__handle:active { cursor: grabbing; }

.task-item--dragging {
    opacity: .4;
}
.task-item--dragover {
    outline: 2px dashed var(--primary);
    outline-offset: 2px;
    background: #eef5ff;
    border-radius: var(--radius);
}
