/* =========================================================================
   NDBSA Community & Club Knockouts — Executive Stylesheet (Zero Emojis)
   ========================================================================= */
.ko-view-tabs {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    gap: 4px;
    margin-bottom: 22px;
}
.ko-view-tab {
    border: none;
    background: transparent;
    color: #475569;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 9px 18px;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.16s ease;
}
.ko-view-tab.active {
    background: #0c3b2e;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(12, 59, 46, 0.22);
}
.ko-tab-count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #d4af37;
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 800;
}

.ko-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.ko-filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ko-filter-pill {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}
.ko-filter-pill.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.ko-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s ease, background 0.15s ease;
}
.ko-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ko-btn-primary { background: #16a34a; color: #ffffff; }
.ko-btn-primary:hover { background: #15803d; }
.ko-btn-dark { background: #0f172a; color: #ffffff; }
.ko-btn-dark:hover { background: #1e293b; }
.ko-btn-gold { background: #d4af37; color: #0f172a; }
.ko-btn-gold:hover { background: #c49f28; }
.ko-btn-outline { background: #ffffff; color: #334155; border-color: #cbd5e1; }
.ko-btn-outline:hover { background: #f8fafc; }
.ko-btn-ghost { background: rgba(255,255,255,0.12); color: #ffffff; border-color: rgba(255,255,255,0.25); }
.ko-btn-ghost:hover { background: rgba(255,255,255,0.2); }
.ko-btn-danger { background: #b91c1c; color: #ffffff; }
.ko-btn-danger:hover { background: #991b1b; }
.ko-btn-sm { padding: 6px 12px; font-size: 0.78rem; }

.ko-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.ko-pill-slate { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.ko-pill-green { background: #dcfce7; color: #166534; }
.ko-pill-amber { background: #fef3c7; color: #92400e; }
.ko-pill-gold  { background: #fef9c3; color: #854d0e; border: 1px solid #eab308; }
.ko-pill-dark  { background: #0f172a; color: #ffffff; }

.ko-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.ko-status-open   { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.ko-status-active { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.ko-status-done   { background: #e2e8f0; color: #334155; border: 1px solid #cbd5e1; }

.ko-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    gap: 18px;
}

.ko-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: 3px solid #0c3b2e;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ko-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.ko-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ko-code-tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
}
.ko-card-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}
.ko-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.84rem;
    color: #475569;
}
.ko-card-sub {
    font-size: 0.8rem;
    color: #64748b;
}
.ko-card-actions {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.ko-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 46px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
}
.ko-empty h4 { margin: 0 0 6px 0; color: #0f172a; font-size: 1.1rem; }
.ko-empty p  { margin: 0; font-size: 0.9rem; }

/* Detail Header & Money Ledger */
.ko-detail-header {
    background: linear-gradient(135deg, #071e16 0%, #0c3b2e 60%, #124b3a 100%);
    color: #ffffff;
    padding: 22px 24px;
    border-radius: 14px;
    border-bottom: 4px solid #d4af37;
    margin-bottom: 16px;
}
.ko-ledger-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    background: #fffdf7;
    border: 1px solid #ecd078;
    border-left: 4px solid #d4af37;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.ko-ledger-item span {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 2px;
}
.ko-ledger-item strong {
    font-size: 1.05rem;
    color: #0f172a;
}
.ko-ledger-payinfo {
    grid-column: 1 / -1;
    padding-top: 8px;
    border-top: 1px solid #f1e6b8;
    font-size: 0.84rem;
    color: #334155;
}

.ko-banner-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.ko-champ-banner, .ko-hb-banner {
    flex: 1 1 220px;
    padding: 14px 18px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ko-champ-banner {
    background: #0c3b2e;
    color: #ffffff;
    border: 1px solid #d4af37;
}
.ko-hb-banner {
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #334155;
}
.ko-banner-kicker {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fde68a;
    font-weight: 800;
}
.ko-champ-banner strong, .ko-hb-banner strong {
    font-size: 1.35rem;
}

/* Open Sign-Up Pool Grid */
.ko-pool-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}
.ko-pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}
.ko-pool-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 11px 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Live Bracket Tree */
.ko-bracket-notice {
    font-size: 0.84rem;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.ko-bracket-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
}
.ko-bracket-grid {
    display: flex;
    gap: 24px;
    min-width: max-content;
    align-items: stretch;
}
.ko-round-col {
    width: 248px;
    display: flex;
    flex-direction: column;
}
.ko-round-head {
    background: #0f172a;
    color: #ffffff;
    padding: 9px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    border-bottom: 2px solid #d4af37;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ko-round-head strong { font-size: 0.88rem; }
.ko-round-head span   { font-size: 0.72rem; color: #cbd5e1; }

.ko-round-matches {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 14px;
}
.ko-match-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #64748b;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.ko-match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
    border-color: #0c3b2e;
}
.ko-match-card.is-done { border-left-color: #d4af37; }
.ko-match-card.is-mine { border-left-color: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18); }

.ko-match-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    font-size: 0.84rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 8px;
}
.ko-match-row:last-child { border-bottom: none; }
.ko-match-row.is-winner { background: #f0fdf4; font-weight: 800; color: #0c3b2e; }
.ko-match-row.is-bye    { color: #94a3b8; font-style: italic; background: #f8fafc; }

.ko-match-player {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex: 1;
}
.ko-player-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ko-hcp-pill {
    font-size: 0.68rem;
    font-weight: 800;
    background: #e2e8f0;
    color: #334155;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ko-brk-tag {
    font-size: 0.66rem;
    font-weight: 800;
    background: #fef9c3;
    color: #854d0e;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ko-match-score {
    min-width: 28px;
    text-align: right;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

/* Modals */
.ko-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    z-index: 9995;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
.ko-modal-box {
    background: #ffffff;
    border-radius: 14px;
    max-width: 560px;
    width: 100%;
    padding: 24px;
    position: relative;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
    max-height: 92vh;
    overflow-y: auto;
}
.ko-modal-wide { max-width: 780px; }
.ko-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.55rem;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
}
.ko-field { margin-bottom: 12px; min-width: 0; }
.ko-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
}
.ko-field input, .ko-field select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    background: #ffffff;
    color: #0f172a;
}
.ko-field input[type="date"],
.ko-field input[type="datetime-local"] {
    -webkit-appearance: none;
    appearance: none;
    min-height: 43px;
    text-align: left;
}
.ko-mf-row input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px !important;
}
.ko-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 12px 0 16px 0;
}
.ko-contact-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 12px;
    font-size: 0.86rem;
    line-height: 1.5;
}
.ko-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.ko-table th {
    background: #0f172a;
    color: #ffffff;
    text-align: left;
    padding: 8px 9px;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ko-table td {
    padding: 8px 9px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}
