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

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
}

.header {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-nav {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-btn:hover {
    background: #34495e;
}

.logout {
    background: #e74c3c;
}

.container {
    padding: 1rem;
}

/* POS Layout */
.pos-container {
    display: grid;
    grid-template-columns: 200px 1fr 350px;
    gap: 1rem;
    height: calc(100vh - 80px);
}

.categories-sidebar {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-btn {
    padding: 1rem;
    border: none;
    background: #ecf0f1;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.category-btn:hover, .category-btn.active {
    background: #3498db;
    color: white;
}

.products-grid {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
}

.products-grid #products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.product-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-price {
    font-weight: bold;
    color: #27ae60;
    margin-top: 0.5rem;
}

.order-panel {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.clear-order {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.order-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.order-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    background: #3498db;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
}

.order-totals {
    border-top: 2px solid #eee;
    padding-top: 1rem;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.grand-total {
    font-size: 1.2em;
    font-weight: bold;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
}

.order-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-discount, .btn-checkout {
    padding: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
}

.btn-discount {
    background: #f39c12;
    color: white;
}

.btn-checkout {
    background: #27ae60;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    float: right;
    font-size: 1.5em;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 1024px) {
    .pos-container {
        grid-template-columns: 150px 1fr 300px;
    }
}

@media (max-width: 768px) {
    .pos-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .categories-sidebar {
        flex-direction: row;
        overflow-x: auto;
    }
}