/* admin.scanraise.com /leagues - league/district management UI */

/* Center the page content. Same pattern as the other admin pages
   (admin-payouts.css, admin-auctions.css, donors.css). Without this
   rule the <main class="wrap"> element gets no max-width or padding
   and the H1 hugs the left edge of the viewport. */
.wrap { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }

h1 { margin: 0 0 8px; }
.sub { color: #64748b; margin: 0 0 28px; }

.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.card h2 { margin: 0 0 6px; font-size: 1.3rem; }
.card p.muted { margin: 0 0 14px; color: #64748b; }
.card .row { display: flex; gap: 14px; margin: 12px 0; align-items: flex-start; flex-wrap: wrap; }
.card .row > div { flex: 1; min-width: 220px; }
.card .row > div.grow { flex: 2; }
.card label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; color: #334155; }
.card input[type="text"], .card input[type="number"], .card input[type="url"], .card textarea, .card select {
    width: 100%; box-sizing: border-box;
    border: 1px solid #cbd5e1; border-radius: 6px;
    padding: 8px 10px; font-size: 0.95rem;
    font-family: inherit;
    background: #fff; color: #0f172a;
}
.card select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat; background-position: right 10px center;
    padding-right: 32px;
    cursor: pointer;
}
.card input:focus, .card select:focus { outline: 2px solid #2563eb; outline-offset: 0; border-color: #2563eb; }
.card .req { color: #dc2626; }
.btn { padding: 9px 18px; border-radius: 6px; border: 1px solid transparent; font-weight: 600; cursor: pointer; font-size: 0.95rem; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #fff; color: #334155; border-color: #cbd5e1; }
.btn-secondary:hover { background: #f1f5f9; }
.btn-danger { background: #fff; color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.muted { color: #64748b; font-size: 0.9rem; }
.loading { padding: 32px; text-align: center; color: #64748b; }
.hidden { display: none !important; }

/* Leagues list */
.league-row {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: #fff;
}
.league-row.public { border-color: #bfdbfe; }
.league-row.competitive { border-color: #fde68a; box-shadow: 0 0 0 1px #fde68a; }
.league-row-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.league-row-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}
.league-row-meta {
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-left: 10px;
}
.league-row-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.league-row-actions a { text-decoration: none; }
.league-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.league-pill.public { background: #dbeafe; color: #1e40af; }
.league-pill.private { background: #f1f5f9; color: #475569; }
.league-pill.competitive { background: #fef3c7; color: #92400e; }

.league-tagline-row {
    color: #475569;
    font-size: 0.92rem;
    margin-top: 6px;
}
.league-stats-row {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 8px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.league-stats-row strong { color: #0f172a; }

/* Member orgs table */
.league-orgs {
    margin-top: 14px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 14px;
}
.league-orgs h4 {
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin: 0 0 8px;
}
.league-orgs ul { list-style: none; padding: 0; margin: 0; }
.league-orgs li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}
.league-orgs li:last-child { border-bottom: none; }
.league-orgs-name { font-weight: 600; color: #0f172a; }
.league-orgs-goal { color: #64748b; font-size: 0.85rem; }
.league-orgs-actions { display: flex; gap: 6px; }

/* Modals (reuse the same pattern as edit-class modal) */
.modal { position: fixed; inset: 0; z-index: 1000; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.55); }
.modal-card {
    position: relative;
    max-width: 520px;
    margin: 8vh auto;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(15,23,42,0.25);
}
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0 4px;
}
.modal-close:hover { color: #0f172a; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; color: #334155; }
.field.checkbox label { font-weight: 400; }
.field.checkbox input[type="checkbox"] { margin-right: 6px; }
.field input, .field select { width: 100%; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 6px; padding: 8px 10px; font-size: 0.95rem; background: #fff; color: #0f172a; font-family: inherit; }
.field select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat; background-position: right 10px center;
    padding-right: 32px;
    cursor: pointer;
}
.field input:focus, .field select:focus { outline: 2px solid #2563eb; outline-offset: 0; border-color: #2563eb; }
.field .hint { color: #64748b; font-size: 0.82rem; margin-top: 4px; }
.input-readonly { background: #f8fafc; }
.actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}
.error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 10px 12px;
    color: #991b1b;
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.error.hidden { display: none; }
