/* ═══════════════════════════════════════════════════════════════════════════
   CHAUSP AM — Design System
   Paleta: violeta/índigo cálido · fondo marfil · verde esmeralda para éxito
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Fondo y superficie ─────────────────────────────────────── */
  --bg:            #F8F7FF;   /* fondo app: blanco con tinte violeta muy sutil */
  --bg-subtle:     #F2F0FA;   /* fondo secundario levemente más oscuro */
  --surface:       #FFFFFF;
  --surface-soft:  #FDFCFF;

  /* ── Texto ──────────────────────────────────────────────────── */
  --text:          #1A1333;   /* casi negro con tinte índigo */
  --text-soft:     #4A4166;
  --muted:         #7E7899;

  /* ── Marca / Primario ───────────────────────────────────────── */
  --primary:       #7C3AED;   /* violeta-600 */
  --primary-dark:  #6D28D9;   /* violeta-700 */
  --primary-deep:  #5B21B6;   /* violeta-800 */
  --primary-bg:    #F5F3FF;   /* violeta-50 */
  --primary-border:#DDD6FE;   /* violeta-200 */

  /* ── Semánticos ─────────────────────────────────────────────── */
  --green:         #059669;
  --green-dark:    #047857;
  --green-bg:      #ECFDF5;
  --green-border:  #A7F3D0;
  --amber:         #D97706;
  --amber-bg:      #FFFBEB;
  --amber-border:  #FDE68A;
  --red:           #DC2626;
  --red-bg:        #FEF2F2;
  --red-border:    #FECACA;

  /* ── Estructura ─────────────────────────────────────────────── */
  --border:        #EAE7F5;
  --border-soft:   #F2EFF9;
  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     18px;
  --radius-xl:     24px;
  --shadow-xs:     0 1px 4px rgba(109, 40, 217, 0.06);
  --shadow-sm:     0 4px 12px rgba(109, 40, 217, 0.08);
  --shadow:        0 8px 28px rgba(109, 40, 217, 0.11);
  --shadow-lg:     0 20px 50px rgba(109, 40, 217, 0.15);
  --t:             0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; }
a { color: inherit; }
h1, h2, h3, h4, p { margin-top: 0; }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.app-shell {
  width: min(680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 32px;
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.brand {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary), #9333EA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  margin-top: 1px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.account-badge {
  max-width: min(340px, 55vw);
  padding: 7px 12px;
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 0 8px;
  font-size: 13px;
}
.footer-link { color: var(--primary); text-decoration: none; font-weight: 600; transition: opacity var(--t); }
.footer-link:hover { opacity: 0.75; }
.footer-link-muted { color: var(--muted); font-weight: 500; }
.footer-sep { color: var(--border); }

/* ═══════════════════════════════════════════════════════════════════════════
   BOTONES
   ═══════════════════════════════════════════════════════════════════════════ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  transition: background var(--t), box-shadow var(--t), transform var(--t), opacity var(--t);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.button:active:not(:disabled) { transform: scale(0.97); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.30);
}
.button-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-deep) 100%);
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.38);
  transform: translateY(-1px);
}

.button-secondary {
  color: var(--text-soft);
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.button-secondary:hover:not(:disabled) {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--primary-bg);
  transform: translateY(-1px);
}

.button-success {
  color: #fff;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28);
}
.button-success:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.36);
  transform: translateY(-1px);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, var(--red) 0%, #B91C1C 100%);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}
.btn-danger:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.button-xl {
  min-height: 56px;
  padding: 16px 28px;
  font-size: 17px;
  border-radius: var(--radius-lg);
}

.button-block { width: 100%; }

.btn-sm {
  min-height: 36px !important;
  padding: 7px 14px !important;
  font-size: 13px !important;
  border-radius: var(--radius-sm) !important;
}

/* Loading state */
.button.loading { pointer-events: none; opacity: 0.8; }
.button.loading::after {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 6px;
}
.button-secondary.loading::after {
  border-color: rgba(124,58,237,0.3);
  border-top-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

input::placeholder { color: var(--muted); font-weight: 400; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237E7899' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.field-group { margin-bottom: 16px; }
.field-group-full { grid-column: 1 / -1; }

.actions { display: grid; gap: 10px; margin-top: 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS / PANELS
   ═══════════════════════════════════════════════════════════════════════════ */

.screen, .guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.guide-card {
  padding: 24px;
  margin-bottom: 14px;
  animation: slideUp 0.3s ease both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   INLINE ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */

.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: var(--radius);
  color: #991B1B;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 12px;
}

.alert-success {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: #065F46;
}

.alert-info {
  background: var(--primary-bg);
  border-color: var(--primary-border);
  color: var(--primary-deep);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

#toastContainer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: #1A1333;
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  animation: toastIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: auto;
  max-width: 100%;
}

.toast.toast-success { background: var(--green-dark); }
.toast.toast-error   { background: #991B1B; }
.toast.toast-info    { background: var(--primary-deep); }

.toast.toast-out {
  animation: toastOut 0.22s ease both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   START SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

.start-screen {
  min-height: min(720px, calc(100vh - 140px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.start-copy {
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(44px, 9vw, 72px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -2px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--text) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  max-width: 400px;
  margin: 0 auto 28px;
  color: var(--text-soft);
  font-size: clamp(17px, 2.5vw, 19px);
  line-height: 1.5;
  font-weight: 400;
}

/* Branch selector */
.branch-selector-wrap {
  margin: 0 auto 22px;
  max-width: 400px;
  text-align: left;
}

.branch-selector-wrap label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.safety-note {
  max-width: 380px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

/* Trust badges on start */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  box-shadow: var(--shadow-xs);
}

.trust-badge-icon { font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════════════════
   WAITING SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

.waiting-screen {
  min-height: min(620px, calc(100vh - 140px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.waiting-content {
  text-align: center;
  max-width: 480px;
  width: 100%;
  animation: fadeIn 0.4s ease both;
}

.waiting-icon-wrap {
  width: 72px;
  height: 72px;
  background: var(--primary-bg);
  border: 2px solid var(--primary-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  position: relative;
}

.waiting-spinner-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

.waiting-icon-inner { font-size: 28px; }

.waiting-content h2 {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.waiting-content > p {
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.waiting-email {
  color: var(--primary) !important;
  font-weight: 700;
  font-size: 15px !important;
}

.waiting-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 20px auto;
  padding: 12px 20px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #92400E;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: var(--amber);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
  flex: 0 0 auto;
}

.waiting-note {
  font-size: 13px !important;
  color: var(--muted) !important;
  margin-top: 12px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   REJECTED SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

.rejected-screen {
  min-height: min(500px, calc(100vh - 140px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.rejected-content {
  text-align: center;
  max-width: 400px;
  animation: fadeIn 0.4s ease both;
}

.rejected-icon-wrap {
  width: 72px;
  height: 72px;
  background: var(--red-bg);
  border: 2px solid var(--red-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 20px;
}

.rejected-content h2 { color: var(--red); font-size: 24px; margin-bottom: 10px; }
.rejected-content p  { color: var(--text-soft); margin-bottom: 24px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════════════
   SERVICE SCREEN — CLIENT GUIDE
   ═══════════════════════════════════════════════════════════════════════════ */

.client-guide {
  padding-top: 4px;
}

/* ─── Guide Hero ──────────────────────────────────────────────────────────── */

.guide-hero {
  background: linear-gradient(135deg, var(--primary-bg) 0%, #F0EBFF 100%);
  border-color: var(--primary-border);
  padding: 28px 28px 24px;
}

.guide-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.guide-hero h2 {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--primary-deep);
}

.guide-hero p {
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.trust-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.trust-list span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
}

.trust-list span::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  flex: 0 0 auto;
}

/* ─── Panel head ─────────────────────────────────────────────────────────── */

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.step {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-radius: 10px;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(109, 40, 217, 0.28);
}

.panel-head h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 2px;
  color: var(--text);
}

.panel-head p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

/* ─── Categories (client view) ──────────────────────────────────────────── */

.client-category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 2px solid var(--primary-border);
  border-radius: var(--radius);
  background: var(--primary-bg);
  cursor: default;
  transition: border-color var(--t), box-shadow var(--t);
}

.category-card-icon { font-size: 24px; line-height: 1; }

.category-card h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-deep);
}

.category-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin-top: auto;
  width: fit-content;
}

/* ─── Plan box ───────────────────────────────────────────────────────────── */

.plan-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 16px;
}

.plan-box span {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.plan-box strong {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.plan-box p {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}

/* Advanced controls collapsed */
.advanced-controls {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.advanced-controls summary {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: var(--bg-subtle);
  transition: background var(--t);
}
.advanced-controls summary::-webkit-details-marker { display: none; }
.advanced-controls summary::after { content: " ↓"; font-size: 11px; }
details[open] .advanced-controls summary::after { content: " ↑"; }
.advanced-controls summary:hover { background: var(--border-soft); color: var(--text); }

.advanced-controls > *:not(summary) { padding: 0 16px 16px; }
.advanced-controls label { margin-top: 12px; }

/* CTA area */
.guide-actions { gap: 10px; }
.safe-copy {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}

/* ─── Progress panel ─────────────────────────────────────────────────────── */

.progress-panel {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-subtle) 100%);
}

.progress-panel.is-running {
  border-color: var(--primary-border);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10), var(--shadow);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metric {
  padding: 14px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.metric strong {
  display: block;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 5px;
  color: var(--text);
}

.metric span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-hero {
  background: var(--primary-bg);
  border-color: var(--primary-border);
}
.metric-hero strong { color: var(--primary); font-size: 30px; }

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
}
.progress-meta strong { color: var(--primary); font-size: 22px; line-height: 1; }

.progress-track {
  height: 12px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #A855F7);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-panel.is-running .progress-fill {
  background: linear-gradient(90deg, var(--green), var(--primary), #A855F7);
  background-size: 200% 100%;
  animation: shimmerProgress 1.8s linear infinite;
}

@keyframes shimmerProgress {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.selection-summary {
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ─── Final step panel ──────────────────────────────────────────────────── */

.final-step-panel {
  border-color: var(--green-border);
  background: var(--green-bg);
}

.final-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.final-checklist > div {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-dark);
}

.final-checklist > div.pending { color: var(--text-soft); }

.final-checklist > div strong {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  flex: 0 0 auto;
}

.final-checklist > div.pending strong {
  background: var(--border);
  color: var(--muted);
}

.final-step-panel h3 { color: var(--green-dark); font-size: 18px; margin-bottom: 8px; }
.final-step-panel > p { color: #065F46; line-height: 1.6; margin-bottom: 10px; }

.warning-copy {
  padding: 10px 14px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #92400E;
  margin-bottom: 10px;
  line-height: 1.5;
}

.progress-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(26, 19, 51, 0.60);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease both;
}

.modal-card {
  width: min(480px, 100%);
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal-card h2 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 8px;
}

.modal-card p {
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 15px;
  margin-bottom: 8px;
}

.modal-note {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  line-height: 1.5;
  margin-top: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.modal-card-lg { width: min(680px, 100%); }

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.modal-payment-note {
  padding: 12px 14px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  color: #92400E;
  margin-bottom: 16px;
}
.modal-payment-note strong { display: block; font-weight: 800; margin-bottom: 3px; }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH SCREENS (login)
   ═══════════════════════════════════════════════════════════════════════════ */

.fullpage-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  overflow-y: auto;
}

.fullpage-screen:not(.admin-panel-screen):not(.branch-panel-screen) {
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: linear-gradient(160deg, var(--primary-bg) 0%, var(--bg) 60%);
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.30);
}

.auth-logo-name {
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #9333EA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-role-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: -2px;
  border: 1px solid var(--primary-border);
}

.auth-card h2 {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.auth-back {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t);
}
.auth-back:hover { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.admin-panel-screen:not(.hidden) {
  display: flex !important;
  height: 100dvh;
  overflow: hidden;
}

/* Sidebar */
.admin-sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: #100C24;
  color: #C4BAE0;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 4px;
  overflow-y: auto;
}

.admin-brand-sidebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  margin-bottom: 28px;
}

.admin-brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), #9333EA);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}

.admin-brand-text { line-height: 1.2; }
.admin-brand-text strong { display: block; font-size: 16px; font-weight: 900; color: #fff; }
.admin-brand-text small  { font-size: 10px; font-weight: 700; color: #6D5FAA; letter-spacing: 0.06em; text-transform: uppercase; }

.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.admin-nav-btn {
  width: 100%;
  padding: 11px 14px;
  text-align: left;
  background: transparent;
  color: #9B92BE;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-nav-btn:hover  { background: rgba(255,255,255,0.07); color: #fff; }
.admin-nav-btn.active { background: rgba(124,58,237,0.28); color: #fff; font-weight: 700; }
.admin-nav-btn.active::before { content: ""; width: 3px; height: 20px; background: var(--primary); border-radius: 999px; margin-right: 4px; display: none; }

.admin-nav-icon { font-size: 16px; }

.admin-logout-btn {
  margin-top: auto;
  font-size: 13px;
  background: rgba(255,255,255,0.06) !important;
  color: #9B92BE !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 10px !important;
}
.admin-logout-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.10) !important;
  color: #fff !important;
  transform: none !important;
}

/* Main content */
.admin-main-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  background: var(--bg);
}

.admin-tab { min-height: 100%; }

/* Admin page header */
.admin-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.admin-page-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}

/* Stats grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.admin-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t), transform var(--t);
}
.admin-stat:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.admin-stat-icon { font-size: 22px; margin-bottom: 10px; display: block; }

.admin-stat strong {
  display: block;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 5px;
}

.admin-stat span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-stat-green strong { color: var(--green); }
.admin-stat-blue  strong { color: var(--primary); }
.admin-stat-warn  strong { color: var(--amber); }
.admin-stat-red   strong { color: var(--red); }

/* Two column */
.admin-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 4px;
}
.admin-two-col h3 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }

/* Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table th {
  padding: 10px 14px;
  text-align: left;
  background: var(--bg-subtle);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--text-soft);
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover td { background: var(--bg-subtle); }
.admin-table td strong { color: var(--text); font-weight: 700; }
.admin-table td code { font-family: monospace; font-size: 12px; background: var(--bg-subtle); padding: 2px 6px; border-radius: 4px; }

.admin-table-scroll { overflow-x: auto; border-radius: var(--radius); }

.admin-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

.admin-cell-actions { display: flex; gap: 6px; white-space: nowrap; }

.admin-filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  min-height: 36px;
}
.admin-select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }

.admin-price-input {
  width: 88px;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  min-height: 32px;
}

/* Badges */
.adm-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.adm-badge-green { background: var(--green-bg);   color: #065F46; border: 1px solid var(--green-border); }
.adm-badge-warn  { background: var(--amber-bg);   color: #92400E; border: 1px solid var(--amber-border); }
.adm-badge-red   { background: var(--red-bg);     color: #991B1B; border: 1px solid var(--red-border);   }
.adm-badge-gray  { background: var(--bg-subtle);  color: var(--muted); border: 1px solid var(--border);  }
.adm-badge-blue  { background: var(--primary-bg); color: var(--primary-deep); border: 1px solid var(--primary-border); }

/* ═══════════════════════════════════════════════════════════════════════════
   BRANCH PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.branch-panel-screen:not(.hidden) {
  display: flex !important;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--bg);
}

.branch-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.branch-panel-header-left { display: flex; align-items: center; gap: 12px; }

.branch-panel-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}

.branch-panel-title strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.branch-panel-title span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.branch-panel-body {
  flex: 1;
  padding: 24px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* Stats row */
.branch-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.branch-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t);
}
.branch-stat:hover { box-shadow: var(--shadow-sm); }
.branch-stat strong { display: block; font-size: 32px; font-weight: 900; line-height: 1; margin-bottom: 5px; }
.branch-stat span   { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.branch-stat-green strong { color: var(--green); }
.branch-stat-blue  strong { color: var(--primary); }
.branch-stat-amber strong { color: var(--amber); }

/* Sections */
.branch-section { margin-bottom: 28px; }
.branch-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.branch-section h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.branch-section-badge {
  padding: 3px 10px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #92400E;
}

.branch-list { display: flex; flex-direction: column; gap: 10px; }

/* Pending card */
.branch-op-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
  transition: box-shadow var(--t);
}
.branch-op-card:hover { box-shadow: var(--shadow-sm); }

.branch-op-pending {
  border-left: 4px solid var(--amber);
  background: linear-gradient(to right, var(--amber-bg), var(--surface));
}

.branch-op-info { flex: 1; min-width: 0; }
.branch-op-info strong { display: block; font-size: 15px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.branch-op-info span  { display: block; font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.4; }

.branch-op-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.branch-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.72); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.88); }
  60%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .app-shell {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .topbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .account-badge { max-width: 100%; }

  h1 {
    font-size: 42px;
    letter-spacing: -1.5px;
  }

  .start-screen, .waiting-screen, .rejected-screen {
    padding: 32px 0;
    min-height: calc(100dvh - 120px);
  }

  .guide-card { padding: 18px 16px; }

  .guide-hero { padding: 20px 16px; }
  .guide-hero h2 { font-size: 20px; }

  .client-category-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .category-card { padding: 12px; }
  .category-card-icon { font-size: 20px; }

  .metrics { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .metric { padding: 12px 8px; }
  .metric strong { font-size: 20px; }
  .metric-hero strong { font-size: 24px; }

  .modal-actions { flex-direction: column; }
  .modal-actions .button { width: 100%; }

  .modal-form-grid { grid-template-columns: 1fr; }
  .field-group-full { grid-column: 1; }

  .admin-panel-screen { flex-direction: column; height: auto; min-height: 100dvh; }
  .admin-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 6px;
    height: auto;
  }
  .admin-brand-sidebar { margin-bottom: 0; }
  .admin-nav { flex-direction: row; flex: none; flex-wrap: wrap; }
  .admin-nav-btn { padding: 7px 12px; font-size: 13px; }
  .admin-logout-btn { margin-top: 0 !important; }
  .admin-main-content { padding: 16px; }
  .admin-two-col { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }

  .branch-panel-body { padding: 16px; }
  .branch-stats-row { grid-template-columns: repeat(2, 1fr); }

  .auth-card { padding: 28px 20px; }

  .branch-op-card { flex-direction: column; align-items: flex-start; }
  .branch-op-actions { width: 100%; }
  .branch-op-actions .button { flex: 1; }

  .waiting-icon-wrap { width: 60px; height: 60px; }
  .waiting-icon-inner { font-size: 22px; }
}

@media (max-width: 380px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric-speed { grid-column: 1 / -1; }
}
