/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

body.dark {
    background: #1a1a1a;
    color: #e0e0e0;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    color: white;
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.header-center {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.2);
    border-radius: 25px;
    padding: 0.5rem 1rem;
}

.search-box i {
    color: rgba(255,255,255,0.7);
    margin-right: 0.5rem;
}

.search-box input {
    background: none;
    border: none;
    color: white;
    outline: none;
    flex: 1;
    font-size: 1rem;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.7);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Ensure mobile menu button stays clickable above overlays */
.menu-toggle { z-index: 1101; position: relative; }
.sidebar.mobile-open { z-index: 1100; }
.notification-dropdown { z-index: 1102; }

/* Sidebar mobile overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.theme-toggle, .notification {
    position: relative;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover, .notification:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    cursor: pointer;
}

.profile-img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.profile-avatar-small {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-placeholder {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.avatar-placeholder:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.user-profile span {
    font-weight: 500;
}

.user-profile .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 150px;
    z-index: 1000;
}

.user-profile:hover .dropdown {
    display: block;
}

.dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
}

.dropdown a:hover {
    background: #f8f9fa;
}

.dropdown a:last-child {
    border-bottom: none;
}

/* Main Container */
.main-container {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    transition: all 0.3s ease;
    position: fixed;
    height: calc(100vh - 80px);
    left: 0;
    top: 80px;
    z-index: 999;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 70px;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    margin-bottom: 0.1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link i {
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.nav-link:hover, .nav-link.active {
    background: #34495e;
    color: white;
    border-right: 3px solid #3498db;
}

.content-area {
    margin-left: 250px;
    flex: 1;
    padding: 2rem;
    transition: all 0.3s ease;
    width: calc(100% - 250px);
}

.sidebar.collapsed + .content-area {
    margin-left: 70px;
    width: calc(100% - 70px);
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

body.dark .card {
    background: #2d3748;
    border-color: #4a5568;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.card-icon i {
    font-size: 1.8rem;
}

.card:nth-child(1) .card-icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.card:nth-child(2) .card-icon { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.card:nth-child(3) .card-icon { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.card:nth-child(4) .card-icon { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

.card-content h3 {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

body.dark .card-content h3 {
    color: #a0aec0;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

body.dark .stat-number {
    color: #e2e8f0;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

body.dark .action-card {
    background: #2d3748;
    border-color: #4a5568;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.action-card:hover::before {
    left: 100%;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.action-card i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1rem;
    display: block;
}

.action-card h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

body.dark .action-card h3 {
    color: #e2e8f0;
}

/* Recent Sales Table */
.recent-sales h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

body.dark .recent-sales h2 {
    color: #e2e8f0;
}

.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

body.dark .table-container {
    background: #2d3748;
    border-color: #4a5568;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

body.dark th, body.dark td {
    border-bottom-color: #4a5568;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark th {
    background: #4a5568;
    color: #e2e8f0;
}

tr:hover {
    background: #f8f9fa;
}

body.dark tr:hover {
    background: #4a5568;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status.completed {
    background: #d4edda;
    color: #155724;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Sales Page Styles */
.sales-container {
    max-width: 1200px;
    margin: 0 auto;
}

.sales-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.product-search {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.product-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.product-search input:focus {
    outline: none;
    border-color: #3498db;
}

.product-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

body.dark .product-card {
    background: #2d3748;
    border-color: #4a5568;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.product-image {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.product-image i {
    font-size: 3rem;
    color: #bdc3c7;
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #3498db;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.product-info h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-size: 1.1rem;
    line-height: 1.3;
}

body.dark .product-info h3 {
    color: #e2e8f0;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

body.dark .product-meta {
    color: #a0aec0;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #27ae60;
    margin: 0.5rem 0;
}

.product-stock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.stock-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e74c3c;
}

.stock-low .stock-indicator {
    background: #f39c12;
}

.stock-high .stock-indicator {
    background: #27ae60;
}

.add-to-cart {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 80px;
    width: 400px;
    height: calc(100vh - 80px);
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    margin-bottom: 0.25rem;
    color: #2c3e50;
    font-size: 1rem;
}

.cart-item-price {
    font-weight: 600;
    color: #27ae60;
    font-size: 1.1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.25rem;
}

.cart-total {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #3498db;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.grand-total {
    font-size: 1.5rem;
    color: #27ae60;
    font-weight: 700;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Inventory Page */
.inventory-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select, .filter-input {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    min-width: 150px;
}

body.dark .filter-select, body.dark .filter-input {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.add-product-form {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

body.dark .add-product-form {
    background: #2d3748;
    border-color: #4a5568;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

body.dark .form-group label {
    color: #e2e8f0;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

body.dark .form-group input,
body.dark .form-group select,
body.dark .form-group textarea {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e0e0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

/* Prevent flex/grid children from overflowing and overlapping */
.form-grid > .form-group { min-width: 0; }

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.inventory-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

body.dark .inventory-table {
    background: #2d3748;
    border-color: #4a5568;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

body.dark .table-header {
    background: #4a5568;
    border-bottom-color: #718096;
}

.table-header h3 {
    color: #2c3e50;
    font-size: 1.2rem;
}

body.dark .table-header h3 {
    color: #e2e8f0;
}

/* Customer Management */
.customer-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

body.dark .customer-card {
    background: #2d3748;
    border-color: #4a5568;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.customer-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
}

body.dark .customer-name {
    color: #e2e8f0;
}

.customer-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

body.dark .customer-meta {
    color: #a0aec0;
}

.customer-sales {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

body.dark .customer-sales {
    background: #4a5568;
}

/* Reports Page */
.reports-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.report-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    text-align: center;
}

body.dark .report-card {
    background: #2d3748;
    border-color: #4a5568;
}

.report-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.report-icon.sales { color: #e74c3c; }
.report-icon.profit { color: #27ae60; }
.report-icon.stock { color: #3498db; }
.report-icon.customers { color: #9b59b6; }

.report-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

body.dark .report-number {
    color: #e2e8f0;
}

.report-label {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 500;
}

body.dark .report-label {
    color: #a0aec0;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

body.dark .chart-container {
    background: #2d3748;
    border-color: #4a5568;
}

/* Settings Page */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

body.dark .settings-section {
    background: #2d3748;
    border-color: #4a5568;
}

.settings-section h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.3rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

body.dark .settings-section h3 {
    color: #e2e8f0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        margin: 0;
    }
    
    .header-right {
        order: 2;
    }
    
    .search-box {
        max-width: none;
    }
    
    .sidebar {
        transform: translateX(-100%);
        z-index: 1100;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .content-area {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .sales-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .inventory-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select, .filter-input {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .table-container table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    .card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* Dark Mode Styles */
body.dark {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d3748;
    --text-primary: #e0e0e0;
    --text-secondary: #a0aec0;
    --border-color: #4a5568;
    --card-bg: #2d3748;
}

body.dark .logo-img {
    filter: brightness(0) invert(1);
}

body.dark .product-card:hover {
    border-color: #63b3ed;
}

body.dark .add-to-cart {
    background: linear-gradient(135deg, #48bb78 0%, #68d391 100%);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert i {
    font-size: 1.2rem;
}

/* Invoice Styles */
.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.invoice-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.invoice-body {
    padding: 2rem;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.invoice-table th,
.invoice-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.invoice-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.invoice-total {
    text-align: right;
    font-size: 1.2rem;
    font-weight: 700;
    color: #27ae60;
    padding: 1rem 0;
    border-top: 2px solid #3498db;
}

.print-btn {
    display: block;
    margin: 1rem auto;
    padding: 1rem 2rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.print-btn:hover {
    background: #2980b9;
}

/* Profile Page Styles */
.profile-container {
    display: grid;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-form-card,
.password-form-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
    overflow: hidden;
    transition: all 0.3s ease;
}

body.dark .profile-form-card,
body.dark .password-form-card {
    background: #2d3748;
    border-color: #4a5568;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.profile-form-card:hover,
.password-form-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

body.dark .profile-form-card:hover,
body.dark .password-form-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-bottom: 1px solid #e1e5e9;
}

body.dark .card-header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-bottom-color: #4a5568;
}

.card-header h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

body.dark .card-header h3 {
    color: #e2e8f0;
}

.card-header h3 i {
    color: #667eea;
    font-size: 1.3rem;
}

.card-subtitle {
    margin: 0;
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 500;
}

body.dark .card-subtitle {
    color: #a0aec0;
}

.profile-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.profile-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.profile-avatar-container {
    position: relative;
    display: inline-block;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.profile-avatar:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    backdrop-filter: blur(10px);
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: #fff;
    color: #667eea;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 2;
}

.avatar-upload-btn:hover {
    background: #f8f9fa;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.avatar-upload-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.profile-details h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.role-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    display: inline-block;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.status-online {
    color: #4ade80;
    font-size: 0.7rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    word-break: break-all;
}

.profile-form,
.password-form {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-form .form-group,
.password-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-form label,
.password-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

body.dark .profile-form label,
body.dark .password-form label {
    color: #d1d5db;
}

.profile-form label i,
.password-form label i {
    color: #667eea;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.profile-form h3,
.password-form h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    color: #333;
    font-size: 1.4rem;
    font-weight: 700;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f3f4;
}

.dark .profile-form h3,
.dark .password-form h3 {
    color: #e0e0e0;
    border-bottom-color: #444;
}

.profile-form .form-group,
.password-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-form label,
.password-form label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.dark .profile-form label,
.dark .password-form label {
    color: #d1d5db;
}

.profile-form input,
.password-form input {
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
    font-weight: 500;
}

.dark .profile-form input,
.dark .password-form input {
    background: #1f1f1f;
    border-color: #4b5563;
    color: #e0e0e0;
}

.profile-form input:focus,
.password-form input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.dark .profile-form input:focus,
.dark .password-form input:focus {
    background: #2a2a2a;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.profile-form input::placeholder,
.password-form input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

body.dark .profile-form input::placeholder,
body.dark .password-form input::placeholder {
    color: #6b7280;
}

.profile-form .btn,
.password-form .btn {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.profile-form .btn::before,
.password-form .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.profile-form .btn:hover::before,
.password-form .btn:hover::before {
    left: 100%;
}

.btn.warning {
    background: #f39c12;
    color: white;
}

.btn.warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

body.dark .form-actions {
    border-top-color: #4b5563;
}

.form-actions .btn {
    align-self: auto;
    min-width: 160px;
    justify-content: center;
}

/* Alert Styles for Profile */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.dark .alert.success {
    background: #1e4d2b;
    color: #a3d9a4;
    border-color: #2d5a3d;
}

.dark .alert.error {
    background: #4d1e1e;
    color: #f5a3a3;
    border-color: #5a2d2d;
}

.alert i {
    font-size: 1.2rem;
}

/* Responsive Design for Profile */
@media (max-width: 768px) {
    .profile-container {
        gap: 1.5rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .profile-form .btn,
    .password-form .btn {
        align-self: stretch;
        justify-content: center;
    }
}