/* ---------------------------------------------------
   GLOBAL BASE
--------------------------------------------------- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");


:root {
  --bg-body: #f3f4f6;
  --bg-sidebar: #020617;
  --bg-sidebar-soft: #0b1120;
  --bg-card: #ffffff;
  --bg-topbar: #ffffff;

  --border-subtle: #e5e7eb;
  --border-strong: #cbd5f5;

  --text-main: #111827;
  --text-muted: #6b7280;
  --text-on-dark: #e5e7eb;

  --accent-blue: #2563eb;
  --accent-blue-soft: #dbeafe;
  --accent-teal: #06b6d4;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;

  --radius-card: 14px;
  --radius-pill: 999px;
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 18px 45px rgba(15, 23, 42, 0.15);
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  background: var(--bg-body);
}

/* ---------------------------------------------------
   LAYOUT: SIDEBAR + MAIN
--------------------------------------------------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  padding: 12px 10px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  margin-bottom: 12px;
}

.sidebar-logo h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sidebar-logo p {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 4px;
}

/* Sidebar nav */
.sidebar-nav {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  color: #e5e7eb;
  font-size: 0.9rem;
  text-decoration: none;
  opacity: 0.85;
  transition: background 0.18s, opacity 0.18s, transform 0.06s;
}

.nav-item:hover {
  background: rgba(15, 23, 42, 0.9);
  opacity: 1;
  transform: translateX(1px);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
  color: #f9fafb;
  opacity: 1;
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.logout-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  color: #e5e7eb;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.logout-link:hover {
  background: rgba(15, 23, 42, 0.75);
}

/* Main column */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.topbar-left h1 {
  margin: 0;
  font-size: 1.4rem;
}

.topbar-left p {
  margin: 3px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.portal-notification-wrap {
  position: relative;
}

.portal-notification-button {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-notification-button:hover {
  background: #f8fafc;
}

.portal-notification-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-notification-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.portal-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.26);
}

.portal-notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, calc(100vw - 28px));
  max-height: min(70vh, 560px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-strong);
  z-index: 140;
}

.portal-notification-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.portal-notification-panel-head strong {
  display: block;
  font-size: 0.95rem;
}

.portal-notification-panel-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.portal-notification-action {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.portal-notification-action[disabled] {
  color: var(--text-muted);
  cursor: not-allowed;
}

.portal-notification-list {
  overflow-y: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.portal-notification-item {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: #ffffff;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
}

.portal-notification-item.unread {
  border-color: rgba(37, 99, 235, 0.22);
  background: #f8fbff;
}

.portal-notification-item-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.portal-notification-item strong {
  font-size: 0.88rem;
}

.portal-notification-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.portal-notification-time {
  color: var(--text-muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.portal-notification-empty {
  padding: 24px 12px;
  color: var(--text-muted);
  text-align: center;
}

.portal-toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5000;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
}

.portal-toast {
  position: relative;
  padding: 14px 16px 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.portal-toast-high,
.portal-toast-urgent {
  border-color: rgba(239, 68, 68, 0.2);
}

.portal-toast strong {
  display: block;
  font-size: 0.88rem;
}

.portal-toast p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.portal-toast-actions {
  margin-top: 10px;
}

.portal-toast-open {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.portal-toast-dismiss {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.portal-toast.closing {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.notification-highlight {
  animation: notification-highlight 2.2s ease;
}

@keyframes notification-highlight {
  0% {
    background: rgba(37, 99, 235, 0.14);
  }
  100% {
    background: transparent;
  }
}

.admin-mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #ffffff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 4px;
  flex-direction: column;
}

.admin-mobile-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #0f172a;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, 0.46);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 90;
}

.admin-badge {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  background: var(--accent-blue-soft);
  color: #1d4ed8;
}

.date-badge {
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  background: #f9fafb;
}

/* Content wrapper */
.content {
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------------------------------------------------
   CARDS & GRID
--------------------------------------------------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card-header {
  padding: 14px 18px 8px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.card-header h2 {
  margin: 0;
  font-size: 1rem;
}

.card-header p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-body {
  padding: 14px 18px 16px;
}

.banner-card {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.banner-card .card-body {
  color: #1e3a8a;
  font-size: 0.92rem;
}

/* Filters card */
.card-filters .card-body {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.card-filters .card-body input,
.card-filters .card-body select {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 9px 12px;
  font-size: 0.85rem;
  min-width: 180px;
  background: #ffffff;
}

/* Chips (time range) */
.chip {
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.85rem;
  background: #f3f4f6;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.06s;
}

.chip:hover {
  transform: translateY(-1px);
}

.chip.active {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
  color: #ffffff;
  border-color: transparent;
}

/* Stats metric cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.stats-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  padding: 14px 16px 16px;
}

.metric-card h3 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.metric-value {
  margin-top: 8px;
  font-size: 1.8rem;
  font-weight: 700;
}

.metric-value.pending {
  color: var(--accent-amber);
}

.metric-value.out {
  color: var(--accent-blue);
}

.metric-value.delivered {
  color: var(--accent-green);
}

.metric-sub {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Two-column layout */
.grid-2 {
  display: grid;
  grid-template-columns: 2.1fr 1.4fr;
  gap: 16px;
}

/* Quick actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Ops notes lists */
.ops-notes h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.ops-notes ul {
  list-style: disc;
  margin: 0 0 0 18px;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------
   BUTTONS / BADGES
--------------------------------------------------- */
.btn-primary,
.btn-secondary,
.btn-table {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.12s, background 0.12s;
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.35);
}

.btn-primary[disabled],
.btn-secondary[disabled],
.btn-table[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

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

/* Table buttons */
.btn-table {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #e5e7eb;
  color: #111827;
}

.btn-table.warning {
  background: #fef3c7;
  color: #92400e;
}

.btn-table.danger {
  background: #fee2e2;
  color: #b91c1c;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}
.status-assigned {
  background: #e0f2fe;
  color: #075985;
}
.status-out-for-delivery {
  background: #dbeafe;
  color: #1d4ed8;
}
.status-delivered {
  background: #dcfce7;
  color: #166534;
}
.status-cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

/* ---------------------------------------------------
   TABLES
--------------------------------------------------- */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table thead {
  background: #eff3ff;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.admin-table th {
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}

.admin-table tbody tr:hover {
  background: #f9fafb;
}

/* ---------------------------------------------------
   FORMS (Deliveries / Drivers / Settings)
--------------------------------------------------- */
.card-form .card-body {
  padding-top: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.form-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 9px 10px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.form-actions {
  margin-top: 12px;
}

/* Generic filter row above tables */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 7px 11px;
  font-size: 0.8rem;
}

.hidden {
  display: none !important;
}

.page-message {
  margin: 0;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.page-message.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.page-message.success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #166534;
}

.table-subtext {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
}

.form-grid-admin {
  grid-template-columns: 1.2fr 1fr;
}

.btn-table.secondary {
  background: #e0e7ff;
  color: #1d4ed8;
}

.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.detail-eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-name {
  margin: 0;
  font-size: 1.5rem;
}

.detail-location {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

.summary-card {
  min-width: 0;
}

.summary-list {
  display: grid;
  gap: 14px;
}

.summary-list div,
.metric-strip div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-list span,
.metric-strip span {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-list strong,
.metric-strip strong {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.section-header-inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.detail-secondary-grid {
  align-items: start;
}

.table-inline-select,
.table-inline-input {
  width: 100%;
  min-width: 120px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  padding: 7px 9px;
  font-size: 0.82rem;
  background: #ffffff;
}

.section-header-inline .table-inline-select {
  width: auto;
  min-width: 180px;
}

/* ---------------------------------------------------
   MODALS (View / Edit Delivery)
--------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal.show {
  display: flex !important;
}

.modal-content {
  background: #ffffff;
  width: 92%;
  max-width: 620px;
  padding: 20px 22px;
  border-radius: 14px;
  box-shadow: var(--shadow-strong);
  animation: modal-pop 0.18s ease-out;
}

@keyframes modal-pop {
  from {
    transform: translateY(6px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-title {
  margin: 0 0 4px;
  font-size: 1rem;
}

.modal-subtitle {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-feedback {
  margin-bottom: 12px;
}

.field-hint {
  margin: 2px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
}

/* Layout inside modal */
.modal-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

.modal-section h4 {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-field {
  font-size: 0.85rem;
  padding: 4px 0;
}

.modal-field label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.modal-field span {
  display: block;
  font-weight: 500;
}

/* Photo / signature area */
.modal-media {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.modal-media img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* Modal footer buttons */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
/* ============================
   SETTINGS PAGE STYLES
   RapidMed Admin
==============================*/

/* Collapsible Section Container */
.settings-section {
  margin-bottom: 1.5rem;
  border: 1px solid #d7e2ed;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: 0.3s ease;
}

/* Header Button */
.settings-header {
  width: 100%;
  padding: 1rem 1.2rem;
  background: #f6f9fc;
  cursor: pointer;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  text-align: left;
  transition: 0.2s ease-in-out;
}

.settings-header:hover {
  background: #e9f3ff;
}

.settings-header h2 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}

.settings-header p {
  margin: 0;
  font-size: 0.85rem;
  color: #68788d;
}

/* Arrow Icon */
.toggle-icon {
  font-size: 1.2rem;
  font-weight: 700;
  color: #4a5568;
}

/* Open State */
.settings-section.open .settings-body {
  max-height: 1500px; /* big enough */
  padding: 1.3rem;
  border-top: 1px solid #e3edf5;
}

.settings-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.3rem;
  transition: max-height 0.35s ease, padding 0.3s ease;
}

/* Settings Blocks */
.settings-block {
  margin-bottom: 2rem;
}

.settings-block h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.settings-block p {
  color: #677892;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* Form Grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.form-group input,
.form-group select {
  height: 38px;
  border-radius: 6px;
  border: 1px solid #cfd9e3;
  padding: 0 8px;
  font-size: 0.9rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.checkbox-group small {
  margin-top: 0.3rem;
  display: block;
  font-size: 0.78rem;
  color: #6d7e92;
}

/* Form Buttons */
.form-actions {
  grid-column: span 2;
  text-align: right;
}

.btn-primary {
  background: #0067c8;
  border: none;
  padding: 0.55rem 1rem;
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary:hover {
  background: #0054a5;
}

.btn-secondary {
  background: #f3f6fa;
  border: 1px solid #cbd9e6;
  padding: 0.55rem 1rem;
  color: #43536c;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
}

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

/* Admin Table Buttons */
.btn-table.danger {
  background: #ff3b3b;
  border: none;
  padding: 0.4rem 0.8rem;
  color: #fff;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
}

.btn-table.danger:hover {
  background: #d92626;
}
   


.proof-panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 40px;
  z-index: 9999;
}

.proof-panel.hidden {
  display: none;
}

.proof-warning {
  background: #b91c1c;
  color: #f9fafb;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

.proof-panel img {
  max-width: 90%;
  max-height: 70vh;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.proof-panel::after {
  content: "CONFIDENTIAL - RAPIDMED LOGISTICS";
  position: fixed;
  inset: 0;
  font-size: 20px;
  color: rgba(248, 250, 252, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  transform: rotate(-20deg);
}
.proof-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4000;
}

.proof-modal.hidden {
  display: none;
}

.proof-box {
  background: #fff;
  width: 95%;
  max-width: 500px;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  animation: proofFade 0.25s ease-out;
}

@keyframes proofFade {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

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

.close-btn {
  background: #ef4444;
  border: none;
  color: white;
  font-size: 16px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.proof-body img {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.watermark {
  text-align: center;
  font-size: 12px;
  color: #2563eb;
  margin-top: 8px;
}

.warning {
  text-align: center;
  font-size: 11px;
  color: #dc2626;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .form-actions {
    text-align: left;
  }
}

/* ---------------------------------------------------
   RESPONSIVE
--------------------------------------------------- */
@media (max-width: 1024px) {
  .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: min(280px, 86vw);
    z-index: 110;
    box-shadow: var(--shadow-strong);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .main-area {
    width: 100%;
  }

  .admin-mobile-toggle {
    display: inline-flex;
  }

  body.admin-nav-open {
    overflow: hidden;
  }

  body.admin-nav-open .sidebar {
    transform: translateX(0);
  }

  body.admin-nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid-admin {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .portal-notification-panel {
    right: auto;
    left: 0;
    width: min(100vw - 24px, 420px);
  }

  .portal-toast-container {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .content {
    padding: 14px 12px 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .card-header,
  .card-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .detail-hero,
  .section-header-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-actions {
    justify-content: flex-start;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.form-grid textarea {
  grid-column: span 3;
  min-height: 80px;
}

.form-grid button {
  grid-column: span 3;
  max-width: 220px;
}
/* ===============================
   PROOF VIEWER  OVERLAY
================================ */
.proof-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5000;
}

.proof-overlay.hidden {
  display: none;
}

/* ===============================
   MODAL
================================ */
.proof-modal {
  width: 90%;
  max-width: 900px;
  background: #ffffff;
  border-radius: 14px;
  padding: 24px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  max-height: 90vh;
  overflow: auto;
}

/* Header */
.proof-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 12px;
}

.proof-header h2 {
  color: #2563eb;
}

.proof-warning {
  font-size: 0.8rem;
  color: #ef4444;
  font-weight: 600;
}

/* ===============================
   AUTH STEP
================================ */
.proof-instruction {
  margin: 16px 0;
  color: #374151;
}

.proof-form input,
.proof-form textarea {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

.proof-error {
  color: #dc2626;
  margin-top: 8px;
}

/* ===============================
   VIEW STEP
================================ */
/* =========================
   SETTINGS  PROOF VIEWER UI
========================= */
.status-line {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #374151;
}
.status-ok { color: #16a34a; }
.status-error { color: #dc2626; }
.status-info { color: #2563eb; }

body.modal-open {
  overflow: hidden;
}

/* Reuse your modal base if you already have it. This ensures proof panel works */
#proofPanel.modal {
  display: none;
}
#proofPanel.modal.show {
  display: flex !important;
}

.proof-viewer {
  position: relative;
  padding-bottom: 10px;
}

.proof-warning {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #2563eb;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.proof-warning .muted {
  color: #6b7280;
  font-size: 0.9rem;
  margin-top: 4px;
}

.proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.proof-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}
.proof-card-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: #111827;
}

.proof-media {
  width: 100%;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 170px;
}
.proof-media img {
  max-width: 100%;
  max-height: 240px;
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.proof-media-stack {
  flex-direction: column;
  gap: 12px;
}

.proof-media-block {
  width: 100%;
}

.proof-media-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.proof-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.proof-media-grid img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
}

.proof-meta {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: #374151;
}

.proof-meta span {
  color: #111827;
}

.proof-empty {
  color: #6b7280;
  text-align: center;
  padding: 22px 10px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px dashed #e5e7eb;
}

/* Watermark overlay */
.proof-watermark {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.12;
  font-weight: 800;
  font-size: 18px;
  color: #111827;
  transform: rotate(-18deg);
  text-align: center;
  padding: 20px;
  user-select: none;
}

/* Responsive */
@media (max-width: 900px) {
  .proof-grid {
    grid-template-columns: 1fr;
  }
}
.modal,
.overlay,
.backdrop {
  pointer-events: none;
}

.modal.show,
.overlay.show,
.backdrop.show {
  pointer-events: auto;
}
.proof-code-box {
  margin-top: 10px;
  padding: 16px;
  background: #0f172a;
  color: #22c55e;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  border-radius: 8px;
  width: fit-content;
}
/* ===============================
   PROOF ACCESS CODE  SETTINGS
=============================== */

.proof-code-box {
  margin-top: 10px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

#proofCode {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #2563eb;
}

.proof-code-box small {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

.muted {
  color: #64748b;
  font-size: 14px;
}
  

/* ===============================
   VEHICLES PAGE  LAYOUT HELPERS
   (moves inline CSS from admin-vehicles.html)
=============================== */

.page {
  padding: 24px;
}

/* Grid helpers */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Plate pill */
.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2ff;
  color: #1e3a8a;
  display: inline-block;
}

/* Messages */
.error {
  color: #b91c1c;
  font-size: 13px;
  margin-top: 8px;
}

.success {
  color: #166534;
  font-size: 13px;
  margin-top: 8px;
}

/* Responsive for vehicle grids */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .grid,
  .grid2 {
    grid-template-columns: 1fr;
  }
}
.pill-green { background:#dcfce7; color:#166534; }
.pill-red { background:#fee2e2; color:#991b1b; }
.pill-yellow { background:#fef9c3; color:#854d0e; }



