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

:root {
  --primary: #2e7d32;
  --primary-dark: #1b5e20;
  --primary-light: #a5d6a7;
  --accent: #ff6f00;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #263238;
  --text-light: #607d8b;
  --border: #e0e0e0;
  --success: #2e7d32;
  --warning: #f57f17;
  --danger: #c62828;
  --info: #1565c0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.navbar {
  background: #ffffff;
  color: var(--text);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(0,0,0,0.05);
}

.nav-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.brand-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #43a047 100%);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(46,125,50,0.3);
}
.brand-logo svg { width: 22px; height: 22px; color: white; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.nav-brand h2 { font-size: 1.15rem; color: var(--primary-dark); letter-spacing: -0.3px; }
.nav-subtitle { font-size: 0.68rem; opacity: 0.7; color: var(--text-light); }

.nav-toggle {
  display: none;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  width: 40px; height: 40px; cursor: pointer;
  align-items: center; justify-content: center; color: var(--text);
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle.open { background: var(--primary); color: #fff; border-color: var(--primary); }

.nav-links { display: flex; gap: 2px; flex: 1; justify-content: center; }

.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-light);
  text-decoration: none;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.18s;
  white-space: nowrap;
}
.nav-icon { display: inline-flex; }
.nav-icon svg { width: 16px; height: 16px; }
.nav-link:hover { background: #f0f7f0; color: var(--primary); }
.nav-link.active {
  background: linear-gradient(135deg, var(--primary) 0%, #43a047 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(46,125,50,0.3);
}

.nav-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-light); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.theme-toggle:hover { background: #f0f7f0; color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #43a047 100%);
  color: #fff; font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(46,125,50,0.25);
  letter-spacing: 0.5px;
}

.user-info { display: flex; flex-direction: column; line-height: 1.2; font-size: 0.82rem; font-weight: 600; }

.role-badge {
  display: inline-block; width: fit-content;
  padding: 1px 8px; border-radius: 20px;
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-top: 2px;
}
.role-badge.admin { background: #e3f2fd; color: #1565c0; }
.role-badge.merchant { background: #fff3e0; color: #e65100; }
.role-badge.ngo { background: #e8f5e9; color: #2e7d32; }

#main-content { padding: 24px; max-width: 1200px; margin: 0 auto; }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-header h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
.page-header .page-welcome { color: var(--text-light); font-size: 0.9rem; margin-top: 2px; }
.page-header .page-date { font-size: 0.78rem; color: var(--text-light); margin-top: 4px; }
.page-header-actions { display: flex; gap: 8px; }

.loading-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 60vh; }
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(0,0,0,0.04);
}

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.card-header h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.card-header h3 svg { width: 18px; height: 18px; stroke: var(--primary); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.stat-card {
  display: flex; align-items: center; gap: 14px;
  text-align: left; padding: 18px 20px;
  border-radius: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.stat-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.green { background: #e8f5e9; color: var(--primary); }
.stat-icon.orange { background: #fff3e0; color: #e65100; }
.stat-icon.blue { background: #e3f2fd; color: #1565c0; }
.stat-icon.purple { background: #f3e5f5; color: #6a1b9a; }
.stat-icon.red { background: #ffebee; color: #c62828; }
.stat-icon.teal { background: #e0f2f1; color: #00695c; }
.stat-icon.indigo { background: #e8eaf6; color: #303f9f; }
.stat-icon.amber { background: #fff8e1; color: #f57f17; }

.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-light); margin-top: 3px; }
.stat-card .stat-unit { font-size: 0.75rem; color: var(--text-light); font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: 10px;
  font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.18s;
  text-decoration: none;
}
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(46,125,50,0.2); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(46,125,50,0.3); }
.btn-accent { background: var(--accent); color: white; box-shadow: 0 2px 8px rgba(255,111,0,0.2); }
.btn-accent:hover { opacity: 0.9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f5f5f5; border-color: #c8c8c8; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-info { background: var(--info); color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.9rem; transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }

.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 40%, #388e3c 100%);
  position: relative; overflow: hidden; padding: 20px;
  height: 100vh;
}

.auth-bg-shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.shape {
  position: absolute; border-radius: 50%; opacity: 0.08;
}
.shape-1 {
  width: 600px; height: 600px; background: radial-gradient(circle, #fff 0%, transparent 70%);
  top: -200px; right: -200px;
}
.shape-2 {
  width: 400px; height: 400px; background: radial-gradient(circle, #a5d6a7 0%, transparent 70%);
  bottom: -100px; left: -100px;
}
.shape-3 {
  width: 300px; height: 300px; background: radial-gradient(circle, #fff 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
}

.auth-card {
  background: rgba(255,255,255,0.97); backdrop-filter: blur(20px);
  border-radius: 20px; padding: 40px; width: 420px; max-width: 95vw;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
  position: relative; z-index: 1;
  animation: cardFadeIn 0.5s ease-out;
}
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-icon {
  width: 56px; height: 56px; background: linear-gradient(135deg, var(--primary) 0%, #43a047 100%);
  border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px; box-shadow: 0 4px 12px rgba(46,125,50,0.3);
}
.auth-icon svg { width: 28px; height: 28px; color: white; }
.auth-brand h1 { font-size: 1.6rem; color: var(--primary); margin-bottom: 2px; letter-spacing: -0.5px; }
.auth-brand .subtitle { color: var(--text-light); font-size: 0.85rem; margin: 0; }

.auth-tabs {
  display: flex; background: #f0f2f5; border-radius: 10px; padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 10px; border: none; background: transparent;
  font-size: 0.85rem; font-weight: 600; color: var(--text-light); cursor: pointer;
  border-radius: 8px; transition: all 0.25s;
}
.auth-tab.active {
  background: white; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.auth-tab:hover:not(.active) { color: var(--text); }

.reg-steps {
  display: flex; background: #f0f2f5; border-radius: 10px; padding: 4px;
  margin-bottom: 20px; gap: 4px;
}
.reg-step {
  flex: 1; padding: 8px 6px; border: none; background: transparent;
  font-size: 0.78rem; font-weight: 600; color: var(--text-light);
  border-radius: 8px; transition: all 0.25s; text-align: center; line-height: 1.3;
}
.reg-step.active {
  background: white; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-form { animation: formFade 0.3s ease-out; }
@keyframes formFade { from { opacity: 0; } to { opacity: 1; } }

.auth-form .error-message {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--danger);
  padding: 10px 14px; border-radius: 8px; margin-bottom: 16px;
  font-size: 0.82rem; display: none;
}

.input-group { margin-bottom: 16px; }
.input-group label {
  display: block; font-size: 0.8rem; font-weight: 600; color: var(--text);
  margin-bottom: 5px; letter-spacing: 0.2px;
}

.input-wrapper {
  position: relative; display: flex; align-items: center;
}
.input-icon {
  position: absolute; left: 12px; width: 18px; height: 18px;
  color: #9e9e9e; pointer-events: none; transition: color 0.2s;
  flex-shrink: 0;
}
.input-wrapper .form-control {
  padding: 11px 12px 11px 40px; width: 100%; border: 1.5px solid #e0e0e0;
  border-radius: 10px; font-size: 0.9rem; transition: all 0.2s;
  background: #fafafa;
}
.input-wrapper .form-control:focus {
  outline: none; border-color: var(--primary); background: white;
  box-shadow: 0 0 0 3px rgba(46,125,50,0.12);
}
.input-wrapper:focus-within .input-icon { color: var(--primary); }

.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-row-between {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: -4px 0 16px;
}
.remember-row {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.8rem; font-weight: 500; color: var(--text-light);
  cursor: pointer; margin: 0;
}
.remember-row input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.link-btn {
  background: none; border: none; padding: 0;
  font-size: 0.8rem; font-weight: 600; color: var(--primary);
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--primary-dark); }

.fp-modal { max-width: 440px; }
.fp-intro { font-size: 0.85rem; color: var(--text-light); margin-bottom: 16px; }
.fp-message {
  padding: 10px 14px; border-radius: 8px; font-size: 0.82rem;
  margin-bottom: 14px; display: none;
}
.fp-message.error { background: #ffebee; color: var(--danger); }
.fp-message.info { background: #e3f2fd; color: var(--info); }
.fp-message.success { background: #e8f5e9; color: var(--success); }
.fp-message.warning { background: #fff3e0; color: #e65100; }

.btn-auth {
  width: 100%; padding: 12px; border-radius: 10px; font-size: 0.95rem;
  transition: all 0.3s ease;
  font-weight: 600; margin-top: 8px; justify-content: center; position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, #43a047 100%);
  box-shadow: 0 4px 14px rgba(46,125,50,0.3); transition: all 0.25s;
}
.btn-auth:hover {
  transform: translateY(-1px); box-shadow: 0 6px 20px rgba(46,125,50,0.4);
}
.btn-auth:active { transform: translateY(0); }
.btn-auth .btn-text { transition: opacity 0.2s; }
.btn-auth.loading .btn-text { opacity: 0; }
.btn-auth.loading .btn-loader { display: flex !important; }
.btn-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.spinner-xs { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }

.auth-demo {
  margin-top: 24px; padding: 16px; background: #f8faf8; border-radius: 12px;
  border: 1px solid #e8f0e8;
}
.demo-header { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--text-light); margin-bottom: 10px; }
.demo-icon { width: 16px; height: 16px; }
.demo-list { display: flex; flex-direction: column; gap: 6px; }
.demo-item { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.demo-role {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.demo-role.admin { background: #e3f2fd; color: #1565c0; }
.demo-role.merchant { background: #fff3e0; color: #e65100; }
.demo-role.ngo { background: #e8f5e9; color: #2e7d32; }
.demo-item code { color: var(--text); font-size: 0.82rem; }
.demo-pw { margin-top: 8px; font-size: 0.78rem; color: var(--text-light); }
.demo-pw code { font-size: 0.82rem; color: var(--text); }

.otp-row { display: flex; gap: 8px; align-items: center; }
.otp-status { font-size: 0.8rem; margin-top: 6px; padding: 4px 8px; border-radius: 4px; }
.otp-status.success { color: var(--success); background: #e8f5e9; }
.otp-status.error { color: var(--danger); background: #ffebee; }
.otp-status.info { color: var(--info); background: #e3f2fd; }

.auth-footer {
  position: fixed; bottom: 12px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,0.35); font-size: 0.7rem;
  letter-spacing: 0.3px; z-index: 0; pointer-events: none;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { font-weight: 600; color: var(--text-light); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: #f3faf3; }
tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
}
.badge-pending { background: #fff3e0; color: #e65100; }
.badge-matched { background: #e3f2fd; color: #1565c0; }
.badge-accepted { background: #e8f5e9; color: #2e7d32; }
.badge-rejected { background: #ffebee; color: #c62828; }
.badge-pickup_booked, .badge-driver_on_way { background: #f3e5f5; color: #6a1b9a; }
.badge-driver_assigned { background: #f3e5f5; color: #6a1b9a; }
.badge-picked_up { background: #e8f5e9; color: #1b5e20; }
.badge-delivered { background: #e8f5e9; color: #1b5e20; }
.badge-completed { background: #e8f5e9; color: #1b5e20; }
.badge-cancelled { background: #eceff1; color: #78909c; }
.badge-delivery_failed { background: #ffebee; color: #c62828; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-secondary { background: #eceff1; color: #78909c; }

.empty-state { text-align: center; padding: 56px 24px; color: var(--text-light); }
.empty-state .empty-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  background: #f0f4f0; display: flex; align-items: center; justify-content: center;
}
.empty-state .empty-icon svg { width: 26px; height: 26px; stroke: var(--primary-light); }
.empty-state h3 { margin-bottom: 8px; color: var(--text); font-size: 1.05rem; }
.empty-state p { font-size: 0.88rem; }

.info-banner {
  display: flex; align-items: center; gap: 10px;
  background: #e8f5e9; border: 1px solid #c8e6c9;
  border-radius: 12px; padding: 14px 18px;
  font-size: 0.88rem; color: var(--text); margin-bottom: 20px;
}
.info-banner svg { color: var(--primary); flex-shrink: 0; }

.chart-container { margin-top: 16px; }

.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal { background: white; border-radius: 12px; padding: 32px; width: 500px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; }
.modal .btn-row { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }

.donation-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.donation-detail-grid .detail-item { padding: 8px 0; }
.detail-item label { font-size: 0.8rem; color: var(--text-light); display: block; }
.detail-item span { font-weight: 600; }

.status-timeline { padding: 16px 0; }
.timeline-item { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); margin-top: 4px; flex-shrink: 0; }
.timeline-dot.inactive { background: var(--border); }
.timeline-content { font-size: 0.85rem; }
.timeline-content .time { color: var(--text-light); font-size: 0.75rem; }

.search-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar .form-control { max-width: 200px; }

.db-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.db-table th, .db-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; white-space: nowrap; }
.db-table th { background: var(--bg); font-weight: 600; position: sticky; top: 0; font-size:0.78rem; }
.db-table tbody tr:hover { background: var(--primary-light); }
.db-table .actions { white-space: nowrap; width: 130px; }

.period-btn { border: 1px solid var(--border); background: var(--card); cursor: pointer; }
.period-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Database Manager CRUD Theme ===== */
.db-card { padding: 0; overflow: hidden; border-radius: 12px; }
.db-header {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #388e3c 100%);
  padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.db-header h3 { color: #fff; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; letter-spacing: -0.2px; }
.db-header h3 svg { width: 22px; height: 22px; stroke: rgba(255,255,255,0.9); }
.db-subtitle { color: rgba(255,255,255,0.65); font-size: 0.75rem; margin: 2px 0 0 30px; }
.db-header-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.db-table-bar {
  padding: 14px 24px; background: #f8fbf8;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.db-table-label { font-size: 0.78rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }

.table-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.table-pill {
  padding: 5px 16px; border-radius: 20px; font-size: 0.78rem;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  cursor: pointer; transition: all 0.2s; font-weight: 500;
}
.table-pill:hover { border-color: var(--primary); color: var(--primary); background: #f0f7f0; }
.table-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(46,125,50,0.25); }

.db-status {
  padding: 8px 24px; margin: 0; font-size: 0.78rem; color: var(--text-light);
  background: #fafafa; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
}
.db-status svg { width: 14px; height: 14px; stroke: var(--primary); }

.search-wrap { position: relative; }
.search-wrap .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #aaa; pointer-events: none; width: 16px; height: 16px;
}
.search-wrap .form-control { padding-left: 36px !important; border-radius: 20px !important; background: rgba(255,255,255,0.15) !important; border-color: rgba(255,255,255,0.25) !important; color: #fff !important; }
.search-wrap .form-control::placeholder { color: rgba(255,255,255,0.55); }
.search-wrap .form-control:focus { background: rgba(255,255,255,0.15) !important; border-color: rgba(255,255,255,0.4) !important; box-shadow: none !important; }

.db-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.8rem; }
.db-table thead th {
  background: #e8f5e9; color: var(--primary-dark); font-weight: 600;
  padding: 10px 12px; border: none; border-bottom: 2px solid var(--primary-light);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap;
}
.db-table tbody td {
  padding: 8px 12px; border-bottom: 1px solid #f0f0f0;
  font-size: 0.82rem; color: var(--text); white-space: nowrap;
}
.db-table tbody tr:nth-child(even) { background: #fafdfa; }
.db-table tbody tr:hover { background: #e8f5e9 !important; }
.db-table tbody tr:last-child td { border-bottom: none; }
.db-table .actions-cell { white-space: nowrap; width: 130px; text-align: right; }
.db-table .null-value { color: #bbb; font-style: italic; }

.btn-action {
  padding: 4px 10px; font-size: 0.72rem; border-radius: 4px;
  border: none; cursor: pointer; font-weight: 500; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-action svg { width: 13px; height: 13px; }
.btn-action-edit { background: #e3f2fd; color: #1565c0; }
.btn-action-edit:hover { background: #bbdefb; }
.btn-action-delete { background: #ffebee; color: #c62828; }
.btn-action-delete:hover { background: #ffcdd2; }

.db-empty {
  text-align: center; padding: 60px 24px; color: var(--text-light);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.db-empty svg { width: 48px; height: 48px; stroke: var(--border); }
.db-empty p { font-size: 0.9rem; margin: 0; }
.db-empty .sub { font-size: 0.8rem; color: #aaa; }

/* SQL Section */
.sql-card { padding: 0; overflow: hidden; border-radius: 12px; }
.sql-header {
  padding: 14px 20px; background: #f5f7fa;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border); user-select: none;
}
.sql-header h3 { font-size: 0.9rem; margin: 0; display: flex; align-items: center; gap: 6px; color: var(--text); }
.sql-header svg { width: 16px; height: 16px; stroke: var(--text-light); }
.sql-badge {
  font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
  background: var(--border); color: var(--text-light); padding: 1px 8px; border-radius: 10px; margin-left: 4px;
}
.sql-body { padding: 16px 20px; }
.sql-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Modal Theme */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
  z-index: 1000; animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal {
  background: white; border-radius: 16px; width: 520px; max-width: 92vw;
  max-height: 85vh; overflow: hidden; box-shadow: 0 25px 80px rgba(0,0,0,0.35);
  animation: slideUp 0.2s ease-out;
}
.modal-header {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #388e3c 100%);
  color: #fff; padding: 18px 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { margin: 0; font-size: 1rem; color: #fff; font-weight: 600; }
.modal-close {
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; line-height: 1;
}
.modal-close:hover { background: rgba(255,255,255,0.3); }
.modal-body { padding: 24px; overflow-y: auto; max-height: 55vh; }
.modal-table-label {
  font-size: 0.78rem; color: var(--text-light); margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}
.modal-footer .btn { padding: 8px 20px; font-size: 0.85rem; border-radius: 8px; }
.btn-cancel { background: #f5f5f5; color: var(--text); }
.btn-cancel:hover { background: #eee; }

#modalForm .form-group { margin-bottom: 14px; }
#modalForm label {
  display: flex; align-items: center; gap: 6px; font-size: 0.8rem;
  font-weight: 600; color: var(--text); margin-bottom: 5px;
}
#modalForm label .type-badge {
  font-weight: 400; font-size: 0.65rem; color: var(--text-light);
  background: #f0f0f0; padding: 0 6px; border-radius: 4px;
}
#modalForm .form-control {
  border-radius: 8px; border: 1.5px solid var(--border);
  padding: 9px 12px; font-size: 0.85rem;
}
#modalForm .form-control:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

/* ===== Profile Page ===== */
.profile-card { padding: 0; overflow: hidden; border-radius: 12px; max-width: 720px; margin: 0 auto; }
.profile-header {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #388e3c 100%);
  padding: 24px; display: flex; align-items: center; gap: 16px;
}
.profile-avatar {
  width: 52px; height: 52px; background: rgba(255,255,255,0.15);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-avatar svg { width: 28px; height: 28px; stroke: rgba(255,255,255,0.9); }
.profile-header h3 { color: #fff; font-size: 1.15rem; margin: 0; }
.profile-subtitle { color: rgba(255,255,255,0.65); font-size: 0.78rem; margin: 2px 0 0; }

.profile-section { padding: 20px 24px 0; }
.section-title {
  font-size: 0.82rem; font-weight: 600; color: var(--primary-dark);
  display: flex; align-items: center; gap: 6px; margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid #e8f5e9;
}
.section-title svg { width: 16px; height: 16px; stroke: var(--primary); }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.profile-actions {
  padding: 16px 24px 24px; display: flex; align-items: center; gap: 12px;
}
.profile-status { font-size: 0.82rem; transition: all 0.2s; }
.profile-status.success { color: var(--success); font-weight: 600; }
.profile-status.error { color: var(--danger); font-weight: 600; }
.hint { font-size: 0.72rem; color: var(--text-light); font-weight: 400; display: block; margin-top: 2px; }
.profile-stats { display: flex; gap: 16px; margin-top: 8px; }
.profile-stat { font-size: 0.8rem; color: rgba(255,255,255,0.8); }
.profile-stat .stat-num { font-weight: 700; color: #fff; font-size: 1rem; }

/* ── Pagination ── */
.pagination { display:flex; align-items:center; justify-content:center; gap:8px; padding:12px 0 4px; }
.pagination-info { font-size:0.82rem; color:var(--text-light); }
.pagination .btn:disabled { opacity:0.4; cursor:default; }

/* ── Toast Notification ── */
.toast-container { position:fixed; top:72px; right:20px; z-index:9999; display:flex; flex-direction:column; gap:8px; max-width:400px; }
.toast { padding:12px 16px; border-radius:var(--radius); color:#fff; font-size:0.88rem; box-shadow:0 4px 16px rgba(0,0,0,0.15); display:flex; align-items:center; gap:10px; animation:slideIn .3s ease; cursor:pointer; }
.toast-success { background:var(--success); }
.toast-error { background:var(--danger); }
.toast-info { background:var(--info); }
.toast-warning { background:var(--accent); }
.toast-icon { font-size:1.1rem; flex-shrink:0; }
.toast-close { margin-left:auto; cursor:pointer; opacity:.7; font-size:1.1rem; line-height:1; }
.toast-close:hover { opacity:1; }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes fadeOut { from{opacity:1} to{opacity:0;transform:translateY(-10px)} }

/* ── Modal Dialog ── */
.dialog-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.45); z-index:9998; display:flex; align-items:center; justify-content:center; animation:fadeIn .2s ease; }
.dialog-box { background:#fff; border-radius:12px; width:90%; max-width:480px; max-height:90vh; overflow-y:auto; box-shadow:0 8px 32px rgba(0,0,0,0.2); animation:scaleIn .2s ease; }
.dialog-header { padding:16px 20px; border-bottom:1px solid var(--border); font-weight:600; font-size:1rem; display:flex; align-items:center; justify-content:space-between; }
.dialog-body { padding:20px; }
.dialog-footer { padding:12px 20px; border-top:1px solid var(--border); display:flex; gap:8px; justify-content:flex-end; }
.dialog-footer .btn { min-width:80px; justify-content:center; }
.search-list { max-height:260px; overflow-y:auto; border:1px solid var(--border); border-radius:6px; margin-top:8px; }
.search-list-item { padding:10px 14px; cursor:pointer; border-bottom:1px solid var(--border); transition:background .15s; }
.search-list-item:last-child { border-bottom:none; }
.search-list-item:hover { background:#e8f5e9; }
.search-list-item.selected { background:#c8e6c9; font-weight:600; }
.search-list-item small { color:var(--text-light); display:block; font-size:0.78rem; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes scaleIn { from{transform:scale(.92);opacity:0} to{transform:scale(1);opacity:1} }

/* ── Responsive ── */

/* Tables scroll horizontally on small screens */
@media (max-width:768px) {
  table { display:block; width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; white-space:nowrap; }
  table thead, table tbody, table tr, table th, table td { white-space:nowrap; }
  .card table { max-width:calc(100vw - 48px); }
}
@media (max-width:480px) {
  .card table { max-width:calc(100vw - 32px); }
}

/* Small phones */
@media (max-width: 480px) {
  .navbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 8px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; order: 3; width: 100%;
    flex-direction: column; align-items: stretch;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 10px 12px; border-radius: 8px; }
  .nav-user { margin-left: auto; }
  .user-info { display: none; }
  .nav-brand h2 { font-size: 1.05rem; }
  .nav-subtitle { display: none; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-logo svg { width: 20px; height: 20px; }
  #main-content { padding: 10px; }
  .page-header { flex-direction: column; align-items: flex-start; margin-bottom: 16px; }
  .page-header h1 { font-size: 1.3rem; }
  .card { padding: 16px; }
  .card-header { flex-direction:column; align-items:stretch; gap:8px; }
  .card-header h3 { font-size:0.95rem; }
  .grid { grid-template-columns:1fr 1fr; gap:8px; }
  .stat-card { padding:14px; }
  .stat-card .stat-value { font-size:1.5rem; }
  .stat-card .stat-label { font-size:0.72rem; }
  th, td { padding:8px 6px; font-size:0.78rem; }
  .donation-detail-grid { grid-template-columns:1fr; gap:6px; }
  .profile-grid { grid-template-columns:1fr; }
  .profile-card { max-width:100%; }
  .modal { width:98vw; max-width:98vw; max-height:90vh; margin:0 5px; }
  .modal-body { padding:16px; max-height:50vh; }
  .modal-header { padding:14px 16px; }
  .auth-card { padding:24px 20px; }
  .auth-brand h1 { font-size:1.3rem; }
  .input-row { grid-template-columns:1fr; gap:0; }
  .auth-footer { display:none; }
  .form-group { margin-bottom:12px; }
  .form-control { padding:8px 10px; font-size:0.85rem; }
  .toast-container { right:10px; left:10px; max-width:none; top:66px; }
  .toast { font-size:0.82rem; padding:10px 14px; }
  .dialog-box { width:96%; }
  .db-header { flex-direction:column; align-items:stretch; padding:16px; }
  .db-header-right { justify-content:stretch; }
  .db-table-bar { flex-direction:column; align-items:stretch; padding:10px 16px; }
  .table-pills { gap:4px; }
  .table-pill { font-size:0.72rem; padding:4px 12px; }
  .search-wrap .form-control { width:100% !important; }
  .sql-body { padding:12px 16px; }
  .sql-actions { flex-direction:column; }
  .db-table thead th, .db-table tbody td { padding:6px 8px; font-size:0.72rem; }
  .profile-section { padding:16px 16px 0; }
  .profile-actions { padding:12px 16px 16px; flex-wrap:wrap; }
  .profile-header { padding:16px; flex-wrap:wrap; }
  .donation-detail-grid .detail-item { padding:4px 0; }
  .btn { padding:8px 14px; font-size:0.82rem; }
  .auth-page { min-height:100dvh; height:auto; padding:12px; }
  .auth-card { padding:20px 16px; width:100%; max-width:100%; border-radius:16px; }
  .dialog-body { padding:14px; }
  .dialog-header { padding:12px 14px; font-size:0.9rem; }
  .dialog-footer { padding:10px 14px; }
  .search-list-item { padding:8px 12px; font-size:0.82rem; }
  .db-table { font-size:0.72rem; }
  .db-table .actions-cell { white-space:nowrap; width:auto; }
  .btn-action { padding:3px 8px; font-size:0.65rem; }
  .btn-action svg { width:11px; height:11px; }
  .profile-stats { flex-wrap:wrap; gap:10px; }
}

/* Tablets and small screens */
@media (min-width: 481px) and (max-width: 768px) {
  .navbar { flex-wrap: wrap; height: auto; padding: 10px 16px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; order: 3; width: 100%;
    flex-direction: column; align-items: stretch;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 10px 12px; border-radius: 8px; }
  .nav-user { margin-left: auto; }
  #main-content { padding: 16px; }
  .card { padding:20px; }
  .grid { grid-template-columns:1fr 1fr; gap:12px; }
  .stat-card .stat-value { font-size:1.7rem; }
  .donation-detail-grid { grid-template-columns:1fr; }
  .auth-card { width:400px; }
  .profile-grid { grid-template-columns:1fr 1fr; }
  .db-header-right { justify-content:stretch; }
  .search-wrap .form-control { width:100% !important; }
  .toast-container { right:16px; max-width:360px; }
}

/* Landscape phones */
@media (max-height: 480px) and (orientation: landscape) {
  .auth-page { min-height:100dvh; height:auto; padding:10px; align-items:flex-start; padding-top:10px; }
  .auth-card { padding:16px; }
  .auth-brand { margin-bottom:12px; }
  .auth-brand h1 { font-size:1.1rem; }
  .auth-icon { width:36px; height:36px; margin-bottom:6px; }
  .auth-icon svg { width:20px; height:20px; }
  .auth-tabs { margin-bottom:12px; }
  .input-group { margin-bottom:8px; }
  .auth-demo { display:none; }
  .navbar { height:auto; padding:6px 12px; }
  .nav-link { padding:4px 8px; font-size:0.75rem; }
  .nav-icon { display:none; }
  #main-content { padding:8px; }
  .card { padding:12px; margin-bottom:10px; }
  .card-header { margin-bottom:8px; }
  .card-header h3 { font-size:0.85rem; }
  .grid { gap:6px; }
  .stat-card { padding:10px; }
  .stat-card .stat-value { font-size:1.2rem; }
  .stat-card .stat-label { font-size:0.65rem; }
  table { font-size:0.72rem; }
  th, td { padding:4px 6px; }
  .toast-container { top:56px; right:8px; max-width:300px; }
  .toast { font-size:0.75rem; padding:6px 10px; }
  .form-group { margin-bottom:8px; }
  .btn { padding:6px 12px; font-size:0.78rem; }
  .pagination { flex-wrap:wrap; gap:4px; }
  .pagination-info { font-size:0.72rem; }
}

/* Large screens */
@media (min-width: 1200px) {
  #main-content { padding:32px; }
  .card { padding:28px; }
  .grid { gap:20px; }
}

/* ============================================================
   Dark Mode
   ============================================================ */
html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #66bb6a;
  --primary-dark: #81c784;
  --primary-light: #4caf50;
  --accent: #ff8f3d;
--bg: #101713;
  --card: #18211c;
  --bg-alt: #1f2a23;
  --text: #e3ede6;
  --text-light: #8fa899;
  --border: #2b3a31;
  --success: #66bb6a;
  --warning: #ffb74d;
  --danger: #ef5350;
  --info: #64b5f6;
  --shadow: 0 2px 10px rgba(0,0,0,0.35);
}

html[data-theme="dark"] .navbar { background: #141c17; box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(0,0,0,0.4); }
html[data-theme="dark"] .nav-link:hover { background: #1d2a22; }
html[data-theme="dark"] .nav-toggle:hover { background: #1d2a22; }
html[data-theme="dark"] .theme-toggle:hover { background: #1d2a22; color: var(--primary); }
html[data-theme="dark"] .btn-outline:hover { background: #222d26; }
html[data-theme="dark"] .card { border-color: var(--border); }
html[data-theme="dark"] tbody tr:hover { background: #1c2a22; }
html[data-theme="dark"] .form-control { background: #101713; color: var(--text); }
html[data-theme="dark"] .form-control:focus { border-color: var(--primary); background: #141c17; }

/* Auth / login */
html[data-theme="dark"] .auth-page { background: linear-gradient(135deg, #08130b 0%, #0f2415 45%, #12301c 100%); }
html[data-theme="dark"] .auth-card { background: rgba(24,33,28,0.97); box-shadow: 0 25px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06); }
html[data-theme="dark"] .auth-tabs, html[data-theme="dark"] .reg-steps { background: #0f1712; }
html[data-theme="dark"] .auth-tab.active, html[data-theme="dark"] .reg-step.active { background: var(--card); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
html[data-theme="dark"] .input-wrapper .form-control { background: #101713; border-color: var(--border); }
html[data-theme="dark"] .input-wrapper .form-control:focus { background: #141c17; box-shadow: 0 0 0 3px rgba(102,187,106,0.18); }
html[data-theme="dark"] .auth-form .error-message { background: #2a1416; border-color: #4a2024; }
html[data-theme="dark"] .auth-footer { color: rgba(255,255,255,0.22); }

/* Stat card icons */
html[data-theme="dark"] .stat-icon.green { background: #14341c; color: #81c784; }
html[data-theme="dark"] .stat-icon.orange { background: #3a2510; color: #ffb74d; }
html[data-theme="dark"] .stat-icon.blue { background: #0f2740; color: #90caf9; }
html[data-theme="dark"] .stat-icon.purple { background: #2b1638; color: #ce93d8; }
html[data-theme="dark"] .stat-icon.red { background: #3a1518; color: #ff8a80; }
html[data-theme="dark"] .stat-icon.teal { background: #0f2b26; color: #4db6ac; }
html[data-theme="dark"] .stat-icon.indigo { background: #1a2038; color: #9fa8da; }
html[data-theme="dark"] .stat-icon.amber { background: #3a2f0f; color: #ffd54f; }

/* Modals & dialogs */
html[data-theme="dark"] .modal { background: var(--card); }
html[data-theme="dark"] .dialog-box { background: var(--card); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
html[data-theme="dark"] .dialog-header, html[data-theme="dark"] .dialog-footer { border-color: var(--border); }
html[data-theme="dark"] .btn-cancel { background: #222d26; color: var(--text); }
html[data-theme="dark"] .btn-cancel:hover { background: #2a362e; }
html[data-theme="dark"] .search-list-item:hover { background: #1c2a22; }
html[data-theme="dark"] .search-list-item.selected { background: #1e3a26; }
html[data-theme="dark"] #modalForm .form-control { background: #101713; border-color: var(--border); color: var(--text); }
html[data-theme="dark"] #modalForm label .type-badge { background: #222d26; color: var(--text-light); }

/* Database manager */
html[data-theme="dark"] .db-table-bar { background: #141c17; }
html[data-theme="dark"] .db-table thead th { background: #1c2a22; color: var(--primary); border-bottom-color: var(--border); }
html[data-theme="dark"] .db-table tbody td { border-bottom-color: #22302a; }
html[data-theme="dark"] .db-table tbody tr:nth-child(even) { background: #151f19; }
html[data-theme="dark"] .db-table tbody tr:hover { background: #1c2a22 !important; }
html[data-theme="dark"] .db-status { background: #141c17; color: var(--text-light); }
html[data-theme="dark"] .sql-header { background: #141c17; }
html[data-theme="dark"] .sql-badge { background: #222d26; color: var(--text-light); }
html[data-theme="dark"] .table-pill:hover { background: #1d2a22; }

/* Profile */
html[data-theme="dark"] .section-title { border-bottom-color: var(--border); }

/* Status messages */
html[data-theme="dark"] .otp-status.success, html[data-theme="dark"] .fp-message.success { background: #14341c; color: #81c784; }
html[data-theme="dark"] .otp-status.error, html[data-theme="dark"] .fp-message.error { background: #3a1518; color: #ff8a80; }
html[data-theme="dark"] .otp-status.info, html[data-theme="dark"] .fp-message.info { background: #0f2740; color: #90caf9; }
html[data-theme="dark"] .fp-message.warning { background: #3a2f0f; color: #ffd54f; }

/* Info banner & empty states */
html[data-theme="dark"] .info-banner { background: #14341c; border-color: #245c33; }
html[data-theme="dark"] .empty-state .empty-icon { background: #1c2a22; }

/* Badges */
html[data-theme="dark"] .role-badge.admin { background: #0f2740; color: #90caf9; }
html[data-theme="dark"] .role-badge.merchant { background: #3a2510; color: #ffb74d; }
html[data-theme="dark"] .role-badge.ngo { background: #14341c; color: #81c784; }
html[data-theme="dark"] .badge-pending { background: #3a2510; color: #ffb74d; }
html[data-theme="dark"] .badge-matched { background: #0f2740; color: #90caf9; }
html[data-theme="dark"] .badge-accepted { background: #14341c; color: #81c784; }
html[data-theme="dark"] .badge-rejected { background: #3a1518; color: #ff8a80; }
html[data-theme="dark"] .badge-pickup_booked, html[data-theme="dark"] .badge-driver_on_way, html[data-theme="dark"] .badge-driver_assigned { background: #2b1638; color: #ce93d8; }
html[data-theme="dark"] .badge-picked_up, html[data-theme="dark"] .badge-delivered, html[data-theme="dark"] .badge-completed { background: #14341c; color: #81c784; }
html[data-theme="dark"] .badge-cancelled { background: #222d26; color: #8fa899; }
html[data-theme="dark"] .badge-delivery_failed { background: #3a1518; color: #ff8a80; }
html[data-theme="dark"] .badge-success { background: #14341c; color: #81c784; }
html[data-theme="dark"] .badge-warning { background: #3a2510; color: #ffb74d; }
html[data-theme="dark"] .badge-danger { background: #3a1518; color: #ff8a80; }
html[data-theme="dark"] .badge-secondary { background: #222d26; color: #8fa899; }

/* Scrollbars */
html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2b3a31; border-radius: 5px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3a4c40; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }

/* -- Delivery Checkout -- */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.card-sub { display: block; font-size: 0.8rem; color: var(--text-light); margin-top: 2px; font-weight: 400; }
.flow-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.flow-step {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text);
  background: var(--bg-alt, #f5f5f5); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}
.flow-num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700;
}
.quote-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.quote-table td { padding: 8px 4px; border-bottom: 1px solid var(--border); color: var(--text); }
.quote-table td:last-child { text-align: right; }
.quote-rm { font-weight: 600; }
.quote-total-row td { border-bottom: none; }
.quote-total { font-size: 1.15rem; color: var(--primary); font-weight: 700; }
