/* =========================================================================
   FishLiga — panel (admin / sędzia / zawodnik) — design system
   Ładowany po resources/sass/app.scss, więc reguły poniżej mają pierwszeństwo.
   ========================================================================= */

:root {
    /* Paleta: nieco jaśniejsza niż poprzednio (#0a1627 / #0f2239) */
    --bg: #13253f;
    --bg-2: #0f1f36;
    --surface: #1b3050;
    --surface-2: #233b60;
    --surface-3: #2b4772;
    --border: rgba(226, 238, 255, 0.14);
    --border-strong: rgba(226, 238, 255, 0.24);
    --text: #f1f6ff;
    --muted: #aec2dc;
    --accent: #2ec8ff;
    --accent-2: #7df2c8;
    --accent-ink: #04141f;
    --danger: #ff6b7d;
    --warning: #ffc857;
    --success: #4fe0a8;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(3, 12, 28, 0.28);
    --sidebar-w: 272px;
    --topbar-h: 62px;

    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-secondary-color: var(--muted);
    --bs-border-color: var(--border);
    --bs-emphasis-color: #fff;
    --bs-link-color: var(--accent);
    --bs-link-hover-color: #7fdcff;
    --bs-primary: var(--accent);
    --bs-primary-rgb: 46, 200, 255;
    --bs-success: var(--success);
    --bs-danger: var(--danger);
    --bs-warning: var(--warning);
    --bs-card-bg: var(--surface);
    --bs-card-border-color: var(--border);
    --bs-dropdown-bg: var(--surface-2);
    --bs-dropdown-border-color: var(--border-strong);
    --bs-dropdown-link-hover-bg: rgba(46, 200, 255, 0.14);
    --bs-modal-bg: var(--surface);
    --bs-modal-border-color: var(--border-strong);
}

html { scroll-behavior: smooth; }

html body {
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text);
    background:
        radial-gradient(1000px 520px at 0% -10%, rgba(46, 200, 255, 0.14), transparent 60%),
        radial-gradient(900px 520px at 100% -5%, rgba(125, 242, 200, 0.10), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

html body a { text-decoration: none; }
html body .text-muted, html body .text-secondary { color: var(--muted) !important; }
html body hr { border-color: var(--border); opacity: 1; }
html body ::selection { background: rgba(46, 200, 255, 0.35); }

/* ---------- layout ---------------------------------------------------- */
html body #app { display: flex; min-height: 100vh; flex-direction: row; }

html body .main-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
}

html body .page-main { flex: 1 0 auto; padding: 1.75rem 0 2rem; }
html body .page-container { width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 1.75rem; }

/* ---------- sidebar --------------------------------------------------- */
html body .sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #172b49 0%, #122440 100%) !important;
    border: none !important;
    border-right: 1px solid var(--border) !important;
    color: var(--text) !important;
    z-index: 1000;
    padding: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.sidebar-brand img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.sidebar-brand .brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: .01em; line-height: 1.1; }
.sidebar-brand .brand-sub { font-size: .74rem; color: var(--muted); font-weight: 600; }

.sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: .9rem .8rem 1rem; }

.nav-group-label {
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: .8;
    padding: 1rem .75rem .4rem;
}
.nav-group-label:first-child { padding-top: .25rem; }

html body .sidebar .nav-pills { gap: 2px; }
html body .sidebar .nav-pills .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .62rem .8rem;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 700;
    font-size: .92rem;
    transition: background .15s ease, color .15s ease;
}
html body .sidebar .nav-pills .nav-link i { font-size: 1.1rem; margin: 0; width: 1.3rem; text-align: center; opacity: .9; }
html body .sidebar .nav-pills .nav-link:hover { background: rgba(255,255,255,.07); color: var(--text); }
html body .sidebar .nav-pills .nav-link.active {
    background: linear-gradient(120deg, rgba(46,200,255,.22), rgba(125,242,200,.14));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
}
html body .sidebar .nav-pills .nav-link.active i { color: var(--accent); opacity: 1; }

.sidebar-user {
    border-top: 1px solid var(--border);
    padding: .85rem 1rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    background: rgba(0,0,0,.12);
}
.sidebar-user .avatar { flex: 0 0 auto; }
.sidebar-user .who { min-width: 0; flex: 1; line-height: 1.2; }
.sidebar-user .who strong { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who small { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--accent-ink); font-weight: 800; font-size: .95rem;
}

/* ---------- topbar ---------------------------------------------------- */
html body .top-bar {
    position: sticky;
    top: 0;
    z-index: 990;
    height: var(--topbar-h);
    display: flex !important;
    align-items: center;
    gap: .75rem;
    padding: 0 1.75rem;
    background: rgba(19, 37, 63, 0.82) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text) !important;
}
.top-brand { color: var(--text); font-weight: 800; letter-spacing: .02em; }
.top-bar .user-toggle { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); padding: .25rem .4rem .25rem .75rem; border-radius: 999px; border: 1px solid transparent; }
.top-bar .user-toggle:hover { background: rgba(255,255,255,.06); border-color: var(--border); }
.top-bar .user-toggle .name { font-weight: 700; }

/* ---------- page header ----------------------------------------------- */
html body h1 { font-size: clamp(1.45rem, 1.1rem + 1vw, 1.95rem); font-weight: 800; letter-spacing: -.015em; color: #fff; }
html body h2 { font-weight: 800; letter-spacing: -.01em; }
html body h5, html body .h5 { font-weight: 800; letter-spacing: -.005em; }

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .9rem 1.25rem;
    margin-bottom: 1.5rem;
}
.page-header > h1, .page-header > div:first-child > h1 { margin: 0; min-width: 0; }
.page-header .page-actions,
.page-header > .d-flex:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
}
html body h1.mb-4 { margin-bottom: 1.5rem !important; }

/* ---------- cards ----------------------------------------------------- */
html body .card {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text) !important;
    overflow: hidden;
    transition: none;
}
html body .card:hover { box-shadow: var(--shadow); }
html body .card-header {
    background: rgba(255,255,255,.04) !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text);
    font-weight: 800;
    padding: .9rem 1.25rem;
}
html body .card-body { padding: 1.35rem; }
html body .card-footer { background: rgba(255,255,255,.03); border-top: 1px solid var(--border); }
html body .list-group-item { background: transparent; color: var(--text); border-color: var(--border); }

/* ---------- buttons --------------------------------------------------- */
html body .btn {
    --_h: 2.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: var(--_h);
    padding: .45rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: .005em;
    line-height: 1.2;
    border: 1px solid transparent;
    color: var(--text);
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
    box-shadow: none;
}
html body .btn:hover { transform: translateY(-1px); color: var(--text); }
html body .btn:active { transform: translateY(0); }
html body .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(46,200,255,.35); }
html body .btn:disabled, html body .btn.disabled { opacity: .5; transform: none; cursor: not-allowed; }
html body .btn-sm { --_h: 2rem; padding: .25rem .7rem; font-size: .8rem; border-radius: 9px; }
html body .btn-lg { --_h: 2.9rem; padding: .6rem 1.4rem; font-size: 1rem; }

html body .btn-primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(46,200,255,.22);
}
html body .btn-primary:hover { color: var(--accent-ink); box-shadow: 0 10px 24px rgba(46,200,255,.32); filter: brightness(1.05); }
html body .btn-primary:disabled { box-shadow: none; }

html body .btn-secondary, html body .btn-light {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text);
}
html body .btn-secondary:hover, html body .btn-light:hover { background: #34558a; color: #fff; }

html body .btn-success { background: rgba(79,224,168,.18); border-color: rgba(79,224,168,.5); color: var(--success); }
html body .btn-success:hover { background: rgba(79,224,168,.3); color: #fff; }
html body .btn-danger { background: rgba(255,107,125,.18); border-color: rgba(255,107,125,.55); color: #ffb3bc; }
html body .btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
html body .btn-warning { background: rgba(255,200,87,.2); border-color: rgba(255,200,87,.55); color: var(--warning); }
html body .btn-warning:hover { background: var(--warning); color: #1c1400; }
html body .btn-info { background: rgba(46,200,255,.18); border-color: rgba(46,200,255,.5); color: var(--accent); }
html body .btn-info:hover { background: var(--accent); color: var(--accent-ink); }

html body .btn-outline-primary,
html body .btn-outline-secondary,
html body .btn-outline-light,
html body .btn-outline-dark,
html body .btn-outline-info {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}
html body .btn-outline-primary:hover,
html body .btn-outline-secondary:hover,
html body .btn-outline-light:hover,
html body .btn-outline-dark:hover,
html body .btn-outline-info:hover { background: rgba(255,255,255,.09); border-color: var(--accent); color: #fff; }
html body .btn-outline-success { background: transparent; border-color: rgba(79,224,168,.55); color: var(--success); }
html body .btn-outline-success:hover { background: rgba(79,224,168,.2); color: #fff; }
html body .btn-outline-danger { background: transparent; border-color: rgba(255,107,125,.55); color: #ff9aa8; }
html body .btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
html body .btn-outline-warning { background: transparent; border-color: rgba(255,200,87,.55); color: var(--warning); }
html body .btn-outline-warning:hover { background: var(--warning); color: #1c1400; }
html body .btn-link { color: var(--accent); background: none; border: none; min-height: 0; padding: 0; }
html body .btn-close { filter: invert(1) grayscale(100%) brightness(200%); opacity: .75; }

/* grupy przycisków / akcje w tabelach zawsze zawijają się czytelnie */
.d-flex.gap-1, .d-flex.gap-2, .d-flex.gap-3 { flex-wrap: wrap; }
html body td .btn, html body td form { margin: 0; }
html body td.text-end, html body td .d-flex.gap-1, html body td .d-flex.gap-2 { white-space: normal; }
html body td.text-end .btn + .btn, html body td.text-end form + .btn, html body td.text-end .btn + form { margin-left: .25rem; }
html body td.text-end form { display: inline-block; }
html body .btn-group { flex-wrap: wrap; gap: .25rem; }
html body .btn-group > .btn { border-radius: var(--radius-sm) !important; }

/* ---------- forms ----------------------------------------------------- */
html body .form-label { font-weight: 700; font-size: .85rem; color: var(--text); margin-bottom: .4rem; }
html body .form-text { color: var(--muted); font-size: .8rem; }
html body .form-control,
html body .form-select,
html body .input-group-text {
    background-color: #142843;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    min-height: 2.6rem;
    padding: .55rem .9rem;
}
html body textarea.form-control { min-height: 6rem; }
html body .form-control::placeholder { color: #7f96b4; }
html body .form-control:focus,
html body .form-select:focus {
    background-color: #17304f;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(46,200,255,.25);
    color: var(--text);
}
html body .form-control:disabled, html body .form-select:disabled { background-color: #101f36; opacity: .7; }
html body .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23aec2dc' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
html body .form-select option { background: #17304f; color: var(--text); }
html body .form-check-input { background-color: #142843; border-color: var(--border-strong); width: 1.15rem; height: 1.15rem; }
html body .form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
html body .form-check-label { font-weight: 600; color: var(--text); }
html body .form-control.is-invalid, html body .form-select.is-invalid { border-color: var(--danger); }
html body .invalid-feedback { color: #ff9aa8; }
html body .form-control[type="file"]::file-selector-button { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }

/* Tom Select */
html body .ts-control { background-color: #142843 !important; border: 1px solid var(--border-strong) !important; border-radius: var(--radius-sm) !important; min-height: 2.6rem; color: var(--text) !important; }
html body .ts-wrapper.focus .ts-control { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(46,200,255,.25) !important; }
html body .ts-dropdown { background: var(--surface-2) !important; border: 1px solid var(--border-strong) !important; border-radius: var(--radius-sm) !important; box-shadow: var(--shadow); }
html body .ts-dropdown .option { color: var(--text) !important; border-bottom-color: var(--border) !important; }
html body .ts-dropdown .option.active, html body .ts-dropdown .option:hover { background: rgba(46,200,255,.16) !important; }
html body .ts-control .item { background: rgba(46,200,255,.18) !important; border-color: rgba(46,200,255,.4) !important; }

/* ---------- filtry / wyszukiwarki ------------------------------------- */
html body form.row.g-2, html body form.row.g-3 {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .85rem .9rem;
    margin-left: 0;
    margin-right: 0;
    --bs-gutter-x: .75rem;
    --bs-gutter-y: .6rem;
}
html body form.row.g-2 > [class*="col"], html body form.row.g-3 > [class*="col"] { padding-left: calc(var(--bs-gutter-x) * .5); padding-right: calc(var(--bs-gutter-x) * .5); }

/* ---------- tables ---------------------------------------------------- */
html body .table-responsive {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
html body .card > .table-responsive,
html body .card-body.p-0 > .table-responsive,
html body .card .table-responsive { border: none; border-radius: 0; box-shadow: none; background: transparent; }

html body table.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-hover-bg: rgba(46,200,255,.07);
    --bs-table-hover-color: var(--text);
    --bs-table-striped-bg: rgba(255,255,255,.025);
    margin-bottom: 0;
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
html body table.table thead th {
    background: rgba(255,255,255,.05);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-strong) !important;
    padding: .85rem 1rem;
    white-space: nowrap;
}
html body table.table thead.table-dark th { background: rgba(255,255,255,.06); color: var(--muted); }
html body table.table tbody tr, html body table.table tbody tr:nth-child(odd) { background: transparent; }
html body table.table tbody td, html body table.table tbody th { padding: .8rem 1rem; border-color: var(--border) !important; vertical-align: middle; }
html body table.table tbody tr:hover { background: rgba(46,200,255,.07); }
html body table.table tfoot td { background: rgba(255,255,255,.05); border-color: var(--border) !important; }
html body table.table-sm tbody td, html body table.table-sm thead th { padding: .55rem .85rem; }
html body .table-warning, html body tr.table-warning > * { --bs-table-bg: rgba(255,200,87,.14); color: var(--text); }
html body .table-secondary, html body tr.table-secondary > * { --bs-table-bg: rgba(255,255,255,.05); color: var(--muted); }

/* ---------- badges / alerts / dropdowns / modals ----------------------- */
html body .badge { font-weight: 800; letter-spacing: .02em; border-radius: 999px; padding: .38em .7em; }
html body .badge.bg-primary { background: rgba(46,200,255,.22) !important; color: var(--accent) !important; }
html body .badge.bg-success { background: rgba(79,224,168,.2) !important; color: var(--success) !important; }
html body .badge.bg-danger { background: rgba(255,107,125,.2) !important; color: #ff9aa8 !important; }
html body .badge.bg-warning { background: rgba(255,200,87,.2) !important; color: var(--warning) !important; }
html body .badge.bg-info { background: rgba(46,200,255,.2) !important; color: var(--accent) !important; }
html body .badge.bg-secondary { background: rgba(255,255,255,.12) !important; color: var(--muted) !important; }
html body .badge.text-dark { color: inherit !important; }
html body .login-code-badge { background: rgba(255,255,255,.08); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }

html body .alert {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong) !important;
    background: var(--surface-2) !important;
    color: var(--text) !important;
    padding: .85rem 1.1rem;
    font-weight: 600;
}
html body .alert-success { border-left: 4px solid var(--success) !important; }
html body .alert-danger { border-left: 4px solid var(--danger) !important; }
html body .alert-warning { border-left: 4px solid var(--warning) !important; }
html body .alert-info, html body .alert-secondary { border-left: 4px solid var(--accent) !important; }

html body .dropdown-menu {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: .4rem;
    color: var(--text) !important;
}
html body .dropdown-item { border-radius: 8px; color: var(--text); font-weight: 600; padding: .5rem .75rem; display: flex; align-items: center; gap: .4rem; }
html body .dropdown-item:hover, html body .dropdown-item:focus { background: rgba(46,200,255,.16); color: #fff; }
html body .dropdown-item.text-danger:hover { background: rgba(255,107,125,.2); }
html body .dropdown-divider { border-color: var(--border); }

html body .modal-content { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0,0,0,.5); color: var(--text); }
html body .modal-header, html body .modal-footer { border-color: var(--border); }
html body .modal-footer { gap: .5rem; flex-wrap: wrap; }
html body .modal-title { font-weight: 800; }

html body .pagination { gap: .25rem; flex-wrap: wrap; }
html body .page-link { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 9px !important; font-weight: 700; }
html body .page-link:hover { background: var(--surface-3); color: #fff; }
html body .page-item.active .page-link { background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-ink); }
html body .page-item.disabled .page-link { background: transparent; color: #6f86a6; }

html body .nav-tabs { border-color: var(--border); gap: .25rem; flex-wrap: wrap; }
html body .nav-tabs .nav-link { color: var(--muted); border: 1px solid transparent; border-radius: 10px 10px 0 0; font-weight: 700; }
html body .nav-tabs .nav-link.active { background: var(--surface); border-color: var(--border) var(--border) var(--surface); color: #fff; }
html body .progress { background: rgba(255,255,255,.1); border-radius: 999px; }

.trash-tab-btn { border: 1px solid var(--border-strong); color: var(--muted); background: rgba(255,255,255,.04); font-weight: 700; }
.trash-tab-btn:hover, .trash-tab-btn:focus { border-color: var(--accent); color: var(--text); background: rgba(46,200,255,.16); }
.trash-tab-btn.active { background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-ink); }

/* ---------- footer ---------------------------------------------------- */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,.14);
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
}
.site-footer .page-container { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: center; justify-content: space-between; padding-top: 1.1rem; padding-bottom: 1.1rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: #fff; }

/* ---------- responsywność --------------------------------------------- */
@media (max-width: 991.98px) {
    html body #app { display: block; }
    html body .sidebar {
        width: min(86vw, 320px) !important;
        max-width: 320px;
        position: fixed !important;
        top: 0 !important; left: 0 !important;
        height: 100vh !important;
        z-index: 1045 !important;
        background: #142845 !important;
        border-right: 1px solid var(--border-strong) !important;
    }
    html body .offcanvas-backdrop { z-index: 1040 !important; }
    html body .top-bar { padding: 0 1rem; height: 58px; }
    html body .page-main { padding: 1.1rem 0 1.5rem; }
    html body .page-container { padding: 0 1rem; }
    html body table.table { min-width: 680px; }
    html body .card-body { padding: 1.1rem; }
}

@media (max-width: 767.98px) {
    .page-header { flex-direction: column; align-items: stretch; }
    .page-header .page-actions, .page-header > .d-flex:last-child { width: 100%; }
    .page-header .page-actions > .btn, .page-header .page-actions > form, .page-header > .d-flex:last-child > .btn,
    .page-header > .d-flex:last-child > form { flex: 1 1 calc(50% - .55rem); }
    .page-header > .d-flex:last-child > .badge { flex: 1 1 100%; text-align: center; }
    html body form.row.g-2 > [class*="col-"], html body form.row.g-3 > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
    html body .modal-dialog { margin: .75rem; }
    html body .modal-footer > .btn, html body .modal-footer > form { flex: 1 1 auto; }
    html body .modal-footer form .btn { width: 100%; }
    .site-footer .page-container { flex-direction: column; align-items: flex-start; }
    html body td.text-end { text-align: left !important; }
}

@media (max-width: 575.98px) {
    html body .btn { width: auto; }
    html body .d-flex.justify-content-between.align-items-center:not(.page-header) { flex-wrap: wrap; gap: .6rem; }
    html body .top-bar .user-toggle .name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    html body .btn { transition: none; }
}

/* drobne poprawki układu */
html body .list-group-item .badge, html body .d-flex > .badge { align-self: center; }
html body .row.g-3 > [class*="col"] > .card .display-6 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem); font-weight: 800; }
@media (max-width: 575.98px) {
    html body .row.g-3 > .col-6 > .card .card-body { padding: .9rem; }
}

/* strony formularzy (create/edit): czytelna szerokość, pola wyboru jako karty */
html body h1.mb-4 + .card, html body .page-container > div > h1.mb-4 + .card { max-width: 980px; }
html body .card-body .form-check {
    padding: .7rem .9rem .7rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .03);
    margin-bottom: .6rem;
}
html body .card-body .form-check .form-check-input { margin-left: -1.65rem; margin-top: .2rem; }
html body .card-body .form-check .form-text { margin-top: .15rem; }
html body .card-body .form-check:hover { border-color: var(--border-strong); background: rgba(255,255,255,.05); }
html body .table .form-check, html body .modal .form-check, html body form.row .form-check { border: none; background: transparent; padding-top: 0; padding-bottom: 0; }
html body form.row .form-select, html body form.row .form-control { font-size: .88rem; }
html body form.row .form-select { padding-left: .75rem; padding-right: 2rem; text-overflow: ellipsis; }

/* ---------- ekrany dla gości (logowanie, reset hasła) ------------------ */
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; padding: 2rem 1rem; }
.auth-brand { display: flex; align-items: center; gap: .9rem; color: var(--text); }
.auth-brand img { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.auth-brand strong { display: block; font-size: 1.4rem; font-weight: 800; line-height: 1.1; }
.auth-brand small { color: var(--muted); font-weight: 600; font-size: .78rem; }
.auth-card-wrap { width: 100%; max-width: 460px; }
.auth-card-wrap .container, .auth-card-wrap .container .row, .auth-card-wrap .container .row > [class*="col-md-"] { max-width: 100%; padding: 0; margin: 0; width: 100%; flex: 0 0 100%; }
.auth-card-wrap .card-header { font-size: 1.1rem; padding: 1.1rem 1.5rem; }
.auth-card-wrap .card-body { padding: 1.5rem; }
.auth-card-wrap .row.mb-3, .auth-card-wrap .row.mb-0 { display: block; margin-left: 0; margin-right: 0; }
.auth-card-wrap .row > [class*="col-"] { width: 100%; max-width: 100%; margin-left: 0 !important; padding: 0; text-align: left !important; }
.auth-card-wrap .col-form-label { padding: 0 0 .4rem; font-weight: 700; font-size: .85rem; }
.auth-card-wrap .btn-primary { width: 100%; margin-top: .25rem; }
.auth-card-wrap .btn-link { display: block; margin: .75rem auto 0; text-align: center; font-size: .85rem; color: var(--muted); }
.auth-card-wrap .btn-link:hover { color: var(--accent); }
.auth-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.25rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
.auth-footer a { color: var(--muted); }
.auth-footer a:hover { color: #fff; }
.auth-card-wrap .form-check{border:none;background:transparent;padding:.2rem 0 .2rem 1.8rem;margin-bottom:.9rem}.auth-card-wrap .form-check .form-check-input{margin-left:-1.8rem}
html body .page-container h2 { font-size: 1.25rem; }

/* nagłówek strony szczegółów (tytuł + meta + akcje) */
.back-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-weight: 700; font-size: .82rem; margin-bottom: .45rem; }
.back-link:hover { color: #fff; }
.page-header--detail { align-items: flex-end; }
.page-header--detail .page-title-block { min-width: 0; flex: 1 1 320px; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; color: var(--muted); font-size: .85rem; font-weight: 600; }
.page-meta i { margin-right: .25rem; opacity: .85; }
.page-header--detail .page-actions { flex: 0 1 auto; }
.page-actions .dropdown-menu .dropdown-item { width: 100%; background: transparent; border: 0; text-align: left; }
@media (max-width: 767.98px) {
    .page-header--detail .page-actions > .btn, .page-header--detail .page-actions > .dropdown { flex: 1 1 calc(50% - .55rem); }
    .page-header--detail .page-actions > .btn.btn-primary { flex-basis: 100%; }
    .page-header--detail .page-actions > .dropdown > .btn { width: 100%; }
}

/* przyklejona kolumna z nazwą w przewijanych tabelach (public/js/sticky-table.js) */
html body table.table th.sticky-col,
html body table.table td.sticky-col {
    position: sticky;
    left: var(--sticky-left, 0px);
    z-index: 2;
    background: var(--sticky-bg, #1b3050);
    background-clip: padding-box;
}
html body table.table thead th.sticky-col { z-index: 3; background: var(--sticky-head-bg, #243b5f); }
html body table.table tbody tr:hover td.sticky-col { background: #20395c; }
html body table.table .sticky-col.sticky-last { box-shadow: 6px 0 10px -6px rgba(0, 0, 0, .55); border-right: 1px solid var(--border-strong) !important; }
@media (max-width: 767.98px) { .page-header--detail .page-title-block { flex: 0 0 auto; } }

/* nagłówki sekcji list (trwające / nadchodzące / zakończone) */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-live { background: #ff6b7d; box-shadow: 0 0 0 4px rgba(255, 107, 125, .2); }
.dot-upcoming { background: var(--accent); box-shadow: 0 0 0 4px rgba(46, 200, 255, .2); }
.dot-finished { background: var(--accent-2); box-shadow: 0 0 0 4px rgba(125, 242, 200, .2); }
html body .section-title, html body main h4.section-title { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; font-weight: 800; color: var(--text) !important; margin: 1.75rem 0 .9rem; }
html body .page-container h2.text-success, html body .page-container h2.text-primary, html body .page-container h2.text-muted,
html body .page-container h3.text-success, html body .page-container h3.text-primary, html body .page-container h3.text-muted { color: var(--text) !important; display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; }
html body .page-container h4.text-success, html body .page-container h4.text-primary, html body .page-container h4.text-muted { color: var(--text) !important; display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; font-weight: 800; }
