/* =====================================================================
   match.css: shared styles for every match page
   match.php, match3.php, matchAll.php, matchScore.php, matchEdit.php,
   matchEditStep.php, matchEditStep3.php, matchStep.php, matchStep3.php,
   matchAdd.php, matchSetup.php, matchLeague.php, matchClose.php,
   matchDelete.php, matchCopy.php

   Breakpoints:  PC >= 1200px | iPad 768-1199px | Phone <= 767px
   Colours follow the navbar theme through the --nav-* variables
   (script/navColor.js); the value after the comma is the fallback.

   Sections
     1. Legacy layout (.match-filter, .match-table: old-style tables)
     2. Shared components (mt-*): title + switch, card, toolbar, stats,
        table wrap, odds table, empty state, league tiles,
        progress modal, bill modal
     3. Page-specific rules
   ===================================================================== */


/* =====================================================================
   1. LEGACY LAYOUT (old-style tables, matchStep / matchStep3 filter bar)
   ===================================================================== */

/* Filter bar variants:
     .match-filter                     -> one line: label | input | Print (right)
     .match-filter.match-filter-stack  -> labels above inputs, wraps to 2 lines on phone */
.match-filter { display: flex; align-items: center; margin-bottom: 10px; }
/* Bootstrap .row clearfix pseudo-elements would become flex items */
.match-filter::before, .match-filter::after { display: none; }
.match-filter .control-label { padding-top: 0; margin-bottom: 0; white-space: nowrap; }
.match-print { text-align: right; }
.match-filter-stack { flex-wrap: wrap; align-items: flex-end; }
.match-filter-stack > [class*="col-"] { margin-bottom: 8px; }
.match-filter-stack label { margin-bottom: 3px; white-space: nowrap; }

.match-tabs { margin-top: 5px; }

.match-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 0; margin-bottom: 15px; }
.match-table { margin-bottom: 0; }
.match-table > thead > tr > th,
.match-table > tbody > tr > td { white-space: nowrap; vertical-align: middle; }
.match-table > thead > tr > th { text-align: center; }
.match-table .bg-dark { width: 4px; min-width: 4px; padding: 0 !important; }
/* status toggle icons (matchEditStep.php, matchEditStep3.php) */
.match-table .glyphicon.changeStatus { font-size: 20px; vertical-align: middle; }
.match-table .glyphicon-ban-circle.changeStatus { color: #000; }

@media (max-width: 1199px) {
    .match-table { font-size: 13px; }
    .match-table > thead > tr > th,
    .match-table > tbody > tr > td { padding: 5px; }
}

@media (max-width: 767px) {
    /* keep theme's top margin: it clears the navbar-fixed-top */
    .page-header { padding-bottom: 5px; }
    .page-header h2 { font-size: 22px; margin-bottom: 0; }
    .match-filter .control-label { text-align: left; }
    .match-filter > [class*="col-"] { padding-left: 5px; padding-right: 5px; }
    .match-print .btn { padding: 6px 10px; }
    .match-filter-stack .match-print .btn-group,
    .match-filter-stack .match-print .btn { width: 100%; }
    .match-tabs > li > a { padding: 8px 12px; }
    .match-table { font-size: 12px; }
    .match-table > thead > tr > th,
    .match-table > tbody > tr > td { padding: 3px 4px; }
    .match-table .glyphicon.changeStatus { font-size: 18px; }
    .match-table .label { font-size: 70%; padding: .15em .4em; }
    #detailModal .modal-dialog { margin: 10px; }
}


/* =====================================================================
   2. SHARED COMPONENTS
   ===================================================================== */

/* ---- page title + new/old design switch ----
   keep the h2's normal top/bottom spacing (theme uses it to clear the fixed navbar),
   but on the row, so the switch stays vertically centred on the title */
.mt-title { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 20px 0 10px; }
.mt-title h2 { margin: 0; }
.mt-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; margin: 0;
    font-weight: normal; font-size: 14px; color: #555; background: #f5f5f5; border: 1px solid #e3e3e3; border-radius: 18px; padding: 4px 12px 4px 5px; }
.mt-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.mt-switch-track { position: relative; width: 44px; height: 24px; border-radius: 12px; background: #bbb; transition: background .2s; flex: 0 0 auto; }
.mt-switch-track:after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .2s; }
.mt-switch input:checked + .mt-switch-track { background: #5cb85c; }
.mt-switch input:checked + .mt-switch-track:after { left: 23px; }
.mt-switch input:focus-visible + .mt-switch-track { outline: 2px solid #337ab7; outline-offset: 2px; }
.mt-switch-state { font-weight: bold; min-width: 26px; }
.mt-switch input:checked ~ .mt-switch-state { color: #3c763d; }
@media (max-width: 767px) {
    .mt-title { margin-bottom: 0; }
    .mt-title h2 { font-size: 22px; }
}

/* ---- card (toolbar box, form box, list box) ---- */
.mt-card { background: #fff; border: 1px solid #ddd; border-top: 3px solid var(--nav-line, #ddd); border-radius: 6px;
    padding: 15px 18px; margin-bottom: 16px; }
.mt-card-title { font-size: 18px; font-weight: bold; margin: 0 0 15px; }
/* card header row: title left, summary / tools right */
.mt-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.mt-list-head .mt-card-title { margin: 0; }
.mt-summary { font-size: 14px; color: #555; }
.mt-summary b { color: #3c763d; font-size: 16px; }
.mt-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mt-tools .input-group { width: 220px; }
.mt-tools .badge { margin-left: 3px; }

/* ---- toolbar: one line on desktop, wraps below 992px ---- */
.mt-toolbar { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 12px; }
.mt-field { flex: 0 0 auto; }
.mt-field label { display: block; font-size: 13px; color: #777; font-weight: normal; margin-bottom: 4px; white-space: nowrap; }
.mt-date .input-group { width: 230px; }
/* date box: themes add 6-10px top/bottom padding, which clips the bold date; centre it with line-height instead */
.mt-date #matchPicker { padding: 0 6px; line-height: 32px; min-width: 120px;
    text-align: center; font-weight: bold; font-size: 16px; background: #fff; cursor: pointer; }
.mt-weekday { color: #999; margin-left: 4px; }
.mt-league #ddlLeague { width: 220px; text-overflow: ellipsis; }
.mt-grow { flex: 1 1 auto; min-width: 120px; }
.mt-bill .input-group { width: 190px; }
.mt-btns { display: flex; gap: 8px; }
@media (max-width: 991px) {
    .mt-toolbar { flex-wrap: wrap; }
}

/* large toolbar (edit pages): 40px controls; wraps below 1400px.
   No vertical padding: with 16px text the theme padding overflows 40px and clips the
   dropdown text, so centre with line-height instead */
.mt-toolbar-lg .mt-field label { font-size: 14px; color: #666; margin-bottom: 5px; }
.mt-toolbar-lg .form-control, .mt-toolbar-lg .input-group-addon, .mt-toolbar-lg .btn { height: 40px; font-size: 16px; }
.mt-toolbar-lg .form-control, .mt-toolbar-lg .input-group-addon { padding-top: 0; padding-bottom: 0; line-height: 38px; }
.mt-toolbar-lg select.form-control { padding-left: 10px; padding-right: 24px; }
.mt-toolbar-lg .btn { padding: 0 14px; line-height: 38px; }
.mt-toolbar-lg.mt-toolbar .mt-date #matchPicker { line-height: 38px; font-size: 18px; }
.mt-toolbar-lg .mt-grow { min-width: 140px; }
@media (max-width: 1399px) {
    .mt-toolbar-lg { flex-wrap: wrap; }
}

@media (max-width: 767px) {
    .mt-field, .mt-date .input-group, .mt-bill .input-group, .mt-league #ddlLeague { width: 100%; }
}

/* ---- date row (setup / league pages: big date picker + button) ---- */
.mt-date-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mt-date-row .input-group { width: 230px; }
.mt-date-row #matchPicker { text-align: center; font-size: 18px; font-weight: bold; height: 40px; }
.mt-date-row .btn { height: 40px; }
.mt-date-row .mt-weekday { font-size: 16px; color: #777; min-width: 110px; margin-left: 0; }
.mt-hint { font-size: 12px; color: #999; }

/* ---- stat pills under the toolbar ---- */
.mt-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee; font-size: 13px; }
.mt-stat { border-radius: 12px; padding: 3px 12px; background: #f0f0f0; color: #555; }
.mt-stat b { font-size: 14px; }
.mt-stat.open, .mt-stat.ft { background: #dff0d8; color: #3c763d; }
.mt-stat.closed { background: #f2dede; color: #a94442; }
.mt-stat.live { background: #d9edf7; color: #31708f; }
.mt-stat.kicked { background: #fcf8e3; color: #8a6d3b; }

/* ---- announcements (match.php; newest first, red) ---- */
.mt-announce { background: #fff5f5; border: 1px solid #f5c6c6; border-left: 5px solid #d9534f; border-radius: 6px;
    padding: 10px 16px; margin-bottom: 18px; max-height: 140px; overflow-y: auto; }
.mt-announce.is-empty { display: none; }
.mt-ann-row { display: flex; gap: 10px; color: #c9302c; font-size: 17px; line-height: 1.5; padding: 2px 0; }
.mt-ann-row + .mt-ann-row { border-top: 1px dashed #f2d0d0; }
.mt-ann-time { flex: 0 0 auto; font-size: 13px; color: #a94442; background: #f9dede; border-radius: 10px; padding: 1px 8px; align-self: center; }

/* ---- tabs above a table wrap (matchAll.php) ---- */
.mt-tabs { margin-bottom: 0; border-bottom: 0; }
.mt-tabs > li > a { font-weight: bold; font-size: 15px; padding: 9px 18px; border-radius: 6px 6px 0 0; }
.mt-tabs > li.active > a, .mt-tabs > li.active > a:hover, .mt-tabs > li.active > a:focus { border-color: #ddd #ddd transparent; background: #fff; }
.mt-tabs .badge { margin-left: 4px; }

/* ---- scrolling table box with sticky header ---- */
.mt-wrap { overflow: auto; max-height: calc(100vh - 120px); border: 1px solid #ddd; border-radius: 6px; background: #fff; margin-bottom: 20px; }
.mt-tabs + .tab-content .mt-wrap { border-radius: 0 6px 6px 6px; }

/* ---- odds table (match.php, match3.php, matchAll.php) ---- */
.mt-table { margin: 0; border: 0; font-size: 13px; }
.mt-table th { position: sticky; z-index: 2; text-align: center; vertical-align: middle; white-space: nowrap; border-color: var(--nav-border, #2e6da4); font-size: 16px; }
.mt-table thead tr:first-child th { top: 0; }
.mt-table thead tr:nth-child(2) th { top: 33px; } /* JS sets the real height after render */
.mt-table th.g-info { background: var(--nav-bg, #337ab7); color: var(--nav-fg, #fff); }
.mt-table th.g-ft { background: var(--nav-bg-dark, #1f4e79); color: var(--nav-fg, #fff); }
.mt-table th.g-ht { background: var(--nav-bg-darker, #2a7f74); color: var(--nav-fg, #fff); }
.mt-table th.g-sub { font-weight: normal; font-size: 15px; }
.mt-table td { vertical-align: middle; white-space: nowrap; }
.mt-table td.c { text-align: center; }
.mt-table .b-ft { border-left: 3px solid #1f4e79 !important; }
.mt-table .b-ht { border-left: 3px solid #2a7f74 !important; }
.mt-table .b-ou { border-left: 2px solid #bbb !important; }
.mt-table tr.mt-lg td { background: var(--nav-tint, #e8f1fa); color: var(--nav-tint-fg, #1f4e79); font-weight: bold; text-align: center; padding: 6px 12px; font-size: 15px;
    border-top: 2px solid var(--nav-line, #337ab7); border-bottom: 2px solid var(--nav-line, #337ab7); }
.mt-table tr.mt-lg small { font-weight: normal; color: var(--nav-tint-muted, #6b8bb0); margin-left: 6px; }
.mt-table td.mt-time { font-size: 13px; color: #333; text-align: center; white-space: nowrap; }
.mt-table td.mt-score { text-align: center; font-weight: bold; }
.mt-table td.mt-ht { text-align: center; color: #888; background: #fafafa; }
.mt-table td.mt-hdc { font-weight: bold; }
.mt-table td.active { background: #eee; }
/* bet number (the number members bet with): big and bold */
.mt-table .mt-id { display: inline-block; min-width: 34px; padding: 0 5px; border-radius: 4px; background: #f0f3f7;
    color: #1f4e79; font-size: 15px; font-weight: bold; text-align: center; line-height: 1.5; }
.mt-table .text-danger .mt-id, .mt-table td.text-danger .mt-id { color: #c9302c; background: #fbeaea; }
.mt-table .text-blue .mt-id { color: #2a6db0; }

/* old-style odds table (switch off) */
.old-wrap { border-top: 1px solid #ddd; }
.old-table { margin: 0; }
.old-table thead th { font-size: 16px; }
.old-table .mt-id-old { font-size: 15px; font-weight: bold; }

/* .mt-fit (match.php): the table fits the window, no sideways scroll. Cells may wrap, but
   the browser only wraps them when the row would not fit otherwise (kick time: date above
   time; team names; bet number above price). Bet numbers and prices never break. */
.mt-fit > thead > tr > th { padding: 5px 4px; }
.mt-fit > tbody > tr > td { white-space: normal; padding: 4px 3px; }
.mt-fit .mt-id, .mt-fit .mt-id-old, .mt-fit .label { white-space: nowrap; }
.mt-table.mt-fit .mt-id { min-width: 0; padding: 0 3px; }
.mt-table.mt-fit td.mt-time { white-space: normal; }
.mt-fit td.mt-team { min-width: 90px; }

/* ---- empty state ---- */
.mt-empty { padding: 50px 0; text-align: center; color: #999; font-size: 15px; }

/* ---- league tiles (matchSetup.php, matchLeague.php) ---- */
.mt-item { position: relative; display: flex; align-items: flex-start; gap: 10px; border: 1px solid #ddd; border-left-width: 5px; border-radius: 6px;
    padding: 10px 12px; margin-bottom: 12px; background: #fff; cursor: pointer; user-select: none; transition: background .15s, border-color .15s; }
.mt-item:hover { border-color: #aaa; }
.mt-item.is-on { border-color: #5cb85c; background: #f1f9f1; }
.mt-item.is-busy { opacity: .5; pointer-events: none; }
.mt-item-body { flex: 1; min-width: 0; }
.mt-item-name { font-weight: bold; font-size: 14px; line-height: 1.3; }
.mt-item:not(.is-on) .mt-item-name { color: #888; }
.mt-item-api { font-size: 12px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-item-meta { margin-top: 6px; font-size: 12px; color: #666; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mt-kicks { background: var(--nav-tint, #eef3f8); color: var(--nav-tint-fg, #31708f); border-radius: 10px; padding: 1px 8px; font-weight: bold; }
/* order number: a real button-sized target (whole box opens the x-editable editor), 22px high */
a.mt-order, a.mt-order.editable-click { display: inline-block; box-sizing: border-box; height: 22px; line-height: 18px;
    min-width: 74px; padding: 1px 8px; border: 1px solid #bbb !important; border-radius: 3px; background: #fff; color: #333;
    font-size: 12px; text-decoration: none; cursor: pointer; text-align: center; vertical-align: middle; }
a.mt-order:hover, a.mt-order:focus { border-color: var(--nav-line, #337ab7) !important; background: var(--nav-tint, #eef3f8); color: var(--nav-tint-fg, #31708f); text-decoration: none; }
a.mt-order b { font-size: 12px; margin: 0 2px; }
a.mt-order .glyphicon { font-size: 10px; color: var(--nav-line, #337ab7); top: 1px; }

/* ---- progress modal (#waittingModal) ---- */
.progress-spin { animation: progressSpin 1s linear infinite; }
@keyframes progressSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
#waittingModal .modal-header { padding: 20px 25px; }
#waittingModal .modal-title { font-size: 26px; }
#waittingModal .modal-body { padding: 30px 25px; }
#waittingModal #progressMsg { font-size: 20px; margin-bottom: 20px !important; }
#waittingModal .progress { height: 32px; margin-bottom: 15px !important; }
#waittingModal .small { font-size: 16px; }

/* ---- bill modal (#detailModal) ---- */
#detailModal .modal-body { padding: 15px; }
.bl-bill { border: 1px solid var(--nav-line, #ddd); border-radius: 6px; margin-bottom: 14px; overflow: hidden; }
.bl-bill-head { background: var(--nav-tint, #f5f5f5); color: var(--nav-tint-fg, #333); padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; }
.bl-bill-head b { font-size: 14px; }
.bl-bill table { margin: 0; font-size: 13px; }
.bl-bill td, .bl-bill th { text-align: center; vertical-align: middle !important; }
.bl-bill td.bl-team { text-align: left; }
.bl-bill-foot { background: #fcf8e3; padding: 8px 12px; display: flex; justify-content: flex-end; gap: 24px; font-size: 14px; }
.bl-total { background: #dff0d8; border-radius: 6px; padding: 10px 14px; display: flex; justify-content: flex-end; gap: 24px; font-size: 16px; font-weight: bold; }


/* =====================================================================
   3. PAGE-SPECIFIC
   ===================================================================== */

/* ---------- matchScore.php ---------- */
.sc-announce { display: flex; gap: 12px; align-items: flex-start; background: #fcf8e3; border: 1px solid #faebcc;
    border-left: 5px solid #f0ad4e; border-radius: 6px; padding: 12px 16px; margin-bottom: 20px; color: #8a6d3b; }
.sc-announce > .glyphicon { font-size: 20px; margin-top: 2px; }
.sc-announce-body { flex: 1; min-width: 0; font-size: 16px; }
.sc-announce:empty, .sc-announce.is-empty { display: none; }
.sc-league { border: 1px solid var(--nav-line, #ddd); border-radius: 6px; margin-bottom: 16px; overflow: hidden; background: #fff; }
/* league name centred; kick count stays on the right (padding keeps a long name clear of it) */
.sc-league-head { position: relative; background: var(--nav-bg, #337ab7); color: var(--nav-fg, #fff); padding: 8px 70px; font-weight: bold;
    text-align: center; font-size: 15px; }
.sc-league-head small { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: normal; opacity: .85; }
.sc-row { display: grid; grid-template-columns: 90px 1fr 70px 90px 1fr; align-items: center; gap: 8px;
    padding: 8px 14px; border-top: 1px solid #eee; }
.sc-row:first-of-type { border-top: 0; }
.sc-time { font-size: 13px; color: #555; }
.sc-time .label { display: inline-block; margin-top: 3px; }
.sc-home { text-align: right; }
.sc-away { text-align: left; }
.sc-team-id { color: #999; font-size: 11px; }
.sc-fav { color: #d9534f; font-weight: bold; }
.sc-ht { text-align: center; color: #888; font-size: 13px; }
.sc-ht small { display: block; font-size: 10px; color: #bbb; line-height: 1; }
.sc-ft { text-align: center; }
.sc-ft span { display: inline-block; min-width: 64px; padding: 4px 8px; border-radius: 4px; background: #333; color: #fff;
    font-size: 17px; font-weight: bold; letter-spacing: 1px; }
.sc-ft span.is-none { background: #eee; color: #aaa; }
.sc-row.is-cancel { opacity: .55; }
@media (max-width: 767px) {
    .sc-row { grid-template-columns: 1fr 64px 1fr; grid-template-areas: "time time time" "home ft away" "ht ht ht"; gap: 4px 8px; }
    .sc-time { grid-area: time; }
    .sc-home { grid-area: home; }
    .sc-ft { grid-area: ft; }
    .sc-away { grid-area: away; }
    .sc-ht { grid-area: ht; }
    .sc-ht small { display: inline; margin-right: 4px; }
    .sc-ft span { min-width: 56px; font-size: 15px; }
}

/* ---------- matchEditStep.php, matchEditStep3.php ---------- */
.es-num select { width: 110px; }
@media (max-width: 767px) { .es-num select { width: 100%; } }
/* table, new style only (#detail.es-new); old style = theme defaults */
.es-wrap.es-new-wrap { overflow: auto; max-height: calc(100vh - 120px); border: 1px solid #ddd; border-radius: 6px; background: #fff; }
#detail.es-new { margin: 0; font-size: 14px; }
#detail.es-new thead th { position: sticky; z-index: 3; text-align: center; vertical-align: middle; white-space: nowrap;
    background: var(--nav-bg, #337ab7); color: var(--nav-fg, #fff); border-color: var(--nav-border, #2e6da4); font-weight: normal; }
#detail.es-new thead tr:first-child th { top: 0; }
#detail.es-new thead th.bg-dark, #detail.es-new tbody th.bg-dark { background: var(--nav-bg-darker, #2a7f74); width: 6px; padding: 0; }
#detail.es-new td { vertical-align: middle; white-space: nowrap; }
/* league header rows (rows without id) */
#detail.es-new tbody tr:not([id]) td { background: var(--nav-tint, #e8f1fa); color: var(--nav-tint-fg, #1f4e79); font-weight: bold; font-size: 16px;
    border-top: 2px solid var(--nav-line, #337ab7); border-bottom: 2px solid var(--nav-line, #337ab7); padding: 7px 0; text-align: center; }
/* league name centred in the VISIBLE part of the wide (29-column) table, and stays there when scrolling sideways */
#detail.es-new .es-lg-name { position: sticky; left: 0; display: block; width: var(--es-view-w, 100%); text-align: center; padding: 0 10px; box-sizing: border-box; }
/* kick rows: light backgrounds with dark text, so it stays readable on dark themes (white text) too;
   red/blue/green text classes keep their own colour */
#detail.es-new tbody tr[id] > td { background: #fff; }
#detail.es-new tbody tr[id] > td:not(.text-danger):not(.text-blue):not(.text-success):not(.text-primary) { color: #333; }
#detail.es-new tbody tr[id] > td.text-danger { color: #c9302c; }
#detail.es-new tbody tr[id] > td.text-blue { color: #2a6db0; }
#detail.es-new tbody tr[id] td[rowspan] { font-weight: bold; background: #f4f8fc; }
/* darker line between kicks (first row of each kick is tagged .es-kick-start after render).
   Drawn as an inset shadow, not a border: with border-collapse the 1px grey border of the row above
   wins over a 1px border-top here. 1px = thinner than the 2px league lines */
#detail.es-new tbody tr.es-kick-start > td, #detail.es-new tbody tr.es-kick-start > th { box-shadow: inset 0 1px 0 darkgray; }
#detail.es-new tbody tr:not([id]) + tr.es-kick-start > td, #detail.es-new tbody tr:not([id]) + tr.es-kick-start > th { box-shadow: none; }
/* kicked (started) kicks: soft yellow row, dark text */
#detail.es-new tbody tr.warning > td { background: #fcf8e3; }
#detail.es-new tbody tr.warning td[rowspan] { background: #f9eec6; color: #5c4a1e; }
/* editable values: look clickable */
#detail.es-new .ePrice, #detail.es-new .eHDC, #detail.es-new .eStatus:not(.btn) {
    display: inline-block; min-width: 38px; padding: 1px 6px; border: 1px dashed #9fb8d3; border-radius: 3px;
    background: #fff; color: inherit; cursor: pointer; text-decoration: none; font-weight: bold; }
#detail.es-new .ePrice:hover, #detail.es-new .eHDC:hover, #detail.es-new .eStatus:not(.btn):hover { border-style: solid; border-color: #337ab7; background: #eef5fc; }
#detail.es-new .editable-click { border-bottom-width: 1px; }
#detail.es-new .btn-xs { font-size: 13px; padding: 2px 8px; }
#detail.es-new .changeStatus { font-size: 18px; cursor: pointer; }

/* ---------- matchEdit.php ---------- */
.me-actions { display: flex; gap: 6px; }
.me-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #eee; }
.me-filter .btn { border-radius: 16px; padding: 5px 14px; font-size: 15px; }
.me-filter .badge { margin-left: 4px; font-size: 13px; }
@media (max-width: 767px) { .me-actions { flex-wrap: wrap; } }
#tblMatch.me-old { margin: 0; }
#tblMatch:not(.me-old) { margin: 0; border: 0; font-size: 15px; }
#tblMatch:not(.me-old) thead th { position: sticky; top: 0; z-index: 2; background: var(--nav-bg, #337ab7); color: var(--nav-fg, #fff); text-align: center; vertical-align: middle;
    white-space: nowrap; border-color: var(--nav-border, #2e6da4); font-weight: normal; font-size: 14px; }
#tblMatch:not(.me-old) td { vertical-align: middle; }
#tblMatch:not(.me-old) td.c { text-align: center; }
#tblMatch:not(.me-old) tr.me-lg td { background: var(--nav-tint, #e8f1fa); color: var(--nav-tint-fg, #1f4e79); border-top: 2px solid var(--nav-line, #337ab7); border-bottom: 2px solid var(--nav-line, #337ab7); padding: 6px 10px; }
/* 3 columns (equal outer columns) so the league name is centred on the whole row,
   not just between the left and right buttons (they have different widths) */
.me-lg-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.me-lg-name { text-align: center; font-weight: bold; font-size: 16px; }
.me-lg-name small { font-weight: normal; color: var(--nav-tint-muted, #6b8bb0); margin-left: 6px; }
.me-lg-tools { display: flex; align-items: center; gap: 6px; }
.me-lg-bar > .me-lg-tools:first-child { justify-self: start; }
.me-lg-bar > .me-lg-tools:last-child { justify-self: end; }
@media (max-width: 767px) {
    .me-lg-bar { grid-template-columns: 1fr; justify-items: center; }
    .me-lg-bar > .me-lg-tools:first-child, .me-lg-bar > .me-lg-tools:last-child { justify-self: center; }
}
/* order / price count: real button-size targets (x-editable) */
a.me-box, a.me-box.editable-click { display: inline-block; box-sizing: border-box; height: 26px; line-height: 22px; min-width: 80px;
    padding: 1px 10px; border: 1px solid #9fb8d3 !important; border-radius: 3px; background: #fff; color: #1f4e79; font-size: 14px;
    text-decoration: none; text-align: center; cursor: pointer; }
a.me-box:hover, a.me-box:focus { border-color: #337ab7 !important; background: #eef5fc; text-decoration: none; }
a.me-box b { margin: 0 2px; }
a.me-box .glyphicon { font-size: 11px; color: #337ab7; top: 1px; }
.me-lg-tools .btn { height: 26px; line-height: 22px; padding: 1px 10px; font-size: 14px; }
#tblMatch:not(.me-old) td.me-time { white-space: nowrap; text-align: center; }
#tblMatch:not(.me-old) td.me-time a { color: #337ab7; margin-right: 4px; }
.eKickTime { cursor: pointer; border-bottom: 1px dashed #999; }
#tblMatch:not(.me-old) td.me-home { text-align: right; }
/* wider team columns (header th 2 = home, th 5 = away) */
#tblMatch:not(.me-old) td.me-home, #tblMatch:not(.me-old) td.me-away,
#tblMatch:not(.me-old) thead th:nth-child(2), #tblMatch:not(.me-old) thead th:nth-child(5) { min-width: 220px; width: 20%; }
@media (max-width: 1399px) {
    #tblMatch:not(.me-old) td.me-home, #tblMatch:not(.me-old) td.me-away,
    #tblMatch:not(.me-old) thead th:nth-child(2), #tblMatch:not(.me-old) thead th:nth-child(5) { min-width: 160px; }
}
#tblMatch:not(.me-old) td.me-ht { text-align: center; background: #fafafa; color: #777; font-size: 16px; }
#tblMatch:not(.me-old) td.me-ft { text-align: center; font-weight: bold; font-size: 17px; }
#tblMatch:not(.me-old) td .btn-xs { min-width: 50px; font-size: 14px; padding: 2px 8px; }
#tblMatch:not(.me-old) td.paid .btn-xs { min-width: 96px; }
#tblMatch:not(.me-old) .delPrice { cursor: pointer; font-size: 17px; }
.me-type { font-size: 13px; border-radius: 10px; padding: 2px 10px; white-space: nowrap; }
.me-type.AUTO { background: #dff0d8; color: #3c763d; }
.me-type.FIX { background: #fcf8e3; color: #8a6d3b; }
.me-type.MANUAL { background: #d9edf7; color: #31708f; }
#tblMatch:not(.me-old) tr.is-hidden-kick td.me-home, #tblMatch:not(.me-old) tr.is-hidden-kick td.me-away { color: #aaa; text-decoration: line-through; }

/* ---------- matchAdd.php ---------- */
.ma-lbl { font-size: 13px; color: #666; font-weight: normal; margin-bottom: 4px; }
.mt-card .form-group { margin-bottom: 14px; }
/* select2 sized like Bootstrap 3 inputs */
.mt-card .select2-container .select2-selection--single { height: 34px; border-color: #ccc; }
.mt-card .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 32px; }
.mt-card .select2-container--default .select2-selection--single .select2-selection__arrow { height: 32px; }
.ma-teams { display: flex; align-items: stretch; gap: 12px; }
.ma-team { flex: 1; min-width: 0; border: 2px solid #e5e5e5; border-radius: 6px; padding: 10px 12px; transition: border-color .15s, background .15s; }
.ma-team.is-fav { border-color: #d9534f; background: #fdf3f3; }
.ma-team-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ma-team-side { font-weight: bold; color: #555; }
.ma-fav { cursor: pointer; font-size: 12px; border-radius: 12px; padding: 2px 10px; border: 1px solid #ccc; color: #888; background: #fff; user-select: none; }
.ma-fav input { display: none; }
.ma-team.is-fav .ma-fav { border-color: #d9534f; background: #d9534f; color: #fff; }
.ma-vs { align-self: center; font-weight: bold; color: #aaa; font-size: 16px; }
.ma-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.ma-actions .checkbox { margin: 0; }
#btnAdd { min-width: 180px; }
#matchInfo { margin-bottom: 0; }
/* list header follows the navbar colour (script/navColor.js) */
#matchInfo thead tr th { background: var(--nav-bg, #337ab7); color: var(--nav-fg, #fff); border-color: var(--nav-border, #2e6da4); }
#matchInfo td { vertical-align: middle; }
#matchInfo .ma-favname { color: #d9534f; font-weight: bold; }
#matchInfo .ma-favname:after { content: ' ต่อ'; font-size: 11px; font-weight: normal; }
.ma-del { color: #d9534f; cursor: pointer; font-size: 16px; }
.ma-save-bar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; }
#btnSave { min-width: 200px; font-size: 16px; }

/* ---------- matchSetup.php ---------- */
.ms-step { display: inline-block; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; text-align: center;
    background: var(--nav-bg, #337ab7); color: var(--nav-fg, #fff); font-weight: bold; margin-right: 8px; }
.ms-check { flex: 0 0 22px; height: 22px; border: 2px solid #ccc; border-radius: 4px; text-align: center; line-height: 18px;
    color: transparent; font-size: 12px; margin-top: 1px; }
.mt-item.is-on .ms-check { background: #5cb85c; border-color: #5cb85c; color: #fff; }
.ms-stale { display: none; }
/* sticky create bar */
.ms-bar { position: sticky; bottom: 0; z-index: 10; background: #fff; border-top: 3px solid #5cb85c;
    box-shadow: 0 -4px 14px rgba(0,0,0,.08); padding: 12px 20px; margin: 0 -15px 20px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ms-bar-info { font-size: 15px; }
.ms-bar-info .ms-bar-date { font-size: 20px; font-weight: bold; margin-right: 8px; }
.ms-bar #btnCreate { min-width: 200px; font-size: 17px; padding: 10px 20px; }

/* ---------- matchLeague.php ---------- */
.ml-switch { flex: 0 0 40px; height: 22px; border-radius: 11px; background: #ccc; position: relative; margin-top: 1px; transition: background .15s; }
.ml-switch:after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.mt-item.is-on .ml-switch { background: #5cb85c; }
.mt-item.is-on .ml-switch:after { left: 20px; }
.ml-reform { vertical-align: middle; }
.ml-reform .btn { box-sizing: border-box; height: 22px; line-height: 18px; padding: 1px 8px; font-size: 12px; }

/* ---------- matchClose.php, matchDelete.php (month list) ---------- */
.mc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.mc-toolbar .btn-group .btn { min-width: 110px; }
.mc-toolbar .badge { margin-left: 4px; }
.mc-search { max-width: 260px; }
.mc-month { margin-bottom: 15px; }
.mc-month .panel-heading { cursor: pointer; user-select: none; }
/* month headings + active filter follow the navbar colour; status colours stay green/red */
.mc-month.panel { border-color: var(--nav-line, #ddd); }
.mc-month > .panel-heading { background: var(--nav-tint, #f5f5f5); color: var(--nav-tint-fg, #333); border-color: var(--nav-line, #ddd); border-bottom-width: 2px; font-size: 15px; }
.mc-month > .panel-heading .text-muted { color: var(--nav-tint-muted, #777); }
.mc-month > .panel-heading .text-success { color: #3c763d; }
#mcFilter .btn.active, #mcFilter .btn.active:hover, #mcFilter .btn.active:focus {
    background: var(--nav-bg, #337ab7); color: var(--nav-fg, #fff); border-color: var(--nav-border, #2e6da4); }
#mcFilter .btn.active .badge { background: var(--nav-fg, #fff); color: var(--nav-bg, #337ab7); }
#mcFilter .btn.active .glyphicon { color: inherit; }
.mc-month .panel-heading .glyphicon-chevron-down { transition: transform .2s; }
.mc-month .panel-heading.collapsed .glyphicon-chevron-down { transform: rotate(-90deg); }
.mc-month .panel-body { padding-bottom: 0; }
.mc-month-count { font-size: 12px; font-weight: normal; }
.mc-card { border: 1px solid #ddd; border-left-width: 5px; border-radius: 4px; padding: 10px 12px; margin-bottom: 15px; background: #fff; }
.mc-card.is-open { border-left-color: #5cb85c; }
.mc-card.is-closed { border-left-color: #d9534f; background: #fafafa; }
.mc-card.is-closed.is-muted { border-left-color: #999; } /* matchDelete.php: closed days in grey */
.mc-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.mc-date { font-size: 18px; font-weight: bold; line-height: 1.2; }
.mc-day { font-size: 12px; color: #888; }
.mc-card .btn { margin-top: 10px; }
.mc-bills { margin-top: 8px; font-size: 13px; color: #555; }
.mc-bills.is-zero { color: #bbb; }
.mc-paid { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: bold; border-radius: 10px; padding: 2px 9px; }
.mc-paid.is-paid { color: #3c763d; background: #dff0d8; }
.mc-paid.is-unpaid { color: #a94442; background: #f2dede; }
.mc-paid.is-none { color: #999; background: #f0f0f0; font-weight: normal; }
/* delete confirm dialog (matchDelete.php) */
#delModal .modal-dialog { width: 400px; max-width: calc(100% - 32px); margin: 12vh auto 0; }
#delModal .modal-content { border: 0; border-top: 6px solid #d9534f; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
#delModal .modal-body { padding: 30px 30px 10px; text-align: center; }
#delModal .del-icon { width: 64px; height: 64px; line-height: 64px; margin: 0 auto 15px; border-radius: 50%;
    background: #fdecea; color: #d9534f; font-size: 28px; }
#delModal .del-title { font-size: 18px; color: #555; margin: 0 0 15px; }
#delModal .del-date { font-size: 28px; font-weight: bold; color: #333; line-height: 1.1; }
#delModal .del-day { font-size: 14px; color: #999; margin-bottom: 12px; }
#delModal .del-bills { display: inline-block; font-size: 15px; font-weight: bold; color: #d9534f;
    background: #fdecea; border-radius: 14px; padding: 4px 14px; margin-bottom: 16px; }
#delModal .del-bills.is-zero { color: #888; background: #f0f0f0; font-weight: normal; }
#delModal .del-note { font-size: 13px; color: #888; background: #f7f7f7; border-radius: 4px; padding: 10px 12px; margin: 0; }
#delModal .modal-footer { border-top: 0; padding: 15px 30px 25px; display: flex; gap: 10px; }
#delModal .modal-footer .btn { flex: 1; margin: 0; padding: 9px 0; font-size: 15px; }
