/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.5;
}

/* ---------- Color System ---------- */
:root {
    --bg: #f6f7f9;
    --bg-card: #ffffff;
    --text: #1f2933;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #059669;
    --danger: #dc2626;
}

/* ---------- Dark Mode ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --bg-card: #020617;
        --text: #e5e7eb;
        --text-muted: #9ca3af;
        --border: #1e293b;
        --primary: #60a5fa;
        --primary-hover: #3b82f6;
        --success: #34d399;
        --danger: #f87171;
    }
}

/* ---------- Layout ---------- */
body {
    background-color: var(--bg);
    color: var(--text);
}

.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ---------- Header ---------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header h1 {
    margin: 0;
    font-size: 1.4rem;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ---------- Forms ---------- */
label {
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
}

input[type="file"],
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

/* ---------- Buttons ---------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.button-primary {
    background: var(--primary);
    color: white;
}

.button-primary:hover {
    background: var(--primary-hover);
}

.button-danger {
    background: var(--danger);
    color: white;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(16,185,129,0.15);
    color: var(--success);
}

.alert-danger {
    background: rgba(239,68,68,0.15);
    color: var(--danger);
}

/* ---------- Tables ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

th, td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

th {
    text-align: left;
    color: var(--text-muted);
}