:root {
  --ink: #17232a;
  --ink-soft: #53616a;
  --paper: #f4f5f2;
  --panel: #ffffff;
  --line: #dfe4df;
  --line-dark: #2e3b40;
  --coral: #ec6c4f;
  --coral-soft: #fff0eb;
  --lime: #c8ef67;
  --blue: #6ba7bf;
  --yellow: #f6cf58;
  --red: #d94b4b;
  --shadow: 0 16px 36px rgba(23, 35, 42, .07);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Noto Sans SC", Manrope, sans-serif; }
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(107, 167, 191, .4); outline-offset: 2px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; background: var(--ink); color: #f6f8f4; padding: 28px 20px 20px; display: flex; flex-direction: column; flex-shrink: 0; }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 8px 27px; }
.brand-mark { display: grid; place-items: center; width: 45px; height: 45px; background: #fff; color: var(--ink); font-weight: 800; font-size: 16px; letter-spacing: .04em; line-height: 1; overflow: hidden; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-kicker { font: 500 9px "DM Mono", monospace; letter-spacing: .11em; color: #93a5ab; margin: 0 0 4px; }
.brand-lockup h1 { font-size: 19px; margin: 0; letter-spacing: .05em; }
.season-chip { height: 35px; border: 1px solid #405058; padding: 0 10px; display: flex; align-items: center; gap: 8px; color: #d6dfdf; font-size: 12px; margin: 0 8px 26px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(200,239,103,.12); }
.season-live { margin-left: auto; font: 500 9px "DM Mono", monospace; color: var(--lime); }
.nav-list { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; background: transparent; color: #9aa9ae; text-align: left; font-size: 13px; transition: .2s ease; }
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.8; }
.nav-item:hover { background: #233137; color: #fff; }
.nav-item.active { background: var(--lime); color: var(--ink); font-weight: 700; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #36464c; padding: 20px 8px 0; }
.fixture-note { display: flex; gap: 9px; align-items: flex-start; color: #b3c2c4; font-size: 11px; }
.fixture-note svg { width: 15px; color: var(--coral); margin-top: 2px; }
.fixture-note strong, .fixture-note span { display: block; }
.fixture-note strong { color: #f4f7f3; font-size: 12px; margin-bottom: 4px; }
.mini-match { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: #d2dcda; padding: 15px 0 18px; }
.mini-match b { color: var(--coral); font: 700 10px "DM Mono", monospace; }
.admin-rail { width: 100%; display: flex; align-items: center; gap: 9px; height: 38px; border: 1px solid #41535a; background: transparent; color: #b9c6c7; padding: 0 11px; font-size: 11px; }
.admin-rail svg { width: 14px; }
.admin-rail svg:last-child { margin-left: auto; width: 13px; }
.admin-rail:hover { border-color: var(--lime); color: var(--lime); }

.main-content { flex: 1; min-width: 0; }
.topbar { height: 76px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 42px; background: rgba(244,245,242,.92); }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 12px; }
.breadcrumb svg { width: 14px; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.mode-switch { display: flex; padding: 3px; background: #e7ebe7; gap: 2px; }
.mode-btn { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); height: 30px; padding: 0 10px; background: transparent; font-size: 11px; }
.mode-btn svg { width: 14px; }
.mode-btn.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(23,35,42,.1); font-weight: 700; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; background: transparent; color: var(--ink-soft); }
.icon-btn:hover { background: #e7ebe7; color: var(--ink); }
.icon-btn svg { width: 16px; }
.avatar { width: 32px; height: 32px; background: var(--ink); color: var(--lime); font-weight: 700; font-size: 12px; }
.mobile-brand { display: none; align-items: center; gap: 9px; font-size: 14px; }
.mobile-brand .brand-mark { width: 31px; height: 31px; font-size: 11px; }

#pageContent { padding: 38px 42px 60px; max-width: 1540px; }
.hero { background: var(--ink); color: #f5f7f3; padding: 34px 38px 35px; position: relative; overflow: hidden; }
.hero::after { content: "S24"; position: absolute; right: 29px; bottom: -31px; color: #26363c; font: 800 168px/1 Manrope, sans-serif; letter-spacing: -.1em; pointer-events: none; }
.eyebrow { font: 500 10px "DM Mono", monospace; letter-spacing: .13em; color: var(--coral); margin: 0 0 12px; }
.hero h2 { font-size: clamp(27px, 3vw, 43px); letter-spacing: -.045em; line-height: 1.1; margin: 0 0 15px; max-width: 560px; position: relative; z-index: 1; }
.hero-copy { color: #b7c5c6; font-size: 13px; margin: 0; max-width: 510px; line-height: 1.8; position: relative; z-index: 1; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; position: relative; z-index: 1; }
.hero-meta span { border: 1px solid #415158; color: #dbe5e2; padding: 7px 10px; font: 500 10px "DM Mono", monospace; }
.hero-meta .accent { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(290px,.65fr); gap: 20px; margin-top: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 17px; border-bottom: 1px solid var(--line); }
.panel-header h3 { font-size: 15px; letter-spacing: -.02em; margin: 0; }
.panel-header p { margin: 4px 0 0; font-size: 11px; color: var(--ink-soft); }
.text-link { color: var(--coral); font-size: 11px; background: transparent; padding: 4px; display: inline-flex; align-items: center; gap: 5px; }
.text-link svg { width: 13px; }
.global-backbar { margin-bottom: 12px; }
.global-backbar .text-link { color: var(--ink-soft); }
.global-backbar .text-link:hover { color: var(--coral); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 18px 18px; border-top: 1px solid var(--line); color: var(--ink-soft); font: 500 10px "DM Mono", monospace; }
.pagination .secondary-btn { height: 34px; padding: 0 10px; font: 600 11px "Noto Sans SC", sans-serif; }
.pagination .secondary-btn:disabled { opacity: .45; cursor: not-allowed; }
.pagination svg { width: 13px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 20px; }
.metric { padding: 17px 16px; background: var(--panel); border: 1px solid var(--line); }
.metric-label { color: var(--ink-soft); font-size: 11px; margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.metric-label svg { width: 13px; }
.metric-value { font: 700 28px/1 Manrope, sans-serif; letter-spacing: -.06em; }
.metric-value small { font: 500 11px "Noto Sans SC", sans-serif; margin-left: 4px; color: var(--ink-soft); letter-spacing: 0; }
.metric-foot { color: #809097; font-size: 10px; margin-top: 8px; }

.match-list { padding: 7px 22px 16px; }
.match-row { min-height: 61px; border-bottom: 1px solid #edf0ed; display: grid; grid-template-columns: 68px 1fr 62px 1fr 73px; align-items: center; gap: 10px; font-size: 12px; }
.match-row:last-child { border-bottom: 0; }
.match-round { font: 500 10px "DM Mono", monospace; color: #829197; }
.match-team { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-team.home { text-align: right; }
.team-display { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; vertical-align: middle; }
.match-team.home .team-display { justify-content: flex-end; }
.team-display > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.team-logo { width: 22px; height: 22px; flex: 0 0 22px; object-fit: contain; display: inline-block; }
.team-logo-fallback { display: inline-grid; place-items: center; background: #e4ebe7; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.score { justify-self: center; min-width: 49px; padding: 7px 5px; background: #f0f3f0; text-align: center; font: 700 13px "DM Mono", monospace; }
.score.live { background: var(--coral-soft); color: var(--coral); }
.score.upcoming { background: #eff6da; color: #537113; }
.match-status { color: #819097; font-size: 10px; }
.match-status.live { color: var(--coral); font-weight: 700; }
.standings-wrap { padding: 0 12px 12px; }
.table-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-hint { display: none; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: #8a9698; font-size: 10px; font-weight: 500; text-align: right; padding: 12px 9px 10px; white-space: nowrap; }
th:first-child, th:nth-child(2), td:first-child, td:nth-child(2) { text-align: left; }
td { padding: 11px 9px; border-top: 1px solid #edf0ed; text-align: right; white-space: nowrap; }
td:first-child { color: #8c999d; font: 500 10px "DM Mono", monospace; width: 32px; }
td:nth-child(2) { font-weight: 600; }
.rank-badge { display: inline-grid; place-items: center; width: 20px; height: 20px; background: #eff1ee; font: 500 10px "DM Mono", monospace; }
.rank-badge.top { background: var(--lime); color: var(--ink); font-weight: 700; }
.form-dots { display: inline-flex; gap: 3px; }
.form-dot { width: 6px; height: 6px; border-radius: 50%; background: #d9dfdd; }
.form-dot.w { background: var(--lime); }
.form-dot.d { background: var(--yellow); }
.form-dot.l { background: var(--coral); }
.group-pill { display: inline-block; padding: 4px 6px; background: #eef3f3; color: #6a7a80; font: 500 9px "DM Mono", monospace; }

.side-stack { display: grid; gap: 20px; }
.leader-list { padding: 7px 22px 15px; }
.leader { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #edf0ed; padding: 13px 0; }
.leader:last-child { border-bottom: 0; }
.leader-number { color: #92a0a4; width: 18px; font: 500 10px "DM Mono", monospace; }
.leader-avatar { width: 31px; height: 31px; display: grid; place-items: center; color: var(--ink); background: #dce9e2; font-size: 11px; font-weight: 700; object-fit: contain; flex: 0 0 31px; }
.leader:nth-child(2) .leader-avatar { background: #f7e7b7; }
.leader:nth-child(3) .leader-avatar { background: #e5d8ee; }
.leader-info { flex: 1; min-width: 0; }
.leader-info strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-info span { display: block; color: #8c989c; font-size: 10px; margin-top: 3px; }
.leader-stat { font: 700 18px Manrope, sans-serif; }
.leader-stat small { font: 500 9px "Noto Sans SC", sans-serif; color: #8b989b; margin-left: 2px; }
.discipline-strip { padding: 0 22px 20px; }
.discipline-row { display: grid; grid-template-columns: 1fr 54px 54px; gap: 8px; align-items: center; border-bottom: 1px solid #edf0ed; padding: 13px 0; font-size: 11px; }
.discipline-row:last-child { border-bottom: 0; }
.discipline-row > span:not(:first-child) { text-align: right; font: 500 12px "DM Mono", monospace; }
.discipline-row strong, .discipline-row small { display: block; }
.discipline-row strong { font-size: 11px; }
.discipline-row small { color: #8c989c; font-size: 9px; margin-top: 3px; }
.discipline-player { display: flex; align-items: center; gap: 8px; min-width: 0; }
.discipline-avatar { width: 25px; height: 25px; flex: 0 0 25px; object-fit: contain; }
.red-card::before, .yellow-card::before { content: ""; display: inline-block; width: 8px; height: 11px; margin-right: 5px; vertical-align: -1px; }
.red-card::before { background: var(--red); }
.yellow-card::before { background: var(--yellow); }
.discipline-note { display: flex; align-items: center; gap: 6px; color: #8d6d13; background: #fff8dc; border: 1px solid #f2e3a6; padding: 9px 10px; margin-top: 10px; font-size: 10px; }
.discipline-note svg { width: 13px; }

.view-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.view-header h2 { margin: 0; font-size: 29px; letter-spacing: -.045em; }
.view-header p { margin: 7px 0 0; color: var(--ink-soft); font-size: 12px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-select, .search-input { height: 34px; padding: 0 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 11px; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 9px; top: 9px; width: 14px; color: #94a0a2; }
.search-input { padding-left: 30px; width: 185px; }
.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
.section-tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); padding: 0 22px; }
.section-tab { background: transparent; color: #839094; height: 42px; padding: 0 12px; font-size: 11px; position: relative; }
.section-tab.active { color: var(--ink); font-weight: 700; }
.section-tab.active::after { content: ""; height: 2px; background: var(--coral); position: absolute; bottom: -1px; left: 12px; right: 12px; }
.schedule-table td, .schedule-table th { text-align: left; }
.schedule-table th:last-child, .schedule-table td:last-child { text-align: right; }
.schedule-table td { padding-top: 15px; padding-bottom: 15px; }
.date-block strong, .date-block span { display: block; }
.date-block strong { font-size: 12px; }
.date-block span { color: #8b989b; font-size: 10px; margin-top: 3px; }
.fixture-badge { display: inline-flex; align-items: center; gap: 6px; color: #789087; font-size: 10px; }
.fixture-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c5cfca; }
.fixture-badge.live { color: var(--coral); font-weight: 700; }
.fixture-badge.live::before { background: var(--coral); }
.fixture-badge.upcoming { color: #66801e; }
.fixture-badge.upcoming::before { background: var(--lime); }
.score-cell { font: 700 13px "DM Mono", monospace; }
.score-link { min-width: 56px; padding: 7px 8px; border: 0; background: #f0f3f0; color: var(--ink); font: 700 13px "DM Mono", monospace; cursor: pointer; }
.score-link:hover, .match-row-clickable:hover .score { background: var(--coral-soft); color: var(--coral); }
.match-row-clickable { cursor: pointer; }
.match-detail-card { overflow: hidden; }
.match-detail-score { display: grid; grid-template-columns: 1fr 120px 1fr; align-items: center; gap: 18px; padding: 34px 28px; text-align: center; }
.match-detail-score > div { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.match-detail-score > div strong { font-size: 14px; }
.detail-team-logo { width: 58px; height: 58px; object-fit: contain; }
.detail-score { font: 700 26px "DM Mono", monospace; }
.detail-score.upcoming { color: #537113; font-size: 17px; }
.event-timeline { padding: 6px 24px 24px; }
.event-item { display: grid; grid-template-columns: 48px 52px 1fr; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf0ed; }
.event-minute { color: #829197; font: 500 11px "DM Mono", monospace; }
.event-type { display: inline-block; padding: 5px 6px; text-align: center; background: #eef3f3; color: var(--ink-soft); font-size: 10px; }
.event-type-red { background: #fde8e8; color: var(--red); }
.event-type-yellow { background: #fff5cd; color: #9a7412; }
.event-item > div { display: grid; grid-template-columns: 25px 1fr; align-items: center; column-gap: 8px; }
.event-team-logo { width: 25px; height: 25px; object-fit: contain; grid-row: span 2; }
.event-item small { grid-column: 2; color: #8a979b; font-size: 10px; margin-top: 2px; }
.info-rail { display: grid; gap: 20px; align-content: start; }
.callout { padding: 20px; background: var(--ink); color: #f5f7f3; }
.callout h3 { font-size: 15px; margin: 0 0 8px; }
.callout p { color: #b6c3c3; font-size: 11px; line-height: 1.75; margin: 0; }
.callout-stat { border-top: 1px solid #3d4c50; margin-top: 17px; padding-top: 14px; display: flex; justify-content: space-between; align-items: flex-end; }
.callout-stat strong { font: 700 27px Manrope, sans-serif; color: var(--lime); letter-spacing: -.05em; }
.callout-stat span { color: #93a2a4; font-size: 10px; }
.group-list { padding: 4px 20px 16px; }
.group-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf0ed; font-size: 11px; }
.group-item:last-child { border-bottom: 0; }
.group-label { display: inline-grid; place-items: center; width: 25px; height: 25px; background: var(--coral-soft); color: var(--coral); font: 700 11px "DM Mono", monospace; margin-right: 8px; }
.group-item span:last-child { color: #879497; font: 500 10px "DM Mono", monospace; }
.ranking-table td { padding-top: 14px; padding-bottom: 14px; }
.player-cell { display: flex; align-items: center; gap: 9px; text-align: left; }
.player-avatar { width: 28px; height: 28px; display: grid; place-items: center; background: #e4ebe7; font-size: 10px; font-weight: 700; object-fit: contain; flex: 0 0 28px; }
.player-cell strong, .player-cell span { display: block; }
.player-cell strong { font-size: 12px; }
.player-cell span { color: #8a979b; font-size: 10px; margin-top: 2px; }
.stat-emphasis { font: 700 16px Manrope, sans-serif; }
.discipline-table td:nth-child(4), .discipline-table th:nth-child(4) { color: var(--red); }
.discipline-table td:nth-child(5), .discipline-table th:nth-child(5) { color: #aa8a12; }
.card-warning { color: #7e8b8d; font-size: 10px; }
.card-warning.is-alert { display: inline-block; padding: 4px 6px; color: #9a7412; background: #fff5cd; font-weight: 700; }
.warning-panel { overflow: hidden; }
.warning-list { padding: 7px 22px 4px; }
.warning-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0ed; }
.warning-item:last-child { border-bottom: 0; }
.warning-item strong, .warning-item span { display: block; }
.warning-item strong { font-size: 12px; }
.warning-item div span { color: #8b989b; font-size: 10px; margin-top: 3px; }
.warning-level { color: #9a7412; background: #fff5cd; padding: 5px 7px; font: 500 10px "DM Mono", monospace; }
.warning-disclaimer { color: #8a9698; font-size: 10px; line-height: 1.7; margin: 9px 22px 18px; }
.empty-state { padding: 50px 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 15px; background: #eef3f3; color: var(--ink-soft); }
.empty-icon svg { width: 20px; }
.empty-state h3 { margin: 0 0 8px; font-size: 15px; }
.empty-state p { max-width: 430px; margin: 0 auto; color: var(--ink-soft); font-size: 11px; line-height: 1.8; }

.admin-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #eff6dc; border: 1px solid #d9e9ac; padding: 15px 18px; margin-bottom: 20px; }
.admin-banner > div { display: flex; align-items: center; gap: 10px; }
.admin-banner svg { width: 17px; color: #6c8b20; }
.admin-banner strong { display: block; font-size: 12px; }
.admin-banner span { display: block; font-size: 10px; color: #79903a; margin-top: 3px; }
.upload-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--ink); color: var(--lime); height: 34px; padding: 0 13px; font-size: 11px; font-weight: 700; }
.upload-btn svg { width: 14px; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.upload-panel { padding: 28px; border: 1px dashed #b9c8c3; background: #fbfcfa; text-align: center; }
.upload-icon { width: 45px; height: 45px; margin: 0 auto 13px; display: grid; place-items: center; background: var(--coral-soft); color: var(--coral); }
.upload-icon svg { width: 20px; }
.upload-panel h3 { font-size: 15px; margin: 0 0 8px; }
.upload-panel p { color: var(--ink-soft); font-size: 11px; line-height: 1.7; margin: 0 auto 18px; max-width: 370px; }
.hidden-input { display: none; }
.data-source-list { display: grid; gap: 8px; margin-top: 23px; text-align: left; }
.data-source-row { display: flex; align-items: center; justify-content: space-between; background: #f1f4f1; padding: 11px 12px; font-size: 11px; }
.data-source-row span:last-child { color: #769027; font: 500 10px "DM Mono", monospace; }
.data-source-row svg { width: 13px; color: #759022; vertical-align: -2px; margin-right: 5px; }
.admin-guide { padding: 22px; }
.admin-guide h3 { font-size: 14px; margin: 0 0 16px; }
.guide-line { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf0ed; }
.guide-line:last-child { border-bottom: 0; }
.guide-num { display: grid; place-items: center; width: 22px; height: 22px; background: var(--ink); color: var(--lime); font: 500 10px "DM Mono", monospace; flex-shrink: 0; }
.guide-line p { margin: 1px 0 0; font-size: 11px; line-height: 1.6; color: var(--ink-soft); }
.admin-tools { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(320px,.8fr); gap: 20px; margin-bottom: 20px; }
.admin-editor { min-width: 0; }
.editor-body { padding: 19px 22px 22px; }
.admin-match-filters { margin-top: 0; margin-bottom: 13px; }
.field-hint { display: block; margin-top: 5px; color: #8a979b; font-size: 10px; }
.full-input { width: 100%; margin-top: 6px; height: 39px; }
.editor-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 13px; }
.editor-grid label:first-child:last-child { grid-column: 1 / -1; }
.score-editor { display: grid; grid-template-columns: 1fr 22px 1fr; gap: 10px; align-items: end; margin-top: 13px; }
.score-editor .field-label { margin: 0; }
.score-dash { display: grid; place-items: center; height: 40px; color: #8c999d; font: 700 16px "DM Mono", monospace; }
.admin-action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.secondary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 13px; border: 1px solid var(--line); background: #f6f8f5; color: var(--ink); font-size: 11px; font-weight: 600; }
.secondary-btn:hover { border-color: var(--ink-soft); background: #fff; }
.secondary-btn svg { width: 14px; }
.copy-round { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; color: var(--ink-soft); font-size: 11px; }
.copy-round strong { color: var(--ink); margin-right: 2px; }
.copy-round .filter-select { height: 34px; }
.event-log { border-top: 1px solid var(--line); margin-top: 20px; padding: 14px 4px 0 0; max-height: 420px; overflow-y: auto; }
.event-log-head { color: var(--ink-soft); font-size: 10px; margin-bottom: 5px; }
.event-log-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #edf0ed; padding: 10px 0; }
.event-log-row:last-child { border-bottom: 0; }
.event-log-row strong, .event-log-row span { display: block; }
.event-log-row strong { font-size: 11px; }
.event-log-row div span { color: #8b989b; font-size: 10px; margin-top: 3px; }
.event-log-main { flex: 1; min-width: 0; }
.event-log-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.event-log-actions button { width: 30px; height: 30px; display: grid; place-items: center; background: transparent; color: var(--ink-soft); }
.event-log-actions button:hover { background: #eef2ef; color: var(--ink); }
.event-log-actions button.danger:hover { background: #fff0ee; color: var(--red); }
.event-log-actions svg { width: 14px; height: 14px; }
.event-type { min-width: 33px; padding: 4px 5px; background: var(--coral-soft); color: var(--coral); font-size: 10px; text-align: center; }
.empty-inline { padding: 21px 14px; color: #879497; font-size: 11px; line-height: 1.7; text-align: center; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; background: rgba(23,35,42,.62); padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { width: 100%; max-width: 385px; background: var(--panel); padding: 34px 34px 30px; position: relative; box-shadow: 0 24px 70px rgba(10,20,25,.3); }
.modal-close { position: absolute; right: 14px; top: 14px; }
.modal-icon { width: 43px; height: 43px; display: grid; place-items: center; background: var(--ink); color: var(--lime); margin-bottom: 20px; }
.modal-icon svg { width: 19px; }
.modal h2 { margin: 0 0 10px; font-size: 23px; letter-spacing: -.04em; }
.modal-copy { color: var(--ink-soft); font-size: 12px; line-height: 1.7; margin: 0 0 24px; }
.field-label { display: block; color: var(--ink-soft); font-size: 11px; margin-bottom: 7px; }
.text-input { width: 100%; height: 42px; border: 1px solid var(--line); padding: 0 12px; color: var(--ink); background: #fbfcfa; font-size: 13px; }
.primary-btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; height: 40px; padding: 0 17px; background: var(--coral); color: #fff; font-size: 12px; font-weight: 700; }
.primary-btn svg { width: 15px; }
.primary-btn.full { width: 100%; margin-top: 15px; }
.demo-hint { text-align: center; color: #99a4a5; font-size: 10px; margin: 15px 0 0; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; background: var(--ink); color: #fff; padding: 12px 15px; font-size: 11px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1100px) {
  .sidebar { width: 220px; }
  .topbar, #pageContent { padding-left: 28px; padding-right: 28px; }
  .dashboard-grid, .view-grid, .admin-layout, .admin-tools { grid-template-columns: 1fr; }
  .info-rail { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; height: auto; padding: 12px 14px 13px; display: block; }
  .brand-lockup, .season-chip, .sidebar-footer { display: none; }
  .nav-list { display: flex; gap: 3px; overflow-x: auto; padding-top: 4px; }
  .nav-item { height: 35px; padding: 0 11px; flex-shrink: 0; font-size: 11px; }
  .nav-item svg { width: 14px; }
  .topbar { height: 61px; padding: 0 16px; }
  .mobile-brand { display: flex; }
  .breadcrumb { display: none; }
  .topbar-actions { gap: 6px; }
  .mode-btn { padding: 0 7px; font-size: 10px; }
  .icon-btn { width: 29px; height: 29px; }
  .avatar { width: 29px; height: 29px; }
  #pageContent { padding: 22px 16px 40px; }
  .hero { padding: 26px 21px 25px; }
  .hero h2 { font-size: 27px; }
  .hero-copy { font-size: 12px; }
  .hero::after { font-size: 105px; right: 4px; bottom: -14px; }
  .metrics-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .metric { padding: 13px 12px; }
  .metric-value { font-size: 24px; }
  .match-row { grid-template-columns: 44px 1fr 52px 1fr; gap: 6px; }
  .match-status { display: none; }
  .panel-header { padding-left: 16px; padding-right: 16px; }
  .match-list { padding-left: 16px; padding-right: 16px; }
  .view-header { display: block; }
  .view-header h2 { font-size: 25px; }
  .filter-bar { margin-top: 15px; }
  .search-input { width: 160px; }
  .info-rail { grid-template-columns: 1fr; }
  .schedule-table { min-width: 620px; }
  .ranking-table { min-width: 580px; }
  .panel { min-width: 0; }
  .table-hint { display: block; margin: 12px 16px 0; color: #8a979b; font-size: 10px; }
  .standings-scroll { overflow-x: auto; width: 100%; }
  .schedule-table, .ranking-table { min-width: 0; width: 100%; display: block; }
  .schedule-table thead, .ranking-table thead { display: none; }
  .schedule-table tbody, .ranking-table tbody { display: grid; gap: 9px; padding: 10px 12px 15px; }
  .schedule-table tr, .ranking-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; padding: 10px 11px; border: 1px solid var(--line); background: #fbfcfa; }
  .schedule-table td, .ranking-table td { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 7px 0; border-top: 0; text-align: right !important; white-space: normal; font-size: 11px; }
  .schedule-table td::before, .ranking-table td::before { content: attr(data-label); flex: 0 0 auto; color: #8a9698; font-size: 9px; font-weight: 500; }
  .schedule-table td:nth-child(1), .schedule-table td:nth-child(2), .ranking-table td:nth-child(1), .ranking-table td:nth-child(2) { grid-column: 1 / -1; }
  .schedule-table td:nth-child(2), .ranking-table td:nth-child(2) { justify-content: flex-start; }
  .schedule-table td:nth-child(2)::before, .ranking-table td:nth-child(2)::before { margin-right: auto; }
  .schedule-table .team-display, .ranking-table .team-display { max-width: 78%; }
  .schedule-table .player-cell, .ranking-table .player-cell { width: 100%; justify-content: flex-start; }
  .schedule-table .score-link { margin-left: auto; }
  .ranking-table .player-cell strong { font-size: 11px; }
  .ranking-table .player-cell span { font-size: 9px; }
  /* Compact mobile rows: one match, team, or player per line. */
  .schedule-table tbody, .ranking-table tbody { display: block; padding: 0 12px 10px; }
  .schedule-table tr, .ranking-table tr { display: grid; align-items: center; gap: 0 7px; padding: 9px 0; border: 0; border-bottom: 1px solid #edf0ed; background: transparent; }
  .schedule-table tr { grid-template-columns: 28px minmax(0,1fr) 51px minmax(0,1fr); }
  .schedule-table td, .ranking-table td { display: block; padding: 0; border: 0; min-width: 0; text-align: left !important; }
  .schedule-table td::before, .ranking-table td::before { display: none; }
  .schedule-table td:nth-child(1) { grid-column: auto; }
  .schedule-table td:nth-child(2), .schedule-table td:nth-child(6) { display: none; }
  .schedule-table td:nth-child(3) { grid-column: 2; text-align: right !important; }
  .schedule-table td:nth-child(4) { grid-column: 3; text-align: center !important; }
  .schedule-table td:nth-child(5) { grid-column: 4; }
  .schedule-table .team-display { max-width: 100%; gap: 5px; }
  .schedule-table td:nth-child(3) .team-display { justify-content: flex-end; }
  .schedule-table .team-logo { width: 20px; height: 20px; flex-basis: 20px; }
  .schedule-table .score-link { min-width: 51px; padding: 5px 3px; font-size: 11px; }
  .ranking-table:not(.discipline-table) tr { grid-template-columns: 27px minmax(0,1fr) 30px 28px 28px 28px 44px 34px; }
  .ranking-table:not(.discipline-table) td:nth-child(1) { grid-column: 1; }
  .ranking-table:not(.discipline-table) td:nth-child(2) { grid-column: 2; }
  .ranking-table:not(.discipline-table) td:nth-child(3) { grid-column: 3; text-align: center !important; }
  .ranking-table:not(.discipline-table) td:nth-child(4) { grid-column: 4; text-align: center !important; }
  .ranking-table:not(.discipline-table) td:nth-child(5) { grid-column: 5; text-align: center !important; }
  .ranking-table:not(.discipline-table) td:nth-child(6) { grid-column: 6; text-align: center !important; }
  .ranking-table:not(.discipline-table) td:nth-child(7) { grid-column: 7; text-align: center !important; }
  .ranking-table:not(.discipline-table) td:nth-child(8) { grid-column: 8; text-align: center !important; }
  .ranking-table:not(.discipline-table) td:nth-child(9), .ranking-table:not(.discipline-table) td:nth-child(10), .ranking-table:not(.discipline-table) td:nth-child(11), .ranking-table:not(.discipline-table) td:nth-child(12) { display: none; }
  .ranking-table:not(.discipline-table) .player-cell { gap: 6px; }
  .ranking-table:not(.discipline-table) .player-avatar { width: 24px; height: 24px; flex-basis: 24px; }
  .ranking-table.standings-table thead { display: block; padding: 0 12px; background: #f7f9f7; border-bottom: 1px solid var(--line); }
  .ranking-table.standings-table thead tr,
  .ranking-table.standings-table tbody tr { grid-template-columns: 27px minmax(0, 1fr) repeat(4, 28px) 38px 36px; gap: 0 7px; }
  .ranking-table.standings-table thead tr { display: grid; align-items: center; padding: 9px 0 8px; }
  .ranking-table.standings-table th { display: block; padding: 0; text-align: center; font-size: 9px; }
  .ranking-table.standings-table th:nth-child(1),
  .ranking-table.standings-table th:nth-child(2) { text-align: left; }
  .ranking-table.standings-table th:nth-child(3),
  .ranking-table.standings-table th:nth-child(8),
  .ranking-table.standings-table th:nth-child(9),
  .ranking-table.standings-table th:nth-child(12),
  .ranking-table.standings-table td:nth-child(3),
  .ranking-table.standings-table td:nth-child(8),
  .ranking-table.standings-table td:nth-child(9),
  .ranking-table.standings-table td:nth-child(12) { display: none; }
  .ranking-table.standings-table th:nth-child(1), .ranking-table.standings-table td:nth-child(1) { grid-column: 1; }
  .ranking-table.standings-table th:nth-child(2), .ranking-table.standings-table td:nth-child(2) { grid-column: 2; }
  .ranking-table.standings-table th:nth-child(4), .ranking-table.standings-table td:nth-child(4) { grid-column: 3; }
  .ranking-table.standings-table th:nth-child(5), .ranking-table.standings-table td:nth-child(5) { grid-column: 4; }
  .ranking-table.standings-table th:nth-child(6), .ranking-table.standings-table td:nth-child(6) { grid-column: 5; }
  .ranking-table.standings-table th:nth-child(7), .ranking-table.standings-table td:nth-child(7) { grid-column: 6; }
  .ranking-table.standings-table th:nth-child(10), .ranking-table.standings-table td:nth-child(10) { display: block; grid-column: 7; text-align: center !important; }
  .ranking-table.standings-table th:nth-child(11), .ranking-table.standings-table td:nth-child(11) { display: block; grid-column: 8; text-align: right !important; }
  .ranking-table.standings-table td:nth-child(4),
  .ranking-table.standings-table td:nth-child(5),
  .ranking-table.standings-table td:nth-child(6),
  .ranking-table.standings-table td:nth-child(7) { text-align: center !important; }
  .player-ranking-table tr { grid-template-columns: 27px minmax(0,1fr) 38px; }
  .player-ranking-table td:nth-child(1) { grid-column: 1; }
  .player-ranking-table td:nth-child(2) { grid-column: 2; }
  .player-ranking-table td:nth-child(3) { display: none; }
  .player-ranking-table td:nth-child(4) { grid-column: 3; text-align: right !important; }
  .discipline-table tr { grid-template-columns: 27px minmax(0,1fr) 25px 30px 50px; }
  .discipline-table td:nth-child(1) { grid-column: 1; }
  .discipline-table td:nth-child(2) { grid-column: 2; }
  .discipline-table td:nth-child(3) { display: none; }
  .discipline-table td:nth-child(4) { grid-column: 3; text-align: center !important; }
  .discipline-table td:nth-child(5) { grid-column: 4; text-align: center !important; }
  .discipline-table td:nth-child(6) { grid-column: 5; text-align: right !important; }
  .match-detail-score { grid-template-columns: 1fr 78px 1fr; gap: 8px; padding: 25px 15px; }
  .detail-team-logo { width: 44px; height: 44px; }
  .match-detail-score > div strong { font-size: 12px; }
  .detail-score { font-size: 20px; }
  .event-timeline { padding-left: 16px; padding-right: 16px; }
  .admin-banner { align-items: flex-start; flex-direction: column; }
  .upload-btn { width: 100%; justify-content: center; }
  .editor-grid { grid-template-columns: 1fr; }
  .score-editor { grid-template-columns: 1fr; }
  .score-dash { display: none; }
  .copy-round { align-items: stretch; }
  .copy-round .filter-select, .copy-round .secondary-btn { width: 100%; }
}
