/* ============================================================
   DART LEAGUE MANAGER — app.css
   Theme: Industrial / Sports-bar — dark steel with red accents
   ============================================================ */

:root {
    --bg:          #0f1117;
    --bg2:         #181c26;
    --bg3:         #1f2435;
    --card:        #1a1e2e;
    --card-border: #2a2f45;
    --red:         #e8372a;
    --red-dark:    #b82a1f;
    --red-glow:    rgba(232,55,42,0.18);
    --gold:        #f5c842;
    --gold-dim:    #b8922a;
    --green:       #2eb87a;
    --text:        #e8ecf4;
    --text-muted:  #7a8099;
    --text-dim:    #4a5068;
    --border:      #2a2f45;
    --radius:      8px;
    --radius-lg:   14px;
    --shadow:      0 4px 24px rgba(0,0,0,0.5);
    --font-head:   'Bebas Neue', sans-serif;
    --font-cond:   'Barlow Condensed', sans-serif;
    --font-body:   'Barlow', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navbar ── */
.navbar {
    background: var(--bg2);
    border-bottom: 2px solid var(--red);
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 58px;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-icon { font-size: 1.5rem; }

.brand-text {
    font-family: var(--font-head);
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: var(--text);
    white-space: nowrap;
}

.navbar-links {
    display: flex;
    gap: 4px;
    flex: 1;
}

.navbar-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-cond);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: var(--radius);
    transition: all 0.18s;
}

.navbar-links a:hover { color: var(--text); background: var(--bg3); }
.navbar-links a.active { color: var(--red); background: var(--red-glow); }

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.user-badge {
    font-family: var(--font-cond);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid;
}

.role-admin    { color: var(--gold); border-color: var(--gold-dim); background: rgba(245,200,66,0.1); }
.role-treasurer{ color: var(--green); border-color: #1d7a52; background: rgba(46,184,122,0.1); }
.role-editor   { color: #6b9cff; border-color: #2d4a99; background: rgba(107,156,255,0.1); }
.role-viewer   { color: var(--text-muted); border-color: var(--border); }

.user-name {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.btn-logout {
    color: var(--red);
    text-decoration: none;
    font-size: 0.82rem;
    font-family: var(--font-cond);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid var(--red-dark);
    padding: 4px 10px;
    border-radius: var(--radius);
    transition: all 0.18s;
}

.btn-logout:hover { background: var(--red); color: white; }

/* ── Main content ── */
.main-content {
    flex: 1;
    padding: 28px 28px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.main-content.full-height {
    max-width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 0px);
}

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-family: var(--font-head);
    font-size: 2.4rem;
    letter-spacing: 3px;
    color: var(--text);
    line-height: 1;
}

.page-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Cards ── */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-cond);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.card-grid {
    display: grid;
    gap: 20px;
}

.card-grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card-grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ── Stat tiles ── */
.stat-tile {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.stat-tile .stat-value {
    font-family: var(--font-head);
    font-size: 2.8rem;
    color: var(--red);
    line-height: 1;
    letter-spacing: 2px;
}

.stat-tile .stat-label {
    font-family: var(--font-cond);
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 6px;
}

.stat-tile.gold .stat-value { color: var(--gold); }
.stat-tile.green .stat-value { color: var(--green); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead tr {
    background: var(--bg3);
    border-bottom: 2px solid var(--border);
}

thead th {
    padding: 10px 14px;
    text-align: left;
    font-family: var(--font-cond);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}

tbody tr:hover { background: var(--bg3); }

tbody td {
    padding: 10px 14px;
    vertical-align: middle;
}

.td-mono {
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
}

/* ── Forms ── */
.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width { grid-column: 1 / -1; }

label {
    font-family: var(--font-cond);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"],
select,
textarea {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 9px 12px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    width: 100%;
    transition: border-color 0.18s, box-shadow 0.18s;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-glow);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a8099' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

textarea { resize: vertical; min-height: 80px; }

.form-hint {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-family: var(--font-cond);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s;
    white-space: nowrap;
}

.btn-primary   { background: var(--red); color: white; }
.btn-primary:hover { background: var(--red-dark); box-shadow: 0 0 16px var(--red-glow); }

.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-muted); }

.btn-success   { background: var(--green); color: #0a1a12; }
.btn-success:hover { filter: brightness(1.1); }

.btn-gold      { background: var(--gold); color: #1a1200; }
.btn-gold:hover { filter: brightness(1.1); }

.btn-danger    { background: transparent; color: var(--red); border: 1px solid var(--red-dark); }
.btn-danger:hover { background: var(--red); color: white; }

.btn-sm { padding: 4px 10px; font-size: 0.78rem; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-cond);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge-green  { background: rgba(46,184,122,0.15); color: var(--green); border: 1px solid #1d7a52; }
.badge-red    { background: rgba(232,55,42,0.15);  color: #ff6b60;     border: 1px solid var(--red-dark); }
.badge-gold   { background: rgba(245,200,66,0.15); color: var(--gold); border: 1px solid var(--gold-dim); }
.badge-muted  { background: var(--bg3); color: var(--text-muted);       border: 1px solid var(--border); }

/* ── Flash messages ── */
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.92rem;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

.flash-success { background: rgba(46,184,122,0.12); border-color: var(--green); color: #7eefc0; }
.flash-error   { background: rgba(232,55,42,0.12); border-color: var(--red); color: #ff8c85; }
.flash-info    { background: rgba(107,156,255,0.1); border-color: #4a7aff; color: #9ab8ff; }
.flash-warning { background: rgba(245,200,66,0.1); border-color: var(--gold); color: var(--gold); }

.flash-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.6;
}

.flash-close:hover { opacity: 1; }

/* ── Login page ── */
.login-page { background: radial-gradient(ellipse at center, #1a1020 0%, var(--bg) 70%); }

.login-box {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--red);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo .dart-icon { font-size: 3rem; display: block; margin-bottom: 8px; }

.login-logo h1 {
    font-family: var(--font-head);
    font-size: 2rem;
    letter-spacing: 3px;
    color: var(--text);
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ── Progress / payment indicators ── */
.pay-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

.pay-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.pay-dot.paid   { background: var(--green); color: #0a1a12; }
.pay-dot.unpaid { background: var(--bg3); border-color: var(--border); color: var(--text-dim); }
.pay-dot.unpaid:hover { border-color: var(--red); color: var(--red); }

/* ── Award podium ── */
.award-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.award-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gold);
}

.award-rank {
    font-family: var(--font-head);
    font-size: 3.5rem;
    color: var(--gold);
    line-height: 1;
    opacity: 0.2;
    position: absolute;
    right: 14px;
    top: 10px;
}

.award-category {
    font-family: var(--font-cond);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.award-winner {
    font-family: var(--font-head);
    font-size: 1.6rem;
    letter-spacing: 2px;
    color: var(--text);
    margin-bottom: 4px;
}

.award-team {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.award-stat {
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
    color: var(--gold);
    margin-top: 8px;
}

.award-prize {
    font-family: var(--font-cond);
    font-weight: 700;
    color: var(--green);
    margin-top: 6px;
    font-size: 1.1rem;
}

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-cond);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 8px 18px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: -1px;
}

.tab-btn.active { color: var(--red); border-bottom-color: var(--red); }
.tab-btn:hover:not(.active) { color: var(--text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Progress bar ── */
.progress-bar {
    height: 6px;
    background: var(--bg3);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--red);
    border-radius: 99px;
    transition: width 0.4s ease;
}

.progress-bar-fill.green { background: var(--green); }
.progress-bar-fill.gold  { background: var(--gold); }

/* ── Section divider ── */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ── Eligibility indicator ── */
.eligible-yes { color: var(--green); font-weight: 600; }
.eligible-no  { color: var(--red);   font-weight: 600; }

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 12px;
    font-size: 0.75rem;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .navbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
    .navbar-links { order: 3; width: 100%; flex-wrap: wrap; }
    .main-content { padding: 16px; }
    .page-title { font-size: 1.8rem; }
}

/* ── Treasurer checklist ── */
.treasurer-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.week-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.week-btn {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-cond);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}

.week-btn.active  { background: var(--red); color: white; border-color: var(--red); }
.week-btn.has-data{ border-color: var(--green); color: var(--green); }
.week-btn:hover:not(.active) { border-color: var(--text-muted); color: var(--text); }

/* ── Import drop zone ── */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg3);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--red);
    background: var(--red-glow);
}

.drop-zone-icon { font-size: 3rem; margin-bottom: 10px; }
.drop-zone p { color: var(--text-muted); font-size: 0.9rem; }
.drop-zone strong { color: var(--text); }
