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

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

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 14px;
    opacity: 0.8;
}

.sidebar.collapsed .sidebar-header h1,
.sidebar.collapsed .sidebar-header p {
    display: none;
}

.sidebar-toggle {
    position: absolute;
    right: -15px;
    top: 50%;
    background: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    color: #667eea;
    font-weight: bold;
    z-index: 10;
}

.menu-items {
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: #fff;
}

.menu-item.active {
    background: rgba(255,255,255,0.2);
    border-left-color: #fff;
}

.menu-item i {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .menu-item span {
    display: none;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 15px;
}

.sidebar.collapsed .menu-item i {
    margin-right: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h2 {
    font-size: 28px;
    color: #2c3e50;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-badge {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left: 5px solid;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.blue { border-left-color: #3498db; }
.stat-card.green { border-left-color: #2ecc71; }
.stat-card.purple { border-left-color: #9b59b6; }
.stat-card.orange { border-left-color: #f39c12; }

.stat-card h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-card .change {
    font-size: 12px;
    color: #27ae60;
}

/* Sales Interface */
.sales-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    height: calc(100vh - 140px);
}

.products-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #3498db;
}

.barcode-input {
    width: 300px;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
}

.barcode-input:focus {
    border-color: #e74c3c;
}

.search-btn {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #2980b9;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    flex: 1;
    overflow-y: auto;
}

.product-card {
    background: #f8f9fa;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.product-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.product-card .category {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.product-card .price {
    font-size: 18px;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 8px;
}

.product-card .stock {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 15px;
    color: white;
}

.stock.high { background: #27ae60; }
.stock.medium { background: #f39c12; }
.stock.low { background: #e74c3c; }

/* Cart Section */
.cart-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.customer-selection {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.customer-selection select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.customer-selection select:focus {
    border-color: #3498db;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    max-height: 300px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h5 {
    font-size: 14px;
    margin-bottom: 4px;
}

.cart-item-info .price {
    font-size: 12px;
    color: #7f8c8d;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: background 0.3s;
}

.qty-btn:hover {
    background: #bdc3c7;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.remove-btn:hover {
    background: #c0392b;
}

.cart-summary {
    border-top: 2px solid #ecf0f1;
    padding-top: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    border-top: 1px solid #ecf0f1;
    padding-top: 8px;
    margin-top: 8px;
}

.discount-btn {
    width: 100%;
    padding: 12px;
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.discount-btn:hover {
    background: #e67e22;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.payment-btn {
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 600;
}

.payment-btn.active {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.payment-btn:hover {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease;
}

.checkout-btn:hover {
    background: #229954;
}

.checkout-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Table Styles */
.data-table {
    width: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s;
    padding: 5px;
}

.action-btn.btn-edit i {
    color: #3498db;
}

.action-btn.btn-delete i {
    color: #e74c3c;
}

.action-btn:hover i {
    color: #000;
}

.btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 10px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #2980b9;
}

/* Hide sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
    text-align: center;
}

.modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ecf0f1;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s;
}

.modal-content input:focus {
    border-color: #3498db;
}

.modal-content button {
    width: 48%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.modal-content button[type="submit"] {
    background: #27ae60;
    color: white;
    margin-right: 4%;
}

.modal-content button[type="submit"]:hover {
    background: #229954;
}

.modal-content button[type="button"] {
    background: #e74c3c;
    color: white;
}

.modal-content button[type="button"]:hover {
    background: #c0392b;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .menu-item span {
        display: none;
    }
    
    .sales-container {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .customer-selection {
        flex-direction: column;
    }

    .modal-content {
        padding: 15px;
    }

    .modal-content button {
        width: 100%;
        margin: 5px 0;
    }

    .modal-content button[type="submit"] {
        margin-right: 0;
    }
}