:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --gold: #d97706;
  --gold-light: #fbbf24;
  --emerald: #059669;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-royal: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; position: relative; }

/* Notification Container */
#manager-toast-box {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 92vw;
}
.toast-alert {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(8px);
  color: #fff;
  border-left: 4px solid var(--gold-light);
  border-radius: 10px;
  padding: 0.85rem 1.15rem;
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  animation: slideInRight 0.3s ease-out;
  min-width: 290px;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Dynamic Caution Banner */
#city-caution-banner { display: none; background: #0f172a; border-bottom: 1px solid rgba(251, 191, 36, 0.35); color: #f8fafc; text-align: center; padding: 0.6rem 1rem; font-size: 0.84rem; font-weight: 500; }
#city-caution-banner a { color: var(--gold-light); text-decoration: underline; cursor: pointer; margin-left: 0.4rem; font-weight: 700; }

/* Header Bar */
header {
  background: linear-gradient(180deg, #090e1a 0%, #0f172a 100%);
  color: white;
  padding: 0.8rem 1.4rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.brand-group { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo { font-size: 1.28rem; font-weight: 800; color: #fff; letter-spacing: -0.2px; cursor: pointer; display: flex; align-items: center; gap: 0.4rem; }
.brand-logo span { color: var(--gold-light); }

.header-select-pill {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.38rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
}
.header-select-pill option { background: #0f172a; color: #fff; }

.header-right { position: relative; display: flex; align-items: center; gap: 0.65rem; }
.btn-header-auth {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.2s;
}
.btn-header-auth:hover { background: var(--accent-hover); }

.user-pill {
  display: none;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.9);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 0.82rem;
  color: #fff;
  font-weight: 600;
}

/* Profile Menu */
#profile-menu { display: none; position: absolute; top: 48px; right: 0; background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-royal); width: 220px; padding: 0.5rem 0; z-index: 1200; }
.menu-item-vertical { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1.1rem; color: #334155; font-size: 0.86rem; font-weight: 600; cursor: pointer; transition: 0.15s; text-decoration: none; }
.menu-item-vertical:hover { background: #f1f5f9; color: var(--accent); }
.menu-divider { border-bottom: 1px solid #f1f5f9; margin: 0.3rem 0; }
.menu-logout-vertical { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1.1rem; color: #dc2626; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.menu-logout-vertical:hover { background: #fef2f2; }

/* Navigation Tabs */
.customer-tabs {
  display: flex;
  gap: 0.55rem;
  justify-content: center;
  margin: 1.2rem 0 1.5rem;
  flex-wrap: wrap;
  position: relative;
}
.tab-btn {
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-weight: 700;
  cursor: pointer;
  background: #ffffff;
  color: #475569;
  font-size: 0.86rem;
  transition: 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.tab-btn.active {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}
.dropdown-container { position: relative; display: inline-block; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-royal);
  min-width: 220px;
  z-index: 1200;
  overflow: hidden;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  padding: 0.7rem 1rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border-bottom: 1px solid #f8fafc;
  transition: 0.15s;
}
.dropdown-item:hover { background: #f1f5f9; color: var(--accent); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.view-section { display: none; }
.view-section.active { display: block; }

/* Cards & Presentation Layout */
.app-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 2.2rem;
  box-shadow: var(--shadow-royal);
  max-width: 740px;
  margin: 0 auto 1.6rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  position: relative;
}
.app-card h3 { font-size: 1.35rem; margin-bottom: 0.6rem; color: #0f172a; text-align: center; font-weight: 800; }

.presentation-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.presentation-hero {
  background: radial-gradient(circle at 10% 20%, #1e293b 0%, #0f172a 90%);
  color: white;
  border-radius: 20px;
  padding: 2.3rem 1.8rem;
  text-align: center;
  margin-bottom: 1.2rem;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}
.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(217, 119, 6, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--gold-light);
  padding: 0.32rem 0.9rem;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.presentation-hero h1 { font-size: 1.9rem; margin-bottom: 0.65rem; font-weight: 800; letter-spacing: -0.3px; line-height: 1.25; }
.presentation-hero p { color: #cbd5e1; font-size: 0.92rem; max-width: 630px; margin: 0 auto 1.4rem; line-height: 1.55; }

.presentation-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.metric-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 0.9rem 0.5rem;
  text-align: center;
}
.metric-box h4 { font-size: 1.3rem; color: var(--gold-light); font-weight: 800; }
.metric-box span { font-size: 0.76rem; color: #94a3b8; font-weight: 600; display: block; margin-top: 0.2rem; }

.btn-presentation-city {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  font-weight: 800;
  padding: 0.8rem 1.9rem;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
  transition: 0.2s;
}

.announcements-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem;
  box-shadow: var(--shadow-royal);
}
.announcements-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 0.65rem;
  margin-bottom: 0.9rem;
}
.live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.static-bottom-caution {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 5px solid var(--gold);
  border-radius: 12px;
  padding: 1rem 1.3rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.05);
}
.static-bottom-caution h4 { color: #92400e; font-size: 0.92rem; font-weight: 800; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.4rem; }
.static-bottom-caution p { color: #78350f; font-size: 0.84rem; line-height: 1.55; }

/* Forms & Questions */
.step-label { font-weight: 700; font-size: 0.88rem; color: #334155; margin-bottom: 0.4rem; display: block; }
.form-control { width: 100%; padding: 0.75rem 0.85rem; border: 1.5px solid var(--border); border-radius: 10px; font-size: 0.92rem; margin-bottom: 1rem; background: #fff; transition: 0.2s; outline: none; }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.question-block { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
.question-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 0.6rem; color: #1e293b; }
.radio-option { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; font-size: 0.86rem; cursor: pointer; color: #475569; }

.valuation-result { display: none; background: #ecfdf5; border: 2px dashed #10b981; border-radius: 14px; padding: 1.5rem; text-align: center; margin-top: 1.5rem; }
.valuation-result h4 { color: #065f46; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem; }
.estimated-price { font-size: 2.2rem; font-weight: 800; color: #047857; margin-bottom: 0.4rem; }

.booking-block { background: #ffffff; border-top: 2px solid var(--border); padding-top: 1.5rem; margin-top: 1.5rem; text-align: left; }
.booking-block h4 { color: #0f172a; margin-bottom: 1rem; font-size: 1.05rem; font-weight: 800; }

.terms-agreement-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin: 1.1rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.83rem;
  color: #334155;
}
.terms-agreement-box input[type="checkbox"] { margin-top: 0.15rem; width: 16px; height: 16px; accent-color: var(--accent); }
.terms-agreement-box a { color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 600; }

.btn-action { width: 100%; padding: 0.85rem; background-color: var(--accent); color: white; border: none; border-radius: 10px; font-size: 0.92rem; font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-action:hover { filter: brightness(0.95); }
.btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.btn-secondary { background-color: #64748b; color: white; }
.btn-danger { background-color: #dc2626; color: white; border: none; padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: 700; }

.pickup-advice-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 5px solid var(--gold);
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: left;
}
.pickup-advice-card h4 { color: #92400e; font-size: 0.92rem; margin-bottom: 0.45rem; display: flex; align-items: center; gap: 6px; font-weight: 800; }
.pickup-advice-card ul { padding-left: 1.2rem; font-size: 0.83rem; color: #78350f; line-height: 1.6; }

/* Share Suite */
.share-grid-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 0.8rem;
}
.btn-share {
  border: none;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  transition: 0.2s;
}
.btn-share-driver { background: #0284c7; }
.btn-share-wa { background: #16a34a; }
.btn-share-mail { background: #ea580c; }
.btn-share-any { background: #475569; }

.phone-wrapper { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; margin-bottom: 1rem; }
.country-prefix { padding: 0.75rem 0.85rem; background-color: #f1f5f9; font-weight: bold; color: #334155; border-right: 1.5px solid var(--border); }
.phone-wrapper input { border: none; outline: none; padding: 0.75rem; width: 100%; font-size: 0.95rem; }

.divider-line { display: flex; align-items: center; text-align: center; margin: 1.3rem 0; color: #94a3b8; font-size: 0.82rem; font-weight: 700; }
.divider-line::before, .divider-line::after { content: ''; flex: 1; border-bottom: 1px solid #cbd5e1; }
.divider-line:not(:empty)::before { margin-right: .75em; }
.divider-line:not(:empty)::after { margin-left: .75em; }

.portal-tabs { display: flex; background: #e2e8f0; border-radius: 10px; padding: 4px; margin-bottom: 1.5rem; gap: 4px; }
.portal-tab-btn { flex: 1; border: none; padding: 0.65rem; border-radius: 8px; font-weight: 700; font-size: 0.88rem; cursor: pointer; background: transparent; color: #475569; transition: 0.2s; }
.portal-tab-btn.active { background: white; color: #0f172a; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* Tables & Hub Views */
.app-table { width: 100%; border-collapse: collapse; margin-top: 0.6rem; background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; font-size: 0.82rem; }
.app-table th, .app-table td { padding: 0.75rem 0.85rem; text-align: left; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.app-table th { background: #f8fafc; color: #334155; font-weight: 700; }
.header-filter-select, .header-filter-input { width: 100%; margin-top: 0.35rem; padding: 0.3rem 0.45rem; font-size: 0.76rem; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; outline: none; }

.order-id-link { color: var(--accent); text-decoration: underline; font-weight: 700; cursor: pointer; }

/* Modals */
.policy-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(4px); z-index: 3000; justify-content: center; align-items: center; }
.policy-modal-box { background: white; border-radius: 18px; padding: 1.8rem; width: 92%; max-width: 760px; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px rgba(0,0,0,0.3); }

/* Operations Workspace */
#staff-fullpage-workspace { display: none; max-width: 1300px; margin: 1.5rem auto; padding: 0 1rem; }
.workspace-header-bar { display: flex; justify-content: space-between; align-items: center; background: #0f172a; color: white; padding: 1.1rem 1.5rem; border-radius: 12px; margin-bottom: 1.4rem; }
.manager-nav-tabs { display: flex; gap: 0.55rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.mgr-tab-btn { background: #e2e8f0; color: #334155; border: none; padding: 0.65rem 1.3rem; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 0.86rem; }
.mgr-tab-btn.active { background: var(--accent); color: #fff; }

.manager-orders-layout {
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 1.4rem;
  align-items: start;
}

.queries-sidebar-box {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.query-alert-item {
  background: #f8fafc;
  border-left: 4px solid #f59e0b;
  padding: 0.7rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 0.7rem;
  font-size: 0.83rem;
}
.query-alert-item.alert-threat {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
}

.badge-blacklist { background: #fee2e2; color: #b91c1c; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 700; font-size: 0.76rem; display: inline-block; }
.badge-active { background: #dcfce7; color: #15803d; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 700; font-size: 0.76rem; }

.vertical-condition-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.7rem;
}
.part-condition-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.7rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.83rem;
}
.part-condition-name {
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.part-condition-val {
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.part-condition-val.warn { color: #b45309; background: #fef3c7; }
.part-condition-val.danger { color: #b91c1c; background: #fee2e2; }

.modal-nav-bar {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1rem;
  padding-bottom: 4px;
  flex-wrap: wrap;
}
.modal-tab-pill {
  background: none;
  border: none;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px;
  transition: 0.15s;
}
.modal-tab-pill.active {
  background: var(--accent);
  color: #ffffff;
}

@media (max-width: 860px) {
  header { padding: 0.65rem 0.8rem; }
  .brand-logo { font-size: 1.05rem; }
  .presentation-layout { grid-template-columns: 1fr; gap: 1rem; }
  .presentation-hero { padding: 1.8rem 1.2rem; }
  .presentation-hero h1 { font-size: 1.45rem; }
  .presentation-metrics { grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
  .metric-box h4 { font-size: 1.05rem; }
  .metric-box span { font-size: 0.68rem; }
  .app-card { padding: 1.5rem 1rem; border-radius: 14px; }
  .customer-tabs { gap: 0.35rem; }
  .tab-btn { padding: 0.5rem 0.75rem; font-size: 0.78rem; }
  .manager-orders-layout { grid-template-columns: 1fr; }
  .workspace-header-bar { flex-direction: column; gap: 0.8rem; text-align: center; }
}