:root {
  --navy: #102a43;
  --navy-2: #173f5f;
  --blue: #1f6feb;
  --blue-soft: #eaf2ff;
  --mint: #13a085;
  --mint-soft: #e8f8f3;
  --amber: #b7791f;
  --amber-soft: #fff7df;
  --red: #c2414d;
  --red-soft: #fff0f1;
  --ink: #17212b;
  --muted: #637083;
  --line: #dce4ec;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --shadow: 0 16px 40px rgba(16, 42, 67, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .35rem; font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.15; letter-spacing: -.025em; }
h2 { margin-bottom: .25rem; font-size: 1.2rem; line-height: 1.3; }
h3 { margin-bottom: 0; font-size: 1.1rem; }
p { color: var(--muted); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px; display: flex; flex-direction: column; padding: 24px 18px; color: #fff; background: linear-gradient(165deg, #0d2538 0%, #133b5c 55%, #0e3048 100%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 26px; }
.brand span:last-child { display: grid; }
.brand strong { font-size: 1rem; }
.brand small { margin-top: 2px; color: #a9c0d3; font-size: .75rem; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 auto; display: inline-grid; place-items: center; border-radius: 11px; color: #0e3048; background: #6ee7cf; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.brand-mark.large { width: 48px; height: 48px; border-radius: 15px; font-size: 1.2rem; }
.nav-links { display: grid; gap: 6px; }
.nav-links a { position: relative; padding: 11px 14px; color: #c6d6e3; border-radius: 11px; font-weight: 650; font-size: .94rem; }
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-links a.active::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: #6ee7cf; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.user-chip { display: flex; align-items: center; gap: 8px; color: #dbe7f0; font-size: .86rem; overflow-wrap: anywhere; }
.user-chip > span { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; color: #123; background: #fff; font-weight: 800; }
.link-button { padding: 0; color: #aac1d2; background: none; border: 0; cursor: pointer; }
.link-button:hover { color: #fff; }

.main-content { min-height: 100vh; margin-left: 248px; padding: 36px clamp(24px, 4vw, 56px) 64px; }
.mobile-header, .mobile-menu { display: none; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading p { margin-bottom: 0; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--blue); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.readonly-badge { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 12px; border: 1px solid #b8e9dc; border-radius: 999px; color: #08715e; background: var(--mint-soft); font-size: .78rem; font-weight: 750; }
.readonly-badge span { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(19,160,133,.12); }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--blue); font-weight: 700; font-size: .9rem; }

.notice { max-width: 820px; margin: 0 0 18px; padding: 13px 16px; border: 1px solid; border-radius: 12px; font-weight: 650; }
.notice.success { color: #076b58; border-color: #b8e9dc; background: var(--mint-soft); }
.notice.error { color: #9c2f3a; border-color: #f1c3c7; background: var(--red-soft); }
.auth-notice { position: fixed; z-index: 20; top: 16px; left: 50%; width: min(92vw, 560px); transform: translateX(-50%); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { position: relative; min-height: 142px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(16,42,67,.04); }
.metric-card::after { content: ""; position: absolute; right: -24px; bottom: -32px; width: 100px; height: 100px; border-radius: 50%; background: rgba(31,111,235,.05); }
.metric-card.accent { color: #fff; border-color: transparent; background: linear-gradient(145deg, #144a70, #0f2f48); }
.metric-card.accent::after { background: rgba(110,231,207,.13); }
.metric-card small { color: var(--muted); font-weight: 700; }
.metric-card.accent small, .metric-card.accent span { color: #bfd2df; }
.metric-card strong { position: relative; z-index: 1; font-size: clamp(1.45rem, 2.6vw, 2.05rem); letter-spacing: -.03em; }
.metric-card strong em { color: var(--muted); font-size: 1rem; font-style: normal; }
.metric-card span { color: var(--muted); font-size: .82rem; }

.dashboard-meta-strip { display: flex; gap: 10px; margin-bottom: 16px; }
.dashboard-meta-strip > div { min-width: 132px; display: flex; align-items: baseline; gap: 8px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.dashboard-meta-strip strong { color: var(--navy-2); font-size: 1.08rem; }
.dashboard-meta-strip span { color: var(--muted); font-size: .76rem; }
.dashboard-meta-strip .has-error { border-color: #ecc3c7; background: var(--red-soft); }
.dashboard-meta-strip .has-error strong, .dashboard-meta-strip .has-error span { color: #a4333e; }
.dashboard-heading-actions { display: flex; align-items: center; gap: 10px; }
.bulk-sync-panel { margin-bottom: 16px; }
.bulk-sync-panel[hidden], .result-modal[hidden] { display: none; }
.bulk-sync-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bulk-sync-head h2 { margin-bottom: 0; }
.bulk-sync-head > strong { color: var(--navy-2); font-size: 1.05rem; white-space: nowrap; }
.bulk-progress-track { height: 10px; margin: 16px 0 10px; overflow: hidden; border-radius: 999px; background: #e8edf2; }
.bulk-progress-track span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--mint)); transition: width .25s ease; }
.bulk-current-step { margin: 0; color: var(--navy-2); font-size: .86rem; font-weight: 700; }
.bulk-sync-summary { display: flex; gap: 14px; margin-top: 10px; color: var(--muted); font-size: .76rem; }
.bulk-step-list { max-height: 230px; display: grid; gap: 6px; padding: 0; margin: 14px 0 0; overflow-y: auto; list-style: none; }
.bulk-step { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px; border-radius: 9px; background: #f5f8fb; font-size: .76rem; }
.bulk-step strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-step span { color: var(--muted); text-align: right; }
.bulk-step.running { color: var(--blue); background: var(--blue-soft); }
.bulk-step.success { color: #08715e; background: var(--mint-soft); }
.bulk-step.skipped { color: #8a5b11; background: var(--amber-soft); }
.bulk-step.failed { color: #a4333e; background: var(--red-soft); }
.result-modal { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(9, 27, 42, .58); }
.result-modal-card { width: min(92vw, 390px); padding: 26px; text-align: center; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(8, 24, 38, .3); }
.result-modal-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 14px; color: #08715e; border-radius: 50%; background: var(--mint-soft); font-size: 1.5rem; font-weight: 900; }
.result-modal-card p { margin: 8px 0 20px; }
.ranking-grid { display: grid; gap: 16px; margin-bottom: 20px; }
.ranking-panel { overflow: hidden; }
.ranking-panel > .panel-head { margin-bottom: 14px; }
.period-ranking-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.period-ranking { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.period-ranking > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.period-ranking > header div { display: grid; }
.period-ranking > header h3 { font-size: 1rem; }
.period-ranking > header small { color: var(--muted); font-size: .68rem; }
.period-ranking > header > span { padding: 3px 7px; color: var(--muted); border-radius: 999px; background: #edf2f6; font-size: .68rem; white-space: nowrap; }
.period-ranking ol { display: grid; gap: 5px; padding: 0; margin: 0; list-style: none; }
.period-ranking li { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 42px; padding: 6px 7px; border-radius: 9px; background: #fff; }
.rank-number { width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); border-radius: 8px; background: #edf2f6; font-size: .72rem; font-weight: 800; }
.period-ranking li:first-child .rank-number { color: #805500; background: #ffedb3; }
.rank-worker { display: grid; min-width: 0; }
.rank-worker strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.rank-worker strong em { display: inline-block; margin-left: 5px; padding: 1px 5px; color: #08715e; border-radius: 999px; background: var(--mint-soft); font-size: .62rem; font-style: normal; vertical-align: 1px; }
.rank-worker small { color: var(--muted); font-size: .67rem; }
.rank-income { color: var(--navy-2); font-size: .82rem; white-space: nowrap; }
.period-ranking li.is-current-worker { box-shadow: inset 3px 0 0 var(--mint); background: #f0fbf7; }
.previous-ranking-panel { background: #fbfcfd; }
.player-ranking-grid { margin-top: -4px; }

.content-grid { display: grid; gap: 20px; align-items: start; }
.content-grid.two-one { grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); }
.content-grid.one-two { grid-template-columns: minmax(270px, .8fr) minmax(0, 2fr); }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(16,42,67,.035); }
.sticky-panel { position: sticky; top: 20px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head p { margin-bottom: 0; font-size: .86rem; }
.count-chip { padding: 6px 10px; border-radius: 999px; color: var(--navy-2); background: #edf3f7; font-size: .8rem; font-weight: 750; }
.text-link { color: var(--blue); font-size: .86rem; font-weight: 750; white-space: nowrap; }

.status-list { display: grid; gap: 8px; margin-bottom: 18px; }
.status-list > div { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; background: #f5f8fb; }
.status-list span { color: var(--muted); font-size: .88rem; }
.status-list strong { font-size: 1rem; }
.status { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; white-space: nowrap; border-radius: 999px; color: var(--navy-2); background: #edf3f7; font-size: .76rem; font-weight: 750; }
.status.ok { color: #08715e; background: var(--mint-soft); }
.status.pending { color: #8a5b11; background: var(--amber-soft); }
.status.bad { color: #a4333e; background: var(--red-soft); }
.status.empty-status { color: #316686; background: #eaf4fa; }
.status.muted { color: #687483; background: #edf0f3; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.data-table th { padding: 10px 12px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: left; font-size: .75rem; letter-spacing: .04em; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #e8edf2; font-size: .88rem; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table td strong { display: block; }
.data-table td small { display: block; margin-top: 2px; color: var(--muted); }
.order-table { min-width: 900px; }

.empty { min-height: 150px; display: grid; place-content: center; gap: 5px; padding: 24px; color: var(--muted); text-align: center; border: 1px dashed #cfd9e2; border-radius: 14px; background: #fbfcfd; }
.empty strong { color: var(--ink); }
.empty.compact { min-height: 90px; }

.stack-form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #344253; font-size: .84rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); border: 1px solid #ccd7e1; border-radius: 10px; outline: 0; background: #fff; font-weight: 500; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 750; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(31,111,235,.18); }
.button.secondary { color: var(--navy-2); border-color: #c9d7e2; background: #fff; }
.button.ghost { color: var(--blue); background: var(--blue-soft); }
.button.wide { width: 100%; }
.form-divider { display: flex; align-items: center; gap: 10px; margin: 2px 0; color: var(--muted); font-size: .75rem; }
.form-divider::before, .form-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.inline-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.inline-form label { min-width: 180px; flex: 1; }

.worker-list { display: grid; }
.create-worker-panel { margin-bottom: 18px; }
.create-worker-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.create-worker-divider, .create-worker-actions { grid-column: 1 / -1; }
.create-worker-actions { display: flex; justify-content: flex-end; gap: 10px; }
.worker-list-panel { width: 100%; }
.worker-period-filter { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin: -2px 0 14px; padding: 14px; border-radius: 13px; background: #f5f8fb; }
.worker-period-filter label { min-width: 158px; }
.worker-period-actions { display: flex; gap: 9px; }
.worker-row { display: grid; grid-template-columns: 44px minmax(150px, 1fr) minmax(130px, auto) minmax(100px, auto) auto auto 20px; gap: 12px; align-items: center; min-height: 82px; padding: 12px 8px; border-bottom: 1px solid #e8edf2; }
.worker-row:last-child { border-bottom: 0; }
.worker-row:hover { background: #f8fafc; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #18405e; background: #dff3ef; font-weight: 850; }
.worker-main { display: grid; min-width: 0; }
.worker-main small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.worker-business { display: grid; min-width: 130px; text-align: right; }
.worker-business strong { color: var(--navy-2); font-size: 1.05rem; }
.worker-business small { color: var(--muted); font-size: .72rem; }
.worker-rejected { justify-self: end; padding: 5px 9px; color: #a4333e; border-radius: 999px; background: var(--red-soft); font-size: .74rem; font-weight: 800; white-space: nowrap; }
.worker-rejected.empty-rejected { color: var(--muted); background: #f1f4f6; font-weight: 650; }
.worker-meta { display: grid; min-width: 82px; text-align: right; }
.worker-meta small { color: var(--muted); font-size: .72rem; }
.arrow { color: #8a98a8; font-size: 1.5rem; }

.account-panel, .password-panel { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.account-panel p, .password-panel p { margin-bottom: 0; }
.account-disclosure { margin-bottom: 24px; padding: 0; overflow: hidden; }
.account-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 18px 22px; cursor: pointer; list-style: none; }
.account-disclosure > summary::-webkit-details-marker { display: none; }
.account-disclosure h2, .account-disclosure p { margin-bottom: 0; }
.account-disclosure .eyebrow { margin-bottom: 3px; }
.account-disclosure[open] .expand-closed { display: none; }
.account-disclosure[open] .expand-open { display: inline; }
.account-disclosure[open] .club-expand i { transform: rotate(180deg); }
.account-disclosure-body { padding: 18px 22px 22px; border-top: 1px solid var(--line); }
.account-disclosure-body > p { margin: 0 0 14px; }
.account-form { max-width: 620px; width: 100%; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 32px 0 16px; }
.section-heading p { margin-bottom: 0; }
.detail-period-filter { margin-bottom: 14px; }
.period-filter-hint { align-self: center; color: var(--muted); font-size: .78rem; }
.worker-rollup { margin-bottom: 14px; }
.rollup-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.rollup-heading h3 { margin-top: 3px; }
.rollup-heading > span { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.rollup-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rollup-metrics div { display: grid; gap: 4px; padding: 14px; border-radius: 12px; background: #f5f8fb; }
.rollup-metrics strong { font-size: 1.2rem; }
.rollup-metrics span, .club-list-hint { color: var(--muted); font-size: .76rem; }
.club-list-hint { margin: 0 0 10px; }
.club-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.club-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(16,42,67,.035); }
.club-card.has-error { border-color: #ecc3c7; }
.club-disclosure > summary { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(360px, 1.5fr) auto; align-items: center; gap: 18px; padding: 16px 20px; cursor: pointer; list-style: none; }
.club-disclosure > summary::-webkit-details-marker { display: none; }
.club-summary-title { min-width: 0; }
.club-summary-title small { color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.club-summary-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.club-summary-metrics > span { display: grid; min-width: 0; }
.club-summary-metrics strong { overflow: hidden; color: var(--navy-2); font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.club-summary-metrics small { color: var(--muted); font-size: .68rem; }
.club-summary-actions { display: flex; align-items: center; gap: 12px; }
.club-expand { display: flex; align-items: center; gap: 8px; color: var(--blue); font-size: .78rem; font-weight: 750; white-space: nowrap; }
.club-expand i { font-size: 1.05rem; font-style: normal; transition: transform .18s ease; }
.expand-open { display: none; }
.club-disclosure[open] .expand-closed { display: none; }
.club-disclosure[open] .expand-open { display: inline; }
.club-disclosure[open] .club-expand i { transform: rotate(180deg); }
.club-detail { padding: 18px 20px 20px; border-top: 1px solid var(--line); }
.club-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.club-metrics div { display: grid; gap: 2px; padding: 10px; border-radius: 10px; background: #f5f8fb; }
.club-metrics strong { font-size: .95rem; }
.club-metrics span { color: var(--muted); font-size: .7rem; }
.meta-list { display: grid; gap: 8px; margin: 0 0 15px; }
.meta-list div { display: flex; justify-content: space-between; gap: 16px; }
.meta-list dt { color: var(--muted); font-size: .78rem; }
.meta-list dd { margin: 0; text-align: right; font-size: .8rem; font-weight: 650; overflow-wrap: anywhere; }
.inline-error { margin: 0 0 14px; padding: 10px 12px; color: #a4333e; border-radius: 10px; background: var(--red-soft); font-size: .8rem; }
.card-actions { display: flex; gap: 8px; }
.card-actions form { flex: 1; }
.card-actions .button { width: 100%; }
.club-empty { min-height: 116px; margin-bottom: 14px; }
.binding-form { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.binding-form p { margin: 0; font-size: .76rem; }

.source-list { display: grid; }
.source-list article { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 6px; border-bottom: 1px solid #e8edf2; }
.source-list article:last-child { border-bottom: 0; }
.source-icon { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; border-radius: 12px; background: linear-gradient(145deg, var(--navy-2), var(--blue)); font-weight: 850; }
.source-list article div { display: grid; min-width: 0; }
.source-list small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.filter-panel { margin-bottom: 18px; }
.filter-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.filter-form label { min-width: 140px; }
.filter-form .date-filter { min-width: 158px; }
.filter-form .grow { min-width: 220px; flex: 1; }
.filter-summary { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; padding-top: 15px; color: var(--muted); border-top: 1px solid var(--line); font-size: .85rem; }
.filter-summary strong { color: var(--ink); }
.order-panel { padding: 8px 18px 18px; }
.order-panel .panel-head { padding: 14px 4px 0; }

.player-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.player-club-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.player-club-card { display: grid; gap: 16px; padding: 18px; color: inherit; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none; transition: border-color .16s, box-shadow .16s, transform .16s; }
.player-club-card:hover { transform: translateY(-2px); border-color: #a9c8e8; box-shadow: 0 12px 28px rgba(16,42,67,.08); }
.player-club-card.is-selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,111,235,.1); }
.club-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.club-name > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; border-radius: 12px; background: var(--navy-2); font-weight: 850; }
.club-name div { display: grid; min-width: 0; }
.club-name small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-club-card > .status { justify-self: start; }
.club-amount { display: grid; }
.club-amount strong { font-size: 1.4rem; }
.club-amount span, .club-foot { color: var(--muted); font-size: .76rem; }
.club-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.club-card-link { color: var(--blue); font-size: .76rem; font-weight: 750; }
.portal-order-filter { margin-bottom: 16px; }
.portal-order-filter .grow { min-width: 190px; flex: 1; }
.player-binding-manager { margin: 16px 0 18px; }
.player-binding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.player-binding-item { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #f9fbfc; }
.player-binding-item.has-error { border-color: #ecc3c7; }
.player-binding-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.player-binding-title > div { display: grid; }
.player-binding-title small { color: var(--muted); font-size: .72rem; }
.player-binding-form { gap: 11px; }

.auth-body { min-height: 100vh; background: #0f2b42; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(380px, .8fr); }
.login-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 6vw, 76px); overflow: hidden; color: #fff; background: radial-gradient(circle at 12% 12%, rgba(110,231,207,.18), transparent 30%), linear-gradient(145deg, #0d2b42, #174f74); }
.login-panel::after { content: ""; position: absolute; right: -130px; bottom: -180px; width: 470px; height: 470px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 68px rgba(255,255,255,.025), 0 0 0 136px rgba(255,255,255,.018); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.login-brand div { display: grid; }
.login-brand strong { font-size: 1.05rem; }
.login-brand small { color: #b9cddd; }
.login-copy { position: relative; z-index: 1; max-width: 620px; padding: 80px 0 20px; }
.login-copy .eyebrow { color: #6ee7cf; }
.login-copy h1 { max-width: 720px; font-size: clamp(2.4rem, 4.1vw, 4.2rem); line-height: 1.03; white-space: nowrap; }
.login-copy p { max-width: 560px; color: #c9d9e5; font-size: 1.02rem; }
.login-copy ul { display: flex; gap: 10px; flex-wrap: wrap; padding: 0; margin: 28px 0 0; list-style: none; }
.login-copy li { padding: 8px 11px; color: #dbf3ee; border: 1px solid rgba(110,231,207,.25); border-radius: 999px; background: rgba(110,231,207,.08); font-size: .78rem; font-weight: 700; }
.login-card { display: flex; flex-direction: column; justify-content: center; gap: 30px; padding: clamp(34px, 7vw, 92px); background: #fff; }
.login-card h2 { margin-bottom: 7px; font-size: 2rem; }
.login-card p { margin-bottom: 0; }
.privacy-note { padding-top: 18px; border-top: 1px solid var(--line); font-size: .78rem; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-ranking-grid { grid-template-columns: 1fr; }
  .player-club-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { width: 216px; }
  .main-content { margin-left: 216px; padding: 30px 24px 56px; }
  .content-grid.two-one, .content-grid.one-two { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .account-panel, .password-panel { align-items: flex-start; flex-direction: column; }
  .account-disclosure > summary { align-items: flex-start; }
  .account-form { max-width: none; }
  .login-layout { grid-template-columns: 1fr 410px; }
  .login-panel { padding: 40px; }
  .login-card { padding: 46px; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 0 16px 42px; }
  .mobile-header { position: sticky; top: 0; z-index: 20; height: 62px; display: flex; align-items: center; justify-content: space-between; margin: 0 -16px 22px; padding: 0 16px; border-bottom: 1px solid var(--line); background: rgba(244,247,250,.96); backdrop-filter: blur(10px); }
  .mobile-brand { display: flex; align-items: center; gap: 9px; font-weight: 850; }
  .mobile-brand .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .menu-button { min-height: 40px; padding: 7px 12px; color: var(--navy-2); border: 1px solid #c9d7e2; border-radius: 10px; background: #fff; font-weight: 750; }
  .mobile-menu { position: fixed; z-index: 25; top: 60px; left: 12px; right: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
  .mobile-menu[hidden] { display: none; }
  .mobile-menu a, .mobile-menu button { min-height: 42px; display: grid; place-items: center; padding: 6px; color: var(--navy-2); border: 0; border-radius: 9px; background: #f3f7fa; font-size: .8rem; font-weight: 750; }
  .mobile-menu form { display: contents; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .dashboard-heading-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .dashboard-heading-actions .button { width: 100%; }
  .readonly-badge { white-space: normal; }
  .metric-grid, .player-metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dashboard-meta-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-meta-strip > div { min-width: 0; align-items: center; flex-direction: column; gap: 2px; text-align: center; }
  .ranking-panel { padding: 15px; }
  .period-ranking { padding: 11px; }
  .bulk-step { align-items: flex-start; flex-direction: column; gap: 2px; }
  .bulk-step span { text-align: left; }
  .metric-card { min-height: 126px; padding: 16px; }
  .metric-card:first-child { grid-column: 1 / -1; }
  .panel { padding: 17px; border-radius: 15px; }
  .panel-head { flex-direction: column; }
  .worker-period-filter { align-items: stretch; flex-direction: column; }
  .worker-period-filter label { min-width: 0; width: 100%; }
  .worker-period-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .worker-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 8px; }
  .create-worker-form { grid-template-columns: 1fr; }
  .create-worker-divider, .create-worker-actions { grid-column: auto; }
  .create-worker-actions { align-items: stretch; flex-direction: column; }
  .worker-meta, .worker-row > .status { display: none; }
  .arrow { grid-column: 3; grid-row: 1; }
  .worker-business { grid-column: 2; grid-row: 2; min-width: 0; text-align: left; }
  .worker-rejected { grid-column: 2; grid-row: 3; justify-self: start; }
  .inline-form { align-items: stretch; flex-direction: column; width: 100%; }
  .inline-form label { min-width: 0; }
  .club-grid, .player-club-grid { grid-template-columns: 1fr; }
  .player-binding-grid { grid-template-columns: 1fr; }
  .rollup-heading { align-items: flex-start; flex-direction: column; }
  .rollup-metrics { grid-template-columns: 1fr 1fr; }
  .rollup-metrics div:first-child { grid-column: 1 / -1; }
  .club-disclosure > summary { gap: 12px; padding: 14px 16px; }
  .club-disclosure > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .club-summary-metrics { grid-column: 1 / -1; grid-row: 2; }
  .club-summary-actions { grid-column: 2; grid-row: 1; align-items: flex-end; flex-direction: column; gap: 6px; }
  .period-filter-hint { align-self: flex-start; }
  .club-detail { padding: 16px; }
  .filter-form { align-items: stretch; flex-direction: column; }
  .filter-form label, .filter-form .grow { min-width: 0; width: 100%; }
  .filter-summary { display: grid; grid-template-columns: 1fr 1fr; }
  .data-table { min-width: 0; }
  .order-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .order-table, .order-table tbody, .order-table tr, .order-table td { display: block; width: 100%; }
  .order-table tr { margin: 0 0 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .order-table td { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 0; border: 0; text-align: right; }
  .order-table td:first-child { align-items: flex-start; flex-direction: column; text-align: left; }
  .order-table td:not(:first-child)::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 600; }
  .sync-table { min-width: 0; }
  .sync-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sync-table, .sync-table tbody, .sync-table tr, .sync-table td { display: block; width: 100%; }
  .sync-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-bottom: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
  .sync-table td { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 2px 0; border: 0; text-align: right; }
  .sync-table td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 600; }
  .sync-table td:nth-child(5) { grid-column: 1 / -1; }
  .order-panel { padding: 10px; background: transparent; border: 0; box-shadow: none; }
  .login-layout { min-height: 100svh; display: flex; flex-direction: column; background: #fff; }
  .login-panel { min-height: 285px; flex: 0 0 auto; padding: 28px 22px; }
  .login-copy { padding: 42px 0 6px; }
  .login-copy h1 { font-size: 2.25rem; white-space: normal; }
  .login-copy p { font-size: .9rem; }
  .login-copy ul { display: none; }
  .login-card { flex: 1; gap: 22px; padding: 30px 22px 42px; }
}

@media (max-width: 390px) {
  .metric-grid, .player-metrics { grid-template-columns: 1fr; }
  .metric-card:first-child { grid-column: auto; }
  .club-metrics { grid-template-columns: 1fr; }
  .club-metrics div { grid-template-columns: 1fr auto; align-items: center; }
  .club-summary-actions .status { display: none; }
  .card-actions { flex-direction: column; }
  .login-copy h1 { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
