:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --light: #f8fafc;
    --dark: #1e293b;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f1f5f9;
    color: #334155;
}

.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-icon {
    font-size: 4rem;
    color: var(--primary);
    display: block;
}

.login-logo {
    max-height: 80px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--dark);
    color: white;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand img { height: 40px; border-radius: 8px; }

.sidebar-brand h5 { margin: 0; font-size: 1.1rem; font-weight: 600; }

.sidebar-nav { padding: 10px 0; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav .nav-link.active {
    background: rgba(37,99,235,0.2);
    color: white;
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link i { font-size: 1.2rem; width: 24px; text-align: center; }

.sidebar-section {
    padding: 10px 20px 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-area { padding: 30px; }

/* Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary);
}

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.info { border-left-color: var(--info); }

.stat-card h3 { font-size: 2rem; font-weight: 700; color: var(--dark); }
.stat-card p { color: var(--secondary); margin: 0; }

.card-custom {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: none;
}

.card-custom .card-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 24px;
    border-radius: 12px 12px 0 0 !important;
}

/* Tables */
.table-custom { margin: 0; }
.table-custom th { 
    background: var(--light); 
    font-weight: 600; 
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
    border-bottom: 2px solid #e2e8f0;
}
.table-custom td { vertical-align: middle; padding: 12px 16px; }

/* Space/Table Grid */
.space-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 10px 0;
}

.table-box {
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.table-box.free {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.table-box.occupied {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.table-box.reserved {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.table-box:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.table-box .table-number { font-size: 1.5rem; font-weight: 700; }
.table-box .table-capacity { font-size: 0.8rem; opacity: 0.8; }

/* Kitchen */
.kitchen-order {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 16px;
}

.kitchen-order-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.kitchen-order-items { padding: 12px 16px; }

.kitchen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.kitchen-item:last-child { border-bottom: none; }

.kitchen-item .qty {
    background: var(--primary);
    color: white;
    border-radius: 6px;
    padding: 2px 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Status badges */
.badge-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-free { background: #dcfce7; color: #166534; }
.badge-occupied { background: #fee2e2; color: #991b1b; }
.badge-reserved { background: #fef3c7; color: #92400e; }

/* Product menu grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #e2e8f0;
    text-align: center;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37,99,235,0.15);
    transform: translateY(-2px);
}

.product-card.selected {
    border-color: var(--primary);
    background: #eff6ff;
}

.product-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 1.5rem;
}

.product-card .product-name { font-weight: 600; margin-bottom: 2px; font-size: 0.85rem; }
.product-card .product-desc { color: #94a3b8; font-size: 0.7rem; margin-bottom: 4px; }
.product-card .product-price { color: var(--primary); font-weight: 700; font-size: 1rem; }

/* Buttons */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-sidebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    background: none;
    width: 100%;
    font-size: 0.95rem;
}

.btn-sidebar:hover { background: rgba(255,255,255,0.1); color: white; }
.btn-sidebar i { font-size: 1.2rem; width: 24px; text-align: center; }

/* Payment methods */
.payment-method-btn {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.payment-method-btn:hover { border-color: var(--primary); background: #eff6ff; }
.payment-method-btn.active { border-color: var(--primary); background: #eff6ff; }
.payment-method-btn i { font-size: 1.5rem; display: block; margin-bottom: 8px; color: var(--primary); }

/* Ticket/Print */
.ticket {
    width: 80mm;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #000;
    background: white;
    padding: 10px;
}

.ticket-header { text-align: center; margin-bottom: 10px; border-bottom: 1px dashed #000; padding-bottom: 10px; }
.ticket-header img { max-width: 60mm; max-height: 20mm; }
.ticket-divider { border-top: 1px dashed #000; margin: 8px 0; }
.ticket-row { display: flex; justify-content: space-between; }
.ticket-item { padding: 3px 0; }

/* Mobile waiter */
.mobile-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 10px;
}

/* Print styles */
@media print {
    .no-print { display: none !important; }
    body { background: white; margin: 0; }
    .main-content { margin: 0; }
    .ticket { box-shadow: none; border: none; }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .content-area { padding: 15px; }
}

/* Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse { animation: pulse 2s infinite; }
