:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e3a5f 0%, #0d2137 100%);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar-brand i {
    font-size: 2rem;
    color: #4fc3f7;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu .menu-header {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px 10px;
    font-weight: 600;
}

.sidebar-menu .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.sidebar-menu .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: #4fc3f7;
}

.sidebar-menu .nav-link.active {
    background: rgba(79, 195, 247, 0.15);
    color: #4fc3f7;
    border-left-color: #4fc3f7;
    font-weight: 600;
}

.sidebar-menu .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-submenu {
    background: rgba(0,0,0,0.2);
}

.sidebar-submenu .nav-link {
    padding-left: 56px;
    font-size: 0.85rem;
}

/* Collapsible Submenu */
.sidebar-menu .has-submenu {
    display: flex;
    align-items: center;
}

.sidebar-menu .has-submenu .bi-chevron-down {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.sidebar-menu .has-submenu[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar-menu .submenu {
    background: rgba(0,0,0,0.15);
}

.sidebar-menu .submenu .nav-link {
    padding: 8px 15px 8px 45px;
    font-size: 0.8rem;
    border-left: 2px solid transparent;
}

.sidebar-menu .submenu .nav-link:hover {
    background: rgba(255,255,255,0.05);
}

.sidebar-menu .submenu .nav-link i {
    font-size: 0.85rem;
    margin-right: 8px;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 15px;
}

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Top Bar */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #333;
    cursor: pointer;
    padding: 5px;
    display: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Mobile Sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Responsive Sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0099ff 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-logo {
    font-size: 3rem;
    color: #0d6efd;
}

.dashboard-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.dashboard-card .card-body {
    padding: 1.5rem;
}

.dashboard-card .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.dashboard-card .card-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.card-icon-primary { background-color: rgba(13, 110, 253, 0.1); color: #0d6efd; }
.card-icon-success { background-color: rgba(25, 135, 84, 0.1); color: #198754; }
.card-icon-warning { background-color: rgba(255, 193, 7, 0.1); color: #ffc107; }
.card-icon-danger { background-color: rgba(220, 53, 69, 0.1); color: #dc3545; }
.card-icon-info { background-color: rgba(13, 202, 240, 0.1); color: #0dcaf0; }

.table-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #333;
}

.content-wrapper {
    padding: 1.5rem;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.table th {
    font-weight: 600;
    color: #555;
    border-top: none;
}

.form-label {
    font-weight: 500;
    color: #555;
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.status-available { background-color: #198754; }
.status-with_customer { background-color: #0dcaf0; }
.status-overdue { background-color: #dc3545; }
.status-damaged { background-color: #6c757d; }
.status-lost { background-color: #212529; }

.qr-code-display {
    max-width: 200px;
    border: 2px solid #ddd;
    padding: 15px;
    border-radius: 10px;
    background: #fff;
}

.quick-actions .btn {
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
}

.notification-item {
    border-left: 3px solid transparent;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    border-left-color: #0d6efd;
    background-color: #f0f7ff;
}

.chart-container {
    position: relative;
    height: 300px;
}

@media print {
    .no-print { display: none !important; }
    .sidebar, .topbar, .navbar, footer { display: none !important; }
    .main-wrapper { margin-left: 0 !important; }
    .card { border: 1px solid #ddd !important; box-shadow: none !important; }
    body { background: #fff; padding: 0; }
    .content-wrapper { padding: 0 !important; }
}

@media (max-width: 768px) {
    .dashboard-card .card-value {
        font-size: 1.25rem;
    }
    .dashboard-card .card-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    .content-wrapper {
        padding: 0.75rem;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .page-header h1 {
        font-size: 1.25rem;
    }
    .card-header {
        padding: 0.75rem 1rem;
    }
    .card-body {
        padding: 1rem;
    }
    .table {
        font-size: 0.85rem;
    }
    .table th, .table td {
        padding: 0.5rem;
    }
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    .form-control, .form-select {
        font-size: 0.9rem;
    }
    .row.g-4 {
        --bs-gutter-y: 0.75rem;
    }
}

@media (max-width: 576px) {
    .page-header .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    .table-responsive {
        font-size: 0.8rem;
    }
    .dashboard-card .card-body {
        padding: 1rem;
    }
    .topbar {
        padding: 0 10px;
    }
    .topbar-right .dropdown-menu {
        width: 280px !important;
    }
}

.empty-state {
    padding: 3rem;
    text-align: center;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.filter-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.receipt-container {
    max-width: 300px;
    margin: 0 auto;
    font-family: monospace;
    font-size: 12px;
}

.receipt-container hr {
    border-style: dashed;
}
