:root {
    --primary-red: #e63946;
    --dark-red: #c92a36;
    --bg-light: #f4f6f9;
    --sidebar-bg: #1a1a2e;
    /* Dark navy for sidebar */
    --sidebar-text: #e0e0e0;
    --sidebar-hover: #16213e;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #6c757d;
    --border: #e9ecef;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s;
}

.sidebar-header {
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.1);
    text-align: center;
}

.sidebar-header h2 {
    color: var(--primary-red);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    flex-grow: 1;
}

.nav-links li a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border-left: 4px solid transparent;
}

.nav-links li a:hover,
.nav-links li a.active {
    background-color: var(--sidebar-hover);
    border-left-color: var(--primary-red);
    color: #fff;
}

.user-info {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    text-align: center;
    color: #aaa;
}

.btn-logout {
    display: inline-block;
    margin-top: 10px;
    background-color: #ff6b6b;
    color: white;
    text-decoration: none;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    transition: all 0.3s;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-logout:hover {
    background: #fa5252;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

header.top-bar {
    background-color: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #444;
}

.content-wrapper {
    padding: 2rem;
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}

.card-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-icon {
    float: right;
    color: var(--primary-red);
    opacity: 0.2;
    font-size: 2.5rem;
}

/* Tables & CRUD */
.table-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-red);
    color: #fff;
}

.btn-primary:hover {
    background: var(--dark-red);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-edit {
    background: #343a40;
    color: #fff;
}

.btn-delete {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-delete:hover {
    background: var(--danger);
    color: #fff;
}

/* Status Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-expired {
    background: #f8d7da;
    color: #721c24;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

/* Forms */
.form-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
        /* Hide sidebar on mobile */
    }

    .main-content {
        width: 100%;
        /* Full width content */
    }
}