:root {
    --navy: #101826;
    --navy-2: #192438;
    --orange: #f47b20;
    --orange-soft: #fff2e8;
    --ink: #172033;
    --muted: #667085;
    --line: #e4e7ec;
    --surface: #ffffff;
    --background: #f5f7fa;
    --danger: #c43232;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
body:not(.coach-authenticated) .coach-only { display: none !important; }
body:not(.coach-authenticated) .authenticated-only { display: none !important; }
body:not(.admin-authenticated) .admin-only { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 32px 20px; background: var(--navy); color: white; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; }
.brand-ball { color: var(--orange); font-size: 32px; line-height: .5; }
.brand-subtitle { margin: 4px 0 40px 42px; color: #aeb7c7; font-size: 13px; }
nav { display: grid; gap: 8px; }
.nav-button { width: 100%; border: 0; border-radius: 10px; padding: 12px 14px; text-align: left; color: #c8d0dc; background: transparent; }
.nav-button:hover, .nav-button.active { color: white; background: var(--navy-2); }
.nav-button.active { box-shadow: inset 3px 0 var(--orange); }
.sidebar-note { position: absolute; bottom: 28px; left: 20px; right: 20px; padding: 14px; border: 1px solid #2c3a50; border-radius: 10px; color: #aeb7c7; font-size: 12px; line-height: 1.5; }
.sidebar-tools { display: grid; gap: 8px; }
.sidebar-tools strong { color: white; }
.sidebar-tools div { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sidebar-button { border: 1px solid #3b4a61; border-radius: 7px; padding: 7px 5px; color: #d5dbe5; background: #192438; font-size: 11px; font-weight: 700; }
main { min-width: 0; padding: 0 42px 80px; }
.topbar { min-height: 116px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.team-switcher { display: flex; width: auto; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.team-switcher select { width: auto; min-width: 145px; padding: 8px 30px 8px 10px; }
.access-badge { border: 1px solid #d0d5dd; border-radius: 999px; padding: 7px 11px; color: #475467; background: #f2f4f7; font-size: 12px; font-weight: 800; white-space: nowrap; }
.access-badge.coach { border-color: #a6dfc2; color: #17613b; background: #e9f8ef; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; }
h2 { margin-bottom: 0; font-size: 21px; }
h3 { margin-bottom: 5px; }
.eyebrow { margin-bottom: 6px; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.primary-button, .secondary-button, .ghost-button, .danger-button { border-radius: 9px; padding: 10px 16px; font-weight: 700; }
.primary-button { border: 1px solid var(--orange); color: white; background: var(--orange); }
.primary-button:hover { background: #dc6512; }
.secondary-button { border: 1px solid #f4b381; color: #b84e07; background: var(--orange-soft); }
.ghost-button { border: 1px solid var(--line); color: var(--ink); background: white; }
.danger-button { border: 1px solid #f0c5c5; color: var(--danger); background: #fff6f6; }
.icon-button { border: 0; background: transparent; font-size: 25px; color: var(--muted); }
.hidden { display: none !important; }
.view { padding-top: 30px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stat-card, .panel, .practice-card, .block-card, .drill-card, .template-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 3px 12px rgba(16, 24, 38, .035); }
.stat-card { display: flex; flex-direction: column; padding: 22px; color: var(--muted); }
.stat-card strong { margin-top: 12px; color: var(--ink); font-size: 30px; }
.stat-card small { margin-top: 6px; }
.section-heading { margin: 34px 0 16px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.practice-list { display: grid; gap: 12px; }
.practice-card { display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 20px; padding: 18px; }
.date-tile { display: grid; place-items: center; min-height: 64px; border-radius: 10px; color: white; background: var(--navy-2); }
.date-tile strong { font-size: 25px; }
.date-tile span { font-size: 11px; letter-spacing: .08em; }
.practice-meta, .drill-meta { color: var(--muted); font-size: 13px; }
.status-chip { display: inline-block; margin-left: 6px; border-radius: 999px; padding: 3px 7px; color: #17613b; background: #e9f8ef; font-size: 10px; font-weight: 800; }
.card-actions { display: flex; gap: 8px; }
.practice-card .card-actions { flex-wrap: wrap; justify-content: flex-end; }
.panel { padding: 22px; }
.basics-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 18px; }
.wide { grid-column: span 2; }
label { display: grid; gap: 7px; color: #344054; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cfd4dc; border-radius: 8px; padding: 10px 11px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244, 123, 32, .12); }
textarea { resize: vertical; }
.timeline-heading { align-items: center; }
.timeline-actions { display: flex; align-items: center; gap: 12px; }
.time-badge { border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 800; background: #eef2f6; }
.time-badge.over { color: var(--danger); background: #fff0f0; }
.blocks-container { display: grid; gap: 14px; }
.block-card { overflow: hidden; border-left: 5px solid var(--block-color, var(--orange)); }
.block-header { display: grid; grid-template-columns: 115px 1fr auto; align-items: center; gap: 16px; padding: 16px 18px; background: #fbfcfd; }
.block-time { font-weight: 800; color: var(--navy); }
.block-body { padding: 18px; }
.block-fields { display: grid; grid-template-columns: 1.4fr 1fr .7fr 1.5fr; gap: 12px; }
.drill-assignments { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.assignment-row { display: grid; grid-template-columns: 1.6fr 90px 1.2fr 1.5fr auto; gap: 10px; align-items: end; margin-top: 10px; }
.block-tools { display: flex; gap: 6px; }
.small-button { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: white; }
.small-button.danger { color: var(--danger); }
.sticky-save { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding: 16px 0; background: linear-gradient(transparent, var(--background) 25%); }
.filter-bar { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 18px; }
.drill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.drill-card { padding: 18px; }
.type-chip { display: inline-block; margin-bottom: 12px; border-radius: 999px; padding: 5px 8px; color: #9a4308; background: var(--orange-soft); font-size: 10px; font-weight: 800; }
.drill-card .card-actions { margin-top: 16px; }
.empty-state { padding: 40px; border: 1px dashed #cfd4dc; border-radius: 14px; text-align: center; color: var(--muted); background: white; }
.message { position: fixed; z-index: 10; right: 24px; top: 20px; max-width: 420px; border-radius: 10px; padding: 14px 18px; color: #155d36; background: #e9f8ef; box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.message.error { color: #8f2727; background: #fff0f0; }
dialog { width: min(560px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 0; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10, 17, 28, .62); }
#drill-form, #team-form, #coach-form, #password-form { display: grid; gap: 15px; padding: 25px; }
#coach-login-form { display: grid; gap: 16px; padding: 26px; }
.login-intro { margin: -2px 0 2px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.form-error { margin: 0; border-radius: 8px; padding: 10px 12px; color: #8f2727; background: #fff0f0; font-size: 13px; line-height: 1.45; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-actions { justify-content: flex-end; margin-top: 8px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.game-plan-panel { margin-top: 18px; border-left: 5px solid var(--orange); }
.game-plan-grid { display: grid; grid-template-columns: .8fr 1.4fr 1.4fr; gap: 16px; }
.review-panel { margin-top: 18px; border-left: 5px solid #10b981; }
.review-grid { display: grid; grid-template-columns: 1fr 3fr; align-items: end; gap: 16px; }
.checkbox-label { display: flex; align-items: center; align-self: center; gap: 9px; }
.checkbox-label input { width: auto; }
.section-intro { margin: -4px 0 20px; color: var(--muted); }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.template-card { padding: 20px; }
.template-card .card-actions { margin-top: 18px; flex-wrap: wrap; }
.calendar-toolbar { align-items: center; margin-top: 0; }
.calendar-column-headings { display: grid; grid-template-columns: 72px repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 12px 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.calendar-column-headings strong:last-child { color: var(--orange); }
.calendar-grid { display: grid; gap: 12px; }
.calendar-week { display: grid; grid-template-columns: 72px repeat(3, minmax(0, 1fr)); gap: 12px; }
.week-number { display: grid; place-items: center; border-radius: 12px; color: var(--muted); background: #e9edf3; font-size: 12px; font-weight: 800; }
.calendar-day { min-height: 150px; border: 1px solid var(--line); border-radius: 13px; padding: 14px; background: white; }
.calendar-day.outside-month { opacity: .48; }
.calendar-day.game-column { border-top: 4px solid var(--orange); }
.calendar-day-heading { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 800; }
.calendar-day-heading strong { color: var(--ink); font-size: 20px; }
.calendar-items { display: grid; gap: 8px; }
.calendar-item { width: 100%; border: 1px solid #dce3eb; border-left: 4px solid #2563eb; border-radius: 8px; padding: 9px; text-align: left; color: var(--ink); background: #f8fafc; }
.calendar-item.game { border-left-color: var(--orange); background: var(--orange-soft); }
.calendar-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.calendar-empty { color: #a1a9b6; font-size: 12px; }
.statistics-panel { margin-top: 18px; }
.statistics-filter-panel { display: flex; align-items: end; gap: 16px; margin-bottom: 18px; }
.statistics-filter-panel > label { width: min(260px, 100%); }
.statistics-custom-dates { display: flex; align-items: end; gap: 10px; }
.statistics-custom-dates label { width: 170px; }
.statistics-period-label { margin-left: auto; padding: 9px 12px; border-radius: 999px; color: #475467; background: #eef2f6; font-size: 12px; font-weight: 800; }
.statistics-list { display: grid; gap: 18px; }
.statistic-row { display: grid; grid-template-columns: 160px 1fr 95px; align-items: center; gap: 16px; }
.statistic-label { font-weight: 800; }
.statistic-bar-track { height: 18px; overflow: hidden; border-radius: 999px; background: #edf0f4; }
.statistic-bar { height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, var(--orange), #ffad67); }
.statistic-value { text-align: right; color: var(--muted); font-size: 13px; font-weight: 700; }
.practice-view-dialog { width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 8px 30px rgba(16, 24, 38, .08); }
.practice-view-content { display: flex; flex-direction: column; padding: 0; }
.practice-view-header { flex: 0 0 auto; padding: 28px 32px 20px; border-bottom: 1px solid var(--line); background: white; }
.practice-view-header h2 { max-width: 850px; margin: 0; font-size: 28px; line-height: 1.2; overflow-wrap: anywhere; }
.practice-view-scroll { min-height: 0; padding: 20px 32px 30px; background: #f8fafc; }
.practice-view-meta { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.coach-notes-box { margin-bottom: 18px; padding: 18px 20px; border: 1px solid #dfe4eb; border-radius: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; background: white; }
.coach-notes-box .eyebrow { display: block; }
.game-view-box, .review-view-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; padding: 14px; border-radius: 12px; }
.game-view-box { border: 1px solid #ffd5b5; background: var(--orange-soft); }
.review-view-box { border: 1px solid #b9ead3; background: #effbf5; }
.view-detail { min-width: 0; padding: 12px 14px; border-radius: 9px; background: rgba(255, 255, 255, .76); }
.view-detail span, .view-detail strong { display: block; }
.view-detail span { margin-bottom: 6px; color: #667085; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.view-detail strong { font-size: 13px; font-weight: 600; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.practice-view-blocks { display: grid; gap: 14px; }
.practice-view-block { overflow: hidden; border: 1px solid #dfe4eb; border-left: 6px solid var(--view-color, var(--orange)); border-radius: 13px; background: white; box-shadow: 0 3px 10px rgba(16, 24, 38, .035); }
.practice-view-block-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 17px 20px; background: #fbfcfd; }
.practice-view-block-title { display: flex; min-width: 0; align-items: flex-start; gap: 12px; }
.practice-view-block-title h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.block-number { display: grid; flex: 0 0 28px; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: white; background: var(--view-color, var(--orange)); font-size: 12px; font-weight: 800; }
.practice-view-block-meta { color: var(--muted); font-size: 12px; }
.practice-view-time { flex: 0 0 auto; border-radius: 999px; padding: 7px 10px; color: var(--navy); background: #edf1f6; font-size: 13px; font-weight: 800; white-space: nowrap; }
.practice-view-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; padding: 14px 20px 4px; }
.practice-view-note { min-width: 0; padding: 13px 14px; border: 1px solid #e7eaf0; border-radius: 10px; background: #fcfcfd; }
.practice-view-note span { display: block; margin-bottom: 6px; color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.practice-view-note p { margin: 0; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.practice-view-drills { display: grid; gap: 8px; padding: 14px 20px 18px; }
.practice-view-drill { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 11px 13px; border-radius: 9px; background: #f4f6f9; }
.practice-view-drill-copy { min-width: 0; }
.practice-view-drill-copy strong { display: block; overflow-wrap: anywhere; }
.practice-view-drill-copy p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.drill-teaching-points { margin-top: 9px; padding: 9px 11px; border-left: 3px solid var(--orange); border-radius: 0 7px 7px 0; background: white; }
.drill-teaching-points span { display: block; margin-bottom: 3px; color: var(--orange); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.drill-teaching-points p { margin: 0; color: var(--ink); }
.drill-time { border-radius: 999px; padding: 4px 8px; color: #344054; background: white; font-size: 11px; font-weight: 800; white-space: nowrap; }
.practice-share-actions { flex: 0 0 auto; flex-wrap: wrap; margin: 0; padding: 18px 32px; border-top: 1px solid var(--line); background: white; box-shadow: 0 -8px 22px rgba(16, 24, 38, .04); }
.print-scale-control { display: flex; width: auto; flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
.print-scale-control select { width: auto; min-width: 170px; padding: 9px 10px; }
.dialog-action-spacer { flex: 1; }
.team-pill { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; border-radius: 999px; padding: 4px 8px; color: #344054; background: #eef2f6; font-size: 11px; font-weight: 800; }
.team-pill::before { width: 8px; height: 8px; border-radius: 50%; background: var(--team-color, var(--orange)); content: ""; }
.admin-heading { margin-top: 24px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: white; box-shadow: 0 3px 12px rgba(16, 24, 38, .035); }
.admin-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-card-heading h3 { overflow-wrap: anywhere; }
.account-status { border-radius: 999px; padding: 4px 8px; color: #17613b; background: #e9f8ef; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.account-status.inactive { color: #8f2727; background: #fff0f0; }
.admin-card .card-actions { margin-top: 16px; flex-wrap: wrap; }
.team-permission-box { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.team-permission-box legend { padding: 0 6px; color: #344054; font-size: 13px; font-weight: 800; }
.team-checkboxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.team-checkboxes label { display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 9px; background: #f8fafc; }
.team-checkboxes input { width: auto; }
@media print {
    @page { size: A4 portrait; margin: 12mm; }
    body.printing-practice { color: #111827; background: white; }
    body.printing-practice .sidebar,
    body.printing-practice .topbar,
    body.printing-practice .message,
    body.printing-practice .view:not(#practice-detail-view),
    body.printing-practice #drill-dialog,
    body.printing-practice #coach-login-dialog { display: none !important; }
    body.printing-practice .app-shell { display: block !important; }
    body.printing-practice main { padding: 0 !important; }
    body.printing-practice #practice-detail-view { display: block !important; padding: 0 !important; }
    body.printing-practice #practice-view-dialog {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        border: 0 !important;
        box-shadow: none !important;
        zoom: var(--practice-print-scale, 1);
    }
    body.printing-practice .practice-view-content { display: block; max-height: none; padding: 0; }
    body.printing-practice .practice-view-header { padding: 0 0 18px; border: 0; }
    body.printing-practice .practice-view-scroll { overflow: visible; padding: 0; background: white; }
    body.printing-practice .practice-view-block { break-inside: avoid; box-shadow: none; }
    body.printing-practice .dialog-actions,
    body.printing-practice .practice-view-header button { display: none !important; }
    body.printing-practice .game-view-box { border: 1px solid #e4e7ec; background: white; }
    body.printing-practice .eyebrow { color: #b84e07; }
}
@media (max-width: 950px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; padding: 18px; }
    .sidebar-note, .brand-subtitle { display: none; }
    nav { display: flex; margin-top: 16px; overflow-x: auto; }
    main { padding: 0 18px 70px; }
    .stats-grid, .drill-grid, .template-grid, .admin-grid { grid-template-columns: 1fr; }
    .basics-grid, .block-fields, .assignment-row { grid-template-columns: 1fr 1fr; }
    .calendar-column-headings, .calendar-week { grid-template-columns: 55px repeat(3, minmax(190px, 1fr)); }
    .calendar-grid, .calendar-column-headings { overflow-x: auto; }
    .game-plan-grid, .game-view-box, .review-grid, .review-view-box { grid-template-columns: 1fr; }
    .statistics-filter-panel, .statistics-custom-dates { align-items: stretch; flex-direction: column; }
    .statistics-filter-panel > label, .statistics-custom-dates label { width: 100%; }
    .statistics-period-label { margin-left: 0; align-self: flex-start; }
    .wide { grid-column: span 2; }
}
@media (max-width: 620px) {
    .topbar, .section-heading { align-items: flex-start; }
    .topbar { padding: 20px 0; }
    .topbar-actions { flex-wrap: wrap; }
    .team-switcher { width: 100%; justify-content: space-between; }
    .team-switcher select { flex: 1; }
    .practice-card, .block-header, .basics-grid, .block-fields, .assignment-row, .filter-bar { grid-template-columns: 1fr; }
    .statistic-row { grid-template-columns: 1fr; gap: 6px; }
    .statistic-value { text-align: left; }
    .wide { grid-column: auto; }
    .date-tile { width: 75px; }
    .practice-view-dialog { width: 100%; }
    .practice-view-header { padding: 20px 18px 16px; }
    .practice-view-header h2 { font-size: 23px; }
    .practice-view-scroll { padding: 16px 14px 20px; }
    .practice-view-block-heading { align-items: flex-start; padding: 14px; }
    .practice-view-time { font-size: 11px; }
    .practice-view-notes, .practice-view-drills { padding-left: 14px; padding-right: 14px; }
    .practice-share-actions { padding: 14px; }
    .print-scale-control { width: 100%; justify-content: space-between; }
    .practice-share-actions .dialog-action-spacer { display: none; }
    .team-checkboxes { grid-template-columns: 1fr; }
}
