/* ═══════════════════════════════════════════════
   Happy Community 2 — Main Stylesheet (LTR/EN)
   Font: Cairo
   ═══════════════════════════════════════════════ */

:root {
  --primary:       #1e3a5f;
  --primary-light: #2563a8;
  --primary-dark:  #0f2030;
  --accent:        #e8a020;
  --accent-light:  #f5c842;
  --success:       #166534;
  --success-bg:    #dcfce7;
  --danger:        #991b1b;
  --danger-bg:     #fee2e2;
  --warn:          #92400e;
  --warn-bg:       #fef3c7;
  --surface:       #ffffff;
  --surface-alt:   #f8fafc;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --muted:         #64748b;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:     0 16px 48px rgba(0,0,0,.14);
  --ease:          all .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; overflow-x: hidden; }
body { font-family: 'Cairo'; background: var(--surface-alt); color: var(--text); min-height: 100dvh; overflow-x: hidden; }
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ──────────────────────────────────── */
.layout-wrapper { display: flex; flex-direction: column; min-height: 100dvh; }

.site-header {
  font-family: 'Cairo';
  background: linear-gradient(105deg, #ffffff 0%, #f8fafc 58%, #fef7e8 100%);
  border-bottom: 1px solid #e5e7eb;
  min-height: 74px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .07);
}
.header-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand-zone {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}
.brand {
  font-family: 'Cairo';
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
}
.brand:hover { opacity: .95; }
.brand-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #d4870b 0%, #f4b93f 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(212, 135, 11, .24);
}
.brand-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-name {
  font-family: 'Cairo';
  font-size: 1.05rem;
  font-weight: 800;
  color: #1f2937;
  letter-spacing: .01em;
  text-align: left;
}
.brand-sub {
  font-family: 'Cairo';
  font-size: .71rem;
  font-weight: 600;
  color: #6b7280;
  margin-top: .4rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .33rem .6rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #475569;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
}

.header-nav { display: flex; align-items: center; gap: .75rem; }
.nav-link {
  color: #334155;
  font-size: .87rem;
  font-weight: 700;
  padding: .42rem .78rem;
  border-radius: 9px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition: var(--ease);
}
.nav-link:hover {
  background: #fff;
  border-color: #e2e8f0;
  color: #0f172a;
  text-decoration: none;
}
.btn-register {
  background: linear-gradient(135deg, #d4870b 0%, #f4b93f 100%);
  color: #111827 !important;
  font-weight: 800;
  border-color: rgba(212, 135, 11, .25);
}
.btn-register:hover {
  background: linear-gradient(135deg, #c77708 0%, #e8aa2e 100%);
}
.btn-logout {
  background: #f8fafc;
  border: 1px solid #d5dde8;
  color: #334155;
  padding: .42rem .86rem;
  border-radius: 9px;
  font-family: inherit;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--ease);
  display: inline-flex;
  align-items: center;
  gap: .38rem;
}
.btn-logout:hover {
  background: #fff;
  border-color: #cbd5e1;
  color: #0f172a;
}
.nav-user {
  color: #64748b;
  font-size: .82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .36rem .56rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-main { flex: 1; padding: 1.5rem; }
.site-footer {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #6b7280;
  text-align: center;
  padding: 1rem;
  font-size: .8rem;
  border-top: 1px solid #e5e7eb;
}

@media (max-width: 980px) {
  .site-header { padding: .7rem 1rem; min-height: auto; }
  .header-inner { flex-direction: column; align-items: stretch; gap: .7rem; }
  .header-brand-zone { justify-content: space-between; }
  .header-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: .5rem;
  }
}

/* ─── Buttons ──────────────────────────────────── */
.btn-primary {
  background: var(--primary-light); color: #fff; border: none;
  padding: .6rem 1.6rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem; font-weight: 600;
  cursor: pointer; transition: var(--ease);
  display: inline-flex; align-items: center; gap: .4rem; text-decoration: none;
}
.btn-primary:hover:not(:disabled) { background: var(--primary); transform: translateY(-1px); text-decoration: none; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: .8rem 2rem !important; font-size: 1rem !important; }

.btn-secondary {
  background: var(--surface); color: var(--primary); border: 1.5px solid var(--border);
  padding: .6rem 1.6rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; transition: var(--ease);
}
.btn-secondary:hover { background: var(--surface-alt); }

.btn-danger {
  background: var(--danger); color: #fff; border: none;
  padding: .6rem 1.6rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; transition: var(--ease);
}
.btn-danger:hover:not(:disabled) { background: #7f1d1d; }
.btn-danger:disabled { opacity: .55; cursor: not-allowed; }

/* ─── Confirm Dialog ────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,.94);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: confirm-overlay-in .2s ease;
}
@keyframes confirm-overlay-in { from { opacity: 0; } to { opacity: 1; } }

.confirm-dialog {
  background: #fff; border-radius: 18px;
  padding: 2.25rem 2rem 1.75rem;
  max-width: 420px; width: 92%;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.06);
  animation: confirm-dialog-in .25s cubic-bezier(.22,1,.36,1);
}
@keyframes confirm-dialog-in {
  from { opacity: 0; transform: scale(.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.confirm-icon-wrap {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.confirm-icon-danger { background: #fef2f2; border: 2px solid #fecaca; }
.confirm-icon-info   { background: #ecfdf5; border: 2px solid #bbf7d0; }
.confirm-icon { font-size: 1.75rem; line-height: 1; }

.confirm-title {
  margin: 0 0 .5rem; font-size: 1.2rem; font-weight: 800;
  color: var(--text); letter-spacing: -.01em;
}
.confirm-message {
  margin: 0 0 1.75rem; font-size: .88rem; color: var(--muted);
  line-height: 1.6; padding: 0 .5rem;
}
.confirm-actions {
  display: flex; justify-content: center; gap: .6rem;
}
.confirm-cancel-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--surface-alt); color: var(--text); border: 1.5px solid var(--border);
  padding: .6rem 1.4rem; border-radius: 10px;
  font-family: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
}
.confirm-cancel-btn:hover { background: #e2e8f0; border-color: #cbd5e1; }

.confirm-danger-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; border: none;
  padding: .6rem 1.4rem; border-radius: 10px;
  font-family: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: all .15s ease;
  box-shadow: 0 2px 8px rgba(220,38,38,.3);
}
.confirm-danger-btn:hover { background: linear-gradient(135deg, #b91c1c, #991b1b); box-shadow: 0 4px 14px rgba(220,38,38,.4); transform: translateY(-1px); }

.confirm-primary-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; border: none;
  padding: .6rem 1.4rem; border-radius: 10px;
  font-family: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: all .15s ease;
  box-shadow: 0 2px 8px rgba(30,58,95,.3);
}
.confirm-primary-btn:hover { box-shadow: 0 4px 14px rgba(30,58,95,.4); transform: translateY(-1px); }

.btn-danger-outline {
  background: transparent; color: var(--danger); border: 1.5px solid var(--danger);
  padding: .55rem 1.3rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; transition: var(--ease);
}
.btn-danger-outline:hover { background: var(--danger-bg); }

.btn-edit {
  background: var(--accent); color: var(--primary-dark); border: none;
  padding: .55rem 1.3rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: var(--ease);
}
.btn-edit:hover { background: var(--accent-light); }

.btn-link { background: none; border: none; color: var(--primary-light); cursor: pointer; font-size: .88rem; text-decoration: underline; margin-top: .5rem; display: block; text-align: center; font-family: inherit; }

.btn-outline {
  background: transparent; border: 2px solid rgba(255,255,255,.6); color: #fff;
  padding: .6rem 1.6rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; transition: var(--ease);
  display: inline-flex; align-items: center; text-decoration: none;
}
.btn-outline:hover { background: rgba(255,255,255,.15); border-color: #fff; text-decoration: none; }

/* ─── Forms ────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--text); }
.req { color: #dc2626; }

.form-input {
  padding: .6rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .92rem; color: var(--text); background: var(--surface);
  transition: var(--ease); width: 100%;
}
.form-input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,168,.12); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-error, .validation-message { color: var(--danger); font-size: .8rem; margin-top: .15rem; }

/* ─── Alerts ───────────────────────────────────── */
.alert { padding: .8rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.1rem; font-size: .9rem; font-weight: 500; }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border-left: 4px solid var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); border-left: 4px solid var(--success); }
.alert-info    { background: #eff6ff; color: #1d4ed8; border-left: 4px solid #2563eb; }

/* ─── Auth Pages — Enterprise Split Layout ─────── */
.auth-page {
  display: flex;
  overflow-x: hidden;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 15% 20%, rgba(232,160,32,.10) 0, transparent 32%),
    radial-gradient(circle at 85% 75%, rgba(30,58,95,.08) 0, transparent 36%),
    var(--surface-alt);
}

/* ── Left brand panel ──────────────────────────── */
.auth-brand-panel {
  flex: 0 0 44%;
  background: linear-gradient(145deg, var(--primary-dark) 0%, #1c3d6e 55%, var(--primary-light) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2.5rem;
  position: relative; overflow: hidden;
  min-height: 0;
}
.auth-brand-panel::before {
  content: ''; position: absolute;
  width: 440px; height: 440px; border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: -130px; right: -130px; pointer-events: none;
}
.auth-brand-panel::after {
  content: ''; position: absolute;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(232,160,32,.08);
  bottom: -90px; left: -70px; pointer-events: none;
}
.auth-brand-inner { position: relative; z-index: 1; max-width: 360px; width: 100%; }

.auth-brand-logo { display: flex; align-items: center; gap: .95rem; margin-bottom: 2.5rem; }
.auth-brand-logo .abp-logo-img {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  background: #fff;
  padding: 6px;
  object-fit: contain;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.auth-brand-logo .abp-icon {
  width: 50px; height: 50px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(232,160,32,.35);
}
.auth-brand-logo .abp-text { display: flex; flex-direction: column; }
.auth-brand-logo .abp-name { font-family: 'Cairo'; font-size: 1.2rem; font-weight: 900; color: #fff; letter-spacing: .01em; }
.auth-brand-logo .abp-sub  { font-size: .72rem; font-weight: 600; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .08em; margin-top: .15rem; }

/* ── Mobile-only brand strip & footer ──────────── */
.auth-mobile-brand { display: none; }
.auth-mobile-footer { display: none; }

.auth-panel-headline {
  font-size: 1.55rem; font-weight: 800; color: #fff;
  line-height: 1.38; margin-bottom: 1.8rem;
}
.auth-panel-headline em { font-style: normal; color: var(--accent-light); }

.auth-panel-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .85rem; }
.auth-panel-features li {
  display: flex; align-items: center; gap: .8rem;
  color: rgba(255,255,255,.75); font-size: .88rem; font-weight: 500;
}
.auth-panel-features li .apf-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: .82rem;
}

/* ── Right form panel ──────────────────────────── */
.auth-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  min-height: 0;
  gap: 1rem;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 16px 42px rgba(15,23,42,.14);
  border: 1px solid #e5e7eb;
  padding: 2.5rem 2.25rem;
  width: 100%; max-width: 460px;
  animation: auth-card-in .35s cubic-bezier(.22,1,.36,1);
}
@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Auth card header */
.auth-card-header { text-align: center; margin-bottom: 1.8rem; }
.auth-card-icon {
  width: 58px; height: 58px; border-radius: 16px; margin: 0 auto .9rem;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
  box-shadow: 0 6px 18px rgba(15,32,48,.18);
}
.auth-card-icon.icon-admin {
  background: linear-gradient(135deg, #1a2332 0%, #374151 100%);
}
.auth-card-header h2 { font-size: 1.3rem; font-weight: 800; color: var(--primary); margin-bottom: .25rem; }
.auth-card-header p  { color: var(--muted); font-size: .88rem; }

.auth-trust-row {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: -.4rem 0 1rem;
}
.auth-trust-chip {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  padding: .28rem .56rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.auth-trust-chip i {
  color: var(--accent);
  font-size: .72rem;
}

/* Role tab switcher */
.tab-switcher {
  display: flex; background: var(--surface-alt);
  border-radius: var(--radius-sm); padding: 4px;
  margin-bottom: 1.5rem; gap: 3px;
}
.tab-btn {
  flex: 1; background: transparent; border: none;
  padding: .55rem .3rem; border-radius: 7px;
  font-family: inherit; cursor: pointer;
  color: var(--muted); transition: var(--ease);
  display: flex; flex-direction: column; align-items: center; gap: .22rem;
}
.tab-btn i    { font-size: .92rem; }
.tab-btn span { font-size: .74rem; font-weight: 700; letter-spacing: .01em; }
.tab-btn.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 10px rgba(30,58,95,.22);
}
.tab-btn.active i { color: var(--accent); }

/* Icon-prefixed inputs */
.input-icon-group { position: relative; display: flex; align-items: center; }
.input-icon-group > i {
  position: absolute; left: .88rem;
  color: var(--muted); font-size: .9rem; pointer-events: none; z-index: 1;
}
.input-icon-group .form-input { padding-left: 2.45rem; }

/* Auth-card inputs — bigger, more touch-friendly */
.auth-card .form-input {
  min-height: 48px;
  font-size: 1rem;
  padding-top: .75rem;
  padding-bottom: .75rem;
}
.auth-card .input-icon-group .form-input { padding-left: 2.7rem; padding-right: .9rem; }
.auth-card .input-icon-group.input-with-action .form-input { padding-right: 3rem; }

/* Show/Hide password toggle (and similar action) */
.input-toggle-btn {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  transition: var(--ease);
  z-index: 2;
}
.input-toggle-btn:hover { background: var(--surface-alt); color: var(--primary); }
.input-toggle-btn:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 1px;
}

/* Helper hint text under inputs */
.form-hint {
  display: block;
  font-size: .76rem;
  color: var(--muted);
  margin-top: .35rem;
  line-height: 1.45;
}

/* Remember-this-device toggle */
.remember-toggle {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 1rem;
  cursor: pointer;
  user-select: none;
  font-size: .85rem;
  color: var(--text);
  min-height: 36px;
}
.remember-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
.remember-toggle .rt-box {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--ease);
  color: #fff;
  font-size: .65rem;
}
.remember-toggle .rt-box i { opacity: 0; transition: opacity .12s ease; }
.remember-toggle input:checked + .rt-box {
  background: var(--primary);
  border-color: var(--primary);
}
.remember-toggle input:checked + .rt-box i { opacity: 1; }
.remember-toggle input:focus-visible + .rt-box {
  box-shadow: 0 0 0 3px rgba(37,99,168,.2);
}
.remember-toggle .rt-label { line-height: 1.3; }

/* Gold submit buttons inside auth card */
.auth-card .btn-primary.btn-full {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #1a2332 !important; font-weight: 800;
  box-shadow: 0 3px 12px rgba(232,160,32,.28);
  margin-top: .25rem;
  min-height: 50px;
  font-size: 1rem;
  padding: .85rem 1.6rem;
}
.auth-card .btn-primary.btn-full:hover:not(:disabled) {
  background: linear-gradient(135deg, #c97a08 0%, var(--accent) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232,160,32,.35);
}
.auth-card .btn-primary.btn-full:active:not(:disabled) {
  transform: translateY(0);
}

/* OTP secondary actions row (Back / Resend) */
.otp-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .9rem;
  flex-wrap: wrap;
}
.otp-secondary-actions .btn-link {
  margin-top: 0;
  font-size: .85rem;
  padding: .35rem .25rem;
}
.resend-countdown {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
  padding: .35rem .6rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.resend-countdown i { color: var(--accent); }
.resend-btn:disabled { opacity: .55; cursor: not-allowed; }

/* OTP success message */
.auth-form { display: flex; flex-direction: column; }
.auth-role-note {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .8rem;
  padding: .62rem .78rem;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: .84rem;
  font-weight: 600;
}
.auth-role-note i {
  color: var(--primary);
  font-size: .86rem;
}
.otp-sent-msg {
  display: flex; align-items: center; gap: .75rem;
  background: var(--success-bg);
  border: 1px solid rgba(22,101,52,.14);
  padding: .75rem 1rem; border-radius: var(--radius-sm);
  margin-bottom: 1.1rem; color: var(--success);
}
.otp-sent-msg i   { font-size: 1.1rem; flex-shrink: 0; }
.otp-sent-msg p   { margin: 0; font-size: .88rem; color: var(--text); }
.otp-input { font-size: 1.6rem !important; letter-spacing: 10px; text-align: center; }

/* Back / footer links */
.btn-link {
  background: none; border: none; color: var(--primary-light);
  cursor: pointer; font-size: .87rem; text-decoration: none;
  margin-top: .5rem; display: flex; align-items: center; justify-content: center; gap: .35rem;
  font-family: inherit; transition: var(--ease);
}
.btn-link:hover { color: var(--primary); text-decoration: underline; }
.admin-login-link { text-align: center; margin-top: 1.1rem; font-size: .83rem; }
.admin-login-link a {
  color: var(--muted); display: inline-flex; align-items: center; gap: .35rem;
  text-decoration: none; transition: var(--ease);
}
.admin-login-link a:hover { color: var(--primary-light); }
.auth-footer-text { text-align: center; margin-top: 1.1rem; font-size: .88rem; color: var(--muted); }

/* Responsive — hide brand panel on small screens, show mobile brand strip */
@media (max-width: 820px) {
  .auth-brand-panel { display: none; }
  .auth-page {
    background:
      radial-gradient(circle at 20% 0%, rgba(232,160,32,.18) 0, transparent 38%),
      radial-gradient(circle at 80% 100%, rgba(37,99,168,.22) 0, transparent 42%),
      linear-gradient(160deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    align-items: stretch;
    justify-content: center;
  }
  .auth-form-panel {
    width: 100%;
    padding: 1.5rem 1.25rem 1.25rem;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1rem;
  }
  .auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    justify-content: center;
    padding: .5rem 0 .25rem;
    color: #fff;
  }
  .auth-mobile-brand img {
    width: 44px; height: 44px; border-radius: 12px;
    background: #fff;
    padding: 5px;
    object-fit: contain;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
  }
  .auth-mobile-brand .amb-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
  }
  .auth-mobile-brand strong {
    font-family: 'Cairo';
    font-size: 1.05rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: .01em;
  }
  .auth-mobile-brand .amb-text span {
    font-size: .68rem;
    font-weight: 600;
    color: rgba(255,255,255,.7);
    text-transform: uppercase;
    letter-spacing: .08em;
  }
  .auth-mobile-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-size: .76rem;
    color: rgba(255,255,255,.78);
    padding: .25rem 0 .75rem;
    text-align: center;
  }
  .auth-mobile-footer i { color: var(--accent-light); font-size: .8rem; }

  .auth-card {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }
  .auth-trust-row { justify-content: center; }
}

@media (max-width: 480px) {
  .auth-form-panel { padding: 1rem 0.875rem .5rem; }
  .auth-card {
    padding: 1.5rem 1.15rem;
    max-width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15,23,42,.22);
  }
  .tab-btn { padding: .55rem .2rem; min-height: 48px; }
  .tab-btn span { font-size: .72rem; }
  .auth-card-header { margin-bottom: 1.1rem; }
  .auth-card-icon { width: 52px; height: 52px; font-size: 1.25rem; border-radius: 14px; margin-bottom: .7rem; }
  .auth-card-header h2 { font-size: 1.2rem; }
  .auth-card-header p { font-size: .82rem; }
  .auth-trust-row { gap: .3rem; }
  .auth-trust-chip { font-size: .68rem; padding: .24rem .44rem; }
  .auth-card .btn-primary.btn-full { min-height: 52px; font-size: 1.02rem; }
  .auth-card .form-input { min-height: 50px; font-size: 16px; /* iOS no zoom */ }
  .otp-input { font-size: 1.5rem !important; letter-spacing: 8px; }
  .auth-mobile-brand img { width: 40px; height: 40px; }
  .auth-mobile-brand strong { font-size: 1rem; }
  .otp-secondary-actions { gap: .5rem; }
}

/* ─── Register Page ────────────────────────────── */
.register-page { max-width: 760px; margin: 0 auto; padding: 1.5rem 0; }

/* Step progress bar */
.steps-header {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--accent);
}
.steps-track { display: flex; align-items: center; justify-content: center; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: .4rem; min-width: 80px; }

/* Step circles — pending → active (gold) → done (navy) */
.step-circle {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  border: 2px solid var(--border);
  background: var(--surface); color: var(--muted);
  transition: var(--ease);
}
.step-item.active .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(232,160,32,.22);
}
.step-item.done .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.step-label { font-size: .72rem; color: var(--muted); font-weight: 600; text-align: center; letter-spacing: .02em; text-transform: uppercase; }
.step-item.active .step-label { color: var(--accent); font-weight: 800; }
.step-item.done  .step-label  { color: var(--primary); font-weight: 700; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 .4rem 18px; transition: var(--ease); }
.step-line.done { background: var(--primary); }

/* Registration card */
.register-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--primary);
}
.step-title {
  font-size: 1.15rem; font-weight: 800; color: var(--primary);
  margin-bottom: 1.4rem; padding-bottom: .75rem;
  border-bottom: 1.5px solid var(--border);
  display: flex; align-items: center; gap: .55rem;
}
.step-title i { color: var(--accent); font-size: 1rem; }
.step-form { display: flex; flex-direction: column; }
.step-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.4rem; }

/* Role selector cards */
.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.role-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: var(--ease);
  text-align: center;
  background: var(--surface);
}
.role-card:hover {
  border-color: var(--accent);
  background: #fffbf0;
  box-shadow: var(--shadow-sm);
}
.role-card.selected {
  border-color: var(--accent);
  background: #fff8e6;
  box-shadow: 0 0 0 3px rgba(232,160,32,.2);
}
.role-icon {
  font-size: 2rem; display: block; margin-bottom: .6rem;
  color: var(--muted); transition: var(--ease);
}
.role-card:hover .role-icon,
.role-card.selected .role-icon { color: var(--accent); }
.role-card strong { display: block; color: var(--primary); font-size: .95rem; font-weight: 800; margin-bottom: .25rem; }
.role-card p { color: var(--muted); font-size: .8rem; margin: 0; }

.registration-fee-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .95rem 1rem;
  border: 1px solid rgba(232,160,32,.35);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fffaf0 0%, #fff 100%);
  box-shadow: 0 10px 28px rgba(43,74,109,.06);
}
.registration-fee-card.compact { padding: .85rem .95rem; }
.registration-fee-card.fallback {
  border-color: rgba(245,158,11,.45);
  background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}
.registration-fee-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #b45309;
  background: rgba(245,158,11,.16);
}
.registration-fee-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .12rem;
}
.registration-fee-label {
  font-size: .76rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .055em;
}
.registration-fee-main strong {
  color: var(--primary);
  font-size: 1.25rem;
  line-height: 1.15;
}
.registration-fee-main small {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}

/* Community read-only label */
.fixed-community-label {
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface-alt); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: .65rem 1rem;
  font-size: .92rem; font-weight: 600; color: var(--primary);
}
.fixed-community-label i { color: var(--accent); font-size: 1rem; }
.community-autocomplete { position: relative; overflow: visible; }
.community-autocomplete .form-input { width: 100%; }
.community-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 2000;
  background: var(--surface); border: 1.5px solid var(--border);
  border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 220px; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.community-option {
  padding: .6rem 1rem; font-size: .9rem; cursor: pointer;
  color: var(--text); display: flex; align-items: center; gap: .5rem;
  transition: background .12s;
}
.community-option:hover { background: var(--surface-alt); color: var(--primary); }
.community-option i { color: var(--accent); font-size: .85rem; }
.community-selected-badge {
  margin-top: .45rem; display: inline-flex; align-items: center; gap: .4rem;
  background: var(--success-bg); color: var(--success);
  border-radius: var(--radius-sm); padding: .35rem .75rem;
  font-size: .85rem; font-weight: 600;
}

/* Public payment return/status screen */
.payment-status-page {
  min-height: calc(100dvh - 110px);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at 16% 18%, rgba(232,160,32,.14), transparent 32%),
    linear-gradient(135deg, #f8fafc 0%, #fff7e6 100%);
}
.payment-status-card {
  width: min(100%, 520px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 2.25rem;
  text-align: center;
  box-shadow: 0 18px 45px rgba(15,23,42,.12);
}
.payment-status-icon {
  width: 72px;
  height: 72px;
  display: inline-grid;
  place-items: center;
  border-radius: 22px;
  margin-bottom: 1rem;
  font-size: 2rem;
  background: #fff7e6;
  color: #d4870b;
}
.payment-status-paid .payment-status-icon {
  background: #ecfdf5;
  color: #16a34a;
}
.payment-status-pending .payment-status-icon {
  background: #eff6ff;
  color: #2563eb;
}
.payment-status-error .payment-status-icon {
  background: #fef2f2;
  color: #dc2626;
}
.payment-status-card h1 {
  margin: 0 0 .55rem;
  color: #172033;
  font-size: 1.55rem;
  font-weight: 900;
}
.payment-status-card p {
  color: #5f6b7a;
  line-height: 1.7;
  margin: 0 auto 1.35rem;
}
.payment-status-actions {
  display: flex;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .payment-status-card { padding: 1.5rem; border-radius: 18px; }
  .payment-status-card h1 { font-size: 1.25rem; }
  .payment-status-actions .btn-primary,
  .payment-status-actions .btn-secondary { width: 100%; justify-content: center; }
}
.fixed-community-id {
  margin-left: auto; font-size: .73rem; font-weight: 600;
  color: var(--muted); background: var(--surface);
  padding: .18rem .6rem; border-radius: 20px;
  border: 1px solid var(--border);
}

/* File upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  text-align: center;
  background: var(--surface-alt);
  transition: var(--ease);
  cursor: pointer;
}
.upload-zone.has-file,
.upload-zone:hover { border-color: var(--accent); background: #fffdf7; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: .45rem; }
.upload-icon {
  font-size: 2.4rem; color: var(--accent);
  margin-bottom: .25rem; display: block;
}
.upload-placeholder p { color: var(--muted); font-size: .88rem; margin: 0; }
.upload-placeholder small { color: var(--muted); font-size: .78rem; }
.file-input { display: none; }
.file-input-hidden { display: none; }
.file-drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface-alt); transition: var(--ease); }
.file-drop-zone.file-drop-error { border-color: var(--danger); }
.file-drop-label { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.5rem 1rem; cursor: pointer; text-align: center; color: var(--muted); font-size: .88rem; }
.file-drop-label:hover { color: var(--accent); }
.file-drop-label small { font-size: .75rem; }
/* Upload progress bar */
.up-progress { width: 80%; background: #e5e7eb; border-radius: 99px; height: 6px; margin: 8px auto 0; overflow: hidden; }
.up-progress-fill { background: var(--primary, #3b82f6); height: 100%; border-radius: 99px; transition: width 0.08s linear; }
.up-progress-label { display: block; text-align: center; color: var(--muted); font-size: .75rem; margin-top: 4px; padding-bottom: .5rem; }
.upload-preview-shell {
  width: 100%;
  height: 220px;
  min-height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, .32);
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
  animation: uploadPreviewIn .18s ease-out both;
}
.upload-preview-shell--sm {
  width: 100%;
  height: 170px;
  min-height: 170px;
  padding: 0;
}
.upload-preview-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(16px) brightness(.55) saturate(1.3);
  transform: scale(1.12);
  z-index: 0;
  pointer-events: none;
  border-radius: 0;
}
.upload-preview-image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transform: scaleX(1.13);
  display: block;
  border-radius: 0;
  background: transparent;
  transition: opacity .18s ease, transform .18s ease;
}
.upload-preview-caption {
  display: block;
  width: 100%;
  text-align: center;
  padding: .32rem .7rem;
  font-size: .72rem;
  color: var(--muted);
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-progress,
.up-progress {
  width: min(86%, 320px);
  background: #e5e7eb;
  border-radius: 99px;
  height: 7px;
  margin: 10px auto 0;
  overflow: hidden;
}
.upload-progress-fill,
.up-progress-fill {
  background: linear-gradient(90deg, var(--accent, #d8911f), var(--primary, #1f3a5f));
  height: 100%;
  border-radius: 99px;
  transition: width .12s ease-out;
}
.upload-progress-label,
.up-progress-label {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: .75rem;
  margin-top: 5px;
  padding-bottom: .55rem;
}
.upload-state-success,
.upload-state-error {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: 100%;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.35;
}
.upload-state-success { color: var(--success); }
.upload-state-error { color: var(--danger); }
.file-drop-zone:has(.upload-preview-shell) {
  padding: 0 !important;
  border-style: solid;
  background: var(--surface);
}
@keyframes uploadPreviewIn {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}
@media (max-width: 480px) {
  .upload-preview-shell { width: 100%; height: 200px; min-height: 200px; }
  .upload-preview-shell--sm { width: 100%; height: 155px; min-height: 155px; }
  .upload-preview-caption { font-size: .7rem; padding: .3rem .55rem; }
}
/* ── Image previews in upload cards ───────────────────────────────────────── */

/* Document thumbnail (identity doc, auth letter) */
.upload-preview-img {
    max-width: 100%;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: .5rem auto;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/*
 * Fixed-height centering wrapper — the ONLY element that sets height.
 * The <img> inside scales freely within these bounds; no cropping for
 * any aspect ratio (landscape / portrait / square / transparent PNG).
 */
.photo-preview-box {
    width: 100%;
    height: 200px;                    /* consistent card height for all images */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;             /* neutral fill for empty space around image */
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
}
/* Smaller variant for compact cards (additional-tenant rows) */
.photo-preview-box--sm {
    height: 140px;
    padding: 6px;
}

/* The image — never stretched, never cropped, always centered */
.photo-preview-thumb {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center center;
    display: block;
    border-radius: 4px;
    /* smooth transition when swapping images */
    transition: opacity .15s ease;
}

/* ── Preview-active state: label becomes a plain flex column, no padding, no clipping radius ── */
.file-drop-label.has-preview {
    padding: 0;
    gap: 0;
    overflow: visible;          /* let the box fill the zone without being clipped */
    border-radius: 0;           /* zone itself provides radius; no double-rounding */
}
.file-drop-label.has-preview small {
    display: block;
    width: 100%;
    text-align: center;
    padding: .35rem .5rem;
    font-size: .78rem;
    color: var(--muted);
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
}
.file-drop-label.has-preview:hover small { color: var(--accent); }

/* When a photo-preview-box is rendered inside a file-drop-zone,
   kill the zone's own padding so the image fills edge-to-edge. */
.file-drop-zone:has(.photo-preview-box) {
    padding: 0 !important;
    border-style: solid;        /* swap dashed → solid for cleaner photo frame */
}

/* Ensure the preview box fills 100% of whatever zone it's in */
.photo-preview-box,
.photo-preview-box--sm {
    width: 100%;
}

/* Compact label used in additional-tenant grid rows (no preview active) */
.file-drop-label[style*="gap:.3rem"]:not(.has-preview) {
    padding: .75rem .5rem;
}
.btn-upload-label {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #1a2332 !important;
  padding: .45rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 700; font-size: .85rem;
  transition: var(--ease); letter-spacing: .01em;
  display: inline-flex; align-items: center; gap: .35rem;
}
.btn-upload-label:hover { background: linear-gradient(135deg, #c97a08 0%, var(--accent) 100%); }
.file-preview { display: flex; align-items: center; gap: 1rem; justify-content: center; font-size: .9rem; }
.file-preview-icon { font-size: 1.6rem; color: var(--primary-light); flex-shrink: 0; }
.file-preview strong { display: block; color: var(--primary); }
.file-preview small { color: var(--muted); font-size: .78rem; }
.btn-remove-file {
  background: var(--danger-bg); color: var(--danger);
  border: none; width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--ease); flex-shrink: 0;
}
.btn-remove-file:hover { background: var(--danger); color: #fff; }

.checkbox-label { display: flex; align-items: center; gap: .65rem; cursor: pointer; font-size: .9rem; }

/* ─── Status / Dashboard ───────────────────────── */
.status-page { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.status-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0;
  max-width: 520px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.status-card-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--accent) 60%, var(--accent-light) 100%);
}
.status-card-body { padding: 2.5rem 2.5rem 2rem; }
.status-icon {
  display: flex; align-items: center; justify-content: center;
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 24px rgba(15,32,48,.2);
}
.status-icon i { font-size: 2.2rem; color: #fff; }
.status-card h1 { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; }
.status-card p  { color: var(--muted); margin-bottom: .5rem; line-height: 1.7; }
.status-steps { display: flex; flex-direction: column; gap: .65rem; margin: 1.4rem 0 2rem; text-align: left; }
.status-step {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1rem; border-radius: var(--radius-sm); font-size: .88rem;
}
.status-step i { font-size: .95rem; flex-shrink: 0; width: 16px; text-align: center; }
.status-step.done    { background: var(--success-bg); color: var(--success); }
.status-step.active  { background: #fff8e1; color: #92400e; font-weight: 700; }
.status-step.pending { background: var(--surface-alt); color: var(--muted); }

.dashboard-page { max-width: 960px; margin: 0 auto; }
.dashboard-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.dashboard-header h1 { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.dashboard-header h1 span { color: var(--primary-light); }

.role-badge {
  padding: .3rem 1rem; border-radius: 20px; font-size: .78rem;
  font-weight: 700; display: inline-flex; align-items: center; gap: .35rem;
}
.role-badge.broker      { background: #dbeafe; color: #1e40af; }
.role-badge.coordinator { background: #f3e8ff; color: #7c3aed; }

.status-banner { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem; border-radius: var(--radius); margin-bottom: 1.8rem; }
.status-banner-icon {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; background: rgba(0,0,0,.07);
}
.status-banner h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: .25rem; }
.status-banner p  { font-size: .88rem; line-height: 1.6; }
.status-pending   { background: var(--warn-bg);    color: var(--warn); }
.status-approved  { background: var(--success-bg); color: var(--success); }
.status-rejected  { background: var(--danger-bg);  color: var(--danger); }
.status-suspended { background: #fffbeb;           color: #92400e; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.info-card { background: var(--surface); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm); }
.info-card h3 { font-size: .95rem; font-weight: 700; color: var(--primary); margin-bottom: .9rem; }
dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem .75rem; align-items: baseline; }
dt { font-size: .78rem; color: var(--muted); font-weight: 600; }
dd { font-size: .88rem; color: var(--text); }

/* ─── Owner Dashboard ──────────────────────────── */

/* Hero welcome banner */
.owner-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1c3d6e 58%, var(--primary-light) 100%);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  margin-bottom: .25rem;
  position: relative; overflow: hidden;
}
.owner-hero::before {
  content: ''; position: absolute;
  width: 320px; height: 320px; border-radius: 50%;
  background: rgba(232,160,32,.07);
  right: -70px; top: -100px; pointer-events: none;
}
.owner-hero::after {
  content: ''; position: absolute;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.04);
  left: -40px; bottom: -60px; pointer-events: none;
}
.owner-hero-left { position: relative; z-index: 1; }
.owner-hero-eyebrow {
  font-size: .7rem; font-weight: 700; color: var(--accent-light);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: .35rem;
  display: flex; align-items: center; gap: .4rem;
}
.owner-hero h1 {
  font-size: 1.65rem; font-weight: 900; color: #fff;
  margin: 0 0 .3rem; line-height: 1.2;
}
.owner-hero h1 span { color: var(--accent-light); }
.owner-hero-sub {
  font-size: .86rem; color: rgba(255,255,255,.6); margin: 0;
  display: flex; align-items: center; gap: .35rem;
}
.owner-hero-stats {
  display: flex; gap: .75rem; flex-wrap: wrap; position: relative; z-index: 1;
}
.owner-stat {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--radius-sm);
  padding: .8rem 1.1rem;
  text-align: center; min-width: 78px;
  backdrop-filter: blur(4px);
}
.owner-stat-value {
  font-size: 1.6rem; font-weight: 900; color: var(--accent-light); line-height: 1;
}
.owner-stat-label {
  font-size: .67rem; font-weight: 700; color: rgba(255,255,255,.5);
  text-transform: uppercase; letter-spacing: .07em; margin-top: .28rem;
}

/* Section headings */
.owner-section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
  margin-top: 2rem; margin-bottom: .85rem;
  padding-bottom: .65rem;
  border-bottom: 1.5px solid var(--border);
}
.owner-section-hdr h2 {
  margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--primary);
  display: flex; align-items: center; gap: .5rem;
}
.owner-section-hdr h2 i { color: var(--accent); font-size: .95rem; }
.hdr-badge {
  font-size: .72rem; font-weight: 700;
  background: var(--surface-alt); border: 1px solid var(--border);
  color: var(--muted); padding: .2rem .65rem; border-radius: 20px;
}
.owner-section-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* Unit grid & cards */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 1rem;
}
.unit-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: var(--ease);
}
.unit-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.unit-card-accent { height: 3px; }
.unit-card-accent.occupied { background: linear-gradient(90deg, var(--success) 0%, #22c55e 100%); }
.unit-card-accent.vacant   { background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%); }
.unit-card-body { padding: 1.1rem 1.2rem 1.2rem; }
.unit-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: .75rem;
}
.unit-card-title {
  font-size: 1rem; font-weight: 800; color: var(--primary);
  display: flex; align-items: center; gap: .4rem;
}
.unit-card-title i { color: var(--accent); font-size: .9rem; }
.unit-card-meta { display: flex; flex-direction: column; gap: .32rem; margin-bottom: .75rem; }
.unit-meta-row {
  display: flex; align-items: center; gap: .45rem;
  font-size: .83rem; color: var(--muted);
}
.unit-meta-row i { width: 14px; color: var(--accent); font-size: .79rem; flex-shrink: 0; text-align: center; }
.unit-meta-row span { color: var(--text); }
.unit-card-footer { padding-top: .75rem; border-top: 1px solid var(--border); }

/* Brokers inside unit card */
.unit-brokers {
  margin-top: .75rem;
  padding-top: .65rem;
  border-top: 1px solid var(--border);
}
.unit-brokers-label {
  display: flex; align-items: center; gap: .35rem;
  font-size: .74rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: .45rem;
}
.unit-brokers-label i { color: var(--accent); font-size: .72rem; }
.unit-brokers-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.unit-broker-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .65rem .28rem .35rem;
  background: var(--surface-2, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .8rem; color: var(--text);
  white-space: nowrap;
}
.unit-broker-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .65rem; flex-shrink: 0;
}
.unit-broker-name { font-weight: 500; }
.unit-brokers-empty { font-size: .8rem; color: var(--muted); font-style: italic; }

/* Broker assignment cards */
.broker-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.2rem 1.35rem;
  margin-bottom: .85rem; transition: var(--ease);
}
.broker-card:hover { box-shadow: var(--shadow-md); }
.broker-card-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 1rem; flex-wrap: wrap;
}
.broker-card-left { display: flex; align-items: flex-start; gap: .85rem; }
.broker-avatar {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .95rem;
  box-shadow: 0 3px 10px rgba(30,58,95,.18);
}
.broker-info h3 { margin: 0 0 .2rem; font-size: .95rem; font-weight: 700; color: var(--primary); }
.broker-info-row {
  display: flex; align-items: center; gap: .38rem;
  font-size: .81rem; color: var(--muted); margin-top: .16rem;
}
.broker-info-row i { font-size: .75rem; width: 13px; color: var(--accent); flex-shrink: 0; }
.broker-card-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex-shrink: 0;
}
.broker-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .95rem; padding-top: .85rem;
  border-top: 1px solid var(--border); flex-wrap: wrap; gap: .5rem;
}
.broker-notes {
  font-size: .82rem; color: var(--muted);
  display: flex; align-items: center; gap: .38rem; margin-top: .7rem;
}
.broker-notes i { color: var(--accent); font-size: .8rem; }

/* Assignment history cards */
.history-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1rem 1.2rem;
  margin-bottom: .65rem;
  border-left: 3px solid var(--border);
  transition: var(--ease);
}
.history-card.is-active  { border-left-color: var(--success); }
.history-card.is-revoked { border-left-color: var(--danger); }

/* Gold action button */
.btn-gold {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #1a2332 !important; border: none;
  padding: .55rem 1.2rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: var(--ease);
  display: inline-flex; align-items: center; gap: .4rem;
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(232,160,32,.22);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, #c97a08 0%, var(--accent) 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(232,160,32,.32);
  text-decoration: none; color: #1a2332 !important;
}

/* ─── Broker / Coordinator Dashboard ───────────── */

/* Non-approved status page */
.broker-status-page {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1rem;
}
.broker-status-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem; font-size: 1.9rem;
}
.broker-status-icon.pending  { background: var(--warn-bg);    color: var(--warn); }
.broker-status-icon.rejected { background: var(--danger-bg);  color: var(--danger); }
.broker-status-icon.payment  { background: #eff6ff;           color: var(--primary-light); }

/* Profile info cards (2-col grid) */
.broker-profile-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
  margin-bottom: .5rem;
}
.broker-profile-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.bpc-header {
  display: flex; align-items: center; gap: .85rem;
  padding: 1rem 1.2rem .85rem;
  border-bottom: 1.5px solid var(--border);
  background: var(--surface-alt);
}
.bpc-icon {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.bpc-icon.navy   { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%); color: #fff; }
.bpc-icon.gold   { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);        color: var(--primary-dark); }
.bpc-header-text h3  { font-size: .9rem; font-weight: 800; color: var(--primary); margin: 0 0 .1rem; }
.bpc-header-text span { font-size: .73rem; color: var(--muted); }
.bpc-rows { padding: .8rem 1.2rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; }
.bpc-row  { display: flex; align-items: baseline; gap: .55rem; }
.bpc-label {
  font-size: .73rem; font-weight: 700; color: var(--muted);
  display: inline-flex; align-items: center; gap: .28rem;
  flex-shrink: 0; min-width: 96px;
}
.bpc-label i { color: var(--accent); font-size: .7rem; }
.bpc-value   { font-size: .875rem; color: var(--text); font-weight: 500; word-break: break-all; }

/* Assigned unit cards (broker view) */
.assigned-unit-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  margin-bottom: .85rem; transition: var(--ease);
}
.assigned-unit-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.auc-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary-light) 100%);
}
.auc-body { padding: 1.1rem 1.25rem; }
.auc-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem;
}
.auc-title {
  font-size: 1rem; font-weight: 800; color: var(--primary);
  display: flex; align-items: center; gap: .45rem;
}
.auc-title i { color: var(--accent); }
.auc-meta { display: flex; flex-direction: column; gap: .3rem; }
.auc-meta-row {
  display: flex; align-items: center; gap: .45rem;
  font-size: .83rem; color: var(--muted);
}
.auc-meta-row i { width: 14px; color: var(--accent); font-size: .79rem; text-align: center; flex-shrink: 0; }
.auc-meta-row span { color: var(--text); }
.auc-footer {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .6rem;
  margin-top: .9rem; padding-top: .85rem; border-top: 1px solid var(--border);
}
.auc-owner { display: flex; flex-direction: column; gap: .22rem; }
.auc-owner-name {
  font-size: .85rem; font-weight: 700; color: var(--primary);
  display: flex; align-items: center; gap: .35rem;
}
.auc-owner-name i { color: var(--accent); font-size: .8rem; }
.auc-owner-email {
  font-size: .8rem; color: var(--muted);
  display: flex; align-items: center; gap: .3rem;
}
.auc-owner-email i { font-size: .75rem; color: var(--muted); }

/* Quick-actions bar */
.broker-actions-bar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: var(--surface); border-radius: var(--radius);
  padding: 1rem 1.25rem; box-shadow: var(--shadow-sm);
  margin-top: 1.75rem; margin-bottom: .25rem;
  border-left: 3px solid var(--accent);
}
.broker-actions-label {
  font-size: .78rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; flex-shrink: 0;
}

@media (max-width: 640px) {
  .broker-profile-grid { grid-template-columns: 1fr; }
}

/* ─── Home Page ────────────────────────────────── */
.home-page { max-width: 960px; margin: 0 auto; }
.hero-section { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%); border-radius: var(--radius); padding: 4rem 2rem; text-align: center; color: #fff; margin-bottom: 1.8rem; }
.hero-icon { font-size: 3.5rem; display: block; margin-bottom: .9rem; }
.hero-section h1 { font-size: 2.4rem; font-weight: 900; margin-bottom: .5rem; }
.hero-subtitle { font-size: 1.1rem; color: var(--accent-light); font-weight: 600; margin-bottom: .9rem; }
.hero-desc { font-size: .95rem; opacity: .8; line-height: 1.8; max-width: 500px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.features-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.feature-card { background: var(--surface); border-radius: var(--radius); padding: 1.8rem; text-align: center; box-shadow: var(--shadow-sm); transition: var(--ease); }
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feature-card span { font-size: 2.2rem; display: block; margin-bottom: .65rem; }
.feature-card h3 { font-size: .95rem; font-weight: 700; color: var(--primary); margin-bottom: .4rem; }
.feature-card p  { color: var(--muted); font-size: .84rem; line-height: 1.6; }

/* ─── Admin Shell (sidebar layout) ─────────────── */
/* On admin pages we hide the global site header / footer so the admin shell
   gets the full viewport. The admin shell has its own sidebar + topbar that
   serves the same purpose. */
body:has(.admin-shell) .site-header,
body:has(.admin-shell) .site-footer { display: none; }
body:has(.admin-shell) .layout-wrapper,
body:has(.admin-shell) .site-main { min-height: 100dvh; }

.site-main:has(.admin-shell) { padding: 0; }
.admin-shell { display: flex; min-height: 100dvh; position: relative; }

/* Mobile sidebar backdrop — only visible on small screens when drawer is open */
.admin-shell-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 95;
  animation: admin-backdrop-in .2s ease;
}
@keyframes admin-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

/* ─── Admin Top Bar (above main content) ───────── */
.admin-topbar {
  position: sticky;
  top: 0;        /* admin shell is full-viewport; no site header above us */
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
  margin: -1.75rem -2rem 1.5rem;  /* offset .admin-content's own padding */
  min-height: 64px;
}

.admin-topbar-hamburger {
  display: none;     /* hidden on desktop, shown on mobile via media query */
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--ease);
}
.admin-topbar-hamburger:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.admin-topbar-spacer { flex: 1; }

/* User block (right side of topbar) */
.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.admin-topbar-user .atu-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .95rem;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(37, 99, 235, .25);
}
.admin-topbar-user .atu-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: right;
  min-width: 0;
}
.admin-topbar-user .atu-name {
  font-weight: 800; font-size: .92rem; color: var(--text);
  white-space: nowrap;
}
.admin-topbar-user .atu-meta {
  display: flex; align-items: center; gap: .45rem;
  margin-top: .25rem;
}
.admin-topbar-user .atu-role {
  font-size: .65rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.admin-topbar-user .atu-community {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: rgba(232,160,32,.16);
  border: 1px solid rgba(232,160,32,.38);
  color: #c97a08;
  font-size: .68rem; font-weight: 700;
  max-width: 180px;
  overflow: hidden;
}
.admin-topbar-user .atu-community i { font-size: .6rem; }
.admin-topbar-user .atu-community span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-topbar-user .atu-community-none {
  background: rgba(220,38,38,.14);
  border-color: rgba(220,38,38,.32);
  color: #b91c1c;
}

/* Sign-out icon button on the right of the topbar */
.atu-signout {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--danger);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  transition: var(--ease);
  margin-left: .35rem;
}
.atu-signout:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* ═══════════════════════════════════════════════
   Enterprise Sidebar
   ═══════════════════════════════════════════════ */
.sb-sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--primary-dark);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  height: 100dvh;
  z-index: 99;
  overflow: hidden;     /* container clips; .sb-nav handles its own scroll */
  border-right: 1px solid rgba(255,255,255,.06);
}
.sb-sidebar::-webkit-scrollbar { width: 4px; }
.sb-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

/* ── Brand ───────────────────────────────────── */
.sb-brand {
  display: flex; align-items: center; gap: .9rem;
  padding: 1.35rem 1.25rem 1.2rem;
  background: linear-gradient(180deg, rgba(255,255,255,.07) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sb-logo {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(232,160,32,.35);
}

.sb-brand-name {
  font-family: 'Cairo';
  font-size: .95rem; font-weight: 900; color: #fff;
  letter-spacing: .01em; line-height: 1.2;
}
.sb-brand-env {
  display: flex; align-items: center; gap: .4rem;
  font-size: .68rem; color: rgba(255,255,255,.45); font-weight: 500;
  margin-top: .2rem; text-transform: uppercase; letter-spacing: .06em;
}
.sb-env-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,.7);
  flex-shrink: 0;
}

/* ── Navigation ──────────────────────────────── */
.sb-nav {
  flex: 1; min-height: 0; padding: .65rem 0 1.25rem;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.sb-group-label {
  font-size: .62rem; font-weight: 800; letter-spacing: .1em;
  color: rgba(255,255,255,.28); text-transform: uppercase;
  padding: 1.1rem 1.25rem .35rem;
  flex-shrink: 0;
}
.sb-group-label:first-child { padding-top: .6rem; }

/* Super Admin group — purple tint to set it apart from regular admin tools */
.sb-group-label-super {
  color: #c4b5fd;
  border-top: 1px dashed rgba(168,85,247,.3);
  margin-top: .5rem;
}

/* Locked nav item — shown to all admins but disabled for non-super admins. */
.sb-item.sb-item-locked {
  cursor: not-allowed;
  opacity: .42;
}
.sb-item.sb-item-locked:hover {
  background: transparent;
  color: rgba(255,255,255,.6);
}
.sb-item.sb-item-locked:hover .sb-item-icon {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.5);
}
.sb-item-lock-icon {
  margin-left: auto;
  font-size: .68rem;
  color: rgba(255,255,255,.4);
  flex-shrink: 0;
}

/* ── Nav Item ────────────────────────────────── */
.sb-item {
  display: flex; align-items: center; gap: .75rem;
  width: 100%; padding: .6rem 1rem .6rem 1.1rem;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.6); font-family: inherit;
  font-size: .845rem; font-weight: 500;
  text-align: left; text-decoration: none;
  transition: all .15s ease;
  position: relative; border-radius: 0;
  margin: 1px 0; flex-shrink: 0;
}
a.sb-item { text-decoration: none; }

.sb-item-icon {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.5);
  transition: all .15s ease;
}
.sb-item-text { flex: 1; line-height: 1.2; }

/* Hover */
.sb-item:hover {
  color: #fff; background: rgba(255,255,255,.06);
  text-decoration: none;
}
.sb-item:hover .sb-item-icon {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
}

/* Active */
.sb-item.active {
  color: #fff; font-weight: 700;
  background: rgba(232,160,32,.12);
}
.sb-item.active::before {
  content: "";
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.sb-item.active .sb-item-icon {
  background: rgba(232,160,32,.2);
  color: var(--accent-light);
}

/* External link icon */
.sb-ext-icon {
  font-size: .58rem; color: rgba(255,255,255,.25);
  margin-left: auto; flex-shrink: 0;
  transition: all .15s ease;
}
.sb-item:hover .sb-ext-icon { color: rgba(255,255,255,.5); }

/* ── Badges ──────────────────────────────────── */
.sb-badge {
  margin-left: auto; flex-shrink: 0;
  background: #ef4444; color: #fff;
  border-radius: 20px; font-size: .65rem; font-weight: 800;
  padding: .15rem .5rem; min-width: 20px; text-align: center;
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(239,68,68,.4);
  animation: sb-pulse 2s ease infinite;
}
.sb-count {
  margin-left: auto; flex-shrink: 0;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.6);
  border-radius: 20px; font-size: .65rem; font-weight: 700;
  padding: .15rem .5rem; min-width: 20px; text-align: center;
  line-height: 1.3;
}
.sb-item.active .sb-count {
  background: rgba(232,160,32,.2); color: var(--accent-light);
}

@keyframes sb-pulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(239,68,68,.4); }
  50%       { box-shadow: 0 2px 10px rgba(239,68,68,.7); }
}

/* ── Divider ─────────────────────────────────── */
.sb-divider {
  border: none; border-top: 1px solid rgba(255,255,255,.07);
  margin: .5rem 1.25rem;
}

/* ── User Footer ─────────────────────────────── */
.sb-user {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.15);
  flex-shrink: 0;
}

.sb-avatar {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-light) 0%, #3b82f6 100%);
  color: #fff; font-size: .75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .03em;
  box-shadow: 0 2px 8px rgba(37,99,168,.4);
}

.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name {
  font-size: .8rem; font-weight: 700; color: rgba(255,255,255,.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-user-role {
  font-size: .67rem; color: rgba(255,255,255,.38);
  font-weight: 500; margin-top: .1rem;
  text-transform: uppercase; letter-spacing: .05em;
}

.sb-user-community {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .35rem;
  padding: .18rem .5rem;
  border-radius: 999px;
  background: rgba(232,160,32,.18);
  border: 1px solid rgba(232,160,32,.38);
  color: #f8d28b;
  font-size: .68rem; font-weight: 700;
  max-width: 100%;
  overflow: hidden;
}
.sb-user-community i { font-size: .62rem; }
.sb-user-community span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-user-community-none {
  background: rgba(220,38,38,.18);
  border-color: rgba(220,38,38,.4);
  color: #fca5a5;
}

.sb-logout-btn {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.35); font-size: .8rem;
  background: rgba(255,255,255,.05);
  text-decoration: none; transition: all .15s ease;
  border: 1px solid rgba(255,255,255,.07);
}
.sb-logout-btn:hover {
  background: rgba(239,68,68,.2);
  color: #fca5a5; border-color: rgba(239,68,68,.3);
  text-decoration: none;
}

/* ─────────────────────────────────────────────── */
.admin-content { flex: 1; padding: 1.75rem 2rem; min-width: 0; margin-left: 248px; min-height: 100dvh; background: var(--surface-alt); }
/* ph-toolbar inside admin-shell has no site-header above it, so sticky top must be 0 not 60px */
.admin-content .ph-toolbar { top: 0; }
.content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; flex-wrap: wrap; gap: .75rem; }
.content-header h1 { font-size: 1.35rem; font-weight: 800; color: var(--primary); margin: 0; }

/* Enterprise User Management (Admins) */
.umx-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2030 55%, #1c2d4a 100%);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.umx-hero::before {
  content: "";
  position: absolute;
  top: -52px;
  right: -28px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,164,76,.22) 0%, transparent 65%);
  pointer-events: none;
}
.umx-hero::after {
  content: "";
  position: absolute;
  bottom: -42px;
  left: 35%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,.12) 0%, transparent 65%);
  pointer-events: none;
}
.umx-hero-left {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  position: relative;
  z-index: 1;
}
.umx-hero-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(212,164,76,.22);
  color: #f8d28b;
  border: 1px solid rgba(212,164,76,.42);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.umx-sub {
  font-size: .8rem;
  color: rgba(255,255,255,.75);
  margin-top: .1rem;
}
.umx-hero h1,
.umx-kpi-value {
  font-family: 'Cairo';
}
.umx-hero h1 { color: #fff; }
.umx-add-btn {
  background: linear-gradient(135deg, #d4870b 0%, #f1b539 100%);
  color: #111827;
  border: 1px solid rgba(212, 135, 11, .32);
  border-radius: 10px;
  padding: .56rem .95rem;
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  font-size: .86rem;
  font-weight: 800;
}
.umx-add-btn:hover { filter: brightness(.97); transform: translateY(-1px); }
.umx-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-bottom: 1rem;
}
.umx-kpi-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: .78rem .82rem;
  display: flex;
  align-items: center;
  gap: .62rem;
}
.umx-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff7e8;
  color: #c77808;
  border: 1px solid #f6d7a5;
}
.umx-kpi-value {
  font-size: 1rem;
  font-weight: 800;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.umx-kpi-label {
  font-size: .74rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: .08rem;
}
.umx-table-wrap {
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}
.umx-table thead tr {
  background: linear-gradient(120deg, #374151 0%, #4b5563 60%, #d4870b 160%);
}
.umx-table th {
  font-size: .76rem;
  letter-spacing: .03em;
}
.umx-table th i {
  color: #f8d28b;
  margin-right: .28rem;
}
.umx-btn-delete {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
  border-radius: 8px;
  padding: .28rem .58rem;
  font-size: .76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.umx-btn-delete:hover { background: #ffe4e6; }
.umx-current-badge {
  border: 1px solid #bbf7d0;
  background: #ecfdf3;
  color: #166534;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  padding: .21rem .52rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.umx-mobile-list {
  display: none;
  margin-top: .8rem;
  gap: .55rem;
}
.umx-mobile-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: .8rem .85rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .04);
}
.umx-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .45rem;
}
.umx-mobile-card p {
  font-size: .82rem;
  color: #4b5563;
  margin-bottom: .35rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.umx-mobile-card .umx-btn-delete { margin-top: .3rem; }

@media (max-width: 980px) {
  .umx-kpis { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .umx-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
  }
  .umx-kpis { grid-template-columns: 1fr; }
  .umx-table-wrap { display: none; }
  .umx-mobile-list {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* ─── Admin ────────────────────────────────────── */
.admin-page { max-width: 1280px; margin: 0 auto; }
.admin-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }
.admin-page-header h1 { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.admin-badge { background: var(--primary); color: #fff; padding: .28rem .85rem; border-radius: 20px; font-size: .78rem; font-weight: 700; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.3rem; }
.admin-accounts-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 1rem; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1.4rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .25rem; border-left: 4px solid transparent; transition: var(--ease); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-num { font-size: 2rem; font-weight: 900; line-height: 1; }
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.pending-stat  { border-color: var(--warn);         } .pending-stat .stat-num  { color: var(--warn); }
.approved-stat { border-color: var(--success);      } .approved-stat .stat-num { color: var(--success); }
.rejected-stat { border-color: var(--danger);       } .rejected-stat .stat-num { color: var(--danger); }
.total-stat    { border-color: var(--primary-light); } .total-stat .stat-num    { color: var(--primary-light); }

.filter-bar { background: var(--surface); border-radius: var(--radius); padding: .9rem 1.3rem; display: flex; align-items: center; gap: .9rem; margin-bottom: 1.1rem; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.search-box { flex: 1; min-width: 220px; }
.search-input { width: 100%; padding: .55rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: .88rem; }
.search-input:focus { outline: none; border-color: var(--primary-light); }
.filter-select { padding: .55rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: .88rem; background: var(--surface); min-width: 130px; }
.btn-reset-filters { background: transparent; border: 1.5px solid var(--border); color: var(--muted); padding: .5rem .9rem; border-radius: var(--radius-sm); font-family: inherit; font-size: .84rem; cursor: pointer; transition: var(--ease); white-space: nowrap; }
.btn-reset-filters:hover { border-color: var(--primary-light); color: var(--primary-light); }

.table-wrapper {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.1rem;
}
.admin-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: .86rem; }
.admin-table thead tr { background: var(--primary); }
.admin-table th { padding: .75rem 1rem; font-weight: 700; text-align: left; color: #fff; font-size: .82rem; white-space: nowrap; }
.admin-table tbody tr { border-bottom: 1px solid var(--surface-alt); transition: var(--ease); }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: #f8faff; }
.admin-table td { padding: .75rem 1rem; vertical-align: middle; }
.row-approved { background: rgba(22,101,52,.03) !important; }
.row-rejected { background: rgba(153,27,27,.03) !important; }

.status-badge { padding: .22rem .65rem; border-radius: 20px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.status-badge.pending  { background: var(--warn-bg);    color: var(--warn); }
.status-badge.approved { background: var(--success-bg); color: var(--success); }
.status-badge.rejected { background: var(--danger-bg);  color: var(--danger); }

.role-pill { padding: .18rem .58px; border-radius: 12px; font-size: .76rem; font-weight: 700; }
.role-pill.broker      { background: #dbeafe; color: #1e40af; }
.role-pill.coordinator { background: #f3e8ff; color: #7c3aed; }

.action-cell { display: flex; gap: .35rem; align-items: center; }
.btn-action { padding: .25rem .6rem; border-radius: 6px; font-family: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; border: none; transition: var(--ease); text-decoration: none; display: inline-block; }
.btn-view    { background: #e8f0fb; color: var(--primary-light); }
.btn-view:hover { background: #d0e2f7; }
.btn-approve { background: var(--success-bg); color: var(--success); }
.btn-approve:hover { background: #bbf7d0; }
.btn-reject  { background: var(--danger-bg);  color: var(--danger); }
.btn-reject:hover  { background: #fecaca; }

.pagination { background: var(--surface); border-radius: var(--radius); padding: .7rem 1.3rem; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-sm); }
.page-info { font-size: .82rem; color: var(--muted); }
.page-buttons { display: flex; gap: .35rem; }
.page-btn { padding: .3rem .65rem; border: 1.5px solid var(--border); border-radius: 6px; background: var(--surface); font-family: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--text); transition: var(--ease); min-width: 34px; }
.page-btn:hover:not(:disabled) { border-color: var(--primary-light); color: var(--primary-light); }
.page-btn.active { background: var(--primary-light); color: #fff; border-color: var(--primary-light); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

.empty-state { background: var(--surface); border-radius: var(--radius); padding: 3.5rem 2rem; text-align: center; color: var(--muted); }
.empty-state span { font-size: 3rem; display: block; margin-bottom: .9rem; }
.loading-spinner { text-align: center; padding: 3rem; color: var(--muted); font-size: 1rem; }

.auth-bootstrap-screen {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: linear-gradient(160deg, #f8fafc 0%, #fef7e8 100%);
  overflow-x: hidden;
}
.auth-bootstrap-card {
  width: min(420px, 100%);
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, .12);
  padding: 1.4rem 1.2rem;
  text-align: center;
}
.auth-bootstrap-card h2 {
  font-size: 1.05rem;
  color: #111827;
  margin: .35rem 0 .35rem;
}
.auth-bootstrap-card p {
  font-size: .9rem;
  color: #64748b;
}
.auth-bootstrap-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 999px;
  border: 3px solid #e5e7eb;
  border-top-color: #d4870b;
  animation: auth-bootstrap-spin .8s linear infinite;
}
@keyframes auth-bootstrap-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .auth-bootstrap-card {
    padding: 1.2rem .95rem;
    border-radius: 14px;
  }
  .auth-bootstrap-card h2 { font-size: 1rem; }
  .auth-bootstrap-card p { font-size: .84rem; }
}

/* ─── Detail Page ──────────────────────────────── */
.detail-page { max-width: 1020px; margin: 0 auto; }
.detail-header { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.detail-header h1 { font-size: 1.3rem; font-weight: 800; color: var(--primary); flex: 1; }
.back-btn { color: var(--muted); font-size: .85rem; font-weight: 600; padding: .35rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); transition: var(--ease); white-space: nowrap; text-decoration: none; }
.back-btn:hover { border-color: var(--primary-light); color: var(--primary-light); text-decoration: none; }

.action-bar { display: flex; gap: 1rem; margin-bottom: 1.3rem; }
.btn-approve-lg, .btn-reject-lg { padding: .7rem 1.8rem; border: none; border-radius: var(--radius-sm); font-family: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; transition: var(--ease); }
.btn-approve-lg { background: var(--success); color: #fff; }
.btn-approve-lg:hover:not(:disabled) { background: #14532d; }
.btn-reject-lg  { background: var(--danger);  color: #fff; }
.btn-reject-lg:hover:not(:disabled)  { background: #7f1d1d; }
.btn-approve-lg:disabled, .btn-reject-lg:disabled { opacity: .55; cursor: not-allowed; }

.reject-form-panel, .edit-form-panel { background: var(--surface); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1.3rem; border: 1.5px solid var(--border); }
.edit-form-panel h3 { margin-bottom: 1.1rem; color: var(--primary); font-size: 1rem; font-weight: 700; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-bottom: 1.3rem; }
.detail-section { background: var(--surface); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); }
.detail-section h3 { font-size: .92rem; font-weight: 700; color: var(--primary); margin-bottom: .9rem; padding-bottom: .55rem; border-bottom: 1.5px solid var(--surface-alt); }
.info-list { display: grid; grid-template-columns: auto 1fr; gap: .45rem .7rem; align-items: baseline; }
.info-list dt { font-size: .78rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.info-list dd { font-size: .86rem; color: var(--text); }

.doc-link { display: inline-flex; align-items: center; gap: .45rem; color: var(--primary-light); font-weight: 600; padding: .55rem .9rem; background: #e8f0fb; border-radius: var(--radius-sm); transition: var(--ease); font-size: .88rem; }
.doc-link:hover { background: #d0e2f7; text-decoration: none; }
.no-doc { color: var(--muted); font-size: .88rem; }

.bottom-actions { display: flex; gap: 1rem; justify-content: flex-end; padding-top: .4rem; }

/* ─── Account Detail — Enterprise Redesign ─────── */
.ad-loading { display:flex; align-items:center; gap:.75rem; padding:3rem; color:var(--muted); font-size:.95rem; }
.ad-loading i { font-size:1.4rem; color:var(--primary-light); }
.ad-not-found { text-align:center; padding:4rem 1rem; color:var(--muted); }
.ad-not-found i { font-size:3rem; display:block; margin-bottom:.75rem; color:var(--border); }
.ad-back-link { display:inline-block; margin-top:1rem; color:var(--primary-light); font-size:.9rem; }

.ad-page { max-width:1060px; margin:0 auto; }

.ad-breadcrumb { display:flex; align-items:center; gap:.5rem; margin-bottom:1.25rem; }
.ad-bc-link { display:inline-flex; align-items:center; gap:.4rem; color:var(--muted); font-size:.83rem; font-weight:600; text-decoration:none; transition:var(--ease); }
.ad-bc-link:hover { color:var(--primary-light); text-decoration:none; }
.ad-bc-sep { font-size:.6rem; color:var(--border); }
.ad-bc-current { font-size:.83rem; color:var(--text); font-weight:600; }

.ad-alert { display:flex; align-items:center; gap:.6rem; padding:.75rem 1.1rem; border-radius:var(--radius-sm); font-size:.88rem; font-weight:500; margin-bottom:1rem; }
.ad-alert--success { background:var(--success-bg); color:var(--success); border:1px solid #bbf7d0; }
.ad-alert--error   { background:var(--danger-bg);  color:var(--danger);  border:1px solid #fca5a5; }

.ad-hero { display:flex; justify-content:space-between; align-items:flex-start; background:var(--surface); border-radius:var(--radius); padding:1.5rem 1.75rem; border:1px solid var(--border); box-shadow:var(--shadow-sm); margin-bottom:1rem; gap:1rem; }
.ad-hero-left { display:flex; align-items:flex-start; gap:1.1rem; flex:1; min-width:0; }
.ad-hero-right { display:flex; flex-direction:column; align-items:flex-end; gap:.5rem; flex-shrink:0; }

.ad-avatar { width:58px; height:58px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:1.55rem; font-weight:800; flex-shrink:0; line-height:1; }
.ad-avatar--broker { background:#dbeafe; color:#1e40af; }
.ad-avatar--coord  { background:#f3e8ff; color:#7c3aed; }

.ad-hero-info { display:flex; flex-direction:column; gap:.4rem; min-width:0; }
.ad-hero-name { font-size:1.35rem; font-weight:800; color:var(--primary); margin:0; line-height:1.2; }
.ad-hero-chips { display:flex; flex-wrap:wrap; align-items:center; gap:.45rem; }
.ad-role-chip { display:inline-flex; align-items:center; gap:.35rem; padding:.22rem .65rem; border-radius:999px; font-size:.76rem; font-weight:700; }
.ad-role-chip--broker { background:#dbeafe; color:#1e40af; }
.ad-role-chip--coord  { background:#f3e8ff; color:#7c3aed; }
.ad-community-chip { display:inline-flex; align-items:center; gap:.3rem; font-size:.78rem; color:var(--muted); font-weight:500; }
.ad-hero-contacts { display:flex; flex-wrap:wrap; gap:.5rem 1rem; margin-top:.1rem; }
.ad-hero-contacts span { display:inline-flex; align-items:center; gap:.35rem; font-size:.82rem; color:var(--muted); }
.ad-hero-contacts i { font-size:.72rem; }

.ad-status-badge { display:inline-flex; align-items:center; gap:.45rem; padding:.35rem .85rem; border-radius:999px; font-size:.78rem; font-weight:700; }
.ad-status-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.ad-status--pending { background:#fef3c7; color:#92400e; }
.ad-status--pending .ad-status-dot { background:#f59e0b; }
.ad-status--approved { background:#dcfce7; color:#14532d; }
.ad-status--approved .ad-status-dot { background:#16a34a; }
.ad-status--approvedpendingpayment { background:#e0e7ff; color:#3730a3; }
.ad-status--approvedpendingpayment .ad-status-dot { background:#6366f1; }
.ad-status--rejected { background:#fee2e2; color:#7f1d1d; }
.ad-status--rejected .ad-status-dot { background:#dc2626; }
.ad-account-id { font-size:.74rem; color:var(--muted); font-weight:600; }

.ad-action-bar { display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:.85rem 1.1rem; margin-bottom:1.25rem; box-shadow:var(--shadow-sm); }

.ad-btn { display:inline-flex; align-items:center; gap:.45rem; padding:.52rem 1.15rem; border-radius:var(--radius-sm); font-family:inherit; font-size:.875rem; font-weight:600; cursor:pointer; border:none; transition:var(--ease); white-space:nowrap; }
.ad-btn:disabled { opacity:.55; cursor:not-allowed; }
.ad-btn--primary { background:var(--primary-light); color:#fff; }
.ad-btn--primary:hover:not(:disabled) { background:var(--primary); }
.ad-btn--success { background:var(--success); color:#fff; }
.ad-btn--success:hover:not(:disabled) { background:#14532d; }
.ad-btn--danger  { background:var(--danger);  color:#fff; }
.ad-btn--danger:hover:not(:disabled)  { background:#7f1d1d; }
.ad-btn--outline { background:transparent; color:var(--text); border:1.5px solid var(--border); }
.ad-btn--outline:hover { border-color:var(--primary-light); color:var(--primary-light); background:transparent; }
.ad-btn--ghost-danger { background:transparent; color:var(--danger); border:1.5px solid transparent; }
.ad-btn--ghost-danger:hover { background:var(--danger-bg); border-color:var(--danger); }

.ad-reject-panel { background:#fff7f7; border:1.5px solid #fca5a5; border-radius:var(--radius); padding:1.25rem 1.4rem; margin-bottom:1.25rem; }
.ad-reject-header { display:flex; align-items:center; gap:.55rem; font-size:.92rem; font-weight:700; color:var(--danger); margin-bottom:1rem; }

.ad-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.1rem; margin-bottom:1.25rem; }

.ad-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-sm); overflow:hidden; }
.ad-card-hdr { display:flex; align-items:center; gap:.65rem; padding:.85rem 1.15rem; border-bottom:1px solid var(--surface-alt); }
.ad-card-hdr-icon { width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:.8rem; flex-shrink:0; }
.ad-card-hdr-title { font-size:.88rem; font-weight:700; color:var(--primary); }

.ad-fields { padding:.1rem 0; }
.ad-field { display:grid; grid-template-columns:38% 1fr; gap:.2rem .75rem; align-items:baseline; padding:.62rem 1.15rem; border-bottom:1px solid var(--surface-alt); }
.ad-field--last { border-bottom:none; }
.ad-field-lbl { font-size:.74rem; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; }
.ad-field-val { font-size:.875rem; color:var(--text); font-weight:500; }
.ad-mono { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.82rem; letter-spacing:.03em; }

.ad-doc-tile { display:flex; align-items:center; gap:.85rem; margin:1rem 1.15rem; padding:.85rem 1rem; background:var(--surface-alt); border:1.5px solid var(--border); border-radius:var(--radius-sm); text-decoration:none; transition:var(--ease); }
.ad-doc-tile:hover { border-color:var(--primary-light); background:#e8f0fb; text-decoration:none; }
.ad-doc-tile-icon { width:40px; height:40px; border-radius:8px; background:#eff6ff; color:#2563eb; display:flex; align-items:center; justify-content:center; font-size:1.15rem; flex-shrink:0; }
.ad-doc-tile-body { display:flex; flex-direction:column; gap:.2rem; }
.ad-doc-tile-name { font-size:.88rem; font-weight:700; color:var(--text); }
.ad-doc-tile-action { font-size:.76rem; color:var(--primary-light); font-weight:500; }
.ad-doc-empty { display:flex; align-items:center; gap:.65rem; margin:1rem 1.15rem; padding:.85rem 1rem; color:var(--muted); font-size:.85rem; font-style:italic; }
.ad-doc-empty i { font-size:1.1rem; color:var(--border); }

.ad-timeline { padding:.5rem 1.15rem .75rem; display:flex; flex-direction:column; }
.ad-tl-item { display:flex; gap:.85rem; align-items:flex-start; padding:.55rem 0; position:relative; }
.ad-tl-item:not(.ad-tl-item--last)::after { content:""; position:absolute; left:7px; top:22px; width:2px; height:calc(100% - 2px); background:var(--border); z-index:0; }
.ad-tl-dot { width:16px; height:16px; border-radius:50%; flex-shrink:0; margin-top:2px; position:relative; z-index:1; border:2.5px solid var(--surface); }
.ad-tl-dot--blue  { background:#3b82f6; box-shadow:0 0 0 2px #bfdbfe; }
.ad-tl-dot--green { background:#16a34a; box-shadow:0 0 0 2px #bbf7d0; }
.ad-tl-dot--amber { background:#f59e0b; box-shadow:0 0 0 2px #fde68a; }
.ad-tl-dot--red   { background:#dc2626; box-shadow:0 0 0 2px #fca5a5; }
.ad-tl-dot--gray  { background:#94a3b8; box-shadow:0 0 0 2px #e2e8f0; }
.ad-tl-body { display:flex; flex-direction:column; gap:.1rem; flex:1; }
.ad-tl-label { font-size:.73rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.ad-tl-value { font-size:.84rem; color:var(--text); font-weight:500; }

.ad-edit-wrap { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-sm); overflow:hidden; margin-bottom:1.25rem; }
.ad-edit-hdr { display:flex; align-items:center; gap:.85rem; padding:1rem 1.5rem; border-bottom:1px solid var(--surface-alt); }
.ad-edit-wrap .form-row, .ad-edit-wrap .form-group { padding-left:0; }
.ad-edit-section { font-size:.74rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; padding-bottom:.5rem; margin-top:1.25rem; margin-bottom:.9rem; border-bottom:2px solid var(--surface-alt); }
.ad-edit-wrap EditForm, .ad-edit-wrap form { padding:1.25rem 1.5rem; display:block; }
.ad-edit-footer { display:flex; justify-content:flex-end; gap:.75rem; padding-top:1.25rem; margin-top:1rem; border-top:1px solid var(--surface-alt); }

@media (max-width:900px) {
  .ad-grid { grid-template-columns:1fr; }
  .ad-hero { flex-direction:column; }
  .ad-hero-right { align-items:flex-start; flex-direction:row; flex-wrap:wrap; }
}
@media (max-width:600px) {
  .ad-hero-left { flex-direction:column; }
  .ad-action-bar { flex-direction:column; align-items:stretch; }
  .ad-btn { justify-content:center; }
}

/* ─── Modal ────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.92); z-index: 999; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-card { background: var(--surface); border-radius: var(--radius); padding: 2rem; max-width: 500px; width: 100%; max-height: calc(100dvh - 2rem); overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: 1.1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.1rem; }
.create-account-modal {
  max-width: 680px;
  width: min(680px, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.create-account-modal .form-row { gap: .85rem; }
.create-account-help {
  display: block;
  margin-top: .25rem;
  color: var(--muted);
  font-size: .78rem;
}
.create-fee-preview {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-top: .9rem;
  padding: .85rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}
.create-fee-preview-icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  border-radius: .8rem;
  color: #1d4ed8;
  background: #dbeafe;
}
.create-fee-preview-body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.create-fee-preview-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.create-fee-preview-body strong {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 900;
}
.create-fee-preview-body small {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}
.create-fee-preview-error { color: var(--danger) !important; }

@media (max-width: 640px) {
  .create-account-modal {
    padding: 1.25rem;
    max-height: calc(100vh - 1rem);
  }
  .create-account-modal .modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .create-account-modal .modal-actions button { justify-content: center; }
  .create-fee-preview { align-items: flex-start; padding: .75rem; }
}

/* ─── Contract Receipt ─────────────────────────── */
.contract-toolbar { display:flex; align-items:center; justify-content:space-between; padding:1rem 2rem; background:var(--surface); border-bottom:1px solid var(--border); flex-wrap:wrap; gap:.75rem; }

.contract-receipt { max-width:860px; margin:2rem auto; background:#fff; border-radius:var(--radius); box-shadow:var(--shadow-md); padding:2.5rem 3rem; font-size:.9rem; }

.receipt-header { display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:1rem; margin-bottom:1.5rem; }
.receipt-logo { display:flex; align-items:center; gap:.75rem; }
.receipt-brand { font-size:1.4rem; font-weight:900; color:var(--primary); line-height:1.1; }
.receipt-brand-sub { font-size:.75rem; color:var(--muted); }
.receipt-meta { text-align:right; }
.receipt-contract-no { font-size:1.3rem; font-weight:900; color:var(--primary); letter-spacing:.03em; }
.receipt-date { font-size:.8rem; color:var(--muted); margin-top:.2rem; }

.receipt-divider { border:none; border-top:1.5px solid var(--surface-alt); margin:1.2rem 0; }
.receipt-section-title { font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); margin-bottom:.75rem; }

.receipt-grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:.75rem 1rem; margin-bottom:.25rem; }
.receipt-grid-2 { display:grid; grid-template-columns:repeat(2,1fr); gap:.75rem 1rem; margin-bottom:.25rem; }
.receipt-field { display:flex; flex-direction:column; gap:.15rem; }
.rf-label { font-size:.7rem; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.rf-value { font-size:.88rem; color:var(--text); font-weight:500; word-break:break-word; }

.receipt-fees-table { border:1.5px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.receipt-fee-row { display:flex; justify-content:space-between; padding:.6rem 1rem; font-size:.88rem; border-bottom:1px solid var(--surface-alt); }
.receipt-fee-row:last-child { border-bottom:none; }
.receipt-fee-row span:last-child { font-weight:600; }
.receipt-fee-total { background:var(--primary); color:#fff !important; font-weight:800 !important; }
.receipt-fee-total span { color:#fff !important; font-weight:800 !important; }

.receipt-footer { display:flex; justify-content:space-between; font-size:.75rem; color:var(--muted); flex-wrap:wrap; gap:.5rem; }

/* Print / PDF */
.print-only { display:none; }
@media print {
  .no-print { display:none !important; }
  .print-only { display:inline !important; }
  .site-header, .site-footer, .admin-shell, .contract-toolbar { display:none !important; }
  .site-main { padding:0 !important; }
  .contract-receipt { box-shadow:none !important; border-radius:0 !important; margin:0 !important; padding:1.5rem 2rem !important; max-width:100% !important; }
  .receipt-fee-total { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  body { background:#fff !important; }
}

/* ─── Misc ─────────────────────────────────────── */
.not-found { text-align: center; padding: 5rem 2rem; }
.not-found h1 { font-size: 5rem; color: var(--border); font-weight: 900; }
.not-found p { color: var(--muted); margin-bottom: 2rem; }

/* Contract status badge colours */
.status-badge.underreview { background: #eff6ff; color: #1d4ed8; }
.status-badge.draft      { background: #f1f5f9; color: #64748b; }
.status-badge.active     { background: var(--success-bg); color: var(--success); }
.status-badge.expired    { background: #fef3c7; color: #92400e; }
.status-badge.terminated { background: var(--danger-bg); color: var(--danger); }
.status-badge.suspended  { background: #fffbeb; color: #92400e; }

/* ─── New Contract — locked / auto-filled fields ── */
.nc-locked-field {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .9rem;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .92rem; color: var(--text); font-weight: 600;
  min-height: 2.55rem;
  cursor: default; user-select: text;
}
.nc-lock-icon {
  font-size: .7rem; color: var(--muted); flex-shrink: 0; opacity: .7;
}
.nc-verified-notice {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8rem; color: var(--success); font-weight: 600;
  background: var(--success-bg); border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm); padding: .5rem .85rem;
  margin-bottom: .75rem;
}
.nc-verified-notice i { font-size: .85rem; }

/* ── New Contract — Unit service-charges info button + drawer ──────────────── */
.nc-info-btn {
  margin-left: .5rem; border: 1px solid #c7d2fe; background: #eef2ff; color: #4f46e5;
  border-radius: 999px; padding: .12rem .55rem; font-size: .72rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.nc-info-btn:hover { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.nc-info-btn i { margin-right: .25rem; }

.nc-drawer-scrim {
  position: fixed; inset: 0; background: rgba(15,23,42,.35);
  z-index: 1200; animation: nc-fade .15s ease;
}
.nc-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 420px; max-width: 92vw;
  background: #fff; z-index: 1201; box-shadow: -8px 0 30px rgba(15,23,42,.18);
  display: flex; flex-direction: column; animation: nc-slide .2s ease;
}
@keyframes nc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nc-slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
.nc-drawer-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 1.1rem 1.25rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
}
.nc-drawer-head h3 { margin: 0; font-size: 1rem; font-weight: 700; color: #1e293b; }
.nc-drawer-head p  { margin: .2rem 0 0; font-size: .82rem; color: #64748b; }
.nc-drawer-close {
  background: none; border: none; color: #94a3b8; font-size: 1.1rem; cursor: pointer; padding: .2rem .4rem;
}
.nc-drawer-close:hover { color: #ef4444; }
.nc-drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.nc-drawer-empty { text-align: center; color: #94a3b8; padding: 2.5rem 1rem; }
.nc-drawer-empty i { font-size: 1.8rem; display: block; margin-bottom: .6rem; }
.nc-drawer-empty p { margin: 0; font-size: .85rem; }

.nc-sc-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: .85rem; margin-bottom: .85rem; }
.nc-sc-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.nc-sc-date { font-size: .82rem; font-weight: 600; color: #475569; }
.nc-sc-status { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; }
.nc-sc-status--paid      { background: #dcfce7; color: #15803d; }
.nc-sc-status--unpaid    { background: #fef9c3; color: #a16207; }
.nc-sc-status--cancelled { background: #fee2e2; color: #b91c1c; text-decoration: line-through; }
.nc-sc-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.nc-sc-table th { text-align: left; color: #94a3b8; font-weight: 600; font-size: .72rem; padding: .15rem .3rem; border-bottom: 1px solid #f1f5f9; }
.nc-sc-table td { padding: .25rem .3rem; color: #334155; border-bottom: 1px solid #f8fafc; }
.nc-sc-notes { font-size: .78rem; color: #64748b; margin-top: .5rem; background: #f8fafc; border-radius: 6px; padding: .4rem .55rem; }
.nc-sc-notes i { color: #f59e0b; margin-right: .3rem; }
.nc-sc-total { text-align: right; margin-top: .5rem; font-size: .82rem; color: #475569; }
.nc-sc-total strong { color: #1e293b; }

/* ── New Contract — Section labels ──────────────── */
.nc-section-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text);
  padding: .5rem 0 .6rem;
  border-bottom: 2px solid var(--surface-alt);
  margin-bottom: .9rem;
}
.nc-section-label i { color: var(--primary-light); font-size: .8rem; }

/* ── New Contract — Upload cards grid ───────────── */
.nc-uploads-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; margin-bottom: .5rem;
}
.nc-upload-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 1rem; background: var(--surface);
  display: flex; flex-direction: column; gap: .65rem;
}
.nc-upload-required {
  border-color: #fcd34d;
  background: #fffdf5;
}
.nc-upload-card-header {
  display: flex; align-items: center; gap: .65rem;
}
.nc-upload-card-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
}
.nc-upload-card-title {
  font-size: .875rem; font-weight: 700; color: var(--text);
}
.nc-upload-card-hint {
  font-size: .72rem; color: var(--muted); margin-top: .1rem;
}

@media (max-width: 600px) {
  .nc-uploads-grid { grid-template-columns: 1fr; }
}

/* ─── Fee Breakdown (read-only) ────────────────── */

/* Info bar above the table */
.fee-info-bar {
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin-bottom: 1.25rem;
}
.fee-info-pill {
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: .55rem .85rem;
  font-size: .82rem; flex: 1; min-width: 150px;
}
.fee-info-pill > i {
  font-size: .85rem; color: var(--muted); flex-shrink: 0;
}
.fee-info-pill > div {
  display: flex; flex-direction: column; gap: .05rem; min-width: 0;
}
.fee-info-label {
  font-size: .67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}
.fee-info-value {
  font-size: .82rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fee-info-pill-tier {
  border-color: var(--accent); background: #fffbeb;
}
.fee-info-pill-tier > i { color: var(--accent); }
.fee-info-pill-tier .fee-info-label { color: #b45309; }
.fee-info-pill-tier .fee-info-value  { color: #92400e; }

/* Breakdown table */
.fee-breakdown-table {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: .9rem;
  background: var(--surface);
}

.fee-breakdown-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--surface-alt);
  gap: 1rem; transition: background .12s ease;
}
.fee-breakdown-row:hover { background: #fafbfc; }

.fee-breakdown-left {
  display: flex; align-items: center; gap: .75rem;
  flex: 1; min-width: 0;
}

.fee-row-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-alt); border: 1.5px solid var(--border);
  color: var(--muted); font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.fee-row-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem;
}
.fee-row-info {
  display: flex; flex-direction: column; gap: .1rem; min-width: 0;
}
.fee-row-name {
  font-size: .9rem; font-weight: 700; color: var(--text);
  white-space: nowrap;
}
.fee-row-sub {
  font-size: .75rem; color: var(--muted); font-weight: 400;
}
.fee-row-amount {
  font-size: .9rem; font-weight: 700; color: var(--text);
  white-space: nowrap; flex-shrink: 0;
}

/* Total row */
.fee-breakdown-total {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  gap: 1rem;
}
.fee-breakdown-total .fee-breakdown-left {
  color: rgba(255,255,255,.85); font-size: .92rem; font-weight: 700;
  gap: .6rem;
}
.fee-breakdown-total .fee-breakdown-left i {
  color: var(--accent-light); font-size: .85rem;
}
.fee-total-amount {
  font-size: 1.2rem; font-weight: 900;
  color: var(--accent-light); white-space: nowrap;
}

/* Read-only note */
.fee-readonly-note {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .8rem; color: var(--muted);
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .6rem .9rem;
  margin-bottom: .25rem; line-height: 1.5;
}
.fee-readonly-note i {
  font-size: .8rem; color: var(--primary-light);
  flex-shrink: 0; margin-top: .1rem;
}

/* ─── Wizard ───────────────────────────────────── */
.wizard-steps { display: flex; align-items: center; gap: 0; }
.wizard-step { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.ws-circle {
    width: 2.1rem; height: 2.1rem; border-radius: 50%;
    background: var(--border); color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem; transition: background .2s, color .2s;
}
.wizard-step.active .ws-circle { background: var(--primary); color: #fff; }
.wizard-step.done .ws-circle { background: var(--success); color: #fff; }
.ws-label { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.wizard-step.active .ws-label { color: var(--primary); font-weight: 600; }
.wizard-step.done .ws-label { color: var(--success); }
.wizard-connector { flex: 1; height: 2px; background: var(--border); margin: 0 .5rem; margin-bottom: 1.3rem; transition: background .2s; }
.wizard-connector.done { background: var(--success); }
.wizard-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 1.75rem;
    max-width: 700px;
}

/* ─── Assign Broker — list view ───────────────────────────── */
.ab-toolbar { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; }
.ab-search { position: relative; flex: 1; min-width: 240px; }
.ab-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.ab-search input { padding-left: 2.3rem; width: 100%; }
.ab-assign-btn { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }

.ab-summary { display: flex; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.ab-stat {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
    padding: .7rem 1.1rem; min-width: 130px;
}
.ab-stat span { display: block; font-size: 1.5rem; font-weight: 800; color: #4f46e5; line-height: 1; }
.ab-stat small { color: var(--muted); font-size: .76rem; }

.ab-unit-list { display: flex; flex-direction: column; gap: 1rem; }
.ab-unit-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.ab-unit-head {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: .85rem 1.15rem; background: #f8fafc; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.ab-unit-headinfo { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; }
.ab-unit-num { font-size: .95rem; font-weight: 700; color: #1e293b; }
.ab-unit-num i { color: #6366f1; margin-right: .35rem; }
.ab-unit-meta { font-size: .82rem; color: #64748b; }
.ab-unit-meta i { margin-right: .25rem; opacity: .7; }
.ab-unit-count {
    font-size: .72rem; font-weight: 700; color: #4f46e5; background: #eef2ff;
    border: 1px solid #c7d2fe; padding: .15rem .6rem; border-radius: 999px; white-space: nowrap;
}

.ab-broker-rows { display: flex; flex-direction: column; }
.ab-broker-row {
    display: flex; align-items: center; gap: .85rem; padding: .8rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
}
.ab-broker-row:last-child { border-bottom: none; }
.ab-broker-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg,#6366f1,#4f46e5); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 700;
}
.ab-broker-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.ab-broker-name { font-size: .9rem; font-weight: 600; color: #1e293b; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ab-role-chip {
    font-size: .68rem; font-weight: 700; color: #475569; background: #f1f5f9;
    padding: .1rem .45rem; border-radius: 5px; text-transform: uppercase; letter-spacing: .02em;
}
.ab-broker-contact { font-size: .8rem; color: #64748b; display: flex; gap: 1rem; flex-wrap: wrap; }
.ab-broker-contact i { margin-right: .3rem; opacity: .7; }
.ab-broker-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex-shrink: 0; }
.ab-assigned-date { font-size: .74rem; color: #94a3b8; white-space: nowrap; }
.ab-revoke-btn {
    background: #fff; border: 1px solid #fecaca; color: #dc2626; cursor: pointer;
    font-size: .76rem; font-weight: 600; padding: .25rem .6rem; border-radius: 6px; transition: all .15s;
}
.ab-revoke-btn:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.ab-revoke-btn i { margin-right: .25rem; }

/* Revoke modal */
.ab-modal-scrim {
    position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 1300;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.ab-modal {
    background: #fff; border-radius: 14px; padding: 1.5rem; max-width: 420px; width: 100%;
    box-shadow: 0 20px 50px rgba(15,23,42,.25); text-align: center;
}
.ab-modal-icon {
    width: 48px; height: 48px; border-radius: 50%; background: #fee2e2; color: #dc2626;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin: 0 auto .85rem;
}
.ab-modal h3 { margin: 0 0 .5rem; font-size: 1.1rem; color: #1e293b; }
.ab-modal p { margin: 0; font-size: .88rem; color: #475569; line-height: 1.5; }
.ab-revoke-confirm {
    background: linear-gradient(135deg,#ef4444,#dc2626); color: #fff; border: none;
    padding: .55rem 1.1rem; border-radius: 8px; font-weight: 600; font-size: .85rem; cursor: pointer;
}
.ab-revoke-confirm:hover:not(:disabled) { background: linear-gradient(135deg,#dc2626,#b91c1c); }
.ab-revoke-confirm:disabled { opacity: .6; cursor: not-allowed; }

/* ─── Responsive ───────────────────────────────── */
@media (max-width: 1024px) {
  .sb-sidebar { width: 210px; }
  .admin-content { padding: 1.25rem; margin-left: 210px; }
  .admin-topbar { margin: -1.25rem -1.25rem 1.25rem; padding: .65rem 1.25rem; }
}

/* Mobile drawer: sidebar slides in from left, hamburger toggles it */
@media (max-width: 900px) {
  .admin-topbar-hamburger { display: inline-flex; }

  /* Sidebar becomes a slide-out drawer */
  .sb-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 100;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
    width: 280px;
  }
  .admin-shell.sidebar-open .sb-sidebar {
    transform: translateX(0);
  }
  .admin-shell.sidebar-open .admin-shell-backdrop {
    display: block;
  }

  /* Main content takes full width when sidebar is hidden */
  .admin-content { padding: 1rem; margin-left: 0; }
  .admin-topbar { margin: -1rem -1rem 1rem; padding: .55rem 1rem; }
  .admin-topbar-user { min-width: 0; }

  /* Compact user info on small screens */
  .admin-topbar-user .atu-info { display: none; }
  .admin-topbar-user .atu-avatar { width: 36px; height: 36px; font-size: .85rem; }
}

@media (max-width: 480px) {
  .admin-topbar-hamburger { width: 36px; height: 36px; font-size: .9rem; }
  .admin-topbar { gap: .5rem; }
  .admin-topbar-user { gap: .45rem; }
  .admin-topbar-user .atu-avatar { display: none; }
}
@media (max-width: 900px) {
  .stats-row,
  .admin-accounts-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar .search-box { flex: 1 1 260px; min-width: 0; }
  .filter-select,
  .btn-reset-filters { flex: 1 1 160px; }
}
@media (max-width: 640px) {
  .site-main { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .role-selector { grid-template-columns: 1fr; }
  .features-row { grid-template-columns: 1fr; }
  .stats-row,
  .admin-accounts-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .table-wrapper { overflow-x: auto; }
  .admin-table { min-width: 680px; }
  .pagination { flex-direction: column; gap: .7rem; }
  .modal-overlay { align-items: flex-start; padding: .65rem; }
  .modal-card { padding: 1.25rem; max-height: calc(100dvh - 1.3rem); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button, .modal-actions a { width: 100%; justify-content: center; }
  .register-card { padding: 1.4rem; }
  .hero-section { padding: 2.5rem 1.25rem; }
}

/* ═══════════════════════════════════════════════
   Enterprise Contracts Screen
   ═══════════════════════════════════════════════ */

/* ── Contract View Toolbar ───────────────────── */
.cv-toolbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 62px; z-index: 50;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.cv-back-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--muted); font-size: .85rem; font-weight: 600;
  padding: .45rem .85rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none; transition: var(--ease); white-space: nowrap;
  flex-shrink: 0;
}
.cv-back-btn:hover { color: var(--primary); border-color: var(--primary-light); text-decoration: none; }

.cv-toolbar-center {
  flex: 1; display: flex; align-items: center; gap: .75rem;
  min-width: 0;
}
.cv-toolbar-number {
  font-size: 1rem; font-weight: 800; color: var(--primary);
  letter-spacing: .02em; white-space: nowrap;
}

.cv-toolbar-actions { display: flex; gap: .6rem; flex-shrink: 0; }

.cv-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1.1rem; border-radius: var(--radius-sm);
  border: none; font-family: inherit; font-size: .875rem;
  font-weight: 600; cursor: pointer; transition: var(--ease);
  white-space: nowrap;
}
.cv-btn:disabled { opacity: .55; cursor: not-allowed; }

.cv-btn-approve {
  background: var(--success); color: #fff;
}
.cv-btn-approve:hover:not(:disabled) { background: #14532d; transform: translateY(-1px); }

.cv-btn-print {
  background: var(--surface-alt); color: var(--text);
  border: 1.5px solid var(--border);
}
.cv-btn-print:hover { background: #f1f5f9; border-color: var(--primary-light); color: var(--primary); transform: translateY(-1px); }

/* ── Contract Receipt ────────────────────────── */
.cv-receipt {
  max-width: 900px; margin: 2rem auto 3rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ── Receipt Header ──────────────────────────── */
.cvr-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 2rem 2.5rem 1.75rem;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  flex-wrap: wrap; gap: 1rem;
}

.cvr-brand { display: flex; align-items: center; gap: .85rem; }
.cvr-brand-icon {
  width: 52px; height: 52px;
  background: rgba(255,255,255,.15);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--accent-light);
}
.cvr-brand-name {
  font-family: 'Cairo';
  font-size: 1.3rem; font-weight: 900; color: #fff; line-height: 1.1;
  letter-spacing: .02em;
}
.cvr-brand-sub { font-size: .72rem; color: rgba(255,255,255,.55); font-weight: 500; margin-top: .15rem; }

.cvr-meta { text-align: right; }
.cvr-contract-number {
  font-size: 1.5rem; font-weight: 900; color: #fff;
  letter-spacing: .04em; line-height: 1.1;
}
.cvr-issued, .cvr-created-by {
  font-size: .8rem; color: rgba(255,255,255,.65);
  margin-top: .3rem; display: flex; align-items: center;
  gap: .4rem; justify-content: flex-end;
}

/* ── Receipt Divider & Sections ──────────────── */
.cvr-divider { border: none; border-top: 1px solid var(--border); margin: 0; }

.cvr-section { padding: 1.5rem 2.5rem; }
.cvr-section + .cvr-section { padding-top: 0; }

.cvr-section-header {
  display: flex; align-items: center; gap: .65rem;
  margin-bottom: 1.1rem;
}
.cvr-section-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; flex-shrink: 0;
}
.cvr-icon-blue   { background: #dbeafe; color: #1d4ed8; }
.cvr-icon-orange { background: #ffedd5; color: #c2410c; }
.cvr-icon-teal   { background: #ccfbf1; color: #0f766e; }
.cvr-icon-purple { background: #f3e8ff; color: #7c3aed; }
.cvr-icon-gold   { background: #fef3c7; color: #b45309; }
.cvr-icon-green  { background: var(--success-bg); color: var(--success); }
.cvr-icon-slate  { background: #f1f5f9; color: #475569; }

.cvr-section-title {
  font-size: .8rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text); margin: 0;
}

/* ── Field Grids ─────────────────────────────── */
.cvr-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem 1.25rem; }
.cvr-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem 1.25rem; }
.cvr-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.25rem; }

.cvr-field { display: flex; flex-direction: column; gap: .25rem; }
.cvr-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
  display: flex; align-items: center; gap: .3rem;
}
.cvr-label i { font-size: .65rem; }
.cvr-value {
  font-size: .9rem; color: var(--text); font-weight: 500;
  word-break: break-word; line-height: 1.4;
}
.cvr-highlight { font-weight: 800; color: var(--primary); font-size: 1rem; }
.cvr-rent      { font-weight: 800; color: var(--accent); font-size: 1rem; }

.cvr-doc-link {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--primary-light); font-weight: 600; font-size: .85rem;
  background: #e8f0fb; padding: .3rem .7rem;
  border-radius: var(--radius-sm); text-decoration: none; transition: var(--ease);
}
.cvr-doc-link:hover { background: #d0e2f7; text-decoration: none; }

/* ── Fees Table ──────────────────────────────── */
.cvr-fees-table {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.cvr-fee-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--surface-alt);
  transition: var(--ease);
}
.cvr-fee-row:hover { background: #fafbfc; }
.cvr-fee-row:last-child { border-bottom: none; }

.cvr-fee-info {
  display: flex; align-items: center; gap: .75rem;
}
.cvr-fee-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-alt); color: var(--muted);
  font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cvr-fee-name { font-size: .875rem; color: var(--text); font-weight: 500; }
.cvr-fee-sub  { font-size: .75rem; color: var(--muted); display: block; margin-top: .1rem; }
.cvr-fee-amount { font-size: .875rem; font-weight: 700; color: var(--text); white-space: nowrap; }

.cvr-fee-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.1rem;
  background: var(--primary);
  color: #fff;
}
.cvr-fee-total .cvr-fee-info { color: #fff; gap: .65rem; }
.cvr-total-amount {
  font-size: 1.2rem; font-weight: 900; color: var(--accent-light);
  white-space: nowrap;
}

/* ── Payment Status ──────────────────────────── */
.cvr-payment-received {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--success); font-weight: 700; font-size: .875rem;
}
.cvr-payment-pending {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--warn); font-weight: 700; font-size: .875rem;
}

.cvr-notes {
  font-size: .9rem; color: var(--text); line-height: 1.7;
  background: var(--surface-alt); border-radius: var(--radius-sm);
  padding: .9rem 1.1rem; border-left: 3px solid var(--border);
}

/* ── Receipt Footer ──────────────────────────── */
.cvr-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2.5rem;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: .5rem;
}
.cvr-footer-left, .cvr-footer-right {
  font-size: .75rem; color: var(--muted);
  display: flex; align-items: center; gap: .4rem;
}

/* ── Loading & Empty States (ContractView) ────── */
.cv-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 300px;
}
.cv-loading-inner {
  display: flex; flex-direction: column; align-items: center; gap: .85rem;
  color: var(--muted); font-size: .95rem;
}
.cv-loading-inner i { font-size: 2rem; color: var(--primary-light); }

.cv-empty-state {
  max-width: 480px; margin: 5rem auto; text-align: center; padding: 2rem;
}
.cv-empty-icon {
  font-size: 3.5rem; color: var(--border); margin-bottom: 1.1rem;
  display: block;
}
.cv-empty-state h3 { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: .5rem; }
.cv-empty-state p  { color: var(--muted); margin-bottom: 1.5rem; }

/* ═══════════════════════════════════════════════
   Contracts Dashboard Section (Admin)
   ═══════════════════════════════════════════════ */

/* ── Page Header ─────────────────────────────── */
.cs-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2030 55%, #1c2d4a 100%);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  position: relative;
  overflow: hidden;
}
.cs-page-header::before {
  content: "";
  position: absolute;
  top: -52px;
  right: -28px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,164,76,.22) 0%, transparent 65%);
  pointer-events: none;
}
.cs-page-header::after {
  content: "";
  position: absolute;
  bottom: -42px;
  left: 35%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,.12) 0%, transparent 65%);
  pointer-events: none;
}
.cs-page-header-left { display: flex; align-items: center; gap: .85rem; position: relative; z-index: 1; }
.cs-page-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(212,164,76,.22);
  border: 1px solid rgba(212,164,76,.42);
  display: flex; align-items: center; justify-content: center;
  color: #f8d28b; font-size: 1.1rem; flex-shrink: 0;
}
.cs-page-title { font-size: 1.35rem; font-weight: 800; color: #fff; margin: 0; }
.cs-page-header h1.cs-page-title { color: #fff; }
.cs-page-sub   { font-size: .8rem; color: rgba(255,255,255,.75); margin: .15rem 0 0; }

.cs-new-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary-dark); border: none;
  padding: .6rem 1.35rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem; font-weight: 700;
  cursor: pointer; transition: var(--ease); text-decoration: none;
  box-shadow: 0 2px 8px rgba(232,160,32,.35);
  position: relative;
  z-index: 1;
}
.cs-new-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(232,160,32,.45); text-decoration: none; color: var(--primary-dark); }

/* ── Stats Grid ──────────────────────────────── */
.cs-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .85rem;
  margin-bottom: 1.25rem;
}

.cs-stat-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex; align-items: center; gap: .85rem;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid transparent;
  transition: var(--ease);
}
.cs-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.cs-stat-icon {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.cs-stat-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.cs-stat-num  { font-size: 1.5rem; font-weight: 900; line-height: 1; }
.cs-stat-label { font-size: .72rem; color: var(--muted); font-weight: 600; white-space: nowrap; }

.cs-stat-total     { border-color: var(--primary-light); }
.cs-stat-total     .cs-stat-icon { background: #dbeafe; color: #1d4ed8; }
.cs-stat-total     .cs-stat-num  { color: var(--primary-light); }

.cs-stat-active    { border-color: var(--success); }
.cs-stat-active    .cs-stat-icon { background: var(--success-bg); color: var(--success); }
.cs-stat-active    .cs-stat-num  { color: var(--success); }

.cs-stat-review    { border-color: var(--accent); }
.cs-stat-review    .cs-stat-icon { background: #fef3c7; color: #b45309; }
.cs-stat-review    .cs-stat-num  { color: #b45309; }

.cs-stat-payment   { border-color: #f59e0b; }
.cs-stat-payment   .cs-stat-icon { background: #fef3c7; color: #d97706; }
.cs-stat-payment   .cs-stat-num  { color: #d97706; }

.cs-stat-draft     { border-color: var(--muted); }
.cs-stat-draft     .cs-stat-icon { background: #f1f5f9; color: var(--muted); }
.cs-stat-draft     .cs-stat-num  { color: var(--muted); }

.cs-stat-expired   { border-color: #f59e0b; }
.cs-stat-expired   .cs-stat-icon { background: #fffbeb; color: #d97706; }
.cs-stat-expired   .cs-stat-num  { color: #d97706; }

.cs-stat-terminated { border-color: var(--danger); }
.cs-stat-terminated .cs-stat-icon { background: var(--danger-bg); color: var(--danger); }
.cs-stat-terminated .cs-stat-num  { color: var(--danger); }

.cs-stat-suspended { border-color: #d97706; }
.cs-stat-suspended .cs-stat-icon { background: #fffbeb; color: #d97706; }
.cs-stat-suspended .cs-stat-num  { color: #d97706; }

/* ── Filter Bar ──────────────────────────────── */
.cs-filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
  display: flex; align-items: center; gap: .85rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.cs-search-wrap {
  flex: 1; min-width: 220px;
  position: relative; display: flex; align-items: center;
}
.cs-search-icon {
  position: absolute; left: .75rem;
  color: var(--muted); font-size: .8rem; pointer-events: none;
}
.cs-search-input {
  width: 100%; padding: .55rem .9rem .55rem 2.2rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .875rem; color: var(--text);
  background: var(--surface-alt); transition: var(--ease);
}
.cs-search-input:focus {
  outline: none; border-color: var(--primary-light);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37,99,168,.1);
}
.cs-search-input::placeholder { color: var(--muted); }

.cs-filter-controls { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }

.cs-filter-select {
  padding: .55rem .9rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: .875rem;
  background: var(--surface-alt); color: var(--text); min-width: 155px;
  transition: var(--ease); cursor: pointer;
}
.cs-filter-select:focus { outline: none; border-color: var(--primary-light); }

.cs-reset-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .53rem .9rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: transparent;
  color: var(--muted); font-family: inherit; font-size: .83rem;
  font-weight: 600; cursor: pointer; transition: var(--ease); white-space: nowrap;
}
.cs-reset-btn:hover { border-color: var(--primary-light); color: var(--primary-light); background: #f0f6ff; }

/* ── Loading & Empty States ──────────────────── */
.cs-loading {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; padding: 3.5rem;
  background: var(--surface); border-radius: var(--radius);
  color: var(--muted); font-size: .9rem;
  box-shadow: var(--shadow-sm);
}
.cs-loading i { font-size: 1.3rem; color: var(--primary-light); }

.cs-empty-state {
  background: var(--surface); border-radius: var(--radius);
  padding: 4rem 2rem; text-align: center;
  box-shadow: var(--shadow-sm);
}
.cs-empty-icon {
  font-size: 3rem; color: var(--border);
  margin-bottom: 1rem; display: block;
}
.cs-empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }
.cs-empty-state p  { color: var(--muted); margin-bottom: 1.5rem; font-size: .9rem; }

/* ── Contracts Table ─────────────────────────── */
.cs-table-wrapper {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); margin-bottom: .6rem;
}
.cs-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: .85rem; }

.cs-table thead tr {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}
.cs-table th {
  padding: .8rem 1rem; text-align: left;
  font-size: .72rem; font-weight: 700; color: rgba(255,255,255,.85);
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.cs-table th i { margin-right: .35rem; opacity: .7; }

.cs-table tbody tr { border-bottom: 1px solid var(--surface-alt); transition: var(--ease); }
.cs-table tbody tr:last-child { border-bottom: none; }
.cs-table tbody tr:hover { background: #f8faff; }

.cs-table td { padding: .75rem 1rem; vertical-align: middle; }

/* Row accent by status */
.cs-row-underreview { border-left: 3px solid #1d4ed8; }
.cs-row-active      { border-left: 3px solid var(--success); }
.cs-row-draft       { border-left: 3px solid var(--border); }
.cs-row-expired     { border-left: 3px solid #d97706; }
.cs-row-terminated  { border-left: 3px solid var(--danger); }
.cs-row-suspended   { border-left: 3px solid #d97706; }

/* Cell content styles */
.cs-contract-num { font-weight: 800; color: var(--primary); font-size: .88rem; }
.cs-contract-id  { font-size: .72rem; color: var(--muted); margin-top: .1rem; }

.cs-unit-num  { font-weight: 700; color: var(--text); }
.cs-unit-bldg { font-size: .75rem; color: var(--muted); margin-top: .1rem; }

.cs-person-name { font-weight: 600; color: var(--text); }
.cs-person-sub  { font-size: .75rem; color: var(--muted); margin-top: .15rem; display: flex; align-items: center; gap: .3rem; }
.cs-person-sub i { font-size: .65rem; }

.cs-rent { font-weight: 800; color: var(--accent); font-size: .9rem; }

.cs-date     { font-size: .82rem; color: var(--text); white-space: nowrap; }
.cs-date-end { font-size: .76rem; color: var(--muted); margin-top: .15rem; white-space: nowrap; }

/* ── Table Action Buttons ────────────────────── */
.cs-actions { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }

.cs-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .65rem; border-radius: 6px;
  border: none; font-family: inherit; font-size: .76rem;
  font-weight: 700; cursor: pointer; transition: var(--ease);
  text-decoration: none; white-space: nowrap;
}
.cs-btn i { font-size: .8rem; }

.cs-btn-view    { background: #e8f0fb; color: var(--primary-light); }
.cs-btn-view:hover { background: #d0e2f7; text-decoration: none; color: var(--primary); }

.cs-btn-approve { background: var(--success-bg); color: var(--success); padding: .3rem .55rem; }
.cs-btn-approve:hover { background: #bbf7d0; }

.cs-btn-muted {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    padding: .3rem .55rem;
}

.face-sync-progress-alert .face-sync-progress {
    width: min(100%, 420px);
    height: 6px;
    margin-top: .65rem;
    overflow: hidden;
    border-radius: 999px;
    background: #dbeafe;
}

.face-sync-progress span,
.face-sync-mini-progress span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #60a5fa, #2563eb);
    animation: face-sync-progress 1.05s ease-in-out infinite;
}

.face-sync-mini-progress {
    width: 68px;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbeafe;
}

.face-sync-progress-text {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #1d4ed8;
    font-weight: 600;
}

@keyframes face-sync-progress {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(245%); }
}

.cs-btn-payment { background: #fffbeb; color: #d97706; padding: .3rem .55rem; }
.cs-btn-payment:hover { background: #fef3c7; }

.cs-btn-terminate { background: #fef3c7; color: #b45309; padding: .3rem .55rem; }
.cs-btn-terminate:hover { background: #fde68a; }

.cs-btn-suspend { background: #fef3e2; color: #92400e; padding: .3rem .55rem; }
.cs-btn-suspend:hover { background: #fde68a; }

/* ── Extended button variants (Services / ServiceCharges pages) ── */
.cs-btn-sm      { padding: .28rem .6rem; font-size: .75rem; }
.cs-btn-outline { background: #fff; color: #475569; border: 1.5px solid #cbd5e1; }
.cs-btn-outline:hover:not(:disabled) { border-color: #6366f1; color: #6366f1; }
.cs-btn-primary { background: linear-gradient(135deg,#6366f1,#4f46e5); color: #fff; }
.cs-btn-primary:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.cs-btn-danger  { background: #fef2f2; color: #991b1b; border: 1.5px solid #fecaca; }
.cs-btn-danger:hover:not(:disabled)  { background: #fee2e2; }
.cs-btn-warning { background: #fffbeb; color: #92400e; border: 1.5px solid #fde68a; }
.cs-btn-warning:hover:not(:disabled) { background: #fef3c7; }
.cs-btn-success { background: #f0fdf4; color: #166534; border: 1.5px solid #bbf7d0; }
.cs-btn-success:hover:not(:disabled) { background: #dcfce7; }
.cs-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── cs-table-card alias for cs-table-wrapper ── */
.cs-table-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow-x: auto;
  border: 1px solid var(--border); margin-bottom: .6rem;
}

/* ── Generic form-group helpers ── */
.cs-form-group { display: flex; flex-direction: column; margin-bottom: .75rem; }
.cs-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: .3rem;
}
.cs-input {
  width: 100%; padding: .5rem .75rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .875rem; color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
  font-family: inherit;
}
.cs-input:focus {
  border-color: var(--primary); outline: none;
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
textarea.cs-input { resize: vertical; min-height: 60px; }
.cs-required { color: #e53e3e; margin-left: .15rem; }
.cs-hint     { font-size: .76rem; color: #64748b; margin-top: .2rem; }

/* ── Alert banners ── */
.cs-alert {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .7rem 1rem; border-radius: .5rem;
  font-size: .85rem; font-weight: 500; margin-bottom: .85rem;
  position: relative;
}
.cs-alert i { flex-shrink: 0; margin-top: .05rem; }
.cs-alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.cs-alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.cs-alert-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: inherit; opacity: .6; font-size: 1.1rem; line-height: 1; padding: 0 .2rem;
}
.cs-alert-close:hover { opacity: 1; }

/* ── Table Footer ────────────────────────────── */
.cs-table-footer {
  display: flex; align-items: center; justify-content: flex-end;
  padding: .5rem .25rem;
}
.cs-count { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }

/* ── Enhanced status badges for contracts ────── */
.status-badge.underreview {
  background: #eff6ff; color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.status-badge.draft {
  background: #f1f5f9; color: #475569;
  border: 1px solid var(--border);
}
.status-badge.active {
  background: var(--success-bg); color: var(--success);
  border: 1px solid #bbf7d0;
}
.status-badge.expired {
  background: #fffbeb; color: #b45309;
  border: 1px solid #fde68a;
}
.status-badge.terminated {
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid #fecaca;
}
.status-badge.rejected {
  background: #fef2f2; color: #b91c1c;
  border: 1px solid #fca5a5;
}
.status-badge.cancelled {
  background: #f1f5f9; color: #64748b;
  border: 1px solid #cbd5e1;
}
.status-badge.suspended {
  background: #fffbeb; color: #92400e;
  border: 1px solid #fde68a;
}
.status-badge.approvedpendingpayment {
  background: #fffbeb; color: #d97706;
  border: 1px solid #fcd34d;
}
/* PendingPayment — blue-violet: link sent, awaiting tenant payment */
.status-badge.pendingpayment {
  background: #eff6ff; color: #2563eb;
  border: 1px solid #93c5fd;
}
/* PaidPendingApproval — green tinted: paid, awaiting admin activation */
.status-badge.paidpendingapproval {
  background: #f0fdf4; color: #15803d;
  border: 1px solid #86efac;
}

/* ═══════════════════════════════════════════════
   Contract View — Alert Banners (.cv-alert)
   ═══════════════════════════════════════════════ */
.cv-alert {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: .9rem 1.1rem;
  border-radius: 10px;
  margin: .75rem 1.5rem 0;
  font-size: .9rem;
  line-height: 1.45;
}
.cv-alert > i { font-size: 1.1rem; margin-top: .1rem; flex-shrink: 0; }
.cv-alert > div { flex: 1; }
.cv-alert strong { display: block; font-weight: 700; margin-bottom: .15rem; }
.cv-alert p { margin: 0; opacity: .85; }
.cv-alert-danger  { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.cv-alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.cv-alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.cv-alert-link    { color: inherit; font-weight: 600; word-break: break-all; }
.cv-alert-copy    {
  background: none; border: 1px solid currentColor; border-radius: 6px;
  color: inherit; cursor: pointer; padding: .25rem .5rem; font-size: .8rem;
  margin-left: auto; flex-shrink: 0; align-self: center; opacity: .7;
  transition: opacity .15s;
}
.cv-alert-copy:hover { opacity: 1; }

/* Contract View — Reject box inside receipt */
.cvr-rejection-box {
  display: flex; gap: .8rem; align-items: flex-start;
  background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px;
  padding: .9rem 1rem; margin-top: 1rem; color: #991b1b;
}
.cvr-rejection-box > i { font-size: 1.1rem; margin-top: .1rem; }
.cvr-rejection-label { font-weight: 700; font-size: .8rem; display: block; }
.cvr-rejection-text  { margin: .2rem 0 0; font-size: .9rem; }

/* Contract View — Toolbar new buttons */
.cv-btn-reject {
  background: #fef2f2; color: #b91c1c; border: 1.5px solid #fca5a5;
}
.cv-btn-reject:hover:not(:disabled) { background: #fee2e2; }
.cv-btn-payment {
  background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; border: none;
}
.cv-btn-payment:hover:not(:disabled) { background: linear-gradient(135deg,#d97706,#b45309); }

/* ═══════════════════════════════════════════════
   Contract View — Modal System (.cv-modal)
   ═══════════════════════════════════════════════ */
.cv-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,.92);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: cv-overlay-in .18s ease;
}
@keyframes cv-overlay-in { from { opacity: 0 } to { opacity: 1 } }

.cv-modal {
  background: #fff; border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  width: 100%; max-width: 480px;
  animation: cv-modal-in .2s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}
.cv-modal--wide { max-width: 620px; }
@keyframes cv-modal-in { from { opacity:0; transform:scale(.92) translateY(12px) } to { opacity:1; transform:none } }

/* Modal Header */
.cv-modal-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.4rem 1.6rem; border-bottom: 1px solid var(--border);
}
.cv-modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.cv-modal-header p  { margin: .15rem 0 0; font-size: .82rem; opacity: .65; }
.cv-modal-header--approve { background: #f0fdf4; }
.cv-modal-header--reject  { background: #fef2f2; }
.cv-modal-header--payment { background: #fffbeb; }

.cv-modal-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.cv-modal-icon--approve { background: #dcfce7; color: #15803d; }
.cv-modal-icon--reject  { background: #fee2e2; color: #b91c1c; }
.cv-modal-icon--payment { background: #fef3c7; color: #d97706; }

/* Modal Body */
.cv-modal-body { padding: 1.4rem 1.6rem; }
.cv-modal-body > p { margin: 0 0 .8rem; color: var(--text-muted); font-size: .9rem; }
.cv-modal-list {
  list-style: none; padding: 0; margin: 0 0 1.2rem;
  display: flex; flex-direction: column; gap: .45rem;
}
.cv-modal-list li {
  display: flex; align-items: center; gap: .55rem;
  font-size: .9rem; color: var(--text);
}
.cv-modal-list li i { color: #15803d; font-size: .8rem; }

.cv-modal-amount {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .75rem 1rem; margin-top: .4rem;
  font-size: .9rem; color: var(--text-muted);
}
.cv-modal-amount strong { font-size: 1.1rem; color: var(--primary); font-weight: 800; }

/* Modal Form elements */
.cv-modal-label  { display: block; font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: .3rem; }
.cv-required     { color: #e53e3e; margin-left: .15rem; }
.cv-modal-input, .cv-modal-select, .cv-modal-textarea {
  width: 100%; padding: .55rem .75rem; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .9rem; color: var(--text);
  background: #fff; transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.cv-modal-input:focus, .cv-modal-select:focus, .cv-modal-textarea:focus {
  border-color: var(--primary); outline: none;
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.cv-modal-textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.cv-input-error   { border-color: #e53e3e !important; }
.cv-field-error   { margin: .3rem 0 0; font-size: .78rem; color: #e53e3e; display: flex; align-items: center; gap: .3rem; }
.cv-modal-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.cv-modal-field   { display: flex; flex-direction: column; }
.cv-modal-field--full { grid-column: 1/-1; }

/* Modal Footer */
.cv-modal-footer {
  display: flex; justify-content: flex-end; gap: .65rem;
  padding: 1rem 1.6rem 1.4rem; border-top: 1px solid var(--border);
}
.cv-modal-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.25rem; border-radius: 8px; font-size: .88rem;
  font-weight: 700; cursor: pointer; border: none; transition: all .15s;
}
.cv-modal-btn:disabled { opacity: .6; cursor: not-allowed; }
.cv-modal-btn--ghost   { background: #f1f5f9; color: var(--text-muted); border: 1.5px solid var(--border); }
.cv-modal-btn--ghost:hover:not(:disabled) { background: var(--border); }
.cv-modal-btn--approve { background: linear-gradient(135deg,#22c55e,#16a34a); color: #fff; }
.cv-modal-btn--approve:hover:not(:disabled) { background: linear-gradient(135deg,#16a34a,#15803d); }
.cv-modal-btn--reject  { background: linear-gradient(135deg,#ef4444,#dc2626); color: #fff; }
.cv-modal-btn--reject:hover:not(:disabled) { background: linear-gradient(135deg,#dc2626,#b91c1c); }
.cv-modal-btn--payment { background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; }
.cv-modal-btn--payment:hover:not(:disabled) { background: linear-gradient(135deg,#d97706,#b45309); }

@media (max-width: 540px) {
  .cv-modal-grid { grid-template-columns: 1fr; }
  .cv-modal-field--full { grid-column: 1; }
  .cv-modal-footer { flex-direction: column-reverse; }
  .cv-modal-btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════
   Under Review Screen  (.ur-*)
   ═══════════════════════════════════════════════ */

/* Wrapper */
.ur-wrapper {
  max-width: 640px;
  margin: 2.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 1rem 3rem;
}

/* ── Hero ── */
.ur-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}
.ur-hero-icon-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 3px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 0 8px rgba(37,99,235,.07);
  animation: ur-pulse-ring 2.4s ease-in-out infinite;
}
@keyframes ur-pulse-ring {
  0%, 100% { box-shadow: 0 0 0 8px rgba(37,99,235,.07); }
  50%       { box-shadow: 0 0 0 16px rgba(37,99,235,.03); }
}
.ur-hero-icon {
  font-size: 2.1rem;
  color: #2563eb;
}
.ur-hero-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
}
.ur-hero-sub {
  font-size: .97rem;
  color: var(--muted);
  max-width: 400px;
  line-height: 1.55;
  margin: 0;
}

/* ── Card ── */
.ur-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ur-card-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
}
.ur-card-header-icon {
  font-size: .95rem;
  color: var(--accent);
}

/* ── Summary Grid ── */
.ur-summary-grid {
  display: flex;
  flex-direction: column;
}
.ur-summary-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}
.ur-summary-row:last-child { border-bottom: none; }
.ur-summary-row:hover { background: #fafbfc; }
.ur-summary-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.ur-summary-body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  flex: 1;
}
.ur-summary-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.ur-summary-value {
  font-size: .97rem;
  font-weight: 600;
  color: var(--text);
}
.ur-id {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .03em;
}
.ur-fee {
  color: #7c3aed;
  font-weight: 800;
  font-size: 1.05rem;
}

/* ── Status Badge ── */
.ur-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .75rem;
  border-radius: 20px;
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #854d0e;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.ur-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #eab308;
  animation: ur-dot-blink 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes ur-dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* ── Steps ── */
.ur-steps {
  display: flex;
  flex-direction: column;
  padding: .5rem 1.5rem 1rem;
}
.ur-step {
  display: grid;
  grid-template-columns: 28px 2px 1fr;
  gap: 0 .85rem;
  align-items: start;
  padding: .85rem 0;
}
.ur-step-last {
  grid-template-columns: 28px 1fr;
}
.ur-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 6px rgba(30,58,95,.25);
}
.ur-step-connector {
  width: 2px;
  background: linear-gradient(to bottom, #cbd5e1 0%, #e2e8f0 100%);
  margin: 0 auto;
  min-height: 40px;
  align-self: stretch;
}
.ur-step-body {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding-top: .1rem;
  width: 100%;
  min-width: 0;
}
.ur-step-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ur-step-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  gap: .2rem;
  padding-top: .1rem;
}
.ur-step-title {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  word-break: normal;
  overflow-wrap: break-word;
}
.ur-step-desc {
  display: block;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.5;
  word-break: normal;
  overflow-wrap: break-word;
}

/* ── Action ── */
.ur-actions {
  display: flex;
  justify-content: center;
}
.ur-btn-back {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem 2rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(30,58,95,.28);
  transition: var(--ease);
  letter-spacing: .01em;
}
.ur-btn-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(30,58,95,.36);
  color: #fff;
}
.ur-btn-back i {
  font-size: .85rem;
}

/* ── Green variant (admin success) ── */
.ur-hero-icon-ring--green {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
  box-shadow: 0 0 0 8px rgba(22,163,74,.07);
}
.ur-hero-icon-ring--green .ur-hero-icon { color: #16a34a; }
@keyframes ur-pulse-ring-green {
  0%, 100% { box-shadow: 0 0 0 8px rgba(22,163,74,.07); }
  50%       { box-shadow: 0 0 0 16px rgba(22,163,74,.03); }
}
.ur-hero-icon-ring--green { animation: ur-pulse-ring-green 2.4s ease-in-out infinite; }
.ur-status-badge--green {
  background: #f0fdf4; border-color: #86efac; color: #15803d;
}
.ur-status-dot--green { background: #22c55e; }
/* ── Amber variant (admin-created / pending payment) ── */
.ur-hero-icon-ring--amber {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fcd34d;
  box-shadow: 0 0 0 8px rgba(217,119,6,.07);
  animation: ur-pulse-ring-amber 2.4s ease-in-out infinite;
}
.ur-hero-icon-ring--amber .ur-hero-icon { color: #d97706; }
.ur-hero-icon--amber { color: #d97706; }
@keyframes ur-pulse-ring-amber {
  0%, 100% { box-shadow: 0 0 0 8px rgba(217,119,6,.07); }
  50%       { box-shadow: 0 0 0 16px rgba(217,119,6,.03); }
}
.ur-status-badge--amber {
  background: #fffbeb; border-color: #fcd34d; color: #b45309;
}
.ur-status-dot--amber { background: #f59e0b; animation: ur-dot-blink 1.6s ease-in-out infinite; }

/* ── Step 5 Confirm Panel (.ncp-confirm-*) ── */
.ncp-confirm-panel {
  border: 1.5px solid #fcd34d;
  border-radius: 12px;
  background: #fffbeb;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.ncp-confirm-header {
  display: flex; align-items: center; gap: .7rem;
  padding: .9rem 1.25rem;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  font-size: .9rem; font-weight: 700; color: #92400e;
}
.ncp-confirm-header i { font-size: 1rem; }
.ncp-confirm-steps {
  list-style: none; padding: 1rem 1.25rem; margin: 0;
  display: flex; flex-direction: column; gap: .9rem;
}
.ncp-confirm-steps li {
  display: flex; align-items: flex-start; gap: .9rem;
}
.ncp-confirm-step-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.ncp-confirm-steps li > div:last-child {
  display: flex; flex-direction: column; gap: .15rem; font-size: .88rem;
}
.ncp-confirm-steps li strong { color: var(--text); }
.ncp-confirm-steps li span   { color: var(--text-muted); }
.ncp-confirm-amount {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 1.25rem;
  border-top: 1px solid #fcd34d;
  background: #fef9c3;
  gap: 1rem; flex-wrap: wrap;
}
.ncp-confirm-amount > div  { display: flex; flex-direction: column; gap: .1rem; }
.ncp-confirm-amount-label  { font-size: .75rem; color: #78350f; font-weight: 600; }
.ncp-confirm-amount-value  { font-size: 1.15rem; font-weight: 800; color: #92400e; }

.ur-btn-secondary {
  background: var(--surface) !important;
  color: var(--primary) !important;
  border: 2px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}
.ur-btn-secondary:hover {
  background: #f8fafc !important;
  box-shadow: var(--shadow-md) !important;
  color: var(--primary) !important;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .ur-hero-title { font-size: 1.35rem; }
  .ur-card-header { padding: .75rem 1rem; }
  .ur-summary-row { padding: .75rem 1rem; }
  .ur-steps { padding: .5rem 1rem .75rem; }
  .ur-step-body { gap: .7rem; }
  .ur-step-title { font-size: .92rem; line-height: 1.3; }
  .ur-step-desc { font-size: .84rem; line-height: 1.45; }
}

/* ═══════════════════════════════════════════════
   Review Step  (.rv-*)  –  Enterprise Navy/Gold
   ═══════════════════════════════════════════════ */
.rv-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: .5rem 0 1.5rem;
}

/* ── Hero banner ── */
.rv-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.25rem 1.6rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2a4a72 60%, #1e3a5f 100%);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(30,58,95,.22);
}
.rv-hero-accent {
  position: absolute;
  top: -30%;
  right: -5%;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,160,32,.18) 0%, transparent 70%);
  pointer-events: none;
}
.rv-hero-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  flex-shrink: 0;
}
.rv-hero-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e8a020 0%, #f0b840 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e3a5f;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(232,160,32,.35);
}
.rv-hero-step-pill {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.8);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rv-hero-text {
  flex: 1;
  min-width: 0;
}
.rv-hero-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 .2rem;
  letter-spacing: -.01em;
}
.rv-hero-sub {
  font-size: .84rem;
  color: rgba(255,255,255,.6);
  margin: 0;
}

/* ── Sections grid ── */
.rv-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.rv-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,23,42,.05);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.rv-section:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(30,58,95,.1);
  border-color: #cbd5e1;
}
.rv-section-full {
  grid-column: 1 / -1;
}
/* Fee summary always spans full width for breathing room */
.rv-section--fees {
  grid-column: 1 / -1;
}

/* ── Section header ── */
.rv-section-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.1rem;
  background: var(--rv-bg, #f8fafc);
  border-bottom: 2px solid rgba(30,58,95,.06);
  font-size: .9rem;
  font-weight: 700;
  color: var(--rv-color, #1e3a5f);
  flex-wrap: nowrap;
}
.rv-section-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--rv-color, #1e3a5f);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.rv-section-title-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}
.rv-section-title {
  font-size: .9rem;
  font-weight: 800;
  color: #1e3a5f;
  white-space: nowrap;
}
.rv-section-sub {
  font-size: .72rem;
  color: #64748b;
  font-weight: 600;
  margin-top: .12rem;
  white-space: nowrap;
}
.rv-section-count {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: rgba(30,58,95,.08);
  color: #1e3a5f;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .02em;
  white-space: nowrap;
}
.rv-section-count--green {
  background: rgba(22,163,74,.1);
  color: #15803d;
}
.rv-section-count--gold {
  background: rgba(232,160,32,.12);
  color: #92400e;
}
.rv-section-count--orange {
  background: rgba(234,88,12,.1);
  color: #c2410c;
}

/* ── Data list ── */
.rv-dl {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: .25rem 0 .15rem;
}
.rv-dl dt {
  font-size: .7rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .55rem 1.1rem .15rem;
  display: flex;
  align-items: center;
  margin: 0;
}
.rv-dl dd {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  padding: 0 1.1rem .55rem;
  border-bottom: 1px solid #f1f5f9;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .4rem;
  min-height: 0;
}
.rv-dl dd:last-of-type { border-bottom: none; }
.rv-dt-icon {
  color: #94a3b8;
  font-size: .62rem;
  width: 13px;
  text-align: center;
  margin-right: .3rem;
  flex-shrink: 0;
}

/* ── Value styles ── */
.rv-value-code {
  display: inline-flex;
  align-items: center;
  padding: .12rem .52rem;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #1e3a5f;
  font-size: .88rem;
  font-weight: 700;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  letter-spacing: .02em;
}
.rv-value-currency {
  color: #1e3a5f;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ── Fee summary: horizontal row layout ── */
.rv-section--fees .rv-dl {
  padding: 0;
}
.rv-dl-fees {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: .25rem 0;
}
.rv-dl-fees dt {
  padding: .6rem 1.1rem .15rem;
}
.rv-dl-fees dd {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  color: #1e3a5f;
  font-weight: 700;
  font-size: .92rem;
  padding: 0 1.1rem .6rem;
  border-bottom: 1px solid #f1f5f9;
}
/* For fees: pair each dt+dd into a row using a sub-grid feel */
.rv-section--fees .rv-dl-fees {
  display: flex;
  flex-direction: column;
}
.rv-section--fees .rv-dl-fees dt {
  padding: .55rem 1.1rem .1rem;
}
.rv-section--fees .rv-dl-fees dd {
  padding: 0 1.1rem .55rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: .95rem;
}
.rv-section--fees .rv-dl-fees dd:last-of-type {
  border-bottom: none;
}

/* ── Doc chip ── */
.rv-doc-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: #15803d;
  font-weight: 600;
}
.rv-doc-chip .fa-circle-check {
  color: #16a34a;
}

/* ── Value pills ── */
.rv-value-main {
  font-weight: 700;
  color: #1e3a5f;
  font-size: .95rem;
}
.rv-value-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .18rem .58rem;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}
.rv-value-pill--navy {
  background: rgba(30,58,95,.08);
  border-color: rgba(30,58,95,.15);
  color: #1e3a5f;
}
.rv-value-pill--green {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

/* ── Total row ── */
.rv-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.1rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2a4a72 100%);
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255,255,255,.65);
  border-top: 2px solid rgba(232,160,32,.25);
}
.rv-total-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  white-space: nowrap;
}
.rv-total-label i {
  font-size: .82rem;
  color: rgba(232,160,32,.7);
}
.rv-total-amt {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f0b840;
  letter-spacing: .01em;
  text-shadow: 0 1px 4px rgba(0,0,0,.2);
  white-space: nowrap;
}

/* ── Additional tenants ── */
.rv-tenant-list {
  padding: .55rem 1rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.rv-tenant-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .65rem .85rem;
  background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background .15s ease, border-color .15s ease;
}
.rv-tenant-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.rv-tenant-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(30,58,95,.08);
  color: #64748b;
  font-size: .68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rv-tenant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f 0%, #2a5a8f 100%);
  color: #fff;
  font-size: .88rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(30,58,95,.2);
}
.rv-tenant-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.rv-tenant-name {
  font-size: .9rem;
  font-weight: 700;
  color: #1e3a5f;
}
.rv-tenant-rel {
  font-size: .76rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.rv-tenant-rel i {
  font-size: .62rem;
  color: #94a3b8;
}
.rv-tenant-docs {
  display: flex;
  gap: .4rem;
  flex-shrink: 0;
}
.rv-doc-tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .58rem;
  border-radius: 20px;
  background: rgba(30,58,95,.06);
  color: #1e3a5f;
  font-size: .74rem;
  font-weight: 600;
  border: 1px solid rgba(30,58,95,.1);
  transition: background .15s ease;
  white-space: nowrap;
}
.rv-doc-tag:hover {
  background: rgba(30,58,95,.1);
}

/* ── Confirmation notice ── */
.rv-confirm-notice {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem 1.15rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-left: 4px solid #e8a020;
  border-radius: var(--radius);
  font-size: .82rem;
  color: #92400e;
  font-weight: 600;
}
.rv-confirm-notice i {
  color: #e8a020;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Confirm button pulse ── */
.rv-confirm-btn {
  position: relative;
  overflow: visible;
}
.rv-confirm-btn::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid rgba(232,160,32,.35);
  animation: rv-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes rv-pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.02); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .rv-sections-grid { grid-template-columns: 1fr; }
  .rv-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.2rem;
  }
  .rv-hero-badge {
    flex-direction: row;
    gap: .6rem;
  }
  .rv-section:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(15,23,42,.05);
  }
  .rv-confirm-notice {
    font-size: .78rem;
  }
}

/* ── Additional Occupants list ──────────────── */
.cvr-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  margin-left: .45rem;
  vertical-align: middle;
}
.cvr-tenant-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: .25rem;
}
.cvr-tenant-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .65rem .85rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s;
}
.cvr-tenant-row:hover { border-color: #94a3b8; }
.cvr-tenant-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  font-size: .85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.cvr-tenant-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}
.cvr-tenant-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cvr-tenant-meta {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--muted);
}
.cvr-tenant-meta i { font-size: .72rem; }
.cvr-rel-pill {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 20px;
  background: #eff6ff;
  color: #2563eb;
  font-size: .72rem;
  font-weight: 600;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}
.cvr-tenant-docs {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}
.cvr-doc-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  border-radius: 20px;
  background: #f0fdf4;
  color: #16a34a;
  font-size: .74rem;
  font-weight: 600;
  border: 1px solid #bbf7d0;
  text-decoration: none;
  transition: var(--ease);
}
.cvr-doc-link:hover { background: #dcfce7; text-decoration: none; }

/* ── cv-btn-resend toolbar button ───────────── */
.cv-btn-resend {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .5rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  transition: var(--ease);
  box-shadow: 0 1px 4px rgba(14,165,233,.3);
}
.cv-btn-resend:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  box-shadow: 0 3px 10px rgba(14,165,233,.4);
  transform: translateY(-1px);
}
.cv-btn-resend:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ── Fee Waiver (request + approve) ─────────── */
.cv-alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

.cv-btn-waiver {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #fff; border: none;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem; border-radius: 8px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: var(--ease); box-shadow: 0 1px 4px rgba(139,92,246,.3);
}
.cv-btn-waiver:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  box-shadow: 0 3px 10px rgba(139,92,246,.4); transform: translateY(-1px);
}
.cv-btn-waiver:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.cv-modal-header--waiver { background: #f5f3ff; }
.cv-modal-icon--waiver   { background: #ede9fe; color: #7c3aed; }
.cv-modal-btn--waiver    { background: linear-gradient(135deg,#8b5cf6,#7c3aed); color: #fff; }
.cv-modal-btn--waiver:hover:not(:disabled) { background: linear-gradient(135deg,#7c3aed,#6d28d9); }

.cv-waiver-note {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .82rem; color: #475569; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 8px; padding: .6rem .75rem; margin: 0 0 1rem;
}
.cv-waiver-note i { color: #8b5cf6; margin-top: .1rem; }

.cv-waiver-check {
  display: flex; align-items: center; gap: .65rem;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  padding: .7rem .85rem; margin-bottom: .6rem; cursor: pointer; transition: var(--ease);
}
.cv-waiver-check:hover { border-color: #8b5cf6; background: #faf5ff; }
.cv-waiver-check input { width: 18px; height: 18px; accent-color: #7c3aed; cursor: pointer; }
.cv-waiver-check--disabled { opacity: .5; cursor: not-allowed; }
.cv-waiver-check--disabled:hover { border-color: #e2e8f0; background: transparent; }
.cv-waiver-check-text { display: flex; flex-direction: column; gap: .1rem; }
.cv-waiver-amount { font-size: .8rem; color: #64748b; }

.cv-waiver-summary {
  display: flex; justify-content: space-between; align-items: center;
  background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 8px;
  padding: .6rem .85rem; margin-top: .85rem; font-size: .9rem; color: #5b21b6;
}
.cv-waiver-summary strong { font-size: 1.05rem; }

/* ── Broker-credit split (confirm payment modal) ─────────── */
.cv-credit-box {
  border: 1.5px solid #ddd6fe; background: #f5f3ff;
  border-radius: 10px; padding: .85rem 1rem; margin-top: 1rem;
}
.cv-credit-box--warn { border-color: #fcd34d; background: #fffbeb; }
.cv-credit-toggle {
  display: flex; align-items: center; gap: .75rem; cursor: pointer;
}
.cv-credit-toggle input { width: 18px; height: 18px; accent-color: #7c3aed; cursor: pointer; flex-shrink: 0; }
.cv-credit-toggle > span { display: flex; flex-direction: column; gap: .1rem; flex: 1; }
.cv-credit-toggle strong { font-size: .9rem; color: #5b21b6; }
.cv-credit-toggle small { font-size: .78rem; color: #6b7280; }
.cv-credit-amt {
  font-size: .95rem; font-weight: 700; color: #7c3aed; white-space: nowrap;
}
.cv-credit-warn-row { display: flex; align-items: flex-start; gap: .6rem; font-size: .84rem; color: #92400e; }
.cv-credit-warn-row i { color: #f59e0b; margin-top: .15rem; flex-shrink: 0; }

/* ── Print styles for contract view ─────────── */
@media print {
  .cv-toolbar { display: none !important; }
  .cv-receipt { box-shadow: none !important; border-radius: 0 !important; margin: 0 !important; max-width: 100% !important; }
  .cvr-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cvr-fee-total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print { display: none !important; }
  .print-only { display: inline !important; }
  body { background: #fff !important; }
}

/* ── Responsive: Contracts Screen ───────────── */
@media (max-width: 1280px) {
  .cs-stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .cs-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cvr-grid-4, .cvr-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .cvr-section { padding: 1.25rem 1.5rem; }
  .cvr-header { padding: 1.5rem; }
  .cvr-footer { padding: .85rem 1.5rem; }
}
@media (max-width: 768px) {
  .cs-stats-grid { grid-template-columns: 1fr 1fr; }
  .cs-filter-bar { flex-direction: column; align-items: stretch; }
  .cs-search-wrap { min-width: unset; }
  .cs-filter-controls { justify-content: space-between; }
  .cs-table-wrapper { overflow-x: auto; }
  .cs-table { min-width: 820px; }
  .cv-toolbar { flex-wrap: wrap; padding: .75rem 1rem; top: 0; }
  .cv-toolbar-center { order: 3; width: 100%; }
}
@media (max-width: 640px) {
  .cs-stats-grid { grid-template-columns: 1fr 1fr; }
  .cvr-grid-4, .cvr-grid-3 { grid-template-columns: 1fr 1fr; }
  .cvr-grid-2 { grid-template-columns: 1fr; }
  .cs-page-header { flex-direction: column; align-items: stretch; }
  .cs-new-btn { justify-content: center; }
  .cv-toolbar-actions { flex-wrap: wrap; }
  .cs-filter-controls { width: 100%; }
  .cs-filter-controls .filter-select,
  .cs-filter-controls .btn-reset-filters {
    flex: 1 1 140px;
    min-width: 0;
  }
}

/* ═══════════════════════════════════════════
   Payment History / Financial Report Page
   ═══════════════════════════════════════════ */

/* ── Page wrapper ── */
.ph-page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-family: 'Cairo', sans-serif;
}
.ph-page-portal { max-width: 1400px; }

/* Force Cairo on form controls inside this page
   (buttons/inputs/selects default to system fonts otherwise) */
.ph-page button,
.ph-page input,
.ph-page select,
.ph-page textarea {
  font-family: 'Cairo', sans-serif;
}

/* ── Expandable rows + chevron ── */
.ph-table-compact .ph-th-expand,
.ph-table-compact .ph-td-expand { width: 36px; padding-left: .25rem; padding-right: .25rem; text-align: center; }

.ph-expand-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--muted);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--ease);
  font-size: .72rem;
  padding: 0;
}
.ph-expand-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.ph-expand-btn i {
  transition: transform .18s ease;
}
.ph-expand-btn.is-open i { transform: rotate(90deg); }
.ph-expand-btn.is-open {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Clickable rows */
.ph-tr-click { cursor: pointer; }
.ph-tr-click:hover { background: #eef4fb !important; }
.ph-tr-paid.ph-tr-click:hover { background: #dcfce7 !important; }
.ph-tr-expanded {
  background: #f1f5f9 !important;
}
.ph-tr-expanded.ph-tr-paid { background: #dcfce7 !important; }

/* Expanded detail row */
.ph-detail-row {
  background: #fafbfc;
  cursor: default;
}
.ph-detail-row:hover { background: #fafbfc; }
.ph-detail-row > td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border);
}
.ph-detail-card {
  padding: 1rem 1.25rem 1.1rem;
  background: linear-gradient(180deg, #fefefe 0%, #f8fafc 100%);
  border-left: 3px solid var(--accent);
}
.ph-detail-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: .75rem;
}
.ph-detail-title i { color: var(--accent); font-size: .78rem; }
.ph-detail-title strong { color: var(--primary); font-weight: 800; }
.ph-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .65rem;
}
.ph-detail-item {
  display: flex; flex-direction: column;
  gap: .25rem;
  padding: .65rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ph-detail-label {
  display: flex; align-items: center; gap: .35rem;
  font-size: .76rem; color: var(--muted); font-weight: 600;
}
.ph-detail-label i { color: var(--accent); font-size: .76rem; width: 14px; text-align: center; }
.ph-detail-value {
  font-size: .92rem; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ph-detail-total {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
}
.ph-detail-total .ph-detail-value { color: #92400e; font-size: 1rem; }

/* Compact table: tighten existing columns */
.ph-table-compact th,
.ph-table-compact td { padding: .65rem .85rem; }

@media (max-width: 768px) {
  .ph-detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .ph-detail-grid { grid-template-columns: 1fr; }
  .ph-expand-btn { width: 32px; height: 32px; }
}

/* ── Expandable row cursor ── */
.ph-tr-expandable { cursor: pointer; }
.ph-tr-expandable:hover { background: #eef4fb !important; }
.ph-tr-expandable.ph-tr-paid:hover { background: #d1fae5 !important; }

/* ── Fee breakdown inside detail row ── */
.ph-fee-breakdown {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  padding: .75rem 1.25rem;
  align-items: center;
}
.ph-fee-item {
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem;
}
.ph-fee-label {
  color: var(--muted, #6b7280);
  white-space: nowrap;
}
.ph-fee-label::after { content: ':'; }
.ph-fee-value {
  font-weight: 600; color: var(--primary, #1e3a5f);
  white-space: nowrap;
}
.ph-fee-item + .ph-fee-item::before {
  content: '·'; color: #d1d5db; margin-right: .5rem;
}
.ph-fee-total { margin-left: auto; padding-left: 1rem; border-left: 1px solid #e5e7eb; }
.ph-fee-total .ph-fee-label { font-weight: 700; color: var(--primary, #1e3a5f); }
.ph-fee-total .ph-fee-value { font-size: .9rem; color: #15803d; }
.ph-fee-total::before { display: none; }

/* ── Toolbar ── */
.ph-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2030 55%, #1c2d4a 100%);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  position: sticky;
  top: 60px;
  z-index: 40;
  overflow: hidden;
}
.ph-page:not(.ph-page-portal) .ph-toolbar::before {
  content: "";
  position: absolute;
  top: -52px;
  right: -28px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,164,76,.22) 0%, transparent 65%);
  pointer-events: none;
}
.ph-page:not(.ph-page-portal) .ph-toolbar::after {
  content: "";
  position: absolute;
  bottom: -42px;
  left: 35%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,.12) 0%, transparent 65%);
  pointer-events: none;
}
.ph-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  font-weight: 600;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  padding: .4rem .7rem;
  border-radius: var(--radius-sm);
  transition: var(--ease);
  flex-shrink: 0;
}
.ph-back-btn:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.ph-toolbar-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.ph-toolbar-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(212,164,76,.22);
  border: 1px solid rgba(212,164,76,.42);
  color: #f8d28b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ph-toolbar-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.ph-toolbar-sub {
  font-size: .78rem;
  color: rgba(255,255,255,.75);
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-toolbar-actions {
  display: flex;
  gap: .6rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Keep portal payment toolbar on the previous light style (admin-only hero change) */
.ph-page-portal .ph-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.ph-page-portal .ph-toolbar::before,
.ph-page-portal .ph-toolbar::after {
  content: none;
}
.ph-page-portal .ph-back-btn { color: var(--muted); }
.ph-page-portal .ph-back-btn:hover { background: var(--surface-alt); color: var(--text); }
.ph-page-portal .ph-toolbar-icon-wrap {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border: none;
  color: #fff;
}
.ph-page-portal .ph-toolbar-heading { color: var(--text); }
.ph-page-portal .ph-toolbar-sub { color: var(--muted); }

/* ── Toolbar buttons ── */
.ph-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--ease);
  white-space: nowrap;
}
.ph-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.ph-btn-excel {
  background: linear-gradient(135deg, #166534 0%, #15803d 100%);
  color: #fff;
  box-shadow: 0 1px 4px rgba(22,101,52,.3);
}
.ph-btn-excel:hover:not(:disabled) { background: linear-gradient(135deg, #14532d 0%, #166534 100%); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(22,101,52,.35); }
.ph-btn-print {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  box-shadow: 0 1px 4px rgba(30,58,95,.3);
}
.ph-btn-print:hover:not(:disabled) { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); transform: translateY(-1px); }
.ph-btn-search {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
}
.ph-btn-search:hover:not(:disabled) { transform: translateY(-1px); }
.ph-btn-clear {
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--border);
}
.ph-btn-clear:hover:not(:disabled) { background: var(--border); color: var(--text); }

/* ── Filters card ── */
.ph-filters-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.ph-filters-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.ph-filter-group { display: flex; flex-direction: column; gap: .35rem; }
.ph-filter-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ph-filter-input {
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text);
  background: var(--surface-alt);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.ph-filter-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,168,.12);
}
.ph-filter-actions {
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* ── Loading ── */
.ph-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 3rem 0;
  color: var(--muted);
  font-size: 1rem;
}
.ph-loading i { font-size: 1.5rem; color: var(--primary-light); }

/* ── Summary cards ── */
.ph-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.ph-summary-card {
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
}
.ph-sum-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.ph-sum-body { flex: 1; min-width: 0; }
.ph-sum-value {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-sum-label { font-size: .8rem; font-weight: 600; opacity: .75; margin-top: .2rem; }

.ph-sum-navy  { background: linear-gradient(135deg, #1e3a5f 0%, #2563a8 100%); color: #fff; }
.ph-sum-green { background: linear-gradient(135deg, #166534 0%, #16a34a 100%); color: #fff; }
.ph-sum-amber { background: linear-gradient(135deg, #92400e 0%, #d97706 100%); color: #fff; }
.ph-sum-blue  { background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%); color: #fff; }
.ph-sum-navy .ph-sum-icon  { background: rgba(255,255,255,.18); }
.ph-sum-green .ph-sum-icon { background: rgba(255,255,255,.18); }
.ph-sum-amber .ph-sum-icon { background: rgba(255,255,255,.18); }
.ph-sum-blue .ph-sum-icon  { background: rgba(255,255,255,.18); }

/* ── Empty state ── */
.ph-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--muted);
}
.ph-empty i { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.ph-empty h3 { font-size: 1.1rem; color: var(--text); margin: 0 0 .5rem; }
.ph-empty p  { font-size: .9rem; margin: 0; }

/* ── Table wrapper ── */
.ph-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.ph-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
  min-width: 1100px;
}
.ph-table thead tr {
  background: var(--primary);
  color: #fff;
}
.ph-table th {
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 2px solid rgba(255,255,255,.1);
}
.ph-th-num  { width: 40px; text-align: center; }
.ph-th-amt  { text-align: right; }
.ph-th-total {
  background: rgba(255,255,255,.1);
  color: #fde68a;
}
.ph-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ph-table tbody tr:last-child td { border-bottom: none; }
.ph-table tbody tr:hover { background: #f1f5f9; }
.ph-tr-paid { background: #f0fdf4 !important; }
.ph-tr-paid:hover { background: #dcfce7 !important; }

/* ── Cell types ── */
.ph-td-num  { text-align: center; color: var(--muted); font-size: .78rem; }
.ph-td-amt  { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.ph-td-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: #fefce8;
  color: #854d0e;
}
.ph-td-date   { white-space: nowrap; color: var(--muted); font-size: .8rem; }
.ph-td-method { color: var(--muted); font-size: .82rem; }
.ph-contract-link {
  font-weight: 700;
  color: var(--primary-light);
  text-decoration: none;
  font-size: .85rem;
}
.ph-contract-link:hover { text-decoration: underline; }
.ph-contract-ref {
  font-weight: 700;
  color: var(--primary);
  font-size: .85rem;
}
.ph-unit-main { font-weight: 700; font-size: .85rem; color: var(--text); }
.ph-unit-sub  { font-size: .75rem; color: var(--muted); margin-top: .1rem; }
.ph-person    { font-size: .85rem; color: var(--text); }

/* ── Created by column ── */
.ph-createdby-wrap {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.ph-createdby-name { font-size: .83rem; color: var(--text); }
.ph-role-pill {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  width: fit-content;
}
.ph-role-admin       { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.ph-role-owner       { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.ph-role-broker      { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.ph-role-coordinator { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* ── Payment status cell ── */
.ph-status-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  width: fit-content;
}
.ph-pay-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: .25rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.ph-status-cell .ph-pay-url-btn {
  justify-content: center;
}
.ph-pay-paid      { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.ph-pay-unpaid    { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.ph-pay-cancelled { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }

/* ── Payment URL link (admin page — icon only) ── */
.ph-pay-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  font-size: .75rem;
  text-decoration: none;
  transition: var(--ease);
}
.ph-pay-link:hover { background: #2563eb; color: #fff; text-decoration: none; }

/* ── Payment URL button (portal page — "Pay Now") ── */
.ph-pay-url-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 700;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #fff;
  text-decoration: none;
  transition: var(--ease);
  box-shadow: 0 1px 4px rgba(217,119,6,.3);
  white-space: nowrap;
}
.ph-pay-url-btn:hover { background: linear-gradient(135deg, #b45309 0%, #d97706 100%); transform: translateY(-1px); text-decoration: none; }

/* ── View button ── */
.ph-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: .9rem;
  transition: var(--ease);
}
.ph-view-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

/* ── Table footer totals row ── */
.ph-tfoot-row { background: #f8fafc; }
.ph-tfoot-row td { border-top: 2px solid var(--border); padding: .65rem 1rem; }
.ph-tfoot-label {
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}
.ph-tfoot-total {
  background: #fef9c3;
  color: #854d0e;
  text-align: right;
  font-size: .9rem;
}

/* ── Totals bar ── */
.ph-totals-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  row-gap: .75rem;
}
.ph-total-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
  min-width: 160px;
}
.ph-total-sep {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin: 0 1.25rem;
  flex-shrink: 0;
}
.ph-ti-icon { font-size: 1.25rem; flex-shrink: 0; }
.ph-ti-label { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ph-ti-value { font-size: .95rem; font-weight: 800; margin-top: .15rem; }
.ph-ti-green { color: #16a34a; }
.ph-ti-amber { color: #d97706; }
.ph-ti-navy  { color: var(--primary); }
.ph-ti-muted { color: var(--text); }

/* ── Print-only header ── */
.ph-print-header { display: none; }
.ph-print-header h1 { font-size: 1.4rem; margin: 0 0 .2rem; color: var(--primary); }
.ph-print-header p  { font-size: .85rem; color: var(--muted); margin: 0; }
.print-only { display: none; }

/* ── Responsive ── */
@media (max-width: 1280px) {
  .ph-filters-grid { grid-template-columns: repeat(3, 1fr); }
  .ph-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .ph-page { padding: 1rem; }
  .ph-filters-grid { grid-template-columns: repeat(2, 1fr); }
  .ph-toolbar-sub { display: none; }
}
@media (max-width: 640px) {
  .ph-filters-grid { grid-template-columns: 1fr; }
  .ph-summary-grid { grid-template-columns: 1fr 1fr; }
  .ph-toolbar-actions .ph-btn span { display: none; }
  .ph-toolbar-actions .ph-btn { padding: .5rem .7rem; }
  .ph-total-sep { display: none; }
  .ph-total-item { min-width: 140px; }
}

/* ── Print overrides for payment history ── */
@media print {
  .ph-toolbar, .ph-filters-card, .ph-totals-bar { display: none !important; }
  .ph-page { padding: 0; gap: .75rem; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  .ph-print-header { display: block !important; margin-bottom: 1rem; }
  .ph-table { min-width: unset; font-size: .75rem; }
  .ph-table th, .ph-table td { padding: .35rem .5rem; }
  .ph-summary-grid { grid-template-columns: repeat(4, 1fr); }
  .ph-summary-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ph-tr-paid { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ph-tfoot-total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ═══════════════════════════════════════════════
   Units & Properties Section  (up- prefix)
   Colors: navy · gold/amber · white · gray
   ═══════════════════════════════════════════════ */

/* ── Page header ── */
.up-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .25rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2030 55%, #1c2d4a 100%);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  padding: .95rem 1.1rem;
  position: relative;
  overflow: hidden;
}
.up-page-header::before {
  content: "";
  position: absolute;
  top: -52px;
  right: -28px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,164,76,.22) 0%, transparent 65%);
  pointer-events: none;
}
.up-page-header::after {
  content: "";
  position: absolute;
  bottom: -42px;
  left: 35%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,.12) 0%, transparent 65%);
  pointer-events: none;
}
.up-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.up-header-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(212,164,76,.22);
  border: 1px solid rgba(212,164,76,.42);
  color: #f8d28b;
  font-size: 1.35rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15,23,42,.22);
}
.up-title {
  font-size: 1.4rem; font-weight: 800;
  color: #fff; margin: 0;
  letter-spacing: -.02em;
}
.up-subtitle {
  font-size: .83rem; color: rgba(255,255,255,.75);
  margin: .2rem 0 0;
}
.up-add-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.25rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary-dark);
  border: none; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 8px rgba(232,160,32,.35);
  transition: var(--ease);
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.up-add-btn:hover {
  background: linear-gradient(135deg, #d4900f 0%, var(--accent) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(232,160,32,.45);
}

/* ── Stats row ── */
.up-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem;
}
.up-stat {
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: .85rem;
  box-shadow: var(--shadow-sm);
}
.up-stat-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.up-stat-body { flex: 1; min-width: 0; }
.up-stat-val {
  font-size: 1.5rem; font-weight: 900;
  line-height: 1.1; color: inherit;
}
.up-stat-unit { font-size: 1rem; font-weight: 700; }
.up-stat-lbl {
  font-size: .76rem; font-weight: 600;
  opacity: .8; margin-top: .2rem;
  text-transform: uppercase; letter-spacing: .04em;
}
/* Navy stat */
.up-stat-navy { background: linear-gradient(135deg, #1e3a5f 0%, #2563a8 100%); color: #fff; }
.up-stat-navy .up-stat-icon { background: rgba(255,255,255,.15); color: #fff; }
/* Gold stat */
.up-stat-gold { background: linear-gradient(135deg, #92400e 0%, #d97706 100%); color: #fff; }
.up-stat-gold .up-stat-icon { background: rgba(255,255,255,.15); color: #fff; }
/* Gray stat */
.up-stat-gray { background: linear-gradient(135deg, #374151 0%, #6b7280 100%); color: #fff; }
.up-stat-gray .up-stat-icon { background: rgba(255,255,255,.15); color: #fff; }
/* Teal stat */
.up-stat-teal { background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%); color: #fff; }
.up-stat-teal .up-stat-icon { background: rgba(255,255,255,.15); color: #fff; }

/* ── Filter bar ── */
.up-filter-bar {
  display: flex; align-items: center; gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.up-search-wrap {
  flex: 1; min-width: 220px;
  position: relative;
}
.up-search-icon {
  position: absolute; left: .85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); font-size: .85rem;
  pointer-events: none;
}
.up-search-input {
  width: 100%;
  padding: .55rem .75rem .55rem 2.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem; background: var(--surface-alt);
  color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.up-search-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,168,.12);
}
.up-filter-select {
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem; background: var(--surface-alt);
  color: var(--text); cursor: pointer;
  transition: border-color .15s;
}
.up-filter-select:focus { outline: none; border-color: var(--primary-light); }
.up-reset-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: var(--ease);
  white-space: nowrap;
}
.up-reset-btn:hover { background: var(--border); color: var(--text); }

/* ── Loading & empty states ── */
.up-loading {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; padding: 3rem 0;
  color: var(--muted); font-size: 1rem;
}
.up-loading i { font-size: 1.5rem; color: var(--primary-light); }
.up-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3.5rem 2rem; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.up-empty-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; font-size: 1.75rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; opacity: .55;
}
.up-empty h3 { font-size: 1.05rem; color: var(--text); margin: 0 0 .4rem; }
.up-empty p  { font-size: .87rem; color: var(--muted); margin: 0 0 1.25rem; }

/* ── Table ── */
.up-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
}
.up-table {
  width: 100%; border-collapse: collapse;
  font-size: .85rem; min-width: 820px;
}
.up-table thead tr {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}
.up-table th {
  padding: .85rem 1rem; text-align: left;
  font-size: .75rem; font-weight: 700;
  color: rgba(255,255,255,.9);
  letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 2px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
.up-th-unit { width: 140px; }
.up-th-actions { width: 120px; text-align: center; }
.up-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.up-table tbody tr:last-child td { border-bottom: none; }
.up-tr { transition: background .12s; }
.up-tr:hover { background: #f8fafc; }
.up-tr-occupied { border-left: 3px solid var(--accent); }
.up-tr-vacant   { border-left: 3px solid #cbd5e1; }

/* ── Unit cell ── */
.up-unit-cell {
  display: flex; align-items: center; gap: .7rem;
}
.up-unit-badge {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.up-ub-gold { background: linear-gradient(135deg, #92400e 0%, #d97706 100%); color: #fff; }
.up-ub-gray { background: #e2e8f0; color: #64748b; }
.up-unit-num { font-size: .9rem; font-weight: 800; color: var(--text); }
.up-unit-apt { font-size: .75rem; color: var(--muted); margin-top: .1rem; }

/* ── Property cell ── */
.up-property-cell { display: flex; flex-direction: column; gap: .2rem; }
.up-prop-building {
  font-size: .85rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: .35rem;
}
.up-prop-community {
  font-size: .77rem; color: var(--muted);
  display: flex; align-items: center; gap: .3rem;
}
.up-prop-icon    { font-size: .78rem; color: var(--primary-light); }
.up-prop-icon-sm { font-size: .72rem; color: #94a3b8; }

/* ── Owner cell ── */
.up-owner-cell {
  display: flex; align-items: center; gap: .6rem;
}
.up-owner-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; font-size: .78rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.up-owner-name { font-size: .85rem; font-weight: 600; color: var(--text); }

/* ── Type badge ── */
.up-type-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .65rem; border-radius: 20px;
  background: #ede9fe; color: #5b21b6;
  font-size: .78rem; font-weight: 700;
  border: 1px solid #ddd6fe; white-space: nowrap;
}

/* ── Status badges ── */
.up-status-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .75rem; border-radius: 20px;
  font-size: .78rem; font-weight: 700;
  white-space: nowrap;
}
.up-status-occupied {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e; border: 1.5px solid #fcd34d;
}
.up-status-vacant {
  background: #f1f5f9; color: #64748b;
  border: 1.5px solid #cbd5e1;
}

/* ── Tenant cell ── */
.up-tenant-cell { display: flex; align-items: center; gap: .6rem; }
.up-tenant-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #dcfce7; color: #166534;
  font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.up-tenant-name { font-size: .84rem; font-weight: 600; color: var(--text); }
.up-tenant-contract {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .74rem; color: var(--primary-light);
  text-decoration: none; margin-top: .15rem;
}
.up-tenant-contract:hover { text-decoration: underline; }

/* ── Muted cell value ── */
.up-td-muted { color: var(--muted); font-size: .83rem; }

/* ── Action buttons ── */
.up-actions {
  display: flex; align-items: center; gap: .4rem;
  justify-content: center;
}
.up-act-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; cursor: pointer;
  transition: var(--ease); text-decoration: none;
  background: var(--surface-alt); color: var(--muted);
}
.up-act-btn:hover { text-decoration: none; transform: translateY(-1px); }
.up-act-history:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.up-act-contract:hover { background: #16a34a; color: #fff; border-color: #16a34a; }
.up-act-delete:hover  { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ── Table footer ── */
.up-table-footer {
  display: flex; align-items: center; justify-content: flex-end;
  padding: .65rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}
.up-table-count {
  font-size: .78rem; color: var(--muted); font-weight: 600;
  display: flex; align-items: center; gap: .4rem;
}

/* ═══════════════════════════════════════════════
   Add Unit Modal  (aum- prefix)
   ═══════════════════════════════════════════════ */

.aum-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,32,48,.92);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: aum-fade-in .18s ease;
}
@keyframes aum-fade-in { from { opacity: 0; } to { opacity: 1; } }

.aum-modal {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: aum-slide-in .22s ease;
  display: flex; flex-direction: column;
}
@keyframes aum-slide-in {
  from { transform: translateY(16px) scale(.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Header */
.aum-header {
  display: flex; align-items: center; gap: .9rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.aum-header-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(30,58,95,.25);
}
.aum-header-text { flex: 1; min-width: 0; }
.aum-title { font-size: 1.1rem; font-weight: 800; color: var(--text); margin: 0; }
.aum-subtitle { font-size: .8rem; color: var(--muted); margin: .2rem 0 0; }
.aum-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-alt);
  color: var(--muted); font-size: .9rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--ease); flex-shrink: 0;
}
.aum-close:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* Error banner */
.aum-error-banner {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1.25rem;
  background: #fef2f2; border-bottom: 1px solid #fecaca;
  color: #991b1b; font-size: .85rem; font-weight: 600;
}

/* Section */
.aum-section { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.aum-section-label {
  font-size: .7rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  display: flex; align-items: center; gap: .35rem;
  margin-bottom: .75rem;
}

/* Method toggle */
.aum-method-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  margin-bottom: 1rem;
}
.aum-method-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-alt); color: var(--muted);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  transition: var(--ease);
}
.aum-method-btn:hover { border-color: var(--primary-light); color: var(--primary-light); }
.aum-method-active {
  border-color: var(--primary) !important;
  background: rgba(30,58,95,.07) !important;
  color: var(--primary) !important;
}

/* Search row */
.aum-search-row { display: flex; gap: .6rem; }
.aum-input-wrap {
  flex: 1; position: relative;
}
.aum-input-icon {
  position: absolute; left: .85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); font-size: .85rem; pointer-events: none;
}
.aum-input {
  width: 100%;
  padding: .6rem .75rem .6rem 2.25rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .875rem; background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.aum-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,168,.12);
}
.aum-lookup-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.1rem; white-space: nowrap;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 700; cursor: pointer;
  transition: var(--ease); box-shadow: 0 2px 6px rgba(30,58,95,.25);
}
.aum-lookup-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,58,95,.3); }
.aum-lookup-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Result card */
.aum-result-card {
  margin: 0; border-top: 1px solid var(--border);
  background: var(--surface-alt); padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.aum-result-found-banner {
  display: flex; align-items: center; gap: .55rem;
  padding: .6rem .9rem; border-radius: var(--radius-sm);
  background: #dcfce7; color: #166534;
  font-size: .85rem; font-weight: 700; margin-bottom: 1rem;
  border: 1px solid #bbf7d0;
}
.aum-result-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem .6rem;
  margin-bottom: 1rem;
}
.aum-rf { display: flex; flex-direction: column; gap: .2rem; }
.aum-rf-label {
  font-size: .72rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  display: flex; align-items: center; gap: .3rem;
}
.aum-rf-value { font-size: .875rem; font-weight: 600; color: var(--text); }
.aum-community-fixed {
  display: flex; align-items: center; gap: .5rem;
  border-top: 1px dashed var(--border); padding-top: .9rem; margin-top: .25rem;
  font-size: .9rem; font-weight: 600; color: var(--primary);
}
.aum-community-fixed i { font-size: 1rem; color: var(--gold); }
.aum-community-id {
  margin-left: auto; font-size: .75rem; font-weight: 500;
  color: var(--muted); background: var(--surface-alt); padding: .15rem .5rem;
  border-radius: var(--radius-sm);
}

/* Not-found state */
.aum-not-found {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: 1rem 1.5rem;
  background: #fef2f2; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.aum-nf-icon { font-size: 1.5rem; color: #dc2626; flex-shrink: 0; margin-top: .1rem; }
.aum-not-found strong { font-size: .9rem; color: #991b1b; display: block; margin-bottom: .25rem; }
.aum-not-found p { font-size: .82rem; color: #b91c1c; margin: 0; }

/* Footer */
.aum-footer {
  display: flex; justify-content: flex-end; align-items: center; gap: .6rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.aum-cancel-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-alt); color: var(--muted);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  transition: var(--ease);
}
.aum-cancel-btn:hover { background: var(--border); color: var(--text); }
.aum-confirm-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.25rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary-dark);
  border: none; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 700; cursor: pointer;
  transition: var(--ease); box-shadow: 0 2px 8px rgba(232,160,32,.3);
}
.aum-confirm-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(232,160,32,.4); }
.aum-confirm-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ═══════════════════════════════════════════════
   Unit History Modal  (uhm- prefix)
   ═══════════════════════════════════════════════ */

.uhm-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,32,48,.92);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: aum-fade-in .18s ease;
}
.uhm-modal {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  width: 100%; max-width: 860px;
  max-height: 90vh; overflow-y: auto;
  animation: aum-slide-in .22s ease;
  display: flex; flex-direction: column;
}

/* Header */
.uhm-header {
  display: flex; align-items: center; gap: .9rem;
  padding: 1.4rem 1.5rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}
.uhm-header-icon {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  background: rgba(255,255,255,.15); color: #fff; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.uhm-header-text { flex: 1; min-width: 0; }
.uhm-title { font-size: 1.05rem; font-weight: 800; color: #fff; margin: 0; }
.uhm-subtitle {
  font-size: .8rem; color: rgba(255,255,255,.75); margin: .2rem 0 0;
  display: flex; align-items: center; gap: .3rem;
}
.uhm-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color: #fff;
  font-size: .9rem; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: var(--ease);
}
.uhm-close:hover { background: rgba(255,255,255,.25); }

/* Loading & empty */
.uhm-loading {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; padding: 3rem; color: var(--muted);
}
.uhm-loading i { font-size: 1.5rem; color: var(--primary-light); }
.uhm-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 2.5rem; text-align: center; color: var(--muted);
}
.uhm-empty i { font-size: 2.5rem; margin-bottom: .75rem; opacity: .4; }
.uhm-empty p { font-size: .9rem; margin: 0; }

/* Table */
.uhm-table-wrap { overflow-x: auto; }
.uhm-table {
  width: 100%; border-collapse: collapse;
  font-size: .84rem; min-width: 620px;
}
.uhm-table thead tr { background: var(--surface-alt); }
.uhm-table th {
  padding: .7rem 1rem; text-align: left;
  font-size: .74rem; font-weight: 700; color: var(--muted);
  letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.uhm-th-num   { width: 40px; text-align: center; }
.uhm-th-rent  { text-align: right; }
.uhm-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.uhm-table tbody tr:last-child td { border-bottom: none; }
.uhm-tr:hover { background: #f8fafc; }
.uhm-td-num { text-align: center; color: var(--muted); font-size: .78rem; }
.uhm-contract-num { font-weight: 700; font-size: .875rem; color: var(--primary); }
.uhm-tenant-cell  { display: flex; align-items: center; gap: .6rem; }
.uhm-tenant-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.uhm-tenant-name  { font-size: .85rem; font-weight: 600; color: var(--text); }
.uhm-tenant-phone { font-size: .75rem; color: var(--muted); margin-top: .1rem; display: flex; align-items: center; gap: .25rem; }
.uhm-period { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.uhm-period-date { font-size: .81rem; color: var(--text); }
.uhm-period-arrow { font-size: .68rem; color: var(--muted); }
.uhm-td-rent { text-align: right; }
.uhm-rent { font-weight: 700; font-size: .875rem; color: var(--text); }
.uhm-view-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem; border-radius: var(--radius-sm);
  background: var(--surface-alt); color: var(--primary-light);
  border: 1px solid var(--border); font-size: .8rem; font-weight: 600;
  text-decoration: none; transition: var(--ease);
  white-space: nowrap;
}
.uhm-view-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

/* Footer */
.uhm-footer {
  display: flex; align-items: center; justify-content: flex-end;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border); background: var(--surface-alt);
}
.uhm-count {
  font-size: .8rem; color: var(--muted); font-weight: 600;
  display: flex; align-items: center; gap: .35rem;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .up-stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .up-filter-bar { flex-wrap: wrap; }
  .up-search-wrap { min-width: 100%; }
  .up-stats-row { grid-template-columns: repeat(2, 1fr); }
  .up-page-header { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .up-stats-row { grid-template-columns: 1fr 1fr; }
  .aum-result-grid { grid-template-columns: 1fr; }
  .aum-method-toggle { grid-template-columns: 1fr; }
  .owner-hero { padding: 1.25rem 1rem; }
  .owner-hero h1 { font-size: 1.25rem; line-height: 1.25; }
  .owner-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    width: 100%;
  }
  .owner-stat { min-width: 0; padding: .65rem .6rem; }
}

@media (max-width: 360px) {
  .owner-stat-value { font-size: 1.25rem; }
  .owner-stat-label { font-size: .62rem; letter-spacing: .05em; }
}

/* ═══════════════════════════════════════════════
   Portal Contract Cards  (.pcd-*)
   ═══════════════════════════════════════════════ */
.pcd-contract-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1rem;
}
.pcd-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow: 0 1px 4px rgba(15,23,42,.04);
}
.pcd-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30,58,95,.1);
  border-color: #cbd5e1;
}
.pcd-card:hover .pcd-card-arrow {
  color: #e8a020;
}
.pcd-card:hover .pcd-card-arrow i {
  transform: translateX(3px);
}

/* Top row */
.pcd-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1.1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f0f4f8 100%);
  border-bottom: 1px solid #f1f5f9;
}
.pcd-card-left {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
.pcd-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2a5a8f 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .88rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(30,58,95,.2);
}
.pcd-card-number {
  display: block;
  font-size: .92rem;
  font-weight: 800;
  color: #1e3a5f;
  letter-spacing: -.01em;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcd-card-unit {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: #64748b;
  font-weight: 600;
  margin-top: .1rem;
}
.pcd-card-unit i {
  font-size: .65rem;
  color: #94a3b8;
}
.pcd-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
  flex-shrink: 0;
}
.pcd-card-date {
  font-size: .72rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Bottom row */
.pcd-card-bottom {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: .65rem 1.1rem;
  flex-wrap: wrap;
}
.pcd-card-detail {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: #475569;
  font-weight: 500;
}
.pcd-card-detail i {
  font-size: .72rem;
  color: #94a3b8;
  width: 14px;
  text-align: center;
}
.pcd-card-arrow {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
  font-size: .8rem;
  font-weight: 700;
  color: #1e3a5f;
  transition: color .15s ease;
  white-space: nowrap;
}
.pcd-card-arrow i {
  font-size: .7rem;
  transition: transform .18s ease;
}

/* Responsive */
@media (max-width: 600px) {
  .pcd-card-top { flex-direction: column; align-items: flex-start; }
  .pcd-card-right { flex-direction: row; align-items: center; gap: .5rem; }
  .pcd-card-bottom { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .pcd-card-arrow { margin-left: 0; margin-top: .35rem; }
}

/* Portal-only responsive stabilization (Broker / Coordinator / Owner) */
@media (max-width: 900px) {
  .dashboard-page { max-width: 100%; }
  .owner-hero { padding: 1.5rem 1.35rem; }
  .owner-hero h1 { font-size: 1.4rem; }
  .owner-hero-stats { width: 100%; }
  .owner-section-actions { width: 100%; }
  .ph-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 768px) {
  .owner-hero { gap: 1rem; }
  .owner-hero-sub { flex-wrap: wrap; }
  .owner-section-hdr { gap: .6rem; }
  .owner-section-actions { gap: .5rem; }
  .owner-section-actions .btn-primary,
  .owner-section-actions .btn-gold {
    flex: 1 1 180px;
    justify-content: center;
  }
  .broker-card { padding: 1rem 1rem; }
  .broker-card-right { align-items: flex-start; }
  .assigned-unit-card .auc-body { padding: .95rem 1rem; }
  .broker-actions-bar { padding: .85rem .9rem; }
  .broker-actions-label { width: 100%; }
  .broker-actions-bar .btn-primary,
  .broker-actions-bar .btn-gold {
    flex: 1 1 170px;
    justify-content: center;
  }
  .ph-page { padding: 1rem .75rem 2rem; }
  .ph-toolbar { gap: .65rem; }
  .ph-toolbar-title { min-width: 0; }
  .ph-toolbar-heading { font-size: .95rem; }
  .ph-table { min-width: 980px; }
  .cv-receipt { margin: .75rem auto; padding: 1rem 1rem 1.25rem; }
  .cvr-header { padding: 1rem; }
  .cvr-section { padding: 1rem; }
  .cvr-footer { padding: .7rem 1rem; }
}

@media (max-width: 640px) {
  .steps-track { overflow-x: auto; justify-content: flex-start; padding-bottom: .2rem; }
  .step-item { min-width: 72px; }
  .step-label { font-size: .67rem; }
  .owner-hero { padding: 1.25rem 1rem; }
  .owner-hero h1 { font-size: 1.25rem; line-height: 1.25; }
  .owner-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    width: 100%;
  }
  .owner-stat { min-width: 0; padding: .65rem .6rem; }
  .unit-grid { grid-template-columns: 1fr; }
  .unit-card-header { gap: .5rem; flex-wrap: wrap; }
  .broker-card-footer { flex-direction: column; align-items: stretch; }
  .broker-card-footer .btn-danger-outline { width: 100%; justify-content: center; }
  .owner-assign-success-actions > a,
  .owner-assign-success-actions > button {
    flex: 1 1 100%;
    justify-content: center;
  }
  .ncp-upload-grid-two { grid-template-columns: 1fr !important; }
  .pcd-card-left { width: 100%; }
  .pcd-card-number { max-width: 100%; }
  .pcd-card-unit { min-width: 0; }
  .ph-summary-grid { grid-template-columns: 1fr; }
  .ph-table-wrap { border-radius: 10px; }
  .ph-table { min-width: 920px; }
  .cv-toolbar-actions .cv-btn { width: 100%; justify-content: center; }
  .cvr-grid-4, .cvr-grid-3, .cvr-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .owner-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-section-hdr h2 { font-size: .95rem; }
  .broker-actions-bar .btn-primary,
  .broker-actions-bar .btn-gold,
  .owner-section-actions .btn-primary,
  .owner-section-actions .btn-gold {
    width: 100%;
    flex: 1 1 100%;
  }
  .ph-toolbar { flex-wrap: wrap; }
  .ph-toolbar-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 360px) {
  .owner-stat-value { font-size: 1.25rem; }
  .owner-stat-label { font-size: .62rem; letter-spacing: .05em; }
  .broker-actions-bar { padding: .75rem; }
  .ph-page { padding: .75rem .55rem 1.5rem; }
}

/* ═══════════════════════════════════════════════
   Owner Dashboard — Tabbed Redesign
   ═══════════════════════════════════════════════ */

.owner-dashboard { padding-bottom: 2rem; }

/* Compact hero */
.owner-hero-compact {
  padding: 1.4rem 1.75rem;
  margin-bottom: 1rem;
}
.owner-hero-compact h1 { font-size: 1.4rem; margin-bottom: .2rem; }
.owner-hero-compact .owner-hero-eyebrow { margin-bottom: .25rem; font-size: .65rem; }
.owner-hero-compact .owner-hero-sub { font-size: .82rem; }
.owner-hero-compact .owner-stat { padding: .65rem .95rem; min-width: 72px; }
.owner-hero-compact .owner-stat-value { font-size: 1.4rem; }

/* Quick Actions */
.owner-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.qa-btn {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .95rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: var(--ease);
  box-shadow: var(--shadow-sm);
  min-height: 64px;
}
.qa-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  text-decoration: none;
}
.qa-btn > i {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--surface-alt);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
  transition: var(--ease);
}
.qa-btn:hover > i {
  background: var(--accent);
  color: #fff;
}
.qa-btn-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.qa-btn-title { font-weight: 700; font-size: .95rem; color: var(--text); }
.qa-btn-sub { font-size: .76rem; color: var(--muted); margin-top: .12rem; }
.qa-btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  border-color: transparent;
}
.qa-btn-primary > i { background: rgba(255,255,255,.32); color: #1a2332; }
.qa-btn-primary .qa-btn-title,
.qa-btn-primary .qa-btn-sub { color: #1a2332; }
.qa-btn-primary .qa-btn-sub { opacity: .8; }
.qa-btn-primary:hover {
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(232,160,32,.35);
}
.qa-btn-primary:hover > i { background: rgba(255,255,255,.5); }

/* Tabs */
.owner-tabs {
  display: flex;
  gap: .35rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.owner-tabs::-webkit-scrollbar { display: none; }
.owner-tab-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.15rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  font-size: .9rem; font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--ease);
  min-height: 48px;
}
.owner-tab-btn:hover { color: var(--primary); background: var(--surface-alt); border-radius: 8px 8px 0 0; }
.owner-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}
.owner-tab-btn i { font-size: .9rem; color: var(--accent); }
.owner-tab-btn.active i { color: var(--accent); }
.owner-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 .45rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: .7rem; font-weight: 700; color: var(--muted);
}
.owner-tab-btn.active .owner-tab-count {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a2332;
}
.owner-tab-content { animation: tab-content-in .22s ease; }
@keyframes tab-content-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Per-unit inline contract panel */
.unit-contract-panel {
  margin-top: .75rem;
  padding: .8rem .9rem;
  background: linear-gradient(135deg, #fafbff 0%, #f5f7fb 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: .42rem;
}
.ucp-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
  font-size: .82rem;
}
.ucp-label {
  color: var(--muted);
  display: inline-flex; align-items: center; gap: .35rem;
  font-weight: 600;
}
.ucp-label i { color: var(--accent); font-size: .76rem; width: 12px; text-align: center; }
.ucp-value {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}
.ucp-rent {
  font-size: 1rem; font-weight: 800; color: var(--primary);
}
.ucp-currency { font-size: .72rem; color: var(--muted); font-weight: 600; margin-left: .15rem; }
.ucp-term { font-size: .78rem; font-weight: 500; }
.ucp-row-pill { justify-content: flex-start; flex-wrap: wrap; gap: .4rem; padding-top: .15rem; }

/* Payment status pill */
.pay-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .22rem .58rem;
  border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .02em;
}
.pay-pill i { font-size: .68rem; }
.pay-pill-paid {
  background: var(--success-bg); color: var(--success);
  border: 1px solid rgba(22,101,52,.18);
}
.pay-pill-unpaid {
  background: var(--warn-bg); color: var(--warn);
  border: 1px solid rgba(146,64,14,.2);
}
.pay-pill-cancelled {
  background: var(--surface-alt); color: var(--muted);
  border: 1px solid var(--border);
}

/* Broker chip with remove */
.unit-broker-chip {
  padding-right: .3rem;  /* tighten right side to make room for remove */
}
.unit-broker-remove {
  width: 22px; height: 22px;
  border: none; background: transparent;
  color: var(--muted);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem;
  transition: var(--ease);
  margin-left: .15rem;
}
.unit-broker-remove:hover:not(:disabled) {
  background: var(--danger-bg);
  color: var(--danger);
}
.unit-broker-remove:disabled { opacity: .4; cursor: not-allowed; }

.unit-brokers-empty-link {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; color: var(--primary-light);
  text-decoration: none;
  padding: .35rem .65rem;
  border-radius: 6px;
  border: 1px dashed var(--border);
  transition: var(--ease);
}
.unit-brokers-empty-link:hover {
  background: var(--surface-alt);
  border-color: var(--primary-light);
  text-decoration: none;
}

.unit-card-action {
  font-size: .82rem;
  padding: .45rem .95rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

/* Activity feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--ease);
}
.activity-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}
.activity-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: .15rem;
}
.activity-title a { color: var(--primary); text-decoration: none; }
.activity-title a:hover { color: var(--primary-light); text-decoration: underline; }
.activity-sub {
  font-size: .8rem;
  color: var(--muted);
}
.activity-date {
  font-size: .76rem;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Assignment history (collapsible) */
.owner-history-section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.owner-history-toggle {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .75rem 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  transition: var(--ease);
}
.owner-history-toggle:hover {
  background: #eef2f6;
  border-color: #cbd5e1;
}
.owner-history-toggle > i:first-child { color: var(--accent); }
.owner-history-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: .8rem;
  transition: var(--ease);
}
.owner-history-list {
  margin-top: .85rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.history-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .7rem .95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.history-row.is-active  { border-left-color: var(--success); }
.history-row.is-revoked { border-left-color: var(--danger); }
.history-row-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: .85rem;
  flex-shrink: 0;
}
.history-row.is-active .history-row-icon  { background: var(--success-bg); color: var(--success); }
.history-row.is-revoked .history-row-icon { background: var(--danger-bg); color: var(--danger); }
.history-row-main { flex: 1; min-width: 0; }
.history-row-broker { font-weight: 700; font-size: .88rem; color: var(--text); }
.history-row-meta {
  font-size: .78rem; color: var(--muted); margin-top: .15rem;
  display: flex; gap: .35rem; flex-wrap: wrap;
}
.history-row-meta i { color: var(--accent); font-size: .72rem; }
.history-row-side {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: .25rem;
  flex-shrink: 0;
}
.history-row-date { font-size: .75rem; color: var(--muted); }

/* Responsive */
@media (max-width: 768px) {
  .owner-hero-compact { padding: 1.2rem 1rem; flex-direction: column; align-items: flex-start; }
  .owner-hero-compact .owner-hero-stats { width: 100%; }
  .qa-btn { padding: .75rem .9rem; }
  .qa-btn > i { width: 38px; height: 38px; }
  .qa-btn-title { font-size: .88rem; }
  .qa-btn-sub { font-size: .72rem; }
  .owner-tab-btn { padding: .65rem .85rem; font-size: .85rem; }
  .activity-item { padding: .7rem .85rem; gap: .65rem; }
  .activity-date { font-size: .72rem; }
  .history-row { flex-direction: row; align-items: flex-start; }
  .history-row-side { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (max-width: 480px) {
  .owner-quick-actions {
    grid-template-columns: 1fr;
    gap: .55rem;
  }
  .owner-tab-btn span { font-size: .82rem; }
  .ucp-value { font-size: .8rem; }
  .ucp-rent { font-size: .95rem; }
  .ucp-term { font-size: .72rem; }
  .unit-broker-chip { font-size: .76rem; }
}

/* ═══════════════════════════════════════════════
   Contract Wizard (/contract/new) — Polish & Mobile
   ═══════════════════════════════════════════════ */

/* Page wrapper — slightly wider, more breathable */
.ncp-page { max-width: 880px; margin: 0 auto; padding: 1.5rem 1rem 2rem; }
.ncp-page .register-card { max-width: none; padding: 1.75rem 1.75rem 1.5rem; }

/* Compact, mobile-friendly stepper */
.ncp-stepper-wrap { margin-bottom: 1.5rem; }
.ncp-stepper-current {
  display: none;
  align-items: center; gap: .55rem;
  padding: .5rem .85rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .84rem; font-weight: 700;
  color: var(--primary);
  width: fit-content;
  margin-bottom: .85rem;
}
.ncp-stepper-current i { color: var(--accent); }
.ncp-stepper-current .ncp-step-of { color: var(--muted); font-weight: 600; font-size: .76rem; }

/* Section card with title strip */
.ncp-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.2rem;
  margin-bottom: 1rem;
}
.ncp-section + .ncp-section { margin-top: 0; }
.ncp-section-title {
  display: flex; align-items: center; gap: .55rem;
  font-size: .92rem; font-weight: 800; color: var(--primary);
  margin: 0 0 .85rem;
}
.ncp-section-title i {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}

/* Helpful hint under a field */
.ncp-hint {
  display: flex; align-items: flex-start; gap: .45rem;
  margin: -.4rem 0 .85rem;
  font-size: .78rem; color: var(--muted);
  line-height: 1.45;
}
.ncp-hint i { color: var(--accent); font-size: .82rem; padding-top: 1px; flex-shrink: 0; }
.ncp-hint strong { color: var(--text); }

/* Larger form inputs on this page for touch */
.ncp-page .form-input { min-height: 44px; font-size: .95rem; }

/* Better section header subtitle */
.ncp-section-sub {
  font-size: .82rem; color: var(--muted);
  margin: -.55rem 0 .85rem;
}

/* Additional Tenants — cleaner list */
.ncp-add-tenants {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.2rem;
  margin-top: 1rem;
}
.ncp-add-tenants-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .9rem;
  flex-wrap: wrap;
}
.ncp-add-tenants-title {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 800; color: var(--primary); font-size: .95rem;
}
.ncp-add-tenants-title i {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem;
}
.ncp-add-tenants-sub { font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.ncp-add-tenants-add {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--ease);
  min-height: 40px;
}
.ncp-add-tenants-add:hover { background: var(--primary-light); transform: translateY(-1px); }
.ncp-add-tenants-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--muted);
  font-size: .88rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}
.ncp-add-tenants-empty strong { color: var(--primary); }

/* Additional tenant row card */
.ncp-tenant-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: .85rem;
  background: var(--surface);
  position: relative;
}
.ncp-tenant-card:last-child { margin-bottom: 0; }
.ncp-tenant-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}
.ncp-tenant-card-num {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 800; font-size: .9rem; color: var(--primary);
}
.ncp-tenant-card-num .ncp-num-badge {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a2332;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800;
}
.ncp-remove-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .45rem .85rem;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--ease);
  min-height: 36px;
}
.ncp-remove-btn:hover {
  background: var(--danger-bg);
  border-color: rgba(153,27,27,.25);
}
.ncp-remove-btn i { font-size: .78rem; }

/* Small upload label inside additional tenant card */
.ncp-small-upload-label {
  font-size: .82rem; font-weight: 600;
  display: flex; align-items: center; gap: .4rem;
  margin-bottom: .35rem; color: var(--text);
}
.ncp-small-upload-label i { color: var(--accent); font-size: .78rem; }
.ncp-small-upload-label small { color: var(--muted); font-weight: 400; font-size: .72rem; }

/* Payment method tiles (Step 5) */
.ncp-payment-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.ncp-pay-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  padding: 1.5rem 1.25rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: var(--ease);
  position: relative;
  min-height: 160px;
  font-family: inherit;
}
.ncp-pay-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.ncp-pay-tile.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
  box-shadow: 0 4px 16px rgba(30,58,95,.12);
}
.ncp-pay-tile.selected::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: .75rem; right: .85rem;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem;
}
.ncp-pay-tile-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: .25rem;
  transition: var(--ease);
}
.ncp-pay-tile.selected .ncp-pay-tile-icon {
  background: var(--primary);
  color: #fff;
}
.ncp-pay-tile-name { font-weight: 800; font-size: 1rem; color: var(--primary); }
.ncp-pay-tile-sub { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.ncp-pay-tile-fawry .ncp-pay-tile-icon { color: #c2410c; }
.ncp-pay-tile-fawry.selected .ncp-pay-tile-icon { background: #c2410c; color: #fff; }

/* Sticky action bar on mobile */
.ncp-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.ncp-action-bar .btn-secondary,
.ncp-action-bar .btn-primary {
  min-height: 46px;
  padding: .65rem 1.4rem;
  font-size: .94rem;
}
.ncp-action-bar > * { flex: 0 0 auto; }
.ncp-action-bar .btn-primary { margin-left: auto; }

/* Review section header variants (replace inline gradients) */
.rv-section-header-lease  { background: linear-gradient(135deg,#f0f4f8 0%,#e2e8f0 100%); }
.rv-section-header-tenant { background: linear-gradient(135deg,#f0f9f4 0%,#dcfce7 100%); }
.rv-section-header-fees   { background: linear-gradient(135deg,#fffbeb 0%,#fef3c7 100%); }
.rv-section-header-extra  { background: linear-gradient(135deg,#fff7ed 0%,#fed7aa 100%); }
.rv-section-icon-green    { background: #16a34a !important; color: #fff !important; }
.rv-section-icon-gold     { background: #e8a020 !important; color: #fff !important; }
.rv-section-icon-orange   { background: #ea580c !important; color: #fff !important; }

/* Pay Now CTA on success step */
.ncp-pay-now-wrap { text-align: center; margin: 1rem 0 1.25rem; }
.ncp-pay-now-btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .9rem 2.2rem;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(5,150,105,.32);
  transition: var(--ease);
  min-height: 50px;
}
.ncp-pay-now-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(5,150,105,.42);
  text-decoration: none;
  color: #fff;
}
.ncp-pay-now-note { font-size: .82rem; color: var(--muted); margin-top: .65rem; }

/* Mobile breakpoints */
@media (max-width: 820px) {
  .ncp-page { padding: 1rem .75rem 5rem; }
  .ncp-page .register-card { padding: 1.25rem 1.1rem 1.1rem; border-radius: var(--radius); }

  /* Collapse stepper to icon-only with current label pill */
  .ncp-stepper-current { display: inline-flex; }
  .ncp-page .step-label { display: none; }
  .ncp-page .step-item { min-width: 0; gap: .25rem; }
  .ncp-page .steps-track { gap: 0; }
  .ncp-page .step-line { margin: 0 .25rem 0; }
  .ncp-page .steps-header { margin-bottom: 1rem; }

  /* Additional tenants — single-column upload grid */
  .ncp-page .ncp-upload-grid-two { grid-template-columns: 1fr !important; gap: .9rem; }

  /* Section heading more compact */
  .ncp-section { padding: .95rem 1rem 1.05rem; }
  .ncp-add-tenants { padding: .95rem 1rem 1.1rem; }

  /* Inputs taller on mobile */
  .ncp-page .form-input { min-height: 48px; font-size: 16px; /* prevent iOS zoom */ }

  /* Action bar sticky to viewport bottom */
  .ncp-action-bar {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--surface) 30%);
    padding: 1rem 1rem .9rem;
    margin: 1.25rem -1.1rem -1.1rem;
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 18px rgba(15,23,42,.06);
    z-index: 5;
  }
  .ncp-action-bar .btn-primary,
  .ncp-action-bar .btn-secondary { min-height: 50px; padding: .7rem 1.1rem; }
}

@media (max-width: 480px) {
  .ncp-page { padding: .85rem .65rem 5rem; }
  .ncp-page .register-card { padding: 1rem .9rem .85rem; }
  .ncp-section-title { font-size: .88rem; }
  .ncp-section-title i { width: 26px; height: 26px; font-size: .78rem; }
  .ncp-add-tenants-add { padding: .5rem .85rem; font-size: .82rem; }
  .ncp-tenant-card { padding: .85rem .9rem; }
  .ncp-pay-tile { min-height: 140px; padding: 1.2rem 1rem; }
  .ncp-pay-tile-icon { width: 48px; height: 48px; font-size: 1.3rem; }
  .ncp-pay-tile-name { font-size: .94rem; }
  .ncp-pay-tile-sub { font-size: .76rem; }
}
