/* Shared styling for the compliance-office UI (SMU pilot): the roster tree,
   player page, and evaluation review screen. Extracted from
   compliance_tree.html so the three standalone pages don't drift out of
   sync with duplicated <style> blocks. Page-specific rules live inline in
   each template. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:       #0f1623;
    /* Hover shade for the solid --text-1 buttons/active-states below --
       same value design-tokens.css calls --gray-800, kept as a local
       token rather than a cross-file dependency (see the compliance.css
       standalone-vs-shared-tokens decision in the design-system-
       unification Phase 3 commit). */
    --btn-hover:  #27272A;
    --green:      #16a34a;
    --green-pale: #dcfce7;
    --red:        #dc2626;
    --red-pale:   #fee2e2;
    --amber:      #d97706;
    --amber-pale: #fef9c3;
    --indigo-pale:#dbeafe;
    --surface:    #f4f6f9;
    --card:       #ffffff;
    --border:     #e0e4ea;
    --border-soft:#edf0f4;
    --text-1:     #0f1623;
    --text-2:     #4a5568;
    --text-3:     #8892a0;
    --sidebar-w:  280px;

    /* Per-institution accent colors (session 9) — default to the existing
       neutral system. templates/_compliance_sidebar.html is the ONLY place
       that ever overrides these (a per-request <style> block, driven by
       compliance_routes._inject_institution_theme), so any institution
       with no colors set on its Institution row renders identically to
       before this feature existed. Deliberately used only for restrained
       accents below (active-item border, search focus, the institution
       badge, stat-card top-borders) — never body text, backgrounds, or
       primary buttons, which stay on --text-1/--border/--surface. */
    --inst-primary:   var(--text-1);
    --inst-secondary: var(--text-3);
}

body { font-family: 'Inter', -apple-system, sans-serif; font-size: 13px; background: var(--surface); color: var(--text-1); line-height: 1.5; }

/* ── Sidebar — light/paper, not the old dark navy fill. ── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; }
.sidebar-logo { padding: 16px 16px 12px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; gap: 10px; }
.sidebar-logo-name { color: var(--text-1); font-size: 13px; font-weight: 600; }
.sidebar-logo-sub { color: var(--text-3); font-size: 9px; letter-spacing: 0.8px; text-transform: uppercase; margin-top: 2px; }

/* Institution badge — only rendered when Institution.primary_color is set
   (see _compliance_sidebar.html); no logo/mark, just an initial on a
   colored square, per the session brief's "no SMU mustang mark" rule. */
.institution-badge {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
    background: var(--inst-primary); border: 2px solid var(--inst-secondary);
    color: #fff; font-size: 14px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

.search-wrap { padding: 12px; border-bottom: 1px solid var(--border-soft); }
.search-input {
    width: 100%; padding: 7px 10px; border-radius: 7px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-1); font-size: 12px; font-family: inherit;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus { outline: none; border-color: var(--inst-primary); }

.tree { padding: 8px 8px 20px; }
.tree-root {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: 7px; color: var(--text-2);
    font-size: 12px; font-weight: 600; text-decoration: none; margin-bottom: 4px;
}
.tree-root:hover { background: var(--surface); color: var(--text-1); }
.tree-root.active { background: var(--border); color: var(--text-1); border-left: 3px solid var(--inst-primary); padding-left: 7px; }

.sidebar-divider { height: 0.5px; background: var(--border-soft); margin: 6px 10px 10px; }

.tree-year { margin-bottom: 2px; }

/* A folder row is [chevron toggle][link] — the toggle only shows/hides the
   row's sibling .tree-positions/.tree-players (JS, see
   _compliance_sidebar.html's <script>); the link itself still navigates,
   same as before the collapsible-tree session. */
.tree-row { display: flex; align-items: center; gap: 2px; }
.tree-toggle {
    flex-shrink: 0; width: 18px; height: 18px; padding: 0; border: none; background: none;
    display: flex; align-items: center; justify-content: center; color: var(--text-3); cursor: pointer;
}
.tree-toggle:hover { color: var(--text-1); }
.tree-chevron { display: inline-block; font-size: 12px; transition: transform 0.15s; }
.tree-toggle[aria-expanded="true"] .tree-chevron { transform: rotate(90deg); }

.tree-year-link, .tree-pos-link {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px;
    color: var(--text-2); font-size: 12px; text-decoration: none;
}
.tree-year-link { font-weight: 600; color: var(--text-1); }
.tree-year-link:hover, .tree-pos-link:hover { background: var(--surface); color: var(--text-1); }
.tree-year-link.active, .tree-pos-link.active { background: var(--border); color: var(--text-1); border-left: 3px solid var(--inst-primary); padding-left: 7px; }
/* Connector line from a class-year node down to its position sub-counts —
   same left-border-as-tree-line technique as before, just recolored for
   the light sidebar. */
.tree-positions { margin-left: 20px; border-left: 1px solid var(--border); padding-left: 4px; }
.tree-position { margin-bottom: 1px; }
/* Leaf tier — individual players under an expanded position folder. Plain
   text links (no badge/count), one level further indented than the
   position row above them. */
.tree-players { margin-left: 20px; border-left: 1px solid var(--border-soft); padding-left: 4px; }
.tree-player-link {
    display: block; padding: 5px 10px; border-radius: 7px; font-size: 11.5px;
    color: var(--text-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tree-player-link:hover { background: var(--surface); color: var(--text-1); }
.tree-node-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-badge {
    background: var(--border); color: var(--text-2); font-size: 10px; font-weight: 700;
    min-width: 17px; height: 17px; border-radius: 9px; display: inline-flex;
    align-items: center; justify-content: center; padding: 0 5px; flex-shrink: 0;
}
/* Attention state — a folder containing >=1 flagged player (see
   compliance_tree.build_tree's flagged_count) still gets this class (the
   underlying flag_details()/flagged_count logic is untouched), but as of
   the roster redesign it's no longer color-coded: same neutral gray pill
   as every other count, for now (see the session brief — a deliberate,
   reversible visual-only call, not a removal of the attention data
   itself, which still feeds the Home view's stat cards). */
.tree-badge-attn { background: var(--border); color: var(--text-2); }

/* ── Main ── */
.main-wrap { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: var(--card); border-bottom: 0.5px solid var(--border); height: 52px; display: flex; align-items: center; padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.topbar-title { font-size: 14px; font-weight: 600; }
.topbar-sub { font-size: 11px; color: var(--text-3); margin-left: 8px; }
.page-content { flex: 1; padding: 20px 24px; }

.breadcrumbs { font-size: 12px; color: var(--text-3); }
.breadcrumbs a { color: var(--text-2); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text-1); text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; }

.flash-wrap { padding: 0 24px; margin-top: 12px; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 8px; font-size: 12px; margin-bottom: 8px; }
.flash-error   { background: var(--red-pale);   color: #991b1b; border: 0.5px solid #fca5a5; }
.flash-success { background: var(--green-pale); color: #14532d; border: 0.5px solid #86efac; }
.flash-warning { background: var(--amber-pale); color: #92400e; border: 0.5px solid #fcd34d; }
.flash-close { margin-left: auto; cursor: pointer; opacity: 0.5; background: none; border: none; font-size: 14px; color: inherit; line-height: 1; }

.card { background: var(--card); border: 0.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.card + .card { margin-top: 16px; }
.card-header { padding: 12px 16px; border-bottom: 0.5px solid var(--border); font-size: 12px; font-weight: 600; background: var(--surface); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 9px 14px; font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; background: var(--surface); border-bottom: 0.5px solid var(--border); }
.data-table td { padding: 10px 14px; border-bottom: 0.5px solid var(--border-soft); font-size: 12px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface); }

.pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.pill-navy  { background: #dde3f0; color: #1a2744; }
.pill-grey  { background: #f1f5f9; color: #475569; }
.pill-red   { background: var(--red-pale); color: #b91c1c; }
.pill-amber { background: var(--amber-pale); color: #92400e; }

.gpa-green { color: var(--green); font-weight: 700; }
.gpa-amber { color: var(--amber); font-weight: 700; }
.gpa-red   { color: var(--red); font-weight: 700; }
.gpa-none  { color: var(--text-3); }

.assign-form { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.assign-form select, .assign-form input[type=text] {
    padding: 5px 6px; border: 0.5px solid var(--border); border-radius: 6px; font-size: 11px;
    font-family: inherit; background: var(--card); color: var(--text-1);
}
.assign-form select { max-width: 84px; }
.assign-form input[type=text] { width: 120px; }
.assign-form button {
    padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 500;
    background: var(--text-1); color: #fff; border: none; cursor: pointer;
}
.assign-form button:hover { background: var(--btn-hover); }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-3); }

.upload-form { display: flex; align-items: center; gap: 10px; padding: 16px; flex-wrap: wrap; }
.upload-form button {
    padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
    background: var(--text-1); color: #fff; border: none; cursor: pointer;
}
.upload-form button:hover { background: var(--btn-hover); }

/* ── Player page header ── */
.player-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px; flex-wrap: wrap; }
.player-name { font-size: 20px; font-weight: 700; }
.player-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.player-tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.stat-row { display: flex; gap: 24px; padding: 16px 20px; border-top: 0.5px solid var(--border); flex-wrap: wrap; }
.stat { min-width: 100px; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); font-weight: 600; }
.stat-value { font-size: 18px; font-weight: 700; margin-top: 2px; }

/* ── Attention panel ── */
.attention-panel { border-radius: 10px; overflow: hidden; margin-bottom: 16px; border: 0.5px solid var(--border); }
.attention-panel-header { padding: 10px 16px; font-size: 12px; font-weight: 700; }
.attention-panel.has-error .attention-panel-header { background: var(--red-pale); color: #991b1b; }
.attention-panel.warn-only .attention-panel-header { background: var(--amber-pale); color: #92400e; }
.attention-list { list-style: none; background: var(--card); }
.attention-list li { padding: 9px 16px; font-size: 12px; border-top: 0.5px solid var(--border-soft); display: flex; gap: 8px; align-items: flex-start; }
.attention-list .dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.attention-list li.error .dot { background: var(--red); }
.attention-list li.warning .dot { background: var(--amber); }

/* ── Evaluation review screen ── */
.import-banner { background: var(--indigo-pale); color: #1e3a8a; padding: 10px 16px; border-radius: 8px; font-size: 12px; margin-bottom: 16px; }
.headline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; }
.headline-grid .stat { padding: 16px 20px; border-right: 0.5px solid var(--border-soft); border-bottom: 0.5px solid var(--border); }
.section-title { font-size: 12px; font-weight: 700; padding: 12px 16px 4px; }
.no-export-note { font-size: 11px; color: var(--text-3); font-style: italic; }

/* ── Roster table — dense <table>, one row per player, replacing the
   session-7 card-list redesign. Clicking a row (JS, see compliance_tree.html)
   toggles the `hidden` attribute on its paired .roster-detail-row, which
   holds the hero ring, 2x2 subject-ring grid (or "no evaluation" message),
   assign controls, and action links that used to always be visible in the
   card's expand panel. Multiple rows can be open at once — no accordion
   single-open enforcement, since nothing about scanning several expanded
   players at once is confusing on a page this size. ── */
.roster-table-card { overflow-x: auto; }
.roster-table { table-layout: fixed; }
.roster-col-chevron { width: 28px; }
.roster-row { cursor: pointer; }
.roster-row:focus-visible { outline: 2px solid var(--text-1); outline-offset: -2px; }
.roster-row-name { font-weight: 700; color: var(--text-1); }
.roster-row-chevron { display: inline-block; color: var(--text-3); font-size: 14px; transition: transform 0.15s; }
.roster-row.roster-row-open .roster-row-chevron { transform: rotate(90deg); }
.status-text { font-size: 12px; color: var(--text-2); }

.roster-detail-row td { padding: 0; border-bottom: 0.5px solid var(--border-soft); background: var(--surface); }
.roster-detail { display: flex; gap: 20px; padding: 18px 20px; align-items: flex-start; }
.roster-detail-ring { flex-shrink: 0; width: 60px; height: 60px; }
.roster-detail-body { flex: 1; min-width: 0; }

.roster-ring { display: block; }
.roster-ring-num { font-size: 15px; font-weight: 800; fill: var(--text-1); }
.roster-ring-den { font-size: 9px; font-weight: 600; fill: var(--text-3); }
.roster-ring-empty {
    width: 60px; height: 60px; border-radius: 50%; background: var(--card);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); font-size: 20px;
}

.no-eval-message { text-align: center; padding: 8px 0 8px; color: var(--text-3); font-size: 12px; }

.roster-detail-controls {
    margin-top: 16px; padding-top: 14px; border-top: 0.5px solid var(--border-soft);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.roster-detail-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.roster-detail-link { font-size: 12px; font-weight: 600; color: var(--text-1); text-decoration: none; white-space: nowrap; }
.roster-detail-link:hover { text-decoration: underline; }

/* ── Home view ── */
.home-page-content { max-width: 760px; }
.home-search-form { display: flex; gap: 8px; margin-bottom: 20px; }
.home-search-input { flex: 1; padding: 9px 12px; font-size: 13px; }
.home-search-form button {
    padding: 9px 16px; border-radius: 7px; font-size: 12px; font-weight: 600;
    background: var(--text-1); color: #fff; border: none; cursor: pointer;
}
.home-search-form button:hover { background: var(--btn-hover); }

.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 0.5px solid var(--border); border-top: 3px solid var(--inst-primary); border-radius: 10px; padding: 16px; text-align: center; }
.stat-card-value { font-size: 26px; font-weight: 800; color: var(--text-1); }
.stat-card-label { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.recent-player-link { font-weight: 600; color: var(--text-1); text-decoration: none; }
.recent-player-link:hover { text-decoration: underline; }
.recent-viewed-at { text-align: right; color: var(--text-3); }

/* Subject-ring 2x2 grid — same geometry/labels as results.html's "Where you
   stand" section (see subject_ring_grid in _compliance_partials.html),
   restyled with this stylesheet's own tokens instead of results.html's. */
.subject-grid-2x2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 12px; padding-top: 16px; }
.subject-card { text-align: center; }
.subject-ring-svg { display: block; margin: 0 auto; }
.subject-ring-num { font-size: 18px; font-weight: 800; fill: var(--text-1); }
.subject-ring-den { font-size: 10px; font-weight: 700; fill: var(--text-3); }

/* ── Add Player FAB + modal (Home view) ── */
.fab {
    position: fixed; bottom: 28px; right: 28px; z-index: 20;
    background: var(--text-1); color: #fff; border: none; border-radius: 24px;
    padding: 13px 22px; font-size: 13px; font-weight: 700; font-family: inherit;
    cursor: pointer; box-shadow: 0 6px 16px rgba(15, 22, 35, 0.28);
}
.fab:hover { background: var(--btn-hover); }

.modal { border: 0.5px solid var(--border); border-radius: 10px; padding: 0; width: 420px; max-width: calc(100vw - 40px); box-shadow: 0 12px 32px rgba(15, 22, 35, 0.22); }
.modal::backdrop { background: rgba(15, 22, 35, 0.45); }
.modal-form { display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 0.5px solid var(--border); font-size: 13px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 14px; color: var(--text-3); cursor: pointer; }
.modal-close:hover { color: var(--text-1); }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-field { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text-2); }
.modal-field input, .modal-field select {
    font-family: inherit; font-size: 13px; font-weight: 400; color: var(--text-1);
    padding: 8px 10px; border: 0.5px solid var(--border); border-radius: 7px; background: var(--card);
}
.modal-field input:focus, .modal-field select:focus { outline: none; border-color: var(--inst-primary); }
.modal-hint { font-size: 10px; font-weight: 400; color: var(--text-3); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 0.5px solid var(--border); }
.modal-cancel, .modal-submit {
    font-family: inherit; font-size: 12px; font-weight: 600; border-radius: 7px; padding: 8px 16px; cursor: pointer;
}
.modal-cancel { background: none; border: 0.5px solid var(--border); color: var(--text-2); }
.modal-cancel:hover { background: var(--surface); }
.modal-submit { background: var(--text-1); color: #fff; border: none; }
.modal-submit:hover { background: var(--btn-hover); }
.subject-name { margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--text-1); }
