@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #6366f1;
  --accent-primary: #4f46e5;
  --accent-secondary: #7c3aed;
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  --accent-food: linear-gradient(135deg, #ff5722 0%, #f97316 100%);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 20px 30px -10px rgba(79, 70, 229, 0.15);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(249, 115, 22, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
}

[x-cloak] {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Light Card Panels */
.light-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

/* Auth Login Layout */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}

.brand-header {
  text-align: center;
  margin-bottom: 32px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--accent-food);
  color: white;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
  box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.35);
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Form inputs */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-container {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #0f172a;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.form-input::placeholder {
  color: #94a3b8;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.toggle-password:hover {
  color: var(--accent-primary);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px -5px rgba(79, 70, 229, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Quick Fill Demo Badges */
.demo-accounts {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.demo-title {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 12px;
}

.demo-chips {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.demo-chip {
  padding: 7px 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.demo-chip:hover {
  background: #e0e7ff;
  border-color: #c7d2fe;
  color: var(--accent-primary);
}

/* Alerts */
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-food);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 12px -2px rgba(249, 115, 22, 0.3);
}

.sidebar-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-item:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.nav-item.active {
  background: #e0e7ff;
  color: var(--accent-primary);
  font-weight: 700;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.user-details {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e0e7ff;
  color: var(--accent-primary);
}

.btn-logout {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  font-size: 16px;
  transition: color 0.2s;
}

.btn-logout:hover {
  color: #ef4444;
}

/* Dashboard Content Area */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 36px;
  min-height: 100vh;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}

/* Blank Dashboard Workspace */
.blank-dashboard-card {
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 70px 40px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.blank-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #e0e7ff;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
}

.blank-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.blank-desc {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 24px auto;
  font-size: 14px;
  line-height: 1.6;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
  color: var(--text-main);
}

/* Data Tables */
.table-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-toolbar {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 260px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--accent-primary);
  background: #ffffff;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
}

.filter-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.filter-select {
  padding: 9px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  color: #334155;
  outline: none;
  font-weight: 600;
  font-family: inherit;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #f8fafc;
  padding: 14px 24px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: #1e293b;
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-admin {
  background: #e0e7ff;
  color: #4338ca;
}

.badge-restaurant_owner {
  background: #ffedd5;
  color: #c2410c;
}

.badge-customer {
  background: #f1f5f9;
  color: #475569;
}

.badge-delivery_partner {
  background: #f0fdf4;
  color: #15803d;
}

.badge-active {
  background: #dcfce7;
  color: #15803d;
}

.badge-inactive {
  background: #f1f5f9;
  color: #64748b;
}

.badge-suspended {
  background: #fee2e2;
  color: #b91c1c;
}

/* Table Action Buttons */
.btn-action {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  color: #475569;
  transition: all 0.2s;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
}

.btn-action:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: var(--accent-primary);
}

.btn-action-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

/* Workflow Action Buttons with text */
.btn-workflow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  width: auto;
  min-width: max-content;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  line-height: 1;
}

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

.btn-workflow:active {
  transform: translateY(0);
}

.btn-workflow-accept {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.btn-workflow-accept:hover {
  background: #bbf7d0;
  color: #166534;
  border-color: #86efac;
}

.btn-workflow-prepare {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

.btn-workflow-prepare:hover {
  background: #e9d5ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}

.btn-workflow-dispatch {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.btn-workflow-dispatch:hover {
  background: #bae6fd;
  color: #075985;
  border-color: #7dd3fc;
}

.btn-workflow-delivered {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.btn-workflow-delivered:hover {
  background: #bbf7d0;
  color: #166534;
  border-color: #86efac;
}

.pagination-bar {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: #64748b;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  animation: fadeIn 0.25s ease-out;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
}

.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 24px;
}

/* Modal Navigation Tabs */
.modal-tabs-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.modal-tabs-track {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.modal-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1.2;
  outline: none;
}

.modal-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
}

.modal-tab-btn.active {
  background: #ffffff;
  color: var(--accent-primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.modal-tab-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.modal-tab-btn.active .modal-tab-badge {
  background: #e0e7ff;
  color: var(--accent-primary);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

.btn-secondary {
  padding: 10px 18px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f1f5f9;
}