/* ========================================
   TFM - Tobacco Free Farm Monitor
   Custom Styles
   ======================================== */

/* Base font */
body {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    background-color: #f4f6f9;
    color: #333;
}

:root { --mc-primary:#0a4fa8; --mc-navy:#051d4d; --mc-accent:#f4c430; }
.card { border-radius: 14px; }
.card-header:first-child { border-radius: 14px 14px 0 0; }
.table > :not(caption) > * > * { padding: .75rem .7rem; vertical-align: middle; }
.table thead th { white-space: nowrap; color:#657087; }
.form-control, .form-select { min-height: 40px; }
.form-control-sm, .form-select-sm { min-height: 34px; }
.btn { min-height: 36px; display:inline-flex; align-items:center; justify-content:center; gap:.25rem; }
.sidebar-backdrop { display:none; position:fixed; inset:0; border:0; background:rgba(5,29,77,.5); z-index:1035; }
.workflow-steps { display:grid; grid-template-columns:repeat(4,1fr); gap:.6rem; margin-bottom:1rem; }
.workflow-step { display:flex; gap:.65rem; align-items:center; padding:.75rem; background:#fff; border:1px solid #e4e9f2; border-radius:12px; color:#6b7588; }
.workflow-step .step-number { width:30px; height:30px; flex:0 0 30px; border-radius:50%; display:grid; place-items:center; background:#edf1f7; font-weight:700; }
.workflow-step strong { display:block; color:#25334d; font-size:.8rem; }
.workflow-step small { font-size:.68rem; }
.workflow-step.is-done { border-color:#a7dfc5; background:#f2fbf7; }
.workflow-step.is-done .step-number { background:#198754; color:#fff; }
.workflow-step.is-current { border-color:#8bb4ed; box-shadow:0 0 0 3px rgba(10,79,168,.08); }
.workflow-step.is-current .step-number { background:var(--mc-primary); color:#fff; }
.clinical-alert { border-left:4px solid #dc3545; background:#fff7f7; border-radius:10px; }
.payment-summary { background:linear-gradient(135deg,var(--mc-navy),var(--mc-primary)); color:#fff; border-radius:12px; padding:1rem; }
.payment-summary .amount { font-size:1.75rem; font-weight:800; letter-spacing:-.04em; }
.quick-amounts { display:grid; grid-template-columns:repeat(3,1fr); gap:.4rem; }
.doctor-avatar { width:46px; height:46px; flex:0 0 46px; display:grid; place-items:center; border-radius:13px; background:linear-gradient(135deg,var(--mc-navy),var(--mc-primary)); color:#fff; font-weight:800; }
.doctor-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:.5rem; }
.doctor-kpis div { background:#f6f8fc; border-radius:10px; padding:.65rem .35rem; text-align:center; }
.doctor-kpis strong, .doctor-kpis small { display:block; }
.doctor-kpis strong { font-size:1.15rem; color:#25334d; }
.doctor-kpis small { color:#7d8799; font-size:.62rem; }
.financial-strip { display:grid; grid-template-columns:repeat(3,1fr); border:1px solid #e7ebf2; border-radius:10px; overflow:hidden; }
.financial-strip div { padding:.7rem; text-align:center; border-right:1px solid #e7ebf2; }
.financial-strip div:last-child { border-right:0; }
.financial-strip small, .financial-strip strong { display:block; }
.financial-strip small { color:#7d8799; font-size:.65rem; }
.doctor-patient-list { max-height:520px; overflow:auto; padding-right:.2rem; }
.patient-work-row { border:1px solid #e8ebf1; border-radius:11px; padding:.8rem; margin-bottom:.65rem; background:#fff; }
.empty-doctor-state { min-height:160px; display:grid; place-content:center; text-align:center; color:#9aa3b2; gap:.6rem; }
.empty-doctor-state i { font-size:1.8rem; }
.min-w-0 { min-width:0; }
.permission-option { display:flex; align-items:center; gap:.65rem; padding:.7rem; border:1px solid #e4e9f2; border-radius:10px; cursor:pointer; height:100%; }
.permission-option:hover { background:#f6f8fc; border-color:#a8bddd; }
.permission-option strong, .permission-option small { display:block; }
.permission-option strong { font-size:.75rem; color:#25334d; }
.permission-option small { font-size:.64rem; color:#8a94a6; }
.channel-picker { display:grid; grid-template-columns:repeat(3,1fr); gap:.6rem; }
.channel-picker label { cursor:pointer; }
.channel-picker input { position:absolute; opacity:0; pointer-events:none; }
.channel-picker span { min-height:96px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.25rem; padding:.7rem; border:2px solid #e5eaf1; border-radius:12px; background:#fff; transition:.15s ease; }
.channel-picker i { font-size:1.35rem; }
.channel-picker strong { font-size:.72rem; }
.channel-picker small { font-size:.6rem; color:#8792a3; }
.channel-picker input:checked + span { border-color:#0a4fa8; background:#f1f6fd; box-shadow:0 0 0 3px rgba(10,79,168,.08); }
.channel-whatsapp i { color:#198754; }.channel-sms i { color:#0a4fa8; }.channel-email i { color:#d97706; }

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    height: 100vh;
    max-height: 100vh;
    background: linear-gradient(180deg, #051d4d 0%, #0a4fa8 50%, #073a80 100%);
    color: #fff;
    width: 240px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: all 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* outer never scrolls; inner nav scrolls */
}

.sidebar .sidebar-brand {
    padding: 0.9rem 1rem 0.75rem;
    background: rgba(0,0,0,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    flex: 0 0 auto;
}

.sidebar .sidebar-brand .fa-2x { font-size: 1.5rem !important; margin-bottom: 0.25rem !important; }

.sidebar .sidebar-brand h4 {
    font-weight: 700;
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.sidebar .sidebar-brand i {
    color: #f4c430;
}

.sidebar .sidebar-brand small {
    opacity: 0.7;
    font-size: 0.7rem;
}

.sidebar .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;            /* critical: lets flex child shrink so overflow can kick in */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.sidebar .sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.sidebar .sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }

.sidebar .sidebar-footer {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar .nav-section {
    padding: 0.6rem 1.1rem 0.25rem;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    opacity: 0.55;
    font-weight: 700;
    color: #cfd9ee;
    list-style: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 0.25rem;
}

.sidebar .nav-item { list-style: none; }

.sidebar .nav-link {
    color: rgba(255,255,255,0.85);
    padding: 0.5rem 0.9rem;
    font-size: 0.83rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    margin: 1px 6px;
    border-left: 3px solid transparent;
    border-radius: 6px;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08);
    border-left-color: transparent;
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, #f4c430 0%, rgba(244,196,48,0.05) 100%);
    color: #051d4d !important;
    font-weight: 700;
    border-left-color: transparent;
    box-shadow: 0 4px 12px rgba(244,196,48,0.25);
}

.sidebar .nav-link.active i { color: #051d4d; opacity: 1; }

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 0.95rem;
    opacity: 0.9;
}

.sidebar .nav-link .fw-semibold {
    font-weight: 600 !important;
}

.sidebar .nav-header {
    padding: 1.2rem 1.25rem 0.5rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.5;
    font-weight: 700;
    color: #fff;
}

.sidebar-add-new .btn-success {
    background: linear-gradient(135deg, #0a4fa8 0%, #1a6fd8 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(10,79,168,0.4);
    transition: all 0.3s ease;
}

.sidebar-add-new .btn-success:hover {
    background: linear-gradient(135deg, #1a6fd8 0%, #3d8ef0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10,79,168,0.5);
}

.sidebar-footer {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    margin-left: 240px;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* ========================================
   Topbar
   ======================================== */
.topbar {
    background: #fff;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar .btn-toggle-sidebar {
    border: none;
    background: #f8f9fa;
    font-size: 1rem;
    color: #555;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    transition: all 0.2s;
}

.topbar .btn-toggle-sidebar:hover {
    background: #e8f0fc;
    color: #0a4fa8;
}

/* ========================================
   Content Area
   ======================================== */
.content-wrapper {
    padding: 1.5rem;
}

/* ========================================
   Stat Cards (Dashboard)
   ======================================== */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Slim modern stat-card variant */
.stat-card-mini {
    background: #fff;
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 4px 14px rgba(13,38,76,0.06);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform .2s ease, box-shadow .2s ease;
    height: 100%;
}

.stat-card-mini:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(13,38,76,0.1);
}

.stat-card-mini .stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

.stat-card-mini .stat-label {
    font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.6px; color: #8a94a6; font-weight: 600;
}

.stat-card-mini .stat-value {
    font-size: 1.65rem; font-weight: 700; color: #1a2b48; line-height: 1;
}

.stat-card-mini .stat-foot { font-size: 0.72rem; color: #8a94a6; margin-top: .35rem; }
.stat-card-mini .trend-up { color: #1abc7b; font-weight: 600; }
.stat-card-mini .trend-down { color: #e85c5c; font-weight: 600; }

/* ========================================
   Table Card
   ======================================== */
.table-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table-card .card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 0.5rem;
}

.btn-success {
    background-color: #0a4fa8;
    border-color: #0a4fa8;
}

.btn-success:hover {
    background-color: #073a80;
    border-color: #073a80;
}

/* ========================================
   Page Header
   ======================================== */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h4 {
    font-weight: 700;
    color: #0a4fa8;
    margin: 0;
}

/* ========================================
   Modals
   ======================================== */
.modal-header {
    background: linear-gradient(135deg, #0a4fa8 0%, #1a6fd8 100%);
    color: #fff;
    border-radius: 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-title {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ========================================
   Forms
   ======================================== */
.form-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.25rem;
}

.form-control,
.form-select {
    font-size: 0.85rem;
    border-radius: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #0a4fa8;
    box-shadow: 0 0 0 0.2rem rgba(10,79,168,0.15);
}

/* ========================================
   Badge
   ======================================== */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
}

/* ========================================
   DataTables Overrides
   ======================================== */
.dataTables_wrapper {
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 0.5rem;
}

table.dataTable {
    font-size: 0.83rem;
}

table.dataTable thead th {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #dee2e6;
}

/* ========================================
   Select2 Overrides
   ======================================== */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    min-height: 38px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-family: 'Montserrat', sans-serif;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding: 0;
    line-height: 1.5;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #ced4da;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: #0a4fa8;
}

/* ========================================
   Login Page
   ======================================== */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #051d4d 0%, #0a4fa8 55%, #1a6fd8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper .login-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-wrapper .login-card .login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-wrapper .login-card .login-logo h3 {
    font-weight: 800;
    color: #0a4fa8;
    margin-bottom: 0.25rem;
}

.login-wrapper .login-card .login-logo p {
    color: #888;
    font-size: 0.85rem;
}

/* ========================================
   Responsive Sidebar
   ======================================== */
.sidebar-collapsed .sidebar {
    margin-left: -260px;
}

.sidebar-collapsed .main-content {
    margin-left: 0;
}

@media (max-width: 768px) {
    .sidebar {
        margin-left: -260px;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-open .sidebar {
        margin-left: 0;
    }
    .sidebar-open .sidebar-backdrop { display:block; }
    .content-wrapper { padding:1rem; }
    .topbar { padding:.65rem .8rem; }
    .topbar-title { max-width:48vw; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .workflow-steps { grid-template-columns:1fr 1fr; }
}

@media (max-width: 480px) {
    .workflow-steps { grid-template-columns:1fr; }
    .content-wrapper { padding:.75rem; }
}

/* ========================================
   Animations
   ======================================== */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   SweetAlert2 Custom
   ======================================== */
.swal2-popup {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.9rem !important;
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 3px;
}

/* ══════════════════════════════════════
   Dashboard Redesign
   ══════════════════════════════════════ */
.dash-banner {
    position: relative;
    background: linear-gradient(135deg, #051d4d 0%, #0a4fa8 50%, #1a6fd8 100%);
    border-radius: 16px;
    padding: 1.25rem 2rem;
    overflow: hidden;
    color: #fff;
}
.dash-banner h3 {
    font-size: 1.35rem;
}
.dash-banner p {
    font-size: 0.85rem;
}
.dash-banner-overlay {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM36 6V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.dash-banner-content { position: relative; z-index: 1; }
.dash-search-box {
    position: relative;
    max-width: 420px;
}
.dash-search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    z-index: 2;
}
.dash-search-box .form-control {
    padding-left: 38px;
    border-radius: 50px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    backdrop-filter: blur(4px);
}
.dash-search-box .form-control::placeholder { color: rgba(255,255,255,0.6); }
.dash-search-box .form-control:focus {
    background: rgba(255,255,255,0.25);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
    color: #fff;
}

/* Module Summary Cards */
.dash-module-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.25s, box-shadow 0.25s;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: none !important;
    position: relative;
}
.dash-module-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}
.dash-module-card .card-decor-img {
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
    pointer-events: none;
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
}
.dash-module-header {
    padding: 0.85rem 1.2rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    border-radius: 18px 18px 0 0;
    position: relative;
    z-index: 2;
}
.dash-module-header i {
    font-size: 1rem;
}
.dash-module-header span {
    font-weight: 700 !important;
    letter-spacing: 0.3px;
}
/* Vibrant colored headers */
.dash-module-card.card-registry .dash-module-header {
    background: linear-gradient(135deg, #0a4fa8 0%, #1a6fd8 100%);
    color: #fff;
}
.dash-module-card.card-registry .dash-module-header i,
.dash-module-card.card-registry .dash-module-header span { color: #fff !important; }
.dash-module-card.card-ffs .dash-module-header {
    background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
    color: #fff;
}
.dash-module-card.card-ffs .dash-module-header i,
.dash-module-card.card-ffs .dash-module-header span { color: #fff !important; }
.dash-module-card.card-vsla .dash-module-header {
    background: linear-gradient(135deg, #d4a017 0%, #f4c430 100%);
    color: #fff;
}
.dash-module-card.card-vsla .dash-module-header i,
.dash-module-card.card-vsla .dash-module-header span { color: #fff !important; }
.dash-module-card.card-marketplace .dash-module-header {
    background: linear-gradient(135deg, #bc6c25 0%, #e09f3e 100%);
    color: #fff;
}
.dash-module-card.card-marketplace .dash-module-header i,
.dash-module-card.card-marketplace .dash-module-header span { color: #fff !important; }

.dash-module-body { 
    padding: 1rem 1.2rem; 
    flex: 1; 
    position: relative;
    z-index: 2;
    background: linear-gradient(to right, rgba(255,255,255,0.95) 50%, rgba(255,255,255,0.7) 100%);
}
.dash-module-stat {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0;
}
.dash-module-stat i { 
    width: 22px; 
    text-align: center; 
    font-size: 0.95rem;
}
.dash-stat-number { 
    font-weight: 800; 
    font-size: 1.15rem; 
    color: #0a4fa8;
    letter-spacing: -0.5px;
}
.dash-stat-text { 
    font-size: 0.78rem; 
    color: #555;
    font-weight: 500;
}
.dash-module-footer {
    padding: 0.65rem 1.2rem;
    border-top: 1px solid #eee;
    font-size: 0.82rem;
    position: relative;
    z-index: 2;
    background: #fff;
}
.dash-module-footer a { 
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}
.dash-module-footer a:hover { text-decoration: underline !important; }

/* KPI Cards */
.dash-kpi-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.2rem 1.4rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}
.dash-kpi-card:hover { transform: translateY(-3px); }
.dash-kpi-value { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.dash-kpi-label { font-size: 0.75rem; color: #6c757d; margin-top: 2px; font-weight: 500; }
.dash-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Chart Cards */
.dash-chart-card {
    border-radius: 18px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}
.dash-chart-card .card-header {
    border-bottom: 1px solid #f5f5f5;
    padding: 1rem 1.2rem;
    background: #fff;
}
.dash-chart-card .card-header h6 {
    font-weight: 700 !important;
}

/* List Cards */
.dash-list-card {
    border-radius: 18px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}
.dash-list-card .card-header {
    border-bottom: 1px solid #f5f5f5;
    padding: 1rem 1.2rem;
    background: #fff;
}
.dash-list-card .card-header h6 {
    font-weight: 700 !important;
}
.dash-list-card .list-group-item {
    border-color: #f8f8f8;
    transition: background 0.15s;
}
.dash-list-card .list-group-item:hover { background: #f8fdf9; }

/* Avatar */
.dash-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
}

/* Quick Actions */
.dash-quick-action {
    background: #f8f9fa;
    transition: all 0.2s;
    color: #333;
    border: 1px solid transparent;
}
.dash-quick-action:hover {
    background: #e8f0fc;
    border-color: #c5d8f8;
    color: #0a4fa8;
    transform: translateY(-2px);
}

/* Card Decorative Image */
.card-decor-img {
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    pointer-events: none;
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
}

/* Bold Stat Text */
.dash-stat-text strong {
    font-weight: 700;
    color: #333;
}

/* Background opacity utilities */
.bg-opacity-15 {
    --bs-bg-opacity: 0.15;
}

/* MEDI-CARE OVERRIDES (sidebar polish + dashboard widgets) */
.sidebar .sidebar-brand {
    padding: 1.5rem 1rem 1.25rem;
    background: rgba(0,0,0,0.18);
}
.sidebar .sidebar-brand i { color: #f4c430; }

/* Section labels (template uses .nav-section) */
.sidebar .nav-section {
    padding: 1.1rem 1.5rem 0.4rem;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    opacity: 0.55;
    font-weight: 700;
    color: #cfd9ee;
    list-style: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 0.4rem;
}

.sidebar .nav-item { list-style: none; }

.sidebar .nav-link {
    border-radius: 0;
    margin: 2px 8px;
    border-left: 3px solid transparent;
    border-radius: 8px;
}
.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08);
    border-left-color: transparent;
    transform: translateX(2px);
}
.sidebar .nav-link.active {
    background: linear-gradient(90deg, #f4c430 0%, rgba(244,196,48,0.05) 100%);
    color: #051d4d !important;
    font-weight: 700;
    border-left-color: transparent;
    box-shadow: 0 4px 12px rgba(244,196,48,0.25);
}
.sidebar .nav-link.active i { color: #051d4d; opacity: 1; }

.topbar-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #344767;
}
.topbar-right { margin-left: auto; }
.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a4fa8, #20c997);
    color: #fff;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-weight: 700;
}

/* Dashboard fade-in */
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity:0; transform: translateY(6px);} to {opacity:1; transform:none;} }

/* Soft color backgrounds for stat icons */
.bg-primary-soft   { background: rgba(13,110,253,.12); }
.bg-success-soft   { background: rgba(25,135,84,.12); }
.bg-info-soft      { background: rgba(13,202,240,.14); }
.bg-warning-soft   { background: rgba(255,193,7,.16); }
.bg-danger-soft    { background: rgba(220,53,69,.12); }
.bg-secondary-soft { background: rgba(108,117,125,.12); }

/* ========================================
   Quick Add Modal Button
   ======================================== */
.sidebar-add-new {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Enhanced Module Header Labels */
.dash-module-header .fw-bold,
.dash-module-header span {
    font-weight: 700 !important;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

/* Quick Add Modal Items */
.quick-add-item {
    border: 2px solid transparent;
}
.quick-add-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: currentColor;
}

/* Enhanced Sidebar Profile */
.sidebar-profile {
    background: rgba(0,0,0,0.1);
}

/* Better list item styling */
.list-group-item.border-0:hover {
    background: rgba(10,79,168,0.05) !important;
}

/* Badge improvements */
.badge.rounded-pill {
    font-weight: 600;
}

/* Progress bar styling */
.progress {
    background: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Card header improvements */
.card-header.border-0 {
    border-bottom: 1px solid #f5f5f5 !important;
}

/* Dashboard search in banner */
.dash-search-box .form-control {
    height: 45px;
    font-size: 0.9rem;
}

/* Partner Logos in Sidebar */
.sidebar-logos {
    min-height: 50px;
}

.sidebar-logos .partner-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-logos .partner-logo-item:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar-logos .partner-logo-item img {
    transition: opacity 0.2s ease;
}

.sidebar-logos .partner-logo-item:hover img {
    opacity: 1 !important;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .dash-module-card .card-decor-img {
        width: 35%;
        opacity: 0.15;
    }
}

@media (max-width: 767.98px) {
    .dash-module-card .card-decor-img {
        display: none;
    }
    
    .sidebar-logos {
        flex-wrap: wrap;
    }
    
    .sidebar-logos img {
        height: 22px !important;
    }
}
