:root {
    /* Modern color palette */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-700: #374151;
    --gray-800: #1f2937;
    /* Header colors */
    --header-bg: #1e40af;
    --header-text: #ffffff;
    /* Table header colors */
    --table-header-bg: #38503f;
    --table-header-text: #ffffff;
    /* Animation durations */
    --transition-speed: 0.1s;
}

* {
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background: var(--gray-100);
    width: 1366px;
    height: 768px;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Enhanced Header Styles */
.header {
    background: var(--header-bg);
    padding: 0rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    color: var(--header-text);
    width: 100%;
}

/* Enhanced Dashboard Styles */
.dashboard {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
    height: 548px;
    transition: height var(--transition-speed) ease;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.stats-table th,
.stats-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.stats-table th {
    background: var(--table-header-bg);
    color: var(--header-text);
    font-weight: 600;
}

.stats-table tr:hover td {
    background: var(--gray-50);
}

/* Orders Container and Grid */
.orders-container {
    height: 763px;
}

.orders-grid {
    display: flex;
    gap: 1rem;
    margin-right: 0;
    height: 82%;
    background-color: #F2E8E8;
    overflow: scroll;
}

/* Enhanced Order Card Styles */
.order-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex: 0 0 280px;
    max-height: 100%;
    transition: transform var(--transition-speed) ease;
    margin-right: 9px;
    margin-top: 7px;
}

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

/* Enhanced Order Header Styles */
.order-header {
    padding: 0.3rem 1rem 0rem;
    background: rgba(16, 19, 80, 0.769);
    color: white;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    flex-shrink: 0;
    height: 70px;
}

.order-timer {
    font-family: monospace;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--warning-light);
}

/* Order Items Container */
.order-items {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0.75rem;
    padding: 0.4rem 1rem;
    overflow: hidden;
    align-content: start;
}

/* Dynamic Grid Templates Based on Item Count */
.order-card[data-items="1"] .order-items,
.order-card[data-items="2"] .order-items,
.order-card[data-items="3"] .order-items,
.order-card[data-items="4"] .order-items,
.order-card[data-items="5"] .order-items,
.order-card[data-items="6"] .order-items {
    grid-template-columns: repeat(1, 1fr);
}

.order-card[data-items="7"] .order-items,
.order-card[data-items="8"] .order-items,
.order-card[data-items="9"] .order-items,
.order-card[data-items="10"] .order-items,
.order-card[data-items="11"] .order-items,
.order-card[data-items="12"] .order-items {
    grid-template-columns: repeat(2, 1fr);
}

.order-card[data-items="13"] .order-items,
.order-card[data-items="14"] .order-items,
.order-card[data-items="15"] .order-items,
.order-card[data-items="16"] .order-items,
.order-card[data-items="17"] .order-items,
.order-card[data-items="18"] .order-items {
    grid-template-columns: repeat(3, 1fr);
}

/* Dynamic Card Widths */
.order-card[data-items="7"],
.order-card[data-items="8"],
.order-card[data-items="9"],
.order-card[data-items="10"],
.order-card[data-items="11"],
.order-card[data-items="12"] {
    flex: 0 0 560px;
}

.order-card[data-items="13"],
.order-card[data-items="14"],
.order-card[data-items="15"],
.order-card[data-items="16"],
.order-card[data-items="17"],
.order-card[data-items="18"] {
    flex: 0 0 840px;
}

/* Enhanced Order Item Styles */
.order-item {
    background: var(--gray-50);
    padding: 0rem 0.9rem;
    border-radius: 0.5rem;
    border: 1px solid #D2BCBC;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.order-item:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Item status styles */
.status-new {
    background: white;
}

.status-cooking {
    background: var(--warning-light);
    border-color: var(--warning);
}

.status-done {
    background: var(--success-light);
    border-color: var(--success);
}

/* Undo highlight style */
.undo-highlight {
    animation: highlightUndo 2s ease-out;
    border: 2px solid var(--primary);
}

@keyframes highlightUndo {
    0% {
        background: var(--primary);
        transform: scale(1.05);
    }
    
    100% {
        background: var(--gray-50);
        transform: scale(1);
    }
}

/* Enhanced Order Footer */
.order-footer {
    padding: 0.5rem 1rem 0rem;
    border-top: 1px solid var(--gray-200);
    background: white;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    flex-shrink: 0;
    height: 50px;
}

/* Enhanced Button Styles */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-right: 7px;
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #D97706;
}

.btn-gray {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-gray:hover {
    background: var(--gray-300);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Enhanced Resume Dialog */
.resume-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.resume-content {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.resume-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.resume-item {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    background: var(--gray-50);
}

.resume-table {
    margin-left: 1rem;
    color: var(--gray-700);
    padding: 0.25rem 0;
}

/* Utility Classes */
.text-sm {
    font-size: 0.875rem;
    padding-top: 0;
}

.font-bold {
    font-weight: 700;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.quantity-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.main-qty {
    font-weight: bold;
    font-size: 1.1em;
}

.similar-items {
    margin-top: -1px;
    font-size: 0.8em;
    color: var(--gray-600);
    display: compact;
}

.similar-item {
    color: var(--primary);
    font-style: italic;
}

.text-primary {
    color: var(--primary);
}

.ml-2 {
    margin-left: 0.5rem;
}
