:root {
    --blue-deep: #0B3D5C;
  --blue-deep-2: #0A3450;
  --sky: #0EA5E9;
  --sky-dark: #0284C7;
  --cyan: #06B6D4;
  --cyan-light: #22D3EE;
    --green: #10B981;
  --green-bg: #D1FAE5;
  --green-text: #047857;
  --amber: #F59E0B;
  --amber-bg: #FEF3C7;
  --amber-text: #B45309;
  --red: #DC2626;
  --red-bg: #FEF2F2;
  --red-border: #FECACA;
  --red-text: #B91C1C;
    --white: #FFFFFF;
  --fog: #F8FAFC;
  --border: #E2E8F0;
  --border-soft: #F1F5F9;
  --text-2: #64748B;
  --text-3: #94A3B8;
  --text-1: #0F172A;
    --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.10);
  --sidebar-w: 248px;
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--fog);
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.4px; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
h3 { font-size: 18px; font-weight: 600; }
a { color: var(--sky); text-decoration: none; font-weight: 500; }
a:hover { color: var(--sky-dark); }
button { font-family: inherit; }
[data-lucide] { width: 20px; height: 20px; stroke-width: 1.75; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius);
  font-size: 14.5px; font-weight: 500; cursor: pointer; border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--sky); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--sky-dark); }
.btn-secondary { background: #fff; color: var(--sky); border-color: var(--sky); }
.btn-secondary:hover:not(:disabled) { background: #F0F9FF; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--fog); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #B91C1C; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn [data-lucide] { width: 18px; height: 18px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-1); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14.5px; font-family: inherit; color: var(--text-1);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 14px; resize: vertical; }
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(14,165,233,.14); }
.input-icon { position: relative; }
.input-icon [data-lucide] { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 40px; }

.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.card-tight { padding: 16px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; }
.badge-green { background: var(--green-bg); color: var(--green-text); }
.badge-amber { background: var(--amber-bg); color: var(--amber-text); }
.badge-red { background: var(--red-bg); color: var(--red-text); }
.badge-blue { background: #E0F2FE; color: #0369A1; }
.badge-gray { background: #F1F5F9; color: var(--text-2); }

.auth { display: flex; min-height: 100vh; }
.auth-brand {
  flex: 0 0 44%; background: var(--blue-deep); color: #fff;
  padding: 48px 44px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-form { width: 100%; max-width: 380px; }
.brand-logo { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--cyan); display: flex; align-items: center; justify-content: center; }
.brand-mark [data-lucide] { color: var(--blue-deep); width: 24px; height: 24px; }
.brand-name { font-size: 21px; font-weight: 600; letter-spacing: -0.3px; }
.brand-name b { color: var(--cyan-light); font-weight: 600; }
.auth-illus { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.auth-tag { font-size: 13px; font-weight: 500; color: #67E8F9; background: rgba(6,182,212,.16); border: 1px solid rgba(34,211,238,.4); padding: 6px 13px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; }
.compliance { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; color: var(--text-3); line-height: 1.5; border-top: 1px solid var(--border-soft); padding-top: 14px; margin-top: 24px; }

.shell { display: flex; min-height: 100vh; }
.sidebar { flex: 0 0 var(--sidebar-w); background: var(--blue-deep); color: #fff; display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand-logo { padding: 0 8px 24px; }
.sidebar .brand-name { color: #fff; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius); color: #9FC0D4; font-size: 14.5px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--sky); color: #fff; }
.nav-item [data-lucide] { width: 19px; height: 19px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid rgba(255,255,255,.1); margin-top: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cyan); color: var(--blue-deep); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.sidebar-user .meta { min-width: 0; }
.sidebar-user .meta .n { font-size: 13.5px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta .r { font-size: 12px; color: #9FC0D4; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 19px; font-weight: 600; }
.content { padding: 28px; flex: 1; max-width: 1280px; width: 100%; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.kpi .ico [data-lucide] { width: 20px; height: 20px; }
.kpi .label { font-size: 13px; color: var(--text-2); margin-top: 14px; }
.kpi .val { font-size: 28px; font-weight: 600; font-family: var(--mono); letter-spacing: -1px; margin-top: 2px; }

.table-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.table-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
table { width: 100%; border-collapse: collapse; }
thead th { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); text-align: left; padding: 12px 22px; background: var(--fog); }
tbody td { padding: 14px 22px; font-size: 14px; border-top: 1px solid var(--border-soft); color: var(--text-1); }
tbody tr:hover { background: #FBFDFF; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--text-2); }

.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 28px; }
.step { display: flex; align-items: center; gap: 10px; }
.step .dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; background: #fff; border: 1.5px solid var(--border); color: var(--text-3); }
.step.active .dot { background: var(--sky); border-color: var(--sky); color: #fff; }
.step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.step .lbl { font-size: 13.5px; font-weight: 500; color: var(--text-3); }
.step.active .lbl, .step.done .lbl { color: var(--text-1); }
.step-line { flex: 1; height: 1.5px; background: var(--border); margin: 0 14px; min-width: 24px; }

.dropzone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 48px 24px; text-align: center; background: var(--fog); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--sky); background: #F0F9FF; }
.dropzone .dz-ico { width: 60px; height: 60px; border-radius: 14px; background: #E0F2FE; color: var(--sky); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.dropzone .dz-ico [data-lucide] { width: 30px; height: 30px; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab { font-size: 13px; color: var(--text-2); padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; }
.tab.active { background: var(--sky); color: #fff; }
.scan { border-radius: 10px; overflow: hidden; background: #0A0E14; }
.scan svg { display: block; width: 100%; }

.verdict { border-radius: var(--radius-lg); padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.verdict.pos { background: var(--red-bg); border: 1px solid var(--red-border); }
.verdict.neg { background: #ECFDF5; border: 1px solid #A7F3D0; }
.verdict .vico { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.verdict.pos .vico { background: var(--red); }
.verdict.neg .vico { background: var(--green); }
.verdict .vico [data-lucide] { color: #fff; width: 23px; height: 23px; }
.verdict .vtitle { font-size: 17px; font-weight: 600; }
.verdict.pos .vtitle { color: var(--red-text); }
.verdict.neg .vtitle { color: var(--green-text); }
.verdict .vsub { font-size: 13px; margin-top: 2px; }
.verdict.pos .vsub { color: var(--red); }
.verdict.neg .vsub { color: #059669; }

.disclaimer { background: var(--fog); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 15px; display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: var(--text-2); line-height: 1.55; }
.disclaimer [data-lucide] { width: 17px; height: 17px; color: var(--text-3); flex-shrink: 0; margin-top: 1px; }

#toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--sky); border-radius: var(--radius); padding: 13px 16px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 10px; font-size: 14px; min-width: 260px; animation: slidein .2s ease; }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast [data-lucide] { width: 19px; height: 19px; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius-lg); padding: 26px; max-width: 440px; width: 100%; box-shadow: var(--shadow-md); }
.modal h3 { margin-bottom: 8px; }
.modal p { color: var(--text-2); font-size: 14px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.skeleton { background: linear-gradient(90deg, #F1F5F9 25%, #E8EEF4 50%, #F1F5F9 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.processing { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; }
.proc-steps { display: flex; flex-direction: column; gap: 14px; margin: 28px 0; width: 100%; max-width: 360px; }
.proc-step { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--text-3); }
.proc-step.active { color: var(--text-1); font-weight: 500; }
.proc-step.done { color: var(--green-text); }
.proc-step .pico { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.proc-step.active .pico { border-color: var(--sky); }
.proc-step.done .pico { background: var(--green); border-color: var(--green); }
.proc-step.done .pico [data-lucide] { color: #fff; width: 15px; height: 15px; }
.progress { height: 8px; background: #E2E8F0; border-radius: 999px; overflow: hidden; width: 100%; max-width: 360px; }
.progress .bar { height: 100%; background: var(--sky); border-radius: 999px; transition: width .4s ease; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.row { display: flex; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty [data-lucide] { width: 44px; height: 44px; stroke-width: 1.4; margin-bottom: 12px; }
.hidden { display: none !important; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.filters .field { margin: 0; }
.timeline-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.timeline-thumb { width: 64px; height: 64px; border-radius: var(--radius); background: #0A0E14; flex-shrink: 0; overflow: hidden; }

/* ============ Responsive (tablet / móvil) ============ */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    flex: none; width: 100%; height: auto;
    flex-direction: row; align-items: center; gap: 8px;
    padding: 10px 12px; position: sticky; top: 0; z-index: 20;
  }
  .sidebar .brand-logo { padding: 0 6px 0 2px; flex-shrink: 0; }
  .nav { flex-direction: row; flex: 1; min-width: 0; gap: 4px; overflow-x: auto; }
  .nav-item { flex-shrink: 0; padding: 9px 12px; white-space: nowrap; }
  .sidebar-user { border-top: none; margin: 0; padding: 0 2px; flex-shrink: 0; }
  .sidebar-user .meta { display: none; }
  .main { width: 100%; }
}

@media (max-width: 720px) {
  .auth { flex-direction: column; }
  .auth-brand { flex: none; padding: 22px 24px; justify-content: flex-start; gap: 14px; }
  .auth-illus { display: none; }
  .compliance { margin-top: 16px; }
  .auth-form-wrap { padding: 28px 22px; flex: 1; }

  .row { flex-direction: column; }
  .row > * { flex: 0 0 auto !important; width: 100%; }

  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .page-head { flex-wrap: wrap; gap: 12px; }
  .table-card { overflow-x: auto; }
  .table-head { padding: 14px 16px; }
  thead th, tbody td { padding: 10px 14px; }
  h1 { font-size: 23px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .step .lbl { display: none; }
  .step-line { margin: 0 8px; min-width: 14px; }
  #toast-container { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; }
  .card { padding: 18px; }
}
