:root {
    --color-bg: #f5f5f5;
    --color-card: #fff;
    --color-text: #333;
    --color-primary: #007bff;
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
    --color-new: #e3f2fd;
    --color-in-progress: #fff484;
    --color-completed: #e8f5e9;
    --color-cancelled: #ffebee;
    --color-urgent: #ffdd00;
    --color-very-urgent: #d51e1e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    background-color: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    padding: 1rem;
}

.kitchen-plan {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.table-card {
    background-color: var(--color-card);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    margin-bottom: auto;
}

.table-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.table-card-header {
    background-color: var(--color-primary);
    color: white;
    padding: 0.5rem 0.75rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-card-body {
    padding: 0.5rem;
    padding-bottom: 0;
}

.order-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 4px solid transparent;
    transition: background-color 0.2s ease;
}

.order-item:last-child {
    margin-bottom: 0.5rem;
}

.order-item:hover {
    background-color: rgba(0,0,0,0.03);
}

.order-item h6 {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
}

.order-item p {
    margin: 0.2em 0;
    font-size: 0.85em;
}

.order-item small {
    font-size: 0.75em;
    color: #666;
}

.order-actions {
    margin-top: 0.3rem;
    display: flex;
    justify-content: flex-end;
}

.btn {
    padding: 0.25rem 0.4rem;
    margin-left: 0.25rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-confirm { background-color: var(--color-success); color: white; }
.btn-delete { background-color: var(--color-danger); color: white; }
.btn-complete { background-color: var(--color-success); color: white; }
.btn-star, .btn-plus { background-color: transparent; color: var(--color-warning); font-size: 1.2em; padding: 0; }

.status-new { background-color: var(--color-new); }
.status-in-progress { background-color: var(--color-in-progress); }
.status-completed { background-color: var(--color-completed); }
.status-cancelled { background-color: var(--color-cancelled); }

.urgent { border-left-color: var(--color-urgent); }
.very-urgent { border-left-color: var(--color-very-urgent); }

.order-count {
    font-weight: bold;
    color: var(--color-primary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-primary);
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.order-history-sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: var(--color-card);
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
}

.order-history-sidebar.open {
    right: 0;
}

.order-history-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.order-history-content {
    padding: 1rem;
}

.history-item {
    border-bottom: 1px solid #eee;
    padding: 0.5rem 0;
}

.history-item:last-child {
    border-bottom: none;
}

.modal {
    display: block;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.table-timer {
    font-size: 0.8em;
    padding: 2px 5px;
    text-align: center;
    color: white;
    font-weight: bold;
}

@media (max-width: 600px) {
    .kitchen-plan {
        grid-template-columns: 1fr;
    }
}