:root {
    --primary: #1e293b;
    --secondary: #0f172a;
    --accent: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --text: #f8fafc;
    --text-light: #94a3b8;
    --table-bg: #f1f5f9;
    --table-border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--secondary);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--primary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.date-time {
    text-align: right;
}

#current-date {
    font-size: 1.1rem;
    font-weight: 600;
}

#current-time {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    padding: 1rem;
    gap: 1rem;
    overflow: hidden;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 400px;
}

.right-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 500px;
}

/* Cards */
.card {
    background: var(--primary);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h2 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tables */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.table {
    background: var(--secondary);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.table:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.table.selected {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.table-number {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.table-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.table-status.free {
    background: var(--success);
    color: white;
}

.table-status.occupied {
    background: var(--warning);
    color: white;
}

.table-status.paid {
    background: var(--info);
    color: white;
}

.table-total {
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--accent);
}

/* Current Order */
.current-order {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-items {
    max-height: 300px;
    overflow-y: auto;
    background: var(--secondary);
    border-radius: 8px;
    padding: 1rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.order-item:last-child {
    margin-bottom: 0;
}

.item-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.item-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--secondary);
    border-radius: 20px;
    padding: 0.25rem;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.quantity-btn:hover {
    background: #2563eb;
}

.item-quantity {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.item-total {
    font-weight: 600;
    color: var(--accent);
    min-width: 80px;
    text-align: right;
}

.delete-item {
    background: var(--danger);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-item:hover {
    background: #dc2626;
}

.empty-order {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.order-summary {
    background: var(--secondary);
    border-radius: 8px;
    padding: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
}

.order-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #0da271;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-info:hover {
    background: #0891b2;
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: #64748b;
}

/* Categories */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.category-btn {
    padding: 0.5rem 1rem;
    background: var(--accent);
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-btn:hover {
     background: var(--accent);
    color: white;
}

.category-btn.active {
    background: var(--accent);
    color: white;
}

/* Search */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--secondary);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* Products */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.product-card {
    background: var(--secondary);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.product-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.product-price {
    color: var(--accent);
    font-weight: 600;
    font-size: 1.1rem;
    white-space: nowrap;
}

.product-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.add-to-order {
    flex: 1;
    padding: 0.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.add-to-order:hover {
    background: #2563eb;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--primary);
    border-radius: 10px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-content.large {
    max-width: 800px;
}

.modal-content.receipt {
    max-width: 400px;
}

.modal-content.kitchen-order {
    max-width: 450px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 1rem;
}

/* Payment Modal */
.payment-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.payment-summary {
    background: var(--secondary);
    border-radius: 8px;
    padding: 1.5rem;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.payment-row:last-child {
    margin-bottom: 0;
}

.payment-row span:first-child {
    font-weight: 500;
}

#payment-total {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
}

#amount-received {
    width: 150px;
    padding: 0.5rem;
    background: var(--primary);
    border: 2px solid var(--accent);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
    text-align: right;
}

#change-amount {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--success);
}

.payment-methods {
    background: var(--secondary);
    border-radius: 8px;
    padding: 1.5rem;
}

.payment-methods h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.methods {
    display: flex;
    gap: 1rem;
}

.method-option {
    flex: 1;
    background: var(--primary);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.method-option:hover {
    border-color: var(--accent);
}

.method-option input[type="radio"] {
    margin-right: 0.5rem;
}

/* Receipt */
#receipt-content {
    background: white;
    color: #333;
    padding: 2rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
}

.receipt-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed #ccc;
}

.receipt-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.receipt-info {
    margin-bottom: 1.5rem;
}

.receipt-info div {
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
}

.receipt-items {
    margin-bottom: 1.5rem;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #eee;
}

.receipt-item:last-child {
    border-bottom: none;
}

.receipt-total {
    border-top: 2px solid #333;
    padding-top: 1rem;
    margin-top: 1rem;
}

.receipt-total div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.receipt-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px dashed #ccc;
    font-size: 0.9rem;
    color: #666;
}

/* Kitchen Order Styles */
#kitchen-order-content {
    background: white;
    color: #333;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.kitchen-order-print {
    width: 100%;
}

.kitchen-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.kitchen-header h2 {
    font-size: 16px;
    margin: 0;
    text-transform: uppercase;
    font-weight: bold;
}

.kitchen-header p {
    margin: 2px 0;
    font-size: 12px;
}

.kitchen-info {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px dashed #000;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
    font-size: 12px;
}

.items-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    border-bottom: 1px solid #000;
    padding-bottom: 3px;
    margin-bottom: 5px;
    font-size: 12px;
}

.category-section {
    margin-bottom: 10px;
}

.category-title {
    font-weight: bold;
    background: #f0f0f0;
    padding: 2px 5px;
    margin-bottom: 3px;
    font-size: 12px;
}

.kitchen-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
    padding-left: 10px;
    font-size: 11px;
}

.item-quantity {
    font-weight: bold;
    color: #000;
}

.kitchen-totals {
    border-top: 2px solid #000;
    margin-top: 10px;
    padding-top: 5px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 12px;
}

.kitchen-notes {
    margin-top: 10px;
    padding: 5px;
    border: 1px dashed #000;
    font-size: 10px;
    background: #fff8dc;
}

.kitchen-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 10px;
    border-top: 1px dashed #000;
    padding-top: 5px;
}

/* Report Modal */
.report-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-selector input {
    padding: 0.5rem;
    background: var(--secondary);
    border: 2px solid transparent;
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
}

.date-selector input:focus {
    outline: none;
    border-color: var(--accent);
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--secondary);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.summary-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.summary-icon.primary {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
}

.summary-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.summary-info h4 {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.summary-info p {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.report-details h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.table-container {
    overflow-x: auto;
    background: var(--secondary);
    border-radius: 8px;
    padding: 1rem;
}

#orders-table {
    width: 100%;
    border-collapse: collapse;
}

#orders-table th {
    background: var(--primary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

#orders-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#orders-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Footer */
.footer {
    background: var(--primary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.footer-info {
    display: flex;
    gap: 2rem;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.footer-item i {
    color: var(--accent);
}

.footer-item strong {
    color: var(--text);
}

.footer-actions {
    display: flex;
    gap: 1rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .date-time {
        text-align: center;
    }
    
    .tables-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .report-summary {
        grid-template-columns: 1fr;
    }
    
    .footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Print Styles for Kitchen Orders */
@media print {
    .kitchen-order-print {
        width: 80mm !important;
        margin: 0 !important;
        padding: 5px !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
    }
    
    .kitchen-header h2 {
        font-size: 14px !important;
    }
    
    .kitchen-item {
        font-size: 10px !important;
    }
    
    /* Hide all other elements when printing */
    body * {
        visibility: hidden;
    }
    
    #kitchen-order-content,
    #kitchen-order-content * {
        visibility: visible;
    }
    
    #kitchen-order-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
    }
}