:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #EFF6FF;
    --text: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --bg: #F9FAFB;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

input, select, textarea {
    font: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    width: 100%;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    padding: 10px 18px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
}

button:hover { background: var(--primary-hover); }
button:active { transform: translateY(1px); }
button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: var(--bg); }
button.danger { background: #DC2626; }
button.danger:hover { background: #B91C1C; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
}

.badge.success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.badge.warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.badge.danger { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.badge.info { background: var(--primary-light); color: #1E40AF; border-color: #BFDBFE; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); background: var(--bg); }
tr:hover td { background: #F8FAFC; }

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert.error { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.alert.success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-group .help { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-gray { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.max-w-md { max-width: 448px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 50;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.sidebar-brand h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar a:hover, .sidebar a.active {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
    border-left-color: var(--primary);
}

.main { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; }
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}
.content { flex: 1; padding: 24px; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #F3F4F6;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
}

.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-card p.subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }

@media (max-width: 1024px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
}
