/* CNG Garage & Parts Management System - Custom CSS */

:root {
    --primary-color: #0f766e;
    --primary-hover: #115e59;
    --primary-light: #ccfbf1;
    --sidebar-bg: #090e1a;
    --sidebar-surface: #111827;
    --sidebar-hover: #1f293d;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 76px;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-sans);
    color: #1e293b;
    background-color: #f8fafc;
    overflow-x: hidden;
}

.fs-xs { font-size: 0.75rem; }
.fs-sm { font-size: 0.85rem; }
.shadow-xs { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }

.btn-xs {
    padding: 0.22rem 0.55rem;
    font-size: 0.72rem;
    line-height: 1.25;
    border-radius: 50rem;
    font-weight: 500;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

/* ==========================================================================
   Sidebar & Layout Structure
   ========================================================================== */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

#sidebar-wrapper {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background-color: var(--sidebar-bg) !important;
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
    position: relative;
    user-select: none;
}

/* Sidebar Brand Header */
.sidebar-brand-box {
    height: 64px;
    background: rgba(15, 23, 42, 0.5);
}

.brand-logo-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-pin-btn {
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-pin-btn:hover {
    color: #38bdf8 !important;
    transform: scale(1.1);
}

/* Section Categories */
.nav-section-header {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: #64748b;
    padding: 10px 12px 4px;
    transition: opacity 0.2s ease;
}

/* Nav Links & Buttons */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 2px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #38bdf8;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.sidebar-link .nav-icon {
    width: 22px;
    font-size: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link .nav-label {
    margin-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

/* Chevron indicator for accordion */
.chevron-indicator {
    font-size: 0.72rem;
    transition: transform 0.25s ease;
    color: #94a3b8;
}

.dropdown-toggle-btn[aria-expanded="true"] .chevron-indicator,
.dropdown-toggle-btn.expanded .chevron-indicator {
    transform: rotate(90deg);
    color: #38bdf8;
}

/* Submenu Styling */
.submenu-box {
    background: rgba(17, 24, 39, 0.6);
    border-radius: 8px;
    margin: 2px 0 6px 6px;
    border-left: 2px solid #334155;
}

.submenu-list {
    list-style: none;
    margin: 0;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 500;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.submenu-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
}

.submenu-link.active {
    color: #34d399;
    font-weight: 700;
    background-color: rgba(16, 185, 129, 0.12);
}

/* ==========================================================================
   Collapsed / Mini Sidebar Mode (.sidebar-collapsed)
   ========================================================================== */
#sidebar-wrapper.sidebar-collapsed {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width);
}

#sidebar-wrapper.sidebar-collapsed .brand-text,
#sidebar-wrapper.sidebar-collapsed .user-meta,
#sidebar-wrapper.sidebar-collapsed .nav-section-header,
#sidebar-wrapper.sidebar-collapsed .nav-label,
#sidebar-wrapper.sidebar-collapsed .chevron-indicator,
#sidebar-wrapper.sidebar-collapsed .logout-text,
#sidebar-wrapper.sidebar-collapsed .submenu-box {
    display: none !important;
}

#sidebar-wrapper.sidebar-collapsed .sidebar-brand-box {
    justify-content: center;
    padding: 0.5rem;
}

#sidebar-wrapper.sidebar-collapsed .sidebar-pin-btn {
    display: none !important;
}

#sidebar-wrapper.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 10px 0;
}

#sidebar-wrapper.sidebar-collapsed .sidebar-link .nav-icon {
    margin: 0;
    font-size: 1.15rem;
}

#sidebar-wrapper.sidebar-collapsed .sidebar-user-card {
    justify-content: center;
    padding: 8px 0;
}

#sidebar-wrapper.sidebar-collapsed .user-avatar-circle {
    margin: 0 auto;
}

/* Mobile Offcanvas Drawer */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4);
    }

    #sidebar-wrapper.show-mobile {
        left: 0;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        z-index: 1045;
        transition: opacity 0.25s ease;
    }
}

/* Stat Cards */
.stat-card {
    border-radius: 14px;
    border: none;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.08);
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Tables */
.table-custom {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
}

.table-custom th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 12px 16px;
    border-bottom: 2px solid #e2e8f0;
}

.table-custom td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Badges */
.badge-due {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-weight: 600;
}

.badge-paid {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    font-weight: 600;
}

/* Dossier Image Box */
.dossier-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s;
}

.dossier-img:hover {
    transform: scale(1.02);
}

/* Print Styling */
@media print {
    #sidebar-wrapper, .navbar, .footer, .btn, .no-print, .alert, .sidebar-backdrop {
        display: none !important;
    }
    body, #page-content-wrapper, main {
        background-color: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    .print-container {
        width: 100% !important;
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
        box-shadow: none !important;
        border: none !important;
    }
}
