/* ============================================================================
   Dharah portal shell styles — shared by all portal apps (vendor, riders,
   admin, kyc, shipping, finance). Complements dharah.css (design tokens:
   colors, radius, shadows, buttons, badges, tables, forms, toasts…).
   Polished, professional console UI: sidebar app shell, cards, stats,
   timeline, auth screens. Brand mark can be swapped to the platform logo
   uploaded in the Admin console (.brand-logo-img).
   ============================================================================ */

/* ---------------- auth screens ---------------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: radial-gradient(1100px 500px at 50% -10%, rgba(10, 110, 79, .10), transparent 60%), var(--bg-soft); }
.auth-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 1.9rem 1.75rem 1.6rem; animation: rise-in .22s ease-out; }
.auth-card h1 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.auth-card h1 svg { width: 34px; height: 34px; flex: none; }
.auth-alt { text-align: center; font-size: .88rem; margin-top: 1rem; }
.auth-card .btn--block { margin-top: .35rem; }

@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.spinner { width: 34px; height: 34px; margin: 0 auto .75rem; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--green); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- app shell ---------------- */
.portal { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.portal__side { background: linear-gradient(180deg, #101828 0%, #0C111D 100%); color: #D0D5DD;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #344054 transparent; }
.portal__side::-webkit-scrollbar { width: 8px; }
.portal__side::-webkit-scrollbar-thumb { background: #2b3547; border-radius: 8px; }

.portal__side .dh-logo { color: #fff; padding: 18px 16px; border-bottom: 1px solid #1F2937; }
.portal__side .dh-logo svg, .portal__side .dh-logo .brand-logo-img { width: 34px; height: 34px; flex: none; }
.portal__side .dh-logo small { display: block; font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: #98A2B3; font-weight: 700; margin-top: 2px; }

.portal__side nav { display: grid; gap: 2px; padding: 12px 10px; flex: 1; align-content: start; }
.nav-section { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #667085; padding: 14px 10px 5px; }
.nav-section:first-child { padding-top: 2px; }
.portal__side nav a { color: #CBD5E1; text-decoration: none; font-size: .88rem; font-weight: 600; padding: 9px 11px;
  border-radius: 9px; display: flex; gap: 9px; align-items: center; transition: background .12s ease, color .12s ease; }
.portal__side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.portal__side nav a.on { background: var(--green); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }

.portal__side-bottom { padding: 12px; border-top: 1px solid #1F2937; }
.portal__user { display: flex; gap: 10px; align-items: center; padding: 4px 2px 10px; min-width: 0; }
.portal__user-meta { display: grid; min-width: 0; }
.portal__user-meta strong { font-size: .85rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal__user-meta .muted { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; }

.portal__scrim { position: fixed; inset: 0; background: rgba(16, 24, 40, .5); z-index: 55; }
.portal__main { min-width: 0; display: flex; flex-direction: column; background: var(--bg-soft); }
.portal__top { background: #fff; border-bottom: 1px solid var(--line); padding: 13px 22px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.portal__title { font-weight: 800; font-size: 1.05rem; flex: 1; letter-spacing: -.01em; }
.portal__brand svg, .portal__brand .brand-logo-img { width: 28px; height: 28px; display: block; }
.portal__burger { display: none; border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--ink); padding: 2px 6px; border-radius: 8px; }
.portal__burger:hover { background: var(--bg-soft); }
.portal__view { padding: 22px; max-width: 1120px; width: 100%; margin: 0 auto; animation: fade-view .18s ease-out; }
@keyframes fade-view { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .portal { grid-template-columns: 1fr; }
  .portal__side { position: fixed; left: -250px; width: 240px; z-index: 60; transition: left .18s ease-out; }
  .portal__side.open { left: 0; box-shadow: var(--shadow-lg); }
  .portal__burger { display: block; }
  .portal__view { padding: 14px; }
}

/* ---------------- stat cards ---------------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 16px 14px;
  box-shadow: var(--shadow); overflow: hidden; }
.stat::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--green); opacity: .85; }
.stat b { display: block; font-size: 1.45rem; margin-top: 3px; letter-spacing: -.02em; }
.stat span.k { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------------- toolbar ---------------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input, .toolbar select { border: 1.5px solid var(--line); border-radius: 9px; padding: 8px 12px; background: #fff; font-size: .9rem; }
.toolbar input:focus, .toolbar select:focus { outline: 2px solid var(--green-tint); border-color: var(--green); }

/* ---------------- detail helpers ---------------- */
.kpis { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 1rem; align-items: center; }
.kpis .status { font-size: .78rem; }
.rowbtn { border: 0; background: none; color: var(--green); font-weight: 700; cursor: pointer; padding: 3px 6px; border-radius: 6px; font-size: .86rem; }
.rowbtn:hover { background: var(--green-tint); }
.rowbtn.danger { color: var(--danger); }
.rowbtn.danger:hover { background: var(--danger-tint); }

/* Two-column card grid used on console dashboards */
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Key/value row with separators (details panels) */
.contact-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.contact-row:last-child { border-bottom: 0; }

/* ---------------- modal ---------------- */
.dh-modal { position: fixed; inset: 0; background: rgba(16, 24, 40, .55); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 1rem; }
.dh-modal__card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: 88vh; overflow-y: auto; padding: 1.25rem; animation: rise-in .18s ease-out; }

/* ---------------- brand mark (logo uploaded in Admin → Settings → Brand) --------------- */
.brand-logo-img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; background: #fff; }
.auth-card h1 .brand-logo-img { width: 38px; height: 38px; }

/* ---------------- additional status colors (base .status + core st-* live in dharah.css) ---------------- */
.st-ACTIVE, .st-APPROVED, .st-ACCEPTED, .st-RECEIVED, .st-OPEN { background: var(--ok-tint); color: var(--ok); }
.st-SUSPENDED, .st-INACTIVE, .st-FLAGGED, .st-ESCALATED { background: var(--danger-tint); color: var(--danger); }
.st-IN_REVIEW, .st-CORRECTION_REQUIRED, .st-DRAFT, .st-ASSIGNED, .st-PARTIALLY_REFUNDED, .st-ABANDONED { background: var(--amber-tint); color: var(--amber-dark); }

/* ---------------- accessibility & motion ---------------- */
.btn:focus-visible, .portal__side nav a:focus-visible, .rowbtn:focus-visible, .toolbar input:focus-visible, .toolbar select:focus-visible,
.portal input:focus-visible, .portal select:focus-visible, .portal textarea:focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
