/* Fast Aides — Bootstrap 5 Custom Overrides */
:root {
    --fa-red:      #8B0000;
    --fa-red-dk:   #6a0000;
    --sidebar-bg:  #1A1A2E;
    --sidebar-act: #2A2A4A;
    --sidebar-w:   240px;
    --header-h:    60px;
}

/* ── GLOBAL ── */
body { font-size: 13px; background: #f5f5f5; }

/* ── SIDEBAR SUBMENU ── */
.sidebar-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height .3s ease;
}
.sidebar-submenu.open { max-height: 200px; }
.sidebar-submenu .sub-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 46px;
    color: rgba(255,255,255,.5);
    text-decoration: none;
    font-size: 12px;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar-submenu .sub-link:hover { color: #fff; background: rgba(255,255,255,.04); }
.sidebar-submenu .sub-link.active {
    color: #fff;
    background: var(--sidebar-act);
    border-left-color: var(--fa-red);
    font-weight: 600;
}
.sidebar-parent { position: relative; }
.sidebar-parent .nav-link .chevron {
    margin-left: auto;
    font-size: 11px;
    transition: transform .25s;
    flex-shrink: 0;
}
.sidebar-parent.open .nav-link .chevron { transform: rotate(90deg); }
.sidebar-parent .nav-link.parent-active {
    color: #fff;
    background: var(--sidebar-act);
    border-left-color: var(--fa-red);
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    transition: width .25s;
}
.sidebar-brand {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand h2 { color: var(--fa-red); font-size: 18px; font-weight: 900; letter-spacing: 1px; margin: 0; }
.sidebar-brand small { color: rgba(255,255,255,.45); font-style: italic; font-size: 11px; }

.sidebar-nav { flex: 1; padding: 10px 0; }
.sidebar-nav .nav-link {
    color: rgba(255,255,255,.6);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: all .15s;
    text-decoration: none;
}
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--sidebar-act);
    border-left-color: var(--fa-red);
    font-weight: 600;
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; font-size: 14px; }

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
}

/* ── MAIN AREA ── */
.main-area {
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── TOP HEADER ── */
.top-header {
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.top-header .page-title-h { font-size: 15px; font-weight: 700; margin: 0; }
.top-header .page-sub     { font-size: 11px; color: #6c757d; margin: 0; }

/* ── PAGE BODY ── */
.page-content { padding: 24px; flex: 1; }

/* ── BOOTSTRAP OVERRIDES ── */
/* Primary brand color */
.btn-primary, .btn-primary:hover { background-color: var(--fa-red); border-color: var(--fa-red); }
.btn-primary:focus  { box-shadow: 0 0 0 .2rem rgba(139,0,0,.3); }
.btn-outline-primary { color: var(--fa-red); border-color: var(--fa-red); }
.btn-outline-primary:hover { background: var(--fa-red); color: #fff; border-color: var(--fa-red); }
.text-primary { color: var(--fa-red) !important; }
.bg-primary   { background-color: var(--fa-red) !important; }
.border-primary { border-color: var(--fa-red) !important; }
.badge.bg-primary { background-color: var(--fa-red) !important; }

/* Nav tabs active */
.nav-tabs .nav-link.active { color: var(--fa-red); border-bottom-color: var(--fa-red); font-weight: 600; }
.nav-tabs .nav-link { color: #6c757d; }

/* Cards */
.card { border: none; box-shadow: 0 2px 8px rgba(0,0,0,.07); border-radius: 10px; }
.card-header { background: #fff; border-bottom: 1px solid #f0f0f0; border-radius: 10px 10px 0 0 !important; font-weight: 700; }

/* Stat cards (legacy) */
.stat-card { border-radius: 10px; border-left: 4px solid; }
.stat-card .stat-val { font-size: 26px; font-weight: 800; }
.stat-card .stat-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

/* Dashboard table rows */
table.dataTable thead th { background: #fafafa; }
table.dataTable tbody td { padding: 12px 16px; }

/* DataTables Bootstrap 5 tweaks */
div.dataTables_wrapper div.dataTables_length select { width: auto; display: inline-block; }
div.dataTables_wrapper div.dataTables_filter input  { width: auto; display: inline-block; }
table.dataTable thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: #6c757d; font-weight: 700; background: #f8f9fa; }
table.dataTable tbody td { font-size: 12px; vertical-align: middle; }
table.dataTable tbody tr:hover { background: #fafafa !important; }

/* Filter tab pills */
.filter-pill { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1.5px solid #dee2e6; background: #fff; color: #6c757d; text-decoration: none; transition: all .15s; }
.filter-pill.active, .filter-pill:hover { background: var(--fa-red); color: #fff; border-color: var(--fa-red); }

/* Bell badge */
.bell-wrap { position: relative; cursor: pointer; color: #6c757d; font-size: 18px; }
.bell-wrap .bell-badge { position: absolute; top: -5px; right: -6px; background: #dc3545; color: #fff; border-radius: 50%; width: 15px; height: 15px; font-size: 9px; display: flex; align-items: center; justify-content: center; }

/* Avatar */
.admin-avatar { width: 34px; height: 34px; background: var(--fa-red); border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* LOGIN */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1A1A2E, #8B0000); }
.login-card  { background: #fff; border-radius: 14px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-brand h1 { color: var(--fa-red); font-size: 28px; font-weight: 900; letter-spacing: 1px; }
.login-brand .brand-line { height: 2px; width: 60px; background: var(--fa-red); margin: 10px auto; }

/* Executive cards */
.exec-card { border-radius: 10px; }
.exec-avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 700; flex-shrink: 0; }

/* Sidebar footer logout btn */
.sidebar-logout { background: none; border: none; color: rgba(255,255,255,.45); font-size: 12px; display: flex; align-items: center; gap: 8px; padding: 0; width: 100%; cursor: pointer; transition: color .15s; }
.sidebar-logout:hover { color: #fff; }

/* Map placeholder */
.map-placeholder { background: #e8edf0; border-radius: 10px 0 0 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 500px; color: #6c757d; }

/* Split panel scroll */
.panel-scroll { max-height: 560px; overflow-y: auto; }

/* ── PROFILE / DOCUMENT UPLOAD ── */
.avatar-upload-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.avatar-upload-wrap img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid #dee2e6; }
.avatar-placeholder { width: 120px; height: 120px; border-radius: 50%; background: #e9ecef; display: flex; align-items: center; justify-content: center; color: #adb5bd; font-size: 40px; border: 3px dashed #dee2e6; }
.avatar-upload-btn { position: absolute; bottom: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; background: var(--fa-red); color: #fff; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; }

.doc-upload-card { border: 2px dashed #dee2e6; border-radius: 10px; padding: 20px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.doc-upload-card:hover { border-color: var(--fa-red); background: #fdf5f5; }
.doc-upload-card.has-file { border-style: solid; border-color: #28A745; background: #f0fff4; }
.doc-upload-card .doc-icon { font-size: 32px; color: #adb5bd; margin-bottom: 8px; }
.doc-upload-card.has-file .doc-icon { color: #28A745; }
.doc-preview-img { width: 100%; max-height: 140px; object-fit: cover; border-radius: 6px; margin-top: 8px; }

/* Profile show page */
.partner-avatar { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.partner-avatar-placeholder { width: 110px; height: 110px; border-radius: 50%; background: var(--fa-red); color: #fff; font-size: 38px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 4px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.info-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #6c757d; font-weight: 700; }
.info-value { font-size: 13px; font-weight: 600; color: #333; }
.doc-thumb { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid #dee2e6; }
.doc-pdf-thumb { width: 100%; height: 120px; border-radius: 8px; border: 1px solid #dee2e6; background: #f8f9fa; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #6c757d; }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 58px; }
    .sidebar-brand h2, .sidebar-brand small, .sidebar-nav .nav-link span, .sidebar-footer span { display: none; }
    .main-area { margin-left: 58px; }
}

/* ── TOAST ── */
#toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; min-width: 300px; }
.fa-toast { position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; background: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.14); padding: 14px 16px; border-left: 4px solid; opacity: 0; transform: translateX(40px); transition: opacity .3s, transform .3s; pointer-events: auto; }
.fa-toast.show { opacity: 1; transform: translateX(0); }
.fa-toast.hide { opacity: 0; transform: translateX(40px); }
.fa-toast.toast-success { border-color: #28A745; }
.fa-toast.toast-danger  { border-color: #DC3545; }
.fa-toast.toast-warning { border-color: #FD7E14; }
.fa-toast.toast-info    { border-color: #007BFF; }
.fa-toast .toast-icon   { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.fa-toast.toast-success .toast-icon { color: #28A745; }
.fa-toast.toast-danger  .toast-icon { color: #DC3545; }
.fa-toast.toast-warning .toast-icon { color: #FD7E14; }
.fa-toast.toast-info    .toast-icon { color: #007BFF; }
.fa-toast .toast-title  { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.fa-toast .toast-msg    { font-size: 12px; color: #555; }
.fa-toast .toast-close  { margin-left: auto; background: none; border: none; color: #aaa; font-size: 16px; line-height: 1; padding: 0; cursor: pointer; flex-shrink: 0; }
.fa-toast .toast-close:hover { color: #333; }
.fa-toast .toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; border-radius: 0 0 10px 10px; animation: toastProgress linear forwards; }
.toast-success .toast-progress { background: #28A745; }
.toast-danger  .toast-progress { background: #DC3545; }
.toast-warning .toast-progress { background: #FD7E14; }
.toast-info    .toast-progress { background: #007BFF; }
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* ── DELETE / COMMON MODAL ── */
#deleteModal .modal-header { background: #fff3f3; border-bottom: 1px solid #f5c6cb; }
#deleteModal .delete-icon  { width: 64px; height: 64px; border-radius: 50%; background: #fde8e8; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
#deleteModal .delete-icon i { font-size: 28px; color: #DC3545; }
#commonModal .modal-dialog.modal-xs { max-width: 380px; }

/* ── FORM UTILITIES ── */
.required-label::after { content: ' *'; color: #dc3545; }
