/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
    background: #1a1a2e;
    color: #fff;
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 0.5rem; font-size: 1.2rem; font-weight: 600; }
.nav-logo { font-size: 1.5rem; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-link { color: #ccc; text-decoration: none; font-size: 0.9rem; padding: 0.4rem 0.8rem; border-radius: 4px; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ── Container ────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 2rem auto; padding: 0 1.5rem; }

/* ── Page Header ──────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-header h1 { margin: 0; }

/* ── Stats Grid ───────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid #1a1a2e;
}
.stat-card-green { border-left-color: #27ae60; }
.stat-card-red { border-left-color: #e74c3c; }
.stat-number { font-size: 2rem; font-weight: 700; color: #1a1a2e; }
.stat-label { font-size: 0.85rem; color: #666; margin-top: 0.25rem; }

/* ── Tables ───────────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.table th { background: #1a1a2e; color: #fff; text-align: left; padding: 0.75rem 1rem; font-size: 0.85rem; }
.table td { padding: 0.75rem 1rem; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.table tr:hover { background: #f8f9fa; }
.table .actions { white-space: nowrap; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.2s;
    text-decoration: none;
}
.btn:hover { opacity: 0.85; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-primary { background: #3498db; color: #fff; }
.btn-success { background: #27ae60; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-warning { background: #f39c12; color: #fff; }
.btn-info { background: #17a2b8; color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-full { width: 100%; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
}
.form-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* ── Filters ──────────────────────────────────────────────── */
.filters { margin-bottom: 1rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.filters select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 200px;
}

/* ── Modals ───────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-header h2 { margin: 0; font-size: 1.3rem; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* ── Login Page ───────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.login-container {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.login-header h1 { font-size: 1.5rem; color: #1a1a2e; }
.login-header p { color: #666; font-size: 0.9rem; }

/* ── Code ─────────────────────────────────────────────────── */
code { background: #f1f3f5; padding: 0.15rem 0.4rem; border-radius: 3px; font-size: 0.85rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .nav-links { gap: 0.3rem; flex-wrap: wrap; }
    .nav-link { font-size: 0.8rem; padding: 0.3rem 0.5rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .table { font-size: 0.8rem; }
    .table th, .table td { padding: 0.5rem; }
}
