/**
 * UzaDebt - Customer Portal Stylesheet (status.php)
 * Inspired by Resume.co.tz Executive Workspace (Warm Paper #f8f4ec + White #ffffff + Royal Purple #6b21a8)
 * Zero pill-soup, crisp hairline borders, high-contrast light form controls.
 */

body.portal-body {
  background: #f8f4ec;
  color: #1c1b18;
}

.portal-page {
  background: #f8f4ec;
  color: #1c1b18;
  padding: 32px 0 72px;
  min-height: calc(100vh - 180px);
}

.portal-wrap {
  width: min(100% - 40px, 1200px);
  margin-inline: auto;
}

/* ── Editorial Kicker (replaces pill badges) ──────────────────────────── */
.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #6b21a8;
  margin-bottom: 8px;
}
.portal-kicker::before {
  content: "";
  width: 16px;
  height: 2px;
  background: #6b21a8;
}

/* ── Buttons (8px executive radius, never 999px pills) ───────────────── */
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.p-btn .ic { width: 16px; height: 16px; }
.p-btn--sm { padding: 8px 14px; font-size: 13px; }
.p-btn--block { width: 100%; }

.p-btn--primary {
  background: #6b21a8;
  color: #ffffff;
  border-color: #6b21a8;
}
.p-btn--primary:hover {
  background: #581c87;
  border-color: #581c87;
  color: #ffffff;
}

.p-btn--secondary {
  background: #ffffff;
  color: #1c1b18;
  border-color: #d5cdbc;
}
.p-btn--secondary:hover {
  background: #f8f4ec;
  border-color: #b8ae99;
  color: #1c1b18;
}

.p-btn--whatsapp {
  background: #ffffff;
  color: #15803d;
  border-color: #bbf7d0;
}
.p-btn--whatsapp:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

/* ── Executive 2-Column Workspace Shell ──────────────────────────────── */
.portal-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.portal-sidebar {
  display: grid;
  gap: 20px;
}

.portal-main {
  display: grid;
  gap: 20px;
  min-width: 0;
}

/* ── Cards ───────────────────────────────────────────────────────────── */
.p-card {
  background: #ffffff;
  border: 1px solid #e4decb;
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(28, 27, 24, 0.04);
}

.p-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.p-sec-title {
  margin: 0 0 14px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #1c1b18;
}
.p-card-head .p-sec-title { margin-bottom: 0; }

.p-muted {
  color: #5c574d;
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
}

/* ── Sidebar: Borrower Identity Card ─────────────────────────────────── */
.p-user-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.p-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #6b21a8;
  color: #ffffff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.p-user-name {
  font-size: 16px;
  font-weight: 700;
  color: #1c1b18;
  line-height: 1.25;
  margin: 0 0 2px;
}

.p-user-ref {
  font-family: var(--mono);
  font-size: 12.5px;
  color: #5c574d;
}

.p-user-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #ede8da;
  font-size: 13px;
  color: #5c574d;
}

/* ── Clean Inline Status Tag (6px radius, subtle tint) ───────────────── */
.p-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: #f3e8ff;
  color: #6b21a8;
}
.p-status-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.p-status-tag--ok {
  background: #ecfdf5;
  color: #065f46;
}

/* ── Key-Value Summary List ──────────────────────────────────────────── */
.p-kv {
  margin: 0;
  display: grid;
}
.p-kv > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #f0ece1;
  font-size: 13.5px;
}
.p-kv > div:first-child { padding-top: 0; }
.p-kv > div:last-child { border-bottom: 0; padding-bottom: 0; }
.p-kv dt {
  color: #6e6a61;
  font-weight: 500;
  flex-shrink: 0;
}
.p-kv dd {
  margin: 0;
  color: #1c1b18;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}
.p-kv dd.mono { font-family: var(--mono); font-size: 13px; }

.p-sidebar-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #ede8da;
  display: grid;
  gap: 8px;
}

/* ── Main Header Bar ─────────────────────────────────────────────────── */
.p-header-bar {
  background: #ffffff;
  border: 1px solid #e4decb;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(28, 27, 24, 0.04);
}
.p-header-bar h1 {
  font-family: var(--font);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #1c1b18;
  margin: 0 0 4px;
  line-height: 1.15;
}
.p-header-sub {
  font-size: 13.5px;
  color: #5c574d;
  margin: 0;
}
.p-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── 5-Step Resolution Progress ──────────────────────────────────────── */
.p-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.p-track li {
  background: #faf8f4;
  border: 1px solid #e8e3d5;
  border-radius: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.p-track__num {
  width: 24px;
  height: 24px;
  border-radius: 0;
  background: #ece7da;
  color: #5c574d;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.p-track__num .ic { width: 14px; height: 14px; }
.p-track li strong {
  font-size: 13px;
  font-weight: 700;
  color: #1c1b18;
  line-height: 1.25;
}
.p-track li small {
  font-size: 12px;
  color: #6e6a61;
  line-height: 1.35;
}
.p-track li.is-current {
  background: #faf5ff;
  border-color: #c084fc;
}
.p-track li.is-current .p-track__num {
  background: #6b21a8;
  color: #ffffff;
}
.p-track li.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.p-track li.is-done .p-track__num {
  background: #15803d;
  color: #ffffff;
}

/* ── Settled Banner ──────────────────────────────────────────────────── */
.p-card--settled {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}
.p-settled-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.p-settled-head h2 {
  font-size: 20px;
  color: #1c1b18;
  margin: 8px 0 6px;
}
.p-settled-meta {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: #5c574d;
}
.p-settled-meta strong { font-size: 14px; color: #065f46; }
.p-settled-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ── Control Number & Pending State ──────────────────────────────────── */
.p-cn-box {
  background: #faf8f4;
  border: 1px solid #e4decb;
  border-radius: 10px;
  padding: 18px 20px;
}
.p-cn-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.p-cn-lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b21a8;
  margin-bottom: 4px;
}
.p-cn-num {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: #1c1b18;
  letter-spacing: 0.04em;
}
.p-cn-bar {
  height: 8px;
  background: #e4decb;
  border-radius: 99px;
  overflow: hidden;
  margin: 14px 0;
}
.p-cn-bar > i {
  display: block;
  height: 100%;
  background: #6b21a8;
  border-radius: 99px;
}
.p-cn-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.p-cn-stats span {
  display: block;
  font-size: 12px;
  color: #6e6a61;
  margin-bottom: 2px;
}
.p-cn-stats strong {
  font-size: 14px;
  color: #1c1b18;
}
.p-cn-stats strong.txt-ok { color: #15803d; }
.p-cn-save {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e4decb;
  font-size: 13px;
  color: #15803d;
  display: flex;
  align-items: center;
  gap: 6px;
}

.p-pending {
  background: #faf8f4;
  border: 1px solid #e4decb;
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
}
.p-pending__ic {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f3e8ff;
  color: #6b21a8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.p-pending h3 {
  font-size: 16px;
  color: #1c1b18;
  margin: 0 0 6px;
}
.p-pending p {
  font-size: 13.5px;
  color: #5c574d;
  max-width: 54ch;
  margin: 0 auto;
  line-height: 1.55;
}

/* ── Payment Channels Accordion (Light Mode) ─────────────────────────── */
.p-howto {
  margin-top: 20px;
}
.p-howto h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: #1c1b18;
  margin: 0 0 4px;
}
.p-channels {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.p-channels details {
  background: #faf8f4;
  border: 1px solid #e4decb;
  border-radius: 8px;
  padding: 10px 14px;
}
.p-channels summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: #1c1b18;
}
.p-channels ol {
  margin: 8px 0 0 18px;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: #4a463e;
}

/* ── Restructuring Plan Radio Rows ───────────────────────────────────── */
.p-plan-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #ede8da;
}
.p-plan-form {
  display: grid;
  gap: 10px;
}
.p-plan-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: #ffffff;
  border: 1px solid #d5cdbc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #1c1b18;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.p-plan-opt:hover {
  background: #faf8f4;
  border-color: #b8ae99;
}
.p-plan-opt:has(input:checked) {
  background: #faf5ff;
  border-color: #6b21a8;
  box-shadow: inset 0 0 0 1px #6b21a8;
}
.p-plan-opt input[type="radio"] {
  accent-color: #6b21a8;
  margin-right: 8px;
}

/* ── Bottom 2-Column Row (Care & Payment History) ────────────────────── */
.p-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

/* ── Light-Mode Form Inputs inside Portal ────────────────────────────── */
.portal-page .p-input,
.portal-page select.p-input,
.portal-page textarea.p-input {
  width: 100%;
  background: #ffffff;
  color: #1c1b18;
  border: 1px solid #d5cdbc;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.portal-page .p-input::placeholder { color: #8c867a; }
.portal-page .p-input:focus {
  outline: none;
  border-color: #6b21a8;
  box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.12);
}

.p-input-prefix {
  display: flex;
  align-items: stretch;
  border: 1px solid #d5cdbc;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}
.p-input-prefix span {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: #f8f4ec;
  border-right: 1px solid #e4decb;
  color: #5c574d;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
}
.p-input-prefix .p-input {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.p-input-prefix:focus-within {
  border-color: #6b21a8;
  box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.12);
}

/* ── Alerts ──────────────────────────────────────────────────────────── */
.p-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  margin-top: 14px;
  border: 1px solid transparent;
}
.p-alert--ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.p-alert--err {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* ── Payment History Rows ────────────────────────────────────────────── */
.p-payments {
  display: grid;
  gap: 8px;
}
.p-payments__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #faf8f4;
  border: 1px solid #ece7da;
  border-radius: 8px;
  font-size: 13px;
}
.p-payments__row strong { display: block; color: #1c1b18; }
.p-payments__row small { color: #6e6a61; font-size: 11.5px; }
.p-payments__right { text-align: right; display: grid; gap: 2px; justify-items: end; }

/* ── Lookup Gate & Verify View (Light Mode) ──────────────────────────── */
.p-lookup {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.p-lookup h1 {
  font-family: var(--font);
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: #1c1b18;
  margin: 0 0 12px;
}
.p-lookup__lead {
  font-size: 15.5px;
  line-height: 1.6;
  color: #5c574d;
  margin: 0 0 22px;
}
.p-ticks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.p-ticks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #2f2c26;
  line-height: 1.5;
}
.p-ticks .ic {
  width: 18px;
  height: 18px;
  color: #6b21a8;
  flex-shrink: 0;
  margin-top: 2px;
}
.p-form-q {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}
.p-form-q label {
  font-size: 13.5px;
  font-weight: 700;
  color: #1c1b18;
}
.p-form-q .sub {
  font-size: 12px;
  color: #6e6a61;
  margin-bottom: 4px;
}

.p-verify-collapse {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #ede8da;
}
.p-verify-collapse summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #5c574d;
  display: flex;
  align-items: center;
  gap: 6px;
}
.p-verify-collapse summary:hover { color: #6b21a8; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .portal-shell { grid-template-columns: 1fr; }
  .p-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-two-col { grid-template-columns: 1fr; }
  .p-lookup { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .portal-page { padding: 20px 0 48px; }
  .p-card, .p-header-bar { padding: 18px; }
  .p-track { grid-template-columns: 1fr; }
  .p-cn-stats { grid-template-columns: 1fr; }
}

/* ── Support Shadow Mode Banner (Resume.co.tz Standard) ──────────────── */
.shadow-mode-banner {
  background: #1C1B18;
  color: #FFFFFF;
  border-bottom: 2px solid #D97706;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  position: relative;
  z-index: 120;
}

/* ── Resume-Inspired Workspace Navigation & KPI Strip ────────────────── */
.p-nav-card {
  padding: 12px;
}
.p-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.p-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4B4840;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.p-nav-btn:hover {
  background: #FAF7F1;
  color: #1C1B18;
}
.p-nav-btn.is-active {
  background: rgba(107, 33, 168, 0.08);
  color: #6B21A8;
}
.p-nav-btn-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.p-nav-btn-left svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.p-nav-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: #F3ECE1;
  color: #4B4840;
}
.p-nav-btn.is-active .p-nav-badge {
  background: #6B21A8;
  color: #FFFFFF;
}

.p-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.p-kpi-card {
  background: #FFFFFF;
  border: 1px solid #E4DECB;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(28, 27, 24, 0.04);
}
.p-kpi-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6E6A61;
  margin-bottom: 6px;
}
.p-kpi-val {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #1C1B18;
  letter-spacing: -0.02em;
}
.p-kpi-val--ok { color: #047857; }
.p-kpi-val--purple { color: #6B21A8; }
.p-kpi-sub {
  display: block;
  font-size: 11.5px;
  color: #767267;
  margin-top: 4px;
}

.p-tab-panel[hidden] { display: none !important; }

@media (max-width: 960px) {
  .p-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .p-kpi-grid { grid-template-columns: 1fr; }
}
.shadow-mode-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.shadow-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #FBBF24;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.shadow-mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FBBF24;
  display: inline-block;
}
.shadow-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  color: #1C1B18;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}
.shadow-exit-btn:hover {
  background: #F8F4EC;
}
