/* EasyCheck — components v2
   Carga global — tokens.css debe cargarse primero.
   El scope #modulo-clientes de v1 fue eliminado; bridge.css protege pantallas no migradas.
   Vencimiento: eliminar bridge.css cuando no queden pantallas sin migrar. */

/* ── Reset global ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

*:focus-visible {
  outline: 2px solid var(--ec-accent);
  outline-offset: 2px;
  border-radius: var(--ec-radius-xs);
}

/* ── ec-card ────────────────────────────────────────────────────────────── */
.ec-card {
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--ec-shadow-sm);
}

/* ── ec-filter-bar ──────────────────────────────────────────────────────── */
.ec-filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 1rem;
}

/* ── ec-field ───────────────────────────────────────────────────────────── */
.ec-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ec-field > label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ec-text-muted);
  letter-spacing: .02em;
}

/* ── ec-input ───────────────────────────────────────────────────────────── */
.ec-input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: var(--ec-surface-2);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-sm);
  color: var(--ec-text);
  font-family: var(--ec-font-body);
  font-size: 13px;
  transition: border-color var(--ec-transition), box-shadow var(--ec-transition);
}
.ec-input::placeholder { color: var(--ec-text-hint); }
.ec-input:hover  { border-color: var(--ec-border-2); }
.ec-input:focus  {
  outline: none;
  border-color: var(--ec-accent);
  box-shadow: 0 0 0 3px var(--ec-accent-glow);
}

/* ── ec-select ──────────────────────────────────────────────────────────── */
.ec-select {
  width: 100%;
  height: 36px;
  padding: 0 28px 0 10px;
  background: var(--ec-surface-2);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-sm);
  color: var(--ec-text);
  font-family: var(--ec-font-body);
  font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b8cae' 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 10px center;
  cursor: pointer;
  transition: border-color var(--ec-transition);
}
.ec-select:hover { border-color: var(--ec-border-2); }
.ec-select:focus {
  outline: none;
  border-color: var(--ec-accent);
  box-shadow: 0 0 0 3px var(--ec-accent-glow);
}
.ec-select option { background: var(--ec-surface-2); color: var(--ec-text); }

/* ── ec-btn ─────────────────────────────────────────────────────────────── */
.ec-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--ec-radius-sm);
  font-family: var(--ec-font-body);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ec-transition), border-color var(--ec-transition),
              color var(--ec-transition), box-shadow var(--ec-transition);
  text-decoration: none;
}
.ec-btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* Primary — one per screen; filled green */
.ec-btn-primary {
  background: var(--ec-accent);
  color: #021a0e;
  border-color: var(--ec-accent);
}
.ec-btn-primary:hover {
  background: var(--ec-accent-dk);
  border-color: var(--ec-accent-dk);
  box-shadow: 0 0 0 3px var(--ec-accent-glow);
}

/* Secondary — outlined neutral */
.ec-btn-secondary {
  background: var(--ec-surface-2);
  color: var(--ec-text);
  border-color: var(--ec-border-2);
}
.ec-btn-secondary:hover {
  background: var(--ec-surface-3);
  border-color: var(--ec-text-muted);
}

/* Ghost — no border, subtle */
.ec-btn-ghost {
  background: transparent;
  color: var(--ec-text-muted);
  border-color: transparent;
}
.ec-btn-ghost:hover {
  background: var(--ec-surface-2);
  color: var(--ec-text);
}

/* Outline — accent border, no fill */
.ec-btn-outline {
  background: transparent;
  color: var(--ec-accent);
  border-color: var(--ec-accent);
}
.ec-btn-outline:hover {
  background: var(--ec-accent-bg);
  box-shadow: 0 0 0 3px var(--ec-accent-glow);
}

/* ── ec-table-wrap / ec-table ───────────────────────────────────────────── */
.ec-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius);
}
.ec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--ec-font-body);
}
.ec-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--ec-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--ec-surface);
  border-bottom: 1px solid var(--ec-border);
  white-space: nowrap;
}
.ec-table td {
  padding: 11px 14px;
  color: var(--ec-text);
  border-bottom: 1px solid var(--ec-border);
  vertical-align: middle;
}
.ec-table tbody tr:last-child td { border-bottom: none; }
.ec-table tbody tr:hover td { background: rgba(0,196,122,.04); }

/* Numeric columns — tabular nums, right-aligned */
.ec-table th.ec-num,
.ec-table td.ec-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ── ec-badge ───────────────────────────────────────────────────────────── */
.ec-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}
.ec-badge-ok   { background: var(--ec-ok-bg);     color: var(--ec-ok);     }
.ec-badge-info { background: var(--ec-info-bg);   color: var(--ec-info);   }
.ec-badge-warn { background: var(--ec-warn-bg);   color: var(--ec-warn);   }
.ec-badge-danger { background: var(--ec-danger-bg); color: var(--ec-danger); }

/* ── ec-empty ───────────────────────────────────────────────────────────── */
.ec-empty {
  text-align: center;
  color: var(--ec-text-hint);
  padding: 2.5rem 1rem;
  font-size: 13px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════════════
   SHELL — sidebar, topbar, layout
   ══════════════════════════════════════════════════════════════════════ */

/* ── ec-sidebar ─────────────────────────────────────────────────────────── */
.ec-sidebar {
  width: 220px;
  background: linear-gradient(180deg, var(--ec-surface) 0%, rgba(10,20,36,.98) 100%);
  border-right: 1px solid var(--ec-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 50;
}

/* ── ec-nav ─────────────────────────────────────────────────────────────── */
.ec-nav {
  flex: 1;
  padding: .75rem .5rem;
  overflow-y: auto;
}

/* ── ec-nav-item ────────────────────────────────────────────────────────── */
.ec-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--ec-radius-sm);
  font-size: 13px;
  color: var(--ec-text-muted);
  cursor: pointer;
  transition: all .15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--ec-font-body);
  margin-bottom: 2px;
  font-weight: 500;
}
.ec-nav-item:hover { background: var(--ec-surface-2); color: var(--ec-text); }
.ec-nav-item.active {
  background: var(--ec-accent-bg);
  color: var(--ec-accent);
  font-weight: 600;
}
.ec-nav-item.active i { color: var(--ec-accent); }
.ec-nav-item i { font-size: 17px; flex-shrink: 0; color: var(--ec-text-hint); transition: color .15s; }

/* ── ec-topbar ──────────────────────────────────────────────────────────── */
.ec-topbar {
  padding: 0 1.5rem;
  height: 60px;
  border-bottom: 1px solid var(--ec-border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  background: rgba(15,31,56,.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 40;
}

/* ── ec-brand (área de marca en topbar) ─────────────────────────────────── */
.ec-brand { min-width: 0; }

/* ── ec-content ─────────────────────────────────────────────────────────── */
.ec-content {
  margin-left: 220px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: calc(100% - 220px);
  overflow-x: hidden;
}

/* ── ec-avatar ──────────────────────────────────────────────────────────── */
.ec-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a4a6e, #0d2d4a);
  color: var(--ec-info);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── ec-user ────────────────────────────────────────────────────────────── */
.ec-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--ec-radius-sm);
  background: linear-gradient(135deg, var(--ec-surface-2), rgba(28,46,74,.5));
  border: 1px solid var(--ec-border);
  margin-bottom: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════════════════════════════ */

/* ── ec-login ───────────────────────────────────────────────────────────── */
.ec-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(0,196,122,.08) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 85%, rgba(77,166,255,.04) 0%, transparent 45%),
    var(--ec-bg);
}

/* ── ec-login-card ──────────────────────────────────────────────────────── */
.ec-login-card {
  width: 100%;
  max-width: 380px;
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius);
  padding: 2.5rem 2rem;
  box-shadow: 0 0 0 1px rgba(0,196,122,.05), var(--ec-shadow-lg);
  position: relative;
  overflow: hidden;
}
.ec-login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,196,122,.35), transparent);
}
