/* ═══════════════════════════════════════════════════════════════
   BitGRoot Layout — Dark Luxury Edition (Mikhak Font)
   Deep dark · Gold accents · Professional elegance
   ═══════════════════════════════════════════════════════════════ */

/* ── Font Face ── */
@font-face {
    font-family: 'Mikhak';
    src: url('/font/Mikhak.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-body: 'Mikhak', 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;

    /* Sidebar — Dark */
    --sb-bg: #0f1219;
    --sb-bg-hover: rgba(212, 168, 83, 0.08);
    --sb-bg-active: rgba(212, 168, 83, 0.12);
    --sb-border: #1e2233;
    --sb-text: #6b7294;
    --sb-text-hover: #e8eaf0;
    --sb-accent: #d4a853;
    --sb-accent-soft: rgba(212, 168, 83, 0.12);
    --sb-accent-glow: rgba(212, 168, 83, 0.25);
    --sb-width: 260px;

    /* Content */
    --ct-bg: #0d1017;
    --ct-surface: #161a26;
    --ct-border: #1e2233;
    --ct-text: #e8eaf0;
    --ct-muted: #9da3b8;
    --ct-muted-light: #5a6078;

    /* Topbar */
    --tb-height: 56px;

    /* Shared */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --trans: 200ms var(--ease);

    /* Shadows — Dark theme */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.5);
}

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body) !important;
    background: var(--ct-bg);
    color: var(--ct-text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
}

/* Ensure Bootstrap elements inherit Mikhak font */
.form-control, .form-select, .btn, .card, .nav, .nav-link, .breadcrumb, .badge, .alert, .table, input, select, textarea, button {
    font-family: var(--font-body) !important;
}

/* Dark form elements */
.form-control, .form-select, input, select, textarea {
    background-color: #1a1e2e !important;
    border-color: #2a2e40 !important;
    color: var(--ct-text) !important;
}

.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
    background-color: #1e2232 !important;
    border-color: var(--sb-accent) !important;
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15) !important;
    color: var(--ct-text) !important;
}

/* ═══ Sidebar ═══ */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sb-width);
    height: 100vh;
    background: var(--sb-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    border-left: 1px solid var(--sb-border);
    transition: transform var(--trans);
    overflow: hidden;
    box-shadow: -2px 0 20px rgba(0,0,0,0.3);
    font-family: var(--font-body);
}

.sidebar * {
    font-family: var(--font-body);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 180px;
    background: linear-gradient(180deg, rgba(212,168,83,0.05) 0%, transparent 100%);
    pointer-events: none;
}

/* Logo */
.sb-logo {
    padding: 1.35rem 1.25rem;
    border-bottom: 1px solid var(--sb-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

.sb-logo-mark {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #d4a853 0%, #c9952e 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(212, 168, 83, 0.3);
    position: relative;
}

.sb-logo-mark::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    pointer-events: none;
}

.sb-logo-mark svg {
    width: 18px;
    height: 18px;
    stroke: #0f1219;
    stroke-width: 2.2;
    fill: none;
}

.sb-logo-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #e8eaf0;
    letter-spacing: -0.01em;
}

.sb-logo-text span {
    font-size: 11px;
    color: var(--sb-text);
    font-weight: 400;
}

/* Navigation */
.sb-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem 0.75rem;
}

.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-thumb {
    background: #2a2e42;
    border-radius: 3px;
}

.sb-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #5a6078;
    padding: 1rem 0.75rem 0.4rem;
    display: block;
}

.sb-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--sb-text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--trans);
    position: relative;
    margin-bottom: 2px;
}

.nav-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    font-size: 15px;
    flex-shrink: 0;
    transition: all var(--trans);
    color: var(--sb-text);
}

.sb-nav .nav-link:hover {
    color: var(--sb-text-hover);
    background: var(--sb-bg-hover);
}

.sb-nav .nav-link:hover .nav-icon {
    background: rgba(212, 168, 83, 0.1);
    color: var(--sb-accent);
}

.sb-nav .nav-link.active {
    color: var(--sb-accent);
    background: var(--sb-accent-soft);
    font-weight: 600;
}

.sb-nav .nav-link.active .nav-icon {
    background: var(--sb-accent);
    color: #0f1219;
    box-shadow: 0 3px 10px var(--sb-accent-glow);
}

.sb-nav .nav-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 55%;
    background: var(--sb-accent);
    border-radius: 3px 0 0 3px;
}

/* Footer */
.sb-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--sb-border);
    position: relative;
    z-index: 1;
}

.sb-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--trans);
}

.sb-user:hover {
    background: var(--sb-bg-hover);
}

.sb-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #d4a853, #c9952e);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #0f1219;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.25);
}

.sb-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #e8eaf0;
}

.sb-user-role {
    font-size: 11px;
    color: var(--sb-text);
}

/* ═══ Topbar ═══ */
.topbar {
    height: var(--tb-height);
    background: rgba(13, 16, 23, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--ct-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tb-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
}

.tb-bc-item { color: var(--ct-muted-light); }
.tb-bc-item.active { color: var(--ct-text); font-weight: 600; }
.tb-bc-sep { color: var(--ct-border); font-size: 11px; }

.tb-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tb-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--ct-border);
    background: transparent;
    color: var(--ct-muted);
    cursor: pointer;
    font-size: 15px;
    transition: all var(--trans);
}

.tb-btn:hover {
    background: rgba(212, 168, 83, 0.1);
    color: var(--sb-accent);
    border-color: rgba(212, 168, 83, 0.3);
}

.notif-wrap { position: relative; }

.notif-dot {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    border: 1.5px solid #0f1219;
}

/* ═══ Layout ═══ */
.main-wrapper {
    margin-right: var(--sb-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 1.5rem 2rem 2rem;
}

.sb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1039;
    backdrop-filter: blur(4px);
}

.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--ct-border);
    background: transparent;
    color: var(--ct-muted);
    cursor: pointer;
    font-size: 16px;
}

/* ═══ Responsive ═══ */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .sb-overlay.show { display: block; }
    .main-wrapper { margin-right: 0; }
    .mobile-menu-btn { display: flex; }
    .main-content { padding: 1.25rem; }
}

@media (max-width: 575.98px) {
    .main-content { padding: 1rem; }
    .topbar { padding: 0 1rem; }
}
