:root {
  --navy-950: #03132f;
  --navy-850: #082052;
  --blue: #0e9eea;
  --red: #e90800;
  --green: #20b45b;
  --gray-50: #f5f7fb;
  --gray-100: #eaf0f7;
  --gray-500: #667085;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(3, 19, 47, .12);
  font-family: Inter, Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--navy-950); background: var(--gray-50); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 12px clamp(16px, 4vw, 42px);
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(8, 32, 82, .08);
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 900; }
.brand img { width: 78px; height: 44px; object-fit: contain; }
.brand small { display: block; color: var(--gray-500); font-size: 12px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; color: var(--white); background: linear-gradient(135deg, var(--red), var(--navy-850)); border-radius: 12px; font-weight: 900; }
.nav { display: flex; gap: 10px; justify-content: center; }
.nav a { padding: 10px 12px; border-radius: 999px; color: var(--navy-850); font-weight: 800; }
.nav a:hover { background: var(--gray-100); }

.page { width: min(100% - 28px, 1240px); margin: 0 auto; padding: 28px 0 56px; }
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 22px; }
.page-head h1 { margin: 4px 0 6px; font-size: clamp(28px, 4vw, 44px); letter-spacing: 0; }
.page-head p { margin: 0; color: var(--gray-500); max-width: 660px; }
.eyebrow { color: var(--red); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 16px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 900; box-shadow: none; }
.btn-primary { color: var(--white); background: linear-gradient(135deg, var(--red), #b60600); }
.btn-light { color: var(--navy-850); background: var(--gray-100); }
.btn-whatsapp { color: var(--white); background: linear-gradient(135deg, var(--green), #128c43); }
.btn-full { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.panel, .login-card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(8, 32, 82, .08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 22px; margin-bottom: 22px; }
.panel h2 { margin: 0 0 16px; font-size: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric { padding: 18px; border-radius: var(--radius); color: var(--white); background: linear-gradient(145deg, var(--navy-950), var(--navy-850)); box-shadow: var(--shadow); }
.metric span { display: block; color: rgba(255,255,255,.76); font-weight: 800; }
.metric strong { display: block; margin-top: 10px; font-size: 34px; }
.metric.success { background: linear-gradient(145deg, #08653c, #1ca35b); }
.metric.warning { background: linear-gradient(145deg, #9f6500, #f5a200); }
.metric.danger { background: linear-gradient(145deg, #9b0b06, var(--red)); }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.conversion { font-size: 52px; font-weight: 900; color: var(--red); }
.mini-list { display: grid; gap: 10px; }
.mini-list div { display: flex; justify-content: space-between; gap: 14px; padding: 12px; background: var(--gray-50); border-radius: 12px; }
.mini-list strong { color: var(--red); }

.filter-panel, .form-panel { display: grid; gap: 12px; }
.filter-panel { grid-template-columns: 2fr repeat(7, 1fr) auto auto; padding: 16px; margin-bottom: 18px; background: var(--white); border: 1px solid rgba(8, 32, 82, .08); border-radius: var(--radius); box-shadow: 0 10px 32px rgba(3, 19, 47, .08); }
.form-section { display: grid; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--gray-100); }
.form-section h2 { margin: 0; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 7px; color: var(--navy-850); font-weight: 800; }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid rgba(8, 32, 82, .14); border-radius: 11px; padding: 10px 12px; background: var(--white); color: var(--navy-950); }
textarea { resize: vertical; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; min-height: auto; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th { text-align: left; color: var(--gray-500); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
tbody tr:hover { background: #fafcff; }
.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; color: var(--navy-850); background: var(--gray-100); font-weight: 900; font-size: 12px; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-actions a, .table-actions button { border: 0; background: transparent; color: var(--red); cursor: pointer; font-weight: 900; padding: 0; }
.row-alert.yellow { box-shadow: inset 4px 0 #f7c948; }
.row-alert.orange { box-shadow: inset 4px 0 #f97316; }
.row-alert.red { box-shadow: inset 4px 0 var(--red); }
.alert-dot { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.alert-dot.yellow { background: #fff7d6; color: #8a5c00; }
.alert-dot.orange { background: #ffedd5; color: #9a3412; }
.alert-dot.red { background: #fee2e2; color: #991b1b; }

.lead-layout { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.lead-card dl { display: grid; gap: 10px; margin: 0; }
.lead-card dt { color: var(--gray-500); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.lead-card dd { margin: -6px 0 6px; font-weight: 800; }
.stack-form { display: grid; gap: 12px; }
.timeline { display: grid; gap: 12px; }
.timeline div { padding: 13px; border-radius: 12px; background: var(--gray-50); }
.timeline small { display: block; margin-top: 4px; color: var(--gray-500); }
.muted, .empty { color: var(--gray-500); }
.is-hidden { display: none !important; }

.alert { padding: 14px 16px; margin-bottom: 18px; border-radius: var(--radius); font-weight: 800; }
.alert.success { color: #065f46; background: #dcfce7; }
.alert.error { color: #991b1b; background: #fee2e2; }
.alert ul { margin: 8px 0 0; }

.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 20%, rgba(14,158,234,.22), transparent 30%), linear-gradient(135deg, var(--navy-950), var(--navy-850)); }
.login-shell { width: min(100% - 28px, 1060px); display: grid; grid-template-columns: 1fr 420px; gap: 40px; align-items: center; }
.login-copy { color: var(--white); }
.login-copy h1 { max-width: 620px; font-size: clamp(36px, 6vw, 64px); line-height: 1; margin: 8px 0 16px; }
.login-copy p { max-width: 520px; color: rgba(255,255,255,.74); font-size: 18px; }
.login-card { display: grid; gap: 14px; padding: 26px; }
.login-logo { display: flex; gap: 12px; align-items: center; font-size: 20px; margin-bottom: 8px; }
.login-logo img { width: 118px; height: 62px; object-fit: contain; }
.demo-box { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: var(--gray-50); color: var(--gray-500); font-size: 13px; }
.demo-box strong { color: var(--navy-950); }

@media (max-width: 1100px) {
  .metric-grid, .lead-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav { grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; }
  .page-head, .panel-head { align-items: flex-start; flex-direction: column; }
  .metric-grid, .dashboard-grid, .lead-layout, .form-grid, .filter-panel, .login-shell { grid-template-columns: 1fr; }
  .login-shell { padding: 28px 0; }
  .login-copy h1 { font-size: 38px; }
}
