/* ===================================================
   CateringPro – Global CSS
   Exact visual match of the React/Tailwind version
   =================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', sans-serif; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ─── App Shell ─── */
.app-shell { display: flex; height: 100vh; background: #f1f5f9; }

/* ─── Sidebar ─── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #0c1830;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.logo-icon {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#3b82f6,#1d4ed8);
  flex-shrink: 0;
}
.logo-name { color: white; font-weight: 700; font-size: 14px; line-height: 1; }
.logo-sub  { color: #475569; font-size: 12px; margin-top: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #334155;
  padding: 0 16px;
  margin: 20px 0 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.nav-item:hover { color: #cbd5e1; }
.nav-item.active {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  border-left-color: #3b82f6;
  font-weight: 600;
}
.nav-icon { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar-enc-badge {
  margin: 0 12px 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
}
.sidebar-logout {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: #64748b;
  width: 100%;
  transition: color 0.15s, background 0.15s;
}
.logout-btn:hover { color: #f87171; background: rgba(248,113,113,0.08); }

/* ─── Main Area ─── */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ─── Topbar ─── */
.topbar {
  background: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
}
.topbar-title { font-weight: 700; color: #1e293b; font-size: 16px; }
.topbar-date  { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.enc-badge-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px;
  background: #dbeafe; color: #1d4ed8;
}
.notif-btn {
  position: relative; padding: 8px; border-radius: 8px;
  color: #64748b; transition: background 0.15s;
}
.notif-btn:hover { background: #f1f5f9; }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%; background: #ef4444;
}
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding-left: 12px; border-left: 1px solid #e2e8f0;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#3b82f6,#1d4ed8);
  color: white; font-weight: 700; font-size: 14px;
}
.user-name { font-size: 14px; font-weight: 600; color: #1e293b; line-height: 1.2; }
.user-role { font-size: 12px; color: #94a3b8; }

/* ─── Page Content ─── */
.page-content { flex: 1; overflow: auto; padding: 24px; }

/* ─── Cards & Panels ─── */
.card {
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #f1f5f9;
}
.card-body { padding: 20px 24px; }

/* ─── Grid helpers ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 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: 12px; }
.col-span-2 { grid-column: span 2; }
.space-y-5 > * + * { margin-top: 20px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-3 > * + * { margin-top: 12px; }

/* ─── Stat Card ─── */
.stat-card { padding: 20px; }
.stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.stat-row { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.stat-trend { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: #059669; }
.stat-value { font-size: 24px; font-weight: 800; color: #1e293b; margin-bottom: 2px; }
.stat-label { font-size: 14px; font-weight: 600; color: #374151; }
.stat-sub   { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* ─── Badges ─── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 9999px; }
.badge-enc   { background: #d1fae5; color: #065f46; }
.badge-cha   { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-blue  { background: #dbeafe; color: #1d4ed8; }
.badge-yellow{ background: #fef3c7; color: #d97706; }
.badge-red   { background: #fee2e2; color: #991b1b; }
.badge-gray  { background: #f1f5f9; color: #475569; }
.badge-purple{ background: #ede9fe; color: #6d28d9; }

/* ─── Table ─── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.tbl th { padding: 14px 20px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }
.tbl td { padding: 14px 20px; font-size: 14px; color: #374151; border-top: 1px solid #f1f5f9; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl .mono { font-family: 'Courier New', monospace; font-weight: 600; color: #475569; font-size: 12px; }
.tbl-wrap { overflow-x: auto; }

/* ─── Forms ─── */
.form-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #475569; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 12px;
  border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 14px; outline: none; background: white;
  transition: border-color 0.15s;
  font-family: 'Inter', sans-serif;
}
.form-control:focus { border-color: #3b82f6; }
.form-control-icon { padding-left: 40px; }
.input-wrapper { position: relative; }
.input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; pointer-events: none;
  display: flex; align-items: center;
}
.input-icon svg { width: 15px; height: 15px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  transition: all 0.15s; cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #059669; color: white; }
.btn-danger  { background: #dc2626; color: white; }
.btn-outline { background: white; color: #475569; border: 1px solid #e2e8f0; }
.btn-outline:hover { background: #f8fafc; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 6px; border-radius: 8px; transition: all 0.15s; }
.btn-icon-blue   { color: #2563eb; } .btn-icon-blue:hover   { background: #dbeafe; }
.btn-icon-green  { color: #059669; } .btn-icon-green:hover  { background: #d1fae5; }
.btn-icon-red    { color: #dc2626; } .btn-icon-red:hover    { background: #fee2e2; }

/* ─── Search bar ─── */
.search-bar { display: flex; align-items: center; gap: 12px; }
.search-wrap { position: relative; flex: 1; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.search-input {
  width: 100%; padding: 8px 16px 8px 40px;
  border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 14px; outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: #3b82f6; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: white; border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  padding: 24px;
}
.modal-box-lg { max-width: 680px; }
.modal-title { font-size: 18px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: #94a3b8; padding: 4px; line-height: 1;
  font-size: 20px; float: right; margin-top: -2px;
}
.modal-close:hover { color: #475569; }

/* ─── Dark panel ─── */
.dark-panel {
  background: #0c1830; border-radius: 12px; padding: 12px;
  font-family: 'Courier New', monospace;
}
.dark-panel-lg { padding: 16px; border-radius: 16px; }

/* ─── Tabs ─── */
.tab-bar {
  display: flex; gap: 4px; padding: 4px;
  background: #f1f5f9; border-radius: 12px; margin-bottom: 16px;
}
.tab-btn {
  flex: 1; padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; transition: all 0.15s;
  color: #94a3b8; background: transparent;
}
.tab-btn.active { background: white; color: #1d4ed8; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* ─── Encryption step ─── */
.enc-step {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px; border: 1px solid #e2e8f0;
  background: #f8fafc; transition: all 0.4s; opacity: 0.4;
}
.enc-step.active { background: #eff6ff; border-color: #bfdbfe; opacity: 1; }
.enc-step.done   { background: #f0fdf4; border-color: #bbf7d0; opacity: 1; }
.enc-step-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: #e2e8f0; transition: all 0.3s;
}
.enc-step.active .enc-step-icon { background: #2563eb; }
.enc-step.done   .enc-step-icon { background: #059669; }

/* ─── Flow visualization ─── */
.flow-wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flow-node {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 16px 12px; border-radius: 16px; border: 2px solid #e2e8f0;
  background: #f8fafc; transition: all 0.4s;
}
.flow-node.active { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.flow-node.done   { background: #f0fdf4; border-color: #bbf7d0; }
.flow-icon-wrap {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #e2e8f0; background: #f1f5f9;
}
.flow-node.done .flow-icon-wrap { background: #d1fae5; border-color: #86efac; }
.flow-label { font-size: 11px; font-weight: 700; text-align: center; color: #475569; }
.flow-desc  { font-size: 10px; text-align: center; color: #94a3b8; }
.flow-arrow { display: flex; align-items: center; flex-shrink: 0; }
.flow-line  { height: 2px; width: 24px; background: #e2e8f0; transition: background 0.4s; }
.flow-node.done ~ .flow-arrow .flow-line { background: #86efac; }

/* ─── Bounce dots ─── */
.bounce-dots { display: flex; gap: 4px; }
.bounce-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #3b82f6;
  animation: bounce 0.6s infinite alternate;
}
.bounce-dot:nth-child(2) { animation-delay: 0.15s; }
.bounce-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-6px); } }

/* ─── Spinner ─── */
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Pulse ─── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* ─── Login page ─── */
.login-page { min-height: 100vh; display: flex; background: #060e1e; }
.login-left  {
  width: 40%; padding: 40px;
  background: linear-gradient(160deg, #0c1830 0%, #0f2045 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
@media(max-width:900px){ .login-left{display:none;} }
.login-left-content { flex: 1; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 64px; }
.login-brand-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#3b82f6,#1d4ed8);
}
.login-brand-name { color: white; font-weight: 700; font-size: 15px; }
.login-brand-sub  { color: #475569; font-size: 12px; }
.login-headline { font-size: 30px; font-weight: 700; color: white; margin-bottom: 16px; line-height: 1.3; }
.login-headline span { color: #60a5fa; }
.login-desc { font-size: 14px; color: #64748b; line-height: 1.6; margin-bottom: 40px; }
.login-features { display: flex; flex-direction: column; gap: 16px; }
.login-feature { display: flex; align-items: center; gap: 12px; }
.login-feature-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59,130,246,0.12); flex-shrink: 0;
}
.login-feature-text { font-size: 14px; color: #94a3b8; }
.login-card-info {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.login-card-info-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.login-copyright { font-size: 12px; color: #334155; text-align: center; }

.login-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-form-wrap { width: 100%; max-width: 360px; }
.login-box {
  background: white; border-radius: 20px; overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}
.login-box-accent { height: 4px; background: linear-gradient(90deg,#3b82f6,#1d4ed8,#6366f1); }
.login-box-body { padding: 32px; }
.login-icon-wrap {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#3b82f6,#1d4ed8);
}
.login-form-title { font-size: 20px; font-weight: 700; color: #1e293b; text-align: center; }
.login-form-sub   { font-size: 14px; color: #94a3b8; text-align: center; margin-top: 4px; }
.login-demo-box {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 12px; text-align: center;
  font-size: 12px; color: #64748b; margin-top: 20px;
}
.login-box-footer {
  background: #f8fafc; border-top: 1px solid #e2e8f0;
  padding: 12px 32px; text-align: center;
  font-size: 12px; color: #94a3b8;
}
.login-error {
  font-size: 12px; color: #dc2626; background: #fef2f2;
  border: 1px solid #fecaca; border-radius: 8px;
  padding: 8px 12px; margin-top: 8px;
}
.login-btn {
  width: 100%; padding: 10px; border-radius: 8px;
  color: white; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg,#3b82f6,#1d4ed8);
  border: none; cursor: pointer; transition: opacity 0.15s;
  font-family: 'Inter', sans-serif;
  margin-top: 4px;
}
.login-btn:disabled { background: #93c5fd; cursor: not-allowed; }
.eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: #94a3b8; padding: 0;
  display: flex; align-items: center;
}
.eye-btn:hover { color: #475569; }

/* ─── Status cards (OrderStatus) ─── */
.status-card-btn {
  padding: 16px; border-radius: 16px; text-align: left;
  transition: all 0.15s; cursor: pointer; background: white;
  border: 2px solid #e2e8f0; width: 100%;
  font-family: 'Inter', sans-serif;
}
.order-card {
  background: white; border-radius: 16px; padding: 20px;
  border: 2px solid #e2e8f0; transition: box-shadow 0.15s;
}
.order-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* ─── Security flow ─── */
.security-banner {
  border-radius: 16px; padding: 20px;
  background: linear-gradient(135deg,#0c1830 0%,#1e3a5f 100%);
  border: 1px solid rgba(59,130,246,0.2);
  display: flex; align-items: center; gap: 20px; color: white;
}

/* ─── Toggle switch ─── */
.toggle-wrap { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.toggle-wrap input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 40px; height: 20px; border-radius: 10px;
  background: #e2e8f0; transition: background 0.2s; position: relative;
}
.toggle-wrap input:checked + .toggle-track { background: #2563eb; }
.toggle-track::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; transition: transform 0.2s;
}
.toggle-wrap input:checked + .toggle-track::after { transform: translateX(20px); }

/* ─── Misc ─── */
.page-header { margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 10px; }
.page-sub   { font-size: 14px; color: #64748b; margin-top: 4px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.empty-state {
  padding: 56px; text-align: center; color: #94a3b8; font-size: 14px;
}
.empty-icon {
  width: 48px; height: 48px; border-radius: 50%; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.font-mono { font-family: 'Courier New', monospace; }
.text-sm   { font-size: 13px; }
.text-xs   { font-size: 11px; }
.break-all { word-break: break-all; }
.w-full    { width: 100%; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.overflow-hidden { overflow: hidden; }
.rounded-2xl { border-radius: 16px; }

/* ─── Action row in forms ─── */
.form-actions { display: flex; gap: 12px; margin-top: 20px; }
.form-actions .btn { flex: 1; justify-content: center; }

/* ─── Info box ─── */
.info-box {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border-radius: 12px;
  background: #eff6ff; border: 1px solid #bfdbfe;
  font-size: 12px; color: #1d4ed8;
}

/* ─── Preview table ─── */
.preview-table { border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; }
.preview-table-head {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 10px 16px; background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px; font-weight: 600; text-transform: uppercase; color: #94a3b8;
}
.preview-table-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 10px 16px; border-top: 1px solid #f1f5f9;
  font-size: 12px; align-items: center;
}

/* ─── Notify toast ─── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #059669; color: white;
  padding: 12px 20px; border-radius: 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 2000; transform: translateY(100px);
  transition: transform 0.3s ease;
}
.toast.show { transform: translateY(0); }
