/* ============================================
   Gorgeous Flowers Jamaica - OMS Shared Styles
   ============================================ */

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

/* ---- CSS Variables (Wocom palette) ---- */
:root {
  --primary: #7B2FF2;
  --primary-dark: #5A1FBD;
  --primary-light: #BE93FF;
  --primary-bg: #F0EBFF;
  --primary-deep: #2D0A5E;
  --primary-mid: #4A1494;
  --secondary: #38BD94;
  --secondary-dark: #2A8E6F;
  --secondary-light: #6FD9B8;
  --secondary-bg: #D1FAE5;
  --cream: #F9FAFB;
  --cream-dark: #F3F4F6;
  --dark: #1F2937;
  --dark-light: #374151;
  --accent: #f9ca24;
  --accent-light: #fde68a;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f7f7f7;
  --gray-200: #e9e9e9;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --info-text: #1e40af;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --success: #22c55e;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --teal: #14b8a6;
  --teal-bg: #ccfbf1;
  --teal-text: #0f766e;
  --orange: #f97316;
  --orange-bg: #ffedd5;
  --orange-text: #9a3412;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.14);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --transition: 0.2s ease;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-width: 240px;
  --topbar-height: 56px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--dark);
  background-color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--secondary); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 600; line-height: 1.3; color: var(--dark); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
table { border-collapse: collapse; width: 100%; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- Top Bar ---- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 2px solid var(--primary-light);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 0 0;
  box-shadow: var(--shadow-sm);
}
.topbar-logo {
  display: flex; align-items: center; gap: 10px;
  width: var(--sidebar-width); min-width: var(--sidebar-width);
  padding: 0 16px; height: 100%;
  font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700;
  color: var(--dark);
  border-right: 1px solid var(--gray-200);
}
.topbar-logo .flower { font-size: 1.4rem; }
.topbar-center {
  flex: 1; text-align: center;
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.5px;
}
.topbar-right {
  display: flex; align-items: center; gap: 14px;
}
.topbar-user, .topbar-user-btn {
  font-size: 0.82rem; color: var(--dark-light); font-weight: 600;
  background: transparent; border: none; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
}
.topbar-user-btn:hover {
  background: var(--primary-bg);
  color: var(--primary-dark);
}
.topbar-user-btn::before {
  content: '\1F464'; /* user icon */
  margin-right: 6px;
}
.topbar-logout {
  padding: 6px 16px; border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  background: var(--white); color: var(--dark-light); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition); font-family: var(--font-body);
}
.topbar-logout:hover { border-color: var(--danger); color: var(--danger); }

.hamburger {
  display: none; background: none; border: none; cursor: pointer; padding: 8px;
  flex-direction: column; gap: 4px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--dark); transition: var(--transition); }

/* ---- Sidebar ---- */
.sidebar {
  position: fixed; top: var(--topbar-height); left: 0; bottom: 0;
  width: var(--sidebar-width); background: var(--white);
  border-right: 1px solid var(--gray-200); overflow-y: auto;
  z-index: 90; padding: 16px 0;
  transition: transform 0.3s ease;
}
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a, .sidebar-nav button {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 20px;
  font-family: var(--font-body); font-size: 0.92rem; font-weight: 500;
  color: var(--dark-light); background: none; border: none;
  cursor: pointer; transition: all var(--transition); text-align: left;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav button:hover {
  background: var(--cream); color: var(--dark);
}
.sidebar-nav a:hover .nav-icon, .sidebar-nav button:hover .nav-icon {
  background: #fff;
  transform: scale(1.05);
}
.sidebar-nav a.active, .sidebar-nav button.active {
  background: var(--primary-bg); color: var(--primary-dark);
  border-left-color: var(--primary); font-weight: 600;
}
.sidebar-nav a.active .nav-icon, .sidebar-nav button.active .nav-icon {
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff;
  box-shadow: 0 4px 10px rgba(123,47,242,0.3);
}
.sidebar-nav .nav-icon {
  font-size: 1.4rem;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
  border-radius: 12px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.sidebar-divider { height: 1px; background: var(--gray-200); margin: 12px 16px; }

/* Sidebar profile circle pinned to bottom-left */
.sidebar { display: flex; flex-direction: column; }
.sidebar-nav { flex: 1; }
.sidebar-profile {
  position: relative;
  margin: auto 0 16px 16px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  width: 48px; height: 48px;
  align-self: flex-start;
}
.sidebar-profile-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD) center/cover;
  color: #fff;
  font-weight: 700; font-size: 17px;
  box-shadow: 0 4px 14px rgba(123,47,242,0.35);
  border: 2px solid #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}
.sidebar-profile:hover .sidebar-profile-avatar {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(123,47,242,0.5);
}
/* Hover tooltip (name + email) */
.sidebar-profile-tip {
  position: absolute;
  left: calc(100% + 12px);
  bottom: 0;
  background: #1F2937;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  display: flex; flex-direction: column;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 100;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.sidebar-profile-tip::before {
  content: '';
  position: absolute;
  left: -5px; bottom: 18px;
  width: 10px; height: 10px;
  background: #1F2937;
  transform: rotate(45deg);
}
.sidebar-profile:hover .sidebar-profile-tip {
  opacity: 1;
  transform: translateX(0);
}
.sp-name { font-weight: 700; font-size: 13px; }
.sp-email { font-size: 11px; opacity: 0.75; margin-top: 2px; }

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-height));
}

/* ---- Page Header ---- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-size: 1.35rem; }

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm); border-left: 4px solid var(--gray-300);
  display: flex; align-items: center; gap: 14px;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 46px; height: 46px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.stat-info .stat-value { font-size: 1.6rem; font-weight: 700; font-family: var(--font-heading); line-height: 1.2; }
.stat-info .stat-label { font-size: 0.72rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }

.stat-card.blue { border-left-color: var(--info); }
.stat-card.blue .stat-icon { background: var(--info-bg); color: var(--info); }
.stat-card.amber { border-left-color: var(--warning); }
.stat-card.amber .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat-card.teal { border-left-color: var(--teal); }
.stat-card.teal .stat-icon { background: var(--teal-bg); color: var(--teal); }
.stat-card.orange { border-left-color: var(--orange); }
.stat-card.orange .stat-icon { background: var(--orange-bg); color: var(--orange); }
.stat-card.green { border-left-color: var(--secondary); }
.stat-card.green .stat-icon { background: var(--secondary-bg); color: var(--secondary); }
.stat-card.gold { border-left-color: var(--accent); }
.stat-card.gold .stat-icon { background: #fdf6e3; color: var(--accent); }

/* ---- Cards / Panels ---- */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 2px solid var(--primary-light);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.card-header h3 { font-size: 1.05rem; }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* ---- Data Tables ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--cream); }
.data-table th {
  padding: 12px 14px; text-align: left; font-size: 0.72rem; font-weight: 700;
  color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid var(--primary-light); white-space: nowrap;
}
.data-table td {
  padding: 11px 14px; font-size: 0.82rem; border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.data-table tbody tr { cursor: pointer; transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--cream); }
.data-table tbody tr:nth-child(even) { background: var(--gray-50); }
.data-table tbody tr:nth-child(even):hover { background: var(--cream); }
.data-table tbody tr.selected { background: var(--primary-bg); }
.data-table td.mono { font-family: 'SF Mono', 'Consolas', monospace; font-weight: 600; font-size: 0.8rem; }
.data-table .no-click { cursor: default; }

/* ---- Status Badges ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px; white-space: nowrap;
}
.status-new, .badge-new { background: var(--info-bg); color: var(--info-text); }
.status-preparing, .badge-preparing, .badge-in_progress, .badge-in-progress { background: var(--warning-bg); color: var(--warning-text); }
.status-ready, .badge-ready { background: var(--teal-bg); color: var(--teal-text); }
.status-out-for-delivery, .badge-out_for_delivery, .badge-out-for-delivery { background: var(--orange-bg); color: var(--orange-text); }
.status-delivered, .badge-delivered { background: var(--success-bg); color: var(--success-text); }
.status-completed, .badge-completed { background: #a7f3d0; color: #064e3b; }
.status-cancelled, .badge-cancelled { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }
.badge-pending { background: var(--info-bg); color: var(--info-text); }
.badge-delivery { background: var(--secondary-bg); color: var(--secondary-dark); }
.badge-pickup { background: #e0e7ff; color: #4338ca; }

/* ---- Priority Badges ---- */
.priority-normal, .badge-priority-normal { background: var(--gray-100); color: var(--gray-500); }
.priority-high, .badge-priority-high { background: var(--danger-bg); color: var(--danger-text); border: 1.5px solid var(--danger); }
.priority-urgent, .badge-priority-urgent {
  background: var(--danger-bg); color: var(--danger-text); border: 1.5px solid var(--danger);
  animation: pulse-badge 1.5s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  border: 2px solid transparent; cursor: pointer;
  transition: all var(--transition); text-decoration: none; line-height: 1.4;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 4px 12px rgba(123,47,242,0.3); }
.btn-success { background: var(--secondary); color: var(--white); border-color: var(--secondary); }
.btn-success:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); box-shadow: 0 4px 12px rgba(90,138,106,0.3); }
.btn-warning { background: var(--warning); color: var(--white); border-color: var(--warning); }
.btn-warning:hover { background: #d97706; border-color: #d97706; }
.btn-danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-outline { background: transparent; color: var(--primary-dark); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-outline-gray { background: transparent; color: var(--dark-light); border-color: var(--gray-300); }
.btn-outline-gray:hover { background: var(--gray-100); }
.btn-sm { padding: 6px 14px; font-size: 0.78rem; border-radius: 6px; }
.btn-lg { padding: 14px 32px; font-size: 0.95rem; }
.btn-icon { padding: 6px; border-radius: 6px; min-width: 32px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--dark); margin-bottom: 5px;
}
.form-group label .required { color: var(--danger); }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.88rem;
  color: var(--dark); background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(123,47,242,0.12);
}
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 70px; }
select.form-control {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23737373' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section {
  background: var(--cream); border-radius: var(--radius-md);
  padding: 18px; margin-bottom: 18px;
}
.form-section-title {
  font-size: 0.75rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 12px; font-family: var(--font-body);
}

/* Order type toggle */
.order-type-toggle {
  display: flex; border-radius: var(--radius-sm);
  overflow: hidden; border: 1.5px solid var(--gray-300); margin-bottom: 14px;
}
.order-type-btn {
  flex: 1; padding: 10px; border: none; background: var(--white);
  cursor: pointer; font-family: var(--font-body); font-size: 0.88rem;
  font-weight: 600; color: var(--dark-light); transition: all var(--transition); text-align: center;
}
.order-type-btn.active { background: var(--primary); color: var(--white); }
.order-type-btn:not(.active):hover { background: var(--cream); }

/* ---- Items Table (in order form) ---- */
.items-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.items-table th {
  text-align: left; padding: 8px 10px; font-size: 0.72rem; font-weight: 700;
  color: var(--gray-500); text-transform: uppercase;
  border-bottom: 2px solid var(--primary-light); background: var(--cream);
}
.items-table td { padding: 8px 10px; font-size: 0.82rem; border-bottom: 1px solid var(--gray-100); }
.items-table tfoot td {
  font-weight: 700; font-size: 1rem;
  border-top: 2px solid var(--secondary); background: var(--secondary-bg);
  padding: 10px;
}
.items-table .remove-btn {
  background: none; border: none; color: var(--danger); cursor: pointer;
  font-size: 1.1rem; padding: 2px 6px;
}
.items-table .remove-btn:hover { color: #dc2626; }

/* ---- Filters Bar ---- */
.filters-bar {
  background: var(--white); border-radius: var(--radius-lg); padding: 14px 18px;
  margin-bottom: 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.filters-bar select, .filters-bar input[type="text"], .filters-bar input[type="date"] {
  padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.8rem; background: var(--white); min-width: 130px;
}
.filters-bar select:focus, .filters-bar input:focus { outline: none; border-color: var(--primary); }
.filters-bar input[type="text"] { min-width: 180px; }
.filter-label { font-size: 0.72rem; color: var(--gray-500); font-weight: 600; }

/* ---- Modal / Overlay ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 500;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-xl);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 1.15rem; }
.modal-close {
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: var(--gray-400); padding: 4px; line-height: 1;
}
.modal-close:hover { color: var(--dark); }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--gray-200);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ---- Slide Panel (Order Detail) ---- */
.slide-panel {
  display: none; position: fixed; top: var(--topbar-height); right: 0; bottom: 0;
  width: 540px; max-width: 100%; background: var(--white); z-index: 95;
  box-shadow: -4px 0 30px rgba(0,0,0,0.12); overflow-y: auto;
  transform: translateX(100%); transition: transform 0.3s ease;
}
.slide-panel.open { display: block; transform: translateX(0); }
.slide-panel-header {
  position: sticky; top: 0; background: var(--white);
  padding: 16px 20px; border-bottom: 2px solid var(--primary-light);
  display: flex; align-items: center; justify-content: space-between; z-index: 1;
}
.slide-panel-header h3 { font-size: 1.1rem; }
.slide-panel-body { padding: 20px; }

.detail-section {
  background: var(--cream); border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 16px;
}
.detail-section h4 {
  font-size: 0.72rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px; font-family: var(--font-body);
}
.detail-section p { font-size: 0.85rem; margin-bottom: 4px; }
.detail-section p strong { font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }

/* Status Timeline (vertical in detail panel) */
.status-timeline { position: relative; padding-left: 34px; margin: 16px 0; }
.status-timeline::before {
  content: ''; position: absolute; left: 13px; top: 0; bottom: 0;
  width: 2px; background: var(--gray-200);
}
.timeline-step { position: relative; padding: 10px 0 18px; }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -34px; top: 12px; width: 28px; height: 28px;
  border-radius: 50%; background: var(--white); border: 2px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; z-index: 1;
}
.timeline-step.completed .timeline-dot { background: var(--secondary); border-color: var(--secondary); color: var(--white); }
.timeline-step.active .timeline-dot {
  background: var(--primary); border-color: var(--primary); color: var(--white);
  box-shadow: 0 0 0 4px rgba(123,47,242,0.2);
}
.timeline-step-label { font-weight: 600; font-size: 0.85rem; color: var(--gray-400); }
.timeline-step.completed .timeline-step-label,
.timeline-step.active .timeline-step-label { color: var(--dark); }
.timeline-step-desc { font-size: 0.75rem; color: var(--gray-400); margin-top: 1px; }
.timeline-step-meta { font-size: 0.7rem; color: var(--gray-500); margin-top: 2px; font-style: italic; }

/* Action Row */
.actions-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.action-group { display: flex; flex-direction: column; gap: 4px; }
.action-group label { font-size: 0.72rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; }
.action-group select { padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 0.82rem; font-family: var(--font-body); }
.action-inline { display: flex; gap: 6px; }

/* Delivery Photo */
.delivery-photo { margin-top: 16px; }
.delivery-photo img {
  max-width: 280px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); cursor: pointer;
}
.delivery-photo img:hover { box-shadow: var(--shadow-lg); }

/* ---- Tabs ---- */
.tab-group { display: flex; gap: 2px; margin-bottom: 20px; background: var(--gray-100); border-radius: var(--radius-md); padding: 3px; display: inline-flex; }
.tab-btn {
  padding: 8px 20px; border: none; background: transparent;
  border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.82rem;
  font-weight: 600; color: var(--gray-500); cursor: pointer; transition: all var(--transition);
}
.tab-btn.active { background: var(--primary); color: var(--white); }
.tab-btn:hover:not(.active) { background: var(--cream); color: var(--dark); }

/* ---- Report Styles ---- */
.report-period {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 20px;
}
.report-summary {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.report-card {
  background: var(--white); border-radius: var(--radius-md); padding: 18px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.report-card .value { font-size: 1.6rem; font-weight: 700; font-family: var(--font-heading); color: var(--secondary-dark); }
.report-card .label { font-size: 0.72rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; margin-top: 4px; }
.report-breakdown {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px;
}
.breakdown-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 0.85rem; }

/* ---- Toast Notifications ---- */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 600; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 500; color: var(--white);
  box-shadow: var(--shadow-lg);
  transform: translateX(120%); transition: transform 0.3s ease;
  max-width: 380px; display: flex; align-items: center; gap: 8px;
}
.toast.show { transform: translateX(0); }
.toast-success { background: var(--secondary); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }

/* ---- Loading / Empty ---- */
.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 3px solid var(--gray-200); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state { display: flex; flex-direction: column; align-items: center; padding: 48px 20px; color: var(--gray-400); }
.loading-state .spinner { margin-bottom: 12px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-400); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 10px; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

/* ---- Tracking Page ---- */
.tracking-page {
  min-height: 100vh; background: linear-gradient(135deg, #f9e4eb 0%, #F9FAFB 40%, #e8f0e4 100%);
}
.tracking-header {
  background: var(--white); border-bottom: 2px solid var(--primary-light);
  padding: 14px 20px; display: flex; align-items: center; justify-content: center;
}
.tracking-header .logo { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: var(--dark); }
.tracking-container { max-width: 640px; margin: 0 auto; padding: 40px 20px; }
.tracking-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.tracking-card-header {
  padding: 20px 24px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.tracking-card-header h2 { font-size: 1.2rem; }
.tracking-card-body { padding: 24px; }

.tracking-search { max-width: 480px; margin: 0 auto; text-align: center; }
.tracking-search h2 { margin-bottom: 8px; }
.tracking-search p { color: var(--gray-500); margin-bottom: 20px; font-size: 0.9rem; }
.tracking-search-form { display: flex; gap: 8px; }
.tracking-search-form input { flex: 1; }

.order-info { margin-top: 20px; border-top: 1px solid var(--gray-200); padding-top: 16px; }
.order-info-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.88rem; }
.order-info-row .label { color: var(--gray-500); }
.order-info-row .value { font-weight: 600; }
.order-items-list { margin-top: 14px; }
.order-items-list h4 { font-size: 0.9rem; margin-bottom: 8px; }
.order-items-list li { list-style: none; padding: 5px 0; display: flex; justify-content: space-between; font-size: 0.85rem; border-bottom: 1px solid var(--gray-100); }
.order-items-list li:last-child { border-bottom: none; }

.tracking-footer {
  text-align: center; padding: 40px 20px 24px;
  font-size: 0.78rem; color: var(--gray-500);
}
.tracking-footer a { color: var(--primary-dark); }
.tracking-footer .phones { margin-top: 8px; }
.tracking-footer .phones a { margin: 0 6px; }

/* ---- Print Styles ---- */
@media print {
  .sidebar, .topbar, .hamburger, .btn, .filters-bar,
  .actions-row, .toast-container, .slide-panel-header button { display: none !important; }
  .main-content { margin: 0 !important; padding: 10px !important; }
  .slide-panel {
    position: static !important; width: 100% !important; max-width: 100% !important;
    transform: none !important; box-shadow: none !important;
  }
  .card { box-shadow: none !important; border: 1px solid #ddd; }
  .data-table tbody tr:nth-child(even) { background: #f9f9f9 !important; }
  body { background: #fff !important; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .slide-panel { width: 100%; }
  .report-breakdown { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .hamburger { display: flex; }
  .topbar-logo { min-width: auto; width: auto; border-right: none; padding: 0 10px; font-size: 0.95rem; }
  .topbar-center { display: none; }

  .sidebar {
    transform: translateX(-100%); width: 260px; z-index: 99;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3);
    z-index: 98; top: var(--topbar-height);
  }
  .sidebar-overlay.open { display: block; }

  .main-content { margin-left: 0; padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filters-bar { flex-direction: column; }
  .filters-bar select, .filters-bar input[type="text"], .filters-bar input[type="date"] { min-width: 100%; width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .data-table th, .data-table td { padding: 8px 6px; font-size: 0.75rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .actions-row { flex-direction: column; }
  .report-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .report-summary { grid-template-columns: 1fr; }
  .tracking-search-form { flex-direction: column; }
}

/* Quick date/time selector buttons */
.quick-date-btn, .quick-time-btn {
  min-width: 60px;
  padding: 8px 14px;
  font-size: 13px;
  border: 2px solid var(--primary-light);
  border-radius: 20px;
  background: #fff;
  color: var(--dark);
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.quick-date-btn:hover, .quick-time-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--dark);
}
#productSearch { font-size: 15px; padding: 10px 14px; }

/* Order progress overlay */
.order-progress-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 32px 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: progressSlideIn 0.4s ease;
}
@keyframes progressSlideIn {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.order-progress-spinner { margin: 0 auto 8px; }

/* Custom confirm modal */
#confirmOverlay { display: none; }
#confirmCancelBtn:hover { background: #f5f5f5; }
#confirmOkBtn:hover { filter: brightness(1.1); }

/* ====================== DASHBOARD HERO + KPI TILES ====================== */
.dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 36px 38px;
  margin: 22px 0 22px;
  color: #fff;
  background: linear-gradient(120deg, #2D0A5E 0%, #4A1494 35%, #7B2FF2 100%);
  background-size: 220% 220%;
  animation: dhGradient 18s ease infinite;
  box-shadow: 0 20px 50px rgba(45,10,94,0.35);
}
@keyframes dhGradient {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.dash-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(190,147,255,0.20), transparent 50%);
}
.dash-hero-content { position: relative; z-index: 1; max-width: 720px; }
.dash-hero-illust {
  position: absolute;
  right: 32px; top: 50%; transform: translateY(-50%);
  font-size: 180px;
  opacity: 0.18;
  line-height: 1;
  z-index: 1;
  user-select: none;
}
.dash-hero-eyebrow {
  font-size: 11px; letter-spacing: 2.5px;
  color: #DBC6FF; font-weight: 700;
  margin-bottom: 8px;
}
.dash-hero-title {
  font-size: 36px; font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -1px; line-height: 1.1;
  color: #fff !important;
  font-family: var(--font-heading);
}
.dash-hero-sub {
  font-size: 15px; margin: 0 0 22px;
  color: rgba(255,255,255,0.85);
}
.dash-hero-revenue {
  display: inline-flex; flex-direction: column;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(8px);
  padding: 12px 18px;
  border-radius: 14px;
  margin-bottom: 22px;
  border: 1px solid rgba(255,255,255,0.18);
}
.dhr-label { font-size: 10px; letter-spacing: 1.5px; opacity: 0.85; text-transform: uppercase; }
.dhr-value { font-size: 30px; font-weight: 800; margin-top: 2px; letter-spacing: -1px; }

.dash-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-hero-cta {
  background: #fff;
  color: #5A1FBD;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}
.dash-hero-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 22px rgba(0,0,0,0.2); }
.dash-hero-cta-ghost {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: none;
}
.dash-hero-cta-ghost:hover { background: rgba(255,255,255,0.25); box-shadow: none; }

@media (max-width: 720px) {
  .dash-hero { padding: 28px 22px; border-radius: 18px; }
  .dash-hero-title { font-size: 26px; }
  .dash-hero-illust { font-size: 110px; opacity: 0.1; right: 10px; }
}

/* KPI tiles */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-tile {
  background: #fff;
  border-radius: 18px;
  padding: 20px 18px;
  border: 1px solid #E5E7EB;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.kpi-tile::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.kpi-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(123,47,242,0.12);
}
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}
.kpi-value {
  font-size: 32px; font-weight: 800;
  letter-spacing: -1px; line-height: 1;
  color: #1F2937;
  font-family: var(--font-heading);
}
.kpi-label {
  font-size: 12px; color: #6B7280;
  font-weight: 600; margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.kpi-trend {
  font-size: 11px; color: #9CA3AF; margin-top: 8px;
}
.kpi-blue::before   { background: linear-gradient(90deg,#3B82F6,#60A5FA); }
.kpi-blue   .kpi-icon { background: #DBEAFE; color: #1E40AF; }
.kpi-amber::before  { background: linear-gradient(90deg,#F59E0B,#FBBF24); }
.kpi-amber  .kpi-icon { background: #FEF3C7; color: #92400E; }
.kpi-teal::before   { background: linear-gradient(90deg,#14B8A6,#5EEAD4); }
.kpi-teal   .kpi-icon { background: #CCFBF1; color: #0F766E; }
.kpi-orange::before { background: linear-gradient(90deg,#F97316,#FB923C); }
.kpi-orange .kpi-icon { background: #FFEDD5; color: #9A3412; }
.kpi-green::before  { background: linear-gradient(90deg,#22C55E,#4ADE80); }
.kpi-green  .kpi-icon { background: #DCFCE7; color: #15803D; }
.kpi-purple::before { background: linear-gradient(90deg,#7B2FF2,#BE93FF); }
.kpi-purple .kpi-icon { background: #F0EBFF; color: #5A1FBD; }

/* ====================== GRAPHICAL DASHBOARD ====================== */
.dash-graph-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  margin-top: 20px;
}
.dash-card-trend  { grid-column: 1 / 2; grid-row: 1; }
.dash-card-donut  { grid-column: 2 / 3; grid-row: 1; }
.dash-card-hourly { grid-column: 1 / 2; grid-row: 2; }
.dash-card-feed   { grid-column: 2 / 3; grid-row: 2; }

@media (max-width: 980px) {
  .dash-graph-grid { grid-template-columns: 1fr; }
  .dash-card-trend, .dash-card-donut, .dash-card-hourly, .dash-card-feed {
    grid-column: 1; grid-row: auto;
  }
}

.dash-graph-grid .card {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(31,41,55,0.04);
  border: 1px solid #EEF0F4;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.dash-graph-grid .card:hover {
  box-shadow: 0 8px 24px rgba(123,47,242,0.10);
  border-color: #DBC6FF;
  transform: translateY(-2px);
}
.dash-graph-grid .card-body {
  flex: 1;
  position: relative;
  min-height: 0;
  padding: 16px 20px 20px;
}
.dash-card-trend  .card-body { height: 250px; }
.dash-card-donut  .card-body { height: 280px; }
.dash-card-hourly .card-body { height: 170px; }
.dash-card-feed   .card-body { height: 280px; padding: 0; }
.dash-graph-grid canvas {
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Sleek minimal headers — no more loud gradients */
.dash-grad-header {
  background: #fff;
  color: #1F2937;
  padding: 16px 20px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
}
.dash-grad-header.donut, .dash-grad-header.hourly, .dash-grad-header.feed { background: #fff; }
.dash-grad-header h3 {
  margin: 0;
  color: #1F2937 !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.dash-grad-header h3::before {
  content: '';
  width: 4px; height: 16px;
  background: linear-gradient(180deg, #7B2FF2, #5A1FBD);
  border-radius: 2px;
  display: inline-block;
}
.dash-card-donut  .dash-grad-header h3::before { background: linear-gradient(180deg, #BE93FF, #7B2FF2); }
.dash-card-hourly .dash-grad-header h3::before { background: linear-gradient(180deg, #38BD94, #2A8E6F); }
.dash-card-feed   .dash-grad-header h3::before { background: linear-gradient(180deg, #F59E0B, #D97706); }

.dash-live-pill {
  background: #F0FDF4;
  color: #15803D;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #BBF7D0;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 6px #22C55E;
  animation: livePulse 1.8s infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -45%);
  text-align: center;
  pointer-events: none;
}
.donut-center .donut-num {
  font-size: 36px;
  font-weight: 800;
  color: #5A1FBD;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1;
}
.donut-center .donut-lbl {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 6px;
}

.recent-feed { max-height: 320px; overflow-y: auto; }
.recent-feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #E5E7EB;
  cursor: pointer;
  transition: background 0.15s;
}
.recent-feed-item:hover { background: #F9FAFB; }
.recent-feed-item:last-child { border-bottom: none; }
.recent-feed-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #BE93FF, #7B2FF2);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.recent-feed-body { flex: 1; min-width: 0; }
.recent-feed-name { font-weight: 600; font-size: 13px; color: #2d2d2d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-feed-meta { font-size: 11px; color: #888; margin-top: 2px; }
.recent-feed-amount { font-weight: 700; font-size: 14px; color: #5a8a6a; flex-shrink: 0; }
.recent-feed-empty {
  padding: 40px 20px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

/* ====================== SMS CENTER ====================== */
.sms-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
}
.sms-pill::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.sms-pill-ok      { background: #e8f5ed; color: #2d6a3d; }
.sms-pill-ok::before      { background: #4caf50; box-shadow: 0 0 6px #4caf50; }
.sms-pill-warn    { background: #fff3e0; color: #b76410; }
.sms-pill-warn::before    { background: #ff9800; }
.sms-pill-fail    { background: #fce8e8; color: #b03030; }
.sms-pill-fail::before    { background: #e53935; }
.sms-pill-unknown { background: #eee; color: #888; }
.sms-pill-unknown::before { background: #aaa; }

.sms-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.sms-overview-card .card-body { padding: 18px 20px; }
.sms-ov-label { font-size: 11px; text-transform: uppercase; color: #888; letter-spacing: 1px; }
.sms-ov-value { font-size: 18px; font-weight: 700; color: #2d2d2d; margin: 4px 0; }
.sms-ov-sub   { font-size: 12px; color: #888; }
.sms-stat-row { display: flex; gap: 18px; }
.sms-stat-num { font-size: 26px; font-weight: 800; color: #5A1FBD; font-family: 'Plus Jakarta Sans', sans-serif; }
.sms-stat-failed { color: #e53935; }

.sms-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
}
@media (max-width: 980px) { .sms-grid { grid-template-columns: 1fr; } }

.sms-status-sent      { background: #e8f5ed; color: #2d6a3d; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.sms-status-failed    { background: #fce8e8; color: #b03030; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.sms-status-skipped   { background: #eee; color: #888; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }

/* ====================== NOTIFICATIONS ====================== */
.notif-bell {
  position: relative;
  background: rgba(255,255,255,0.15);
  border: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px;
  transition: background 0.15s, transform 0.15s;
  color: #fff;
}
.notif-bell:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }
.notif-bell-icon { font-size: 18px; line-height: 1; }
.notif-bell.has-new .notif-bell-icon { animation: bellShake 0.6s ease 2; transform-origin: top center; }
@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-15deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(5deg); }
}
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #e53935;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(229,57,53,0.4);
  animation: badgePulse 2s infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(229,57,53,0.4); }
  50% { box-shadow: 0 2px 12px rgba(229,57,53,0.8); }
}

.notif-panel {
  position: fixed;
  top: 60px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 500px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  border: 1px solid #E5E7EB;
  z-index: 700;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: notifPanelOpen 0.2s ease;
}
.notif-panel.open { display: flex; }
@keyframes notifPanelOpen {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.notif-panel-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, #7B2FF2 0%, #5A1FBD 100%);
  color: #fff;
  display: flex; justify-content: space-between; align-items: center;
}
.notif-panel-header h4 { margin: 0; font-size: 15px; font-weight: 600; }
.notif-mark-read {
  background: rgba(255,255,255,0.2);
  border: none; color: #fff;
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
}
.notif-mark-read:hover { background: rgba(255,255,255,0.35); }

.notif-panel-body { overflow-y: auto; flex: 1; }
.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
}
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid #E5E7EB;
  cursor: pointer;
  display: flex;
  gap: 12px;
  transition: background 0.15s;
}
.notif-item:hover { background: #F9FAFB; }
.notif-item.unread { background: #F0EBFF; border-left: 3px solid #7B2FF2; }
.notif-item-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.notif-item-icon.delivered { background: linear-gradient(135deg, #d4f5dc, #a0e0b3); color: #2d6a3d; }
.notif-item-icon.completed { background: linear-gradient(135deg, #d4ecf5, #a0c8e0); color: #1a5577; }
.notif-item-icon.cancelled { background: linear-gradient(135deg, #fddede, #f5b0b0); color: #b03030; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-weight: 600; font-size: 13px; color: #2d2d2d; }
.notif-item-text  { font-size: 12px; color: #666; margin-top: 2px; }
.notif-item-time  { font-size: 11px; color: #aaa; margin-top: 4px; }

/* ===== Rich delivery popup (top-right, slides in) ===== */
.delivery-popup {
  position: fixed;
  top: 70px;
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(45,106,61,0.25);
  border: 1px solid #d4f5dc;
  z-index: 800;
  overflow: hidden;
  animation: deliveryPopupSlide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
@keyframes deliveryPopupSlide {
  from { opacity: 0; transform: translateX(120%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.delivery-popup.closing { animation: deliveryPopupOut 0.3s forwards; }
@keyframes deliveryPopupOut {
  to { opacity: 0; transform: translateX(120%); }
}
.delivery-popup.cancelled { box-shadow: 0 16px 48px rgba(176,48,48,0.25); border-color: #fddede; }
.delivery-popup-header {
  background: linear-gradient(135deg, #4eaf6d 0%, #2d6a3d 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
}
.delivery-popup.cancelled .delivery-popup-header {
  background: linear-gradient(135deg, #e85a5a 0%, #b03030 100%);
}
.delivery-popup-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  animation: deliveryIconBounce 0.7s ease 0.2s;
}
@keyframes deliveryIconBounce {
  0%   { transform: scale(0.4); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.delivery-popup-title { flex: 1; font-weight: 700; font-size: 15px; line-height: 1.2; }
.delivery-popup-sub   { font-size: 11px; opacity: 0.85; margin-top: 2px; font-weight: 400; }
.delivery-popup-close {
  background: rgba(255,255,255,0.2);
  border: none; color: #fff;
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px; line-height: 1;
}
.delivery-popup-body {
  padding: 14px 18px;
  font-size: 13px;
  color: #444;
  line-height: 1.5;
}
.delivery-popup-body strong { color: #2d2d2d; }
.delivery-popup-progress {
  height: 3px;
  background: rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}
.delivery-popup-progress::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 100%;
  background: linear-gradient(90deg, #4eaf6d, #a0e0b3);
  animation: deliveryProgress 8s linear forwards;
}
.delivery-popup.cancelled .delivery-popup-progress::after {
  background: linear-gradient(90deg, #e85a5a, #f5b0b0);
}
@keyframes deliveryProgress {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

/* Stack multiple popups */
.delivery-popup-stack {
  position: fixed; top: 70px; right: 16px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 800;
  pointer-events: none;
}
.delivery-popup-stack .delivery-popup {
  position: relative; top: auto; right: auto;
  pointer-events: auto;
}

/* ====================== SETTINGS ====================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 980px) { .settings-grid { grid-template-columns: 1fr; } }
.mono { font-family: 'Courier New', monospace; }

/* ====================== NEW ORDER FORM (presentable layout) ====================== */
.new-order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: flex-start;
}
@media (max-width: 1100px) { .new-order-layout { grid-template-columns: 1fr; } }

.new-order-card { width: 100%; max-width: none; border-radius: 24px; }
.new-order-card .card-body { padding: 28px 32px; }

.new-order-card .form-section {
  padding: 24px 26px;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 22px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.new-order-card .form-section:hover { border-color: #DBC6FF; box-shadow: 0 4px 14px rgba(123,47,242,0.06); }
.new-order-card .form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #5A1FBD;
  margin: 0 0 18px;
  padding: 6px 14px;
  background: #F0EBFF;
  border-radius: 999px;
  display: inline-block;
}

.new-order-card .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.new-order-card .form-row-address {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.new-order-card .form-row-spacer { /* keeps email column the same width as address */ }

.new-order-card .form-group { margin-bottom: 12px; }
.new-order-card .form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.2px;
}
.new-order-card .form-group label .optional-tag {
  color: #9CA3AF;
  font-weight: 400;
  font-size: 11px;
  margin-left: 4px;
}
.new-order-card .form-control {
  width: 100%;
  padding: 12px 18px;
  border: 1.5px solid #E5E7EB;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  color: #1F2937;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.new-order-card .form-control:focus {
  outline: none;
  border-color: #7B2FF2;
  box-shadow: 0 0 0 3px rgba(123,47,242,0.12);
}
.new-order-card .form-control:hover:not(:focus):not([readonly]) {
  border-color: #BE93FF;
}
.new-order-card .form-control[readonly] {
  background: #F9FAFB;
  color: #6B7280;
  cursor: not-allowed;
}
.new-order-card select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235A1FBD' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 38px;
}

.new-order-card .order-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 400px;
}
.new-order-card .order-type-btn {
  padding: 14px;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.15s;
}
.new-order-card .order-type-btn:hover {
  border-color: #BE93FF;
  color: #5A1FBD;
}
.new-order-card .order-type-btn.active {
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff;
  border-color: #7B2FF2;
  box-shadow: 0 4px 12px rgba(123,47,242,0.25);
}

/* Quick date / time pill buttons */
.quick-date-row,
.quick-time-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.new-order-card .quick-date-btn,
.new-order-card .quick-time-btn {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  color: #5A1FBD;
  cursor: pointer;
  transition: all 0.15s;
}
.new-order-card .quick-date-btn:hover,
.new-order-card .quick-time-btn:hover {
  background: #F0EBFF;
  border-color: #BE93FF;
  transform: translateY(-1px);
}
/* Selected state — bright green so the chosen pill is unmistakable */
.new-order-card .quick-date-btn.selected,
.new-order-card .quick-time-btn.selected {
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: #fff;
  border-color: #16A34A;
  box-shadow: 0 4px 14px rgba(34,197,94,0.4);
  transform: none;
  font-weight: 700;
}
.new-order-card .quick-date-btn.selected:hover,
.new-order-card .quick-time-btn.selected:hover {
  background: linear-gradient(135deg, #16A34A, #15803D);
  border-color: #15803D;
  color: #fff;
  transform: translateY(-1px);
}
.new-order-card .quick-date-btn.selected::before,
.new-order-card .quick-time-btn.selected::before {
  content: '\2713'; /* checkmark */
  margin-right: 6px;
  font-weight: 700;
}
/* ASAP gets a green tint as the "fast" choice */
.new-order-card .quick-time-asap {
  background: #38BD94;
  color: #fff;
  border-color: #38BD94;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.new-order-card .quick-time-asap:hover {
  background: #2A8E6F;
  border-color: #2A8E6F;
  color: #fff;
}
.new-order-card .quick-time-asap.selected {
  background: linear-gradient(135deg, #38BD94, #2A8E6F);
  border-color: #2A8E6F;
  box-shadow: 0 4px 12px rgba(56,189,148,0.4);
}

/* Sublabels (e.g. "Time" inside a section) */
.new-order-card .form-section-sublabel {
  display: block;
  font-size: 12px; font-weight: 600;
  color: #374151;
  margin: 14px 0 8px;
  letter-spacing: 0.2px;
}

/* Schedule summary chips at top of section */
.schedule-summary {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #DCFCE7, #F0FDF4);
  border: 1px solid #86EFAC;
  border-radius: 14px;
  animation: schedSummaryIn 0.3s ease;
}
.schedule-summary::before {
  content: '\2713 SELECTED:';
  font-size: 10px; font-weight: 800;
  color: #15803D; letter-spacing: 1.5px;
  margin-right: 4px;
}
@keyframes schedSummaryIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.sched-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: #fff;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  color: #15803D;
  box-shadow: 0 2px 6px rgba(34,197,94,0.2);
  border: 1px solid #BBF7D0;
}

/* Date input gets a green ring when a value is set (via :valid pseudo-class on required field) */
.new-order-card #orderDeliveryDate:valid {
  border-color: #22C55E;
  background: #F0FDF4;
  color: #15803D;
  font-weight: 600;
}

/* My Profile page */
.profile-page {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: flex-start;
}
@media (max-width: 980px) { .profile-page { grid-template-columns: 1fr; } }

.profile-identity-card { border-radius: 18px; }
.profile-avatar-wrap { position: relative; display: inline-block; }
.profile-avatar-large {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 46px;
  box-shadow: 0 12px 32px rgba(123,47,242,0.3);
  border: 4px solid #fff;
  margin: 0 auto;
}
.profile-avatar-upload {
  position: absolute; bottom: 0; right: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #5A1FBD;
  border: 2px solid #E5DBFF;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.15s;
}
.profile-avatar-upload:hover {
  background: #7B2FF2;
  color: #fff;
  border-color: #7B2FF2;
  transform: scale(1.1);
}
.profile-role-pill {
  display: inline-block;
  padding: 4px 14px; border-radius: 999px;
  background: linear-gradient(135deg, #F0EBFF, #fff);
  color: #5A1FBD;
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  border: 1px solid #DBC6FF;
}

.profile-cards-col { display: flex; flex-direction: column; gap: 18px; }

.pw-strength {
  height: 4px; width: 100%;
  background: #E5E7EB; border-radius: 999px;
  overflow: hidden; margin-top: 6px;
}
.pw-strength-fill {
  height: 100%; width: 0;
  transition: width 0.2s, background 0.2s;
}

/* ====================== ORDER SUMMARY PANEL (right of New Order) ====================== */
.order-summary-panel {
  position: sticky;
  top: 76px;
  background: linear-gradient(160deg, #ffffff 0%, #FAF7FF 100%);
  border: 1px solid #E5DBFF;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(123,47,242,0.10);
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.osp-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #F0EBFF;
}
.osp-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(123,47,242,0.3);
}
.osp-title { font-weight: 700; font-size: 15px; color: #1F2937; }
.osp-sub { font-size: 11px; color: #888; margin-top: 2px; }

.osp-section { margin-bottom: 16px; }
.osp-section-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: #888; font-weight: 700; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.osp-count {
  background: #F0EBFF; color: #5A1FBD;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.osp-empty { color: #B0AFC2; font-size: 13px; font-style: italic; }
.osp-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.osp-pill-purple { background: #F0EBFF; color: #5A1FBD; }
.osp-pill-amber  { background: #FEF3C7; color: #92400E; }
.osp-pill-green  { background: #DCFCE7; color: #15803D; }

.osp-cust { display: flex; align-items: center; gap: 12px; }
.osp-cust-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.osp-cust-body { flex: 1; min-width: 0; }
.osp-cust-name { font-weight: 700; font-size: 14px; color: #1F2937; }
.osp-cust-meta { font-size: 11px; color: #6B7280; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.osp-address {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 13px; color: #374151; margin-top: 8px;
  line-height: 1.4;
}
.osp-pin { color: #5A1FBD; flex-shrink: 0; }
.osp-parish {
  display: inline-block; margin-left: 6px;
  background: #F0EBFF; color: #5A1FBD;
  padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}

.osp-items { display: flex; flex-direction: column; gap: 6px; }
.osp-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #F0EBFF;
  border-radius: 10px;
}
.osp-item-qty { font-weight: 700; color: #5A1FBD; font-size: 13px; text-align: center; }
.osp-item-name { font-size: 12.5px; font-weight: 600; color: #1F2937; line-height: 1.3; }
.osp-item-var { font-size: 10px; color: #888; margin-top: 1px; }
.osp-item-price { font-size: 13px; font-weight: 700; color: #15803D; }

.osp-total-block {
  margin-top: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  border-radius: 14px;
  display: flex; justify-content: space-between; align-items: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(123,47,242,0.3);
}
.osp-total-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.9; font-weight: 600; }
.osp-total-value { font-size: 24px; font-weight: 800; }

.osp-help {
  margin-top: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #FBBF24;
  border-radius: 12px;
  font-size: 12px; color: #78350F; line-height: 1.4;
}
.osp-help strong { display: block; margin-bottom: 4px; color: #92400E; font-weight: 700; }
.osp-help p { margin: 0; }

/* ====================== MAP (New Order + Detail) ====================== */
.order-map-wrap {
  margin-top: 14px;
  border: 1px solid #E5DBFF;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.order-map-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, #F0EBFF, #fff);
  font-size: 12px; color: #5A1FBD;
}
.order-map-status {
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
  margin-right: 10px;
}
.order-map-action {
  font-size: 11px; font-weight: 700;
  color: #5A1FBD;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  white-space: nowrap;
}
.order-map-action:hover { text-decoration: underline; }
.order-map { height: 220px; width: 100%; }

/* Detail panel map */
.detail-map {
  height: 220px; width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #E5E7EB;
  margin-bottom: 10px;
}
.nav-link-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.nav-link {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px; font-weight: 700;
  text-decoration: none;
  color: #fff;
  transition: transform 0.15s, filter 0.15s;
  white-space: nowrap;
}
.nav-link:hover { transform: translateY(-2px); filter: brightness(1.05); color: #fff; }
.nav-link-google { background: #4285F4; }
.nav-link-waze   { background: #33CCFF; color: #1F2937 !important; }
.nav-link-apple  { background: #1F2937; }

/* ====================== ORDER LIFECYCLE TIMELINE ====================== */
.lifecycle-timeline {
  background: linear-gradient(135deg, #F0FDF4, #F9FAFB);
  border: 1px solid #BBF7D0;
  border-radius: 14px;
  padding: 16px;
}
.lc-row {
  display: flex; align-items: stretch; flex-wrap: wrap;
  gap: 0;
  justify-content: space-between;
}
.lc-step {
  flex: 1; min-width: 90px;
  background: #fff;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  border: 1px solid #BBF7D0;
  position: relative;
}
.lc-icon {
  font-size: 22px;
  background: linear-gradient(135deg, #DCFCE7, #BBF7D0);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px;
}
.lc-label {
  font-size: 11px; font-weight: 700;
  color: #15803D;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  line-height: 1.2;
}
.lc-date  { font-size: 12px; color: #1F2937; font-weight: 600; }
.lc-time  { font-size: 11px; color: #6B7280; }
.lc-arrow {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
  position: relative;
}
.lc-arrow span {
  font-size: 10px; font-weight: 700;
  color: #15803D;
  background: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #BBF7D0;
  white-space: nowrap;
}
.lc-arrow::before {
  content: '';
  position: absolute; top: 50%; left: 0; right: 0;
  height: 2px; background: #BBF7D0;
  z-index: -1;
}
.lc-total {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed #BBF7D0;
  display: flex; justify-content: space-between; align-items: center;
}
.lc-total-label { font-size: 11px; color: #15803D; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.lc-total-value { font-size: 16px; font-weight: 800; color: #15803D; }

/* ====================== TIP CLOTHESLINE (cards hanging from a string) ====================== */
.tip-marquee {
  position: relative;
  overflow: hidden;
  padding: 30px 0 22px;
  margin: 28px 0 8px;
  background: transparent;
  /* The clothesline string */
  --line-color: #B0AFC2;
  --line-thickness: 2px;
}
.tip-marquee::before {
  /* The horizontal string itself */
  content: '';
  position: absolute;
  top: 22px; left: 0; right: 0;
  height: var(--line-thickness);
  background:
    linear-gradient(90deg, transparent 0%, var(--line-color) 6%, var(--line-color) 94%, transparent 100%);
  border-radius: 999px;
  z-index: 1;
}
.tip-marquee::after {
  /* Edge fade so cards leave/enter softly */
  content: '';
  position: absolute; top: 0; bottom: 0; left: 0; right: 0;
  pointer-events: none; z-index: 4;
  background:
    linear-gradient(90deg, var(--bg-edge, #F9FAFB) 0%, transparent 6%, transparent 94%, var(--bg-edge, #F9FAFB) 100%);
}

/* Page-specific string colors (subtle) */
.tip-marquee-orders  { --line-color: #3B82F6; }
.tip-marquee-drivers { --line-color: #F97316; }
.tip-marquee-agents  { --line-color: #14B8A6; }

.tip-marquee-track {
  display: flex; gap: 28px;
  padding-top: 6px;
  align-items: flex-start;
  animation: tmScroll 50s linear infinite;
  width: max-content;
  position: relative;
  z-index: 2;
}
.tip-marquee:hover .tip-marquee-track { animation-play-state: paused; }
@keyframes tmScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* The tip card hanging from the string */
.tip-card {
  position: relative;
  flex: 0 0 250px;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px 14px 14px;
  display: flex; gap: 12px; align-items: flex-start;
  box-shadow: 0 6px 18px rgba(31,41,55,0.10);
  border: 1px solid #EEF0F4;
  margin-top: 24px; /* space for the wire + peg above */
  transform-origin: top center;
  animation: tcSway 4.5s ease-in-out infinite;
  cursor: default;
}
/* Stagger sway timings so cards don't move in sync */
.tip-marquee-track .tip-card:nth-child(2n)   { animation-duration: 5.2s; animation-delay: -0.4s; }
.tip-marquee-track .tip-card:nth-child(3n)   { animation-duration: 4.8s; animation-delay: -1.2s; }
.tip-marquee-track .tip-card:nth-child(4n+1) { animation-duration: 5.5s; animation-delay: -2.0s; }
.tip-marquee-track .tip-card:nth-child(5n+2) { animation-duration: 4.2s; animation-delay: -0.8s; }

@keyframes tcSway {
  0%, 100% { transform: rotate(-1.5deg); }
  50%      { transform: rotate(1.5deg); }
}

/* The thin wire from the card up to the string */
.tip-card::before {
  content: '';
  position: absolute;
  left: 50%; transform: translateX(-50%);
  top: -22px;
  width: 1.5px; height: 22px;
  background: #B0AFC2;
}
/* The peg/clip at the top of the wire on the string */
.tip-card::after {
  content: '';
  position: absolute;
  left: 50%; transform: translateX(-50%);
  top: -28px;
  width: 12px; height: 8px;
  background: linear-gradient(180deg, #6B7280 0%, #4B5563 100%);
  border-radius: 3px 3px 1px 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.tip-card-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.tip-card-icon.tc-purple { background: linear-gradient(135deg,#F0EBFF,#DBC6FF); color: #5A1FBD; }
.tip-card-icon.tc-green  { background: linear-gradient(135deg,#DCFCE7,#86EFAC); color: #15803D; }
.tip-card-icon.tc-amber  { background: linear-gradient(135deg,#FEF3C7,#FDE68A); color: #92400E; }
.tip-card-icon.tc-pink   { background: linear-gradient(135deg,#FCE7F3,#F9A8D4); color: #9D174D; }
.tip-card-icon.tc-blue   { background: linear-gradient(135deg,#DBEAFE,#93C5FD); color: #1E40AF; }
.tip-card-body { flex: 1; min-width: 0; }
.tip-card-title { font-weight: 700; font-size: 13px; color: #1F2937; line-height: 1.2; }
.tip-card-text  { font-size: 11.5px; color: #6B7280; line-height: 1.4; margin-top: 4px; }

/* ====================== HELP & GUIDE PAGE ====================== */
.help-hero {
  background: linear-gradient(135deg, #2D0A5E 0%, #4A1494 50%, #7B2FF2 100%);
  background-size: 200% 200%;
  animation: bgShift 18s ease infinite;
  color: #fff;
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.help-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.15), transparent 60%);
}
.help-hero-icon { font-size: 36px; margin-bottom: 8px; }
.help-hero h2 { color: #fff !important; font-size: 28px; margin: 0 0 6px; letter-spacing: -0.5px; }
.help-hero p  { color: rgba(255,255,255,0.85); margin: 0 0 18px; font-size: 14px; }
.help-search-wrap {
  position: relative;
  max-width: 480px; margin: 0 auto;
}
.help-search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: #9CA3AF; font-size: 16px; pointer-events: none;
}
#helpSearch {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border: none;
  border-radius: 999px;
  font-family: inherit; font-size: 14px;
  background: rgba(255,255,255,0.95);
  color: #1F2937;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
#helpSearch:focus { outline: none; box-shadow: 0 0 0 4px rgba(255,255,255,0.4); }

.help-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: flex-start;
}
@media (max-width: 980px) { .help-layout { grid-template-columns: 1fr; } }

.help-sidebar {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 14px 10px;
  position: sticky; top: 76px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.help-nav-group { margin-bottom: 10px; }
.help-nav-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: #9CA3AF; font-weight: 700;
  padding: 8px 12px 6px;
}
.help-nav-link {
  display: block; width: 100%;
  background: transparent; border: none;
  padding: 8px 12px;
  text-align: left;
  font-family: inherit; font-size: 13px;
  color: #374151;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
}
.help-nav-link:hover { background: #F0EBFF; color: #5A1FBD; }
.help-nav-link.active {
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff;
  font-weight: 600;
}

.help-content {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 28px 32px;
  min-height: 60vh;
}
.help-topic-head {
  display: flex; align-items: flex-start; gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid #F3F4F6;
}
.help-topic-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #F0EBFF, #DBC6FF);
  color: #5A1FBD;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.help-topic-head h2 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.5px; }
.help-topic-intro { font-size: 14px; color: #6B7280; line-height: 1.5; margin: 0; }

.help-h {
  font-size: 13px;
  font-weight: 700;
  color: #5A1FBD;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 22px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.help-h::before {
  content: '';
  width: 4px; height: 14px;
  background: linear-gradient(180deg, #7B2FF2, #5A1FBD);
  border-radius: 2px;
}

.help-list, .help-steps { padding-left: 22px; margin: 0 0 12px; line-height: 1.7; font-size: 14px; color: #374151; }
.help-list li { margin-bottom: 4px; }
.help-steps { counter-reset: step; padding-left: 0; list-style: none; }
.help-steps li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 8px 36px;
  margin-bottom: 4px;
}
.help-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 24px; height: 24px;
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 12px;
  font-size: 13px;
}
.help-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #F3F4F6;
  color: #374151;
}
.help-table td:first-child { white-space: nowrap; color: #5A1FBD; font-weight: 600; }

.help-callout {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px; line-height: 1.5;
  margin: 14px 0;
}
.help-callout strong { color: inherit; font-weight: 700; }
.help-callout-tip {
  background: linear-gradient(135deg, #DCFCE7, #F0FDF4);
  border: 1px solid #BBF7D0;
  color: #15803D;
}
.help-callout-warn {
  background: linear-gradient(135deg, #FEF3C7, #FFFBEB);
  border: 1px solid #FBBF24;
  color: #78350F;
}

.help-content kbd {
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #1F2937;
  margin: 0 2px;
}
.help-content code {
  background: #F0EBFF;
  color: #5A1FBD;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}
.help-content a { color: #5A1FBD; text-decoration: none; font-weight: 600; }
.help-content a:hover { text-decoration: underline; }

/* ====================== REPORTS PAGE ====================== */
.report-period {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid #E5E7EB;
  margin-bottom: 16px;
}
.report-period-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  color: #5A1FBD;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.report-period-btn:hover { background: #F0EBFF; border-color: #BE93FF; }
.report-period-btn.active {
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff;
  border-color: #7B2FF2;
  box-shadow: 0 4px 10px rgba(123,47,242,0.3);
}
.filter-label { font-size: 12px; color: #6B7280; font-weight: 600; }

.report-tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: #F3F4F6;
  border-radius: 14px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.report-tab {
  flex: 1; min-width: 120px;
  padding: 10px 14px;
  border-radius: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  white-space: nowrap;
  transition: all 0.15s;
}
.report-tab:hover { color: #5A1FBD; background: rgba(123,47,242,0.06); }
.report-tab.active {
  background: #fff;
  color: #5A1FBD;
  box-shadow: 0 2px 6px rgba(31,41,55,0.08);
}

.report-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 880px) { .report-grid-2 { grid-template-columns: 1fr; } }

/* Lifecycle metrics segments */
.lifecycle-segments {
  display: flex; flex-direction: column; gap: 8px;
}
.lc-seg {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
}
.lc-seg-label { font-size: 13px; color: #374151; font-weight: 600; }
.lc-seg-value { font-size: 16px; font-weight: 800; color: #5A1FBD; }
.lc-seg-total {
  background: linear-gradient(135deg, #F0EBFF, #fff);
  border-color: #BE93FF;
  margin-top: 6px;
}
.lc-seg-total .lc-seg-value { color: #15803D; font-size: 18px; }

/* On-time delivery display */
.ontime-display { padding: 14px 0; }
.ontime-pct { font-size: 56px; font-weight: 800; line-height: 1; font-family: var(--font-heading); margin-bottom: 8px; }
.ontime-label { font-size: 12px; color: #6B7280; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.ontime-stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.ontime-stat {
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.ontime-stat.ot-good { background: #DCFCE7; color: #15803D; }
.ontime-stat.ot-bad { background: #FEE2E2; color: #B91C1C; }
.ontime-stat.ot-total { background: #F3F4F6; color: #6B7280; }

/* Customer lookup autocomplete (Name / Phone fields) */
.customer-lookup-row { position: relative; }
.customer-lookup-results {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(123,47,242,0.15);
  max-height: 360px;
  overflow-y: auto;
  z-index: 50;
  padding: 6px;
}
.cl-header {
  padding: 8px 12px 4px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: #888; font-weight: 700;
}
.cl-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s;
}
.cl-item:hover { background: #F0EBFF; }
.cl-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.cl-body { flex: 1; min-width: 0; }
.cl-name { font-weight: 600; font-size: 13.5px; color: #1F2937; }
.cl-meta { font-size: 11px; color: #888; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-stats { text-align: right; flex-shrink: 0; }
.cl-orders { font-size: 11px; color: #888; }
.cl-ltv { font-size: 13px; font-weight: 700; color: #15803D; margin-top: 2px; }

/* Returning-customer banner (after a customer is applied) */
.returning-customer-banner {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #FBBF24;
  border-radius: 12px;
  animation: schedSummaryIn 0.3s ease;
}
.rc-badge {
  font-size: 10px; font-weight: 800;
  color: #92400E; letter-spacing: 1.5px;
  background: #fff; padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 2px 4px rgba(146,64,14,0.15);
  flex-shrink: 0;
}
.rc-info { flex: 1; font-size: 12.5px; color: #78350F; }
.rc-clear {
  background: rgba(146,64,14,0.15); border: none;
  width: 22px; height: 22px; border-radius: 50%;
  color: #92400E; cursor: pointer; font-size: 14px; line-height: 1;
}
.rc-clear:hover { background: #92400E; color: #fff; }

/* Agent chip (top-right of New Order page header) */
.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(123,47,242,0.06);
}
.agent-chip-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.agent-chip-text { display: flex; flex-direction: column; line-height: 1.1; }
.agent-chip-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1.5px; color: #9CA3AF; font-weight: 600; }
.agent-chip-name { font-size: 13px; font-weight: 600; color: #1F2937; }

/* Compact product search input (Order Items section) */
.product-search-wrap {
  position: relative;
  max-width: 460px;
  margin-bottom: 14px;
}
.product-search-icon {
  position: absolute;
  left: 16px; top: 19px;
  color: #9CA3AF;
  font-size: 14px;
  pointer-events: none;
  z-index: 2;
}
.product-search-input {
  width: 100%;
  padding: 11px 38px 11px 40px;
  border: 1.5px solid #E5E7EB;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  color: #1F2937;
  background: #F9FAFB;
  transition: all 0.15s;
}
.product-search-input:focus {
  outline: none;
  border-color: #7B2FF2;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(123,47,242,0.12);
}
.product-search-clear {
  position: absolute;
  right: 12px; top: 12px;
  width: 24px; height: 24px;
  border: none; background: #E5E7EB;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  color: #6B7280;
  transition: all 0.15s;
  z-index: 2;
}
.product-search-clear:hover { background: #7B2FF2; color: #fff; }

/* Autocomplete results list */
.product-search-results {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(123,47,242,0.15);
  max-height: 380px;
  overflow-y: auto;
  z-index: 10;
  padding: 6px;
}
.psr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}
.psr-item:hover { background: #F0EBFF; transform: translateX(2px); }
.psr-img {
  width: 44px; height: 44px;
  background: #F3F4F6 center/cover no-repeat;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.psr-img-placeholder { opacity: 0.45; }
.psr-body { flex: 1; min-width: 0; }
.psr-name {
  font-weight: 600; font-size: 13.5px; color: #1F2937;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.psr-tag {
  font-size: 9px; font-weight: 700;
  background: #F0EBFF; color: #5A1FBD;
  padding: 2px 7px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.psr-meta { font-size: 11px; color: #888; margin-top: 2px; }
.psr-price { font-weight: 800; color: #5A1FBD; font-size: 15px; flex-shrink: 0; }
.psr-empty { padding: 18px; text-align: center; color: #888; font-size: 13px; }

@media (max-width: 720px) {
  .new-order-card .card-body { padding: 18px; }
  .new-order-card .form-section { padding: 18px; border-radius: 18px; }
  .new-order-card .form-row-2,
  .new-order-card .form-row-address { grid-template-columns: 1fr; }
  .new-order-card .form-row-spacer { display: none; }
  .agent-chip-text { display: none; }
  .agent-chip { padding: 6px; }
  .product-search-wrap { max-width: 100%; }
}

/* ====================== COMMAND PALETTE ====================== */
.cmd-palette-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  z-index: 900;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.cmd-palette-overlay.open { display: flex; animation: cmdFadeIn 0.15s ease; }
@keyframes cmdFadeIn { from { opacity: 0; } to { opacity: 1; } }
.cmd-palette {
  width: 600px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: cmdSlideIn 0.2s ease;
}
@keyframes cmdSlideIn {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.cmd-palette-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #E5E7EB;
}
.cmd-palette-icon { font-size: 18px; color: #888; }
.cmd-palette-input {
  flex: 1; border: none; outline: none;
  font-size: 16px; color: #2d2d2d;
  font-family: inherit;
}
.cmd-palette-kbd {
  background: #F3F4F6; color: #888;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-family: monospace;
}
.cmd-palette-results {
  max-height: 400px; overflow-y: auto;
  padding: 6px 0;
}
.cmd-result {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.cmd-result.active { background: #F9FAFB; border-left-color: #7B2FF2; }
.cmd-result-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #F3F4F6; color: #5A1FBD;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.cmd-result-body { flex: 1; min-width: 0; }
.cmd-result-title { font-weight: 600; font-size: 14px; color: #2d2d2d; }
.cmd-result-sub   { font-size: 12px; color: #888; margin-top: 2px; }
.cmd-result-kbd   { font-size: 11px; color: #aaa; font-family: monospace; }
.cmd-result-section {
  font-size: 11px; text-transform: uppercase;
  color: #888; letter-spacing: 1px; padding: 8px 16px 4px;
  font-weight: 600;
}
.cmd-palette-footer {
  padding: 10px 16px;
  background: #fafafa;
  border-top: 1px solid #E5E7EB;
  display: flex; gap: 16px;
  font-size: 11px; color: #888;
}
.cmd-palette-footer kbd, .shortcuts-table kbd {
  background: #fff; border: 1px solid #ddd;
  padding: 1px 6px; border-radius: 3px;
  font-family: monospace; font-size: 11px; color: #555;
  margin: 0 2px;
  box-shadow: 0 1px 0 #ccc;
}
.shortcuts-table { width: 100%; border-collapse: collapse; }
.shortcuts-table td { padding: 8px 0; font-size: 13px; }
.shortcuts-table td:first-child { white-space: nowrap; padding-right: 16px; }

/* ====================== DARK MODE ====================== */
body.dark-mode {
  background: #1a1a1a;
  color: #e0e0e0;
}
body.dark-mode .topbar { background: #252525; border-bottom: 1px solid #333; }
body.dark-mode .sidebar { background: #1f1f1f; border-right: 1px solid #333; }
body.dark-mode .sidebar-nav button { color: #ccc; }
body.dark-mode .sidebar-nav button:hover,
body.dark-mode .sidebar-nav button.active { background: #2d2d2d; color: #fff; }
body.dark-mode .card,
body.dark-mode .modal,
body.dark-mode .stat-card,
body.dark-mode .product-card,
body.dark-mode .sms-overview-card,
body.dark-mode .dash-graph-grid .card { background: #252525 !important; border-color: #333 !important; color: #e0e0e0 !important; }
body.dark-mode .form-control,
body.dark-mode select.form-control,
body.dark-mode input.form-control,
body.dark-mode textarea.form-control { background: #1f1f1f !important; border-color: #333 !important; color: #e0e0e0 !important; }
body.dark-mode .data-table th { background: #1f1f1f; color: #ccc; border-color: #333; }
body.dark-mode .data-table td { border-color: #2d2d2d; color: #ddd; }
body.dark-mode .data-table tr:hover td { background: #2a2a2a; }
body.dark-mode .filters-bar { background: #252525; border-color: #333; }
body.dark-mode .recent-feed-item { border-color: #333; }
body.dark-mode .recent-feed-item:hover { background: #2a2a2a; }
body.dark-mode .recent-feed-name { color: #fff; }
body.dark-mode .notif-panel { background: #252525; border-color: #333; }
body.dark-mode .notif-item { border-color: #333; }
body.dark-mode .notif-item:hover { background: #2a2a2a; }
body.dark-mode .notif-item.unread { background: #2d1f25; }
body.dark-mode .notif-item-title { color: #fff; }
body.dark-mode .cmd-palette { background: #252525; }
body.dark-mode .cmd-palette-input { background: transparent; color: #fff; }
body.dark-mode .cmd-palette-input-wrap { border-color: #333; }
body.dark-mode .cmd-result.active { background: #2a2a2a; }
body.dark-mode .cmd-result-title { color: #fff; }
body.dark-mode .cmd-result-icon { background: #2d2d2d; }
body.dark-mode .cmd-palette-footer { background: #1f1f1f; border-color: #333; color: #888; }
body.dark-mode .topbar-logout { color: #ccc; }
body.dark-mode .bulk-bar { background: linear-gradient(135deg, #2d1f25, #252525); border-color: #4a3340; }
body.dark-mode .product-card-name { color: #fff; }
body.dark-mode .product-card-img { background-color: #1f1f1f; }
body.dark-mode .badge { filter: brightness(0.85); }
body.dark-mode .modal-overlay { background: rgba(0,0,0,0.7); }
body.dark-mode .stat-info .stat-label { color: #aaa; }
body.dark-mode .stat-info .stat-value { color: #fff; }

/* ====================== BULK ACTION BAR ====================== */
.bulk-bar {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #F0EBFF, #F9FAFB);
  border: 1px solid #E5DBFF;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(123,47,242,0.12);
  flex-wrap: wrap;
  animation: bulkBarSlide 0.25s ease;
}
@keyframes bulkBarSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.bulk-count { color: #5A1FBD; font-size: 14px; }
.bulk-count strong { font-size: 18px; font-family: 'Plus Jakarta Sans', sans-serif; margin-right: 4px; }

/* ====================== PRODUCTS GRID (admin) ====================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.product-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(123,47,242,0.06);
  border: 1px solid #E5E7EB;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex; flex-direction: column;
  position: relative;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(123,47,242,0.18);
  border-color: #BE93FF;
}
.product-card:hover .product-card-add-overlay { opacity: 1; }
.product-card.out-of-stock { opacity: 0.5; cursor: not-allowed; }
.product-card.out-of-stock:hover { transform: none; box-shadow: 0 2px 8px rgba(123,47,242,0.06); border-color: #E5E7EB; }
.product-card.out-of-stock .product-card-add-overlay { display: none; }
.product-card-img {
  width: 100%; aspect-ratio: 1 / 1;
  background: #F3F4F6 center/cover no-repeat;
  position: relative;
}
.product-card-img.no-image::after {
  content: '🌹'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; opacity: 0.3;
}
.product-card-stock-badge {
  position: absolute; top: 6px; left: 6px;
  background: rgba(255,255,255,0.95);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}
.product-card-stock-badge.in { color: #2A8E6F; }
.product-card-stock-badge.out { color: #b03030; }
.product-card-edit-btn {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: #5A1FBD;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: background 0.15s, color 0.15s, transform 0.15s;
  z-index: 3;
}
.product-card-edit-btn:hover { background: #7B2FF2; color: #fff; transform: scale(1.1); }
.product-card-add-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, transparent, rgba(123,47,242,0.95));
  color: #fff;
  padding: 30px 8px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.product-card-body { padding: 8px 10px 10px; flex: 1; display: flex; flex-direction: column; }
.product-card-name {
  font-weight: 600; font-size: 12px; line-height: 1.3;
  color: #1F2937; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}
.product-card-cat {
  font-size: 9px; text-transform: uppercase;
  color: #888; letter-spacing: 0.5px; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-card-price { font-weight: 800; color: #5A1FBD; font-size: 14px; margin-top: auto; }
.products-empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: #888;
}
.products-empty-icon { font-size: 48px; opacity: 0.4; margin-bottom: 10px; }

/* ====================== MODERN TRACKING PAGE (v2) ====================== */
body.tracking-v2 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #F9FAFB 0%, #F0EBFF 100%);
  color: #2d2d2d;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.tv2-topbar {
  background: #fff;
  padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 2px 12px rgba(123,47,242,0.08);
  position: sticky; top: 0; z-index: 100;
}
.tv2-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.tv2-logo-icon { font-size: 26px; }
.tv2-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.tv2-logo-name { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 17px; color: #5A1FBD; }
.tv2-logo-sub { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #888; }
.tv2-topbar-actions { display: flex; gap: 8px; }
.tv2-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #F3F4F6;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: #5A1FBD;
  font-size: 16px;
  transition: transform 0.15s, background 0.15s;
}
.tv2-icon-btn:hover { transform: scale(1.08); background: #E5DBFF; }
.tv2-wa { background: #d4f5dc; color: #2d6a3d; }
.tv2-wa:hover { background: #a0e0b3; }

.tv2-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* Search card */
.tv2-search { display: flex; justify-content: center; padding: 40px 0; }
.tv2-search-card {
  background: #fff;
  border-radius: 24px;
  padding: 48px 32px;
  text-align: center;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 48px rgba(123,47,242,0.15);
}
.tv2-search-illust { font-size: 56px; margin-bottom: 12px; }
.tv2-search-card h1 {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 500;
  color: #5A1FBD; font-size: 28px; margin: 0 0 8px;
}
.tv2-search-card p { color: #666; font-size: 14px; margin: 0 0 24px; }
.tv2-search-form {
  display: flex; gap: 0;
  background: #f9f3f5; border-radius: 12px;
  overflow: hidden;
  border: 2px solid #E5DBFF;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tv2-search-form:focus-within { border-color: #7B2FF2; box-shadow: 0 0 0 4px rgba(123,47,242,0.12); }
.tv2-search-form input {
  flex: 1; border: none; background: transparent;
  padding: 14px 16px; font-size: 15px; outline: none;
  font-family: 'Courier New', monospace; letter-spacing: 0.5px;
}
.tv2-search-form button {
  border: none; background: linear-gradient(135deg, #7B2FF2, #5A1FBD);
  color: #fff; padding: 14px 22px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: filter 0.15s;
}
.tv2-search-form button:hover { filter: brightness(1.05); }
.tv2-help { font-size: 12px; color: #888; margin-top: 14px; }

/* States */
.tv2-state {
  text-align: center; padding: 60px 20px;
  background: #fff; border-radius: 20px; margin: 20px 0;
  box-shadow: 0 6px 24px rgba(123,47,242,0.08);
}
.tv2-state-icon { font-size: 48px; margin-bottom: 12px; }
.tv2-state h3 { color: #5A1FBD; font-family: 'Plus Jakarta Sans', sans-serif; margin: 0 0 8px; }
.tv2-state p { color: #666; margin: 0 0 18px; }
.tv2-spinner {
  width: 40px; height: 40px;
  border: 3px solid #E5DBFF;
  border-top-color: #7B2FF2;
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: tv2spin 0.8s linear infinite;
}
@keyframes tv2spin { to { transform: rotate(360deg); } }

/* Hero */
.tv2-hero {
  position: relative; overflow: hidden;
  border-radius: 24px;
  padding: 36px 28px 32px;
  margin-bottom: 18px;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, #7B2FF2 0%, #5A1FBD 100%);
  box-shadow: 0 12px 32px rgba(123,47,242,0.25);
}
.tv2-hero.hero-out_for_delivery {
  background: linear-gradient(135deg, #f5a623 0%, #d4851a 100%);
  box-shadow: 0 12px 32px rgba(245,166,35,0.3);
}
.tv2-hero.hero-delivered, .tv2-hero.hero-completed {
  background: linear-gradient(135deg, #4eaf6d 0%, #2d6a3d 100%);
  box-shadow: 0 12px 32px rgba(78,175,109,0.3);
}
.tv2-hero.hero-cancelled {
  background: linear-gradient(135deg, #c0392b 0%, #8e2820 100%);
}
.tv2-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.12), transparent 50%);
  pointer-events: none;
}
.tv2-hero-content { position: relative; z-index: 1; }
.tv2-hero-icon {
  width: 72px; height: 72px;
  background: rgba(255,255,255,0.22);
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  animation: heroPop 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes heroPop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.tv2-hero-status {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.tv2-hero h2 {
  margin: 0 0 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: 0.5px;
}
.tv2-hero-sub { margin: 0 0 20px; font-size: 14px; opacity: 0.95; }
.tv2-hero-eta {
  background: rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 14px 18px;
  display: inline-flex; flex-direction: column;
  margin-bottom: 18px;
  min-width: 200px;
}
.tv2-eta-label { font-size: 11px; opacity: 0.85; text-transform: uppercase; letter-spacing: 1px; }
.tv2-eta-value { font-size: 18px; font-weight: 700; margin-top: 4px; }
.tv2-hero-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tv2-chip {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  transition: background 0.15s;
}
.tv2-chip:hover { background: rgba(255,255,255,0.35); }
.tv2-order-id {
  font-size: 12px;
  opacity: 0.9;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 14px;
}
.tv2-order-id-mono { font-family: 'Courier New', monospace; font-weight: 700; letter-spacing: 1px; }

/* Cards */
.tv2-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px 22px;
  margin-bottom: 14px;
  box-shadow: 0 4px 18px rgba(123,47,242,0.08);
}
.tv2-card-title {
  margin: 0 0 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  color: #5A1FBD;
  font-weight: 500;
}

/* Modern timeline */
.tv2-timeline { display: flex; flex-direction: column; gap: 0; }
.tv2-timeline .timeline-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 6px 0;
  position: relative;
}
.tv2-timeline .timeline-step::after {
  content: '';
  position: absolute;
  left: 17px; top: 36px; bottom: -6px;
  width: 2px;
  background: #E5DBFF;
}
.tv2-timeline .timeline-step:last-child::after { display: none; }
.tv2-timeline .timeline-step.completed::after { background: #4eaf6d; }
.tv2-timeline .timeline-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #F3F4F6;
  border: 2px solid #E5DBFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #5A1FBD;
  position: relative; z-index: 1;
  transition: all 0.3s;
}
.tv2-timeline .timeline-step.completed .timeline-dot {
  background: #4eaf6d; border-color: #4eaf6d; color: #fff;
}
.tv2-timeline .timeline-step.active .timeline-dot {
  background: #fff; border-color: #7B2FF2; color: #5A1FBD;
  box-shadow: 0 0 0 6px rgba(123,47,242,0.2);
  animation: dotPulse 2s infinite;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(123,47,242,0.2); }
  50% { box-shadow: 0 0 0 12px rgba(123,47,242,0.05); }
}
.tv2-timeline .timeline-step-label { font-weight: 600; color: #2d2d2d; font-size: 14px; padding: 8px 0 2px; }
.tv2-timeline .timeline-step-desc  { font-size: 12px; color: #888; padding-bottom: 14px; }
.tv2-timeline .timeline-step.completed .timeline-step-label { color: #2d6a3d; }
.tv2-timeline .timeline-step.active .timeline-step-label { color: #5A1FBD; }

/* Driver card */
.tv2-driver-row { display: flex; align-items: center; gap: 14px; }
.tv2-driver-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5a623, #d4851a);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.tv2-driver-info { flex: 1; min-width: 0; }
.tv2-driver-name { font-weight: 600; font-size: 16px; }
.tv2-driver-meta { font-size: 12px; color: #888; margin-top: 2px; }

/* Photo */
.tv2-photo-wrap { border-radius: 14px; overflow: hidden; background: #F3F4F6; }
.tv2-photo-wrap img { width: 100%; display: block; }
.tv2-photo-meta { font-size: 12px; color: #888; margin: 10px 0 0; text-align: center; }

/* Detail rows */
.tv2-detail-grid { display: flex; flex-direction: column; gap: 0; }
.tv2-detail-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #F3F4F6;
  gap: 16px;
}
.tv2-detail-row:last-of-type { border-bottom: none; }
.tv2-detail-label { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0; }
.tv2-detail-value { font-size: 14px; color: #2d2d2d; font-weight: 500; text-align: right; }

.tv2-items { margin-top: 18px; }
.tv2-items h4 { font-size: 13px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 10px; font-weight: 600; }
.tv2-items-list { list-style: none; padding: 0; margin: 0; }
.tv2-items-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 14px;
}
.tv2-items-list li:last-child { border-bottom: none; }
.tv2-items-list li > span:last-child { color: #2d6a3d; font-weight: 600; }

.tv2-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0 4px;
  margin-top: 12px;
  border-top: 2px solid #7B2FF2;
  font-size: 16px; font-weight: 700;
}
.tv2-total-amount { color: #5A1FBD; font-size: 22px; font-family: 'Plus Jakarta Sans', sans-serif; }

/* Buttons */
.tv2-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer;
  padding: 12px 22px;
  font-size: 14px; font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
}
.tv2-btn-primary { background: linear-gradient(135deg, #7B2FF2, #5A1FBD); color: #fff; }
.tv2-btn-primary:hover { filter: brightness(1.05); }
.tv2-btn-success { background: #4eaf6d; color: #fff; }
.tv2-btn-success:hover { background: #3d9a5c; }
.tv2-btn-outline { background: transparent; border: 2px solid #E5DBFF; color: #5A1FBD; }
.tv2-btn-outline:hover { background: #F9FAFB; border-color: #7B2FF2; }
.tv2-btn-block { display: flex; width: 100%; margin-top: 10px; }
.tv2-btn-pill { border-radius: 999px; padding: 10px 18px; font-size: 13px; }

.tv2-refresh-note {
  text-align: center;
  font-size: 12px;
  color: #888;
  margin: 18px 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tv2-pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4eaf6d;
  display: inline-block;
  animation: pulseDot 1.6s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(78,175,109,0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 8px rgba(78,175,109,0); }
}

/* Footer */
.tv2-footer {
  background: #2d2d2d; color: #ccc;
  padding: 32px 20px 20px;
  margin-top: 40px;
  text-align: center;
}
.tv2-footer-grid {
  max-width: 720px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: 24px; text-align: left; padding-bottom: 20px;
  border-bottom: 1px solid #444;
}
.tv2-footer h4 { color: #7B2FF2; font-size: 14px; margin: 0 0 8px; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 500; }
.tv2-footer p, .tv2-footer a { font-size: 13px; line-height: 1.6; color: #aaa; text-decoration: none; display: block; }
.tv2-footer a:hover { color: #fff; }
.tv2-footer-copy { font-size: 11px; color: #666; margin: 16px 0 0; }

@media (max-width: 600px) {
  .tv2-hero { padding: 30px 20px 24px; border-radius: 18px; }
  .tv2-hero h2 { font-size: 24px; }
  .tv2-hero-icon { width: 60px; height: 60px; font-size: 30px; }
  .tv2-card { padding: 18px 16px; border-radius: 14px; }
  .tv2-search-card { padding: 36px 22px; }
}

