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

:root {
  --lavender: #9B8EC4;
  --lavender-light: #C4B5E8;
  --lavender-dark: #6B5AA0;
  --soft-blue: #6B9FD4;
  --blue-light: #A8C8E8;
  --blue-dark: #4A7CB5;
  --pink: #E8A4C8;
  --pink-light: #F5D0E8;
  --pink-dark: #C87AAF;
  --white: #FFFFFF;
  --bg: #F0EEF8;
  --card-bg: rgba(255,255,255,0.85);
  --text-dark: #2D2640;
  --text-muted: #6B6280;
  --success: #48BB78;
  --warning: #ECC94B;
  --danger: #FC8181;
  --info: #63B3ED;
  --border: rgba(155, 142, 196, 0.2);
  --shadow: 0 8px 32px rgba(107, 90, 160, 0.12);
  --shadow-lg: 0 20px 60px rgba(107, 90, 160, 0.2);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  overflow-x: hidden;
}

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

/* ========== GLASS CARDS ========== */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}
.glass-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 12px; font-weight: 600;
  font-size: 14px; cursor: pointer; transition: all 0.2s ease;
  border: none; text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--lavender-dark), var(--lavender)); color: white; }
.btn-primary:hover { background: linear-gradient(135deg, var(--lavender), var(--lavender-dark)); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(107,90,160,0.4); }
.btn-secondary { background: rgba(155,142,196,0.1); color: var(--lavender-dark); border: 1px solid var(--lavender-light); }
.btn-secondary:hover { background: rgba(155,142,196,0.2); }
.btn-success { background: linear-gradient(135deg, #48BB78, #38A169); color: white; }
.btn-danger { background: linear-gradient(135deg, #FC8181, #E53E3E); color: white; }
.btn-warning { background: linear-gradient(135deg, #ECC94B, #D69E2E); color: white; }
.btn-info { background: linear-gradient(135deg, #63B3ED, #3182CE); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 10px; }

/* ========== FORMS ========== */
.form-input {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.8);
  font-size: 14px; color: var(--text-dark); transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.form-input:focus { outline: none; border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(155,142,196,0.2); }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-group { margin-bottom: 16px; }
.form-select {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.8);
  font-size: 14px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B5AA0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}
.form-select:focus { outline: none; border-color: var(--lavender); }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ========== BADGES ========== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-queued { background: rgba(100,116,139,0.15); color: #475569; }
.badge-preparing { background: rgba(234,179,8,0.15); color: #854d0e; }
.badge-ready { background: rgba(59,130,246,0.15); color: #1e40af; }
.badge-completed { background: rgba(34,197,94,0.15); color: #166534; }
.badge-cancelled { background: rgba(239,68,68,0.15); color: #991b1b; }
.badge-low { background: rgba(239,68,68,0.15); color: #991b1b; }
.badge-ok { background: rgba(34,197,94,0.15); color: #166534; }

/* ========== STAT CARDS ========== */
.stat-card {
  background: var(--card-bg); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.7); border-radius: 20px;
  padding: 24px; box-shadow: var(--shadow); transition: all 0.3s;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 80px; height: 80px; border-radius: 0 20px 0 50%;
  opacity: 0.08;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .stat-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--text-dark); line-height: 1; }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }
.stat-card .stat-change { font-size: 12px; font-weight: 600; margin-top: 8px; }

/* Gradient variants */
.stat-purple .stat-icon { background: linear-gradient(135deg, rgba(155,142,196,0.2), rgba(107,90,160,0.3)); color: var(--lavender-dark); }
.stat-blue .stat-icon { background: linear-gradient(135deg, rgba(107,159,212,0.2), rgba(74,124,181,0.3)); color: var(--blue-dark); }
.stat-pink .stat-icon { background: linear-gradient(135deg, rgba(232,164,200,0.2), rgba(200,122,175,0.3)); color: var(--pink-dark); }
.stat-green .stat-icon { background: rgba(72,187,120,0.15); color: #2F855A; }
.stat-orange .stat-icon { background: rgba(237,137,54,0.15); color: #C05621; }
.stat-teal .stat-icon { background: rgba(56,178,172,0.15); color: #2C7A7B; }

/* ========== SIDEBAR ========== */
#sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 260px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(240,238,248,0.95) 100%);
  backdrop-filter: blur(20px); border-right: 1px solid var(--border);
  box-shadow: 4px 0 20px rgba(107,90,160,0.08);
  display: flex; flex-direction: column; z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-logo { padding: 24px 20px; border-bottom: 1px solid var(--border); }
.sidebar-logo .logo-text { font-size: 22px; font-weight: 800; background: linear-gradient(135deg, var(--lavender-dark), var(--soft-blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-logo .logo-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: 14px; cursor: pointer; transition: all 0.2s;
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  margin-bottom: 4px; text-decoration: none;
}
.nav-item:hover { background: rgba(155,142,196,0.1); color: var(--lavender-dark); }
.nav-item.active { background: linear-gradient(135deg, rgba(107,90,160,0.1), rgba(155,142,196,0.15)); color: var(--lavender-dark); font-weight: 600; }
.nav-item .nav-icon { width: 20px; text-align: center; font-size: 16px; }
.nav-item .nav-badge { margin-left: auto; background: var(--danger); color: white; border-radius: 10px; padding: 2px 7px; font-size: 11px; font-weight: 700; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); }

/* ========== MAIN LAYOUT ========== */
#main-content { margin-left: 260px; min-height: 100vh; transition: margin 0.3s; }
.page-header { background: rgba(255,255,255,0.8); backdrop-filter: blur(10px); padding: 20px 32px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text-dark); }
.page-body { padding: 32px; }

/* ========== TABLES ========== */
.table-wrapper { overflow-x: auto; border-radius: 16px; }
table { width: 100%; border-collapse: collapse; }
thead th { background: rgba(155,142,196,0.08); padding: 14px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
tbody td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(155,142,196,0.04); }

/* ========== MODALS ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(45,38,64,0.5); backdrop-filter: blur(8px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: white; border-radius: 24px; box-shadow: var(--shadow-lg); max-width: 540px; width: 100%; max-height: 90vh; overflow-y: auto; animation: modalIn 0.3s ease; }
.modal-lg { max-width: 720px; }
.modal-header { padding: 24px 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-body { padding: 28px; }
.modal-footer { padding: 20px 28px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }

@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ========== HERO PAGE ========== */
.hero-bg {
  background: linear-gradient(135deg, #1a0533 0%, #2d1054 25%, #1e3a6e 60%, #0f4c75 100%);
  min-height: 100vh; position: relative; overflow: hidden;
}
.hero-bg::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(155,142,196,0.3) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(107,159,212,0.3) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(232,164,200,0.2) 0%, transparent 50%);
}
.hero-nav { position: relative; z-index: 10; padding: 24px 40px; display: flex; align-items: center; justify-content: space-between; }
.hero-logo { font-size: 28px; font-weight: 800; color: white; }
.hero-logo span { color: var(--lavender-light); }
.hero-content { position: relative; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; text-align: center; padding: 40px; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: var(--lavender-light); padding: 8px 20px; border-radius: 100px; font-size: 13px; font-weight: 500; margin-bottom: 24px; backdrop-filter: blur(10px); }
.hero-title { font-size: 64px; font-weight: 900; color: white; line-height: 1.1; margin-bottom: 20px; }
.hero-title .gradient-text { background: linear-gradient(135deg, var(--lavender-light), var(--blue-light), var(--pink-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 18px; color: rgba(255,255,255,0.7); max-width: 600px; line-height: 1.7; margin-bottom: 40px; }

/* ========== CARDS FOR SECTIONS ========== */
.feature-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 28px; backdrop-filter: blur(10px); transition: all 0.3s; }
.feature-card:hover { background: rgba(255,255,255,0.1); transform: translateY(-4px); }
.feature-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 16px; }

/* ========== ORDER QUEUE DISPLAY ========== */
.queue-card { background: linear-gradient(135deg, #9B8EC4, #6B9FD4); color: white; border-radius: 24px; padding: 32px; text-align: center; }
.countdown-ring { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.countdown-ring svg { transform: rotate(-90deg); }
.countdown-ring .ring-bg { fill: none; stroke: rgba(255,255,255,0.2); stroke-width: 8; }
.countdown-ring .ring-progress { fill: none; stroke: white; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.countdown-time { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; }

/* ========== PROGRESS BAR ========== */
.progress-bar { height: 8px; background: rgba(155,142,196,0.2); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; background: linear-gradient(135deg, var(--lavender), var(--soft-blue)); transition: width 1s linear; }

/* ========== ALERTS ========== */
.alert { padding: 14px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.alert-success { background: rgba(72,187,120,0.1); border: 1px solid rgba(72,187,120,0.3); color: #276749; }
.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #9B2C2C; }
.alert-warning { background: rgba(234,179,8,0.1); border: 1px solid rgba(234,179,8,0.3); color: #744210; }
.alert-info { background: rgba(107,159,212,0.1); border: 1px solid rgba(107,159,212,0.3); color: #1a4f84; }

/* ========== LOADING ========== */
.loading { display: flex; align-items: center; justify-content: center; padding: 60px; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--lavender); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, rgba(155,142,196,0.1) 25%, rgba(155,142,196,0.2) 50%, rgba(155,142,196,0.1) 75%); background-size: 200% 100%; animation: skeleton 1.5s infinite; border-radius: 8px; }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ========== TOAST NOTIFICATIONS ========== */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: white; border-radius: 14px; padding: 14px 18px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 380px; animation: toastIn 0.3s ease; border-left: 4px solid var(--lavender); }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* ========== IMAGE UPLOAD ========== */
.img-upload-area { border: 2px dashed var(--lavender-light); border-radius: 16px; padding: 32px; text-align: center; cursor: pointer; transition: all 0.2s; background: rgba(155,142,196,0.03); }
.img-upload-area:hover { border-color: var(--lavender); background: rgba(155,142,196,0.08); }
.menu-item-img { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; }

/* ========== INVENTORY PROGRESS ========== */
.inv-progress { height: 6px; background: rgba(0,0,0,0.08); border-radius: 100px; overflow: hidden; margin-top: 6px; }
.inv-progress-fill { height: 100%; border-radius: 100px; }
.inv-high .inv-progress-fill { background: var(--success); }
.inv-medium .inv-progress-fill { background: var(--warning); }
.inv-low .inv-progress-fill { background: var(--danger); }

/* ========== RATING STARS ========== */
.stars { display: flex; gap: 4px; }
.star { font-size: 18px; cursor: pointer; color: #CBD5E0; transition: color 0.2s; }
.star.filled, .star:hover, .star.hover { color: #ECC94B; }

/* ========== CUSTOMER PAGE ========== */
.customer-bg {
  background: linear-gradient(135deg, #f8f5ff 0%, #eef4ff 50%, #fff5fa 100%);
  min-height: 100vh;
}
.menu-category-header { font-size: 18px; font-weight: 700; color: var(--lavender-dark); padding: 16px 0 10px; display: flex; align-items: center; gap: 10px; }
.menu-item-card { background: white; border-radius: 18px; padding: 16px; box-shadow: 0 4px 15px rgba(107,90,160,0.08); display: flex; gap: 14px; align-items: center; transition: all 0.2s; border: 1px solid rgba(155,142,196,0.1); }
.menu-item-card:hover { box-shadow: 0 8px 25px rgba(107,90,160,0.15); transform: translateY(-2px); }
.menu-item-img-wrap { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, rgba(155,142,196,0.1), rgba(107,159,212,0.1)); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 28px; height: 28px; border-radius: 8px; border: none; cursor: pointer; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.qty-minus { background: rgba(155,142,196,0.15); color: var(--lavender-dark); }
.qty-plus { background: var(--lavender-dark); color: white; }
.qty-count { font-size: 16px; font-weight: 700; min-width: 24px; text-align: center; }

/* Cart */
.cart-panel { position: fixed; bottom: 0; left: 0; right: 0; background: white; border-radius: 24px 24px 0 0; padding: 20px; box-shadow: 0 -8px 30px rgba(107,90,160,0.15); z-index: 200; transition: transform 0.3s; }
.cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* ========== ANALYTICS CHARTS ========== */
.chart-container { position: relative; height: 280px; }
.chart-container-sm { position: relative; height: 200px; }

/* ========== NOTIFICATIONS ========== */
.notif-item { display: flex; gap: 14px; padding: 16px; border-radius: 14px; background: rgba(255,255,255,0.6); border: 1px solid var(--border); margin-bottom: 10px; transition: all 0.2s; }
.notif-item:hover { background: rgba(255,255,255,0.9); }
.notif-item.unread { border-left: 3px solid var(--lavender); }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lavender); flex-shrink: 0; margin-top: 6px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #main-content { margin-left: 0; }
  .hero-title { font-size: 42px; }
  #mobile-overlay { display: block; }
}
@media (max-width: 768px) {
  .page-body { padding: 20px; }
  .page-header { padding: 16px 20px; }
  .hero-title { font-size: 32px; }
  .hero-nav { padding: 16px 20px; }
  .modal { max-width: 95vw; }
  .stat-card .stat-value { font-size: 22px; }
}

#mobile-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 99;
}
#mobile-overlay.show { display: block; }

/* Section transitions */
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Gradient backgrounds for hero sections */
.section-bg-light { background: rgba(255,255,255,0.5); }

/* Tab styles */
.tab-bar { display: flex; gap: 4px; background: rgba(155,142,196,0.08); padding: 4px; border-radius: 14px; margin-bottom: 24px; }
.tab { padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; color: var(--text-muted); }
.tab.active { background: white; color: var(--lavender-dark); box-shadow: 0 2px 8px rgba(107,90,160,0.15); }

/* Search bar */
.search-bar { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.8); border: 1px solid var(--border); border-radius: 14px; padding: 10px 16px; width: 100%; max-width: 340px; }
.search-bar input { border: none; background: transparent; outline: none; font-size: 14px; width: 100%; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; }

/* Floating action button */
.fab { position: fixed; bottom: 28px; right: 28px; width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, var(--lavender-dark), var(--soft-blue)); color: white; font-size: 22px; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(107,90,160,0.4); cursor: pointer; transition: all 0.3s; z-index: 50; border: none; }
.fab:hover { transform: scale(1.1) rotate(45deg); }

/* Status flow indicator */
.status-flow { display: flex; align-items: center; gap: 0; }
.status-step { display: flex; flex-direction: column; align-items: center; }
.status-step-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: all 0.3s; }
.status-step-dot.done { background: var(--success); color: white; }
.status-step-dot.current { background: var(--lavender); color: white; animation: pulse 1.5s infinite; }
.status-step-dot.pending { background: rgba(155,142,196,0.15); color: var(--text-muted); }
.status-line { width: 40px; height: 2px; background: rgba(155,142,196,0.2); margin-bottom: 24px; }
.status-line.done { background: var(--success); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(155,142,196,0.4); } 50% { box-shadow: 0 0 0 8px rgba(155,142,196,0); } }
