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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

nav {
    display: flex;
    background: #1e293b;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #334155;
}

nav .tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

nav .tab.active {
    color: #f8fafc;
    border-bottom-color: #e94560;
}

main { padding: 1rem; }

.page { display: none; }
.page.active { display: block; }

h2 {
    font-size: 1.1rem;
    margin: 1.2rem 0 0.6rem;
    color: #94a3b8;
}

.banner {
    background: #e94560;
    color: #fff;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.1rem;
}

.hidden { display: none !important; }

/* Scrape controls */
.scrape-controls {
    margin-bottom: 1rem;
}

.scrape-range {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.range-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #334155;
    border-radius: 20px;
    background: #1e293b;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.85rem;
}

.range-btn.active { background: #e94560; color: #fff; border-color: #e94560; }

.scrape-range input[type="date"] {
    padding: 0.35rem 0.5rem;
    border: 1px solid #334155;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #1e293b;
    color: #e2e8f0;
    color-scheme: dark;
}

.scrape-btn {
    padding: 0.7rem;
    background: #334155;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

.scrape-btn:hover { background: #475569; }

#run-scrape-btn { width: 100%; background: #1e293b; border-color: #334155; }
#run-scrape-btn:hover { background: #334155; }

.scrape-sources {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.scrape-sources .source-btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 0.5rem;
}

.scrape-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Sources */
.source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #1e293b;
}

.source-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.source-status.ok { background: #2ecc71; }
.source-status.error { background: #e74c3c; }
.source-status.unknown { background: #475569; }

.source-item div:last-child { color: #64748b; }

/* Matches */
.match-card {
    background: #1e293b;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border: 1px solid #334155;
}

.match-card.unconfirmed { border-left: 4px solid #e94560; }
.match-card.confirmed { border-left: 4px solid #2ecc71; }
.match-card.dismissed { border-left: 4px solid #475569; opacity: 0.6; }

.match-name { font-weight: 700; font-size: 1.05rem; color: #f8fafc; }
.match-group { color: #64748b; font-size: 0.85rem; }
.match-details { font-size: 0.9rem; color: #94a3b8; margin-top: 0.4rem; }
.match-details a { color: #60a5fa; }

.match-actions {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.5rem;
}

.match-actions button {
    padding: 0.4rem 0.8rem;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #0f172a;
    cursor: pointer;
    font-size: 0.85rem;
    color: #94a3b8;
}

.match-actions button.confirm { color: #2ecc71; border-color: #2ecc71; }
.match-actions button.confirm:hover { background: #2ecc71; color: #0f172a; }
.match-actions button.dismiss { color: #64748b; border-color: #475569; }
.match-actions button.dismiss:hover { background: #475569; color: #f8fafc; }

.filters {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #334155;
    border-radius: 20px;
    background: #1e293b;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.85rem;
}

.filter-btn.active { background: #e94560; color: #fff; border-color: #e94560; }

/* Watchlist */
.watchlist-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.watchlist-controls input,
.watchlist-controls select {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #1e293b;
    color: #e2e8f0;
}

.watchlist-controls button {
    padding: 0.5rem 1rem;
    background: #334155;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.watchlist-controls button:hover { background: #475569; }

.watchlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #1e293b;
}

.watchlist-info { flex: 1; }
.watchlist-name { font-weight: 600; color: #f8fafc; }
.watchlist-meta { font-size: 0.8rem; color: #64748b; }

.watchlist-actions {
    display: flex;
    gap: 0.3rem;
}

.watchlist-actions button {
    padding: 0.3rem 0.6rem;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #0f172a;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.8rem;
}

.watchlist-actions button:hover { background: #334155; color: #f8fafc; }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
}

.modal-content h3 { margin-bottom: 1rem; color: #f8fafc; }

.modal-content label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

.modal-content input,
.modal-content textarea {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #334155;
    border-radius: 4px;
    margin-top: 0.3rem;
    font-size: 0.95rem;
    background: #0f172a;
    color: #e2e8f0;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.modal-actions button {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #334155;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    background: #0f172a;
    color: #94a3b8;
}

.modal-actions button:hover { background: #334155; color: #f8fafc; }

.modal-actions button[type="submit"] {
    background: #e94560;
    color: #fff;
    border-color: #e94560;
}

.modal-actions button[type="submit"]:hover { background: #d63851; }
