:root {
    --primary: #1a237e;
    --primary-dark: #0d1442;
    --secondary: #0277bd;
    --success: #2e7d32;
    --warning: #ef6c00;
    --danger: #c62828;
    --info: #00838f;
    --sidebar-width: 250px;
    --navbar-height: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    overflow-x: hidden;
}

.wrapper { display: flex; width: 100%; }

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    height: var(--navbar-height);
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar-brand { font-size: 1.2rem; font-weight: 700; }
.navbar-dark .navbar-nav .nav-link { color: rgba(255,255,255,0.85); padding: 0.5rem 1rem; }
.navbar-dark .navbar-nav .nav-link:hover { color: #fff; }
.notif-dropdown { width: 320px; max-height: 400px; overflow-y: auto; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: linear-gradient(180deg, var(--primary-dark), var(--primary));
    transition: all 0.3s;
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 12px 20px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-left-color: #42a5f5;
}
.sidebar .nav-link i { width: 22px; text-align: center; margin-right: 10px; }
.sidebar .submenu { background: rgba(0,0,0,0.2); }
.sidebar .submenu .nav-link { padding-left: 45px; font-size: 0.85rem; }
.sidebar .submenu .nav-link i { width: 8px; font-size: 6px; margin-right: 12px; }

/* Content */
.content-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    padding: 20px;
    min-height: calc(100vh - var(--navbar-height));
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    transition: transform 0.2s;
}
.card:hover { transform: translateY(-2px); }
.card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}
.card-body { padding: 20px; }

/* Stat Cards */
.stat-card {
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.stat-card .stat-icon {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 2.5rem;
    opacity: 0.3;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.85rem; opacity: 0.9; }
.bg-primary-gradient { background: linear-gradient(135deg, #1a237e, #3949ab); }
.bg-success-gradient { background: linear-gradient(135deg, #2e7d32, #43a047); }
.bg-warning-gradient { background: linear-gradient(135deg, #ef6c00, #ff9800); }
.bg-info-gradient { background: linear-gradient(135deg, #00838f, #00acc1); }
.bg-danger-gradient { background: linear-gradient(135deg, #c62828, #e53935); }
.bg-purple-gradient { background: linear-gradient(135deg, #4a148c, #7b1fa2); }
.bg-teal-gradient { background: linear-gradient(135deg, #004d40, #00897b); }
.bg-pink-gradient { background: linear-gradient(135deg, #880e4f, #d81b60); }
.bg-secondary-gradient { background: linear-gradient(135deg, #37474f, #607d8b); }
.bg-orange-gradient { background: linear-gradient(135deg, #e65100, #ff6d00); }

/* Status badges */
.badge-pending { background: #fff3e0; color: #ef6c00; }
.badge-completed { background: #e8f5e9; color: #2e7d32; }
.badge-cancelled { background: #ffebee; color: #c62828; }
.badge-delivered { background: #e3f2fd; color: #0277bd; }
.badge-waiting { background: #fffde7; color: #f9a825; }
.badge-repairing { background: #f3e5f5; color: #7b1fa2; }
.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #f5f5f5; color: #616161; }

/* Buttons */
.btn { border-radius: 8px; padding: 8px 20px; font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); }
.btn-warning { background: var(--warning); border-color: var(--warning); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* Tables */
.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
}
.table td { vertical-align: middle; font-size: 0.9rem; }

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    font-size: 0.9rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26,35,126,0.15);
}
.form-label { font-weight: 500; font-size: 0.9rem; color: #333; }

/* Footer */
.footer {
    background: #fff;
    padding: 15px 0;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #666;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

/* POS Styles */
.pos-container { display: flex; gap: 20px; min-height: calc(100vh - 120px); }
.pos-products { flex: 1; }
.pos-cart { width: 400px; flex-shrink: 0; }
.pos-search { position: relative; }
.pos-search input { padding-left: 40px; }
.pos-search i { position: absolute; left: 15px; top: 14px; color: #999; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.product-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
}
.product-item:hover { border-color: var(--primary); box-shadow: 0 4px 15px rgba(26,35,126,0.15); transform: translateY(-2px); }
.product-item .product-name { font-size: 0.85rem; font-weight: 600; margin: 5px 0; }
.product-item .product-price { color: var(--primary); font-weight: 700; font-size: 1rem; }
.product-item .product-stock { font-size: 0.75rem; color: #666; }
.cart-items { max-height: 400px; overflow-y: auto; }
.cart-item { padding: 10px; border-bottom: 1px solid #eee; font-size: 0.85rem; }
.cart-summary { background: #f8f9fa; padding: 15px; border-radius: 8px; }
.cart-summary .row { margin-bottom: 8px; }

/* Print styles */
@media print {
    .sidebar, .navbar, .footer, .btn, .no-print { display: none !important; }
    .content-wrapper { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar { margin-left: calc(var(--sidebar-width) * -1); }
    .sidebar.active { margin-left: 0; }
    .content-wrapper { margin-left: 0; width: 100%; }
    .footer { margin-left: 0; width: 100%; }
    .pos-container { flex-direction: column; }
    .pos-cart { width: 100%; }
}

@media (max-width: 767px) {
    .stat-card .stat-value { font-size: 1.3rem; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .content-wrapper { padding: 15px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Modal */
.modal-content { border-radius: 12px; border: none; }
.modal-header { background: #f8f9fa; border-radius: 12px 12px 0 0; }

/* Additional */
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 20px; }
.text-primary-custom { color: var(--primary); }
.bg-light-custom { background: #f0f2f5; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.empty-state { text-align: center; padding: 40px; color: #999; }
.empty-state i { font-size: 3rem; margin-bottom: 15px; }
