/* ==========================================================================
   Agape Real Solutions - Client Portal Brand Overlay (v1.1)
   Overrides Perfex CRM default Bootstrap and Tailwind styles
   ========================================================================== */

/* 1. Global Background & Typography */
body.customers {
    background-color: #F1F5F9 !important; /* Tailwind Slate-100 for better contrast */
    font-family: 'Inter', sans-serif !important;
    color: #334155 !important;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.panel-title,
.tw-font-bold, .tw-font-semibold {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    color: #0F172A !important;
}

a {
    color: #C8A24E;
    transition: all 0.2s ease;
}

a:hover, a:focus {
    color: #a6843c;
    text-decoration: none;
}

/* 2. Header / Navigation */
.navbar.navbar-default.header {
    background-color: #FFFFFF !important;
    border: none !important;
    border-bottom: 1px solid #E2E8F0 !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04) !important;
    padding: 10px 0;
    margin-bottom: 40px !important;
}

.navbar-default .navbar-nav > li > a {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #475569 !important;
    text-transform: none !important;
    letter-spacing: 0;
    padding: 15px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.navbar-default .navbar-nav > li > a:hover {
    color: #C8A24E !important;
    background-color: #F8FAFC !important;
}

.navbar-default .navbar-nav > li.active > a,
.navbar-default .navbar-nav > li.active > a:focus,
.navbar-default .navbar-nav > li.active > a:hover {
    color: #C8A24E !important;
    background-color: transparent !important;
    position: relative;
}

.navbar-default .navbar-nav > li.active > a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background-color: #C8A24E;
    border-radius: 3px;
}

/* 3. Cards & Panels */
.panel_s {
    background-color: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
    margin-bottom: 30px;
}

.panel_s > .panel-body {
    padding: 30px !important;
    background: transparent !important;
}

.panel_s > .panel-heading {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #F1F5F9 !important;
    padding: 24px 30px !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 20px !important;
}

/* 4. Project Summary Blocks (Overriding Tailwind utilities) */
/* The specific Tailwind classes used by Perfex summary blocks */
.tw-border.tw-border-solid.tw-border-neutral-200.tw-rounded-md {
    background-color: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 5px !important;
}

.tw-border.tw-border-solid.tw-border-neutral-200.tw-rounded-md:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.06) !important;
    border-color: #CBD5E1 !important;
}

/* Make the summary digits pop */
.tw-text-primary-600 {
    font-family: 'Outfit', sans-serif !important;
    font-size: 24px !important;
    font-weight: 800 !important;
}

/* 5. Tables */
.table {
    background-color: transparent !important;
}

.table-responsive {
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02) !important;
}

.table > thead > tr > th {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    color: #64748B !important;
    border-bottom: 2px solid #E2E8F0 !important;
    background-color: #F8FAFC !important;
    padding: 18px 20px !important;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.table > tbody > tr > td {
    padding: 18px 20px !important;
    border-bottom: 1px solid #F1F5F9 !important;
    color: #334155 !important;
    vertical-align: middle !important;
    font-weight: 500 !important;
}

.table-hover > tbody > tr:hover {
    background-color: #F8FAFC !important;
}

/* DataTables styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    font-weight: 600 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #C8A24E !important;
    color: #FFFFFF !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(200, 162, 78, 0.3) !important;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #E2E8F0 !important;
    border-radius: 10px !important;
    padding: 8px 16px !important;
    font-family: 'Inter', sans-serif !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #C8A24E !important;
    box-shadow: 0 0 0 3px rgba(200, 162, 78, 0.1) !important;
    outline: none !important;
}

/* 6. Buttons */
.btn {
    border-radius: 10px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    transition: all 0.2s ease !important;
    text-transform: none !important;
    border: none !important;
}

.btn-primary, .btn-info {
    background-color: #0F172A !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2) !important;
}

.btn-primary:hover, .btn-info:hover {
    background-color: #1E293B !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.3) !important;
}

.btn-success {
    background-color: #10B981 !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2) !important;
}

.btn-success:hover {
    background-color: #059669 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3) !important;
}

.btn-default {
    background-color: #FFFFFF !important;
    color: #475569 !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02) !important;
}

.btn-default:hover {
    background-color: #F8FAFC !important;
    color: #0F172A !important;
    border-color: #CBD5E1 !important;
    transform: translateY(-1px) !important;
}

/* =========================================================
   Project Details & Dashboard Layout
   ========================================================= */

.project-header {
    background: var(--surface);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.project-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, var(--gold-light) 100%);
    opacity: 0.5;
    pointer-events: none;
}

.header-left { display: flex; flex-direction: column; gap: 16px; }

.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 700;
    background: var(--info-light); color: var(--info); width: fit-content;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.project-title { font-size: 36px; font-weight: 800; line-height: 1.2; margin:0;}
.project-meta { display: flex; gap: 24px; color: var(--text-tertiary); font-size: 14px; font-weight: 500; }
.meta-item { display: flex; align-items: center; gap: 8px; }
.meta-item i { color: var(--gold); }
.header-right { display: flex; gap: 12px; z-index: 1; }

.tabs-wrapper {
    background: var(--surface); border-radius: 16px; padding: 8px; margin-bottom: 30px;
    display: flex; gap: 8px; border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02); overflow-x: auto;
}
.tab {
    padding: 12px 24px; border-radius: 12px; font-weight: 600; font-size: 14px;
    color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none !important;
}
.tab:hover { background: var(--bg-color); color: var(--text-primary); text-decoration: none; }
.tab.active { background: var(--text-primary); color: white; text-decoration: none; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } .project-header { flex-direction: column; gap: 24px; } }

.card-custom {
    background: var(--surface); border-radius: 24px; padding: 32px;
    border: 1px solid var(--border-color); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03); height: 100%;
}
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 24px; display: flex; align-items: center; gap: 12px; }
.card-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: var(--bg-color); border-radius: 8px; color: var(--text-primary); }

.progress-metrics { display: flex; flex-direction: column; gap: 30px; }
.metric-group { display: flex; flex-direction: column; gap: 12px; }
.metric-header { display: flex; justify-content: space-between; align-items: flex-end; }
.metric-label { font-weight: 600; color: var(--text-primary); }
.metric-value { font-family: 'Outfit', sans-serif; font-size: 24px; font-weight: 800; color: var(--gold); }
.progress-bar-bg { width: 100%; height: 8px; background: var(--bg-color); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold) 0%, #E6C26E 100%); border-radius: 4px; position: relative; }
.progress-bar-fill.success { background: linear-gradient(90deg, var(--success) 0%, #34D399 100%); }

.detail-list { display: flex; flex-direction: column; gap: 20px; }
.detail-item { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.detail-item:last-child { border-bottom: none; padding-bottom: 0; }
.detail-label { font-size: 14px; color: var(--text-tertiary); font-weight: 500; }
.detail-value { font-size: 15px; color: var(--text-primary); font-weight: 600; }

.badge-list { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-custom { padding: 6px 12px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.badge-custom i { color: var(--gold); }

.description-content { font-size: 15px; line-height: 1.6; color: var(--text-secondary); }

/* =========================================================
   DataTables Custom Styling
   ========================================================= */
.dataTables_wrapper { padding: 0; }
.dataTables_length, .dataTables_info, .dataTables_paginate { padding: 15px 30px; font-size: 13px; color: var(--text-secondary); }
table.dataTable { width: 100% !important; border-collapse: collapse !important; margin: 0 !important; border-radius: 20px 20px 0 0; overflow: hidden; }
table.dataTable thead th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background-color: #F8FAFC !important;
    padding: 16px 30px !important;
    text-align: left;
    border-bottom: 2px solid var(--border-color) !important;
}
table.dataTable tbody td {
    padding: 20px 30px !important;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    vertical-align: middle;
}
table.dataTable tbody tr:hover td { background-color: #F8FAFC !important; }

/* Improve Card Contrasts on individual project page */
.customers_area_project #wrapper { background-color: var(--bg-color) !important; }
.card-custom {
    border: 1px solid #CBD5E1 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06) !important;
}

/* Custom Search Bar wrapper in datatables */
.dataTables_filter label { font-size: 0; }
.dataTables_filter input {
    font-size: 14px;
    width: 250px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    margin-bottom: 10px;
    margin-right: 15px;
}
.dataTables_filter input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 162, 78, 0.1);
}

/* =========================================================
   Projects Summary Grid
   ========================================================= */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none !important;
}

.summary-card.active-summary {
    border-color: var(--gold);
    box-shadow: 0 8px 25px rgba(200, 162, 78, 0.15);
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    border-color: #CBD5E1;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-count {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}


/* =========================================================================
   SIDEBAR CONVERSION & DROPDOWN FIXES (ADMIN STYLE)
   ========================================================================= */

/* Fix Bootstrap Select Visibility */
.bootstrap-select .dropdown-menu {
    background-color: #fff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.bootstrap-select .dropdown-menu li a,
.bootstrap-select .dropdown-menu li a span.text {
    color: #1e293b !important;
}

.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li.active a,
.bootstrap-select .dropdown-menu li.selected a {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.bootstrap-select .btn.dropdown-toggle {
    background-color: #fff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

.bootstrap-select .btn.dropdown-toggle,
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.project-title { font-size: 36px; font-weight: 800; line-height: 1.2; margin:0;}
.project-meta { display: flex; gap: 24px; color: var(--text-tertiary); font-size: 14px; font-weight: 500; }
.meta-item { display: flex; align-items: center; gap: 8px; }
.meta-item i { color: var(--gold); }
.header-right { display: flex; gap: 12px; z-index: 1; }

.tabs-wrapper {
    background: var(--surface); border-radius: 16px; padding: 8px; margin-bottom: 30px;
    display: flex; gap: 8px; border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02); overflow-x: auto;
}
.tab {
    padding: 12px 24px; border-radius: 12px; font-weight: 600; font-size: 14px;
    color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none !important;
}
.tab:hover { background: var(--bg-color); color: var(--text-primary); text-decoration: none; }
.tab.active { background: var(--text-primary); color: white; text-decoration: none; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } .project-header { flex-direction: column; gap: 24px; } }

.card-custom {
    background: var(--surface); border-radius: 24px; padding: 32px;
    border: 1px solid var(--border-color); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03); height: 100%;
}
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 24px; display: flex; align-items: center; gap: 12px; }
.card-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: var(--bg-color); border-radius: 8px; color: var(--text-primary); }

.progress-metrics { display: flex; flex-direction: column; gap: 30px; }
.metric-group { display: flex; flex-direction: column; gap: 12px; }
.metric-header { display: flex; justify-content: space-between; align-items: flex-end; }
.metric-label { font-weight: 600; color: var(--text-primary); }
.metric-value { font-family: 'Outfit', sans-serif; font-size: 24px; font-weight: 800; color: var(--gold); }
.progress-bar-bg { width: 100%; height: 8px; background: var(--bg-color); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold) 0%, #E6C26E 100%); border-radius: 4px; position: relative; }
.progress-bar-fill.success { background: linear-gradient(90deg, var(--success) 0%, #34D399 100%); }

.detail-list { display: flex; flex-direction: column; gap: 20px; }
.detail-item { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.detail-item:last-child { border-bottom: none; padding-bottom: 0; }
.detail-label { font-size: 14px; color: var(--text-tertiary); font-weight: 500; }
.detail-value { font-size: 15px; color: var(--text-primary); font-weight: 600; }

.badge-list { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-custom { padding: 6px 12px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.badge-custom i { color: var(--gold); }

.description-content { font-size: 15px; line-height: 1.6; color: var(--text-secondary); }

/* =========================================================
   DataTables Custom Styling
   ========================================================= */
.dataTables_wrapper { padding: 0; }
.dataTables_length, .dataTables_info, .dataTables_paginate { padding: 15px 30px; font-size: 13px; color: var(--text-secondary); }
table.dataTable { width: 100% !important; border-collapse: collapse !important; margin: 0 !important; border-radius: 20px 20px 0 0; overflow: hidden; }
table.dataTable thead th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background-color: #F8FAFC !important;
    padding: 16px 30px !important;
    text-align: left;
    border-bottom: 2px solid var(--border-color) !important;
}
table.dataTable tbody td {
    padding: 20px 30px !important;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    vertical-align: middle;
}
table.dataTable tbody tr:hover td { background-color: #F8FAFC !important; }

/* Improve Card Contrasts on individual project page */
.customers_area_project #wrapper { background-color: var(--bg-color) !important; }
.card-custom {
    border: 1px solid #CBD5E1 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06) !important;
}

/* Custom Search Bar wrapper in datatables */
.dataTables_filter label { font-size: 0; }
.dataTables_filter input {
    font-size: 14px;
    width: 250px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    margin-bottom: 10px;
    margin-right: 15px;
}
.dataTables_filter input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 162, 78, 0.1);
}

/* =========================================================
   Projects Summary Grid
   ========================================================= */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none !important;
}

.summary-card.active-summary {
    border-color: var(--gold);
    box-shadow: 0 8px 25px rgba(200, 162, 78, 0.15);
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    border-color: #CBD5E1;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-count {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}


/* =========================================================================
   SIDEBAR CONVERSION & DROPDOWN FIXES (ADMIN STYLE)
   ========================================================================= */

/* Fix Bootstrap Select Visibility */
.bootstrap-select .dropdown-menu {
    background-color: #fff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.bootstrap-select .dropdown-menu li a,
.bootstrap-select .dropdown-menu li a span.text {
    color: #1e293b !important;
}

.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li.active a,
.bootstrap-select .dropdown-menu li.selected a {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.bootstrap-select .btn.dropdown-toggle {
    background-color: #fff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    height: auto !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
}

.bootstrap-select .btn.dropdown-toggle,
.bootstrap-select .btn.dropdown-toggle .filter-option-inner-inner,
.bootstrap-select .btn.dropdown-toggle .filter-option {
    color: #1e293b !important;
}

/* Premium Dark Sidebar Layout (Globalized) */
:root{
  --bg:#f5f6fa;--white:#fff;--border:#e9ebf0;--border-lt:#f0f1f5;
  --t1:#111827;--t2:#374151;--t3:#6b7280;--t4:#9ca3af;--t5:#c4c9d4;
  --gold:#c8a24e;--gold-dk:#a67f28;--gold-lt:rgba(200,162,78,.08);
  --blue:#4f7df5;--green:#16a76e;--purple:#7c5cfc;--orange:#e88c30;--red:#e5534b;--cyan:#0ea5c2;
  --f:'Plus Jakarta Sans','Inter',-apple-system,sans-serif;
  --r:14px;--rl:20px;--rx:24px;--sw:260px;
}

/* ═══ SIDEBAR ═══ */
.ag-sb{width:var(--sw);position:fixed;top:0;left:0;bottom:0;z-index:1000;
  background:#0f1117;display:flex;flex-direction:column;overflow-y:auto;font-family:var(--f)}
.ag-sb::-webkit-scrollbar{width:4px}
.ag-sb::-webkit-scrollbar-thumb{background:rgba(255,255,255,.1);border-radius:4px}
.ag-sb-brand{padding:22px 20px 18px;display:flex;align-items:center;gap:11px;border-bottom:1px solid rgba(255,255,255,.06)}
.ag-sb-logo{width:36px;height:36px;background:linear-gradient(135deg,var(--gold),#e8c45a);border-radius:10px;
  display:flex;align-items:center;justify-content:center;font-weight:900;font-size:1.05rem;color:#0a0b10;font-family:var(--f)}
.ag-sb-brand span{color:#fff;font-weight:800;font-size:1.15rem;letter-spacing:-.02em}
.ag-sb-sec{padding:16px 14px 6px}
.ag-sb-lbl{font-size:.7rem;font-weight:700;color:rgba(255,255,255,.2);text-transform:uppercase;letter-spacing:.08em;padding:0 10px;margin-bottom:6px}
.ag-sb-nav{list-style:none;display:flex;flex-direction:column;gap:2px;margin:0;padding:0}
.ag-sb-nav a{display:flex;align-items:center;gap:11px;padding:9px 12px;border-radius:9px;font-size:.88rem;font-weight:500;
  color:rgba(255,255,255,.45);transition:all .2s;text-decoration:none;position:relative}
.ag-sb-nav a:hover{background:rgba(255,255,255,.06);color:rgba(255,255,255,.75);text-decoration:none}
.ag-sb-nav a.active{background:rgba(200,162,78,.1);color:var(--gold);font-weight:600}
.ag-sb-nav a.active::before{content:'';position:absolute;left:0;top:50%;transform:translateY(-50%);
  width:3px;height:18px;background:var(--gold);border-radius:0 3px 3px 0}
.ag-sb-nav a i{width:18px;text-align:center;font-size:.85rem}
.ag-sb-bot{margin-top:auto;padding:16px;border-top:1px solid rgba(255,255,255,.06)}
.ag-sb-usr{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:10px;text-decoration:none;}
.ag-sb-usr:hover { background: rgba(255,255,255,.03); text-decoration: none; }
.ag-sb-av{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--purple),var(--blue));
  display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:.78rem;flex-shrink:0}
.ag-sb-uname{color:rgba(255,255,255,.85);font-weight:600;font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ag-sb-urole{color:rgba(255,255,255,.3);font-size:.7rem;font-weight:500}

/* Global Navigation Override */
.navbar.header, .customer-top-submenu, .footer, #footer { display: none !important; }

/* Global Wrapper Adjustments for Sidebar */
@media (min-width: 769px) {
    #wrapper {
        margin-left: var(--sw) !important;
        padding-top: 30px !important; 
    }
}
@media(max-width:768px){
    #wrapper{margin-left:0 !important; padding-top: 60px !important;}
    
    /* Hide sidebar by default, show via class */
    .ag-sb { 
        transform: translateX(-100%); 
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px !important; /* Slightly wider on mobile for touch targets */
    }
    .ag-sb.mobile-open {
        transform: translateX(0) !important;
        display: flex !important;
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }
    
    /* Close button inside sidebar */
    .ag-sb-close {
        display: flex !important;
        background: rgba(255,255,255,0.1);
        border: none;
        color: #fff;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        cursor: pointer;
    }
    
    /* Mobile Header */
    .ag-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 60px;
        background: #ffffff;
        padding: 0 16px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 900;
        box-shadow: 0 1px 10px rgba(0,0,0,0.05);
        border-bottom: 1px solid var(--border);
    }
    
    .ag-mobile-btn {
        background: none;
        border: none;
        color: #64748b;
        font-size: 20px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
    }
    
    .ag-mobile-logo {
        font-family: var(--f);
        font-size: 1.15rem;
        font-weight: 800;
        color: var(--t1);
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .ag-logo-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        background: linear-gradient(135deg,var(--gold),#e8c45a);
        color: #0a0b10;
        border-radius: 6px;
        font-weight: 900;
        font-size: 0.9rem;
    }
    
    /* Overlay */
    .ag-sb-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .ag-sb-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
}
