/**
 * BestFilings ERP — assets/css/style.css
 * Custom styles on top of Bootstrap 5.
 * Colors: Navy #03b072 (primary), Gold #05c07d (accent), Light Grey #f8f9fa (background)
 */

/* ─── CSS Custom Properties ─────────────────────────────────────────────── */
:root {
    --bf-navy:        #03b072;
    --bf-navy-dark:   #027a52;
    --bf-navy-light:  #2a4d7f;
    --bf-gold:        #05c07d;
    --bf-gold-light:  #ffc433;
    --bf-sidebar-w:   240px;
    --bf-topnav-h:    56px;
    --bf-sidebar-bg:  #1a2e48;
    --bf-sidebar-text:#c8d8e8;
    --bf-border:      #dee2e6;
    --bf-bg-body:     #f0f2f5;
    --bf-card-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ─── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.bf-app {
    background: var(--bf-bg-body);
    color: #212529;
    font-size: 0.9rem;
}

/* ─── Top Navigation ────────────────────────────────────────────────────── */
.bf-topnav {
    background: linear-gradient(90deg, #03b072 0%, #04a468 100%) !important;
    height: var(--bf-topnav-h);
    padding: 0 1rem;
    z-index: 1040;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.bf-topnav .navbar-brand {
    font-size: 1.2rem;
    letter-spacing: 0.3px;
}

/* ─── Wrapper ───────────────────────────────────────────────────────────── */
.bf-wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: var(--bf-topnav-h);
}

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.bf-sidebar {
    width: var(--bf-sidebar-w);
    min-height: calc(100vh - var(--bf-topnav-h));
    background: var(--bf-sidebar-bg);
    color: var(--bf-sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: var(--bf-topnav-h);
    left: 0;
    bottom: 0;
    z-index: 1030;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.25s ease, width 0.25s ease;
}

/* Sidebar is hidden on mobile by default */
@media (max-width: 767px) {
    .bf-sidebar {
        transform: translateX(-100%);
    }
    .bf-sidebar.bf-sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 16px rgba(0,0,0,0.3);
    }
}

/* Desktop collapsed state */
body.bf-sidebar-collapsed .bf-sidebar {
    width: 56px;
}
body.bf-sidebar-collapsed .bf-sidebar .nav-label,
body.bf-sidebar-collapsed .bf-sidebar .nav-category,
body.bf-sidebar-collapsed .bf-sidebar .bf-role-label,
body.bf-sidebar-collapsed .bf-sidebar .bf-sidebar-brand span,
body.bf-sidebar-collapsed .bf-sidebar .bf-sidebar-footer {
    display: none;
}
body.bf-sidebar-collapsed .bf-sidebar .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
body.bf-sidebar-collapsed .bf-sidebar .nav-link i {
    margin: 0 !important;
    font-size: 1.1rem;
}

.bf-sidebar-brand {
    background: rgba(0,0,0,.2);
    min-height: 52px;
    border-bottom: 1px solid rgba(255,255,255,.05);
}

.bf-role-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.4rem 1rem 0.25rem;
    opacity: 0.6;
}

/* Nav category dividers */
.bf-sidenav .nav-category {
    list-style: none;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(200,216,232,.45);
    padding: 0.7rem 1rem 0.2rem;
    margin-top: 0.4rem;
}

.bf-sidenav .nav-link {
    color: var(--bf-sidebar-text);
    padding: 0.45rem 1rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
}

.bf-sidenav .nav-link:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}

.bf-sidenav .nav-link.active {
    background: var(--bf-navy-light);
    color: #fff;
    border-left: 3px solid var(--bf-gold);
}

.bf-sidenav .nav-link i {
    font-size: 0.95rem;
    width: 18px;
    flex-shrink: 0;
}

.bf-sidebar-footer {
    padding: 0.75rem 0.75rem;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.07);
}

/* Backdrop for mobile sidebar */
.bf-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1025;
}

/* ─── Main Content Area ─────────────────────────────────────────────────── */
.bf-main {
    flex: 1;
    margin-left: var(--bf-sidebar-w);
    padding: 1.25rem 1.5rem;
    min-width: 0;
    transition: margin-left 0.25s ease;
}

body.bf-sidebar-collapsed .bf-main {
    margin-left: 56px;
}

@media (max-width: 767px) {
    .bf-main {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Flash message container */
.bf-flash-container {
    margin-bottom: 0.75rem;
}

/* ─── Page Header ───────────────────────────────────────────────────────── */
.bf-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bf-page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bf-navy);
    margin: 0;
}

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.bf-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e9ee;
    box-shadow: var(--bf-card-shadow);
}

.bf-card-header {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #e5e9ee;
    background: #fafbfc;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.bf-card-header h5,
.bf-card-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--bf-navy);
}

.bf-card-body {
    padding: 1.25rem;
}

/* ─── Stat Cards (dashboard) ────────────────────────────────────────────── */
.bf-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid #e5e9ee;
    box-shadow: var(--bf-card-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.15s;
}

.bf-stat-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.1); }

.bf-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.bf-stat-icon.navy  { background: rgba(30,58,95,.1);  color: var(--bf-navy); }
.bf-stat-icon.green { background: rgba(25,135,84,.1); color: #198754; }
.bf-stat-icon.amber { background: rgba(255,193,7,.15);color: #d39e00; }
.bf-stat-icon.red   { background: rgba(220,53,69,.1); color: #dc3545; }
.bf-stat-icon.blue  { background: rgba(13,110,253,.1);color: #0d6efd; }

.bf-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--bf-navy);
}

.bf-stat-label {
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: 2px;
}

/* ─── Tables ────────────────────────────────────────────────────────────── */
.bf-table-wrapper {
    overflow-x: auto;
    border-radius: 0 0 8px 8px;
}

.bf-table {
    margin-bottom: 0;
    font-size: 0.87rem;
}

.bf-table thead th {
    background: #f5f7fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid #e5e9ee;
    white-space: nowrap;
    padding: 0.6rem 1rem;
}

.bf-table tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

.bf-table tbody tr:hover { background: #f8f9ff; }

.bf-table tbody tr.selected { background: #eef3ff; }

.bf-table td {
    vertical-align: middle;
    padding: 0.6rem 1rem;
    border-color: #f0f2f5;
}

/* ─── Avatar ────────────────────────────────────────────────────────────── */
.bf-avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.bf-avatar {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ─── Global Search ─────────────────────────────────────────────────────── */
.bf-search {
    position: relative;
    min-width: 220px;
}

.bf-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--bf-border);
    border-radius: 6px;
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 2px;
}

.bf-search-item {
    color: #212529;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.1s;
}
.bf-search-item:hover { background: #f8f9fa; }
.bf-search-item:last-child { border-bottom: none; }

/* ─── Notifications Dropdown ────────────────────────────────────────────── */
.bf-notif-dropdown {
    width: 360px;
    max-height: 480px;
    overflow: hidden;
}

.bf-notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.bf-notif-item {
    color: #212529;
    transition: background 0.1s;
}
.bf-notif-item:hover { background: #f8f9fa; }
.bf-notif-unread { background: #f0f5ff; }

.bf-notif-dot {
    width: 8px;
    height: 8px;
    background: #0d6efd;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

/* ─── Order Status Timeline ─────────────────────────────────────────────── */
.bf-timeline {
    position: relative;
    padding-left: 2rem;
}

.bf-timeline::before {
    content: '';
    position: absolute;
    left: 0.6rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.bf-timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.bf-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.55rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #adb5bd;
    border: 2px solid #fff;
}

.bf-timeline-item.active::before { background: var(--bf-navy); }
.bf-timeline-item.completed::before { background: #198754; }

/* ─── Document Checklist ────────────────────────────────────────────────── */
.bf-doc-item {
    background: #fafbfc;
    border: 1px solid #e5e9ee;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    transition: background 0.1s;
}

.bf-doc-item:hover { background: #f0f2f5; }

.bf-doc-item.approved  { border-left: 3px solid #198754; }
.bf-doc-item.rejected  { border-left: 3px solid #dc3545; }
.bf-doc-item.pending   { border-left: 3px solid #ffc107; }

/* ─── Forms ─────────────────────────────────────────────────────────────── */
.bf-form-section {
    background: #fff;
    border: 1px solid #e5e9ee;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.bf-form-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bf-navy);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e9ee;
}

label.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 0.3rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bf-navy-light);
    box-shadow: 0 0 0 0.2rem rgba(30,58,95,.15);
}

/* Required field asterisk */
.required-star {
    color: #dc3545;
    margin-left: 2px;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn-bf-primary {
    background: var(--bf-navy);
    border-color: var(--bf-navy);
    color: #fff;
}
.btn-bf-primary:hover {
    background: var(--bf-navy-dark);
    border-color: var(--bf-navy-dark);
    color: #fff;
}

.btn-bf-gold {
    background: var(--bf-gold);
    border-color: var(--bf-gold);
    color: #212529;
}
.btn-bf-gold:hover {
    background: var(--bf-gold-light);
    border-color: var(--bf-gold-light);
    color: #212529;
}

/* ─── Badges ────────────────────────────────────────────────────────────── */
.badge { font-weight: 500; }

/* ─── Filters Bar ───────────────────────────────────────────────────────── */
.bf-filters {
    background: #fff;
    border: 1px solid #e5e9ee;
    border-radius: 8px;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
}

/* ─── Loading Spinner Overlay ───────────────────────────────────────────── */
.bf-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* ─── Print Styles ──────────────────────────────────────────────────────── */
@media print {
    .bf-topnav,
    .bf-sidebar,
    .bf-sidebar-backdrop,
    .btn,
    .bf-filters,
    .bf-flash-container {
        display: none !important;
    }
    .bf-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .bf-card { box-shadow: none; border: 1px solid #dee2e6; }
}

/* ─── Utility ───────────────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.text-navy      { color: var(--bf-navy) !important; }
.bg-navy        { background: var(--bf-navy) !important; }
.text-gold      { color: var(--bf-gold) !important; }
.fs-7           { font-size: 0.8rem; }
.x-small        { font-size: 0.72rem; }
.border-dashed  { border-style: dashed !important; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .bf-stat-card   { padding: 1rem; }
    .bf-stat-value  { font-size: 1.3rem; }
    .bf-notif-dropdown { width: calc(100vw - 1rem); }
    .bf-filters     { flex-direction: column; }
}
