:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header & Nav */
header {
    background: var(--dark);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.logo:hover { text-decoration: none; }

nav { display: flex; gap: 1rem; }

nav a {
    color: rgba(255,255,255,0.8);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

nav a:hover, nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Main Content */
main { padding: 2rem 0; min-height: calc(100vh - 140px); }

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title { font-size: 1.25rem; font-weight: 600; }

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
}

.stat-number { font-size: 2.5rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--secondary); font-size: 0.875rem; text-transform: uppercase; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #475569; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }

label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    background: var(--light);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    color: var(--secondary);
}

tr:hover { background: var(--light); }

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-box {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary { background: #dbeafe; color: var(--primary); }
.badge-success { background: #dcfce7; color: #166534; }
.badge-secondary { background: #f1f5f9; color: var(--secondary); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary);
}

/* Utility */
.text-muted { color: var(--secondary); }
.text-small { font-size: 0.875rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--dark);
        flex-direction: column;
        padding: 1rem;
        display: none;
    }
    
    nav.active { display: flex; }
    
    nav a {
        padding: 0.75rem 1rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .card { padding: 1rem; }
    
    .form-row { grid-template-columns: 1fr; }
    
    th, td { padding: 0.5rem; font-size: 0.875rem; }
    
    .hide-mobile { display: none; }
    
    .stat-number { font-size: 2rem; }
}
