/* ── Hidden utility ── */
.hidden { display: none !important; }

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.page-title { margin: 0; }

/* ── Loading ── */
.loading-text { color: #666; padding: 16px 0; }

/* ── Status badges ── */
.match-status-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.match-status-badge.not-started { background: #FFF3E0; color: #E65100; }
.match-status-badge.in-progress { background: #E8F5E9; color: #2E7D32; }
.match-status-badge.completed   { background: #ECEFF1; color: #546E7A; }
.match-status-badge.abandoned   { background: #FFF8E1; color: #F57F17; }

/* ── Filter tabs ── */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.filter-tab {
    padding: 8px 18px;
    border-radius: 20px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
    color: #555;
}
.filter-tab:hover,
.filter-tab.active {
    background: var(--png-red);
    border-color: var(--png-red);
    color: white;
}

/* ── Search toolbar ── */
.matches-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.matches-toolbar input[type="text"] {
    flex: 1;
    min-width: 180px;
    padding: 9px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.2s;
}
.matches-toolbar input[type="text"]:focus {
    outline: none;
    border-color: var(--cricket-blue);
}
.matches-count { font-size: 0.88em; color: #888; white-space: nowrap; }

/* ── Matches table ── */
.matches-table { width: 100%; border-collapse: collapse; font-size: 0.97em; }
.matches-table thead tr { background: var(--cricket-blue); color: white; }
.matches-table thead th {
    padding: 11px 14px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.82em;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.matches-table tbody tr { border-bottom: 1px solid #eee; transition: background 0.15s; cursor: pointer; }
.matches-table tbody tr:hover { background: #f5f9ff; }
.matches-table tbody td { padding: 13px 14px; vertical-align: middle; }

.match-teams-cell  { font-weight: 700; color: var(--png-red); font-size: 1.02em; }
.match-vs          { color: #aaa; font-weight: 400; font-size: 0.85em; margin: 0 4px; }
.match-result-cell { font-size: 0.88em; color: #444; }
.match-result-cell.winner { color: #2E7D32; font-weight: 700; }
.match-result-cell.tied   { color: var(--cricket-blue); font-weight: 700; }
.match-date-cell   { color: #666; font-size: 0.9em; white-space: nowrap; }
.result-dash       { color: #ccc; }
.result-margin     { font-weight: 400; color: #555; }

.competition-cell  { font-size: 0.88em; color: #555; }
.competition-link  {
    color: var(--cricket-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88em;
}
.competition-link:hover { text-decoration: underline; }
.no-competition    { color: #bbb; font-style: italic; }

/* ── Row action buttons — self-contained, no dependency on layout.css .btn ── */
.row-actions { display: flex; gap: 7px; align-items: center; }
/* btn-sm styles moved to layout.css */

/* ── Page-level buttons (New Match etc) — self-contained ── */
.btn-comp {
    display: inline-block;
    padding: 10px 18px;
    font-size: 0.9em;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    text-align: center;
    white-space: nowrap;
}
.btn-comp.btn-secondary { background: #616161; color: white; }
.btn-comp.btn-secondary:hover { background: #424242; }

/* ── Competition filter row ── */
.comp-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.comp-filter-row label { font-weight: 700; font-size: 0.88em; color: #555; white-space: nowrap; }
.comp-filter-select {
    padding: 8px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.92em;
    font-family: inherit;
    color: #333;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 220px;
}
.comp-filter-select:focus { outline: none; border-color: var(--cricket-blue); }

/* ── Empty / no-results states ── */
.no-results-row td { text-align: center; padding: 36px; color: #999; font-style: italic; }
.empty-state-wrap  { text-align: center; padding: 55px 10px; }
.empty-state-icon  { font-size: 4em; margin-bottom: 18px; }
.empty-state-title { margin: 0 0 10px 0; color: var(--cricket-blue); font-size: 1.6em; }
.empty-state-text  { margin: 0 auto 12px auto; max-width: 520px; color: #666; line-height: 1.6; }
.empty-state-note  { margin: 0 auto 22px auto; max-width: 520px; color: #666; line-height: 1.6; }

/* ── Archived row ── */
.match-archived-row  { opacity: 0.70; }
.match-row--upcoming { cursor: default; }
.match-row--upcoming:hover td { background: inherit; }

/* ── Assign Competition Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-card {
    background: white;
    border-radius: 14px;
    padding: 28px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.modal-title   { margin: 0 0 18px 0; color: var(--png-red); font-size: 1.3em; }
.modal-select  {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 18px;
    font-family: inherit;
}
.modal-actions { display: flex; gap: 10px; }
.modal-btn {
    flex: 1;
    padding: 11px;
    border-radius: 8px;
    border: none;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.modal-btn-cancel  { background: #f5f5f5; color: #555; }
.modal-btn-confirm { background: var(--cricket-green, #2E7D32); color: white; }
.modal-btn-cancel:hover  { background: #e8e8e8; }
.modal-btn-confirm:hover { background: #1B5E20; }

/* ── Table scroll ── */
.matches-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Scorer cell (shown in BY_SCORER tab) ── */
.match-scorer-cell { font-size: 0.88em; white-space: nowrap; }
.scorer-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1a56db;
    border-radius: 12px;
    padding: 3px 10px;
    font-weight: 600;
    font-size: 0.9em;
}
.scorer-unassigned { color: #bbb; font-style: italic; }

/* ── Scorer filter row ── */
.scorer-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: #f0f4ff;
    border-radius: 10px;
    border: 1.5px solid #c7d7f5;
}
.scorer-filter-row label {
    font-weight: 700;
    font-size: 0.88em;
    color: #555;
    white-space: nowrap;
}

/* ── Scorer tab styling ── */
.filter-tab--admin {
    border-style: dashed;
}
.filter-tab--admin.active {
    border-style: solid;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .comp-filter-select { min-width: unset; width: 100%; }
    .matches-toolbar    { gap: 8px; }
}
@media (max-width: 600px) {
    .matches-table thead th:nth-child(3),
    .matches-table tbody td:nth-child(3) { display: none; }
}

/* ── Pagination bar ── */
/* pagination styles moved to layout.css */

/* ── Search/filter/page loading overlay — dims table without hiding it ── */
.matches-loading-overlay {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.15s;
}
