/* RideUS Admin Dashboard -- shared styles. Plain CSS, no framework, to
   match this app's own "small web app, no build step" scope. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #14171f;
  --text-secondary: #5b6270;
  --text-tertiary: #8a90a0;
  --primary: #1f6feb;
  --primary-dark: #16407a;
  --danger: #c0392b;
  --warning: #b8860b;
  --success: #1a7f37;
  --sidebar-bg: #14171f;
  --sidebar-text: #c7cbd4;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: var(--primary); }

/* --- Login page --------------------------------------------------------- */

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 2px 12px rgba(20, 23, 31, 0.06);
}

.login-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.login-card p.sub {
  color: var(--text-secondary);
  margin: 0 0 24px;
  font-size: 13px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}

.field textarea { resize: vertical; min-height: 60px; }

/* A standalone select outside a .field wrapper -- e.g. the Deliveries
   panel's status filter, sitting next to a Refresh button in a panel
   header rather than inside a labeled form field. */
select.select-inline {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

button.btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.error-banner {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: var(--danger);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.error-banner.show { display: block; }

.hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 16px;
  line-height: 1.5;
}

/* --- Dashboard shell ----------------------------------------------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 18px 0;
}

.sidebar .brand {
  padding: 0 20px 18px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 10px;
}
.sidebar .brand .tag {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--sidebar-text);
  margin-top: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 13.5px;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.06); }
.nav-item.active {
  background: rgba(31,111,235,0.18);
  border-left-color: var(--primary);
  color: #fff;
}
.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 20px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer .who {
  font-size: 12px;
  color: var(--sidebar-text);
  margin-bottom: 8px;
  word-break: break-all;
}

.main {
  flex: 1;
  padding: 28px 32px;
  max-width: 1100px;
}

.panel { display: none; }
.panel.active { display: block; }

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.panel-header h2 { margin: 0; font-size: 19px; }
.panel-header p { margin: 4px 0 0; color: var(--text-secondary); font-size: 13px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.gap-sm { gap: 6px; }

.muted { color: var(--text-tertiary); }
.small { font-size: 12px; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pill-queued, .pill-new, .pill-requested, .pill-pending { background: #fff4d6; color: var(--warning); }
.pill-approved, .pill-active, .pill-resolved, .pill-completed { background: #dff5e3; color: var(--success); }
.pill-rejected, .pill-suspended, .pill-denied, .pill-removed, .pill-failed, .pill-cancelled { background: #fdecea; color: var(--danger); }
.pill-acknowledged, .pill-processing, .pill-infoRequested, .pill-inProgress, .pill-delivered { background: #e4ecfd; color: var(--primary); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
}

.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row { padding: 20px; text-align: center; color: var(--text-tertiary); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
  color: var(--text-secondary); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.3px;
}
table.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data-table tr:last-child td { border-bottom: none; }

.toast {
  position: fixed;
  bottom: 22px; right: 22px;
  background: var(--text);
  color: #fff;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 100;
  max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20,23,31,0.45);
  align-items: center; justify-content: center;
  z-index: 50;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  width: 100%; max-width: 420px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* KYC document photo thumbnails + lightbox (Sept 2026 fix: review screen
   used to be text-only paths). */
.kyc-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.kyc-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  cursor: pointer;
  font: inherit;
}
.kyc-thumb:hover { border-color: var(--primary); }
.kyc-thumb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 84px;
  background: var(--bg);
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
}
.kyc-thumb-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.kyc-thumb-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}
.kyc-thumb-error {
  font-size: 11px;
  color: var(--danger);
  text-align: center;
  padding: 0 4px;
}
.kyc-image-modal {
  max-width: 640px;
}
.kyc-image-modal-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 70vh;
  overflow: auto;
  background: var(--bg);
  border-radius: var(--radius);
}
.kyc-image-modal-body img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
}
