:root {
    --bg: #f4f1e8;
    --surface: #fffdf8;
    --surface-strong: #fff8ef;
    --line: #d6c8b4;
    --text: #1d1b18;
    --muted: #6b645a;
    --primary: #8b1e1e;
    --primary-dark: #661313;
    --accent: #1d5f3a;
    --accent-soft: #e8f2ec;
    --warning: #d79a18;
    --shadow: 0 18px 40px rgba(54, 37, 16, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(139, 30, 30, 0.09), transparent 28%),
        radial-gradient(circle at top right, rgba(29, 95, 58, 0.14), transparent 22%),
        linear-gradient(180deg, #faf7f1 0%, var(--bg) 100%);
    font-family: "Segoe UI", "Aptos", Tahoma, Geneva, Verdana, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.auth-card {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid rgba(139, 30, 30, 0.12);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.auth-brand {
    position: relative;
    padding: 3rem;
    background:
        radial-gradient(circle at top right, rgba(255, 210, 120, 0.22), transparent 22%),
        radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.12), transparent 24%),
        linear-gradient(160deg, rgba(139, 30, 30, 0.97), rgba(102, 19, 19, 0.94)),
        linear-gradient(120deg, rgba(255,255,255,0.16), rgba(255,255,255,0));
    color: #fff5eb;
}

.auth-brand-top {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.auth-eyebrow-light {
    color: rgba(255,245,235,0.72);
}

.auth-brand-logo {
    display: block;
    width: min(280px, 100%);
    max-height: 88px;
    object-fit: contain;
    padding: 0.85rem 1rem;
    border-radius: 22px;
    background: rgba(255, 248, 241, 0.94);
    box-shadow: 0 12px 24px rgba(44, 16, 10, 0.22);
}

.auth-brand h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    line-height: 0.95;
}

.auth-brand p {
    max-width: 34rem;
    color: rgba(255, 245, 235, 0.82);
    line-height: 1.6;
}

.auth-stage {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 0.7rem;
    margin-top: 1.7rem;
    padding: 1.2rem 1.25rem;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 247, 238, 0.12), rgba(255, 247, 238, 0.04));
    border: 1px solid rgba(255, 245, 235, 0.16);
}

.auth-stage-compact {
    margin-top: 1.3rem;
}

.auth-stage-court {
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(255, 245, 235, 0.18);
    border-radius: 18px;
    pointer-events: none;
}

.auth-stage-court::before,
.auth-stage-court::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 245, 235, 0.18);
    pointer-events: none;
}

.auth-stage-court::before {
    top: 16%;
    bottom: 16%;
    left: 50%;
    transform: translateX(-50%);
}

.auth-stage-court::after {
    width: 96px;
    height: 96px;
    top: 50%;
    left: 50%;
    border-radius: 999px;
    transform: translate(-50%, -50%);
}

.auth-stage-ball {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.auth-stage-ball-main {
    right: -34px;
    top: -24px;
    width: 120px;
    height: 120px;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 230, 165, 0.95), rgba(243, 136, 45, 0.96) 48%, rgba(183, 68, 18, 0.98) 100%);
    box-shadow: inset -10px -14px 24px rgba(112, 31, 12, 0.3);
    opacity: 0.92;
}

.auth-stage-ball-soft {
    left: -26px;
    bottom: -30px;
    width: 96px;
    height: 96px;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 237, 194, 0.34), rgba(244, 162, 77, 0.2) 50%, rgba(183, 68, 18, 0.12) 100%);
}

.auth-stage-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.35rem;
    max-width: 26rem;
}

.auth-stage-copy strong {
    display: block;
    font-size: 1rem;
}

.auth-stage-copy span {
    color: rgba(255, 245, 235, 0.82);
    line-height: 1.5;
}

.auth-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.auth-kpi {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 245, 235, 0.12);
    border: 1px solid rgba(255, 245, 235, 0.16);
    backdrop-filter: blur(10px);
}

.auth-kpi strong {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 0.35rem;
}

.auth-kpi span {
    color: rgba(255, 245, 235, 0.82);
    line-height: 1.5;
}

.auth-form {
    padding: 3rem;
}

.eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary);
}

.title {
    margin: 0;
    font-size: 2rem;
}

.subtitle {
    margin: 0.65rem 0 2rem;
    color: var(--muted);
    line-height: 1.6;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
}

.field input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font: inherit;
    color: var(--text);
}

.field select {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font: inherit;
    color: var(--text);
}

.field input:focus {
    outline: 2px solid rgba(139, 30, 30, 0.18);
    border-color: var(--primary);
}

.field select:focus {
    outline: 2px solid rgba(139, 30, 30, 0.18);
    border-color: var(--primary);
}

.field input[readonly] {
    background: #f4efe7;
    color: #5d554c;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 6.4rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.6rem;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    background: rgba(139, 30, 30, 0.08);
    color: var(--primary);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.password-toggle:hover {
    background: rgba(139, 30, 30, 0.14);
}

.auth-actions {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.8rem 1.15rem;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(139, 30, 30, 0.18);
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.button.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.button.secondary:hover {
    background: rgba(255, 255, 255, 0.72);
}

.button.full {
    width: 100%;
}

.error-list,
.flash {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    line-height: 1.5;
}

.error-list {
    background: #fce8e8;
    border: 1px solid #e9b8b8;
    color: #7c1d1d;
}

.flash {
    background: var(--accent-soft);
    border: 1px solid rgba(29, 95, 58, 0.16);
    color: var(--accent);
}

.import-summary-list {
    display: grid;
    gap: 0.65rem;
}

.import-summary-item {
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(29, 95, 58, 0.1);
}

.import-summary-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.2rem;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
    transition: grid-template-columns 180ms ease;
}

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    padding: 2rem 1.4rem;
    background:
        linear-gradient(180deg, rgba(139, 30, 30, 0.97), rgba(102, 19, 19, 0.92)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
    color: #fff5eb;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    transition: opacity 180ms ease, transform 180ms ease, padding 180ms ease;
}

.brand {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 88px;
    padding: 0.9rem;
    border-radius: 18px;
    background: rgba(255, 248, 241, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.brand-mark > img {
    display: block;
    width: 100%;
    max-width: 170px;
    max-height: 72px;
    object-fit: contain;
    opacity: 1;
}

.brand-copy {
    display: grid;
    gap: 0.18rem;
}

.brand strong {
    display: block;
    font-size: 1.3rem;
}

.brand span {
    display: block;
    color: rgba(255, 245, 235, 0.78);
    line-height: 1.5;
}

.nav-group {
    margin-top: 1.5rem;
}

.nav-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0.15rem 0.7rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 245, 235, 0.56);
    cursor: pointer;
    list-style: none;
}

.nav-title::-webkit-details-marker {
    display: none;
}

.nav-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 245, 235, 0.18);
    font-size: 0.78rem;
    line-height: 1;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.nav-section[open] .nav-title-icon {
    transform: rotate(45deg);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.nav-section-links {
    padding-top: 0.15rem;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: rgba(255, 245, 235, 0.84);
    transition: 160ms ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-footer {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 245, 235, 0.72);
    line-height: 1.5;
}

.content {
    padding: clamp(1.4rem, 2vw, 2rem);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.topbar-heading {
    display: grid;
    gap: 0.65rem;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    width: fit-content;
    padding: 0.7rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(139, 30, 30, 0.18);
    background: rgba(255, 248, 241, 0.92);
    color: #6f1e1e;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(111, 30, 30, 0.08);
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.sidebar-toggle:hover {
    transform: translateY(-1px);
    background: #fff;
    box-shadow: 0 14px 34px rgba(111, 30, 30, 0.12);
}

.sidebar-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    background: rgba(139, 30, 30, 0.12);
    line-height: 1;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.6rem);
}

.topbar p {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.user-menu {
    position: relative;
}

.user-menu summary {
    list-style: none;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

body.sidebar-collapsed .app-shell {
    grid-template-columns: 0 1fr;
}

body.sidebar-collapsed .sidebar {
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    transform: translateX(-18px);
    pointer-events: none;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0.7rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(214, 200, 180, 0.9);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.user-menu-avatar {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #2b7a4a);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
}

.user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    min-width: 240px;
    padding: 0.5rem;
    border-radius: 20px;
    border: 1px solid rgba(214, 200, 180, 0.9);
    background: rgba(255, 252, 247, 0.98);
    box-shadow: var(--shadow);
    z-index: 20;
}

.user-menu-panel a,
.user-menu-panel button {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 0.85rem 0.95rem;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
    background: rgba(139, 30, 30, 0.08);
}

.row-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.panel {
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.97), rgba(255, 249, 242, 0.96));
    border: 1px solid rgba(139, 30, 30, 0.1);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 1.6rem;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,248,239,0.96)),
        linear-gradient(120deg, rgba(29,95,58,0.08), rgba(139,30,30,0.06));
}

.hero-grid,
.stats-grid,
.table-grid {
    display: grid;
    gap: 1rem;
}

.hero-grid {
    grid-template-columns: 1.35fr 0.65fr;
}

.stats-grid {
    margin-top: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.mini-card,
.table-card {
    padding: 1.25rem;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid rgba(139, 30, 30, 0.08);
}

.stat-card strong,
.mini-card strong {
    display: block;
    margin-top: 0.5rem;
    font-size: 1.8rem;
}

.muted {
    color: var(--muted);
}

.status-list {
    display: grid;
    gap: 0.7rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: var(--surface-strong);
    border: 1px solid rgba(29, 95, 58, 0.08);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.status-pill.ok {
    background: rgba(29, 95, 58, 0.12);
    color: var(--accent);
}

.status-pill.pending {
    background: rgba(215, 154, 24, 0.15);
    color: #8a6106;
}

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

.table-card th,
.table-card td {
    padding: 0.85rem 0.5rem;
    border-bottom: 1px solid rgba(214, 200, 180, 0.8);
    text-align: left;
}

.table-card th {
    color: #fff8f0;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, rgba(140, 58, 40, 0.96), rgba(102, 19, 19, 0.96));
    position: sticky;
    top: 0;
    z-index: 1;
}

.table-card tbody tr:hover {
    background: rgba(29, 95, 58, 0.03);
}

.table-card tbody tr:last-child td {
    border-bottom: 0;
}

.table-meta strong {
    display: block;
    font-weight: 700;
    color: var(--text);
}

.table-meta span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.section-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.section-head p {
    margin: 0.4rem 0 0;
    color: var(--muted);
    max-width: 60rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.stats-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.stats-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card small {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stats-inline-note {
    display: block;
    margin-top: 0.45rem;
    color: var(--muted);
    line-height: 1.45;
}

.filter-bar {
    margin-bottom: 1rem;
}

.compact-filter-bar {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem 1rem;
    border-radius: 18px;
    background: rgba(255, 250, 244, 0.72);
    border: 1px solid rgba(214, 200, 180, 0.55);
}

.compact-form-grid {
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 0.85rem;
}

.compact-filter-bar .field {
    margin-bottom: 0;
}

.compact-filter-bar .field label {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.compact-filter-bar .field input,
.compact-filter-bar .field select {
    padding: 0.72rem 0.9rem;
    border-radius: 12px;
}

.compact-filter-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}

.teams-page {
    padding-top: 1rem;
}

.teams-filter-panel {
    margin-bottom: 1rem;
    padding: 1rem 1rem 0.95rem;
    border-radius: 18px;
    background: rgba(255, 250, 244, 0.72);
    border: 1px solid rgba(214, 200, 180, 0.55);
}

.teams-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.1fr;
    gap: 0.85rem;
    align-items: end;
}

.teams-field,
.teams-search-field {
    margin-bottom: 0;
}

.teams-field label,
.teams-search-field label {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.teams-field input,
.teams-field select,
.teams-search-field input {
    padding: 0.72rem 0.9rem;
    border-radius: 10px;
}

.teams-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-top: 0.95rem;
    flex-wrap: wrap;
}

.teams-toolbar-summary {
    font-size: 0.94rem;
    color: var(--muted);
}

.teams-toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.teams-search-field {
    min-width: 240px;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 18px;
}

.teams-table {
    width: 100%;
}

.teams-table th,
.teams-table td {
    padding-top: 0.72rem;
    padding-bottom: 0.72rem;
}

.teams-table th {
    background: rgba(123, 57, 40, 0.08);
    color: var(--text);
    position: sticky;
    top: 0;
    backdrop-filter: blur(8px);
}

.teams-table td:last-child,
.teams-table th:last-child {
    text-align: center;
}

.secret-user-delete-trigger {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: default;
}

.teams-pagination {
    margin-top: 0.8rem;
}

.stats-team-cell {
    display: grid;
    gap: 0.45rem;
}

.stats-team-cell strong {
    display: block;
}

.stats-team-meter {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(139, 30, 30, 0.08);
    overflow: hidden;
}

.stats-team-meter-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d28a53, #8b1e1e);
}

.pagination {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(214, 200, 180, 0.8);
}

.pagination span {
    color: var(--muted);
}

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

.button.ghost {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 239, 0.98));
    color: var(--primary);
    border: 1px solid rgba(139, 30, 30, 0.18);
}

.profile-shell {
    display: grid;
    gap: 1.25rem;
}

.profile-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
    padding: 1.6rem;
    background:
        radial-gradient(circle at top right, rgba(255, 211, 162, 0.45), transparent 28%),
        radial-gradient(circle at bottom left, rgba(163, 197, 92, 0.22), transparent 30%),
        linear-gradient(135deg, rgba(255, 251, 245, 0.96), rgba(255, 243, 229, 0.98));
}

.profile-kicker {
    margin: 0 0 0.6rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #9a4a22;
}

.profile-hero h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.profile-hero p:last-child {
    margin: 0.55rem 0 0;
    max-width: 42rem;
    color: var(--muted);
    line-height: 1.6;
}

.profile-badges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.profile-badge {
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(154, 74, 34, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.profile-badge span {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a4a22;
}

.profile-badge strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.35rem;
}

.profile-form {
    display: grid;
    gap: 1.25rem;
}

.profile-section {
    padding: 1.35rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 242, 0.98));
}

.profile-section-head {
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(154, 74, 34, 0.12);
}

.profile-section-tag {
    display: inline-flex;
    align-items: center;
    margin: 0 0 0.45rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(139, 30, 30, 0.1);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-section-head h3 {
    margin: 0;
    font-size: 1.25rem;
}

.profile-section-head p {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.profile-grid .field {
    margin-bottom: 0;
}

.profile-grid .field label {
    font-size: 0.95rem;
    color: #5a3324;
}

.profile-grid .field input,
.profile-grid .field select {
    border-radius: 16px;
    border-color: rgba(154, 74, 34, 0.16);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.profile-grid .field input[readonly] {
    background: #f6efe6;
}

.profile-retencion {
    grid-column: 1 / -1;
    max-width: 720px;
}

.profile-retencion-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
}

.profile-retencion-wrap input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.profile-retencion-wrap span {
    display: grid;
    place-items: center;
    border: 1px solid rgba(154, 74, 34, 0.16);
    border-left: 0;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    background: linear-gradient(180deg, #9a3f24, #7e2c17);
    color: #fff4ea;
    font-weight: 800;
}

.profile-certificate-card {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(29, 95, 58, 0.08), rgba(255, 255, 255, 0.72));
    border: 1px solid rgba(29, 95, 58, 0.14);
}

.profile-certificate-card strong {
    display: block;
    margin-bottom: 0.45rem;
}

.profile-certificate-card p {
    margin: 0 0 0.75rem;
    color: var(--muted);
    word-break: break-word;
}

.profile-certificate-card label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.1rem;
}

.profile-method-card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    border: 1px solid rgba(154, 74, 34, 0.14);
    background: linear-gradient(180deg, rgba(255, 248, 241, 0.96), rgba(255, 255, 255, 0.92));
}

.profile-method-card input {
    margin: 0;
}

.profile-method-card strong {
    font-size: 1rem;
    color: #5f2415;
}

.profile-method-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.profile-signature-assets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.profile-signature-card {
    padding: 1.1rem;
    border-radius: 24px;
    border: 1px solid rgba(154, 74, 34, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 241, 0.85));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.profile-signature-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.profile-signature-head h4 {
    margin: 0.2rem 0 0;
    font-size: 1.15rem;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-chip.is-ready {
    background: rgba(29, 95, 58, 0.14);
    color: #1d5f3a;
}

.profile-chip.is-pending {
    background: rgba(154, 74, 34, 0.12);
    color: #8a3a21;
}

.profile-signature-preview {
    margin-top: 0.9rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px dashed rgba(154, 74, 34, 0.28);
    background:
        radial-gradient(circle at top left, rgba(255, 208, 173, 0.34), transparent 45%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(252, 245, 238, 0.92));
}

.profile-signature-preview img {
    display: block;
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.signature-pad-shell {
    margin-top: 0.35rem;
    border-radius: 20px;
    border: 1px solid rgba(154, 74, 34, 0.18);
    background:
        radial-gradient(circle at top left, rgba(255, 209, 177, 0.32), transparent 40%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 245, 238, 0.94));
    overflow: hidden;
}

.signature-pad {
    display: block;
    width: 100%;
    height: 220px;
    touch-action: none;
    cursor: crosshair;
}

.signature-pad-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.profile-signature-empty {
    margin-top: 0.9rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: rgba(154, 74, 34, 0.06);
    color: var(--muted);
}

.profile-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.9rem;
}

.signature-upload-fallback {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(154, 74, 34, 0.18);
}

.signature-upload-fallback summary {
    cursor: pointer;
    font-weight: 700;
    color: #6e2d18;
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.recibo-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}

.recibo-summary-card {
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 239, 0.95));
    border: 1px solid rgba(154, 74, 34, 0.12);
}

.recibo-summary-card span {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a3a21;
}

.recibo-summary-card strong {
    display: block;
    margin-top: 0.55rem;
    font-size: 1.5rem;
}

.recibo-summary-card.is-net {
    background: linear-gradient(135deg, rgba(29, 95, 58, 0.12), rgba(255, 255, 255, 0.96));
    border-color: rgba(29, 95, 58, 0.16);
}

.dashboard-shell {
    display: grid;
    gap: 1rem;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 1rem;
    padding: 1.5rem;
    background:
        radial-gradient(circle at top right, rgba(255, 205, 168, 0.38), transparent 26%),
        radial-gradient(circle at bottom left, rgba(77, 140, 100, 0.18), transparent 30%),
        linear-gradient(135deg, rgba(255, 252, 246, 0.96), rgba(255, 244, 232, 0.98));
}

.dashboard-hero-copy h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.dashboard-hero-copy p:last-child {
    margin: 0.7rem 0 0;
    max-width: 46rem;
    color: var(--muted);
    line-height: 1.6;
}

.dashboard-hero-badges {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.dashboard-season-picker {
    align-self: start;
    padding: 1.1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(139, 30, 30, 0.1);
}

.dashboard-season-picker label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a3a21;
}

.dashboard-season-picker-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-kpi {
    padding: 1.15rem 1.2rem;
    border-radius: 24px;
    color: #fff;
    box-shadow: var(--shadow);
}

.dashboard-kpi span {
    display: block;
    opacity: 0.82;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-kpi strong {
    display: block;
    margin-top: 0.65rem;
    font-size: clamp(1.8rem, 3vw, 2.2rem);
}

.dashboard-kpi p {
    margin: 0.45rem 0 0;
    color: rgba(255, 255, 255, 0.86);
}

.dashboard-kpi.is-primary {
    background: linear-gradient(135deg, #c5344f, #6d0818);
}

.dashboard-kpi.is-success {
    background: linear-gradient(135deg, #38b95f, #117235);
}

.dashboard-kpi.is-info {
    background: linear-gradient(135deg, #35b0d2, #216ca4);
}

.dashboard-kpi.is-dark {
    background: linear-gradient(135deg, #49525b, #232a30);
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1rem;
}

.dashboard-trend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-panel {
    padding: 1.25rem;
}

.dashboard-category-list {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dashboard-category-row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(160px, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
}

.dashboard-category-meta strong {
    display: block;
}

.dashboard-category-meta span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.dashboard-category-bar-shell {
    height: 12px;
    border-radius: 999px;
    background: rgba(139, 30, 30, 0.08);
    overflow: hidden;
}

.dashboard-category-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #bf5a44, #8b1e1e);
}

.dashboard-category-pct {
    min-width: 52px;
    text-align: right;
}

.dashboard-table-compact th,
.dashboard-table-compact td {
    font-size: 0.92rem;
}

.dashboard-upcoming-list {
    display: grid;
    gap: 0.8rem;
}

.dashboard-upcoming-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: center;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(255, 250, 244, 0.88);
    border: 1px solid rgba(214, 200, 180, 0.6);
}

.dashboard-upcoming-date strong,
.dashboard-upcoming-body strong,
.dashboard-upcoming-side strong {
    display: block;
}

.dashboard-upcoming-date span,
.dashboard-upcoming-body span {
    display: block;
    margin-top: 0.22rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.dashboard-upcoming-side {
    text-align: right;
}

.dashboard-season-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.dashboard-season-summary .mini-card {
    background: rgba(255, 252, 247, 0.82);
}

.dashboard-inline-stats {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: center;
}

.dashboard-inline-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.dashboard-inline-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 248, 241, 0.96);
    border: 1px solid rgba(139, 30, 30, 0.1);
    color: var(--text);
}

.dashboard-inline-tag strong {
    font-size: 0.84rem;
}

.dashboard-inline-tag span {
    color: var(--muted);
    font-size: 0.82rem;
}

.dashboard-trend-chart {
    display: flex;
    align-items: end;
    gap: 0.9rem;
    min-height: 250px;
    padding: 0.75rem 0.35rem 0.1rem;
}

.dashboard-trend-column {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    gap: 0.45rem;
    min-width: 0;
}

.dashboard-trend-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
}

.dashboard-trend-track {
    position: relative;
    display: flex;
    align-items: end;
    width: 100%;
    height: 180px;
    padding: 0 0.15rem;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 239, 230, 0.8));
    border: 1px solid rgba(214, 200, 180, 0.72);
    overflow: hidden;
}

.dashboard-trend-track::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            to top,
            rgba(139, 30, 30, 0.04) 0,
            rgba(139, 30, 30, 0.04) 1px,
            transparent 1px,
            transparent 25%
        );
    pointer-events: none;
}

.dashboard-trend-bar {
    position: relative;
    width: 100%;
    min-height: 10px;
    border-radius: 16px 16px 8px 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
    z-index: 1;
}

.dashboard-trend-bar.is-success {
    background: linear-gradient(180deg, #72be68, #398d3a);
}

.dashboard-trend-bar.is-info {
    background: linear-gradient(180deg, #64abef, #2d73c6);
}

.dashboard-trend-column span {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
}

.table-card tfoot td {
    font-weight: 800;
    background: rgba(214, 200, 180, 0.35);
}

.error-text {
    color: #8f1d16;
}

.import-extra-stack {
    display: grid;
    gap: 0.45rem;
    min-width: 220px;
}

.import-extra-stack label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
}

.import-extra-stack input[type="checkbox"] {
    margin: 0;
}

.import-extra-note {
    line-height: 1.45;
}

@media (max-width: 1100px) {
    .auth-card,
    .app-shell,
    .hero-grid,
    .stats-grid,
    .table-grid,
    .dashboard-kpis,
    .dashboard-main-grid,
    .dashboard-trend-grid,
    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: auto;
    }

    body.sidebar-collapsed .sidebar {
        min-height: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .profile-hero,
    .profile-grid,
    .profile-methods,
    .profile-signature-assets,
    .compact-form-grid,
    .recibo-summary-grid,
    .dashboard-season-summary {
        grid-template-columns: 1fr;
    }

    .teams-filter-grid,
    .teams-toolbar {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .teams-search-field {
        min-width: 0;
        width: 100%;
    }

    .dashboard-category-row,
    .dashboard-upcoming-card,
    .dashboard-season-picker-row {
        grid-template-columns: 1fr;
    }

    .dashboard-upcoming-side {
        text-align: left;
    }
}

@media (max-width: 720px) {
    .auth-shell,
    .content {
        padding: 1rem;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .sidebar-toggle {
        width: 100%;
        justify-content: center;
    }

    .auth-brand,
    .auth-form,
    .hero,
    .stat-card,
    .table-card,
    .mini-card {
        padding: 1.15rem;
    }
}
