:root {
    --navy: #123b6d;
    --navy-dark: #092b53;
    --blue: #1f78d1;
    --blue-soft: #eaf4ff;
    --cyan: #38a9df;
    --green: #1f9d68;
    --orange: #e78b23;
    --red: #d84848;
    --ink: #152536;
    --muted: #66788a;
    --line: #dce5ed;
    --surface: #fff;
    --background: #f4f7fa;
    --shadow: 0 8px 24px rgba(24, 52, 78, .07);
    --role-color: #66727e;
    --role-dark: #444f59;
    --role-soft: #eef1f3;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.role-club { --role-color: #68747f; --role-dark: #414b54; --role-soft: #edf0f2; }
body.role-trainer { --role-color: #e57b18; --role-dark: #a94d0a; --role-soft: #fff0df; }
body.role-member { --role-color: #1976c9; --role-dark: #0c477d; --role-soft: #e7f3ff; }

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); }
button, select { font: inherit; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; display: flex; flex-direction: column; background: var(--role-dark); color: #fff; z-index: 20; overflow-y: auto; transition: background .2s ease; }
.brand { min-height: 86px; padding: 18px 22px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--navy); font-weight: 900; font-size: 14px; transform: rotate(-3deg); }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 18px; }
.brand span { margin-top: 2px; font-size: 12px; color: #b9cbe0; }
.nav { padding: 18px 12px; display: grid; gap: 5px; }
.nav-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.nav-group-title { padding: 0 14px 7px; color: #8fa7bf; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.nav-subitem { min-height: 40px; font-size: 13px; font-weight: 550; }
.nav-item { min-height: 46px; padding: 0 14px; border-radius: 10px; display: flex; align-items: center; gap: 12px; color: #d7e2ef; font-size: 14px; font-weight: 600; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { color: #fff; background: var(--role-color); box-shadow: 0 5px 15px rgba(0,0,0,.12); }
.nav-icon { width: 20px; text-align: center; opacity: .9; }
.nav-icon::before { content: "•"; font-size: 24px; line-height: 1; }
.nav-icon[data-icon="grid"]::before { content: "▦"; }
.nav-icon[data-icon="users"]::before { content: "♙"; }
.nav-icon[data-icon="calendar"]::before { content: "▣"; }
.nav-icon[data-icon="message"]::before { content: "▱"; }
.nav-icon[data-icon="check"]::before { content: "✓"; }
.nav-icon[data-icon="file"]::before { content: "▤"; }
.nav-icon[data-icon="building"]::before { content: "▥"; }
.nav-icon[data-icon="website"]::before { content: "◎"; }
.nav-icon[data-icon="swap"]::before { content: "⇄"; font-size: 18px; }
.nav-icon[data-icon="pitch"]::before { content: "▭"; }
.nav-icon[data-icon="cabin"]::before { content: "▥"; }
.nav-icon[data-icon="closure"]::before { content: "⊘"; }
.nav-icon[data-icon="monitor"]::before { content: "▣"; }
.nav-icon[data-icon="book"]::before { content: "▤"; }
.nav-icon[data-icon="help"]::before { content: "?"; font-size: 15px; font-weight: 900; }
.nav-icon[data-icon="roles"]::before { content: "♙"; }
.nav-icon[data-icon="attendance"]::before { content: "✓"; }
.nav-icon[data-icon="training"]::before { content: "◇"; }
.nav-icon[data-icon="settings"]::before { content: "⚙"; font-size: 17px; }
.nav-icon[data-icon="shield"]::before { content: "◇"; }
.nav-icon[data-icon="shirt"]::before { content: "♢"; }
.sidebar-bottom { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.version { display: block; padding: 12px 14px 4px; color: #8fa7bf; font-size: 11px; }
.page { width: calc(100% - 272px); margin-left: 272px; }
.topbar { height: 72px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.view-identity { min-width: 190px; display: flex; align-items: center; gap: 10px; }
.view-identity strong, .view-identity small { display: block; }
.view-identity strong { color: var(--role-dark); font-size: 15px; }
.view-identity small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.view-marker { width: 10px; height: 34px; border-radius: 8px; background: var(--role-color); }
.top-actions { display: flex; align-items: center; gap: 14px; }
.role-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #f5f7f9; }
.role-switch a { padding: 8px 11px; border-radius: 8px; color: #5e6d7a; font-size: 11px; font-weight: 750; white-space: nowrap; }
.role-switch a.active { color: #fff; background: var(--role-color); box-shadow: 0 3px 8px rgba(25, 50, 75, .16); }
.role-switch-club:hover { background: #e4e8eb; }
.role-switch-trainer:hover { background: #fff0df; color: #a94d0a; }
.role-switch-member:hover { background: #e7f3ff; color: #0c477d; }
.language-picker { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.language-picker select { padding: 9px 30px 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.avatar { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; }
.menu-button { display: none; }
.content { width: min(1440px, 100%); margin: 0 auto; padding: 34px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--blue); text-transform: uppercase; letter-spacing: .09em; font-size: 11px; font-weight: 800; }
h1 { margin: 0; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.03em; }
.page-heading p:last-child { margin: 8px 0 0; color: var(--muted); }
.date-chip { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 13px; white-space: nowrap; }
.alert { margin-bottom: 20px; padding: 16px 18px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; border: 1px solid #f4d59e; border-left: 4px solid var(--orange); border-radius: 12px; background: #fff8e9; }
.alert-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 900; }
.alert p { margin: 3px 0 0; color: #6f5b38; font-size: 13px; }
.alert a { color: #8a5511; font-weight: 700; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { min-height: 100px; padding: 20px; display: flex; align-items: center; gap: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { font-size: 27px; line-height: 1; }
.stat-card div span { margin-top: 7px; color: var(--muted); font-size: 12px; }
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.cyan { color: #2387b8; background: #e5f7ff; }
.stat-icon.green { color: var(--green); background: #e6f7ef; }
.stat-icon.orange { color: var(--orange); background: #fff1df; }
.panel { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { min-height: 58px; padding: 0 20px; display: flex; align-items: center; gap: 10px; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 16px; }
.panel-heading a { color: var(--blue); font-size: 12px; font-weight: 700; }
.count { min-width: 25px; height: 25px; padding: 0 7px; display: grid; place-items: center; border-radius: 20px; background: #fff0db; color: #a45b00; font-size: 12px; font-weight: 800; }
.quick-panel { margin-bottom: 18px; }
.quick-actions { padding: 14px 18px 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.quick-actions button { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; color: var(--navy); font-size: 13px; font-weight: 700; cursor: pointer; }
.quick-actions button:first-child { border-color: var(--blue); background: var(--blue); color: #fff; }
.quick-actions button span { margin-right: 7px; font-size: 17px; }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; align-items: start; }
.tasks-panel { grid-column: 2; }
.event-list { padding: 6px 18px; }
.event { min-height: 74px; display: grid; grid-template-columns: 64px 3px 1fr auto; align-items: center; gap: 13px; border-bottom: 1px solid #edf1f4; }
.event:last-child { border-bottom: 0; }
.event-time strong, .event-time span, .event div:nth-child(3) strong, .event div:nth-child(3) span { display: block; }
.event-time strong { font-size: 13px; }
.event-time span, .event div:nth-child(3) span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.event div:nth-child(3) strong { font-size: 13px; }
.event-line { width: 3px; height: 40px; border-radius: 4px; }
.green { background-color: var(--green); }.blue { background-color: var(--blue); }.orange { background-color: var(--orange); }.red { background-color: var(--red); }
.tag { padding: 5px 8px; border-radius: 12px; color: #fff; font-size: 10px; font-weight: 800; white-space: nowrap; }
.event.muted { opacity: .68; }
.news-card { padding: 22px; }
.news-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.badge { padding: 5px 8px; border-radius: 6px; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.news-card h3 { margin: 17px 0 8px; font-size: 20px; line-height: 1.25; }
.news-card p { margin: 0; color: #475b6e; line-height: 1.6; font-size: 13px; }
.translation-note { margin-top: 14px; padding: 10px; border-radius: 7px; background: #f4f7fa; color: var(--muted); font-size: 11px; }
.translation-note[hidden] { display: none; }
.translation-button { margin-top: 15px; padding: 8px 11px; border: 1px solid #b9d8f5; border-radius: 8px; background: #f3f9ff; color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 800; }
.translation-button span:first-child { margin-right: 5px; }
.task { min-height: 70px; padding: 14px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.task:last-child { border-bottom: 0; }
.task input { width: 18px; height: 18px; accent-color: var(--blue); }
.task strong, .task small { display: block; }
.task strong { font-size: 13px; }
.task small { margin-top: 4px; color: var(--muted); }
.scrim { display: none; }
.secondary-button { padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--role-dark); font-size: 12px; font-weight: 750; }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.team-card { min-height: 132px; padding: 22px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.team-card:hover { transform: translateY(-2px); border-color: #aeb9c2; }
.team-card-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 13px; background: var(--role-soft); font-size: 24px; }
.team-card h2 { margin: 0 0 6px; font-size: 18px; }
.team-card p { margin: 0; color: var(--muted); font-size: 12px; }
.team-card-count { min-width: 72px; text-align: right; }
.team-card-count strong, .team-card-count span { display: block; }
.team-card-count strong { color: var(--role-dark); font-size: 27px; }
.team-card-count span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.privacy-banner { margin-bottom: 14px; padding: 13px 16px; border: 1px solid #c7d4de; border-radius: 10px; background: #f4f7f9; color: #536575; font-size: 12px; }
.member-table-panel { overflow: hidden; }
.member-table { width: 100%; }
.member-row { min-height: 56px; padding: 0 20px; display: grid; grid-template-columns: 100px minmax(180px, 1fr) minmax(140px, .6fr); align-items: center; gap: 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.member-row:last-child { border-bottom: 0; }
.member-row > span { color: var(--muted); }
.member-header { min-height: 42px; background: #f6f8fa; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.member-row.all-members-row { grid-template-columns: 90px minmax(160px, 1fr) minmax(120px, .7fr) minmax(180px, 1fr); }

@media (max-width: 1050px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .tasks-panel { grid-column: auto; }
}

@media (max-width: 760px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .page { width: 100%; margin-left: 0; }
    .topbar { height: 64px; padding: 0 16px; }
    .menu-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
    .view-identity { min-width: 0; }
    .view-identity small { display: none; }
    .view-identity strong { font-size: 13px; }
    .language-picker span { display: none; }
    .role-switch { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 12; justify-content: stretch; box-shadow: 0 8px 30px rgba(9,43,83,.2); }
    .role-switch a { flex: 1; text-align: center; }
    .content { padding: 22px 16px 36px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .date-chip { display: none; }
    .alert { grid-template-columns: auto 1fr; }
    .alert a { grid-column: 2; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { min-height: 86px; padding: 14px; }
    .stat-icon { display: none; }
    .quick-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .event { grid-template-columns: 53px 3px 1fr; padding: 8px 0; }
    .event .tag { grid-column: 3; justify-self: start; }
    .scrim.visible { display: block; position: fixed; inset: 0; background: rgba(5,25,45,.55); z-index: 15; }
    .team-grid { grid-template-columns: 1fr; }
    .team-card { grid-template-columns: auto 1fr; }
    .team-card-count { grid-column: 2; text-align: left; }
    .member-row { grid-template-columns: 62px 1fr; gap: 10px; padding: 10px 14px; }
    .member-row > span:last-child { grid-column: 2; }
    .member-row.all-members-row { grid-template-columns: 62px 1fr; }
    .member-row.all-members-row > span:nth-child(3), .member-row.all-members-row > span:nth-child(4) { grid-column: 2; }
}

@media (max-width: 430px) {
    .stats { grid-template-columns: 1fr; }
    .stat-card { min-height: 72px; }
    .quick-actions { grid-template-columns: 1fr; }
    .language-picker select { width: 112px; }
}
