/* ==========================================================
   QARAAN PRO — Application Theme (Bootstrap 5 + AdminLTE style)
   ========================================================== */
:root {
    --sidebar-w: 260px;
    --brand: #0d6efd;
    --brand-2: #6610f2;
    --topbar-h: 62px;
    --radius: 14px;
    --sidebar-bg: #0f172a;
    --sidebar-fg: #cbd5e1;
    --sidebar-active: #1e293b;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: #f1f4f9;
    color: #1f2937;
}
[data-bs-theme="dark"] body { background: #0b1120; color: #e5e7eb; }

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

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    transition: transform .25s ease; z-index: 1040;
}
.sidebar-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 0 1.1rem; height: var(--topbar-h);
    font-weight: 700; font-size: 1.05rem; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand img { height: 34px; }
.brand-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: .8rem .6rem; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: .8rem;
    color: var(--sidebar-fg); padding: .68rem .8rem; border-radius: 10px;
    font-size: .93rem; margin-bottom: 2px; text-decoration: none; transition: .15s;
}
.sidebar-nav .nav-link i { width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--sidebar-active); color: #fff; }
.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
    box-shadow: 0 6px 16px rgba(13,110,253,.35);
}
.sidebar-footer { padding: .8rem 1.1rem; color: #64748b; border-top: 1px solid rgba(255,255,255,.06); }

/* ---------- Main / Topbar ---------- */
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar {
    height: var(--topbar-h); background: #fff; display: flex; align-items: center;
    gap: 1rem; padding: 0 1.1rem; position: sticky; top: 0; z-index: 1030;
    box-shadow: 0 1px 10px rgba(0,0,0,.05);
}
[data-bs-theme="dark"] .topbar { background: #111827; }
.btn-icon {
    width: 40px; height: 40px; border-radius: 10px; border: none; background: transparent;
    display: inline-grid; place-items: center; color: inherit;
}
.btn-icon:hover { background: rgba(0,0,0,.06); }
[data-bs-theme="dark"] .btn-icon:hover { background: rgba(255,255,255,.08); }

.global-search { position: relative; flex: 1; max-width: 460px; }
.global-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.global-search input { padding-left: 40px; border-radius: 30px; background: #f1f4f9; border: none; }
[data-bs-theme="dark"] .global-search input { background: #1f2937; color: #fff; }
.search-results {
    position: absolute; top: 110%; left: 0; right: 0; background: #fff; border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.15); overflow: hidden; display: none; z-index: 1050;
}
[data-bs-theme="dark"] .search-results { background: #1f2937; }
.search-results a { display: block; padding: .6rem .9rem; color: inherit; text-decoration: none; border-bottom: 1px solid rgba(0,0,0,.05); }
.search-results a:hover { background: rgba(13,110,253,.08); }

.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.user-btn { width: auto; padding: 0 .5rem; gap: .5rem; display: inline-flex; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700;
}

.content { padding: 1.4rem; }

/* ---------- Cards / Stats ---------- */
.card { border: none; border-radius: var(--radius); box-shadow: 0 6px 24px rgba(15,23,42,.06); }
[data-bs-theme="dark"] .card { background: #111827; }
.page-title { font-weight: 700; margin-bottom: 1.1rem; display: flex; align-items: center; gap: .6rem; }

.stat-card {
    border-radius: var(--radius); padding: 1.15rem 1.25rem; color: #fff; position: relative; overflow: hidden;
    box-shadow: 0 10px 26px rgba(15,23,42,.12); transition: transform .2s;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-card .stat-icon { position: absolute; right: -6px; bottom: -10px; font-size: 4.2rem; opacity: .18; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { opacity: .92; font-size: .86rem; text-transform: uppercase; letter-spacing: .4px; }
.g-blue { background: linear-gradient(135deg, #2563eb, #4f46e5); }
.g-green { background: linear-gradient(135deg, #059669, #10b981); }
.g-orange { background: linear-gradient(135deg, #ea580c, #f59e0b); }
.g-red { background: linear-gradient(135deg, #dc2626, #f43f5e); }
.g-purple { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.g-teal { background: linear-gradient(135deg, #0891b2, #06b6d4); }

.table-card .table { margin: 0; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; color: #64748b; }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background:#e2e8f0; display:inline-grid; place-items:center; font-weight:600; color:#475569;}

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
    background: linear-gradient(135deg, #0f172a, #1e3a8a); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 2.2rem;
    box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.auth-logo { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 1.6rem; }

/* ---------- Misc ---------- */
.badge { font-weight: 600; }
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main { margin-left: 0; }
}
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; }
}
