/* ============================================================
   UPCMIS — Global Stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('variables.css');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--body-bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-light);
    text-decoration: none;
}

a:hover {
    color: var(--primary);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f3460 0%, #1a5276 50%, #1abc9c22 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(26, 188, 156, 0.08);
    top: -200px;
    right: -200px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    bottom: -150px;
    left: -100px;
}

.login-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 420px;
    max-width: 95vw;
    padding: 44px 40px;
    position: relative;
    z-index: 1;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand .emblem {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.login-brand .emblem svg {
    width: 38px;
    height: 38px;
    fill: #fff;
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.login-brand h2 {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.login-trilingual {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.login-trilingual span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.login-trilingual .sep {
    color: #ccc;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.15);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    border-left: 3px solid var(--accent);
    padding-left: 10px;
    margin: 22px 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.input-icon {
    position: relative;
}

.input-icon .form-control {
    padding-left: 40px;
}

.input-icon .icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26, 82, 118, 0.35);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--accent-dark);
    color: #fff;
    transform: translateY(-1px);
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
    color: #fff;
}

.btn-secondary {
    background: #ecf0f1;
    color: var(--text);
}

.btn-secondary:hover {
    background: #dde4e6;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm {
    padding: 5px 13px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 0.95rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    padding: 7px 10px;
}

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid transparent;
}

.alert-success {
    background: #eafaf1;
    border-color: #1abc9c;
    color: #0e6655;
}

.alert-danger {
    background: #fdf0ef;
    border-color: #e74c3c;
    color: #922b21;
}

.alert-warning {
    background: #fef9e7;
    border-color: #f39c12;
    color: #7d6608;
}

.alert-info {
    background: #ebf5fb;
    border-color: #3498db;
    color: #1a5276;
}

/* ============================================================
   LAYOUT — SIDEBAR + MAIN
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: width var(--transition);
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent), #27ae60);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand .brand-icon svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.sidebar-brand .brand-text {
    overflow: hidden;
}

.sidebar-brand .brand-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.sidebar-brand .brand-sub {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.sidebar-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.35);
    padding: 16px 20px 6px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background: rgba(26, 188, 156, 0.18);
    color: var(--sidebar-active);
    border-left-color: var(--sidebar-active);
    font-weight: 600;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item .nav-label {
    white-space: nowrap;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    border-radius: 20px;
    padding: 1px 7px;
    font-weight: 700;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 20px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user .avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user .user-info {
    overflow: hidden;
}

.sidebar-user .user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.sidebar-user .user-role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.sidebar-user .logout-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition);
}

.sidebar-user .logout-btn:hover {
    color: #e74c3c;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    height: var(--header-h);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.top-header .page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    flex: 1;
}

.top-header .breadcrumb {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.top-header .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Content Area */
.content-area {
    padding: 28px;
    flex: 1;
}

/* ============================================================
   DASHBOARD STATS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-icon.blue {
    background: rgba(26, 82, 118, 0.12);
    color: var(--primary);
}

.stat-icon.teal {
    background: rgba(26, 188, 156, 0.12);
    color: var(--accent);
}

.stat-icon.orange {
    background: rgba(243, 156, 18, 0.12);
    color: #f39c12;
}

.stat-icon.red {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
}

.stat-icon.purple {
    background: rgba(142, 68, 173, 0.12);
    color: #8e44ad;
}

.stat-icon.green {
    background: rgba(39, 174, 96, 0.12);
    color: #27ae60;
}

.stat-body .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
}

.stat-body .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.card-body {
    padding: 22px;
}

.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table th {
    padding: 11px 14px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: #f8f9fa;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8fbff;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: capitalize;
}

.badge-success {
    background: rgba(26, 188, 156, 0.15);
    color: #0e6655;
}

.badge-primary {
    background: rgba(26, 82, 118, 0.13);
    color: var(--primary);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.15);
    color: #7d6608;
}

.badge-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #922b21;
}

.badge-secondary {
    background: rgba(127, 140, 141, 0.15);
    color: #5d6d7e;
}

.badge-info {
    background: rgba(52, 152, 219, 0.15);
    color: #1a5276;
}

.badge-purple {
    background: rgba(142, 68, 173, 0.15);
    color: #6c3483;
}

.badge-teal {
    background: rgba(22, 160, 133, 0.15);
    color: #0e6655;
}

/* ============================================================
   SEARCH / FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.search-input-wrap .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrap input {
    padding-left: 38px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 600px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.22s ease;
}

.modal-lg {
    width: 820px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 22px 24px;
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 22px;
}

.tab-btn {
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: -1.5px;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   PROGRESS / CAPACITY BAR
   ============================================================ */
.capacity-bar {
    height: 8px;
    background: #e8ecf0;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 5px;
}

.capacity-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease;
}

.capacity-fill.low {
    background: var(--accent);
}

.capacity-fill.medium {
    background: #f39c12;
}

.capacity-fill.high {
    background: #e74c3c;
}

/* ============================================================
   PROFILE / DETAIL VIEW
   ============================================================ */
.detail-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.detail-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.4);
}

.detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.detail-info h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.detail-info .detail-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.detail-info .meta-item {
    font-size: 0.82rem;
    opacity: 0.85;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.info-row {
    display: contents;
}

.info-label {
    padding: 11px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f8f9fa;
    border-bottom: 1px solid #f0f2f5;
}

.info-value {
    padding: 11px 14px;
    font-size: 0.88rem;
    color: var(--text);
    border-bottom: 1px solid #f0f2f5;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--accent);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-content {
    font-size: 0.88rem;
    color: var(--text);
}

.timeline-content strong {
    color: var(--primary);
}

/* ============================================================
   LEDGER TABLE
   ============================================================ */
.credit {
    color: #27ae60;
    font-weight: 600;
}

.debit {
    color: #e74c3c;
    font-weight: 600;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 56px;
    height: 56px;
    opacity: 0.25;
    margin-bottom: 14px;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
}

.page-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text);
    transition: all var(--transition);
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.text-danger {
    color: #e74c3c;
}

.text-success {
    color: #27ae60;
}

.fw-bold {
    font-weight: 700;
}

.fw-600 {
    font-weight: 600;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 6px;
}

.mt-2 {
    margin-top: 14px;
}

.mt-3 {
    margin-top: 22px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 6px;
}

.mb-2 {
    margin-bottom: 14px;
}

.mb-3 {
    margin-bottom: 22px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.gap-1 {
    gap: 6px;
}

.gap-2 {
    gap: 12px;
}

.justify-between {
    justify-content: space-between;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.w-100 {
    width: 100%;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .sidebar {
        width: 64px;
    }

    .sidebar-brand .brand-text,
    .nav-item .nav-label,
    .nav-item .nav-badge,
    .sidebar-section-label,
    .sidebar-user .user-info {
        display: none;
    }

    .sidebar-brand {
        justify-content: center;
        padding: 16px 10px;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .sidebar-user {
        justify-content: center;
    }

    .sidebar-user .logout-btn {
        margin-left: 0;
    }

    .main-content {
        margin-left: 64px;
    }
}

@media (max-width: 600px) {
    .content-area {
        padding: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row.cols-3 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .detail-header {
        flex-direction: column;
        text-align: center;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   TABS (Food & Assets Module)
   ============================================================ */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--card-bg);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 10px 14px 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.tab-btn {
    padding: 9px 18px;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

.tab-btn:hover {
    color: var(--primary);
    background: #f0f4f8;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   CAPACITY BAR (Centers Module)
   ============================================================ */
.capacity-bar {
    height: 8px;
    background: #e8ecf0;
    border-radius: 8px;
    overflow: hidden;
}

.capacity-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.4s ease;
}

.capacity-fill.low {
    background: var(--accent);
}

.capacity-fill.medium {
    background: #f39c12;
}

.capacity-fill.high {
    background: #e74c3c;
}

/* ============================================================
   FINANCE LEDGER
   ============================================================ */
td.debit {
    color: #c0392b;
    font-weight: 600;
}

td.credit {
    color: #0e6655;
    font-weight: 600;
}

/* ============================================================
   UTILITY HELPERS
   ============================================================ */
.d-flex {
    display: flex;
}

.gap-1 {
    gap: 6px;
}

.gap-2 {
    gap: 12px;
}

.fw-bold {
    font-weight: 700;
}

.text-danger {
    color: #e74c3c;
}

.text-center {
    text-align: center;
}

/* ============================================================
   Sidebar Approvals Badge
   ============================================================ */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #e53e3e;
    color: #fff;
    border-radius: 10px;
    font-size: .7rem;
    font-weight: 700;
    margin-left: auto;
}

/* ============================================================
   Badge color additions for food workflow & requests
   ============================================================ */
.badge-purple {
    background: #ede9fe;
    color: #7c3aed;
}

.badge-teal {
    background: #ccfbf1;
    color: #0d9488;
}

/* ============================================================
   Permission Matrix toggle switch
   ============================================================ */
.toggle-label {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle-label input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #e5e7eb;
    border-radius: 22px;
    transition: .3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}

.toggle-label input:checked+.toggle-slider {
    background: var(--accent, #0ea5e9);
}

.toggle-label input:checked+.toggle-slider::before {
    transform: translateX(18px);
}