/* ==========================================================================
   CREDI-LOCK DESIGN SYSTEM • CSS PURO E MODERNO (SEM CARA DE IA)
   ========================================================================== */

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Cores Base */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-light: #e2e8f0;
  --border-focus: #3b82f6;

  /* Tipografia */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  /* Cores Temáticas & Status */
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;

  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;

  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;

  --rose-500: #ef4444;
  --rose-600: #dc2626;
  --rose-50: #fef2f2;
  --rose-100: #fee2e2;

  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-50: #eef2ff;

  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-phone: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);

  /* Transições */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset Geral */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Utilitários */
.hidden {
  display: none !important;
}

/* ==========================================================================
   1. TELA DE LOGIN (AUTH)
   ========================================================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 0%, #1e293b 0%, #090d16 100%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.4s ease-out;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.badge-icon {
  color: var(--blue-600);
  display: flex;
  align-items: center;
}

.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--blue-700);
  letter-spacing: -0.01em;
}

.brand-tag {
  font-size: 0.72rem;
  background: var(--blue-600);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.auth-header h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.input-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.input-group input,
.input-group select {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  color: var(--text-main);
  transition: var(--transition);
  outline: none;
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
}

.checkbox-container input {
  accent-color: var(--blue-600);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.link-muted {
  color: var(--blue-600);
  text-decoration: none;
  font-weight: 500;
}

.link-muted:hover {
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--blue-600);
  color: white;
}

.btn-primary:hover {
  background-color: var(--blue-700);
}

.btn-primary-sm {
  background-color: var(--blue-600);
  color: white;
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary-sm:hover {
  background-color: var(--blue-700);
}

.btn-block {
  width: 100%;
}

.demo-access-box {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-light);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-top: 6px;
  text-align: center;
}

.demo-text strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.demo-text span {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}

.btn-demo {
  background: white;
  border: 1px solid var(--border-light);
  color: var(--blue-600);
  font-size: 0.8rem;
  padding: 7px 14px;
  width: 100%;
}

.btn-demo:hover {
  background: var(--blue-50);
  border-color: var(--blue-600);
}

.auth-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--emerald-600);
  font-weight: 500;
}

.status-indicator .dot {
  width: 7px;
  height: 7px;
  background: var(--emerald-500);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.legal-notice {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 6px;
}

/* ==========================================================================
   2. LAYOUT DO DASHBOARD (TOP NAV & WORKSPACE)
   ========================================================================== */
.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-nav {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-logo {
  width: 34px;
  height: 34px;
  background: var(--blue-600);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-brand-title {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.nav-brand-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.system-status-pills {
  display: flex;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pill-success {
  background: var(--emerald-50);
  color: var(--emerald-600);
  border-color: var(--emerald-100);
}
.pill-success .dot { background: var(--emerald-500); }

.pill-indigo {
  background: var(--indigo-50);
  color: var(--indigo-600);
  border-color: #e0e7ff;
}
.pill-indigo .dot { background: var(--indigo-500); }

.pill-emerald {
  background: var(--blue-50);
  color: var(--blue-600);
  border-color: var(--blue-100);
}
.pill-emerald .dot { background: var(--blue-600); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border-light);
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--slate-800);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.btn-logout:hover {
  background: var(--rose-50);
  color: var(--rose-600);
}

/* ÁREA DE TRABALHO PRINCIPAL */
.main-workspace {
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 24px;
  padding: 24px;
  max-width: 1640px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1280px) {
  .main-workspace {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   3. COLUNA ADMINISTRATIVA (ESQUERDA)
   ========================================================================== */
.admin-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* CARDS DE MÉTRICAS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.metric-header span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.icon-bubble {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-bubble.blue { background: var(--blue-50); color: var(--blue-600); }
.icon-bubble.indigo { background: var(--indigo-50); color: var(--indigo-600); }
.icon-bubble.emerald { background: var(--emerald-50); color: var(--emerald-600); }
.icon-bubble.amber { background: var(--amber-50); color: var(--amber-600); }

.metric-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.metric-value.text-emerald {
  color: var(--emerald-600);
}

.metric-trend {
  font-size: 0.74rem;
  font-weight: 500;
}

.metric-trend.positive { color: var(--emerald-600); }
.metric-trend.neutral { color: var(--text-muted); }
.metric-trend.warning { color: var(--amber-600); }

/* PAINEL DE AÇÃO E CONTROLE RÁPIDO DO CLIENTE ATIVO */
.action-control-banner {
  background: var(--bg-card);
  border: 1px solid var(--blue-100);
  border-left: 4px solid var(--blue-600);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.active-client-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.client-avatar {
  width: 44px;
  height: 44px;
  background: var(--blue-600);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.client-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.client-title-row h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.status-success { background: var(--emerald-50); color: var(--emerald-600); border: 1px solid var(--emerald-100); }
.status-warning { background: var(--amber-50); color: var(--amber-600); border: 1px solid var(--amber-100); }
.status-danger { background: var(--rose-50); color: var(--rose-600); border: 1px solid var(--rose-100); }
.status-indigo { background: var(--indigo-50); color: var(--indigo-600); border: 1px solid #e0e7ff; }

.client-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.simulation-actions-grid {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.action-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.action-buttons-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-outline {
  background: white;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.78rem;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.btn-indicator.green { background: var(--emerald-500); }
.btn-indicator.yellow { background: var(--amber-500); }
.btn-indicator.orange { background: #f97316; }
.btn-indicator.red { background: var(--rose-500); }

.btn-emerald-action {
  background: var(--emerald-600);
  color: white;
  border: none;
  font-size: 0.78rem;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.btn-emerald-action:hover {
  background: var(--emerald-500);
}

/* TABELA DE CONTRATOS */
.contracts-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.table-filters {
  display: flex;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.filter-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn.active {
  background: white;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.table-container {
  overflow-x: auto;
}

.contracts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.contracts-table th {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
}

.contracts-table td {
  font-size: 0.82rem;
  padding: 12px;
  border-bottom: 1px solid var(--bg-subtle);
  color: var(--text-main);
}

.contracts-table tr.selected {
  background-color: var(--blue-50);
}

.contracts-table tr:hover:not(.selected) {
  background-color: #f8fafc;
  cursor: pointer;
}

.client-cell strong {
  display: block;
  font-weight: 600;
}

.client-cell span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.phone-cell strong {
  display: block;
  font-weight: 600;
}

.phone-cell span {
  font-size: 0.72rem;
  color: var(--indigo-600);
}

.btn-select-row {
  background: white;
  border: 1px solid var(--border-light);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue-600);
  cursor: pointer;
}

.btn-select-row:hover {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
}

/* TERMINAL DE ORQUESTRAÇÃO */
.orchestrator-console {
  background: var(--slate-950);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-800);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.console-header {
  background: var(--slate-900);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--slate-800);
}

.console-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #f1f5f9;
}

.live-blink {
  width: 8px;
  height: 8px;
  background: var(--emerald-500);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

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

.console-subtitle {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.btn-clear-logs {
  background: transparent;
  border: 1px solid var(--slate-800);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-clear-logs:hover {
  color: white;
  border-color: var(--text-muted);
}

.console-body {
  padding: 14px 16px;
  height: 180px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.4;
}

.log-entry {
  display: flex;
  gap: 10px;
  animation: slideIn 0.2s ease-out;
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-tag {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.tag-webhook { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.tag-mdm { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.tag-pix { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.tag-lock { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.tag-info { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.log-msg {
  color: #e2e8f0;
  word-break: break-all;
}

/* ==========================================================================
   4. COLUNA DO SMARTPHONE (DIREITA)
   ========================================================================== */
.phone-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-wrapper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-card-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.phone-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.phone-card-header p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.phone-mode-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid var(--blue-100);
  padding: 4px 8px;
  border-radius: var(--radius-full);
}

/* MOCKUP DO HARDWARE DO SMARTPHONE */
.smartphone-frame {
  width: 320px;
  height: 640px;
  background: #0f172a;
  border: 10px solid #1e293b;
  border-radius: 44px;
  box-shadow: var(--shadow-phone);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* BOTÕES DE HARDWARE LATERAIS */
.hw-btn {
  position: absolute;
  background: #334155;
  border-radius: 2px;
}
.hw-btn.volume-up { left: -13px; top: 110px; width: 3px; height: 35px; }
.hw-btn.volume-down { left: -13px; top: 155px; width: 3px; height: 35px; }
.hw-btn.power-btn { right: -13px; top: 130px; width: 3px; height: 45px; }

/* ILHA DINÂMICA / NOTCH */
.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

.dynamic-island {
  width: 85px;
  height: 20px;
  background: black;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  gap: 4px;
}

.island-camera {
  width: 7px;
  height: 7px;
  background: #1e293b;
  border-radius: 50%;
  box-shadow: inset 0 0 2px #38bdf8;
}

.island-sensor {
  width: 4px;
  height: 4px;
  background: #0f172a;
  border-radius: 50%;
}

/* TELA INTERNA */
.phone-screen {
  background: #ffffff;
  flex: 1;
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.phone-status-bar {
  height: 38px;
  padding: 8px 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  z-index: 40;
}

.phone-status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.net-badge {
  font-size: 0.65rem;
  font-weight: 800;
}

.phone-content-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 20px;
  overflow-y: auto;
  animation: fadeIn 0.25s ease-out;
}

/* ESTADO 1: APP NORMAL (EM DIA) */
.app-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.app-logo-mark {
  width: 28px;
  height: 28px;
  background: var(--blue-600);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-brand-name {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  display: block;
}

.app-user-welcome {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
}

.badge-tag-green {
  background: var(--emerald-50);
  color: var(--emerald-600);
  border: 1px solid var(--emerald-100);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.loan-summary-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.loan-label {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.loan-amount-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0 12px;
}

.loan-currency {
  font-size: 0.95rem;
  color: var(--blue-100);
  font-weight: 600;
}

.loan-main-val {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.progress-bar-bg {
  background: rgba(255, 255, 255, 0.15);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  background: var(--emerald-500);
  height: 100%;
  border-radius: 3px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #cbd5e1;
}

.next-due-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.due-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.due-tag {
  font-weight: 700;
  color: var(--text-main);
}

.due-date {
  color: var(--blue-600);
  font-weight: 600;
}

.due-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

.btn-phone-pix {
  background: var(--blue-600);
  color: white;
  border: none;
  width: 100%;
  padding: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-phone-pix:hover {
  background: var(--blue-700);
}

.phone-support-box {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.support-info strong {
  display: block;
  font-size: 0.74rem;
  color: var(--text-main);
}

.support-info span {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.btn-support-link {
  background: var(--emerald-50);
  border: 1px solid var(--emerald-100);
  color: var(--emerald-600);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-support-link:hover {
  background: var(--emerald-100);
}

.device-security-pill {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* ESTADO 2: NOTIFICAÇÃO DE PRÉ-VENCIMENTO */
.home-screen-mock {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.home-apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 16px 8px;
  text-align: center;
}

.mock-app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mock-app-icon span {
  width: 48px;
  height: 48px;
  background: var(--bg-subtle);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.mock-app-icon p {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-main);
}

.phone-notification-card {
  background: white;
  border: 1px solid var(--amber-500);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: auto;
  margin-bottom: 20px;
}

.notif-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.notif-icon-wrap {
  width: 20px;
  height: 20px;
  background: var(--amber-500);
  color: white;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-sender {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--amber-600);
}

.notif-time {
  font-size: 0.62rem;
  color: var(--text-light);
  margin-left: auto;
}

.notif-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.notif-msg {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.3;
}

.notif-actions {
  display: flex;
  gap: 6px;
}

.notif-btn-pay {
  background: var(--blue-600);
  color: white;
  border: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  flex: 1;
  cursor: pointer;
}

.notif-btn-open {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ESTADO 3: BLOQUEIO PARCIAL */
.soft-lock-banner {
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.soft-lock-banner h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--amber-600);
}

.soft-lock-banner p {
  font-size: 0.68rem;
  color: #78350f;
  line-height: 1.2;
}

.mock-app-icon.locked {
  position: relative;
  opacity: 0.55;
}

.app-lock-badge {
  position: absolute;
  top: -4px;
  right: 12px;
  background: var(--rose-500);
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.soft-lock-footer-card {
  margin-top: auto;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.soft-lock-footer-card p {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ESTADO 4: BLOQUEIO TOTAL MDM (DEVICE LOCK) */
.hard-lock-screen {
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #020617 100%);
  color: white;
  text-align: center;
}

.hard-lock-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
}

.lock-shield-icon {
  width: 68px;
  height: 68px;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid var(--rose-500);
  color: var(--rose-500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.lock-screen-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.lock-screen-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.35;
  margin-bottom: 18px;
  padding: 0 10px;
}

.lock-bill-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 18px;
}

.lock-bill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.lock-amount {
  font-size: 1.15rem;
  color: #f87171;
  font-weight: 800;
}

.lock-bill-id {
  font-size: 0.65rem;
  color: #94a3b8;
}

.lock-screen-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-lock-pix {
  background: var(--emerald-600);
  color: white;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 11px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.btn-lock-pix:hover {
  background: var(--emerald-500);
}

.btn-lock-whatsapp {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-lock-emergency {
  background: transparent;
  border: 1px dashed rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.btn-lock-emergency:hover {
  background: rgba(239, 68, 68, 0.15);
}

.lock-compliance-tag {
  font-size: 0.62rem;
  color: #64748b;
  margin-top: auto;
}

/* ESTADO 5: ANIMAÇÃO DE DESBLOQUEIO */
.success-unlock-screen {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.unlock-animation-box {
  text-align: center;
  padding: 20px 10px;
}

.check-circle-animation {
  width: 76px;
  height: 76px;
  background: var(--emerald-500);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 0 10px var(--emerald-100);
  animation: popIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.success-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 18px;
}

.unlock-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--emerald-50);
  border: 1px solid var(--emerald-100);
  color: var(--emerald-600);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

.dot-blink-green {
  width: 6px;
  height: 6px;
  background: var(--emerald-500);
  border-radius: 50%;
}

.phone-nav-bar {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 6px;
}

.nav-btn-bar {
  width: 100px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
}

.phone-helper-text {
  margin-top: 14px;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   5. MODAIS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: white;
  width: 100%;
  max-width: 560px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-sm {
  max-width: 400px;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.installment-calc-box {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  color: var(--blue-700);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
}

.compliance-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.modal-footer {
  padding: 16px 24px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* LISTA DE NÚMEROS DE EMERGÊNCIA */
.emergency-numbers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emergency-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--rose-50);
  border: 1px solid var(--rose-100);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}

.emergency-item:hover {
  background: #ffe4e6;
  border-color: var(--rose-500);
}

.emergency-badge {
  background: var(--rose-500);
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.emergency-item strong {
  display: block;
  font-size: 0.88rem;
}

.emergency-item span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* TOAST POPUP */
.toast-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--slate-900);
  color: white;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  border-left: 4px solid var(--emerald-500);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

.toast-icon {
  width: 24px;
  height: 24px;
  background: var(--emerald-500);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.toast-content strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
}

.toast-content p {
  font-size: 0.74rem;
  color: #cbd5e1;
}

/* ==========================================================================
   6. ANIMAÇÕES
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes popIn {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
