/* ============================================================
   Microframe Sports – Global Styles
   ============================================================ */

:root {
    --mfs-primary:    #1e3065;   /* deep brand blue (structural: nav, headers, cards) */
    --mfs-primary-dk: #0d1d47;   /* very dark brand blue */
    --mfs-secondary:  #2952a3;   /* medium brand blue */
    --mfs-accent:     #2f5dff;   /* marketing CTA blue – action color, tabs, highlights */
    --mfs-accent-dk:  #0f2ccf;   /* darker CTA blue for hover states */
    --mfs-bg:         #f1f0ef;   /* warm neutral – matches marketing site light sections */
    --mfs-card-bg:    #ffffff;
    --mfs-text:       #151414;   /* near-black matching marketing site */
    --mfs-muted:      #767574;   /* warm mid-gray matching marketing site */
}

/* ── Base ─────────────────────────────────────────────────── */
html {
    overflow-x: clip;
}

body {
    font-family: 'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--mfs-bg);
    color: var(--mfs-text);
    padding-top: 56px;
    min-height: 100vh;
}

/* Bump up container horizontal padding so content never hugs viewport edges */
.container-fluid.px-3 {
    padding-left: 1.75rem !important;
    padding-right: 1.75rem !important;
}
.container-fluid.pt-3 {
    padding-top: 1.5rem !important;
}

/* ── Links ────────────────────────────────────────────────── */
a {
    color: var(--mfs-accent);
    text-decoration: none;
}
a:hover {
    color: var(--mfs-accent-dk);
    text-decoration: none;
}

/* ── Inputs ────────────────────────────────────────────────── */
input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    max-width: 100%;
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar-mfs {
    background: linear-gradient(90deg, var(--mfs-primary-dk) 0%, var(--mfs-primary) 100%) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.30);
}

.navbar-mfs .navbar-brand img {
    height: 38px;
    width: auto;
}

.navbar-mfs .nav-link,
.navbar-mfs .navbar-brand {
    color: rgba(255,255,255,.9) !important;
    font-weight: 600;
    font-size: .92rem;
    letter-spacing: .02em;
}

.navbar-mfs .nav-link:hover,
.navbar-mfs .nav-link:focus {
    color: #fff !important;
}

.navbar-mfs .dropdown-menu {
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    border-radius: 6px;
    min-width: 180px;
    margin-top: 4px;
}

.navbar-mfs .dropdown-item {
    font-size: .9rem;
    padding: .55rem 1.1rem;
    color: var(--mfs-text);
}

.navbar-mfs .dropdown-item:hover {
    background-color: #eaefff;
    color: var(--mfs-primary);
}

.navbar-mfs .navbar-toggler {
    border-color: rgba(255,255,255,.4);
}

.navbar-mfs .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ── Navbar inline page title ── */
.navbar-page-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 340px;
    overflow: hidden;
    margin: 0 1rem;
}
/* NOTE: Projects pages intentionally use no PageHeader — titles live in the view */

.navbar-page-title h3,
.navbar-page-title h4,
.navbar-page-title span {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Keep .page-header-band as alias for any views not yet migrated */
.page-header-band {
    background: linear-gradient(135deg, var(--mfs-primary-dk) 0%, var(--mfs-primary) 60%, var(--mfs-secondary) 100%);
    color: white;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 0;
}
.page-header-band h3, .page-header-band h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.15rem;
    color: white;
}

/* Action button inside page-header-band */
.btn-header-action {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
    color: white !important;
    border-radius: 6px;
    padding: .35rem .9rem;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.btn-header-action:hover {
    background: rgba(255,255,255,.28);
    color: white !important;
}
/* Same shape/padding but visible on light (card) backgrounds */
.settings-card .btn-header-action,
.map-card .btn-header-action {
    background: var(--mfs-accent);
    border-color: var(--mfs-accent);
    color: white !important;
}
.settings-card .btn-header-action:hover,
.map-card .btn-header-action:hover {
    background: var(--mfs-accent-dk);
    border-color: var(--mfs-accent-dk);
    color: white !important;
}

/* ── mfs-tabs: shared across all tabbed pages ─────────────── */

/* Outer wrapper separates scrollable tabs from actions (dropdown stays outside overflow) */
.mfs-tabs-outer {
    display: flex;
    align-items: stretch;
    background: white;
    border-bottom: 2px solid #e0dfdf;
    margin: 0;
}
.mfs-tabs-outer .mfs-tabs {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}
.mfs-tabs-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 0 .4rem .5rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.mfs-tabs {
    display: flex;
    align-items: center;
    background: white;
    border-bottom: 2px solid #e0dfdf;
    margin: 0;
    padding: 0 1.75rem;
}
.mfs-tab {
    padding: .85rem 1.4rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--mfs-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.mfs-tab:hover { color: var(--mfs-text); text-decoration: none; }
.mfs-tab.active {
    color: var(--mfs-text);
    border-bottom-color: var(--mfs-accent);
}

/* ── Match / College / Media cards ───────────────────────── */
.match-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    overflow: hidden;
    transition: box-shadow .2s, transform .15s;
    border: none;
    height: 100%;
}
.match-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.13);
    transform: translateY(-2px);
}
.match-card.live {
    border-left: 4px solid #ff4444;
    background: linear-gradient(135deg, #fff 70%, #fff5f5 100%);
    box-shadow: 0 2px 12px rgba(255,68,68,.18);
}
.match-card.live .match-card-header {
    background: #cc2200;
}
.match-card.archived {
    border-left: 4px solid #6c757d;
}
.match-card.archived .match-card-header {
    background: #495057;
}
.match-card-header {
    background: var(--mfs-primary);
    color: white;
    padding: .9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.match-card-title {
    font-weight: 700;
    font-size: .92rem;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.match-card-meta {
    padding: .85rem 1.25rem;
    font-size: .85rem;
    color: var(--mfs-muted);
    border-top: 1px solid #e0dfdf;
}
.match-card-body {
    display: flex;
    align-items: stretch;
    padding: 1.75rem 1.5rem;
    gap: 1rem;
}
.match-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    text-align: center;
}
.match-logo-wrap {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.match-logo {
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
}
.match-score {
    font-size: 2rem;
    font-weight: 800;
    color: var(--mfs-text);
    line-height: 1;
}
.match-name {
    font-size: .78rem;
    font-weight: 600;
    color: white;
    background: var(--mfs-primary);
    padding: 3px 10px;
    border-radius: 20px;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.match-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    color: var(--mfs-muted);
    padding: 0 .25rem;
    padding-top: 20px;
}

/* Live badge */
.live-badge {
    font-size: .72rem;
    font-weight: 700;
    color: #ff4444;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Archived badge */
.badge-archived {
    display: inline-block;
    background: #e0dfdf;
    color: #767574;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

/* Delete button inside card header */
.btn-card-delete {
    background: none;
    border: none;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    font-size: .85rem;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.btn-card-delete:hover {
    color: #ff4444;
    background: rgba(255,255,255,.1);
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--mfs-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: .35; display: block; }
.empty-state h5 { font-weight: 700; color: var(--mfs-text); margin-bottom: .5rem; }

/* ── Match result cards ───────────────────────────────────── */
.match-result-card {
    background: var(--mfs-card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    border-left: 4px solid var(--mfs-accent);
}
.match-result-header {
    background: var(--mfs-primary);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    text-align: center;
    padding: .7rem 1.1rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.match-result-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1.1rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
    font-size: .875rem;
}
.match-result-row:last-child { border-bottom: none; }
.match-result-row.winner {
    background: rgba(47,93,255,.08);
    border-left: 3px solid var(--mfs-accent);
}
.match-result-row.winner .player-name {
    color: var(--mfs-primary);
    font-weight: 700;
}
.match-result-row.winner .player-name::after {
    content: " ✓";
    font-size: .75rem;
    font-weight: 800;
    color: var(--mfs-accent);
}
.match-result-row.winner .set-score {
    background: var(--mfs-accent);
    color: #fff;
}
.match-result-row.winner .team-label {
    color: var(--mfs-primary);
}
.match-result-row .team-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--mfs-muted);
    min-width: 44px;
}
.match-result-row .player-name {
    flex: 1;
    color: var(--mfs-text);
}
.match-result-row .set-score {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: .9rem;
    color: var(--mfs-accent);
    background: rgba(47,93,255,.07);
    border-radius: 4px;
    padding: .1rem .3rem;
}
/* Winning team in score banner */
.match-team.match-winner .match-score {
    color: var(--mfs-accent);
}
.match-team.match-winner .match-name {
    background: var(--mfs-accent);
}
.match-team.match-loser .match-score {
    color: var(--mfs-muted);
    opacity: .7;
}
.match-team.match-loser .match-name {
    background: #a8a6a5;
}

/* ── Settings / form cards ─────────────────────────────────── */
.settings-card {
    background: var(--mfs-card-bg);
    border-radius: 10px;
    border-left: 4px solid var(--mfs-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    padding: 1.75rem;
    margin-bottom: 1.75rem;
}
.settings-card h5 {
    font-weight: 700;
    color: var(--mfs-primary);
    margin-bottom: 1.25rem;
}
.form-label-sm {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--mfs-muted);
    margin-bottom: .4rem;
    display: block;
}
.text-line {
    background-color: transparent;
    border-bottom: 2px solid #a8a6a5;
    border-left: none;
    border-right: none;
    border-top: none;
    color: var(--mfs-text);
    outline: none;
    width: 100%;
    padding: .3rem .1rem;
    font-size: 1rem;
    transition: border-color .2s;
}
.text-line:focus {
    border-bottom-color: var(--mfs-accent);
}

/* Editable title in page header */
.page-title-input {
    background: transparent;
    border: none;
    border-bottom: 2px dashed rgba(255,255,255,.4);
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    outline: none;
    padding: 0 2px;
    max-width: 60vw;
}
.page-title-input:focus {
    border-bottom-color: var(--mfs-accent);
}

/* ── Cards ────────────────────────────────────────────────── */
.mfs-card {
    background: var(--mfs-card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: none;
    transition: box-shadow .2s;
}
.mfs-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.13);
}
.mfs-card-header {
    background-color: var(--mfs-primary);
    color: white;
    padding: .9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
}
.mfs-card-header a {
    color: white !important;
    font-weight: 600;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-mfs {
    background-color: var(--mfs-accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: .02em;
}
.btn-mfs:hover {
    background-color: var(--mfs-accent-dk);
    color: white;
}

.btn-mfs-outline {
    border: 2px solid var(--mfs-accent);
    color: var(--mfs-accent);
    background: transparent;
    border-radius: 6px;
    font-weight: 600;
}
.btn-mfs-outline:hover {
    background-color: var(--mfs-accent);
    color: white;
}

/* ── Tag pill ─────────────────────────────────────────────── */
.tag-pill {
    background: rgba(47,93,255,.12);
    color: var(--mfs-accent);
    font-size: .75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    line-height: 1.6;
    display: inline-block;
}

/* ── Status indicators ────────────────────────────────────── */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-dot.online  { background: #28a745; }
.status-dot.offline { background: #dc3545; }
.status-dot.unknown { background: #a8a6a5; }

/* ── Score grid ───────────────────────────────────────────── */
.score-table {
    width: 100%;
    border-collapse: collapse;
}
.score-table th {
    background-color: var(--mfs-primary);
    color: white;
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    padding: 5px 4px;
    letter-spacing: .04em;
}
.score-table td {
    border: 1px solid #e0dfdf;
    text-align: center;
    padding: 0;
    background: white;
}
.score-table td.name-cell {
    text-align: left;
    padding-left: 10px;
    font-weight: 500;
}
.score-table td.game-cell {
    background-color: #eaefff;
}

/* ── Ticker tape ─────────────────────────────────────────── */
@keyframes ticker {
    0%   { transform: translate3d(0,0,0); visibility: visible; }
    100% { transform: translate3d(-100%,0,0); }
}
.ticker-wrap {
    overflow: hidden;
    background: var(--mfs-primary-dk);
    padding-left: 100%;
    box-sizing: content-box;
}
.ticker-wrap .ticker {
    display: inline-block;
    height: 52px;
    line-height: 52px;
    white-space: nowrap;
    padding-right: 100%;
    box-sizing: content-box;
    animation: ticker 40s linear infinite;
}
.ticker-wrap .ticker__live  { display: inline-block; padding: 0 8px; color: #f66; font-weight: 700; font-size: 1.1rem; }
.ticker-wrap .ticker__title { display: inline-block; padding: 0 8px; color: var(--mfs-accent); font-size: 1.1rem; font-weight: 600; }
.ticker-wrap .ticker__item  { display: inline-block; padding: 0 14px; color: white; font-size: 1rem; border-left: 3px solid var(--mfs-accent); margin: 0 8px; }

/* ── Map card ────────────────────────────────────────────── */
.map-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    overflow: hidden;
}
.map-card iframe {
    width: 100%;
    height: 480px;
    border: none;
    display: block;
}

/* ── Login page ─────────────────────────────────────────── */
.login-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

.login-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    padding: 0;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.login-card .login-logo {
    background: linear-gradient(135deg, var(--mfs-primary-dk) 0%, var(--mfs-primary) 60%, var(--mfs-secondary) 100%);
    text-align: center;
    padding: 2rem 2.25rem 1.75rem;
}

.login-card .login-logo img {
    max-width: 100%;
    max-height: 52px;
    width: auto;
    height: auto;
}

.login-card .login-body {
    padding: 2rem 2.25rem 2rem;
}

.login-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--mfs-primary-dk);
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.login-card .form-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--mfs-text);
    margin-bottom: .3rem;
}

.login-card .form-control {
    border-radius: 7px;
    border: 1.5px solid #a8a6a5;
    padding: .7rem 1rem;
    font-size: .95rem;
    transition: border-color .15s;
}

.login-card .form-control:focus {
    border-color: var(--mfs-accent);
    box-shadow: 0 0 0 3px rgba(47,93,255,.15);
}

.login-card .btn-login {
    background: var(--mfs-accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: .65rem;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    margin-top: .5rem;
    transition: background .15s, transform .1s;
}
.login-card .btn-login:hover {
    background: var(--mfs-accent-dk);
    color: white;
    transform: translateY(-1px);
}

/* ── Buttons inside the tabs row ─────────────────────────── */
.mfs-tabs .btn-header-action,
.mfs-tabs-actions .btn-header-action {
    background: var(--mfs-accent);
    border-color: var(--mfs-accent);
    color: white !important;
}
.mfs-tabs .btn-header-action:hover,
.mfs-tabs-actions .btn-header-action:hover {
    background: var(--mfs-accent-dk);
    border-color: var(--mfs-accent-dk);
    color: white !important;
}
.mfs-tabs .dropdown-toggle.btn-header-action,
.mfs-tabs-actions .dropdown-toggle.btn-header-action {
    background: var(--mfs-accent);
    border-color: var(--mfs-accent);
    color: white !important;
}

/* ── Court detail page (TV view) ─────────────────────────── */
.court-detail-header {
    background: linear-gradient(135deg, var(--mfs-primary-dk), var(--mfs-primary));
    color: white;
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.court-name-display {
    font-size: clamp(1.8rem, 6vw, 3.5rem);
    font-weight: 800;
    color: var(--mfs-text);
    text-align: center;
    border: none;
    background: transparent;
    width: 100%;
    max-width: 100% !important;
    padding: .5rem;
    outline: none;
    letter-spacing: .02em;
}

.court-name-display:focus {
    background: rgba(47,93,255,.05);
    border-radius: 6px;
}

.score-cell-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 70px;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 700;
    background: white;
    border: 2px solid #e0dfdf;
    cursor: pointer;
    transition: background .1s, border-color .15s;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.score-cell-btn.selected {
    background: rgba(47,93,255,.07);
    border-color: var(--mfs-accent) !important;
    color: var(--mfs-text);
    box-shadow: inset 0 0 0 2px var(--mfs-accent);
}

.score-cell-btn.game-cell {
    background: #eaefff;
    border-color: #acbeff;
}

.player-name-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    font-weight: 600;
    padding: .5rem .75rem;
    max-width: 100% !important;
    outline: none;
}

.player-name-input:focus {
    background: #f5f7ff;
}

.score-up-btn, .score-down-btn {
    width: 90px;
    height: 90px;
    font-size: 2rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .1s, background .1s;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    touch-action: manipulation;
}

.score-up-btn {
    background: var(--mfs-accent);
    color: white;
}
.score-up-btn:hover, .score-up-btn:active {
    background: var(--mfs-accent-dk);
    transform: scale(.97);
}
.score-down-btn {
    background: #a8a6a5;
    color: white;
}
.score-down-btn:hover, .score-down-btn:active {
    background: #767574;
    transform: scale(.97);
}

/* ── Status page ──────────────────────────────────────────── */
.display-card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    margin-bottom: 1rem;
    overflow: hidden;
}

.display-card-header {
    background: var(--mfs-primary);
    color: white;
    padding: .6rem 1rem;
    font-weight: 600;
    font-size: .95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.display-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid #e0dfdf;
    background: white;
}
.display-item:last-child { border-bottom: none; }

/* ── Blinking dot ─────────────────────────────────────────── */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}
.blinking { animation: blink 1.2s ease-in-out infinite; }

/* ── Utility ──────────────────────────────────────────────── */
.text-mfs { color: var(--mfs-accent); }
.bg-mfs   { background-color: var(--mfs-primary); }
.required:after { content: "*"; font-weight: bold; color: red; padding-left: 3px; }

/* ── CRM mobile nav bar ───────────────────────────────────── */
.crm-mobile-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: white;
    border-bottom: 2px solid #e0dfdf;
    border-radius: 8px 8px 0 0;
    margin-bottom: .75rem;
}
.crm-mobile-nav::-webkit-scrollbar { display: none; }

.crm-mobile-tab {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem .9rem;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    color: var(--mfs-muted);
    font-size: .82rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.crm-mobile-tab i { font-size: .85rem; opacity: .65; }
.crm-mobile-tab.active {
    color: var(--mfs-primary);
    border-bottom-color: var(--mfs-primary);
    background: rgba(0,105,128,.04);
}
.crm-mobile-tab.active i { opacity: 1; }
.crm-mobile-tab:hover { color: var(--mfs-text); text-decoration: none; }

/* ── CRM sidebar ──────────────────────────────────────────── */
.crm-nav-header {
    background: linear-gradient(135deg, var(--mfs-primary-dk) 0%, var(--mfs-secondary) 100%);
    padding: .55rem .85rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: white;
    text-transform: uppercase;
}

/* Override Bootstrap list-group active with brand blue */
.list-group-item.active,
.list-group-item.active:focus,
.list-group-item.active:hover {
    background-color: rgba(47,93,255,.1);
    border-color: transparent;
    color: var(--mfs-accent);
    font-weight: 600;
}
.list-group-item.active i {
    opacity: 1 !important;
    color: var(--mfs-accent);
}

/* CRM sponsor status badges */
.badge-crm-active     { background: #d4edda; color: #1a6b32; font-weight: 600; }
.badge-crm-prospect   { background: rgba(187,218,124,.28); color: #4a6a15; font-weight: 600; }
.badge-crm-lapsed     { background: #f8d7da; color: #842029; font-weight: 600; }
.badge-crm-cancelled  { background: #e2e3e5; color: #41464b; font-weight: 600; }

/* CRM table */
.table thead.crm-thead th {
    background: var(--mfs-primary);
    color: white;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    border: none;
}
.table tbody tr:hover { background: rgba(47,93,255,.04); }

/* ── Mobile & Responsive ──────────────────────────────────── */

/* Tabs: horizontal scroll on all screen sizes when needed */
.mfs-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
}
.mfs-tabs::-webkit-scrollbar { display: none; }


@media (max-width: 767px) {
    /* Tighten page-level horizontal padding */
    .container-fluid.px-3,
    .container-fluid.px-4 {
        padding-left: .85rem !important;
        padding-right: .85rem !important;
    }

    /* Navbar page title: smaller text so it doesn't crowd the toggler */
    .navbar-page-title h3,
    .navbar-page-title h4,
    .navbar-page-title span {
        font-size: .88rem;
    }

    /* CRM: stack layout on tablet/mobile, desktop sidebar hidden via d-lg-flex */
    .crm-page-layout {
        flex-direction: column;
        gap: 0 !important;
    }

    /* Courts tabs: distribute evenly so all 4 fit without scrolling */
    .mfs-tabs-outer .mfs-tabs { overflow: visible; }
    .mfs-tabs-outer .mfs-tab  { flex: 1; text-align: center; justify-content: center; padding: .65rem .35rem; font-size: .8rem; }

    /* Tables: horizontal scroll wrapper */
    .table-responsive,
    .table-responsive-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Settings cards: less padding */
    .settings-card { padding: 1.25rem; }

    /* Ticker: smaller text */
    .ticker-wrap { font-size: .78rem; }

    /* Match cards: tighten body padding */
    .match-card-body { padding: 1.1rem 1rem; }
    .match-logo-wrap { width: 48px; height: 48px; }
    .match-logo { max-width: 48px; max-height: 48px; }
    .match-score { font-size: 1.6rem; }
}

@media (max-width: 575px) {
    /* Even tighter on phones */
    .container-fluid.px-3,
    .container-fluid.px-4 {
        padding-left: .6rem !important;
        padding-right: .6rem !important;
    }

    /* Navbar logo: keep brand + toggler on one line */
    .navbar-mfs .navbar-brand img { height: 28px; max-width: 160px; }

    /* Locations hero */
    .loc-hero h1 { font-size: 1.65rem; }
    .loc-hero p  { font-size: .9rem; margin-bottom: 1.25rem; }

    /* Page header band */
    .page-header-band h3, .page-header-band h4 { font-size: .95rem; }

    /* mfs-tabs: tighter padding so all tabs fit without scrolling */
    .mfs-tab { padding: .6rem .65rem; font-size: .8rem; }

    /* Courts cards: all 5 columns visible — widths enforced via colgroup in the view */
    .score-tbl td.name-col { width: 40%; }
    .score-tbl td.score-col { width: 15%; }
}
