:root {
  --bg: #e9eef5;
  --surface: #e9eef5;
  --surface-alt: #edf2f8;
  --surface-deep: #dce4f0;
  --text: #1d2939;
  --text-muted: #667085;
  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow-out: 10px 10px 22px rgba(163, 177, 198, 0.45), -10px -10px 22px rgba(255, 255, 255, 0.85);
  --shadow-in: inset 5px 5px 10px rgba(163, 177, 198, 0.35), inset -5px -5px 10px rgba(255, 255, 255, 0.9);
}

body.app-body {
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.mobile-shell {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}

.mobile-shell-inner {
  width: 100%;
}

.app-navbar {
  margin-top: 0.8rem;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-out);
}

.navbar-brand {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.app-badge {
  border: 0;
  background: var(--surface);
  color: var(--primary-strong);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-out);
}

.app-main {
  margin-top: 1rem;
  padding-bottom: 0.8rem;
}

.app-footer {
  padding-bottom: 0.5rem;
}

.app-footer .small {
  text-align: center;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  font-weight: 650;
}

.text-muted,
.small.text-muted,
.form-text {
  color: var(--text-muted) !important;
}

.card {
  background: var(--surface);
  border: 0 !important;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-out) !important;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: #d7e0ec;
}

.table > :not(caption) > * > * {
  padding-top: 0.82rem;
  padding-bottom: 0.82rem;
}

.table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.btn,
.form-control,
.form-select,
.badge {
  border-radius: var(--radius-sm);
}

.btn {
  min-height: 42px;
  font-weight: 650;
  border: 0;
  box-shadow: var(--shadow-out);
}

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

.btn:active,
.btn:focus-visible {
  box-shadow: var(--shadow-in);
}

.btn-sm {
  min-height: 36px;
}

.btn-primary {
  background: linear-gradient(145deg, #4e93fb, #3378df);
  color: #f8fbff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(145deg, #4a8cf2, #2d70d5);
}

.btn-dark {
  background: linear-gradient(145deg, #334155, #1f2937);
  color: #f8fafc;
}

.btn-success {
  background: linear-gradient(145deg, #25b35a, #139846);
  color: #f8fffb;
}

.btn-outline-dark,
.btn-outline-secondary,
.btn-outline-primary {
  background: var(--surface);
  color: var(--text);
}

.form-control,
.form-select {
  min-height: 42px;
  background: var(--surface-alt);
  border: 0;
  box-shadow: var(--shadow-in);
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  background: var(--surface-alt);
  color: var(--text);
  box-shadow: var(--shadow-in), 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.form-check-input {
  border: 0;
  background-color: var(--surface-alt);
  box-shadow: var(--shadow-in);
}

.form-check-input:checked {
  background-color: var(--primary);
}

.badge {
  font-weight: 650;
  padding: 0.48em 0.7em;
  border: 0;
  box-shadow: var(--shadow-out);
}

.text-bg-secondary {
  background-color: #dbe3ee !important;
  color: #334155 !important;
}

.text-bg-warning {
  background-color: #ffe8c2 !important;
  color: #8a4a00 !important;
}

.text-bg-success {
  background-color: #d6f5e2 !important;
  color: #0f7a3b !important;
}

.text-bg-danger {
  background-color: #ffd8d8 !important;
  color: #9b1c1c !important;
}

.text-bg-dark {
  background-color: #2d3748 !important;
  color: #f8fafc !important;
}

.alert {
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--surface);
  box-shadow: var(--shadow-out);
}

.is-loading {
  opacity: 0.75;
}

li {
  margin-bottom: 0.35rem;
}

hr {
  border-color: #d5deeb;
}

code {
  background: #dfe8f4;
  color: #213047;
  border-radius: 8px;
  padding: 0.1rem 0.35rem;
}

.progress-track {
  height: 1.1rem;
  border-radius: 999px;
  background: var(--surface-alt);
  box-shadow: var(--shadow-in);
}

.progress-track .progress-bar {
  font-size: 0.75rem;
  font-weight: 650;
}

.upload-preview {
  background: var(--surface-alt);
}

.next-steps {
  background: var(--surface-alt);
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-in);
  padding: 0.9rem;
}

.thumbnail-btn {
  min-height: auto;
}

.doc-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  box-shadow: var(--shadow-out);
}

.profile-mini {
  min-width: 190px;
}

.btn-action {
  min-height: 46px;
  font-weight: 700;
}

.sticky-stage {
  position: sticky;
  top: 0.5rem;
  z-index: 20;
  border-left: 4px solid var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-out);
}

.status-chip {
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  box-shadow: var(--shadow-out);
}

.status-chip.pending {
  background: #dbe3ee;
  color: #1e293b;
}

.status-chip.progress {
  background: #ffe9c9;
  color: #8a4a00;
}

.status-chip.done {
  background: #d6f5e2;
  color: #0f7a3b;
}

.status-chip.alert {
  background: #ffd8d8;
  color: #9b1c1c;
}

.status-chip.pending::before {
  content: "Pending ";
  font-weight: 700;
}

.status-chip.progress::before {
  content: "In Progress ";
  font-weight: 700;
}

.status-chip.done::before {
  content: "Done ";
  font-weight: 700;
}

.status-chip.alert::before {
  content: "Alert ";
  font-weight: 700;
}

.case-row,
.case-card {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.case-row.d-none,
.case-card.d-none {
  opacity: 0;
  transform: translateY(2px);
}

.table-responsive {
  border-radius: var(--radius-md);
}

.mobile-bulk-bar {
  position: sticky;
  bottom: 0.5rem;
  z-index: 30;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-out);
  padding: 0.55rem 0.8rem;
  margin-top: 0.5rem;
}

.staff-hub-intro {
  border-radius: var(--radius-md);
}

.staff-hub-link {
  color: inherit;
}

.staff-hub-tile {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.staff-hub-link:hover .staff-hub-tile {
  transform: translateY(-3px);
  box-shadow: 12px 14px 28px rgba(163, 177, 198, 0.55), -8px -8px 24px rgba(255, 255, 255, 0.92);
}

.staff-hub-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.staff-hub-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5em 0.9em;
  background: linear-gradient(145deg, #4e93fb, #3378df);
  color: #f8fbff;
  border: 0;
  box-shadow: var(--shadow-out);
}

.staff-hub-badge-pool {
  background: linear-gradient(145deg, #334155, #1f2937);
  color: #f8fafc;
}

.staff-hub-badge-done {
  background: linear-gradient(145deg, #25b35a, #139846);
  color: #f8fffb;
}

.staff-hub-badge-activity {
  background: linear-gradient(145deg, #8b5cf6, #6d28d9);
  color: #faf5ff;
}

.staff-hub-legend li {
  margin-bottom: 0.35rem;
}

.staff-hub-link:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.55);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}

.staff-hub-link:focus-visible .staff-hub-tile {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px rgba(59, 130, 246, 0.35);
}

html {
  scroll-padding-top: 5rem;
}

.scroll-anchor {
  scroll-margin-top: 5rem;
}

.staff-m-stack .staff-m-card:last-child {
  margin-bottom: 0 !important;
}

.staff-m-card .status-chip {
  font-size: 0.68rem;
  padding: 0.28em 0.5em;
}

.staff-empty-state .btn {
  min-height: 46px;
}

.staff-help-alert {
  background: var(--surface-alt);
  color: var(--text);
  border-radius: var(--radius-md);
}

.staff-case-jump .btn {
  min-height: 40px;
}

.sticky-stage.staff-case-stage-card {
  top: 0.35rem;
}

.admin-quick-jumps .btn {
  min-height: 38px;
}

.about-nav-link {
  color: var(--primary-strong);
}

.about-nav-link:hover {
  color: var(--primary);
  text-decoration: underline !important;
}

.about-shortcut-btn {
  font-weight: 650;
}

.about-page .btn-action {
  min-height: 46px;
}

.auth-card {
  max-width: 520px;
  margin: 0 auto;
}

.login-page .auth-card {
  max-width: none;
  margin: 0;
}

.login-primary-card {
  border: 2px solid rgba(59, 130, 246, 0.2);
}

.login-mobile-input {
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

.login-submit-btn {
  font-size: 1.02rem;
  font-weight: 750;
}

.login-staff-area .staff-login-btn {
  min-height: 44px;
  font-weight: 600;
}

.landing-intro-simple .landing-bullets li {
  margin-bottom: 0.25rem;
}

.landing-intro .landing-kicker {
  color: var(--primary-strong);
  letter-spacing: 0.06em;
}

.landing-headline {
  line-height: 1.25;
}

.landing-lead {
  font-size: 0.98rem;
  line-height: 1.55;
}

.hindi-muted {
  line-height: 1.55;
}

.landing-step-num {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #4e93fb, #3378df);
  color: #f8fbff;
  font-size: 0.78rem;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-out);
  margin-top: 0.1rem;
}

.landing-steps .text-muted.small {
  font-size: 0.82rem;
}

.landing-note {
  line-height: 1.45;
  font-size: 0.8rem;
}

@media (max-width: 991px) {
  .login-page .auth-card {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
}

.collapse .bg-light-subtle,
.border.rounded.p-2.bg-light-subtle {
  background: var(--surface-alt) !important;
  border: 0 !important;
  box-shadow: var(--shadow-in);
}

@media (max-width: 992px) {
  .mobile-shell {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

@media (max-width: 768px) {
  body.app-body {
    font-size: 0.92rem;
  }

  .app-navbar {
    margin-top: 0.45rem;
    border-radius: var(--radius-md);
  }

  .app-main {
    margin-top: 0.7rem;
    padding-top: 0.55rem !important;
    padding-bottom: 0.85rem !important;
  }

  .profile-mini {
    min-width: 100%;
  }

  .btn-action {
    min-height: 44px;
  }

  .table > :not(caption) > * > * {
    padding-top: 0.68rem;
    padding-bottom: 0.68rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 0.98rem;
  }

  .app-badge {
    font-size: 0.69rem;
    padding: 0.28rem 0.58rem;
  }

  .auth-card {
    max-width: 100%;
  }

  .auth-card .card-body {
    padding: 1rem !important;
  }

  .login-page .login-primary-card .card-body {
    padding-top: 1.1rem !important;
  }

  .login-submit-btn {
    min-height: 48px;
    font-size: 1.05rem;
  }

  .mobile-bulk-bar {
    bottom: 0.35rem;
  }

  .staff-case-actions .profile-mini {
    width: 100%;
  }

  .staff-hub-intro .card-body {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }
}

/* —— Admin case trail / pipeline —— */
.trail-pipeline {
  margin-bottom: 0.25rem;
}

.trail-pipe-step {
  min-width: 5.5rem;
  max-width: 9rem;
  flex: 1 1 22%;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: var(--shadow-in);
  border: 0;
}

.trail-pipe-step-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.9;
  margin-bottom: 0.2rem;
}

.trail-pipe-step-sub {
  font-size: 0.8rem;
  font-weight: 750;
}

.trail-step-done {
  background: linear-gradient(145deg, #d6f5e2, #b8e9c8);
  color: #0f4d26;
}

.trail-step-progress {
  background: linear-gradient(145deg, #ffe8c2, #ffd38a);
  color: #7a3d00;
}

.trail-step-pending {
  background: var(--surface-alt);
  color: var(--text-muted);
}

.trail-step-danger {
  background: linear-gradient(145deg, #ffd8d8, #ffb4b4);
  color: #7a1212;
}

.trail-step-warn {
  background: linear-gradient(145deg, #fff3d6, #ffe0a3);
  color: #7a4d00;
}

.trail-step-neutral {
  background: #dbe3ee;
  color: #334155;
}

.trail-lane-legend {
  line-height: 1.6;
}

.trail-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-right: 0.2rem;
  vertical-align: middle;
}

.trail-dot-customer {
  background: #0d9488;
}
.trail-dot-documents {
  background: #2563eb;
}
.trail-dot-data_entry {
  background: #4f46e5;
}
.trail-dot-review {
  background: #d97706;
}
.trail-dot-itr {
  background: #16a34a;
}
.trail-dot-admin {
  background: #475569;
}
.trail-dot-workflow {
  background: #9333ea;
}
.trail-dot-other {
  background: #94a3b8;
}

.trail-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.trail-node {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  position: relative;
}

.trail-node-rail {
  width: 5px;
  border-radius: 999px;
  flex-shrink: 0;
  min-height: 2.5rem;
  box-shadow: var(--shadow-in);
}

.trail-lane-customer .trail-node-rail {
  background: linear-gradient(180deg, #14b8a6, #0d9488);
}
.trail-lane-documents .trail-node-rail {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}
.trail-lane-data_entry .trail-node-rail {
  background: linear-gradient(180deg, #818cf8, #4f46e5);
}
.trail-lane-review .trail-node-rail {
  background: linear-gradient(180deg, #fbbf24, #d97706);
}
.trail-lane-itr .trail-node-rail {
  background: linear-gradient(180deg, #4ade80, #16a34a);
}
.trail-lane-admin .trail-node-rail {
  background: linear-gradient(180deg, #94a3b8, #475569);
}
.trail-lane-workflow .trail-node-rail {
  background: linear-gradient(180deg, #c084fc, #9333ea);
}
.trail-lane-other .trail-node-rail {
  background: #cbd5e1;
}

.trail-node-card {
  min-width: 0;
}

.trail-details {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  color: var(--text-muted);
}

.case-trail-summary {
  background: var(--surface);
}

@media (max-width: 576px) {
  .trail-pipe-arrow {
    display: none !important;
  }

  .trail-pipe-step {
    flex: 1 1 45%;
    max-width: none;
  }
}
