/* =====================================================================
   Szkoła Sportowa — profesjonalny system UI (2026)
   Ciemny sidebar + jasny content, spójny język wizualny w całej aplikacji.
   ===================================================================== */

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #6366f1;
    --primary-50: #eef2ff;
    --accent: #f59e0b;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;

    --ink: #0b1220;
    --ink-soft: #141d33;
    --ink-border: rgba(255, 255, 255, .08);

    --bg: #f4f6fb;
    --surface: #ffffff;
    --border: #e6e9f2;
    --text: #0f172a;
    --muted: #64748b;

    --radius-xl: 22px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow: 0 6px 16px rgba(15, 23, 42, .07), 0 2px 6px rgba(15, 23, 42, .05);
    --shadow-lg: 0 20px 45px rgba(15, 23, 42, .14);
    --shadow-glow: 0 10px 24px -8px rgba(79, 70, 229, .55);
    --ring: 0 0 0 3px rgba(79, 70, 229, .22);

    --sidebar-w: 264px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", -apple-system, Roboto, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.025em; margin: .2rem 0 1rem; }
h2 { font-size: 1.22rem; font-weight: 700; letter-spacing: -.015em; margin: 1.7rem 0 .7rem; }
h3 { font-weight: 700; letter-spacing: -.01em; }
a { color: var(--primary); }
::selection { background: var(--primary-light); color: #fff; }

.icon { display: inline-block; vertical-align: -4px; flex-shrink: 0; }

/* ============================================================= APP SHELL */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    background: linear-gradient(190deg, var(--ink-soft), var(--ink) 65%);
    color: #cbd5e1;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    border-right: 1px solid var(--ink-border);
    z-index: 50;
}

.brand-mark {
    width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .45);
}
.brand-mark--sm { width: 26px; height: 26px; border-radius: 8px; }

.sidebar__brand {
    display: flex; align-items: center; gap: .7rem;
    padding: 1.35rem 1.25rem 1.1rem; text-decoration: none;
    border-bottom: 1px solid var(--ink-border);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: .98rem; font-weight: 800; letter-spacing: -.01em; }
.brand-text small { color: #8b95ab; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 1.1rem .8rem; display: flex; flex-direction: column; gap: .2rem; }
.sidebar__label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
    color: #5b6785; padding: 0 .6rem; margin-bottom: .35rem;
}
.nav-item {
    display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem;
    border-radius: var(--radius-sm); color: #b6bfd6; text-decoration: none;
    font-size: .89rem; font-weight: 500; transition: background .15s, color .15s;
    position: relative;
}
.nav-item .icon { opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.is-active {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
}
.nav-item.is-active .icon { opacity: 1; }
.nav-badge {
    margin-left: auto; background: var(--accent); color: #451a03; font-size: .7rem; font-weight: 800;
    min-width: 19px; height: 19px; border-radius: 999px; display: inline-flex; align-items: center;
    justify-content: center; padding: 0 .3rem;
}
.nav-item.is-active .nav-badge { background: #fff; color: var(--primary-dark); }

.sidebar__user { border-top: 1px solid var(--ink-border); padding: .9rem; display: flex; align-items: center; gap: .5rem; }
.sidebar__user-link { display: flex; align-items: center; gap: .65rem; text-decoration: none; flex: 1; min-width: 0; padding: .3rem; border-radius: var(--radius-sm); transition: background .15s; }
.sidebar__user-link:hover { background: rgba(255, 255, 255, .06); }
.sidebar__user-info { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.sidebar__user-info strong { color: #fff; font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--ink-border);
    background: rgba(255, 255, 255, .04); color: #b6bfd6; cursor: pointer; flex: 0 0 auto;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(5, 8, 20, .55); z-index: 45; }

.shell__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Zawsze widoczny górny pasek: dzwonek powiadomień (desktop) + menu/avatar (mobile) */
.top-header {
    display: flex; align-items: center; gap: .75rem; padding: .65rem 1.1rem;
    background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px) saturate(160%);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
}
.top-header__brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: .95rem; display: inline-flex; align-items: center; gap: .5rem; }
.top-header__spacer { flex: 1; }
.only-mobile { display: none !important; }

/* Dzwonek powiadomień + rozwijany panel */
.notif { position: relative; }
.notif__toggle { position: relative; }
.notif__badge {
    position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff;
    font-size: .65rem; font-weight: 800; min-width: 17px; height: 17px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 .25rem;
    border: 2px solid var(--surface);
}
.notif__panel {
    display: none; position: absolute; top: calc(100% + 10px); right: 0; width: 320px; max-width: 88vw;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); overflow: hidden; z-index: 60;
}
.notif__panel.is-open { display: block; }
.notif__panel-header {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .85rem 1.1rem; font-weight: 700; font-size: .9rem; border-bottom: 1px solid var(--border);
}
.notif__item {
    display: flex; align-items: center; gap: .7rem; padding: .75rem 1.1rem; text-decoration: none;
    color: inherit; border-bottom: 1px solid var(--border); transition: background .12s;
}
.notif__item:hover { background: #f8fafc; }
.notif__item:last-of-type { border-bottom: none; }
.notif__item-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.notif__item-text strong { font-size: .87rem; }
.notif__item-text small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif__empty {
    display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.75rem 1rem;
    color: var(--muted); font-size: .85rem;
}
.notif__panel-footer {
    display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .75rem;
    text-decoration: none; color: var(--primary); font-weight: 600; font-size: .85rem;
    background: #f8fafc; border-top: 1px solid var(--border);
}
.notif__panel-footer:hover { background: var(--primary-50); }

/* ============================================================= Marketing (gość) */
.marketing { display: flex; flex-direction: column; min-height: 100vh; }
.marketing-nav {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1.5rem;
    padding: .9rem 1.75rem; background: rgba(255, 255, 255, .85); backdrop-filter: blur(10px) saturate(160%);
    border-bottom: 1px solid var(--border);
}
.marketing-nav__brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.05rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.marketing-nav__links { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.marketing-nav__links a:not(.btn) {
    color: var(--muted); text-decoration: none; font-weight: 500; font-size: .9rem;
    padding: .5rem .75rem; border-radius: 999px; transition: background .15s, color .15s;
}
.marketing-nav__links a:not(.btn):hover { color: var(--text); background: #f1f5f9; }
.marketing-nav__links a.is-active { color: var(--primary); font-weight: 700; }
.marketing-nav__toggle { display: none; margin-left: auto; }
.marketing .container { flex: 1; }

.marketing-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.75rem; background: var(--surface); }
.marketing-footer__inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.marketing-footer__links { display: flex; gap: 1.25rem; }
.marketing-footer__links a { color: var(--muted); text-decoration: none; }
.marketing-footer__links a:hover { color: var(--primary); }

/* ============================================================= Layout */
.container { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.75rem 3.5rem; width: 100%; }

/* ============================================================= Alerts */
.alert {
    padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.1rem;
    border: 1px solid transparent; font-size: .93rem; box-shadow: var(--shadow-sm);
    display: flex; gap: .6rem; align-items: flex-start;
}
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert--success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert--error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert--warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ============================================================= Cards */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.35rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem;
}
.card__title { margin: 0 0 .75rem; font-size: 1.05rem; font-weight: 700; }

/* ============================================================= Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    background: var(--primary); color: #fff; padding: .65rem 1.2rem;
    border-radius: var(--radius-sm); text-decoration: none; border: none; cursor: pointer;
    font-size: .92rem; font-weight: 600; box-shadow: var(--shadow-glow);
    transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 14px 28px -8px rgba(79, 70, 229, .55); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn--danger { background: var(--danger); box-shadow: 0 10px 24px -8px rgba(220, 38, 38, .45); }
.btn--danger:hover { background: #b91c1c; box-shadow: 0 14px 28px -8px rgba(220, 38, 38, .5); }
.btn--success { background: var(--success); box-shadow: 0 10px 24px -8px rgba(5, 150, 105, .45); }
.btn--success:hover { background: #047857; }
.btn--accent { background: var(--accent); box-shadow: 0 10px 24px -8px rgba(245, 158, 11, .5); color: #451a03; }
.btn--accent:hover { background: #d97706; }
.btn--ghost {
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { background: #f8fafc; border-color: #cbd5e1; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--large { padding: .95rem 1.7rem; font-size: 1.05rem; }
.btn--small { padding: .4rem .75rem; font-size: .82rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }

/* ============================================================= Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.1rem; margin: 1.5rem 0; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.3rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
    transition: transform .15s, box-shadow .15s; display: flex; align-items: flex-start; gap: .9rem;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card__icon {
    width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-50); color: var(--primary);
}
.stat-card--warning .stat-card__icon { background: #fffbeb; color: var(--warning); }
.stat-card--success .stat-card__icon { background: #ecfdf5; color: var(--success); }
.stat-card--danger  .stat-card__icon { background: #fef2f2; color: var(--danger); }
.stat-card__body { min-width: 0; }
.stat-card__value { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.stat-card__label { color: var(--muted); font-size: .82rem; font-weight: 500; }

/* ============================================================= Quick links */
.quick-links { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

/* ============================================================= Komunikator */
.conversation-row {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: .85rem 1.1rem; text-decoration: none; color: inherit; margin-bottom: .5rem;
    box-shadow: var(--shadow-sm); transition: border-color .15s, transform .1s;
}
.conversation-row:hover { border-color: var(--primary-light); transform: translateX(3px); }
.chat-messages {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem; height: 440px; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem;
    box-shadow: var(--shadow-sm);
}
.chat-bubble {
    align-self: flex-start; background: #f1f5f9; border-radius: 14px 14px 14px 4px;
    padding: .55rem .85rem; max-width: 72%; box-shadow: var(--shadow-sm);
}
.chat-bubble--me { align-self: flex-end; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; border-radius: 14px 14px 4px 14px; }
.chat-bubble--me .chat-bubble__sender, .chat-bubble--me .chat-bubble__time { color: rgba(255, 255, 255, .8); }
.chat-bubble__sender { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
.chat-bubble p { margin: .15rem 0; }
.chat-bubble__time { font-size: .7rem; color: var(--muted); }
.chat-form { display: flex; gap: .5rem; margin-top: .75rem; }
.chat-form input { flex: 1; padding: .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; }

/* ============================================================= Panel kont */
.inline-form { display: inline-block; }
.inline-form select { padding: .4rem .5rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; font-family: inherit; }
.pending-box {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
    padding: 2.75rem; text-align: center; max-width: 480px; margin: 3rem auto; box-shadow: var(--shadow-lg);
}

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

/* ============================================================= Cards grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; margin: 1rem 0; }
.location-card, .section-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem;
    text-decoration: none; color: inherit; display: block; box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.location-card:hover, .section-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.location-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: .7rem; }
.card-icon {
    width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-50); color: var(--primary); margin-bottom: .8rem;
}

/* ============================================================= Filters */
.filters {
    display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; align-items: flex-end;
    background: var(--surface); padding: 1.1rem; border-radius: var(--radius); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.filters label { display: flex; flex-direction: column; font-size: .82rem; color: var(--muted); gap: .3rem; font-weight: 500; }
.filters input, .filters select { padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-family: inherit; }

/* ============================================================= Schedule */
.schedule-day h3 { text-transform: capitalize; border-bottom: 2px solid var(--border); padding-bottom: .3rem; }
.schedule-event {
    display: flex; gap: .75rem; align-items: center; padding: .7rem .95rem;
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm); margin-bottom: .5rem; flex-wrap: wrap; box-shadow: var(--shadow-sm);
    transition: transform .1s, box-shadow .15s;
}
.schedule-event:hover { transform: translateX(3px); box-shadow: var(--shadow); }
.schedule-event--competition { border-left-color: var(--success); }
.schedule-event--substitution,
.schedule-event--location_change { border-left-color: var(--warning); }
.schedule-event--cancelled { border-left-color: var(--danger); opacity: .6; text-decoration: line-through; }
.schedule-event__badge { margin-left: auto; font-size: .75rem; color: var(--muted); }

/* ============================================================= Training card */
.training-card {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.15rem 1.3rem; margin-bottom: .75rem; box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
}
.training-card__location { color: var(--muted); margin: .3rem 0; }

/* ============================================================= Forms */
.form {
    display: flex; flex-direction: column; gap: 1.15rem; max-width: 560px;
    background: var(--surface); padding: 1.85rem; border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.form--wide { max-width: 840px; }
.form label { display: flex; flex-direction: column; gap: .35rem; font-size: .87rem; color: var(--muted); font-weight: 600; }
.form label.form-check { flex-direction: row; align-items: center; gap: .6rem; }
.form input:not([type="checkbox"]):not([type="radio"]), .form select, .form textarea {
    padding: .68rem .8rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: .95rem; color: var(--text); background: #fbfcfe; transition: border-color .15s, box-shadow .15s, background .15s;
    font-family: inherit; width: 100%;
}
.form input:not([type="checkbox"]):not([type="radio"]):focus, .form select:focus, .form textarea:focus {
    outline: none; border-color: var(--primary-light); box-shadow: var(--ring); background: #fff;
}
.form input[type="checkbox"], .form input[type="radio"] {
    width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--primary); cursor: pointer;
}
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > label { flex: 1; min-width: 180px; }
.form-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.field-error { color: var(--danger); font-size: .85rem; margin: -.5rem 0 0; }
.field-hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
fieldset.form-section {
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 1.15rem 1.3rem; margin: 0;
    display: flex; flex-direction: column; gap: 1rem;
}
fieldset.form-section legend { font-weight: 700; color: var(--text); padding: 0 .4rem; font-size: .95rem; }

/* ============================================================= Table */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.table th, .table td { text-align: left; padding: .8rem .95rem; border-bottom: 1px solid var(--border); }
.table thead th { background: #f8fafc; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbff; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ============================================================= Badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; background: #eef2ff; color: #4338ca; padding: .22rem .65rem; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge--warning { background: #fffbeb; color: #92400e; }
.badge--success { background: #ecfdf5; color: #065f46; }
.badge--danger  { background: #fef2f2; color: #991b1b; }
.badge--muted   { background: #f1f5f9; color: var(--muted); }
.badge-list { display: flex; gap: .4rem; flex-wrap: wrap; }

/* Role chips */
.role-chip { text-transform: capitalize; }
.role-chip--admin   { background: #ede9fe; color: #6d28d9; }
.role-chip--trainer { background: #dbeafe; color: #1d4ed8; }
.role-chip--student { background: #d1fae5; color: #047857; }
.role-chip--parent  { background: #ffedd5; color: #c2410c; }

/* ============================================================= Parent/child switcher */
.children-switcher { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.child-tab { background: var(--surface); border: 1px solid var(--border); padding: .55rem 1.1rem; border-radius: 999px; text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; font-size: .88rem; }
.child-tab:hover { border-color: var(--primary-light); }
.child-tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================= Wymagane dokumenty */
.doc-row {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin-bottom: 0; padding: 1.1rem 1.3rem;
}
.doc-row__info { flex: 1 1 260px; }
.doc-row__info p { font-size: .85rem; }
.doc-row__actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* ============================================================= Guardian links */
.link-list { display: flex; flex-direction: column; gap: .5rem; margin: .5rem 0 0; }
.link-row {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .65rem .9rem;
}
.link-row__info { display: flex; flex-direction: column; }
.link-row__info strong { font-size: .95rem; }
.link-row__info small { color: var(--muted); }

/* ============================================================= Attendance */
.attendance-form { display: flex; flex-direction: column; gap: .6rem; }
.attendance-toolbar {
    display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; justify-content: space-between;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: .75rem 1rem; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 10;
}
.attendance-summary { font-weight: 700; font-size: .9rem; }
.attendance-summary b { color: var(--success); }
.attendance-row {
    display: flex; gap: 1rem; align-items: center; background: var(--surface); padding: .75rem .95rem;
    border-radius: var(--radius-sm); border: 1.5px solid var(--border); flex-wrap: wrap; box-shadow: var(--shadow-sm);
    transition: border-color .15s;
}
.attendance-row__student { display: flex; align-items: center; gap: .5rem; flex: 1 1 220px; font-weight: 600; }
.attendance-row__note { flex: 1 1 200px; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; }

.att-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: #f8fafc; }
.att-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.att-toggle label {
    padding: .4rem .8rem; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--muted);
    transition: background .12s, color .12s; user-select: none;
}
.att-toggle input:checked + label.att--present { background: var(--success); color: #fff; }
.att-toggle input:checked + label.att--late    { background: var(--warning); color: #fff; }
.att-toggle input:checked + label.att--absent  { background: var(--danger);  color: #fff; }
.attendance-row.is-present { border-color: #a7f3d0; }
.attendance-row.is-late    { border-color: #fde68a; }
.attendance-row.is-absent  { border-color: #fecaca; }

/* ============================================================= Profile */
.profile-summary {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.3rem 1.6rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem;
}
.profile-header { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; }
.profile-header .avatar { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }

/* ============================================================= Avatar */
.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #fff; font-weight: 700; font-size: .85rem; overflow: hidden;
    text-transform: uppercase; text-decoration: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 68px; height: 68px; font-size: 1.5rem; }
.avatar--sm { width: 30px; height: 30px; font-size: .75rem; }

/* ============================================================= Hero (marketing) */
.hero {
    position: relative; overflow: hidden; text-align: center; padding: 5rem 1.75rem;
    background: radial-gradient(1000px 400px at 15% 0%, rgba(255, 255, 255, .12), transparent 60%),
                linear-gradient(135deg, var(--ink) 0%, var(--primary-dark) 55%, var(--primary) 100%);
    color: #fff; border-radius: var(--radius-xl); margin: 1rem 0 3rem; box-shadow: var(--shadow-lg);
}
.hero__eyebrow {
    display: inline-flex; align-items: center; gap: .4rem; background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2); color: #fff; font-size: .78rem; font-weight: 700;
    padding: .4rem .9rem; border-radius: 999px; margin-bottom: 1.3rem; letter-spacing: .02em;
}
.hero h1 { font-size: 2.6rem; margin-bottom: .9rem; max-width: 720px; margin-left: auto; margin-right: auto; line-height: 1.15; }
.hero p { font-size: 1.1rem; color: #dbe0f5; max-width: 560px; margin: 0 auto; }
.hero__actions { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; margin-top: 1.9rem; }
.hero .btn { background: #fff; color: var(--primary-dark); }
.hero .btn:hover { background: #f1f5f9; }
.hero .btn--ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero .btn--ghost:hover { background: rgba(255, 255, 255, .18); }

/* Stats strip on marketing home */
.stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; margin: -4.2rem auto 3rem; max-width: 980px; position: relative; z-index: 2; padding: 0 1rem; }
.stats-strip__item {
    background: var(--surface); border-radius: var(--radius); padding: 1.4rem 1rem; text-align: center;
    box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.stats-strip__value { display: block; font-size: 1.9rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }
.stats-strip__label { color: var(--muted); font-size: .82rem; font-weight: 600; }

/* Feature grid */
.section-heading { text-align: center; max-width: 640px; margin: 0 auto 2.2rem; }
.section-heading__eyebrow { display: block; color: var(--primary); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; }
.section-heading h2 { margin: 0 0 .6rem; font-size: 1.7rem; }
.section-heading p { color: var(--muted); margin: 0; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; margin: 2rem 0 3.5rem; }
.feature-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.6rem; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.feature-card p { color: var(--muted); margin: 0; font-size: .92rem; }

.cta-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
    background: linear-gradient(120deg, var(--primary-dark), var(--primary));
    color: #fff; border-radius: var(--radius-xl); padding: 2.4rem 2.6rem; margin: 3rem 0;
    box-shadow: var(--shadow-lg);
}
.cta-banner h2 { margin: 0 0 .4rem; color: #fff; font-size: 1.5rem; }
.cta-banner p { margin: 0; color: #dbe0f5; }
.cta-banner .btn { background: #fff; color: var(--primary-dark); flex: 0 0 auto; }
.cta-banner .btn:hover { background: #f1f5f9; }

/* ============================================================= Split layout (formularz + panel boczny) */
.split { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.split > .form { flex: 2 1 380px; }
.split__aside { flex: 1 1 260px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.split__aside h3 { margin-top: 0; }
.split__aside ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.split__aside li::marker { color: var(--primary); }

/* ============================================================= Utilities */
.muted { color: var(--muted); font-size: .9rem; }
.loading { color: var(--muted); }
.stack > * + * { margin-top: 1rem; }
.row-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Staggered entrance animation for main content */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.container > * { animation: fadeInUp .45s ease both; }
.container > *:nth-child(2) { animation-delay: .04s; }
.container > *:nth-child(3) { animation-delay: .08s; }
.container > *:nth-child(4) { animation-delay: .12s; }
.container > *:nth-child(5) { animation-delay: .16s; }

/* ============================================================= Responsive */
@media (max-width: 960px) {
    .sidebar {
        position: fixed; left: 0; top: 0; transform: translateX(-100%);
        transition: transform .25s ease; box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-overlay.is-open { display: block; }
    .only-mobile { display: inline-flex !important; }
    .attendance-toolbar { position: static; }
}

@media (max-width: 720px) {
    .container { padding: 1.25rem 1.1rem 2.5rem; }
    .marketing-nav { padding: .8rem 1.1rem; flex-wrap: wrap; }
    .marketing-nav__toggle { display: inline-flex; }
    .marketing-nav__links {
        display: none; flex-basis: 100%; flex-direction: column; align-items: stretch;
        gap: .3rem; margin: .75rem 0 0;
    }
    .marketing-nav__links.is-open { display: flex; }
    .marketing-nav__links a.btn { text-align: center; }
    .hero { padding: 3.2rem 1.25rem; }
    .hero h1 { font-size: 1.9rem; }
    .stats-strip { margin-top: -2.5rem; }
    .cta-banner { flex-direction: column; text-align: center; padding: 2rem 1.5rem; }
    .form-row { flex-direction: column; gap: 1.1rem; }
}
