/* =====================================================================
   TeamHub design system
   ===================================================================== */

:root {
    --th-bg: #f4f6fb;
    --th-surface: #ffffff;
    --th-surface-2: #f8fafc;
    --th-border: #e6e8ef;
    --th-text: #0f172a;
    --th-muted: #64748b;
    --th-primary: #4f46e5;
    --th-primary-2: #7c3aed;
    --th-primary-soft: #eef2ff;
    --th-success: #059669;
    --th-success-soft: #ecfdf5;
    --th-danger: #e11d48;
    --th-danger-soft: #fff1f2;
    --th-warning: #b45309;
    --th-warning-soft: #fffbeb;
    --th-info-soft: #eff6ff;
    --th-sidebar: #0b1120;
    --th-sidebar-2: #131c31;
    --th-radius: 14px;
    --th-shadow: 0 1px 2px rgb(15 23 42 / 4%), 0 4px 16px rgb(15 23 42 / 4%);
    --th-shadow-lg: 0 10px 40px rgb(15 23 42 / 12%);
    --th-font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--th-font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--th-text);
    background: var(--th-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--th-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

h1 {
    font-size: 1.6rem;
    font-weight: 750;
}

h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

h1:focus {
    outline: none;
}

p {
    margin: 0 0 0.75rem;
}

.icon {
    flex: none;
    vertical-align: middle;
}

.muted {
    color: var(--th-muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- App shell: sidebar + content ---------- */

.shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100vh;
    padding: 1.25rem 0.9rem;
    color: #cbd5e1;
    background: linear-gradient(180deg, var(--th-sidebar), var(--th-sidebar-2));
    overflow-y: auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.4rem;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.brand:hover {
    text-decoration: none;
}

.brand.dark {
    color: var(--th-text);
}

.brand-logo {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--th-primary), var(--th-primary-2));
    box-shadow: 0 4px 14px rgb(124 58 237 / 40%);
}

.brand-logo.small {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
}

.org-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    background: rgb(255 255 255 / 6%);
    border: 1px solid rgb(255 255 255 / 8%);
}

.org-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.nav-group {
    margin: 1rem 0 0.35rem;
    padding: 0 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    font-weight: 550;
    color: #cbd5e1;
    transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
    color: #fff;
    background: rgb(255 255 255 / 6%);
    text-decoration: none;
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgb(79 70 229 / 90%), rgb(124 58 237 / 90%));
    box-shadow: 0 4px 14px rgb(79 70 229 / 35%);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem;
    border-radius: 12px;
    background: rgb(255 255 255 / 5%);
    border: 1px solid rgb(255 255 255 / 8%);
}

.user-card form {
    margin: 0 0 0 auto;
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #06b6d4, var(--th-primary));
}

.user-info {
    min-width: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 650;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 0.75rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 10px;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.icon-btn:hover {
    background: rgb(148 163 184 / 18%);
}

.main {
    min-width: 0;
}

.content {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.mobile-bar {
    display: none;
}

.nav-toggle,
.backdrop {
    display: none;
}

@media (max-width: 960px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--th-shadow-lg);
    }

    .nav-toggle:checked ~ .sidebar {
        transform: none;
    }

    .nav-toggle:checked ~ .backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgb(15 23 42 / 45%);
    }

    .mobile-bar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.6rem 1rem;
        background: rgb(255 255 255 / 90%);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--th-border);
    }

    .mobile-bar .brand {
        color: var(--th-text);
        font-size: 1.05rem;
    }

    .content {
        padding: 1.25rem 1rem 3rem;
    }
}

/* ---------- Public (signed-out) pages ---------- */

.public-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
}

.public-actions {
    display: flex;
    gap: 0.5rem;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 3rem;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 15%, rgb(255 255 255 / 18%), transparent 35%),
        linear-gradient(135deg, #312e81, var(--th-primary) 45%, var(--th-primary-2));
    box-shadow: var(--th-shadow-lg);
}

.hero h1 {
    max-width: 18ch;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
}

.hero p {
    max-width: 52ch;
    margin: 1rem 0 2rem;
    font-size: 1.1rem;
    color: #e0e7ff;
}

.hero .btn-ghost {
    color: #fff;
    border-color: rgb(255 255 255 / 40%);
}

.hero .btn-ghost:hover {
    background: rgb(255 255 255 / 12%);
}

.hero .btn-primary {
    color: var(--th-primary);
    background: #fff;
    box-shadow: none;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.feature {
    padding: 1.25rem;
    border-radius: var(--th-radius);
    background: var(--th-surface);
    border: 1px solid var(--th-border);
    box-shadow: var(--th-shadow);
}

.feature h3 {
    margin: 0.75rem 0 0.25rem;
    font-size: 1rem;
}

.feature p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--th-muted);
}

/* ---------- Auth (login / registration) ---------- */

.auth {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) 1.1fr;
    min-height: 100vh;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem;
    color: #fff;
    background:
        radial-gradient(circle at 20% 80%, rgb(124 58 237 / 55%), transparent 45%),
        radial-gradient(circle at 90% 10%, rgb(6 182 212 / 35%), transparent 40%),
        linear-gradient(160deg, #0b1120, #1e1b4b);
}

.auth-pitch h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-pitch ul {
    display: grid;
    gap: 0.9rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
    color: #c7d2fe;
}

.auth-pitch li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-pitch li .icon {
    padding: 0.4rem;
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    color: #fff;
    background: rgb(255 255 255 / 10%);
}

.auth-foot {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

.auth-form {
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-card h1 {
    margin-bottom: 0.35rem;
    font-size: 1.75rem;
}

.auth-card > .muted {
    margin-bottom: 1.75rem;
}

@media (max-width: 860px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: 1.5rem;
    }

    .auth-pitch,
    .auth-foot {
        display: none;
    }
}

/* ---------- Page header ---------- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.page-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    color: var(--th-primary);
    background: var(--th-primary-soft);
}

.page-title .back {
    color: var(--th-muted);
}

.subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.92rem;
    color: var(--th-muted);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: 2.5rem;
    padding: 0 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--th-primary), var(--th-primary-2));
    box-shadow: 0 4px 14px rgb(79 70 229 / 30%);
}

.btn-primary:hover {
    box-shadow: 0 6px 18px rgb(79 70 229 / 40%);
}

.btn-ghost {
    color: var(--th-text);
    background: var(--th-surface);
    border-color: var(--th-border);
}

.btn-ghost:hover {
    background: var(--th-surface-2);
}

.btn-danger {
    color: var(--th-danger);
    background: var(--th-surface);
    border-color: #fecdd3;
}

.btn-danger:hover {
    background: var(--th-danger-soft);
}

.btn-sm {
    height: 2rem;
    padding: 0 0.7rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

/* ---------- Cards & stats ---------- */

.card {
    padding: 1.5rem;
    border-radius: var(--th-radius);
    background: var(--th-surface);
    border: 1px solid var(--th-border);
    box-shadow: var(--th-shadow);
}

.card + .card {
    margin-top: 1rem;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--th-radius);
    background: var(--th-surface);
    border: 1px solid var(--th-border);
    box-shadow: var(--th-shadow);
}

.stat-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
}

.stat-icon.indigo { color: var(--th-primary); background: var(--th-primary-soft); }
.stat-icon.green { color: var(--th-success); background: var(--th-success-soft); }
.stat-icon.amber { color: var(--th-warning); background: var(--th-warning-soft); }
.stat-icon.rose { color: var(--th-danger); background: var(--th-danger-soft); }

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--th-muted);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-radius: var(--th-radius);
    color: var(--th-text);
    background: var(--th-surface);
    border: 1px solid var(--th-border);
    box-shadow: var(--th-shadow);
    transition: border-color 0.15s, transform 0.15s;
}

.quick-action:hover {
    text-decoration: none;
    border-color: #c7d2fe;
    transform: translateY(-1px);
}

.quick-action strong {
    display: block;
}

.quick-action small {
    color: var(--th-muted);
}

.quick-action > .icon:last-child {
    margin-left: auto;
    color: var(--th-muted);
}

.progress {
    height: 0.5rem;
    margin-top: 0.6rem;
    border-radius: 999px;
    background: #eef0f5;
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--th-primary), var(--th-primary-2));
}

/* ---------- Forms ---------- */

.form {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    align-content: start; /* in a row of fields, a hint under one field must not push the others' inputs down */
    gap: 0.35rem;
    margin: 0;
}

.field > span:first-child {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.input,
input:not([type=checkbox]):not([type=radio]):not([type=file]),
select,
textarea {
    width: 100%;
    height: 2.65rem;
    padding: 0 0.85rem;
    font: inherit;
    color: var(--th-text);
    background: var(--th-surface);
    border: 1px solid #d5d9e3;
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    height: auto;
    min-height: 5rem;
    padding: 0.6rem 0.85rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--th-primary);
    box-shadow: 0 0 0 4px rgb(79 70 229 / 15%);
}

input:disabled,
select:disabled {
    color: var(--th-muted);
    background: var(--th-surface-2);
}

input[type=file] {
    font: inherit;
}

.input-icon {
    position: relative;
}

.input-icon > .icon {
    position: absolute;
    top: 50%;
    left: 0.8rem;
    color: var(--th-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

/* Same specificity as the generic input rule above, so this one wins. */
.input-icon > input:not([type=checkbox]):not([type=radio]):not([type=file]) {
    padding-left: 2.5rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.form-actions .spacer {
    flex: 1;
}

.hint {
    font-size: 0.82rem;
    color: var(--th-muted);
}

.validation-message {
    font-size: 0.82rem;
    color: var(--th-danger);
}

.invalid {
    border-color: var(--th-danger) !important;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.toolbar .input-icon {
    flex: 1 1 18rem;
}

.toolbar select {
    flex: 0 1 13rem;
    width: auto;
}

.dropzone {
    display: grid;
    justify-items: center;
    gap: 0.6rem;
    padding: 2rem 1rem;
    text-align: center;
    border: 2px dashed #c7d2fe;
    border-radius: var(--th-radius);
    background: #f8f9ff;
}

.dropzone .icon {
    color: var(--th-primary);
}

/* Segmented control (permission levels) */

.segmented {
    display: inline-flex;
    padding: 0.2rem;
    border-radius: 10px;
    background: #eef0f5;
}

.segmented label {
    position: relative;
    cursor: pointer;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--th-muted);
    transition: background 0.15s, color 0.15s;
}

.segmented input:checked + span {
    color: var(--th-text);
    background: #fff;
    box-shadow: 0 1px 3px rgb(15 23 42 / 12%);
}

.segmented input:checked + span.lvl-Read { color: #1d4ed8; }
.segmented input:checked + span.lvl-Write { color: var(--th-success); }

.segmented input:focus-visible + span {
    outline: 2px solid var(--th-primary);
}

.segmented input:disabled + span {
    cursor: not-allowed;
}

/* ---------- Alerts & badges ---------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.92rem;
}

.alert > .icon {
    margin-top: 0.1rem;
}

.alert-error { color: #9f1239; background: var(--th-danger-soft); border-color: #fecdd3; }
.alert-success { color: #065f46; background: var(--th-success-soft); border-color: #a7f3d0; }
.alert-warning { color: #92400e; background: var(--th-warning-soft); border-color: #fde68a; }
.alert-info { color: #1e40af; background: var(--th-info-soft); border-color: #bfdbfe; }

.alert ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 650;
    white-space: nowrap;
}

.badge-Write { color: #047857; background: var(--th-success-soft); }
.badge-Read { color: #1d4ed8; background: var(--th-info-soft); }
.badge-None { color: #94a3b8; background: #f1f5f9; }
.badge-admin { color: #6d28d9; background: #f5f3ff; }
.badge-neutral { color: #475569; background: #f1f5f9; }
.badge-danger { color: #be123c; background: var(--th-danger-soft); }

/* ---------- Generic data table ---------- */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--th-radius);
    background: var(--th-surface);
    border: 1px solid var(--th-border);
    box-shadow: var(--th-shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--th-muted);
    background: var(--th-surface-2);
    border-bottom: 1px solid var(--th-border);
}

.table td {
    padding: 0.8rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--th-border);
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table tbody tr:hover {
    background: var(--th-surface-2);
}

.table .person {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table .avatar {
    width: 2.1rem;
    height: 2.1rem;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.inline-form select {
    width: auto;
    min-width: 11rem;
    height: 2.1rem;
    font-size: 0.88rem;
}

.cell-actions {
    text-align: right;
    white-space: nowrap;
}

/* ---------- Pager ---------- */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    color: var(--th-muted);
    font-size: 0.9rem;
}

/* ---------- Jersey overview ---------- */

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--th-muted);
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.legend i {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 4px;
}

.jersey-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.jersey-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 7.5rem;
    padding: 0.9rem;
    border-radius: var(--th-radius);
    background: var(--th-surface);
    border: 1px solid var(--th-border);
    box-shadow: var(--th-shadow);
    overflow: hidden;
}

.jersey-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--th-primary), var(--th-primary-2));
}

.jersey-card.shared::before {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.jersey-card.free {
    background: transparent;
    border-style: dashed;
    box-shadow: none;
}

.jersey-card.free::before {
    display: none;
}

.jersey-num {
    font-size: 2rem;
    font-weight: 850;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--th-text);
}

.jersey-card.free .jersey-num {
    color: #cbd5e1;
}

.jersey-card .holder {
    overflow: hidden;
    font-size: 0.85rem;
    font-weight: 550;
    color: #334155;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jersey-card .holder.inactive {
    color: #94a3b8;
    text-decoration: line-through;
}

.jersey-card .free-label {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ---------- Roles ---------- */

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.role-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    border-radius: var(--th-radius);
    color: var(--th-text);
    background: var(--th-surface);
    border: 1px solid var(--th-border);
    box-shadow: var(--th-shadow);
    transition: border-color 0.15s, transform 0.15s;
}

a.role-card:hover {
    text-decoration: none;
    border-color: #c7d2fe;
    transform: translateY(-1px);
}

.role-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.role-head h2 {
    font-size: 1.05rem;
}

.role-head .badge {
    margin-left: auto;
}

.role-desc {
    margin: 0;
    font-size: 0.88rem;
    color: var(--th-muted);
}

.perm-list {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0.75rem 0 0;
    list-style: none;
    border-top: 1px solid var(--th-border);
}

.perm-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.88rem;
}

.perm-matrix td:first-child {
    font-weight: 600;
}

.perm-matrix .section-name {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ---------- Empty state ---------- */

.empty {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--th-muted);
    border: 1px dashed var(--th-border);
    border-radius: var(--th-radius);
    background: var(--th-surface);
}

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
    color-scheme: light only;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: none;
    width: 100%;
    padding: 0.6rem 1.25rem 0.7rem;
    background: lightyellow;
    box-shadow: 0 -1px 2px rgb(0 0 0 / 20%);
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    cursor: pointer;
}

.blazor-error-boundary {
    padding: 1rem;
    color: #fff;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "Došlo k chybě.";
}

/* ---------- Confirmation modal ---------- */

.modal {
    width: min(26rem, calc(100vw - 2rem));
    padding: 0;
    border: 0;
    border-radius: 18px;
    color: var(--th-text);
    background: var(--th-surface);
    box-shadow: var(--th-shadow-lg);
}

.modal::backdrop {
    background: rgb(15 23 42 / 50%);
    backdrop-filter: blur(3px);
}

.modal[open] {
    animation: modal-in 0.15s ease-out;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.modal form {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
}

.modal h2 {
    margin-top: 0.25rem;
}

.modal p {
    margin: 0;
    color: var(--th-muted);
}

.modal-icon {
    display: inline-grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    color: var(--th-danger);
    background: var(--th-danger-soft);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    margin-top: 1rem;
}

.modal-actions .btn {
    flex: 1;
}

.btn-danger-solid {
    color: #fff;
    background: var(--th-danger);
    box-shadow: 0 4px 14px rgb(225 29 72 / 30%);
}

.btn-danger-solid:hover {
    background: #be123c;
}

.btn-success {
    color: #fff;
    background: var(--th-success);
    box-shadow: 0 4px 14px rgb(5 150 105 / 30%);
}

.btn-success:hover {
    background: #047857;
}

/* ---------- Checkbox list (roles) ---------- */

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem;
}

.check-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--th-border);
    border-radius: 12px;
    background: var(--th-surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.check-card:hover {
    border-color: #c7d2fe;
}

.check-card:has(input:checked) {
    border-color: var(--th-primary);
    background: var(--th-primary-soft);
}

.check-card input {
    margin-top: 0.2rem;
    accent-color: var(--th-primary);
}

.check-card strong {
    display: block;
    font-size: 0.92rem;
}

.check-card small {
    color: var(--th-muted);
    font-size: 0.8rem;
}

.radio-list {
    display: grid;
    gap: 0.5rem;
}

.radio-list label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 550;
}

.radio-list input {
    accent-color: var(--th-primary);
}

/* ---------- Misc ---------- */

.info-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.45rem 1.25rem;
    margin: 0;
}

.info-list dt {
    color: var(--th-muted);
    font-size: 0.88rem;
}

.info-list dd {
    margin: 0;
    font-weight: 550;
}

.copy-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px dashed #c7d2fe;
    background: #f8f9ff;
}

.copy-box code {
    flex: 1 1 16rem;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    color: var(--th-primary);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.75rem 0 0.75rem;
    font-size: 1.05rem;
}

.pending-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: var(--th-radius);
    border: 1px solid #fde68a;
    background: var(--th-warning-soft);
}

.pending-card .grow {
    flex: 1 1 14rem;
    min-width: 0;
}

.pending-card + .pending-card {
    margin-top: 0.6rem;
}

.badge-warning { color: #92400e; background: #fef3c7; }

.user-card a.user-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    color: inherit;
}

.user-card a.user-link:hover {
    text-decoration: none;
}

.user-card a.user-link:hover .user-name {
    text-decoration: underline;
}

/* ---------- Photos & teams ---------- */

.photo-editor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.photo-actions {
    display: grid;
    gap: 0.6rem;
    flex: 1 1 16rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.team-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem;
    border-radius: var(--th-radius);
    color: var(--th-text);
    background: var(--th-surface);
    border: 1px solid var(--th-border);
    box-shadow: var(--th-shadow);
    transition: border-color 0.15s, transform 0.15s;
}

.team-card:hover {
    text-decoration: none;
    border-color: #c7d2fe;
    transform: translateY(-1px);
}

.team-card h2 {
    font-size: 1.05rem;
}

.team-card p {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--th-muted);
}

.team-card > .icon:last-child {
    margin-left: auto;
    color: var(--th-muted);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem 0.3rem 0.3rem;
    border-radius: 999px;
    color: var(--th-text);
    background: var(--th-surface-2);
    border: 1px solid var(--th-border);
    font-size: 0.88rem;
}

.chip:hover {
    text-decoration: none;
    border-color: #c7d2fe;
}

.consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: var(--th-surface-2);
    border: 1px solid var(--th-border);
    font-size: 0.88rem;
    font-weight: 500;
}

.consent input {
    margin-top: 0.2rem;
    accent-color: var(--th-primary);
}

.prose {
    max-width: 52rem;
}

.prose h2 {
    margin: 1.75rem 0 0.5rem;
}

.prose ul {
    padding-left: 1.2rem;
}

.prose li {
    margin-bottom: 0.3rem;
}
