:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    overflow-x: hidden;
}

/* Wrapper Layout */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
    border-right: 1px solid #e2e8f0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-header h5,
.sidebar.collapsed .sidebar-header small,
.sidebar.collapsed .sidebar-menu span,
.sidebar.collapsed .sidebar-menu-category,
.sidebar.collapsed .user-info div,
.sidebar.collapsed .dropdown-icon {
    display: none;
}

.sidebar.collapsed .sidebar-menu-item a {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .sidebar-menu-item a i {
    margin: 0;
    font-size: 1.3rem;
}

.sidebar.collapsed .sidebar-footer {
    padding: 15px 10px;
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.sidebar-logo {
    max-width: 80px;
    max-height: 80px;
    margin-bottom: 10px;
    border-radius: 50%;
}

.sidebar-header h5 {
    margin: 10px 0 5px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.sidebar-header small {
    font-size: 0.75rem;
    color: #64748b;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-category {
    padding: 15px 20px 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: #94a3b8;
}

.sidebar-menu-item {
    margin: 5px 0;
}

.sidebar-menu-item > a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #475569;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.sidebar-menu-item > a:hover {
    background-color: #eff6ff;
    color: var(--primary-color);
}

.sidebar-menu-item.active > a {
    background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.sidebar-menu-item > a i:first-child {
    width: 25px;
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar-menu-item .dropdown-icon {
    margin-left: auto;
    transition: transform 0.3s;
}

.sidebar-menu-item.open .dropdown-icon {
    transform: rotate(90deg);
}

.sidebar-dropdown {
    list-style: none;
    padding-left: 45px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.sidebar-menu-item.open .sidebar-dropdown {
    max-height: 500px;
}

.sidebar-dropdown li a {
    display: block;
    padding: 8px 15px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.sidebar-dropdown li a:hover {
    color: var(--primary-color);
    padding-left: 20px;
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 15px 20px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 10px;
}

.user-info i {
    color: var(--primary-color);
}

.user-info strong {
    display: block;
    font-size: 0.9rem;
}

.user-info small {
    font-size: 0.7rem;
    color: #64748b;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s ease;
    min-height: 100vh;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/* Top Navbar */
.top-navbar {
    background: white;
    padding: 0 25px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 999;
}

.menu-toggle {
    cursor: pointer;
    font-size: 1.3rem;
    color: #475569;
    transition: all 0.3s;
}

.menu-toggle:hover {
    color: var(--primary-color);
}

.top-navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-dropdown {
    position: relative;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
}

.currency-selector select {
    width: 100px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
}

.date-display {
    font-size: 0.85rem;
    color: #64748b;
}

/* Content Wrapper */
.content-wrapper {
    padding: 25px;
    animation: fadeIn 0.3s ease-out;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    margin-bottom: 25px;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

/* Table Styles */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.3s;
}

.table tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
}

/* Status Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fed7aa;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .top-navbar-right .date-display {
        display: none;
    }
}

/* Print Styles */
@media print {
    .sidebar, .top-navbar, .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Thermal Printer (80mm) */
@media print and (max-width: 80mm) {
    body {
        margin: 0;
        padding: 0;
        font-size: 10px;
    }
    
    .invoice-container {
        width: 80mm;
        padding: 5px;
    }
    
    .table td, .table th {
        padding: 4px;
    }
    
    h1, h2, h3 {
        margin: 5px 0;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}