/* ============================================================
   Servicio MDM — Sistema de diseño
   Enterprise / fintech. Restraint over decoration.
   ============================================================ */

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

:root {
  /* Neutrales */
  --bg:            #F6F7F9;
  --surface:       #FFFFFF;
  --surface-2:     #FAFBFC;
  --surface-3:     #F2F4F7;
  --border:        #E3E6EB;
  --border-strong: #CDD3DC;

  --text:          #0B0E14;
  --text-2:        #545C6B;
  --text-3:        #8B93A2;

  /* Marca / acción */
  --accent:        #2563EB;
  --accent-hover:  #1D4ED8;
  --accent-soft:   #EFF4FF;
  --accent-border: #C7D8FE;

  --solid:         #0B0E14;   /* botón primario */
  --solid-hover:   #22262F;
  --solid-text:    #FFFFFF;

  /* Semánticos */
  --ok:        #067647;  --ok-bg:   #ECFDF3;  --ok-bd:   #ABEFC6;
  --warn:      #B54708;  --warn-bg: #FFFAEB;  --warn-bd: #FEDF89;
  --danger:    #B42318;  --danger-bg:#FEF3F2; --danger-bd:#FECDCA;
  --info:      #175CD3;  --info-bg: #EFF8FF;  --info-bd: #B2DDFF;
  --neutral:   #475467;  --neutral-bg:#F2F4F7; --neutral-bd:#D0D5DD;

  /* Elevación */
  --sh-1: 0 1px 2px rgba(16,24,40,.05);
  --sh-2: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --sh-3: 0 8px 24px rgba(16,24,40,.10), 0 2px 6px rgba(16,24,40,.05);
  --sh-4: 0 20px 48px rgba(16,24,40,.16);

  --ring: 0 0 0 3px rgba(37,99,235,.18);

  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
  --nav-w: 260px;
  --header-h: 60px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg:            #0A0C10;
  --surface:       #12151B;
  --surface-2:     #171B22;
  --surface-3:     #1C212A;
  --border:        #242A35;
  --border-strong: #333B49;

  --text:          #F2F4F7;
  --text-2:        #98A2B3;
  --text-3:        #667085;

  --accent:        #60A5FA;
  --accent-hover:  #93C5FD;
  --accent-soft:   #15243D;
  --accent-border: #1E3A5F;

  --solid:         #F2F4F7;
  --solid-hover:   #FFFFFF;
  --solid-text:    #0B0E14;

  --ok:      #75E0A7; --ok-bg:   #0A2C1D; --ok-bd:   #16543A;
  --warn:    #FEC84B; --warn-bg: #2E1F05; --warn-bd: #5B3D0B;
  --danger:  #FDA29B; --danger-bg:#33110E; --danger-bd:#7A241C;
  --info:    #84CAFF; --info-bg: #0B2545; --info-bd: #17417A;
  --neutral: #98A2B3; --neutral-bg:#1C212A; --neutral-bd:#333B49;

  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 1px 3px rgba(0,0,0,.5);
  --sh-3: 0 8px 24px rgba(0,0,0,.55);
  --sh-4: 0 20px 48px rgba(0,0,0,.65);
  --ring: 0 0 0 3px rgba(96,165,250,.22);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02","cv03","cv04","ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }

/* ---------------- Layout ---------------- */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--solid); color: var(--solid-text);
  display: grid; place-items: center; flex: none;
}
.brand-name { font-weight: 640; letter-spacing: -.015em; font-size: 14.5px; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: .02em; }

.nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.nav-label {
  font-size: 10.5px; font-weight: 620; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3);
  padding: 0 10px; margin: 16px 0 6px;
}
.nav-label:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
  width: 100%; text-align: left; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 560; }
.nav-item.active svg { color: var(--accent); }
.nav-item svg { color: var(--text-3); }
.nav-item:hover svg { color: var(--text-2); }
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 620;
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid var(--danger-bd);
  padding: 1px 6px; border-radius: 20px;
}
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); flex: none; }

.main { display: flex; flex-direction: column; min-width: 0; }
.header {
  height: var(--header-h); flex: none;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.header h1 { font-size: 15.5px; font-weight: 620; letter-spacing: -.01em; }
.header-sub { font-size: 12.5px; color: var(--text-3); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 24px; max-width: 1360px; width: 100%; }

/* ---------------- Botones ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 550; white-space: nowrap;
  border: 1px solid transparent; transition: all .12s;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--solid); color: var(--solid-text); }
.btn-primary:hover:not(:disabled) { background: var(--solid-hover); }
.btn-default { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-1); }
.btn-default:hover:not(:disabled) { background: var(--surface-3); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger-bg) 80%, var(--danger)); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }

/* ---------------- Superficies ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
}
.card-head {
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card-title { font-size: 14px; font-weight: 620; letter-spacing: -.005em; }
.card-desc { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 18px; }
.card-foot { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* KPI */
.kpi { padding: 16px 18px; }
.kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 520; }
.kpi-ico { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); margin-left: auto; }
.kpi-value { font-size: 27px; font-weight: 660; letter-spacing: -.025em; line-height: 1.1; }
.kpi-foot { font-size: 12px; color: var(--text-3); margin-top: 6px; display: flex; align-items: center; gap: 5px; }

/* ---------------- Tablas ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-3);
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; transition: background .1s; }
tbody tr.clickable:hover { background: var(--surface-2); }
.cell-strong { font-weight: 560; }
.cell-muted { color: var(--text-3); font-size: 12.5px; }
.cell-actions { text-align: right; white-space: nowrap; }

/* ---------------- Badges / estados ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 12px; font-weight: 560; white-space: nowrap;
  border: 1px solid transparent;
}
.badge svg { width: 12px; height: 12px; }
.badge-ok      { background: var(--ok-bg);      color: var(--ok);      border-color: var(--ok-bd); }
.badge-warn    { background: var(--warn-bg);    color: var(--warn);    border-color: var(--warn-bd); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-bd); }
.badge-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-bd); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-bd); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------------- Formularios ---------------- */
.field { margin-bottom: 18px; }
.label { display: block; font-size: 13px; font-weight: 560; margin-bottom: 6px; }
.label .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; line-height: 1.45; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color .12s, box-shadow .12s; font-size: 13.5px;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input.err, .textarea.err { border-color: var(--danger); }
.err-msg { font-size: 12.5px; color: var(--danger); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.select { appearance: none; 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='%238B93A2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
.input-group { position: relative; }
.input-group .input { padding-left: 36px; }
.input-group > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Checkbox */
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); flex: none; cursor: pointer; }
.check-text { font-size: 13.5px; }

/* ---------------- Avisos ---------------- */
.alert {
  display: flex; gap: 11px; padding: 13px 15px;
  border-radius: var(--r); border: 1px solid; font-size: 13.5px; line-height: 1.5;
}
.alert svg { flex: none; margin-top: 1px; }
.alert-title { font-weight: 600; margin-bottom: 3px; }
.alert-info    { background: var(--info-bg);   border-color: var(--info-bd);   color: var(--info); }
.alert-warn    { background: var(--warn-bg);   border-color: var(--warn-bd);   color: var(--warn); }
.alert-danger  { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger); }
.alert-ok      { background: var(--ok-bg);     border-color: var(--ok-bd);     color: var(--ok); }
.alert p { color: inherit; opacity: .92; }

/* ---------------- Estado vacío ---------------- */
.empty { padding: 56px 24px; text-align: center; }
.empty-ico {
  width: 44px; height: 44px; border-radius: var(--r-lg); margin: 0 auto 14px;
  background: var(--surface-3); color: var(--text-3); display: grid; place-items: center;
}
.empty-title { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.empty-desc { color: var(--text-3); font-size: 13px; max-width: 380px; margin: 0 auto 18px; }

/* ---------------- Pasos (wizard) ---------------- */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 16px; position: relative; padding-bottom: 24px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 15px; top: 34px; bottom: 0;
  width: 1.5px; background: var(--border);
}
.step:last-child::before { display: none; }
.step-num {
  width: 31px; height: 31px; border-radius: 50%; flex: none; z-index: 1;
  display: grid; place-items: center; font-size: 13px; font-weight: 620;
  background: var(--surface); color: var(--text-3);
  border: 1.5px solid var(--border-strong);
}
.step.done .step-num { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bd); }
.step.current .step-num { background: var(--solid); color: var(--solid-text); border-color: var(--solid); }
.step-body { flex: 1; min-width: 0; padding-top: 3px; }
.step-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.step-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.step-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- Manuales ---------------- */
.doc { max-width: 760px; }
.doc h2 { font-size: 19px; font-weight: 640; letter-spacing: -.02em; margin: 30px 0 10px; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { font-size: 15px; font-weight: 620; margin: 22px 0 8px; }
.doc p { color: var(--text-2); margin-bottom: 12px; line-height: 1.65; }
.doc ul, .doc ol { color: var(--text-2); margin: 0 0 14px 20px; line-height: 1.7; }
.doc li { margin-bottom: 5px; }
.doc li::marker { color: var(--text-3); }
.doc strong { color: var(--text); font-weight: 600; }
.doc code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 4px; color: var(--text);
}
.doc pre {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px; overflow-x: auto; margin-bottom: 14px;
}
.doc pre code { background: none; border: none; padding: 0; font-size: 12.5px; line-height: 1.6; }
.doc .alert { margin-bottom: 14px; }
.doc-toc { display: grid; gap: 10px; }
.doc-link {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); transition: all .12s; text-align: left; width: 100%;
}
.doc-link:hover { border-color: var(--border-strong); box-shadow: var(--sh-2); text-decoration: none; transform: translateY(-1px); }
.doc-link-ico { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; flex: none; }
.doc-link-title { font-weight: 580; font-size: 13.5px; color: var(--text); }
.doc-link-desc { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

/* ---------------- Toasts ---------------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh-3);
  padding: 13px 15px; min-width: 300px; max-width: 400px;
  animation: slideIn .22s cubic-bezier(.16,1,.3,1);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.toast-title { font-weight: 580; font-size: 13.5px; }
.toast-desc { font-size: 12.5px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--danger); }
.toast.info svg { color: var(--info); }

/* ---------------- Modal ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(11,14,20,.5);
  backdrop-filter: blur(3px); z-index: 100;
  display: grid; place-items: center; padding: 24px;
  animation: fade .15s;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-4);
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  animation: pop .22s cubic-bezier(.16,1,.3,1);
}
.modal.wide { max-width: 720px; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.modal-title { font-size: 15.5px; font-weight: 620; letter-spacing: -.01em; }
.modal-desc { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 15px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 9px; background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }

/* ---------------- Login ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login { width: 100%; max-width: 400px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 13px; margin-bottom: 26px; }
.login-mark { width: 46px; height: 46px; border-radius: 11px; background: var(--solid); color: var(--solid-text); display: grid; place-items: center; }
.login-title { font-size: 19px; font-weight: 640; letter-spacing: -.02em; text-align: center; }
.login-sub { font-size: 13.5px; color: var(--text-3); text-align: center; margin-top: 3px; }

/* ---------------- Misc ---------------- */
.detail-grid { display: grid; grid-template-columns: 150px 1fr; gap: 11px 18px; font-size: 13.5px; align-items: baseline; }
.detail-key { color: var(--text-3); font-size: 12.5px; }
.detail-val { font-weight: 520; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 9px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: sh 1.4s infinite; border-radius: 4px; }
@keyframes sh { to { background-position: -200% 0; } }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field .input { font-family: var(--mono); font-size: 12.5px; }
.filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.filters .input-group { width: 260px; }
.filters .select { width: auto; min-width: 160px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--nav-w);
    z-index: 90; transform: translateX(-100%); transition: transform .2s cubic-bezier(.16,1,.3,1);
    height: 100dvh;
  }
  .sidebar.open { transform: none; box-shadow: var(--sh-4); }
  .scrim { position: fixed; inset: 0; background: rgba(11,14,20,.45); z-index: 85; }
  .grid-3, .grid-2, .form-row { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .header { padding: 0 16px; }
  .detail-grid { grid-template-columns: 1fr; gap: 3px 0; }
  .detail-key { margin-top: 8px; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .filters .input-group, .filters .select { width: 100%; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { min-width: 0; max-width: none; }
}
@media (min-width: 901px) { .menu-btn { display: none; } }

/* ============================================================
   Capa SaaS moderna — superficies suaves, movimiento con intención
   ============================================================ */

:root {
  --r-2xl: 20px;
  --lift: 0 2px 4px rgba(16,24,40,.04), 0 6px 16px rgba(16,24,40,.06);
  --lift-hover: 0 4px 8px rgba(16,24,40,.06), 0 12px 28px rgba(16,24,40,.10);
  --ease: cubic-bezier(.16,1,.3,1);
}
:root[data-theme="dark"] {
  --lift: 0 2px 4px rgba(0,0,0,.3), 0 6px 16px rgba(0,0,0,.4);
  --lift-hover: 0 4px 8px rgba(0,0,0,.4), 0 12px 28px rgba(0,0,0,.55);
}

.card { border-radius: var(--r-xl); box-shadow: var(--lift); transition: box-shadow .2s var(--ease); }
.card-foot { border-radius: 0 0 var(--r-xl) var(--r-xl); }
.card.hover:hover { box-shadow: var(--lift-hover); transform: translateY(-1px); }

.btn { border-radius: 9px; transition: all .16s var(--ease); }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn-primary { box-shadow: 0 1px 2px rgba(16,24,40,.15); }
.input, .select, .textarea { border-radius: 9px; transition: all .16s var(--ease); }

/* Selector de empresa (contexto multiempresa) */
.switcher {
  margin: 12px; padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2);
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  transition: all .16s var(--ease); width: calc(100% - 24px);
  text-align: left;
}
.switcher:hover { border-color: var(--border-strong); background: var(--surface-3); }
.switcher-ico {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--solid); color: var(--solid-text);
  display: grid; place-items: center; font-weight: 680; font-size: 12px;
}
.switcher-txt { min-width: 0; flex: 1; }
.switcher-lbl { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 620; }
.switcher-val { font-size: 13.5px; font-weight: 580; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Lista de opciones del selector */
.opt-list { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
  cursor: pointer; transition: all .14s var(--ease); text-align: left; width: 100%;
}
.opt:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }

/* Avatar / iniciales */
.ava {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 640; font-size: 12.5px;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--border);
}
.ava-sm { width: 26px; height: 26px; font-size: 11px; }

/* Ilustración de estado vacío */
.empty-art { width: 108px; height: 84px; margin: 0 auto 18px; opacity: .82; }
.empty-art .bg  { fill: var(--surface-3); }
.empty-art .ln  { stroke: var(--border-strong); stroke-width: 2; fill: none; stroke-linecap: round; }
.empty-art .ac  { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linecap: round; }

/* Bloque de código / secreto */
.secret {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; word-break: break-all;
  display: flex; align-items: center; gap: 10px;
}
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.code-item {
  font-family: var(--mono); font-size: 12.5px; text-align: center;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 6px;
}

/* QR */
.qr-box {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; width: 208px; height: 208px; margin: 0 auto;
  display: grid; place-items: center;
}
.qr-box svg { width: 100%; height: 100%; }

/* Barra de progreso de plan */
.meter { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; transition: width .5s var(--ease); background: var(--accent); }
.meter.warn > i { background: var(--warn); }
.meter.full > i { background: var(--danger); }

/* Pestañas */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 10px 14px; font-size: 13.5px; font-weight: 540; color: var(--text-2);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: all .14s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Entrada de código de verificación */
.otp {
  font-family: var(--mono); font-size: 22px; letter-spacing: .5em;
  text-align: center; height: 52px; padding-left: .5em;
}

/* Aparición suave de vistas */
.content > * { animation: rise .28s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Pantallas de proceso (activación, MFA) */
.flow-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.flow { width: 100%; max-width: 460px; }
.flow-head { text-align: center; margin-bottom: 24px; }
.flow-mark {
  width: 48px; height: 48px; border-radius: 13px; margin: 0 auto 14px;
  background: var(--solid); color: var(--solid-text); display: grid; place-items: center;
}
.flow-title { font-size: 20px; font-weight: 660; letter-spacing: -.02em; }
.flow-sub { font-size: 13.5px; color: var(--text-3); margin-top: 5px; line-height: 1.5; }

/* Medidor de fuerza de contraseña */
.pw-bar { display: flex; gap: 4px; margin-top: 8px; }
.pw-seg { height: 4px; flex: 1; border-radius: 2px; background: var(--surface-3); transition: background .25s; }
.pw-seg.on1 { background: var(--danger); }
.pw-seg.on2 { background: var(--warn); }
.pw-seg.on3 { background: var(--accent); }
.pw-seg.on4 { background: var(--ok); }

@media (max-width: 560px) { .codes { grid-template-columns: 1fr; } }
