:root {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: 0 8px 32px rgba(0,0,0,0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* ===== LOGIN ===== */
#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.login-card h1 { font-size: 28px; margin-bottom: 8px; }
.login-card .subtitle { color: var(--text-muted); margin-bottom: 32px; }

#login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== INPUTS & BUTTONS ===== */
input[type="text"], input[type="password"], input[type="number"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 12px 14px;
    font-size: 15px;
    width: 100%;
    transition: border-color 0.15s;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
button.ghost:hover:not(:disabled) { background: var(--bg-card); }

button.small { padding: 6px 12px; font-size: 13px; }

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== HEADER & TABS ===== */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-inner h1 { font-size: 20px; }

.tabs {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 4px;
    padding: 0 24px;
    overflow-x: auto;
}

.tab {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    white-space: nowrap;
}

.tab:hover { color: var(--text); background: transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

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

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.card h2 { font-size: 18px; margin-bottom: 16px; }

#search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#search-total-display, #search-min-rating-display {
    font-weight: 600;
    color: var(--text);
}

/* ===== STATUS & RESULTS ===== */
.status {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.status.loading::before {
    content: "⏳ ";
}

.error { color: var(--error); margin-top: 8px; font-size: 14px; }

.result {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: 8px;
    border-left: 3px solid var(--success);
    display: none;
}
.result.visible { display: block; }
.result strong { color: var(--success); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 13px;
}

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}

tr:hover td { background: rgba(99, 102, 241, 0.05); }

td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--border);
}

.badge.success { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge.error { background: rgba(239, 68, 68, 0.2); color: var(--error); }
.badge.warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

.filters {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.filters label { flex-direction: row; align-items: center; gap: 8px; }
.filters input[type="number"] { width: 120px; }

.action-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.action-links a {
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text);
    text-decoration: none;
}
.action-links a:hover { background: var(--accent); text-decoration: none; }

@media (max-width: 768px) {
    .header-inner h1 { font-size: 16px; }
    table { font-size: 12px; }
    th, td { padding: 8px 10px; }
}
