/* Dosa King - Main Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: #f8f7ff; color: #1a1a2e; }

:root {
  --lavender: #e8e4f3;
  --lavender-dark: #9c88d4;
  --lavender-deep: #7c5cbf;
  --soft-blue: #dbeafe;
  --blue-accent: #3b82f6;
  --pink: #fce7f3;
  --pink-accent: #ec4899;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--lavender); }
::-webkit-scrollbar-thumb { background: var(--lavender-dark); border-radius: 3px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes countdown { from { stroke-dashoffset: 0; } }

.fade-in { animation: fadeIn 0.3s ease forwards; }
.slide-in { animation: slideIn 0.3s ease forwards; }
.pulse { animation: pulse 2s infinite; }

/* Layout */
.app-container { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: linear-gradient(180deg, #1a0533 0%, #2d1257 100%); color: white; display: flex; flex-direction: column; position: fixed; height: 100vh; left: 0; top: 0; z-index: 100; transition: transform 0.3s; }
.sidebar-logo { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo h1 { font-size: 22px; font-weight: 800; color: white; }
.sidebar-logo span { font-size: 28px; }
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent; font-size: 14px; font-weight: 500; }
.nav-item:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-item.active { color: white; background: rgba(255,255,255,0.15); border-left-color: #c084fc; }
.nav-item i { width: 20px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--pink-accent); color: white; border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700; }

.main-content { margin-left: 260px; flex: 1; min-height: 100vh; }
.topbar { background: white; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.topbar-title { font-size: 20px; font-weight: 700; color: var(--gray-700); }
.page-content { padding: 24px; }

/* Cards */
.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; color: var(--gray-700); }

/* Stat Cards */
.stat-card { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.lavender { background: var(--lavender); }
.stat-icon.blue { background: var(--soft-blue); }
.stat-icon.pink { background: var(--pink); }
.stat-icon.green { background: #d1fae5; }
.stat-icon.orange { background: #ffedd5; }
.stat-icon.yellow { background: #fef3c7; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--gray-700); }
.stat-label { font-size: 12px; color: var(--gray-600); font-weight: 500; margin-top: 2px; }

/* Tables */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--lavender); padding: 12px 16px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--lavender-deep); }
td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-queued { background: #fef3c7; color: #92400e; }
.badge-preparing { background: #dbeafe; color: #1e40af; }
.badge-ready { background: #d1fae5; color: #065f46; }
.badge-completed { background: #e5e7eb; color: #374151; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-low { background: #fee2e2; color: #991b1b; }
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-cash { background: #fef3c7; color: #92400e; }
.badge-online { background: #dbeafe; color: #1e40af; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: var(--lavender-deep); color: white; }
.btn-primary:hover { background: #6b4aaa; }
.btn-secondary { background: var(--lavender); color: var(--lavender-deep); }
.btn-secondary:hover { background: #d4cff0; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.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-sm { padding: 5px 12px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.2s; background: white; }
.form-input:focus { border-color: var(--lavender-dark); box-shadow: 0 0 0 3px rgba(156,136,212,0.15); }
.form-select { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 14px; outline: none; background: white; cursor: pointer; }
.form-select:focus { border-color: var(--lavender-dark); }
.form-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 14px; outline: none; resize: vertical; min-height: 80px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: white; border-radius: 16px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); animation: fadeIn 0.2s ease; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; gap: 12px; justify-content: flex-end; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-600); padding: 4px; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }

/* Hero */
.hero { min-height: 100vh; background: linear-gradient(135deg, #1a0533 0%, #2d1257 40%, #4a1d96 100%); display: flex; align-items: center; justify-content: center; color: white; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.hero-content { text-align: center; z-index: 1; }
.hero-logo { font-size: 80px; margin-bottom: 16px; filter: drop-shadow(0 0 30px rgba(255,200,100,0.5)); }
.hero-title { font-size: 52px; font-weight: 800; margin-bottom: 12px; background: linear-gradient(135deg, #f8e3ff, #c4b5fd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 18px; color: rgba(255,255,255,0.8); margin-bottom: 40px; }
.hero-login-card { background: rgba(255,255,255,0.1); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.2); border-radius: 20px; padding: 40px; max-width: 400px; margin: 0 auto; }
.hero-float { position: absolute; border-radius: 50%; opacity: 0.1; animation: pulse 3s infinite; }

/* Status Colors */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-blue { color: var(--blue-accent); }
.text-purple { color: var(--lavender-deep); }
.text-muted { color: var(--gray-600); }

/* Cooking Queue */
.cooking-queue { background: linear-gradient(135deg, #1a0533, #2d1257); color: white; border-radius: var(--radius); padding: 20px; }
.progress-ring { transform: rotate(-90deg); }
.queue-item { background: rgba(255,255,255,0.1); border-radius: 10px; padding: 14px; margin-bottom: 8px; }
.queue-item.active { background: rgba(255,200,100,0.2); border: 1px solid rgba(255,200,100,0.4); }

/* Notification */
.notification-toast { position: fixed; top: 80px; right: 20px; z-index: 9999; max-width: 340px; }
.toast { background: white; border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-lg); border-left: 4px solid var(--lavender-deep); margin-bottom: 8px; animation: slideIn 0.3s ease; display: flex; align-items: flex-start; gap: 12px; }

/* Filter Chips */
.filter-chip { padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--gray-200); background: white; transition: all 0.2s; }
.filter-chip.active { background: var(--lavender-deep); color: white; border-color: var(--lavender-deep); }

/* Star Rating */
.stars { display: flex; gap: 4px; }
.star { font-size: 18px; cursor: pointer; }
.star.filled { color: #f59e0b; }
.star.empty { color: var(--gray-200); }

/* Search */
.search-box { position: relative; }
.search-box input { padding-left: 36px; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-600); }

/* Responsive */
@media (max-width: 1024px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .hero-title { font-size: 32px; }
}

/* Menu Item Card */
.menu-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px; transition: all 0.2s; cursor: pointer; }
.menu-card:hover { border-color: var(--lavender-dark); box-shadow: var(--shadow-md); }
.menu-card.selected { border-color: var(--lavender-deep); background: var(--lavender); }
.menu-card-symbol { font-size: 36px; text-align: center; margin-bottom: 10px; }
.menu-card-name { font-size: 14px; font-weight: 600; text-align: center; }
.menu-card-price { font-size: 16px; font-weight: 800; color: var(--lavender-deep); text-align: center; }
.menu-card-time { font-size: 12px; color: var(--gray-600); text-align: center; }

/* Qty controls */
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gray-200); background: white; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; font-weight: 700; transition: all 0.2s; }
.qty-btn:hover { background: var(--lavender); border-color: var(--lavender-dark); }
.qty-display { font-weight: 700; min-width: 20px; text-align: center; }

/* Timer */
.timer-circle { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.timer-text { position: absolute; text-align: center; }
.timer-minutes { font-size: 28px; font-weight: 800; }
.timer-label { font-size: 11px; opacity: 0.8; }

/* Inventory Status Bar */
.stock-bar { height: 6px; border-radius: 3px; background: var(--gray-200); overflow: hidden; }
.stock-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.stock-bar-fill.good { background: var(--success); }
.stock-bar-fill.warning { background: var(--warning); }
.stock-bar-fill.danger { background: var(--danger); }

/* Chart container */
.chart-container { position: relative; height: 260px; }

/* Tab Navigation */
.tabs { display: flex; gap: 4px; background: var(--lavender); padding: 4px; border-radius: 10px; }
.tab-btn { padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--gray-600); transition: all 0.2s; }
.tab-btn.active { background: white; color: var(--lavender-deep); box-shadow: var(--shadow); }

/* Sidebar toggle for mobile */
.menu-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--gray-700); }
@media (max-width: 768px) { .menu-toggle { display: block; } }

/* QR Code Box */
.qr-box { background: white; border-radius: 16px; padding: 20px; text-align: center; box-shadow: var(--shadow-lg); }

/* Order tracking */
.status-steps { display: flex; align-items: center; justify-content: space-between; margin: 20px 0; }
.status-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.status-step-circle { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; border: 2px solid var(--gray-200); color: var(--gray-600); background: white; }
.status-step.done .status-step-circle { background: var(--success); border-color: var(--success); color: white; }
.status-step.active .status-step-circle { background: var(--lavender-deep); border-color: var(--lavender-deep); color: white; animation: pulse 1.5s infinite; }
.status-step-label { font-size: 11px; font-weight: 500; color: var(--gray-600); }
.status-connector { flex: 1; height: 2px; background: var(--gray-200); }
.status-connector.done { background: var(--success); }
