/* ============================================================
   Bevcon Zentry - Custom Styles
   ============================================================ */

:root {
    --bz-primary:     #1a3c6e;
    --bz-primary-dark:#122d54;
    --bz-accent:      #f0a500;
    --bz-accent-dark: #d4920a;
    --bz-bg:          #f4f6fb;
    --bz-sidebar-w:   260px;
    --bz-navbar-h:    62px;
    --bz-card-radius: 12px;
    --bz-shadow:      0 2px 16px rgba(26,60,110,.08);
    --bz-shadow-md:   0 4px 24px rgba(26,60,110,.14);
}

/* ---- Base ---- */
* { box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bz-bg);
    color: #2d3748;
    font-size: 14px;
}

/* ---- Navbar ---- */
.bz-navbar {
    background: var(--bz-primary) !important;
    height: var(--bz-navbar-h);
    box-shadow: 0 2px 12px rgba(26,60,110,.25);
    z-index: 1040;
}
.bz-navbar .navbar-brand { padding: .25rem 0; }
.bz-logo-icon {
    width: 38px; height: 38px;
    background: var(--bz-accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: white;
    box-shadow: 0 2px 8px rgba(240,165,0,.4);
}
.bz-navbar .nav-link {
    color: rgba(255,255,255,.82) !important;
    font-weight: 500;
    padding: .45rem .85rem !important;
    border-radius: 8px;
    transition: all .2s;
}
.bz-navbar .nav-link:hover,
.bz-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,.12);
}
.bz-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--bz-accent);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
    flex-shrink: 0;
}

/* ---- Content Area ---- */
.bz-content {
    margin-top: var(--bz-navbar-h);
    min-height: calc(100vh - var(--bz-navbar-h) - 52px);
    padding-top: 1.5rem;
}

/* ---- Footer ---- */
.bz-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: .75rem 0;
    margin-top: 2rem;
}

/* ---- Cards ---- */
.bz-card {
    background: #fff;
    border-radius: var(--bz-card-radius);
    box-shadow: var(--bz-shadow);
    border: 1px solid #edf2f7;
    overflow: hidden;
}
.bz-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.bz-card-header h5, .bz-card-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--bz-primary);
}
.bz-card-body { padding: 1.25rem; }

/* ---- Stat Cards ---- */
.bz-stat-card {
    background: #fff;
    border-radius: var(--bz-card-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--bz-shadow);
    border: 1px solid #edf2f7;
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
.bz-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--bz-shadow-md);
}
.bz-stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.bz-stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--bz-primary);
}
.bz-stat-card .stat-label {
    font-size: .8rem;
    font-weight: 500;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.bz-stat-card::after {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 90px; height: 90px;
    border-radius: 50%;
    opacity: .06;
}
.bz-stat-primary .stat-icon { background: #ebf4ff; color: var(--bz-primary); }
.bz-stat-primary::after { background: var(--bz-primary); }
.bz-stat-warning .stat-icon { background: #fffbeb; color: #d97706; }
.bz-stat-warning::after { background: #f59e0b; }
.bz-stat-success .stat-icon { background: #f0fdf4; color: #16a34a; }
.bz-stat-success::after { background: #16a34a; }
.bz-stat-danger .stat-icon { background: #fff1f2; color: #dc2626; }
.bz-stat-danger::after { background: #dc2626; }
.bz-stat-info .stat-icon { background: #f0f9ff; color: #0284c7; }
.bz-stat-info::after { background: #0284c7; }

/* ---- Page Header ---- */
.bz-page-header {
    margin-bottom: 1.5rem;
}
.bz-page-header h4 {
    font-weight: 700;
    color: var(--bz-primary);
    margin: 0;
}
.bz-breadcrumb {
    font-size: .8rem;
    color: #718096;
    margin-top: .2rem;
}
.bz-breadcrumb a { color: var(--bz-primary); text-decoration: none; }
.bz-breadcrumb a:hover { text-decoration: underline; }

/* ---- Forms ---- */
.form-label { font-weight: 500; color: #4a5568; margin-bottom: .35rem; }
.form-control, .form-select {
    border-radius: 8px;
    border-color: #cbd5e0;
    font-size: .875rem;
    padding: .5rem .85rem;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--bz-primary);
    box-shadow: 0 0 0 3px rgba(26,60,110,.12);
}
.form-text { font-size: .78rem; }
.input-group-text {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #718096;
    border-radius: 8px 0 0 8px;
}

/* Category Amount Rows */
.expense-row {
    background: #f9fafc;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    padding: .75rem 1rem;
    margin-bottom: .5rem;
    transition: background .2s;
}
.expense-row:hover { background: #f0f4fa; }
.expense-row .category-label {
    font-weight: 600;
    color: var(--bz-primary);
    font-size: .85rem;
}

/* File Upload Zone */
.upload-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: #f9fafc;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--bz-primary);
    background: #ebf4ff;
}
.upload-zone i { font-size: 2rem; color: #a0aec0; }
.upload-zone p { color: #718096; margin: .5rem 0 0; font-size: .85rem; }

/* ---- Tables ---- */
.bz-table th {
    background: #f7fafc;
    color: #4a5568;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: .75rem 1rem;
    white-space: nowrap;
}
.bz-table td {
    padding: .75rem 1rem;
    vertical-align: middle;
    border-color: #f0f4f8;
}
.bz-table tbody tr { transition: background .15s; }
.bz-table tbody tr:hover { background: #f7faff; }
.bz-table-container { border-radius: var(--bz-card-radius); overflow: hidden; box-shadow: var(--bz-shadow); }

/* ---- Buttons ---- */
.btn { border-radius: 8px; font-weight: 500; font-size: .85rem; padding: .45rem 1rem; transition: all .2s; }
.btn-primary { background: var(--bz-primary); border-color: var(--bz-primary); }
.btn-primary:hover { background: var(--bz-primary-dark); border-color: var(--bz-primary-dark); }
.btn-warning { color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }

/* ---- Badges ---- */
.badge { border-radius: 6px; font-weight: 500; font-size: .75rem; padding: .35em .7em; }

/* ---- Login Page ---- */
.bz-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bz-primary) 0%, #2563ab 50%, #1e4d8c 100%);
    position: relative;
    overflow: hidden;
}
.bz-login-page::before {
    content: '';
    position: absolute;
    top: -100px; right: -100px;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
}
.bz-login-page::after {
    content: '';
    position: absolute;
    bottom: -150px; left: -80px;
    width: 350px; height: 350px;
    border-radius: 50%;
    background: rgba(240,165,0,.1);
}
.bz-login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    position: relative;
    z-index: 1;
}
.bz-login-logo {
    width: 64px; height: 64px;
    background: var(--bz-primary);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: white;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(26,60,110,.3);
}

/* ---- Invoice / Print View ---- */
.invoice-table th { background: var(--bz-primary) !important; color: white !important; }
.invoice-header { border-bottom: 3px solid var(--bz-primary); padding-bottom: 1rem; margin-bottom: 1.5rem; }

/* ---- Charts ---- */
.chart-container { position: relative; }

/* ---- Status Timeline ---- */
.bz-timeline { padding: .5rem 0; }
.bz-timeline-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.25rem;
    position: relative;
}
.bz-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 19px; top: 36px;
    width: 2px;
    height: calc(100% - 36px);
    background: #e2e8f0;
}
.bz-timeline-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px currentColor;
}

/* ---- Filters ---- */
.bz-filter-bar {
    background: #fff;
    border-radius: var(--bz-card-radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--bz-shadow);
    margin-bottom: 1.25rem;
    border: 1px solid #edf2f7;
}

/* ---- Print ---- */
@media print {
    .bz-navbar, .bz-footer, .no-print, .btn, nav { display: none !important; }
    .bz-content { margin-top: 0 !important; }
    .bz-card, .bz-table-container { box-shadow: none !important; border: 1px solid #ddd !important; }
    body { background: white !important; }
    .page-break { page-break-before: always; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .bz-content { padding-top: 1rem; }
    .bz-stat-card { margin-bottom: .75rem; }
    .bz-login-card { margin: 1rem; padding: 1.75rem; }
    .bz-table th, .bz-table td { padding: .6rem .75rem; font-size: .8rem; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .35s ease forwards; }
