/* =====================================================
   FBAMS - FutureBridge Asset Management System
   Professional Admin Theme (Bootstrap 5 based)
   ===================================================== */

:root {
    --fbams-sidebar-width: 250px;
    --fbams-sidebar-bg: #1e293b;
    --fbams-sidebar-hover: #334155;
    --fbams-primary: #2563eb;
}

body {
    background-color: #f1f5f9;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}
[data-bs-theme="dark"] body { background-color: #0f172a; }

.wrapper { display: flex; min-height: 100vh; }

/* ---------------- Sidebar ---------------- */
.sidebar {
    width: var(--fbams-sidebar-width);
    min-height: 100vh;
    background: var(--fbams-sidebar-bg);
    color: #e2e8f0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1040;
    transition: margin-left .25s ease;
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }

.sidebar-brand {
    display: flex; align-items: center;
    font-size: 1.35rem; font-weight: 700;
    padding: 1rem 1.25rem;
    color: #fff;
    background: rgba(0,0,0,.2);
    letter-spacing: .5px;
}
.sidebar-brand i { color: #60a5fa; }

.sidebar-user {
    padding: .75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-nav { list-style: none; padding: .5rem 0; margin: 0; }
.sidebar-nav .nav-heading {
    padding: .85rem 1.25rem .35rem;
    font-size: .7rem; text-transform: uppercase;
    letter-spacing: 1px; color: #94a3b8;
}
.sidebar-nav a {
    display: flex; align-items: center;
    padding: .65rem 1.25rem;
    color: #cbd5e1; text-decoration: none;
    font-size: .92rem;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar-nav a i { width: 24px; text-align: center; margin-right: .65rem; font-size: .95rem; }
.sidebar-nav a:hover { background: var(--fbams-sidebar-hover); color: #fff; }
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(37,99,235,.25), transparent);
    border-left-color: var(--fbams-primary);
    color: #fff; font-weight: 600;
}

/* ---------------- Main panel ---------------- */
.main-panel {
    flex: 1;
    margin-left: var(--fbams-sidebar-width);
    display: flex; flex-direction: column;
    min-width: 0;
    transition: margin-left .25s ease;
}
.content { flex: 1; }

body.sidebar-collapsed .sidebar { margin-left: calc(-1 * var(--fbams-sidebar-width)); }
body.sidebar-collapsed .main-panel { margin-left: 0; }

.top-navbar {
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    min-height: 58px;
    position: sticky; top: 0; z-index: 1030;
}

.avatar-circle {
    width: 32px; height: 32px;
    background: var(--fbams-primary);
    color: #fff; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .9rem;
}

/* ---------------- Mobile ---------------- */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1035;
}
@media (max-width: 991.98px) {
    .sidebar { margin-left: calc(-1 * var(--fbams-sidebar-width)); }
    .main-panel { margin-left: 0; }
    body.sidebar-open .sidebar { margin-left: 0; }
    body.sidebar-open .sidebar-overlay { display: block; }
}

/* ---------------- Dashboard Cards ---------------- */
.stat-card {
    border: none; border-radius: .75rem;
    color: #fff; overflow: hidden;
    position: relative;
    transition: transform .15s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card .stat-icon {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 3rem; opacity: .25;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: .85rem; opacity: .9; }

.bg-grad-blue    { background: linear-gradient(135deg,#2563eb,#1d4ed8); }
.bg-grad-green   { background: linear-gradient(135deg,#16a34a,#15803d); }
.bg-grad-orange  { background: linear-gradient(135deg,#ea580c,#c2410c); }
.bg-grad-purple  { background: linear-gradient(135deg,#7c3aed,#6d28d9); }
.bg-grad-cyan    { background: linear-gradient(135deg,#0891b2,#0e7490); }
.bg-grad-red     { background: linear-gradient(135deg,#dc2626,#b91c1c); }
.bg-grad-slate   { background: linear-gradient(135deg,#475569,#334155); }
.bg-grad-pink    { background: linear-gradient(135deg,#db2777,#be185d); }

/* ---------------- Cards / Tables ---------------- */
.card { border: none; border-radius: .65rem; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.card-header { background: transparent; border-bottom: 1px solid var(--bs-border-color); font-weight: 600; }
.table > :not(caption) > * > * { vertical-align: middle; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }

/* ---------------- Global Search Dropdown ---------------- */
.search-results {
    display: none;
    position: absolute; top: 110%; left: 0;
    width: 380px; max-height: 380px; overflow-y: auto;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem; z-index: 1050;
}
.search-results a {
    display: block; padding: .55rem .85rem;
    text-decoration: none; color: var(--bs-body-color);
    border-bottom: 1px solid var(--bs-border-color);
    font-size: .88rem;
}
.search-results a:hover { background: var(--bs-tertiary-bg); }

/* ---------------- Loader ---------------- */
.page-loader {
    position: fixed; inset: 0;
    background: rgba(255,255,255,.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
}
[data-bs-theme="dark"] .page-loader { background: rgba(0,0,0,.5); }

/* ---------------- Login Page ---------------- */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    padding: 1rem;
}
.login-card { width: 100%; max-width: 420px; border-radius: 1rem; }
.login-logo {
    width: 70px; height: 70px;
    background: linear-gradient(135deg,#2563eb,#1d4ed8);
    border-radius: 1rem; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2rem;
}

/* ---------------- Asset Profile ---------------- */
.profile-label { font-size: .78rem; text-transform: uppercase; color: var(--bs-secondary-color); letter-spacing: .5px; }
.profile-value { font-weight: 600; }
.qr-box { border: 2px dashed var(--bs-border-color); border-radius: .75rem; padding: 1.25rem; text-align: center; }

/* ---------------- Misc ---------------- */
.required:after { content: " *"; color: #dc2626; }
.dt-buttons .btn { margin-right: .35rem; }
@media print {
    .sidebar, .top-navbar, .dt-buttons, footer, .no-print { display: none !important; }
    .main-panel { margin-left: 0 !important; }
}
