:root {
    --primary-color: #0D2F63; /* Dark Navy Blue from brand */
    --secondary-color: #2DB85C; /* Bright Green from brand */
    --success-color: #2DB85C; /* Bright Green from brand */
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #0D2F63;
    --sage-color: #9BB896; /* Sage Green from brand */
    --gray-color: #A6A8A8; /* Brand Gray */
}
.header-insights {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-inline: auto 30px;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(92,45,213,0.06);
    border-radius: 14px;
    padding: 10px 16px;
    min-width: 150px;
    border: 1px solid rgba(92,45,213,0.08);
}

.insight-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.insight-label {
    display: block;
    font-size: 0.8rem;
    color: #6b5b8a;
}

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;700&display=swap');

/* Brand Fonts */
@font-face {
    font-family: 'Century Gothic';
    src: local('Century Gothic'), local('Century Gothic Bold');
    font-weight: bold;
}

/* Note: GESS Two Medium font needs to be added to your project fonts folder */
@font-face {
    font-family: 'GESS Two';
    font-weight: 500;
    /* Add the font file path when you have the GESS Two font file */
    /* src: url('../fonts/GESSTwo-Medium.ttf') format('truetype'); */
}

/* Reset & base */
* { box-sizing: border-box; }
html { overflow-x: hidden; }
html,body { height:100%; }
body {
    font-family: 'GESS Two', 'Century Gothic', 'Cairo', sans-serif;
    background: #0b2856;
    color: #888;
    min-height: 100vh;
    margin:0;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('../images/tatweer1_logo.png');
    background-repeat: repeat;
    background-size: 320px auto;
    background-position: center;
    opacity: 0.08;
    pointer-events: none;
    z-index: -2;
    filter: saturate(0.4);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(2, 12, 32, 0.78);
    pointer-events: none;
    z-index: -1;
}

/* Container main layout */
.container-main {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding-inline-start: 324px; /* 300px sidebar width + 24px gap */
    min-height: 100vh;
}

/* Sidebar placeholder never occupies space (sidebar is fixed) */
#sidebar-placeholder {
    width: 0;
    padding: 0;
    margin: 0;
    overflow: visible;
}

/* ===== SIDEBAR (shared) ===== */
.sidebar {
    width: 300px;
    background: linear-gradient(180deg, rgba(32,13,82,0.92), rgba(22,8,54,0.9));
    color: #f7f4ff;
    height: 100vh;
    padding: 22px;
    border-radius: 12px;
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(15,23,36,0.08);
    flex-shrink: 0;
    z-index: 1000;
}

/* sidebar header */
.sidebar-header h4 { margin:0; color:#f7f4ff; font-size:1.15rem; }
.sidebar-header p { margin:4px 0 12px; color: rgba(255,255,255,0.75); font-size:0.9rem; }

/* profile */
.user-profile { text-align:center; margin-bottom:14px; }
.user-avatar {
    width:68px; height:68px; border-radius:50%;
    background: linear-gradient(135deg,#f6c85f,#f08d19);
    display:inline-flex; align-items:center; justify-content:center;
    font-size:28px; box-shadow:0 6px 18px rgba(43,108,176,0.18);
}
.user-name { margin-top:10px; font-weight:700; }
.user-role { color: rgba(255,255,255,0.7); font-size:0.9rem; margin-bottom:10px; }
.user-stats { display:flex; justify-content:space-around; gap:10px; margin-top:10px; }
.user-stats .stat-item { text-align:center; }
.user-stats .stat-value { font-weight:700; font-size:1.05rem; }
.user-stats .stat-label { font-size:0.8rem; color:rgba(255,255,255,0.7); }

/* nav */
.sidebar .nav { margin-top: 10px; padding-inline-start:0; }
.sidebar .nav .nav-item { margin-bottom:6px; }
.sidebar .nav .nav-link {
    color: rgba(255,255,255,0.9);
    background: transparent;
    border-radius:8px;
    padding:10px 12px;
    display:flex; align-items:center; gap:10px;
    transition: all .18s ease;
}
.sidebar .nav .nav-link i { width:22px; text-align:center; font-size:16px; color: rgba(255,255,255,0.9); }
.sidebar .nav .nav-link:hover {
    transform: translateX(-6px);
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar .nav .nav-link.active {
    background: linear-gradient(90deg,var(--secondary-color), var(--primary-color));
    color:#fff;
    box-shadow: 0 8px 18px rgba(88,43,199,0.35);
}

/* sidebar footer */
.sidebar-footer { margin-top:18px; color: rgba(255,255,255,0.65); font-size:0.85rem; text-align:center; }

/* ===== MAIN CONTENT (shared styles from order.html) ===== */
.main-content, .container {
    flex:1;
    padding: 20px;
}

/* header card */
.header {
    background: white;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(84,63,154,0.12);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: visible;
}
.header::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}
.page-title h1 { font-weight:700; color:var(--primary-color); margin-bottom:5px; }
.page-title p { color:#5e4b7c; margin-bottom:0; }

/* stats cards */
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 25px; }
.stat-card {
    background: white; border-radius: 15px; padding: 20px;
    box-shadow: 0 5px 18px rgba(84,63,154,0.12); text-align:center; transition: transform .25s;
    color: #2d1b4f;
}
.stat-card:hover { transform: translateY(-5px); }
.stat-icon { font-size:2.2rem; margin-bottom:12px; }
.stat-value { font-size:1.6rem; font-weight:700; margin:8px 0; }

/* filters card */
.filters-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 18px rgba(84,63,154,0.12);
    margin-bottom: 25px;
    color: #2d1b4f;
}
.section-title { font-weight:700; color:var(--primary-color); margin-bottom:20px; padding-bottom:10px; border-bottom:2px solid rgba(0,0,0,0.05); }
.filter-row { display:flex; gap:15px; flex-wrap:wrap; }
.filter-group { flex:1; min-width:200px; }
.filters-card .form-label { color:#5e4b7c; }
.filters-card .form-select,
.filters-card .form-control {
    background-color: #fff;
    border:1px solid rgba(93,67,146,0.25);
    color:#2d1b4f;
}
.filters-card .form-select:focus,
.filters-card .form-control:focus {
    border-color: rgba(92,45,213,0.6);
    box-shadow: 0 0 0 0.2rem rgba(92,45,213,0.1);
}

/* requests table card */
.requests-table { background-color:white; border-radius:15px; overflow:hidden; box-shadow:0 5px 18px rgba(84,63,154,0.12); margin-bottom:20px; color:#2d1b4f; }
.table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    padding: 15px;
    text-align: center;
}
.table td { padding: 15px; vertical-align: middle; text-align: center; color:#2d1b4f; }

/* status badges */
.status-badge { padding:7px 12px; border-radius:20px; font-size:.85rem; font-weight:700; display:inline-flex; gap:8px; align-items:center; }
.status-approved { background-color: rgba(46,204,113,0.12); color: var(--success-color); }
.status-pending  { background-color: rgba(243,156,18,0.12); color: var(--warning-color); }
.status-rejected { background-color: rgba(231,76,60,0.12); color: var(--danger-color); }
.status-completed{ background-color: rgba(52,152,219,0.12); color: var(--secondary-color); }

/* actions */
.btn-action { border-radius: 20px; padding:5px 15px; font-size:0.85rem; font-weight:600; }

/* loader */
.loader {
    position: fixed; top:0; inset-inline-start:0; width:100%; height:100%;
    background: rgba(255,255,255,0.9); display:flex; justify-content:center; align-items:center; z-index:9999; flex-direction:column;
}
.spinner {
    width:60px; height:60px; border:5px solid #f3f3f3; border-top:5px solid var(--secondary-color); border-radius:50%; animation:spin 1s linear infinite; margin-bottom:20px;
}
.loader-text { font-size:1.1rem; color:var(--primary-color); font-weight:600; }
@keyframes spin { 0%{transform:rotate(0)}100%{transform:rotate(360deg)} }

/* no requests */
.no-requests { text-align:center; padding:40px; color:#6c757d; }
.no-requests i { font-size:4rem; margin-bottom:20px; color:#dee2e6; }

/* back button */
.back-button { display:inline-flex; align-items:center; gap:8px; margin-bottom:20px; color:var(--primary-color); text-decoration:none; font-weight:600; transition:all .25s; }
.back-button:hover { color:var(--secondary-color); transform:translateX(-5px); }

.request-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.request-actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.request-actions .btn {
    border-radius: 999px;
    font-weight: 600;
}

.request-actions .btn-outline-primary {
    border-color: rgba(122,102,31,0.4);
    color: #7a661f;
}

/* Enhanced Pagination Styles */
.pagination-wrapper {
    background: white;
    border-radius: 15px;
    padding: 20px 25px;
    box-shadow: 0 5px 18px rgba(84,63,154,0.12);
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.pagination-info {
    width: 100%;
    text-align: center;
}

.pagination-text {
    color: #5e4b7c;
    font-size: 0.95rem;
}

.pagination-text strong {
    color: var(--primary-color);
    font-weight: 700;
}

.pagination-custom {
    margin: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination-custom .page-item {
    margin: 0;
}

.pagination-custom .page-link {
    min-width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 2px solid rgba(93,67,146,0.15);
    border-radius: 12px;
    color: #5e4b7c;
    font-weight: 600;
    font-size: 0.95rem;
    background: white;
    transition: all 0.25s ease;
    text-decoration: none;
    gap: 6px;
}

.pagination-custom .page-link:hover:not(.disabled):not(.active) {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92,45,213,0.3);
}

.pagination-custom .page-item.active .page-link {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(92,45,213,0.35);
    font-weight: 700;
}

.pagination-custom .page-item.disabled .page-link {
    background: #f8f9fa;
    color: #adb5bd;
    border-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-custom .page-link-prev,
.pagination-custom .page-link-next {
    font-weight: 700;
    padding: 0 16px;
    min-width: auto;
}

.pagination-custom .page-link-prev i,
.pagination-custom .page-link-next i {
    font-size: 0.85rem;
}

.pagination-custom .page-link-prev:hover:not(.disabled),
.pagination-custom .page-link-next:hover:not(.disabled) {
    transform: translateX(-3px);
}

.pagination-custom .page-link-next:hover:not(.disabled) {
    transform: translateX(3px);
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .pagination-wrapper {
        padding: 15px;
    }

    .pagination-custom .page-link {
        min-width: 38px;
        height: 38px;
        font-size: 0.9rem;
        padding: 0 10px;
    }

    .pagination-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .pagination-custom {
        gap: 4px;
    }

    .pagination-custom .page-link {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
        padding: 0 8px;
    }

    .pagination-custom .page-link-prev,
    .pagination-custom .page-link-next {
        padding: 0 12px;
    }
}

.request-actions .btn-outline-primary:hover,
.request-actions .btn-outline-primary:focus {
    background: #ffd861;
    color: #3d2a00;
}

.tabbed-orders .nav-link {
    border-radius: 999px;
    color: #7a661f;
    font-weight: 600;
    background: rgba(255, 224, 140, 0.35);
    border: 1px solid transparent;
    margin-bottom: 10px;
}

.tabbed-orders .nav-link.active {
    color: #3d2a00;
    background: #ffd861;
    border-color: #f7c640;
    box-shadow: 0 6px 18px rgba(247,198,64,0.35);
}

.dept-pane {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 25px rgba(110,85,0,0.08);
    margin-top: 16px;
}

.employee-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.employee-summary .info-chip {
    background: rgba(255,232,162,0.6);
    border: 1px dashed rgba(122,102,31,0.4);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 0.95rem;
}

.header-logo-pill {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,0.05);
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.04);
}

.header-logo-pill img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.client-mail-card {
    background: rgba(255,255,255,0.85);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    margin-bottom: 18px;
    border: 1px solid rgba(0,0,0,0.02);
}

.client-mail-card figure {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.client-mail-card img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
    filter: saturate(0.85);
}

.service-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.service-option {
    position: relative;
}

.service-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.service-option-body {
    background: rgba(255,255,255,0.9);
    border: 2px solid rgba(122,102,31,0.15);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 120px;
    transition: all .25s ease;
}

.service-option input:checked + .service-option-body {
    border-color: #f7c640;
    box-shadow: 0 10px 25px rgba(247,198,64,0.25);
    background: #fff4c0;
}

.service-icon-badge {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.service-option-body h5 {
    margin-bottom: 6px;
    font-weight: 700;
    color: #4f3d00;
}

.service-option-body p {
    margin: 0;
    color: #7a661f;
    font-size: 0.9rem;
}

.service-block {
    border: 1px solid rgba(122,102,31,0.15);
    border-radius: 18px;
    background: rgba(255,255,255,0.9);
    margin-bottom: 24px;
    box-shadow: 0 12px 25px rgba(0,0,0,0.06);
    overflow: hidden;
}

.service-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
}

.service-block-header i {
    font-size: 1.5rem;
}

.service-block-body {
    padding: 22px 24px;
}

.service-empty-state {
    padding: 40px;
    border: 2px dashed rgba(122,102,31,0.35);
    border-radius: 18px;
    background: rgba(255,255,255,0.6);
    margin-bottom: 24px;
    color: #7a661f;
}

.summary-card {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    background: rgba(255,255,255,0.92);
    padding: 20px 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
    gap: 12px;
}

.summary-label {
    font-size: 0.8rem;
    color: #7a661f;
    display: block;
}

.summary-notes p {
    color: #4f3d00;
}

.summary-services .badge {
    border-radius: 999px;
}

.attachments-section {
    border: 1px dashed rgba(0,0,0,0.12);
    border-radius: 16px;
    padding: 24px;
    background: rgba(255,255,255,0.8);
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attachment-item {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px,1fr)) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    background: rgba(0,0,0,0.02);
    border-radius: 14px;
}

.attachment-item button {
    border-radius: 10px;
}

/* ============================================================
   RESPONSIVE — Mobile-first, complete overhaul
   ============================================================ */

/* --- Sidebar toggle button (visible on mobile only) --- */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 14px;
    inset-inline-start: 14px;
    z-index: 1200;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: #fff;
    border: none;
    font-size: 1.2rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s ease;
}

/* Overlay behind sidebar on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
}

/* ---- Large tablets and below (≤ 1024px) ---- */
@media (max-width: 1024px) {
    .container-main {
        padding-inline-start: 280px; /* narrower sidebar */
    }
    .sidebar {
        width: 260px;
    }
}

/* ---- Tablets and below (≤ 992px) ---- */
@media (max-width: 992px) {
    /* Show toggle button */
    .sidebar-toggle-btn {
        display: flex;
    }

    /* Sidebar slides off-screen by default */
    .sidebar {
        position: fixed;
        top: 0;
        inset-inline-start: -280px;
        width: 260px;
        height: 100vh;
        border-radius: 0;
        z-index: 1100;
        transition: inset-inline-start .3s ease;
        overflow-y: auto;
    }

    /* Sidebar open state */
    .sidebar.sidebar-open {
        inset-inline-start: 0;
    }

    /* Overlay active */
    .sidebar-overlay.active {
        display: block;
    }

    /* Main content takes full width */
    .container-main {
        flex-direction: column;
        padding: 16px;
        padding-inline-start: 16px;
        padding-top: 70px; /* space for toggle btn */
    }

    .main-content,
    .container {
        padding: 0;
        width: 100%;
    }

    /* Header stacks vertically */
    .header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 16px;
    }

    .header-insights {
        flex-wrap: wrap;
        gap: 10px;
        margin-inline: 0;
        justify-content: flex-start;
    }

    .insight-item {
        min-width: 120px;
        padding: 8px 12px;
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Stats grid: 2 columns on tablet */
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    /* Filter row wraps */
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }
}

/* ---- Mobile (≤ 768px) ---- */
@media (max-width: 768px) {
    .container-main {
        padding: 12px;
        padding-top: 68px;
    }

    /* Stats: 2 columns still fine */
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 14px 10px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-icon {
        font-size: 1.7rem;
        margin-bottom: 8px;
    }

    /* Table: horizontal scroll */
    .requests-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        padding: 10px 8px;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    /* Filters card */
    .filters-card {
        padding: 16px;
    }

    /* Bootstrap row cols on mobile */
    .filters-card .col-md-3,
    .filters-card .col-md-4,
    .filters-card .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Action buttons stack */
    .request-actions-inline {
        flex-direction: column;
        gap: 6px;
    }

    /* Header logo pill hides on mobile */
    .header-logo-pill {
        display: none;
    }

    /* Insight items smaller */
    .insight-item {
        min-width: 100px;
        padding: 7px 10px;
    }

    .insight-label {
        font-size: 0.72rem;
    }

    /* Service options */
    .service-options-grid {
        grid-template-columns: 1fr;
    }

    /* Summary grid */
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Pagination */
    .pagination-wrapper {
        padding: 12px;
    }

    .pagination-custom .page-link {
        min-width: 34px;
        height: 34px;
        font-size: 0.82rem;
        padding: 0 8px;
    }

    /* Back button */
    .back-button {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
}

/* ---- Small mobile (≤ 576px) ---- */
@media (max-width: 576px) {
    .container-main {
        padding: 10px;
        padding-top: 64px;
    }

    /* Stats: 1 column on very small */
    .stats-cards {
        grid-template-columns: 1fr;
    }

    /* Header actions column */
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions .btn,
    .header-actions .dropdown {
        width: 100%;
    }

    .header-actions .dropdown > button {
        width: 100%;
    }

    /* Table font even smaller */
    .table th,
    .table td {
        font-size: 0.78rem;
        padding: 8px 6px;
    }

    /* Section title */
    .section-title {
        font-size: 1rem;
    }

    /* Employee summary: single column */
    .employee-summary {
        grid-template-columns: 1fr;
    }

    /* Summary grid: single column */
    .summary-grid {
        grid-template-columns: 1fr;
    }

    /* Service block body */
    .service-block-body {
        padding: 14px 16px;
    }

    .service-block-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Attachment item */
    .attachment-item {
        grid-template-columns: 1fr;
    }

    /* Filters buttons */
    .filters-card .d-flex.gap-3 {
        flex-direction: column;
    }

    .filters-card .btn {
        width: 100%;
    }

    /* Pagination: tighter */
    .pagination-custom {
        gap: 3px;
    }

    .pagination-custom .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 0.78rem;
        padding: 0 6px;
    }
}

/* ============================================================
   GLOBAL UTILITY — ensures all pages are responsive
   ============================================================ */

/* All Bootstrap tables get horizontal scroll on mobile */
@media (max-width: 768px) {
    .table-responsive,
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Reports pagination row wraps */
    #reportPagination {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    /* Roles / supervisors / employees Bootstrap row cols */
    .row > .col-md-3,
    .row > .col-md-4,
    .row > .col-md-6,
    .row > .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* But keep 2-col for stat card rows */
    .row.g-3 > .col-md-3,
    .stats-cards .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 576px) {
    /* Single col everything on xs */
    .row > .col-md-3,
    .row > .col-md-4,
    .row > .col-md-6,
    .row > .col-md-8,
    .row.g-3 > .col-md-3,
    .stats-cards .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Prevent card-body overflow */
    .card, .section-card, .filters-card, .requests-table {
        overflow-x: hidden;
    }

    /* Reports export buttons stack */
    .advanced-actions .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}


/* ================================================================
 * GLOBAL TOP BAR
 * Fixed top navigation bar — shared across all authenticated pages
 * ================================================================ */

:root {
    --topbar-height: 62px;
    --topbar-bg:     #0D2F63;        /* Brand Navy */
    --topbar-accent: #2DB85C;        /* Brand Green */
    --topbar-text:   rgba(255,255,255,0.92);
    --topbar-muted:  rgba(255,255,255,0.55);
    --topbar-border: rgba(255,255,255,0.10);
    --topbar-hover:  rgba(255,255,255,0.08);
}

.global-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    /* subtle gradient accent line at bottom */
    border-bottom: 2px solid transparent;
    background-clip: padding-box;
}
.global-topbar::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--topbar-accent), var(--topbar-bg));
}

/* ── Left side ── */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-hamburger {
    display: none;           /* shown only on mobile via media query */
    background: none;
    border: none;
    color: var(--topbar-text);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.topbar-hamburger:hover { background: var(--topbar-hover); }

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.topbar-logo {
    height: 34px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
    filter: brightness(1.05);
}
.topbar-app-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ── Right side ── */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Date widget */
.topbar-widget {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 8px;
    background: var(--topbar-hover);
    border: 1px solid var(--topbar-border);
    margin-inline-end: 6px;
}
.topbar-widget-icon {
    color: var(--topbar-accent);
    font-size: 13px;
}
.topbar-widget-text {
    color: var(--topbar-text);
    font-size: 12.5px;
    white-space: nowrap;
}

/* Generic icon button */
.topbar-icon-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--topbar-text);
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.topbar-icon-btn:hover,
.topbar-icon-btn[aria-expanded="true"] {
    background: var(--topbar-hover);
    color: #fff;
}

/* User button */
.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--topbar-hover);
    border: 1px solid var(--topbar-border);
    border-radius: 10px;
    padding: 6px 12px 6px 6px;
    cursor: pointer;
    color: var(--topbar-text);
    transition: background 0.2s, border-color 0.2s;
}
.topbar-user-btn:hover,
.topbar-user-btn[aria-expanded="true"] {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.22);
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--topbar-accent), #1a8c3f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}
.topbar-user-info { text-align: start; line-height: 1.3; }
.topbar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.topbar-user-role {
    font-size: 11px;
    color: var(--topbar-muted);
    white-space: nowrap;
}
.topbar-caret {
    font-size: 11px;
    color: var(--topbar-muted);
    margin-inline-start: 2px;
    transition: transform 0.25s;
}
.topbar-user-btn[aria-expanded="true"] .topbar-caret {
    transform: rotate(180deg);
}

/* Dropdown menu */
.topbar-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.16);
    padding: 8px;
    min-width: 200px;
    margin-top: 6px !important;
}
.topbar-menu .dropdown-item {
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13.5px;
    transition: background 0.15s;
}
.topbar-menu .dropdown-item.active,
.topbar-menu .dropdown-item:active {
    background: rgba(13,47,99,0.08);
    color: var(--topbar-bg);
}
.topbar-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}
.topbar-menu-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--topbar-accent), #1a8c3f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ── Offset body so content doesn't hide under fixed topbar ── */
body {
    padding-top: var(--topbar-height);
}
.container-main {
    padding-top: 20px;
}
/* Sidebar starts below topbar */
.sidebar {
    top: var(--topbar-height) !important;
    height: calc(100vh - var(--topbar-height)) !important;
}


/* ================================================================
 * PAGE BREADCRUMB BAR  — redesigned
 * ================================================================ */

.bc-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e4e9f0;
}

/* Left group: icon box + text */
.bc-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Coloured icon square */
.bc-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color, #0D2F63), #1a4a9a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(13,47,99,0.22);
}

.bc-title-text { display: flex; flex-direction: column; gap: 4px; }

/* Page title */
.bc-page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color, #0D2F63);
    margin: 0;
    line-height: 1.2;
}

/* Trail */
.bc-trail {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.bc-crumb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: #8a97aa;
}

.bc-link {
    color: #8a97aa;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.18s;
}
.bc-link:hover { color: var(--primary-color, #0D2F63); }
.bc-link i { font-size: 11px; }

.bc-sep {
    color: #c8d0da;
    font-size: 9px;
    line-height: 1;
}
[dir="rtl"] .bc-sep i { transform: rotate(180deg); display: inline-block; }

.bc-crumb--active {
    color: var(--primary-color, #0D2F63);
    font-weight: 600;
}


/* ================================================================
 * RESPONSIVE — mobile adjustments for topbar
 * ================================================================ */

@media (max-width: 992px) {
    .topbar-hamburger { display: flex; }
    .topbar-app-name  { display: none; }
    .topbar-logo      { height: 30px; }

    /* Sidebar now slides in from side; topbar stays fixed */
    .container-main {
        padding-inline-start: 0 !important;
    }
    .sidebar {
        transform: translateX(-110%);
        transition: transform 0.28s ease;
    }
    [dir="rtl"] .sidebar { transform: translateX(110%); }

    .sidebar.sidebar-open { transform: translateX(0) !important; }
}

@media (max-width: 576px) {
    .global-topbar { padding: 0 12px; }
    .topbar-widget  { display: none !important; }
}

/* ── Breadcrumb action button ── */
.bc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--secondary-color, #2DB85C) 0%, #28a84f 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(45, 184, 92, 0.35);
    transition: all 0.3s ease;
    flex-shrink: 0;
    border: none;
}
.bc-action-btn i {
    font-size: 14px;
}
.bc-action-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #28a84f 0%, #239946 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 184, 92, 0.45);
}
.bc-action-btn:active:not(:disabled) {
    transform: translateY(0);
}
.bc-action-btn:disabled, .bc-action-btn.disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.bc-disabled-alert {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    color: #e53e3e;
    font-size: 0.85rem;
    font-weight: 600;
}
.bc-disabled-alert a {
    color: #e53e3e;
    text-decoration: underline;
    font-weight: 700;
}
.bc-disabled-alert a:hover {
    color: #c53030;
}
