:root {
    --primary-color: #003366; /* BPS Blue */
    --secondary-color: #f7b900; /* BPS Yellow */
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    transition: background 0.2s;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255,255,255,0.1);
    color: var(--secondary-color);
}

.nav-item i {
    margin-right: 0.75rem;
    width: 20px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 2rem;
}

.content-body {
    padding: 2rem;
}

/* UI Elements */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-secondary { background: var(--border-color); color: var(--text-color); }

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-label { font-size: 0.875rem; color: var(--text-muted); }
.stat-value { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }

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

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

th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-muted);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Badges */
.badge {
    padding: 0.25rem 0.625rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f3f4f6; color: #374151; }

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
}

input:focus { border-color: var(--primary-color); }

[x-cloak] { display: none !important; }

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7); /* Modern dark translucent */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    backdrop-filter: blur(4px); /* Subtle glass effect on backdrop */
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 650px;
    animation: slideUp 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Pagination Fix */
.main-content nav svg {
    width: 20px;
    height: 20px;
    display: inline;
}

.main-content nav div[role="navigation"] {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Utility */
body.modal-open {
    overflow: hidden;
}
