/* Reset-ish */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #111;
    color: #f5f5f5;
}

/* Main application shell */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Make the overall shell use full-height flex layout if not already */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar: fixed + full height */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    /* match your sidebar width */
    z-index: 1000;

    display: flex;
    flex-direction: column;

    overflow: hidden;
    /* container itself doesn't scroll */
}

/* ✅ Make the nav area scroll */
.sidebar nav,
.sidebar .nav,
.sidebar .nav-items,
.sidebar .nav-scroll,
.sidebar .sidebar-menu {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    /* CRITICAL: allows the flex child to actually scroll */
}

/* ✅ Keep signout pinned and visible */
.sidebar .signout,
.sidebar .sidebar-footer,
.sidebar .nav-signout {
    flex: 0 0 auto;
}

/* Footer stays pinned at bottom */
.nav-footer {
    flex: 0 0 auto;
    padding: 0.75rem 0.75rem 1.25rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Main content (stretches to fill remaining space) */
#main-content {
    flex: 1;
    padding: 32px 40px;
    margin-left: 260px;
    background: #181a1f;
}

/* Nav items */
.nav-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #e5e5e5;
    text-align: left;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.nav-item:hover {
    background: #222831;
}

/* Home root button */
.nav-root {
    font-weight: 600;
    margin-bottom: 12px;
}

/* Active state (Home or any sub-item) */
.nav-item.active {
    background: #23953c;
    /* DGS green-ish, can tweak later */
    color: #ffffff;
}

/* Section headers (Player / Team / Admin) */
.nav-section {
    margin-bottom: 12px;
}

.nav-section-header {
    width: 100%;
    border: none;
    background: transparent;
    color: #aaaaaa;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 2px;
    font-size: 13px;
    text-transform: none;
    cursor: pointer;
}

.chart-shell {
    width: 100%;
    aspect-ratio: 16 / 9;
    /* consistent, never too tall */
    position: relative;
}

.chart-shell canvas {
    width: 100% !important;
    height: 100% !important;
    /* now it fills the shell, not the whole card */
    display: block;
}

.nav-section-header:hover {
    color: #ffffff;
}

.nav-section-header .chevron {
    font-size: 11px;
}

/* Submenu items */
.nav-submenu {
    margin-top: 4px;
    padding-left: 10px;
    display: block;
    /* visible by default; JS can collapse/expand */
}

.nav-sub {
    font-size: 13px;
    padding: 5px 10px;
}

/* Footer (Sign Out) */
.nav-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #333;
}

.nav-signout {
    color: #ff4b4b;
}

.nav-signout:hover {
    background: #331111;
}

/* Benchmarks admin view */
.bench-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.bench-card {
    background: #111318;
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid #252a33;
}

.bench-card h2 {
    margin: 0 0 4px;
    font-size: 16px;
}

.bench-id {
    margin: 0 0 8px;
    font-size: 11px;
    color: #888;
}

.bench-key {
    white-space: nowrap;
    color: #bbb;
}

.bench-val {
    text-align: right;
}

.roster-players {
    margin-top: 10px;
}

.roster-players h3 {
    margin: 0 0 4px;
    font-size: 13px;
}

.roster-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    font-size: 11px;
}

.roster-list li {
    margin-bottom: 2px;
}

.roster-index {
    margin-right: 4px;
    opacity: 0.7;
}

/* -------- Auth layout -------- */

/* Ensure the outer shell stretches full width */
#app-container {
    display: none;
    /* still stays hidden until auth shows it */
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #020617;
    /* dark background */
    padding: 2rem;
    box-sizing: border-box;
}

.auth-card {
    background: #0b1120;
    border-radius: 12px;
    padding: 2rem 2.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    color: #f9fafb;
}

.auth-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.6rem;
}

.auth-subtitle {
    margin: 0 0 1.5rem;
    color: #9ca3af;
    font-size: 0.9rem;
}

.auth-label {
    display: block;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.auth-input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.9rem;
    border-radius: 6px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #f9fafb;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 1px #22c55e33;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.auth-btn {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #374151;
    background: #111827;
    color: #e5e7eb;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.auth-btn.primary {
    background: #22c55e;
    border-color: #22c55e;
    color: #022c16;
    font-weight: 600;
}

.auth-btn:hover {
    filter: brightness(1.05);
}

.auth-link-btn {
    margin-top: 0.75rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    font-size: 0.8rem;
    text-decoration: underline;
}

.auth-link-btn:hover {
    color: #e5e7eb;
}

.auth-error {
    margin-top: 0.75rem;
    min-height: 1rem;
    font-size: 0.8rem;
    color: #f97373;
}

/* Player sub-tables headings */
#team-analytics-players h4 {
    margin-top: 24px;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #e5e9f0;
}












#ta-outliers-chart {
    display: block;
    width: 100%;
    height: 300px;
    /* chart gets a real canvas height */
}

/* ===========================
   TEAM ENGAGEMENT CHARTS
   =========================== */

.engagement-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.engagement-chart-card {
    background: #121820;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid #1f2733;
    height: 360px;
    /* top cards taller */
    display: flex;
    flex-direction: column;
}

.engagement-chart-card canvas {
    flex: 1;
}

.engagement-chart-wide {
    margin-top: 16px;
    background: #121820;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid #1f2733;
    height: 260px;
    /* bottom card a bit shorter */
    display: flex;
    flex-direction: column;
}

.engagement-chart-wide canvas {
    flex: 1;
}

.engagement-chart-title {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #e5e9f0;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Chart grid spacing */
.analytics-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
    /* <-- pushes the table down */
}

@media (min-width: 1100px) {
    .analytics-charts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Let the bottom card span both columns */
.analytics-card-span2 {
    grid-column: 1 / -1;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

/* pick colors that fit your palette */
.legend-pos {
    background-color: #22c55e;
    /* above team */
}

.legend-neg {
    background-color: #f97373;
    /* below team */
}

.ta-outlier-bar {
    height: 8px;
    border-radius: 999px;
}

.ta-outlier-bar-pos {
    background-color: #22c55e;
    /* Above Team */
}

.ta-outlier-bar-neg {
    background-color: #f97373;
    /* Below Team */
}

.par-type-chart-wide canvas {
    min-height: 300px;
    max-height: 450px;
}

.info-btn {
    cursor: pointer;
    color: #9ca3af;
    margin-left: 6px;
    font-size: 0.8rem;
}

.info-btn:hover {
    color: white;
}

.info-pill {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid #3a4656;
    background: #151a22;
    color: #cbd2e0;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.info-pill:hover {
    background: #1f2733;
    border-color: #4b5a6f;
}

.engagement-info-panel {
    display: none;
    margin-top: 10px;
    padding: 10px 12px;
    background: #10151c;
    border-radius: 8px;
    border: 1px solid #252b33;
    font-size: 0.85rem;
    color: #cbd2e0;
}

.engagement-info-panel.open {
    display: block;
}

.engagement-info-panel ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

/* =========================================================
   TABLE SYSTEM — ANALYTICS / COACH / ENGAGEMENT / PAR-TYPE
   (single source of truth)
   ========================================================= */

/* Base table look for all analytics-style tables */
.analytics-table,
.coach-table,
.bench-table {
    width: 100%;
    margin-top: 16px;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #11161c;
    border-radius: 12px;
    overflow: hidden;
    /* keep rounded corners */
    table-layout: fixed;
    /* header + body share exact columns */
}

/* Make sure header/body are real table sections */
.analytics-table thead,
.coach-table thead,
.bench-table thead {
    display: table-header-group;
}

.analytics-table tbody,
.coach-table tbody,
.bench-table tbody {
    display: table-row-group;
}

/* Header row bar */
.analytics-table thead th,
.coach-table thead th,
.bench-table thead th {
    background: linear-gradient(90deg, #222b36, #1e252f);
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c5ccd8;
    border-bottom: none;
    text-align: left;
}

/* Cells */
.analytics-table tbody td,
.coach-table tbody td,
.bench-table tbody td {
    padding: 9px 14px;
    border-top: 1px solid #242b36;
    color: #e5e9f0;
    white-space: nowrap;
}

/* Zebra striping */
.analytics-table tbody tr:nth-child(even),
.coach-table tbody tr:nth-child(even),
.bench-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Simple row hover (NO pseudo-element bar) */
.analytics-table tbody tr,
.coach-table tbody tr,
.bench-table tbody tr {
    transition: background 0.15s ease-out;
}

.analytics-table tbody tr:hover,
.coach-table tbody tr:hover,
.bench-table tbody tr:hover {
    background: #1f2733;
}

/* ========== PAR-TYPE TABLES (Par 3 / 4 / 5) ========== */

.par-type-table {
    width: 100%;
}

/* ========== ENGAGEMENT TABLES ========== */

.engagement-table {
    width: 100%;
}

/* ========= ENGAGEMENT TABLES ========= */

/* Default engagement tables: center numeric stuff */
.engagement-table th,
.engagement-table td {
    text-align: left;
    white-space: nowrap;
}

/* Players table: make everything left so headers + values line up */
.engagement-table.engagement-table-players th,
.engagement-table.engagement-table-players td {
    text-align: left;
}

/* ===========================
   HOME HERO PAGE STYLES
   =========================== */

.home-hero-container {
    text-align: center;
    padding: 20px 20px 40px 20px;
    /* ↓ pulls content upward */
    color: #fff;
    margin-top: -20px;
    /* optional: nudges entire block upward */
}

/* Logo size improved */
.home-hero-logo {
    width: 350px;
    /* increased from ~150 */
    height: auto;
    margin-bottom: 15px;
}

/* Welcome line */
.home-hero-welcome {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: #e5e5e5;
}

/* Headline — FORCE single line on desktop */
.home-hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    white-space: nowrap;
    /* ❤️ This keeps it on one line */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Subheading under title */
.home-hero-subtitle {
    font-size: 1.1rem;
    color: #bbbbbb;
    margin-bottom: 25px;
}

/* Body paragraph */
.home-hero-text {
    font-size: 1rem;
    color: #d0d0d0;
    max-width: 700px;
    margin: 0 auto 35px auto;
}

/* Button row */
.home-hero-buttons {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
    margin-bottom: 45px;
    /* Added more breathing room */
}

/* Left (Team Overview) button */
.hero-btn-primary {
    padding: 14px 28px;
    background-color: #23953c;
    color: #fff;
    border-radius: 40px;
    border: none;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Right (Player Snapshot) button — make clearer */
.hero-btn-secondary {
    padding: 14px 28px;
    background-color: transparent;
    color: #ddd;
    border: 2px solid #666;
    border-radius: 40px;
    font-size: 1.05rem;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hero-btn-secondary:hover {
    transform: translateY(-2px);
    border-color: #aaa;
    color: #fff;
}

/* Buttons placed directly under the welcome line */
.hero-buttons-top {
    margin-top: 20px;
    margin-bottom: 40px;
    /* space before headline */
}

/* Pipeline metadata — push downward visually */
.home-hero-updated {
    margin-top: 60px;
    /* much lower */
    font-size: 0.9rem;
    color: #bbbbbb;
}

/* Responsive tweak: allow wrapping on narrow screens */
@media (max-width: 900px) {
    .home-hero-title {
        white-space: normal;
        font-size: 2.3rem;
    }
}

/* Admin generic layout */
.admin-panel {
    padding: 1.5rem 2rem;
}

.admin-status {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #aaa;
}

.admin-status.error {
    color: #ff8888;
}

.admin-players-layout {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.admin-table-wrapper {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-table tbody tr {
    cursor: pointer;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.admin-table tbody tr.row-selected {
    background: rgba(35, 149, 60, 0.15);
}

.admin-players-form {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.25rem;
}

.form-row {
    margin-bottom: 0.75rem;
}

.form-row label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #111;
    color: #f5f5f5;
}

.form-row small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.15rem;
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.btn {
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #f5f5f5;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: #23953c;
    border-color: #23953c;
}

/* Left card layout with search */
.admin-players-list {
    display: flex;
    flex-direction: column;
}

.admin-players-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.admin-player-search {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #111;
    color: #f5f5f5;
}

/* Make the players list scroll within the card */
.admin-table-wrapper {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
    max-height: 60vh;
    /* adjust as desired */
}

.admin-archive-footer {
    margin-top: 1rem;
    text-align: right;
    /* visually “under” the right-hand card */
}

.team-roster-container {
    margin-top: 1rem;
}

.roster-team-block {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: #1c1c1c;
    border-radius: 8px;
}

.roster-team-header {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: #fff;
}

.roster-count {
    color: #ccc;
    font-size: 0.9rem;
}

.roster-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.roster-player {
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
}

.roster-player:hover {
    background: #2e2e2e;
}

.form-row-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}

.form-row-inline>label {
    min-width: 110px;
}

.form-inline-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-inline-group input {
    width: 5rem;
}

.benchmark-par-row {
    display: grid;
    grid-template-columns: 120px 120px 120px 120px 120px 120px;
    /* label, input, label, input, label, input */
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.benchmark-par-row label {
    font-weight: 500;
    text-align: right;
}

.benchmark-par-row input {
    width: 100%;
}

.admin-config-view .view-title {
    margin-bottom: 16px;
}

.config-textarea {
    width: 100%;
    resize: vertical;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #111;
    color: #f5f5f5;
    font-family: inherit;
    font-size: 14px;
}

.config-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.config-status {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.8;
}

.config-status.success {
    color: #4caf50;
}

.config-status.error {
    color: #ff5252;
}

.admin-config-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 16px;
}

.admin-config-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-config-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.config-row-actions {
    display: flex;
    gap: 4px;
}

.btn.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
}

.config-team-label.locked {
    opacity: 0.85;
}

.config-chip {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    background: #222;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-config-form .form-input {
    width: 100%;
}

.admin-table tr.selected {
    background-color: rgba(35, 149, 60, 0.25);
}

.config-status {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.85;
}

.config-status.success {
    color: #4caf50;
}

.config-status.error {
    color: #ff5252;
}

/* Global dark-theme inputs */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
    background-color: #111;
    /* match app background */
    color: #f5f5f5;
    /* light text */
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #23953c;
    /* DGS green on focus */
    box-shadow: 0 0 0 1px #23953c55;
}

input::placeholder,
textarea::placeholder {
    color: #777;
}

.skillLevels-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.skillLevels-controls {
    min-width: 200px;
}

.skillLevels-add-row {
    margin-top: 16px;
    border-top: 1px solid #222;
    padding-top: 12px;
}

.skillLevels-add-grid {
    display: grid;
    grid-template-columns: 1.4fr 1.1fr auto;
    gap: 8px;
    align-items: flex-end;
}

.skillLevels-add-actions {
    display: flex;
    justify-content: flex-end;
}

.skillLevels-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.admin-skill-tags-view input.form-input {
    background-color: #111;
    color: #f5f5f5;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 8px;
}

.admin-skill-tags-view input.form-input:focus {
    outline: none;
    border-color: #23953c;
    box-shadow: 0 0 0 1px #23953c55;
}

.admin-skill-tags-view input.form-input::placeholder {
    color: #777;
}

/* Dark inputs for Skill Builders views */
.admin-skillBuilders-view input.form-input,
.admin-skillBuilders-view textarea.form-input,
.admin-skillBuilder-edit input.form-input,
.admin-skillBuilder-edit textarea.form-input {
    background-color: #111;
    color: #f5f5f5;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 14px;
}

.admin-skillBuilders-view input.form-input:focus,
.admin-skillBuilders-view textarea.form-input:focus,
.admin-skillBuilder-edit input.form-input:focus,
.admin-skillBuilder-edit textarea.form-input:focus {
    outline: none;
    border-color: #23953c;
    /* DGS green */
    box-shadow: 0 0 0 1px #23953c55;
}

.admin-skillBuilders-view input.form-input::placeholder,
.admin-skillBuilder-edit input.form-input::placeholder {
    color: #777;
}

/* Dark inputs for Admin Config view */
.admin-config-view input.form-input {
    background-color: #111;
    color: #f5f5f5;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 14px;
}

.admin-config-view input.form-input:focus {
    outline: none;
    border-color: #23953c;
    box-shadow: 0 0 0 1px #23953c55;
}

.admin-config-view input.form-input::placeholder {
    color: #777;
}

/* Fix Chromium date input + calendar icon on dark background */
.admin-config-view {
    color-scheme: dark;
}

.admin-config-view input.form-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.75;
    cursor: pointer;
}

.admin-config-view input.form-input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.pd-semester-view .form-input {
    background-color: #111;
    color: #f5f5f5;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 8px;
}

.pd-semester-view .form-input:focus {
    outline: none;
    border-color: #23953c;
    box-shadow: 0 0 0 1px #23953c55;
}

.pd-semester-view .form-input::placeholder {
    color: #777;
}

.sb-basic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.sb-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.sb-active-row {
    margin-top: 8px;
    margin-bottom: 16px;
}

.sb-notes-wrapper {
    width: 100%;
}

.sb-notes-input {
    width: 100%;
    max-width: 100%;
    min-height: 240px;
    resize: vertical;
    line-height: 1.4;
}

/* Admin Players – Header Alignment Only */
#admin-players-table thead th {
    text-align: left;
    padding-left: 12px;
    /* Keep your original style */
}

/* Subtle micro-adjustments */
#admin-players-table thead th:nth-child(1) {
    padding-left: 14px;
}

/* Name */
#admin-players-table thead th:nth-child(2) {
    padding-left: 10px;
}

/* Email */
#admin-players-table thead th:nth-child(3) {
    padding-left: 12px;
}

/* Team */
#admin-players-table thead th:nth-child(4) {
    padding-left: 12px;
}

/* Status */
#admin-players-table thead th:nth-child(5) {
    padding-left: 12px;
}

/* Benchmark */
#admin-players-table thead th:nth-child(6) {
    padding-left: 10px;
}

/* Admin → Config → Coach Teams — Header Alignment Only */
.admin-table thead th {
    text-align: left;
    padding-left: 12px;
    /* matches data cells */
}

/* Micro-adjustments per column */
.admin-table thead th:nth-child(1) {
    padding-left: 10px;
    /* "#" column */
}

.admin-table thead th:nth-child(2) {
    padding-left: 14px;
    /* "Team Label" – text is slightly wider, needs a nudge */
}

.admin-table thead th:nth-child(3) {
    padding-left: 10px;
    /* "Actions" – typically centered-left */
}

/* Admin — Coaches: align checkboxes under "Superadmin" header */
#admin-coaches-table td.superadmin-cell {
    padding-left: 20px;
    /* adjust this value until checkbox visually aligns */
}

/* Reduce default td padding ONLY for checkbox cell */
#admin-coaches-table td.superadmin-cell input[type="checkbox"] {
    margin-left: 4px;
    /* optional slight inner nudge */
}

/* Keep table layout exactly the same – only shift the checkbox */
#admin-coaches-table td.superadmin-cell {
    text-align: center;
    /* ensures perfect column alignment */
    padding-left: 12px;
    /* adjust 10–16px until centered visually */
}

#admin-coaches-table td.superadmin-cell .superadmin-check {
    pointer-events: none;
    transform: scale(1.2);
    /* same size as other admin UI checkboxes */
}

/* Constrain the RIGHT PANEL on the Benchmarks page */
#admin-benchmarks-form-panel {
    flex: 0 0 480px !important;
    /* fixed width */
    max-width: 480px !important;
    padding-left: 1.5rem;
    /* spacing from table */
}

/* Let the left table use the rest of the space */
#admin-benchmarks-list-panel {
    flex: 1 1 auto !important;
    min-width: 0;
}

/* Ensure the two columns behave properly */
#admin-benchmarks-container,
.admin-benchmarks-container,
.admin-two-col {
    display: flex;
    align-items: flex-start;
}

/* Team Overview: player distribution layout */
.player-dist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.player-dist-column h4 {
    margin-bottom: 4px;
}

.snapshot-list {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
}

.snapshot-list li {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* light divider inside cards */
.snapshot-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 12px 0;
}

/* ============================================================
   CANONICAL CHART LAYOUT (GLOBAL)
   Prevents overflow, distortion, and growth with data
   ============================================================ */

/* --- Row layout (2-up charts) --- */
.par-type-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch;
}

/* Stack on smaller screens */
@media (max-width: 900px) {
    .par-type-charts-row {
        grid-template-columns: 1fr;
    }
}

/* --- Chart card (hard size container) --- */
.par-type-chart-card {
    height: 420px;
    /* 🔒 Single source of truth */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;

    /* visual styling (adjust if needed) */
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.03),
            rgba(255, 255, 255, 0.01));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* Wide chart = same rules, more horizontal space */
.par-type-chart-wide {
    grid-column: 1 / -1;
}

/* --- Header stays fixed height --- */
.par-type-chart-card .chart-header {
    flex: 0 0 auto;
    margin-bottom: 8px;
}

/* Titles */
.par-type-chart-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0;
}

/* Optional subtitles */
.chart-subtitle,
.chart-header .bench-id {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: 4px;
}

/* --- Canvas container MUST shrink --- */
.par-type-chart-card .chart-canvas {
    flex: 1 1 auto;
    min-height: 0;
    /* 🔥 critical for flexbox */
    position: relative;
}

/* --- Force canvas to respect the box --- */
.par-type-chart-card canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* --- Info panels inside headers (optional) --- */
.ta-info-panel,
.engagement-info-panel {
    margin-top: 6px;
    font-size: 0.75rem;
    line-height: 1.4;
    opacity: 0.85;
}

.ta-info-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 160ms ease, opacity 160ms ease;
}

.ta-info-panel.ta-info-open {
    max-height: 140px;
    /* adjust as needed */
    opacity: 0.85;
}

/* --- Legends under charts (non-intrusive) --- */
.ta-outlier-legend {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* Hero row */
.team-overview-hero-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 16px 0 24px 0;
}

.hero-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 16px 18px;
}

.hero-card h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
    margin-bottom: 6px;
}

.hero-card .hero-headline {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.hero-card .hero-number {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.hero-card .hero-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 6px;
}

.hero-card.hero-focus {
    border: 1px solid rgba(34, 197, 94, 0.35);
}

/* Player momentum grid */
.player-dist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.player-dist-column h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.snapshot-list {
    list-style: none;
    margin: 0 0 10px 0;
    padding: 0;
}

.snapshot-list li {
    font-size: 0.85rem;
    line-height: 1.4;
}

.momentum-up {
    border-left: 3px solid #22c55e;
    padding-left: 6px;
}

.momentum-down {
    border-left: 3px solid #f97373;
    padding-left: 6px;
}

.momentum-top {
    border-left: 3px solid #38bdf8;
    padding-left: 6px;
}

.momentum-bottom {
    border-left: 3px solid #f97316;
    padding-left: 6px;
}

/* Par-type badges */
.par-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.par-badge {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.par-badge-good {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.55);
}

.par-badge-bad {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.55);
}

.par-badge-neutral {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.55);
}

/* ===========================================
   PLAYER SNAPSHOT — LAYOUT + REFINEMENTS
   (uses existing bench-grid / bench-card)
   =========================================== */

.player-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 10px 0;
}

.player-toolbar label {
    color: #bbb;
    font-size: 0.95rem;
}

.player-toolbar select {
    max-width: 420px;
}

.snapshot-meta {
    margin: 0 0 14px 0;
    color: #9aa3b2;
    font-size: 0.85rem;
}

.snapshot-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 12px;
}

@media (max-width: 1100px) {
    .snapshot-grid-3 {
        grid-template-columns: 1fr;
    }
}

.snapshot-card {
    background: #111318;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #252a33;
}

.snapshot-card h2 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.snapshot-headline {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.snapshot-text {
    margin: 0 0 10px 0;
    color: #d7dde8;
    line-height: 1.45;
}

.snapshot-subtext {
    margin: 0;
    color: #9aa3b2;
    font-size: 0.88rem;
    line-height: 1.4;
}

.snapshot-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px 0;
}

.snapshot-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.03);
    color: #cbd2e0;
    white-space: nowrap;
}

.snapshot-metric-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.snapshot-metric-row:first-of-type {
    border-top: none;
    padding-top: 0;
}

.snapshot-metric-label {
    color: #aab3c2;
    font-size: 0.88rem;
}

.snapshot-metric-value {
    font-weight: 700;
    color: #e7ecf5;
    text-align: right;
}

.snapshot-wide {
    grid-column: 1 / -1;
}

.snapshot-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 900px) {
    .snapshot-split {
        grid-template-columns: 1fr;
    }
}

.snapshot-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
}

.snapshot-panel h3 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.snapshot-debug {
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
}

.snapshot-debug summary {
    cursor: pointer;
    color: #cbd2e0;
    font-weight: 600;
}

.snapshot-debug pre {
    margin: 10px 0 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #0b0f14;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd2e0;
    font-size: 12px;
    overflow: auto;
}

/* Force Player Snapshot layout to stay grid/cards even with legacy CSS present */
#player-snapshot-layout .player-snapshot-wrap .snapshot-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 12px;
}

@media (max-width: 1100px) {
    #player-snapshot-layout .player-snapshot-wrap .snapshot-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Ensure snapshot cards always look like cards */
#player-snapshot-layout .player-snapshot-wrap .snapshot-card {
    background: #111318;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #252a33;
    position: relative;
    overflow: hidden;
}

/* Accent line */
#player-snapshot-layout .player-snapshot-wrap .snapshot-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 2px;
    width: 100%;
    opacity: 0.55;
    background: linear-gradient(90deg, rgba(35, 149, 60, 0.9), rgba(225, 75, 75, 0.65));
}

/* Horizontal Par pills */
#player-snapshot-layout .player-snapshot-wrap .par-pill-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

@media (max-width: 900px) {
    #player-snapshot-layout .player-snapshot-wrap .par-pill-row {
        grid-template-columns: 1fr;
    }
}

/* Kill legacy vertical spacing on pills */
#player-snapshot-layout .player-snapshot-wrap .par-pill {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
}

/* ===========================================
   PLAYER SNAPSHOT — PAR-TYPE CHIPS (NEW)
   Does NOT modify Team Overview .par-pill*
   =========================================== */

.par-chip-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* pill look like your other page */
.par-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.03);
    font-weight: 700;
    line-height: 1;
}

.par-chip-label {
    font-weight: 600;
    opacity: 0.85;
}

.par-chip-value {
    font-weight: 800;
}

/* use the SAME scheme you already use elsewhere */
.par-chip-better {
    background-color: rgba(35, 149, 60, 0.15);
    color: var(--dgs-green);
    border-color: rgba(35, 149, 60, 0.40);
}

.par-chip-worse {
    background-color: rgba(225, 75, 75, 0.18);
    color: var(--dgs-red);
    border-color: rgba(225, 75, 75, 0.45);
}

.par-chip-neutral {
    background-color: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.12);
}

/* ===========================================
   PLAYER SNAPSHOT — PAR PILL "CHIP" OVERRIDES
   Scoped so Team Overview is untouched
   =========================================== */

/* Scope EVERYTHING to the snapshot render zone */
#player-snapshot-layout .par-pill-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* Turn the existing par-pill into the small “chip” look */
#player-snapshot-layout .par-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    width: auto;
    /* key: stops the big wide blocks */
    margin: 0;
    /* kill any inherited vertical spacing */
    padding: 8px 12px;
    /* chip padding */
    border-radius: 999px;
    /* chip shape */
    border-left: 0;
    /* remove the thick left bar for chips */
}

/* Slightly smaller typography inside chips */
#player-snapshot-layout .par-pill-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

#player-snapshot-layout .par-pill-value {
    font-size: 0.95rem;
    font-weight: 800;
}

/* ===========================================
   PLAYER SNAPSHOT — PAR-TYPE CHIPS (COMPACT)
   Drop-in: place AFTER existing .par-pill-row / .par-pill rules
   =========================================== */

/* Row: use flex so chips hug content (no full-width columns) */
.par-pill-row {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start !important;
    margin-top: 10px;
}

/* Chip shape (override “full width card” behavior) */
.par-pill {
    width: auto !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start !important;
    /* stop pushing value to the far edge */
    gap: 10px;
    padding: 8px 12px !important;
    border-radius: 999px !important;
    margin: 0 !important;
    border-left: none !important;
    /* chips don’t need the left bar */
    box-sizing: border-box;
    line-height: 1;
}

/* Tighten label/value so they read like a chip */
.par-pill-label {
    font-size: 0.85rem !important;
    opacity: 0.95;
}

.par-pill-value {
    font-size: 0.9rem !important;
    font-weight: 800 !important;
}

/* Chip colors — match your existing scheme (green/red/neutral) */
.par-pill.par-pill-better {
    background: rgba(35, 149, 60, 0.18) !important;
    border: 1px solid rgba(35, 149, 60, 0.55) !important;
    color: var(--dgs-green) !important;
}

.par-pill.par-pill-worse {
    background: rgba(225, 75, 75, 0.20) !important;
    border: 1px solid rgba(225, 75, 75, 0.55) !important;
    color: var(--dgs-red) !important;
}

.par-pill.par-pill-neutral {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    color: #e5e7eb !important;
}

/* ------------------------------
   PLAYER SNAPSHOT — PAR TYPE ROW
   Scoped: only affects Par-Type Profile card
   ------------------------------ */

.par-type-profile-card .par-type-profile-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.par-type-profile-card .par-type-profile-pills {
    flex: 0 0 auto;
}

.par-type-profile-card .par-type-profile-body {
    flex: 1 1 auto;
    min-width: 0;
    /* prevents overflow pushing layout */
}

.par-type-profile-card .par-pill-row {
    display: flex;
    /* keep pills in a row */
    gap: 10px;
    flex-wrap: nowrap;
    /* prevents weird spreading */
    align-items: center;
}

/* Make the pills look like compact chips (without touching global par-pill styles elsewhere) */
.par-type-profile-card .par-pill {
    width: auto;
    /* override any “full width” behavior */
    padding: 8px 12px;
    border-radius: 999px;
    flex: 0 0 auto;
}

/* On smaller screens, stack pills above text */
@media (max-width: 900px) {
    .par-type-profile-card .par-type-profile-row {
        flex-direction: column;
    }

    .par-type-profile-card .par-pill-row {
        flex-wrap: wrap;
    }
}

.par-type-profile-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 6px;
}

.par-type-profile-left {
    flex: 0 0 auto;
}

.par-type-profile-right {
    flex: 1 1 auto;
    min-width: 0;
}

.par-pill-row--compact {
    display: flex;
    gap: 10px;
    margin-top: 0;
}

.par-pill-row--compact .par-pill {
    width: auto;
    /* stop stretching */
    padding: 10px 12px;
    border-radius: 999px;
    /* chip-like */
}

@media (max-width: 900px) {
    .par-type-profile-row {
        flex-direction: column;
    }

    .par-pill-row--compact {
        flex-wrap: wrap;
    }
}

.par-pill-row {
    margin-right: 50px;
}

/* ============================
   Fixed sidebar with scrollable menu + pinned footer
   ============================ */

.app-shell {
    /* Make sure the shell isn't forcing weird overflow behavior */
    position: relative;
}

/* Sidebar pinned to viewport */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    /* match your intended sidebar width */
    z-index: 1000;

    display: flex;
    flex-direction: column;

    overflow: hidden;
    /* IMPORTANT: only .sidebar-main scrolls */
}

/* Top section stays visible */
.sidebar-top {
    flex: 0 0 auto;
}

/* ✅ This is the scroll container */
.sidebar-main {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;

    min-height: 0;
    /* CRITICAL: enables scrolling inside flex */
}

/* Footer stays pinned at bottom */
.nav-footer {
    flex: 0 0 auto;
}

/* Push main content to the right of the fixed sidebar */
.main-content,
#main-content {
    margin-left: 260px;
    /* MUST match .sidebar width */
}

/* Optional: keep main content from hiding under fixed sidebar on small screens */
@media (max-width: 900px) {
    .sidebar {
        width: 240px;
    }

    .main-content,
    #main-content {
        margin-left: 240px;
    }
}

/* ----------------------------------------
   Admin Benchmarks – Par-Type Rows (STACKED)
   ---------------------------------------- */

.benchmark-par-row {
    display: block;
    /* kill any flex behavior */
}

.benchmark-par-row label {
    display: block;
    margin-top: 0.6rem;
    margin-bottom: 0.15rem;
    font-size: 0.85rem;
}

.benchmark-par-row input {
    width: 100%;
}

/* =========================================================
   Admin Cards — Canonical DGS Style (Admin-only)
   ========================================================= */

.admin-panel .admin-card {
    position: relative;
    background: rgba(17, 22, 29, 0.72);
    border-radius: 16px;
    border: 1px solid rgba(35, 149, 60, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    padding: 1.25rem;
    overflow: hidden;
}

.admin-panel .admin-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
            #23953c,
            rgba(35, 149, 60, 0.35));
}

/* Admin Players: allow wide table to scroll without getting clipped by card */
.admin-panel .admin-players-list.admin-card {
    overflow: visible;
    /* override the default hidden */
    padding: 1.25rem;
    /* keep padding */
}

/* Make the table wrapper handle its own scrolling */
.admin-panel .admin-players-list.admin-card .admin-table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
}

/* Right form: keep card clipping off so form never “disappears” */
.admin-panel .admin-players-form.admin-card {
    overflow: visible;
}

/* Prevent width/padding math from causing tiny overflow */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.admin-panel .admin-card {
    max-width: 100%;
}

/* Players page: make the left card a flex column so the table area can scroll */
.admin-panel .admin-players-list.admin-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* keep accent + border clean */
}

/* Let toolbar take natural height */
.admin-panel .admin-players-list.admin-card .admin-players-toolbar {
    flex: 0 0 auto;
}

/* Table wrapper becomes the scroll container */
.admin-panel .admin-players-list.admin-card .admin-table-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    /* critical for flex scroll */
    overflow-y: auto;
    overflow-x: auto;
}

/* Players layout: left flexible, right fixed */
.admin-panel .admin-players-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 1.25rem;
    align-items: start;
}

/* Prevent grid children from forcing expansion */
.admin-panel .admin-players-layout>* {
    min-width: 0;
}

/* Canonical admin card */
.admin-card {
    position: relative;
    overflow: hidden;
    /* ⬅ THIS is the fix */
    border-radius: 16px;
}

.admin-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #23953c;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.admin-panel .admin-players-form.admin-card {
    align-self: start;
}

/* Canonical admin card w/ accent that can NEVER overhang */
.admin-card {
    position: relative;
    border-radius: 16px;
    border: 1px solid rgba(35, 149, 60, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    /* still good */

    /* 2-layer background: accent bar + card fill */
    background:
        linear-gradient(#23953c, #23953c) top / 100% 4px no-repeat,
        rgba(17, 22, 29, 0.72);
}

.admin-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.admin-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    /* do not use width: calc(...) */
    height: 4px;
    background: #23953c;
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

/* =========================================================
   Admin cards — forced canonical border + accent (hard override)
   Put this at the VERY BOTTOM of your CSS file.
   ========================================================= */
.admin-card {
    position: relative !important;
    border-radius: 16px !important;
    overflow: hidden !important;

    border: 1px solid rgba(35, 149, 60, 0.45) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22) !important;

    background:
        linear-gradient(#23953c, #23953c) top / 100% 4px no-repeat,
        rgba(17, 22, 29, 0.72) !important;
}

/* If any older ::before accent exists somewhere, this kills it inside admin cards */
.admin-card::before {
    content: none !important;
}

/* Admin cards: apply canonical outline + accent to BOTH admin-card and bench-card admin-config-card */
.admin-card,
.bench-card.admin-config-card {
    position: relative !important;
    border-radius: 16px !important;
    overflow: hidden !important;

    border: 1px solid rgba(35, 149, 60, 0.45) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22) !important;

    background:
        linear-gradient(#23953c, #23953c) top / 100% 4px no-repeat,
        rgba(17, 22, 29, 0.72) !important;
}

/* Kill any old accent pseudo-element inside these admin cards */
.admin-card::before,
.bench-card.admin-config-card::before {
    content: none !important;
}

/* Skill Levels: header row alignment */
.admin-skill-levels-view .skillLevels-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-skill-levels-view .skillLevels-header>div:first-child {
    flex: 1 1 520px;
    /* title/description column */
    min-width: 320px;
}

.admin-skill-levels-view .skillLevels-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
    /* keep it pinned right */
}

.admin-skill-levels-view .skillLevels-controls .form-label {
    margin: 0;
    white-space: nowrap;
}

.admin-skill-levels-view .skillLevels-controls .form-input {
    width: 220px;
    /* consistent dropdown width */
}

/* Skill Levels: header row alignment */
.admin-skill-levels-view .skillLevels-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-skill-levels-view .skillLevels-header>div:first-child {
    flex: 1 1 520px;
    /* title/description column */
    min-width: 320px;
}

.admin-skill-levels-view .skillLevels-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
    /* keep it pinned right */
}

.admin-skill-levels-view .skillLevels-controls .form-label {
    margin: 0;
    white-space: nowrap;
}

.admin-skill-levels-view .skillLevels-controls .form-input {
    width: 220px;
    /* consistent dropdown width */
}

/* Skill Levels: make header controls clean + compact (vertical) */
.admin-skill-levels-view .skillLevels-controls {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 6px !important;
    margin-left: auto !important;
}

.admin-skill-levels-view .skillLevels-controls .form-label {
    margin: 0 !important;
    font-size: 12px !important;
    opacity: 0.85 !important;
}

.admin-skill-levels-view .skillLevels-controls .form-input {
    width: 220px !important;
    max-width: 100% !important;
}

/* Skill Levels header: keep controls inside the header area (not hugging the top edge) */
.admin-skill-levels-view .skillLevels-header {
    align-items: flex-start !important;
    gap: 16px !important;
}

/* Right-side Category block */
.admin-skill-levels-view .skillLevels-controls {
    margin-left: auto !important;
    padding-top: 10px !important;
    /* <-- this is the "pull it down" fix */
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 6px !important;
}

/* Label spacing so it doesn't float in space */
.admin-skill-levels-view .skillLevels-controls .form-label {
    margin: 0 !important;
    line-height: 1 !important;
    opacity: 0.85 !important;
}

/* Keep the dropdown compact and consistent */
.admin-skill-levels-view #skillLevels-category-select.form-input {
    width: 240px !important;
    max-width: 100% !important;
}

.admin-skill-levels-view .admin-card {
    padding-top: 18px;
    /* ← breathing room below green bar */
}

/* Uncap the Skill Levels page width (page-scoped) */
.admin-skill-levels-view,
.admin-skill-levels-view .admin-skill-levels-layout,
.admin-skill-levels-view .admin-card {
    max-width: none !important;
    width: 100%;
}

.admin-skill-levels-view .skillLevels-card-inner {
    padding: 16px 20px 18px 20px;
    /* left/right inset = 20px */
}

.admin-skill-tags-view .skillTags-card-inner {
    padding: 16px 20px 18px 20px;
}