/* ==========================================================================
   WhatsOrder — Modern Admin Panel Styles
   Design: Clean SaaS / Dashboard
   Font: Plus Jakarta Sans
   ========================================================================== */

:root {
  --brand: #22c55e;
  --brand-600: #16a34a;
  --brand-700: #15803d;
  --brand-50: #f0fdf4;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --ink-3: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --sidebar-bg: #0b1220;
  --sidebar-active: rgba(34, 197, 94, 0.12);
  --danger: #ef4444;
  --danger-50: #fef2f2;
  --warn: #f59e0b;
  --warn-50: #fffbeb;
  --info: #3b82f6;
  --info-50: #eff6ff;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ic { flex-shrink: 0; }

/* ---------------- Layout ---------------- */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--sidebar-bg); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; border-right: 1px solid rgba(255, 255, 255, 0.06); z-index: 40; transition: transform 0.3s var(--ease); }
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content-wrapper { padding: 32px 36px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------------- Sidebar ---------------- */
.sidebar-brand { padding: 22px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #4ade80, #16a34a); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4); }
.logo span b { color: var(--brand); font-weight: 800; }
.version-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: #94a3b8; }

.nav-menu { padding: 18px 12px; flex: 1; overflow-y: auto; }
.nav-group-title { font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: 0.08em; padding: 0 12px 10px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; font-size: 14px; font-weight: 600; color: #94a3b8; margin-bottom: 4px; transition: all 0.2s var(--ease); }
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-link.active { color: #fff; background: var(--sidebar-active); font-weight: 700; border: 1px solid rgba(34, 197, 94, 0.25); }
.nav-link.active .nav-icon { color: var(--brand); }
.nav-icon { color: #64748b; transition: color 0.2s; display: grid; place-items: center; }
.nav-text { flex: 1; }
.nav-pill { padding: 2px 8px; border-radius: 999px; background: var(--brand); color: #052e16; font-size: 11px; font-weight: 800; }
.nav-pill.pulse { animation: navpulse 2s infinite; }
@keyframes navpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.view-store-btn { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(255, 255, 255, 0.06); border-radius: 10px; font-size: 13px; font-weight: 600; color: #e2e8f0; margin-bottom: 14px; transition: background 0.2s; }
.view-store-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.admin-profile { display: flex; align-items: center; gap: 12px; padding: 8px 10px; }
.admin-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #10b981, #047857); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.admin-info { flex: 1; min-width: 0; }
.admin-name { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-role { font-size: 11px; color: #64748b; }
.logout-btn { color: #94a3b8; padding: 6px; border-radius: 8px; transition: all 0.2s; }
.logout-btn:hover { color: #f87171; background: rgba(239, 68, 68, 0.12); }

/* ---------------- Mobile Bar ---------------- */
.mobile-bar { display: none; background: var(--sidebar-bg); padding: 12px 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, 0.08); color: #fff; }
.btn-icon { background: none; border: 0; color: #fff; display: grid; place-items: center; padding: 6px; border-radius: 8px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); z-index: 35; }

/* ---------------- Page Headers & Panels ---------------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.page-subtitle { color: var(--muted); font-size: 14px; margin-top: 2px; }
.panel { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 22px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 17px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 10px; }

/* ---------------- KPI Stat Cards ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 24px; }
.kpi-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: flex; align-items: flex-start; justify-content: space-between; transition: transform 0.2s, box-shadow 0.2s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-val { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; }
.kpi-lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.kpi-icon.blue { background: var(--info-50); color: var(--info); }
.kpi-icon.amber { background: var(--warn-50); color: var(--warn); }
.kpi-icon.purple { background: #faf5ff; color: #9333ea; }

/* ---------------- Tables ---------------- */
.table-responsive { width: 100%; overflow-x: auto; }
table.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; text-align: left; }
table.data-table th { background: #f8fafc; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data-table td { padding: 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: var(--ink-2); }
table.data-table tr:last-child td { border-bottom: 0; }
table.data-table tbody tr:hover td { background: #f8fafc; }

/* ---------------- Badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.b-pending { background: #fef3c7; color: #92400e; }
.badge.b-confirmed { background: #dbeafe; color: #1e40af; }
.badge.b-preparing { background: #ede9fe; color: #6b21a8; }
.badge.b-ready { background: #ccfbf1; color: #0f766e; }
.badge.b-delivered { background: #dcfce7; color: #15803d; }
.badge.b-cancelled { background: #fee2e2; color: #b91c1c; }
.badge.b-on { background: #dcfce7; color: #15803d; }
.badge.b-off { background: #f1f5f9; color: #64748b; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px; font-size: 14px; font-weight: 700; border: 0; cursor: pointer; transition: all 0.2s var(--ease); white-space: nowrap; }
.btn-primary { background: var(--brand); color: #052e16; }
.btn-primary:hover { background: #4ade80; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); transform: translateY(-1px); }
.btn-ghost { background: #fff; border: 1.5px solid var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-lg { height: 50px; font-size: 15px; border-radius: 13px; }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field label em { color: var(--danger); font-style: normal; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 11px; font-size: 14px; background: #fff; color: var(--ink); transition: border-color 0.2s, box-shadow 0.2s; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15); }
.field textarea { resize: vertical; min-height: 80px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ---------------- Alerts ---------------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; margin-bottom: 20px; border: 1px solid; }
.alert.ok { background: var(--brand-50); border-color: #bbf7d0; color: #14532d; }
.alert.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ---------------- Status Filter Tabs ---------------- */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 4px; }
.filter-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-2); transition: all 0.2s; white-space: nowrap; }
.filter-tab:hover { background: #f8fafc; }
.filter-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-tab .tab-cnt { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.08); }
.filter-tab.active .tab-cnt { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* ---------------- Login Screen ---------------- */
.login-body { background: #0b1220; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-wrap { width: 100%; max-width: 420px; }
.login-box { background: #162032; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 22px; padding: 36px 32px; box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5); color: #e2e8f0; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-logo h1 { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.login-logo h1 span { color: var(--brand); }
.login-sub { color: #94a3b8; font-size: 14px; margin-bottom: 24px; }
.login-box .field label { color: #cbd5e1; }
.login-box .field input { background: #0b1220; border-color: #273549; color: #fff; }
.login-box .field input:focus { border-color: var(--brand); }
.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #64748b; pointer-events: none; }
.input-icon-wrap input { padding-left: 44px; }
.login-foot { text-align: center; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.06); font-size: 13px; color: #94a3b8; }
.login-foot a { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

/* ---------------- Grid helpers ---------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* ---------------- Pagination ---------------- */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; background: #fff; border-radius: 0 0 var(--radius) var(--radius); }
.pagination-info { font-size: 13px; color: var(--muted); }
.pagination-info b { color: var(--ink); }
.pagination { display: flex; align-items: center; gap: 6px; }
.pag-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-2); transition: all 0.2s; text-decoration: none; }
.pag-btn:hover:not(.disabled) { background: #f8fafc; border-color: #cbd5e1; }
.pag-btn.disabled { opacity: 0.4; cursor: not-allowed; background: #f8fafc; }
.pag-num { min-width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--ink-2); border: 1.5px solid transparent; transition: all 0.2s; padding: 0 6px; text-decoration: none; }
.pag-num:hover:not(.active) { background: #f1f5f9; }
.pag-num.active { background: var(--brand); color: #052e16; border-color: var(--brand); font-weight: 800; }
.pag-dots { padding: 0 4px; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .pagination-bar { flex-direction: column; align-items: center; gap: 12px; }
}

/* ---------------- Print Receipt / KOT ---------------- */
@media print {
  body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  .sidebar, .mobile-bar, .page-header, .no-print, button, form { display: none !important; }
  .content-wrapper { padding: 0 !important; max-width: 100% !important; margin: 0 !important; }
  .panel { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .print-receipt { display: block !important; width: 80mm; margin: 0 auto; padding: 10px; font-family: monospace; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .mobile-bar { display: flex; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }
  .content-wrapper { padding: 20px 16px 40px; }
  .grid-2, .grid-3, .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* ---------------- Demo Mode Notice & Elements ---------------- */
.demo-notice-bar {
  background: linear-gradient(135deg, #1e1b4b, #2e1065);
  color: #fff;
  padding: 13px 20px;
  border-radius: var(--radius);
  border: 1px solid #6366f1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(49, 46, 129, 0.15);
  flex-wrap: wrap;
}
.demo-notice-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f59e0b;
  color: #78350f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
  flex-shrink: 0;
}
.demo-notice-text {
  font-size: 13px;
  font-weight: 600;
  color: #e0e7ff;
  line-height: 1.5;
  flex: 1;
}
.demo-notice-text code {
  background: rgba(255, 255, 255, 0.14);
  padding: 2px 6px;
  border-radius: 6px;
  color: #fbbf24;
  font-family: monospace;
  font-size: 12px;
}
.demo-badge-tag {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn.disabled-demo {
  opacity: 0.55;
  cursor: not-allowed !important;
  pointer-events: auto;
}
