/* ExchangePro Enterprise UI — mockup style */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0f172a;
  --navy-mid: #1e293b;
  --navy-light: #334155;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-light: #eff6ff;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --sidebar-w: 260px;
  --sidebar-w-mini: 72px;
  --header-h: 52px;
  --footer-h: 78px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.ep-app {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 14px;
  overflow-x: hidden;
}
body.ep-nav-open { overflow: hidden; }

#main-screen.ep-hidden { display: none !important; }
#login-screen.ep-hidden { display: none !important; }

#main-screen { min-height: 100vh; min-height: 100dvh; }

/* ── Login ── */
.ep-login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy);
}
.ep-login-inner { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.ep-login-hero {
  display: flex; flex-direction: column; justify-content: center;
  padding: 3rem; color: #fff;
  background: linear-gradient(135deg, #0c1929 0%, #0f172a 60%, #1e3a5f 100%);
}
.ep-hero-desc { opacity: .78; font-size: .95rem; line-height: 1.65; max-width: 420px; margin-top: 1.5rem; }
.ep-login-hero .ep-badge { display: inline-block; margin-top: 1.5rem; padding: .5rem 1rem; background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.35); border-radius: 999px; font-size: .78rem; color: #93c5fd; }
.ep-login-panel { display: grid; place-items: center; background: var(--bg); padding: 2rem; }
.ep-login-card { width: min(420px, 100%); background: var(--card); border-radius: var(--radius); padding: 2.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.ep-login-card h2 { font-size: 1.5rem; margin-bottom: .25rem; }
.ep-login-card .sub { color: var(--muted); margin-bottom: 1.75rem; }

.ep-brand-pro {
  display: inline;
  color: var(--success);
  font-weight: 800;
  letter-spacing: -.01em;
}
.ep-logo-block .ep-brand-text h1 .ep-brand-pro,
.ep-sidebar .ep-brand-text h1 .ep-brand-pro,
.ep-footer-brand .ep-brand-text h1 .ep-brand-pro { color: #34d399; }
.ep-logo-block .ep-brand-text h1 {
  white-space: nowrap;
  line-height: 1.2;
}

.ep-login-features { display: flex; flex-direction: column; gap: .85rem; margin-top: 1.75rem; max-width: 420px; }
.ep-login-feature {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .75rem .85rem; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
}
.ep-login-feature svg { width: 22px; height: 22px; flex-shrink: 0; color: #60a5fa; margin-top: 2px; }
.ep-login-feature strong { display: block; font-size: .82rem; color: #e2e8f0; margin-bottom: .15rem; }
.ep-login-feature span { font-size: .74rem; color: #94a3b8; line-height: 1.35; }

.ep-login-panel {
  display: grid; place-items: center;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 45%, #f1f5f9 100%);
  padding: 2rem;
  position: relative; overflow: hidden;
}
.ep-login-panel::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(59,130,246,.08), transparent 40%),
              radial-gradient(circle at 10% 90%, rgba(16,185,129,.06), transparent 35%);
  pointer-events: none;
}
.ep-login-panel-inner { position: relative; width: min(440px, 100%); }
.ep-login-brand-mobile { display: none; margin-bottom: 1.25rem; justify-content: center; text-align: center; }
.ep-login-brand-mobile.ep-logo-block .ep-brand-text h1 { font-size: 1.45rem; color: var(--navy) !important; }
.ep-login-brand-mobile.ep-logo-block .ep-brand-text .ep-brand-tagline { max-width: none; color: var(--muted); }

.ep-login-card-pro {
  width: 100%; background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-radius: 16px; padding: 2rem 2rem 1.65rem;
  box-shadow: 0 8px 32px rgba(15,23,42,.08), 0 1px 0 rgba(255,255,255,.8) inset;
  border: 1px solid rgba(226,232,240,.9);
}
.ep-login-card-head { margin-bottom: 1.35rem; }
.ep-login-card-head h2 { font-size: 1.35rem; font-weight: 700; color: var(--navy); margin-bottom: .35rem; }
.ep-login-card-head .sub { margin-bottom: 0; font-size: .86rem; color: var(--muted); }

.ep-login-field { margin-bottom: 1.15rem; }
.ep-login-legacy-toggle {
  margin: .85rem 0 0;
  padding-top: .65rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
.ep-login-legacy-toggle .ep-link-btn { font-size: .78rem; }
.ep-login-card-pro .ep-btn-login { margin-top: .15rem; }
.ep-login-tenant-badge {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1rem;
  padding: .65rem .75rem;
  border-radius: 10px;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.18);
}
.ep-login-tenant-badge-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(59,130,246,.12);
  color: #93c5fd;
}
.ep-login-tenant-badge-icon svg { width: 18px; height: 18px; }
.ep-login-tenant-badge strong {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .12rem;
}
.ep-login-tenant-badge span {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.2;
}
.ep-login-tenant-switch {
  margin: -.35rem 0 .85rem;
  text-align: right;
}
.ep-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: .72rem;
  color: #64748b;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ep-link-btn:hover { color: #94a3b8; }
.ep-login-field label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .45rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.2;
}
.ep-input-wrap { position: relative; display: block; width: 100%; }
.ep-input-wrap input {
  width: 100%;
  padding: .78rem .85rem .78rem 2.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .92rem;
  line-height: 1.35;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.ep-input-wrap input::placeholder { color: #94a3b8; opacity: 1; }
.ep-input-wrap input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.ep-input-icon {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted);
  pointer-events: none; display: grid; place-items: center;
}
.ep-input-wrap:not(.ep-input-wrap-pass) input { padding-right: .85rem; }
.ep-input-wrap-pass input { padding-right: 2.75rem; }
.ep-input-icon svg { width: 18px; height: 18px; }
.ep-input-toggle {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; border-radius: 8px;
}
.ep-input-toggle:hover { background: var(--bg); color: var(--text); }
.ep-input-toggle svg { width: 18px; height: 18px; }

.ep-btn-login {
  width: 100%; margin-top: .35rem; padding: .82rem 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: none; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .95rem;
  color: #fff; background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 55%, #4f46e5 100%);
  box-shadow: 0 4px 14px rgba(37,99,235,.35); transition: transform .12s, box-shadow .12s;
}
.ep-btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,.4); }
.ep-btn-login svg { width: 18px; height: 18px; }
.ep-login-foot { margin-top: 1rem; text-align: center; font-size: .72rem; color: var(--muted); }

/* ── Admin: usuarios, sucursales, calendario ── */
.ep-rol-badge {
  display: inline-block; padding: .15rem .45rem; border-radius: 999px;
  font-size: .68rem; font-weight: 600; text-transform: capitalize;
}
.ep-rol-badge.cajero { background: #dbeafe; color: #1d4ed8; }
.ep-rol-badge.supervisor { background: #fef3c7; color: #b45309; }
.ep-rol-badge.gerente { background: #d1fae5; color: #047857; }
.ep-rol-badge.admin { background: #ede9fe; color: #6d28d9; }

.ep-cal-toolbar { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.ep-cal-legend {
  display: flex; flex-wrap: wrap; gap: .85rem 1.25rem; align-items: center;
  margin-bottom: .65rem; font-size: .75rem; color: var(--muted);
}
.ep-cal-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.ep-cal-legend i {
  width: 12px; height: 12px; border-radius: 3px; display: inline-block;
}
.ep-cal-legend i.libre { background: #fecaca; border: 1px solid #f87171; }
.ep-cal-legend i.vacaciones { background: #bfdbfe; border: 1px solid #60a5fa; }
.ep-cal-legend i.incapacidad { background: #fde68a; border: 1px solid #f59e0b; }
.ep-cal-hint { margin-left: auto; font-style: italic; }

.ep-cal-scroll { overflow: auto; max-width: 100%; }
.ep-cal-grid { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 640px; font-size: .72rem; }
.ep-cal-grid th, .ep-cal-grid td { border: 1px solid var(--border); padding: 0; text-align: center; }
.ep-cal-grid thead th {
  background: var(--bg); font-weight: 600; color: var(--muted);
  padding: .35rem .2rem; min-width: 28px; font-size: .64rem;
}
.ep-cal-grid thead th.ep-cal-user-col,
.ep-cal-grid tbody td.ep-cal-user-col {
  text-align: left; min-width: 140px; max-width: 180px;
  padding: .45rem .55rem; position: sticky; left: 0; background: var(--card); z-index: 2;
  border-right: 2px solid var(--border);
}
.ep-cal-grid tbody td.ep-cal-user-col strong { display: block; font-size: .74rem; }
.ep-cal-grid tbody td.ep-cal-user-col small { color: var(--muted); font-size: .62rem; }
.ep-cal-cell {
  width: 28px; height: 28px; cursor: pointer; transition: transform .1s;
}
.ep-cal-cell:hover { transform: scale(1.08); }
.ep-cal-cell.libre { background: #fecaca; }
.ep-cal-cell.vacaciones { background: #bfdbfe; }
.ep-cal-cell.incapacidad { background: #fde68a; }
.ep-cal-cell.weekend { background: #f8fafc; }
.ep-cal-cell.weekend.libre, .ep-cal-cell.weekend.vacaciones, .ep-cal-cell.weekend.incapacidad { opacity: 1; }
.ep-cal-grid thead th.weekend { background: #f1f5f9; }

/* ── Logo ExchangePro (sidebar + footer + login) ── */
.ep-logo-block {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.ep-logo-block-hero { margin-bottom: .25rem; }
.ep-logo-svg {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.ep-logo-svg-lg { width: 52px; height: 52px; }
.ep-logo-svg-xl { width: 64px; height: 64px; }
.ep-logo-block .ep-brand-text h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
  line-height: 1.2;
  white-space: nowrap;
}
.ep-logo-block .ep-brand-text .ep-brand-tagline {
  font-size: .68rem;
  color: #94a3b8;
  display: block;
  margin-top: 3px;
  line-height: 1.35;
  max-width: 160px;
}
.ep-footer-brand.ep-logo-block .ep-brand-text .ep-brand-tagline { max-width: 200px; color: #cbd5e1; }
.ep-footer-brand.ep-logo-block .ep-brand-text h1 { font-size: 1.35rem; }

.ep-footer-brands {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
}
.ep-footer-brand-divider {
  width: 1px;
  align-self: stretch;
  min-height: 44px;
  background: rgba(255,255,255,.1);
  flex-shrink: 0;
}
.ep-msoft-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
}
.ep-msoft-brand .ep-brand-text { min-width: 0; }
.ep-msoft-title {
  font-size: .72rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: .04em;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
}
.ep-msoft-brand .ep-brand-tagline {
  font-size: .58rem;
  color: #94a3b8;
  letter-spacing: .03em;
}

/* ── Footer ── */
.ep-footer {
  background: linear-gradient(180deg, #060d18 0%, #0a1220 100%);
  border-top: 1px solid rgba(255,255,255,.06);
  padding: .55rem 1rem;
  margin-top: auto;
  flex-shrink: 0;
}
.ep-content-wrap > .ep-footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 40;
  margin-top: 0;
  box-shadow: 0 -6px 24px rgba(0,0,0,.12);
  transition: left .25s ease;
}
.ep-content-wrap > .ep-footer .ep-footer-inner {
  margin: 0 auto;
}
.ep-footer-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr) auto;
  gap: .75rem 1rem;
  align-items: center;
  max-width: 1400px;
}
.ep-footer-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(59,130,246,.08);
  border-radius: 8px;
  border: 1px solid rgba(59,130,246,.15);
}
.ep-footer-icon svg { width: 18px; height: 18px; }
.ep-footer-item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.ep-footer-item strong {
  display: block;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .09em;
  color: #64748b;
  margin-bottom: .2rem;
}
.ep-footer-item p {
  font-size: .64rem;
  color: #cbd5e1;
  line-height: 1.3;
}
.ep-footer-brand {
  padding-left: 1rem;
  border-left: 1px solid rgba(255,255,255,.08);
  min-width: 200px;
}
.ep-footer-global { flex-shrink: 0; }

/* ── Layout ── */
.ep-layout { display: flex; min-height: 100vh; }

.ep-layout.ep-sidebar-collapsed { --sidebar-w: var(--sidebar-w-mini); }

.ep-sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0c1929 0%, #0f172a 100%);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(255,255,255,.06);
  transition: transform .25s ease, width .25s ease;
}

.ep-brand {
  padding: .85rem .85rem .75rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.ep-brand.ep-logo-block { align-items: flex-start; }
.ep-sidebar .ep-logo-block .ep-brand-text .ep-brand-tagline { font-size: .64rem; line-height: 1.3; }

.ep-nav { flex: 1; padding: .45rem .55rem; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.ep-nav-section {
  font-size: .58rem; text-transform: uppercase; letter-spacing: .1em;
  color: #475569; padding: .65rem .65rem .3rem; font-weight: 600;
}
.ep-nav button {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; text-align: left;
  background: transparent; border: none;
  color: #94a3b8; padding: .48rem .65rem;
  border-radius: 8px; cursor: pointer; font-size: .8rem; font-weight: 500;
  transition: all .15s; border-left: 3px solid transparent;
}
.ep-nav button svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; stroke-width: 1.75; }
.ep-nav button:hover { background: rgba(255,255,255,.05); color: #e2e8f0; }
.ep-nav button.active {
  background: rgba(59,130,246,.12); color: #fff;
  border-left-color: var(--blue);
}
.ep-nav button.active svg { opacity: 1; stroke: #60a5fa; }
.ep-nav button.ep-nav-soon {
  opacity: .42;
  cursor: default;
  pointer-events: none;
  position: relative;
}
.ep-nav button.ep-nav-soon::after {
  content: 'Próximamente';
  margin-left: auto;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .85;
}

/* Banner crítico — fondos bajos */
.ep-crit-banner {
  margin: 0 0 .65rem;
  padding: .65rem .85rem;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(220, 38, 38, .12), rgba(245, 158, 11, .08));
  border: 1px solid rgba(220, 38, 38, .35);
  animation: ep-crit-pulse 2.5s ease-in-out infinite;
}
.ep-crit-banner-inner {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.ep-crit-banner-icon {
  width: 2rem; height: 2rem; border-radius: 999px;
  background: #dc2626; color: #fff; display: grid; place-items: center;
  font-weight: 800; flex-shrink: 0;
}
.ep-crit-banner-text { flex: 1; min-width: 180px; }
.ep-crit-banner-text strong { display: block; color: #991b1b; font-size: .92rem; }
.ep-crit-banner-text span { font-size: .82rem; color: #7f1d1d; }
@keyframes ep-crit-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .25); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}
.ep-alert-icon.pulse { animation: ep-alert-blink 1.2s ease-in-out infinite; }
@keyframes ep-alert-blink {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: .85; }
}
.ep-alert-item-crit {
  background: rgba(220, 38, 38, .06);
  border-radius: 8px;
  padding: .15rem;
}
.ep-notif-item.crit { border-left: 3px solid #dc2626; }

/* PWA install banner */
.ep-pwa-banner {
  position: fixed; bottom: calc(var(--footer-h, 2.5rem) + .5rem); left: .65rem; right: .65rem;
  z-index: 1200; max-width: 520px; margin: 0 auto;
}
.ep-pwa-banner-inner {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .75rem .85rem; border-radius: 12px;
  background: #0f172a; color: #e2e8f0;
  border: 1px solid rgba(96, 165, 250, .35);
  box-shadow: 0 12px 40px rgba(15, 23, 42, .45);
}
.ep-pwa-banner-icon img { border-radius: 10px; display: block; }
.ep-pwa-banner-text { flex: 1; min-width: 160px; }
.ep-pwa-banner-text strong { display: block; font-size: .9rem; }
.ep-pwa-banner-text span { font-size: .78rem; color: #94a3b8; }
.ep-pwa-banner-actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* Reportes — anuladas */
.ep-rep-check {
  display: inline-flex; align-items: center; gap: .4rem;
  cursor: pointer; font-size: .82rem; user-select: none;
}
.ep-rep-check input { accent-color: var(--blue); }
.ep-kpi-anul { opacity: .45; }
.ep-kpi-anul.ep-kpi-anul-visible { opacity: 1; }
.ep-rep-anul-motivo {
  margin: 0 0 .35rem; font-size: .75rem; color: #b45309;
  font-style: italic;
}
.ep-muted-sm { font-size: .78rem; color: var(--muted); }

@media (display-mode: standalone) {
  .ep-pwa-banner { display: none !important; }
  .ep-main { padding-bottom: calc(var(--footer-h, 2.5rem) + .25rem); }
}

.ep-user-card {
  margin: .5rem; padding: .65rem;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .75rem;
}
.ep-user-card .ep-avatar-sm {
  width: 36px; height: 36px; border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .72rem; flex-shrink: 0;
  overflow: hidden; position: relative;
}
.ep-avatar-sm {
  width: 36px; height: 36px; border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: .72rem; flex-shrink: 0;
  overflow: hidden; vertical-align: middle;
}
.ep-avatar-sm.ep-avatar-has-photo,
.ep-avatar.ep-avatar-has-photo,
.ep-avatar-lg.ep-avatar-has-photo,
.ep-avatar-xs.ep-avatar-has-photo {
  background: var(--bg);
  padding: 0;
}
.ep-avatar-sm img, .ep-avatar img, .ep-avatar-lg img, .ep-avatar-xs img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit;
}
.ep-avatar-fallback { display: none; }
.ep-avatar-clickable { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.ep-avatar-clickable:hover { transform: scale(1.04); box-shadow: 0 0 0 2px rgba(59,130,246,.35); }
.ep-avatar-lg {
  width: 72px; height: 72px; border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
  overflow: hidden;
}
.ep-avatar-xs {
  width: 28px; height: 28px; border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), #6366f1);
  display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: .62rem;
  vertical-align: middle; overflow: hidden; flex-shrink: 0;
}
.ep-user-cell, .ep-cal-user {
  display: flex; align-items: center; gap: .55rem;
}
.ep-cal-user small { display: block; color: var(--muted); font-size: .68rem; margin-top: 1px; }
.ep-usr-photo-row {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.ep-usr-photo-actions { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.ep-usr-photo-actions .ep-field-label { font-size: .78rem; font-weight: 600; color: var(--text); }
.ep-usr-photo-actions small.ep-muted { font-size: .72rem; color: var(--muted); line-height: 1.35; }
.ep-usr-photo-actions input[type="file"] { font-size: .78rem; max-width: 100%; }

/* Logos empresa / sucursales */
.ep-logo-upload-row {
  display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.ep-logo-preview-wrap {
  width: 84px; height: 84px; flex-shrink: 0;
  border: 1px dashed var(--border); border-radius: 14px;
  background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ep-logo-preview { width: 100%; height: 100%; object-fit: contain; padding: .35rem; }
.ep-logo-placeholder { font-size: .68rem; color: var(--muted); text-align: center; padding: .35rem; line-height: 1.3; }
.ep-logo-actions { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.ep-logo-actions .ep-field-label { font-size: .78rem; font-weight: 600; color: var(--text); }
.ep-logo-actions small.ep-muted { font-size: .72rem; color: var(--muted); line-height: 1.35; }
.ep-logo-actions input[type="file"] { font-size: .78rem; max-width: 100%; }
.ep-check-row { display: flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--text); margin-top: .15rem; }
.ep-logo-xs { width: 18px; height: 18px; border-radius: 5px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex-shrink: 0; }
.ep-logo-sm { width: 24px; height: 24px; border-radius: 7px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex-shrink: 0; }
.ep-logo-md { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex-shrink: 0; }
.ep-col-logo {
  width: 2.75rem; min-width: 2.75rem; max-width: 2.75rem;
  padding: .4rem .35rem !important; text-align: center; vertical-align: middle;
}
.ep-col-logo .ep-logo-sm,
.ep-col-logo .ep-logo-xs { margin: 0 auto; display: block; }
.ep-logo-empty {
  display: inline-block; width: 24px; height: 24px; border-radius: 7px;
  background: #f1f5f9; border: 1px dashed #e2e8f0;
}
.ep-suc-status-grid {
  display: grid; grid-template-columns: 36px 1fr; gap: .55rem; align-items: start;
}
.ep-suc-status-logo-col { display: flex; justify-content: center; padding-top: .15rem; }
.ep-suc-status-body { min-width: 0; }
.ep-suc-status-head { display: flex; align-items: center; justify-content: space-between; gap: .35rem; margin-bottom: .25rem; }
.ep-suc-status-head strong { font-size: .78rem; line-height: 1.25; }
.ep-suc-status-multi { border-color: #fcd34d; background: rgba(245,158,11,.06); }
.ep-suc-status-multi .ep-suc-badge.open { background: #fef3c7; color: #92400e; }
.ep-hist-branch-head {
  display: grid; grid-template-columns: 36px 1fr; gap: .55rem; align-items: center;
  padding: .6rem .85rem; border-bottom: 1px solid var(--border);
  font-size: .8rem; font-weight: 600; background: #f8fafc;
}
.ep-hist-branch-logo { display: flex; justify-content: center; }
.ep-hist-branch-name { min-width: 0; }
.ep-hist-card-grid {
  display: grid; grid-template-columns: 32px 1fr auto; gap: .5rem; align-items: start;
}
.ep-hist-card-head.ep-hist-card-grid { display: grid; align-items: start; }
.ep-hist-card-logo { display: flex; justify-content: center; padding-top: .1rem; }
.ep-cierre-card-grid {
  display: grid; grid-template-columns: 36px 1fr auto; gap: .55rem; align-items: start; width: 100%;
}
.ep-caja-card-head.ep-cierre-card-grid { display: grid; align-items: start; }
.ep-cierre-card-logo { display: flex; justify-content: center; padding-top: .1rem; }
.ep-rep-card-suc-grid {
  display: grid; grid-template-columns: 40px 1fr; gap: .55rem; align-items: center;
}
.ep-rep-card-head.ep-rep-card-suc-grid { display: grid; align-items: center; }
.ep-rep-card-logo { display: flex; justify-content: center; }

.ep-user-card-info strong { display: block; color: #f1f5f9; font-size: .82rem; font-weight: 600; }
.ep-user-card-info span { font-size: .72rem; color: #64748b; display: block; margin-top: 1px; }
.ep-user-card-info em { font-size: .68rem; color: #475569; font-style: normal; }

/* Sidebar colapsado — solo iconos */
.ep-layout.ep-sidebar-collapsed .ep-brand {
  padding: .75rem .35rem .65rem;
  justify-content: center;
}
.ep-layout.ep-sidebar-collapsed .ep-brand.ep-logo-block { align-items: center; }
.ep-layout.ep-sidebar-collapsed .ep-logo-svg { width: 36px; height: 36px; }
.ep-layout.ep-sidebar-collapsed .ep-sidebar-label { display: none; }
.ep-layout.ep-sidebar-collapsed .ep-nav { padding: .45rem .35rem; }
.ep-layout.ep-sidebar-collapsed .ep-nav-section { display: none; }
.ep-layout.ep-sidebar-collapsed .ep-nav button {
  justify-content: center;
  padding: .55rem .4rem;
  gap: 0;
  border-left: none;
}
.ep-layout.ep-sidebar-collapsed .ep-nav button.active {
  border-left: none;
  box-shadow: inset 3px 0 0 var(--blue);
}
.ep-layout.ep-sidebar-collapsed .ep-user-card {
  justify-content: center;
  padding: .5rem .35rem;
  margin: .5rem .35rem;
}

.ep-content-wrap { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; width: calc(100% - var(--sidebar-w)); transition: margin-left .25s ease, width .25s ease; }

.ep-menu-toggle {
  display: inline-flex;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; width: 36px; height: 36px; cursor: pointer;
  align-items: center; justify-content: center; color: var(--text); flex-shrink: 0;
}
.ep-sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99;
}

/* ── Header ── */
.ep-header {
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
  position: sticky; top: 0; z-index: 50;
  flex-shrink: 0;
  gap: .5rem;
}
.ep-header-left { display: flex; align-items: center; gap: .5rem; min-width: 0; flex: 1; }
.ep-breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); min-width: 0; flex-wrap: wrap; }
.ep-breadcrumb strong { color: var(--text); font-weight: 600; }
.ep-header-tenant {
  font-weight: 600; color: var(--msoft-green-dark, #5a8a28); max-width: 10rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ep-header-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; position: relative; }
.ep-datetime { font-size: .72rem; color: var(--muted); text-align: right; display: none; }
@media (min-width: 900px) { .ep-datetime { display: block; } }
.ep-datetime strong { display: block; color: var(--text); font-size: .8rem; }

.ep-main {
  padding: .85rem 1rem calc(.85rem + var(--footer-h));
  flex: 1 1 auto;
  min-height: 0;
}
.ep-page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .65rem; gap: .5rem; flex-wrap: wrap; }
.ep-page-head h2 { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.ep-page-head p { color: var(--muted); font-size: .75rem; margin-top: .05rem; }

/* ── KPI Cards ── */
.ep-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .55rem; margin-bottom: .65rem; }
#view-dashboard .ep-dash-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#view-dashboard .ep-dash-kpi-grid .ep-kpi-rep .value { font-size: .82rem; min-height: 2.1rem; }
#view-dashboard .ep-dash-kpi-grid .ep-rep-kpi-values { font-size: .78rem; gap: .22rem; }
.ep-kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .6rem .7rem;
  box-shadow: var(--shadow);
}
.ep-kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .25rem; }
.ep-kpi-icon { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; }
.ep-kpi-icon svg { width: 13px; height: 13px; }
.ep-kpi-trend { font-size: .58rem; font-weight: 600; padding: .08rem .3rem; border-radius: 5px; }
.ep-kpi .label { font-size: .62rem; color: var(--muted); margin-bottom: .05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-kpi .value { font-size: .98rem; font-weight: 700; color: var(--text); line-height: 1.15; }
.ep-notif-btn {
  position: relative; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; width: 34px; height: 34px; cursor: pointer;
  display: grid; place-items: center; color: var(--muted);
}
.ep-notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center;
}
.ep-user-menu {
  display: flex; align-items: center; gap: .65rem;
  padding: .35rem .75rem .35rem .35rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer;
}
.ep-avatar {
  width: 32px; height: 32px; border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), #6366f1);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .75rem;
  overflow: hidden; position: relative; flex-shrink: 0;
}
.ep-user-menu span { font-size: .8rem; font-weight: 600; }

.ep-kpi-icon.blue { background: var(--blue-light); color: var(--blue); }
.ep-kpi-icon.green { background: #ecfdf5; color: var(--success); }
.ep-kpi-icon.amber { background: #fffbeb; color: var(--warning); }
.ep-kpi-icon.purple { background: #f5f3ff; color: #8b5cf6; }
.ep-kpi-trend.up { background: #ecfdf5; color: var(--success); }
.ep-kpi-trend.down { background: #fef2f2; color: var(--danger); }
.ep-kpi-trend.neutral { background: var(--bg); color: var(--muted); }

/* ── Grid layouts ── */
.ep-dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .65rem;
  align-items: start;
}
.ep-dash-layout.ep-dash-layout--aside {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 290px);
}
.ep-dash-main { display: flex; flex-direction: column; gap: .65rem; min-width: 0; }
.ep-dash-main .ep-dash-row-3,
.ep-dash-main .ep-dash-row-2 { margin-bottom: 0; }
.ep-dash-aside {
  position: sticky;
  top: calc(var(--header-h, 56px) + .65rem);
  max-height: calc(100vh - var(--header-h, 56px) - 1.25rem);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ep-dash-aside-head {
  padding: .7rem .85rem .55rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafc 0%, var(--card) 100%);
  flex-shrink: 0;
}
.ep-dash-aside-head h3 { font-size: .82rem; margin: 0; line-height: 1.25; }
.ep-dash-aside-head .sub { display: block; font-size: .66rem; color: var(--muted); margin-top: .12rem; font-weight: 500; }
.ep-suc-status-stack {
  flex: 1;
  overflow-y: auto;
  padding: .55rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  scrollbar-width: thin;
  /* ~7 tarjetas visibles; el resto con scroll */
  max-height: calc(7 * 5.75rem + 6 * .45rem);
}
.ep-suc-status-stack .ep-suc-status { flex-shrink: 0; padding: .6rem .65rem; border-radius: 10px; }
.ep-suc-status-stack .ep-suc-status-head strong { font-size: .78rem; }
.ep-suc-status-stack .ep-suc-status-meta,
.ep-suc-status-stack .ep-suc-status-kpis,
.ep-suc-status-stack .ep-suc-status-saldos { font-size: .68rem; line-height: 1.35; }

.ep-dash-row-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, .85fr);
  gap: .65rem;
  margin-bottom: .65rem;
  align-items: stretch;
}
.ep-dash-row-3 .ep-card { height: 100%; }
.ep-dash-row-3 .ep-card-body { flex: 1; min-height: 0; }
.ep-dash-row-3 .ep-chart-wrap {
  flex: 1; height: auto; min-height: 140px; max-height: none;
}
.ep-dash-row-3 .ep-alert-list {
  flex: 1; max-height: none; overflow-y: auto; justify-content: flex-start;
}

.ep-dash-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-bottom: .65rem;
  align-items: stretch;
}
.ep-dash-row-3cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Dashboard cards — compacto */
#view-dashboard .ep-card {
  min-height: 0;
  padding: .7rem .8rem;
  border-radius: var(--radius);
}
#view-dashboard .ep-card-head { margin-bottom: .5rem; }
#view-dashboard .ep-card-head h3 { font-size: .82rem; }
#view-dashboard .ep-card-head .sub { font-size: .68rem; }
#view-dashboard .ep-dash-row-2 .ep-chart-wrap {
  flex: none; height: 130px; min-height: 130px; max-height: 130px;
}
#view-dashboard .ep-table.compact td,
#view-dashboard .ep-table.compact th { padding: .2rem .38rem; font-size: .76rem; }
#view-dashboard .ep-currency-cell { gap: .6rem; align-items: center; }
#view-dashboard .ep-currency-name { font-size: .82rem; }
#view-dashboard .ep-currency-code { font-size: .68rem; }
#view-dashboard .ep-currency-pct { min-width: 72px; }
#view-dashboard .ep-alert-item { padding: .5rem .25rem; gap: .5rem; }
#view-dashboard .ep-alert-icon { width: 26px; height: 26px; font-size: .72rem; border-radius: 6px; }
#view-dashboard .ep-alert-item p { font-size: .75rem; }
#view-dashboard .ep-alert-item span { font-size: .65rem; }
#view-dashboard .ep-alert-chevron { width: 14px; height: 14px; }

.ep-sucursal-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .55rem;
  flex: 1;
  min-height: 0;
}
.ep-sucursal-list {
  flex: 0 0 46%;
  max-width: 46%;
  display: flex;
  flex-direction: column;
  gap: .12rem;
  justify-content: center;
  min-width: 0;
}
.ep-sucursal-item {
  display: flex; align-items: center; justify-content: space-between; gap: .35rem;
  font-size: .68rem; padding: .12rem 0;
  border-bottom: 1px solid var(--border);
}
.ep-sucursal-item:last-child { border-bottom: none; }
.ep-sucursal-item strong { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .7rem; }
.ep-sucursal-item span { font-weight: 700; color: var(--blue); flex-shrink: 0; font-size: .72rem; }
.ep-sucursal-item small { display: block; font-size: .58rem; color: var(--muted); font-weight: 400; line-height: 1.15; }
.ep-sucursal-item-info { min-width: 0; flex: 1; }
#view-dashboard .ep-sucursal-card .ep-chart-sucursal {
  flex: 1;
  min-width: 0;
  height: 130px;
  min-height: 130px;
  max-height: 130px;
}

.ep-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.15rem;
  box-shadow: var(--shadow); margin-bottom: 0;
  display: flex; flex-direction: column;
}
.ep-card.compact { min-height: 0; }
.ep-card-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ep-card-body.ep-sucursal-card {
  flex-direction: row;
  align-items: center;
  gap: .55rem;
}
.ep-card-body.ep-sucursal-card .ep-chart-wrap {
  flex: 1;
  min-height: 0;
  height: 130px;
  max-height: 130px;
}
.ep-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; flex-shrink: 0; }
.ep-card-head h3 { font-size: .9rem; font-weight: 600; color: var(--text); }
.ep-card-head .sub { font-size: .7rem; color: var(--muted); font-weight: 400; }
.ep-chart-wrap { position: relative; flex: 1; min-height: 160px; }
.ep-chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* Alertas estilo mockup */
.ep-alert-list { flex: 1; display: flex; flex-direction: column; }
.ep-alert-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem .5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.ep-alert-item:last-child { border-bottom: none; }
.ep-alert-item:hover { background: #f8fafc; border-radius: 8px; }
.ep-alert-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0; font-size: .9rem;
}
.ep-alert-icon.red { background: #fef2f2; }
.ep-alert-icon.amber { background: #fffbeb; }
.ep-alert-icon.blue { background: var(--blue-light); }
.ep-alert-icon.green { background: #ecfdf5; }
.ep-alert-item .ep-alert-text { flex: 1; min-width: 0; }
.ep-alert-item p { font-size: .84rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.ep-alert-item span { font-size: .72rem; color: var(--muted); display: block; margin-top: 2px; }
.ep-alert-chevron { color: #cbd5e1; flex-shrink: 0; }

/* ── Tables ── */
.ep-table { width: 100%; border-collapse: collapse; font-size: .82rem; line-height: 1.25; }
.ep-table th {
  text-align: left; padding: .28rem .42rem; font-size: .72rem; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.ep-table td { padding: .24rem .42rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ep-table tr:last-child td { border-bottom: none; }
.ep-table tr:hover td { background: #f8fafc; }

.ep-currency-cell { display: flex; align-items: center; gap: .45rem; }
.ep-flag-img {
  width: 24px; height: 18px; object-fit: cover; flex-shrink: 0;
  border-radius: 3px; box-shadow: 0 0 0 1px rgba(15,23,42,.1);
  background: #f1f5f9;
}
.ep-flag-img.ep-flag-sm { width: 20px; height: 15px; }
.ep-flag-badge {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 24px; height: 18px; border-radius: 3px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: .55rem; font-weight: 700; color: var(--muted);
}
.ep-currency-name { font-weight: 600; line-height: 1.2; }
.ep-currency-code { font-size: .75rem; color: var(--muted); line-height: 1.2; }

.ep-progress { height: 5px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: .4rem; }
.ep-progress-bar { height: 100%; background: linear-gradient(90deg, var(--blue), #60a5fa); border-radius: 999px; }

.ep-table.compact td, .ep-table.compact th { padding: .2rem .36rem; font-size: .78rem; }
.ep-table .total-row td { font-weight: 700; background: #f8fafc; border-top: 2px solid var(--border); padding: .28rem .42rem; }

/* ── Buttons ── */
.ep-btn {
  border: none; border-radius: 8px; padding: .55rem 1rem;
  font-size: .875rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4rem;
  transition: all .15s;
}
.ep-btn-primary { background: var(--blue); color: #fff; }
.ep-btn-primary:hover { background: var(--blue-dark); }
.ep-btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.ep-btn-success { background: var(--success); color: #fff; }
.ep-btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.ep-btn-sm { padding: .32rem .6rem; font-size: .75rem; }
.ep-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .55rem; border-radius: 999px; font-size: .68rem; font-weight: 600; }
.ep-chip-live { background: #ecfdf5; color: #065f46; }
.ep-chip-live::before { content: ''; width: 6px; height: 6px; background: var(--success); border-radius: 999px; }

.ep-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.ep-empresa-card { max-width: 720px; }
.ep-empresa-note {
  margin-top: 1rem;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ── Forms ── */
.ep-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.ep-field label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .35rem; color: var(--muted); }
.ep-field input, .ep-field select, .ep-field textarea {
  width: 100%; padding: .6rem .85rem; border: 1px solid var(--border);
  border-radius: 8px; font-size: .875rem; background: var(--card); color: var(--text);
  transition: border-color .15s;
}
.ep-field input:focus, .ep-field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.ep-field textarea {
  width: 100%; padding: .6rem .85rem; border: 1px solid var(--border);
  border-radius: 8px; font-size: .875rem; background: var(--card); color: var(--text);
  resize: vertical; min-height: 64px; font-family: inherit;
}

/* Operaciones — cabecera premium */
.ep-op-hero {
  position: relative; overflow: hidden;
  margin: -.25rem 0 .65rem; padding: .75rem .9rem .8rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #0b1224 0%, #152347 42%, #1e1b4b 100%);
  border: 1px solid rgba(99, 102, 241, .35);
  box-shadow: 0 12px 40px rgba(15, 23, 42, .35), inset 0 1px 0 rgba(255,255,255,.08);
  color: #fff;
}
.ep-op-hero-glow {
  position: absolute; inset: -40% -20% auto auto; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(56, 189, 248, .35) 0%, transparent 70%);
  pointer-events: none;
}
.ep-op-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .55rem; position: relative; z-index: 1; }
.ep-op-hero-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.ep-op-hero-sub { font-size: .72rem; color: rgba(255,255,255,.65); margin: .1rem 0 0; }
.ep-op-turno-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: rgba(16, 185, 129, .18); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, .45);
  white-space: nowrap;
}
.ep-op-turno-pill::before { content: ''; width: 7px; height: 7px; border-radius: 999px; background: #34d399; box-shadow: 0 0 8px #34d399; }
.ep-op-turno-pill.off { background: rgba(248, 113, 113, .15); color: #fca5a5; border-color: rgba(248, 113, 113, .4); }
.ep-op-turno-pill.off::before { background: #f87171; box-shadow: 0 0 8px #f87171; }

.ep-op-kpi-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem;
  margin-bottom: 0; position: relative; z-index: 1;
}
.ep-op-stats-bar {
  display: grid;
  grid-template-columns: minmax(240px, 36%) minmax(0, 1fr);
  gap: .45rem;
  align-items: stretch;
  margin-bottom: .65rem;
  position: relative;
  z-index: 1;
}
.ep-op-flujo-inline {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  padding: .35rem .45rem;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
}
.ep-op-flujo-label {
  flex-shrink: 0;
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.45);
  padding-right: .15rem;
  border-right: 1px solid rgba(255,255,255,.1);
  line-height: 1.1;
}
.ep-op-kpi {
  padding: .45rem .5rem; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(6px);
}
.ep-op-kpi-label { display: block; font-size: .58rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.55); margin-bottom: .1rem; }
.ep-op-kpi-val { font-size: .92rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ep-op-kpi-venta .ep-op-kpi-val { color: #6ee7b7; text-shadow: 0 0 20px rgba(52, 211, 153, .35); }
.ep-op-kpi-compra .ep-op-kpi-val { color: #93c5fd; text-shadow: 0 0 20px rgba(96, 165, 250, .35); }
.ep-op-kpi-caja .ep-op-kpi-val { color: #fcd34d; }

.ep-op-flujo-strip, .ep-flujo-strip {
  display: flex; flex-wrap: nowrap; gap: .35rem;
  flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; align-items: center;
  -webkit-overflow-scrolling: touch;
}
.ep-op-flujo-strip::-webkit-scrollbar, .ep-flujo-strip::-webkit-scrollbar { height: 4px; }
.ep-op-flujo-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }
.ep-op-flujo-item, .ep-flujo-item {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .45rem; border-radius: 8px; min-width: 0; flex-shrink: 0;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
}
.ep-op-flujo-item .ep-flag { width: 18px; height: 13px; }
.ep-op-flujo-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .64rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ep-op-flujo-chip strong { color: #e2e8f0; font-size: .62rem; letter-spacing: .03em; }
.ep-op-flujo-chip em { font-style: normal; }
.ep-flujo-item {
  background: var(--card); border-color: var(--border);
  box-shadow: var(--shadow);
}
.ep-op-flujo-info, .ep-flujo-info { min-width: 0; }
.ep-op-flujo-info strong, .ep-flujo-info strong {
  display: block; font-size: .72rem; letter-spacing: .04em; margin-bottom: .12rem;
}
.ep-op-flujo-info strong { color: #e2e8f0; }
.ep-flujo-info strong { color: var(--text); }
.ep-op-flujo-amts, .ep-flujo-amts {
  display: flex; flex-wrap: wrap; gap: .35rem .55rem; font-size: .68rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ep-op-flujo-in, .ep-flujo-in { color: #6ee7b7; }
.ep-op-flujo-out, .ep-flujo-out { color: #fca5a5; }
.ep-op-flujo-empty, .ep-flujo-empty {
  margin: 0; font-size: .64rem; color: rgba(255,255,255,.4); font-style: italic; white-space: nowrap;
}
.ep-flujo-empty { color: var(--muted); }

.ep-op-mode-bar {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  margin-bottom: .55rem; position: relative; z-index: 1;
}
.ep-op-mode {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .75rem; border-radius: 12px; cursor: pointer;
  border: 2px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.75); text-align: left;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.ep-op-mode:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.25); }
.ep-op-mode-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 900; flex-shrink: 0;
  background: rgba(255,255,255,.08);
}
.ep-op-mode-text { display: flex; flex-direction: column; gap: .1rem; }
.ep-op-mode-text strong { font-size: 1rem; letter-spacing: .04em; }
.ep-op-mode-text small { font-size: .68rem; opacity: .75; font-weight: 500; }

.ep-op-mode-venta.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, .35) 0%, rgba(5, 150, 105, .55) 100%);
  border-color: #34d399;
  color: #fff;
  box-shadow: 0 8px 28px rgba(16, 185, 129, .45), inset 0 1px 0 rgba(255,255,255,.2);
}
.ep-op-mode-venta.active .ep-op-mode-icon { background: rgba(255,255,255,.2); box-shadow: 0 0 16px rgba(52, 211, 153, .6); }

.ep-op-mode-compra.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, .35) 0%, rgba(79, 70, 229, .55) 100%);
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 8px 28px rgba(59, 130, 246, .45), inset 0 1px 0 rgba(255,255,255,.2);
}
.ep-op-mode-compra.active .ep-op-mode-icon { background: rgba(255,255,255,.2); box-shadow: 0 0 16px rgba(96, 165, 250, .6); }

.ep-op-subtabs {
  display: flex; gap: .4rem; flex-wrap: wrap; position: relative; z-index: 1;
}
.ep-op-subtabs button {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .75rem; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.7); font-size: .74rem; font-weight: 700;
  transition: background .15s, color .15s, border-color .15s;
}
.ep-op-subtabs button:hover { background: rgba(255,255,255,.12); color: #fff; }
.ep-op-subtabs button.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, .45);
}

.ep-op-hero.dimmed .ep-op-mode-bar { opacity: .45; pointer-events: none; }

/* Operaciones tabs (legacy) */
.ep-op-tabs { display: none; }

/* Clientes panel */
.ep-cli-toolbar { display: flex; gap: .5rem; margin-bottom: .65rem; flex-wrap: wrap; }
.ep-cli-toolbar input, .ep-cli-toolbar select {
  padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--card); font-size: .84rem;
}
.ep-cli-toolbar input { flex: 1; min-width: 180px; }
.ep-cli-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: .65rem; align-items: start; }
.ep-cli-detail-head { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.ep-cli-detail-head h3 { font-size: 1rem; }
.ep-cli-detail-head p { color: var(--muted); font-size: .78rem; }
.ep-cli-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; font-size: .82rem; }
.ep-cli-detail-grid span { display: block; color: var(--muted); font-size: .68rem; margin-bottom: .15rem; }

.ep-kpi-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#rep-kpis.ep-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ep-kpi-rep .ep-kpi-icon-ing,
.ep-kpi-rep .ep-kpi-icon-egr { font-size: .75rem; font-weight: 800; line-height: 1; }
.ep-rep-kpi-values { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 700; line-height: 1.2; }
.ep-rep-kpi-currency { display: inline-flex; align-items: center; gap: .35rem; }
.ep-rep-kpi-currency.ep-rep-ing strong { color: #065f46; }
.ep-rep-kpi-currency.ep-rep-egr strong { color: #991b1b; }
.ep-rep-kpi-empty { color: var(--muted); font-weight: 500; }
.ep-rep-money { display: inline-flex; align-items: center; gap: .35rem; justify-content: flex-end; }
.ep-col-flag {
  width: 30px; min-width: 30px; max-width: 30px;
  padding: .35rem .2rem !important;
  text-align: center; vertical-align: middle;
}
.ep-col-flag .ep-flag-img { display: block; margin: 0 auto; }
.ep-rep-op-amt { display: inline-flex; align-items: baseline; gap: .2rem; line-height: 1.1; white-space: nowrap; }
.ep-rep-op-amt strong { font-size: .82rem; }
.ep-rep-op-amt small { font-size: .68rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.ep-rep-tasa { font-size: .78rem; color: var(--text); }
.ep-table-rep-ops th:nth-child(5),
.ep-table-rep-ops th:nth-child(6),
.ep-table-rep-ops th:nth-child(8) { white-space: nowrap; }
.ep-table-rep-ops td.ep-col-flag + td,
.ep-table-movs td.ep-col-flag + td,
.ep-table-tasas td.ep-col-flag + td { padding-left: .25rem; }

/* ── Tasas ── */
.ep-tas-head .ep-tas-suc { min-width: 180px; }
.ep-tas-card { padding: 0; overflow: hidden; }
.ep-tas-card .ep-tas-table-wrap { padding: .5rem .65rem; }
.ep-tas-mobile-cards { display: none; flex-direction: column; gap: .55rem; padding: .65rem; }
.ep-tas-card-item {
  border: 1px solid var(--border); border-radius: 12px; padding: .7rem .75rem;
  background: var(--card); box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.ep-tas-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .55rem;
}
.ep-tas-card-currency { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.ep-tas-card-currency strong { display: block; font-size: .92rem; line-height: 1.15; }
.ep-tas-card-currency span { display: block; font-size: .72rem; color: var(--muted); line-height: 1.25; margin-top: .1rem; }
.ep-tas-card-rates {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem;
  padding: .55rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: .55rem;
}
.ep-tas-card-rates small {
  display: block; font-size: .62rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: .12rem;
}
.ep-tas-card-rates strong { font-size: .88rem; line-height: 1.2; word-break: break-word; }
.ep-tas-card-edit { width: 100%; justify-content: center; }
.ep-tas-spread-low { color: #059669; }
.ep-tas-spread-mid { color: #d97706; }
.ep-tas-spread-high { color: #dc2626; }
.ep-table-tasas .ep-currency-code { font-size: .72rem; margin-top: .05rem; }

/* ── Caja ── */
.ep-caja-head {
  align-items: flex-start;
  gap: .75rem 1rem;
}
.ep-caja-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem;
  flex: 1 1 320px;
  max-width: 100%;
}
.ep-caja-toolbar .ep-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.ep-caja-actions {
  display: flex; flex-wrap: wrap; gap: .45rem;
}
.ep-caja-mobile-cards { display: none; flex-direction: column; gap: .55rem; }
.ep-caja-card {
  border: 1px solid var(--border); border-radius: 12px; padding: .7rem .75rem;
  background: var(--card); box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.ep-caja-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem;
}
.ep-caja-card-head strong { font-size: .88rem; }
.ep-caja-card-meta { font-size: .78rem; color: var(--text); margin: 0 0 .45rem; line-height: 1.35; }
.ep-caja-card-stats {
  display: grid; grid-template-columns: 1fr; gap: .35rem;
  font-size: .76rem; border-top: 1px solid var(--border); padding-top: .45rem;
}
.ep-caja-card-stats small {
  display: block; font-size: .62rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: .08rem;
}
.ep-caja-card-diff small {
  display: block; font-size: .62rem; color: var(--muted); text-transform: uppercase; margin-bottom: .1rem;
}
.ep-caja-card-diff strong { font-size: .92rem; }
.ep-caja-diff-pos { color: var(--success); }
.ep-caja-diff-neg { color: var(--danger); }
.ep-caja-arq-grid {
  display: grid; grid-template-columns: 1fr; gap: .45rem;
}
.ep-caja-arq-grid > div {
  display: flex; align-items: center; justify-content: space-between; gap: .65rem;
  padding: .25rem 0; border-bottom: 1px dashed var(--border);
}
.ep-caja-arq-grid > div:last-child { border-bottom: none; }
.ep-caja-arq-grid small { margin: 0; font-size: .68rem; color: var(--muted); text-transform: uppercase; }
.ep-caja-fis-input {
  width: 120px; max-width: 55vw; text-align: right; padding: .45rem .5rem;
  border: 1px solid var(--border); border-radius: 8px; font-size: .88rem;
}
.ep-caja-arq-obs { margin-bottom: .65rem; }
.ep-table-caja-arq .ep-caja-fis-input { width: 110px; }

/* ── Reportes: toolbar y tarjetas móvil ── */
.ep-rep-toolbar {
  display: flex; flex-wrap: wrap; gap: .45rem; align-items: stretch;
}
.ep-rep-toolbar-dates {
  display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; flex: 1 1 220px;
}
.ep-rep-toolbar-dates input,
.ep-rep-toolbar-suc,
.ep-rep-toolbar-export .ep-btn { width: 100%; min-height: 38px; }
.ep-rep-toolbar-suc { flex: 1 1 160px; min-width: 0; }
.ep-rep-toolbar-export { display: flex; gap: .45rem; flex: 1 1 100%; }
.ep-rep-toolbar-export .ep-btn { flex: 1; }
.ep-rep-card-body { max-height: 360px; overflow: auto; }
.ep-rep-mobile-cards { display: none; flex-direction: column; gap: .5rem; }
.ep-rep-empty { text-align: center; color: var(--muted); font-size: .82rem; padding: 1rem .5rem; margin: 0; }
.ep-rep-card {
  border: 1px solid var(--border); border-radius: 12px; padding: .65rem .75rem;
  background: var(--card); box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.ep-rep-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .45rem;
}
.ep-rep-card-head-left { display: flex; align-items: center; gap: .4rem; min-width: 0; flex-wrap: wrap; }
.ep-rep-card-num { font-size: .82rem; letter-spacing: -.01em; }
.ep-rep-card-meta { font-size: .72rem; color: var(--muted); font-weight: 500; }
.ep-rep-card-cliente { font-size: .78rem; color: var(--text); margin-bottom: .45rem; }
.ep-rep-card-money-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: .35rem; align-items: end;
}
.ep-rep-card-money {
  display: flex; align-items: flex-start; gap: .35rem; min-width: 0;
}
.ep-rep-card-money small,
.ep-rep-card-tasa small,
.ep-rep-card-stats small {
  display: block; font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .1rem;
}
.ep-rep-card-money strong,
.ep-rep-card-tasa strong { font-size: .78rem; line-height: 1.2; word-break: break-word; }
.ep-rep-card-tasa { text-align: center; padding: 0 .15rem; }
.ep-rep-card-mov-main {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: .35rem;
}
.ep-rep-card-mov-main strong { font-size: .92rem; }
.ep-rep-card-moneda { font-size: .72rem; color: var(--muted); font-weight: 700; }
.ep-rep-card-concepto { font-size: .78rem; color: var(--text); margin: 0 0 .45rem; line-height: 1.35; }
.ep-rep-card-action { width: 100%; justify-content: center; }
.ep-rep-card-mov.ingreso { border-left: 3px solid var(--success); background: rgba(16,185,129,.05); }
.ep-rep-card-mov.egreso { border-left: 3px solid var(--danger); background: rgba(239,68,68,.04); }
.ep-rep-card-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem;
  font-size: .78rem;
}
.ep-rep-card-stats div { display: flex; flex-direction: column; gap: .15rem; align-items: flex-start; }
.ep-rep-card-stats strong { font-size: .8rem; }
.ep-table-movs .ep-mov-row.ep-mov-ingreso { background: rgba(16,185,129,.07); }
.ep-table-movs .ep-mov-row.ep-mov-egreso { background: rgba(239,68,68,.06); }
.ep-table-movs .ep-mov-row td:first-child { box-shadow: inset 3px 0 0 0 transparent; }
.ep-table-movs .ep-mov-ingreso td:first-child { box-shadow: inset 3px 0 0 0 var(--success); }
.ep-table-movs .ep-mov-egreso td:first-child { box-shadow: inset 3px 0 0 0 var(--danger); }
.ep-mov-badge {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .68rem; font-weight: 700; padding: .18rem .45rem; border-radius: 999px; white-space: nowrap;
}
.ep-mov-badge.ingreso { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.ep-mov-badge.egreso { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Badges unificados de tipo de movimiento */
.ep-mov-tipo {
  display: inline-flex; align-items: center; justify-content: center; gap: .15rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .68rem; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap; line-height: 1.2; border: 1px solid transparent;
}
.ep-mov-tipo-venta { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.ep-mov-tipo-compra { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.ep-mov-tipo-ingreso { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.ep-mov-tipo-egreso { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.ep-mov-tipo-other { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.ep-table-hist .ep-hist-col-tipo { white-space: nowrap; }
#caja-kpis.ep-kpi-grid-3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.ep-dash-filters { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }

.ep-notif-btn { position: relative; }
.ep-notif-panel {
  position: absolute; right: 1rem; top: calc(var(--header-h) - .25rem); width: 320px; max-height: 360px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  z-index: 200; overflow: hidden;
}
.ep-notif-head { display: flex; justify-content: space-between; align-items: center; padding: .65rem .85rem; border-bottom: 1px solid var(--border); }
.ep-notif-head-actions { display: flex; align-items: center; gap: .25rem; }
.ep-notif-close { min-width: 2rem; padding: .25rem .45rem; font-size: .9rem; line-height: 1; }
.ep-chart-desc {
  font-size: .72rem;
  color: var(--muted);
  margin: .2rem 0 0;
  line-height: 1.4;
  max-width: 42ch;
}
.ep-chart-empty {
  margin: 0;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.45;
}
.ep-chart-wrap { position: relative; min-height: 200px; }
.ep-chart-wrap canvas.ep-hidden { display: none !important; }
.ep-notif-list { max-height: 300px; overflow: auto; }
.ep-notif-item { padding: .65rem .85rem; border-bottom: 1px solid var(--border); font-size: .8rem; }
.ep-notif-item.unread { background: #fffbeb; }
.ep-notif-item strong { display: block; font-size: .82rem; margin-bottom: .15rem; }
.ep-notif-item span { color: var(--muted); display: block; line-height: 1.35; }
.ep-notif-item small { color: var(--muted); font-size: .68rem; }

.ep-suc-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .65rem; }
.ep-suc-status { border: 1px solid var(--border); border-radius: 12px; padding: .75rem; background: var(--card); }
.ep-suc-status.warn { border-color: #fecaca; background: #fef2f2; }
.ep-suc-status.ok { border-color: #bbf7d0; background: #f0fdf4; }
.ep-suc-status-head { display: flex; justify-content: space-between; align-items: center; gap: .35rem; margin-bottom: .35rem; }
.ep-suc-status-meta, .ep-suc-status-kpis, .ep-suc-status-saldos { font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.ep-suc-badge { font-size: .65rem; font-weight: 700; padding: .15rem .45rem; border-radius: 999px; }
.ep-suc-badge.open { background: #ecfdf5; color: #065f46; }
.ep-suc-badge.closed { background: #fef2f2; color: #991b1b; }

@media (max-width: 1200px) {
  #rep-kpis.ep-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #view-dashboard .ep-dash-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #caja-kpis.ep-kpi-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Ticket térmico 80mm */
.ep-ticket-print-host { position: fixed; left: -9999px; top: 0; }
.ep-ticket {
  width: 72mm; max-width: 72mm; font-family: 'Consolas', 'Courier New', monospace;
  font-size: 11px; line-height: 1.35; color: #000; background: #fff; padding: 8px 6px;
}
.ep-ticket-head { text-align: center; margin-bottom: 8px; }
.ep-ticket-logo { font-size: 16px; font-weight: 800; letter-spacing: .5px; }
.ep-ticket-logo-img {
  max-width: min(100%, 110px);
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto 4px;
  display: block;
}
.ep-ticket-suc-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}
.ep-ticket-suc-logo {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  object-fit: contain;
  border-radius: 2px;
  flex-shrink: 0;
}
.ep-ticket-sub { font-size: 10px; color: #444; margin-top: 2px; }
.ep-ticket-suc { font-size: 10px; font-weight: 600; color: var(--text); margin-top: 4px; }
.ep-ticket-type { font-size: 10px; font-weight: 700; margin-top: 6px; letter-spacing: .04em; }
.ep-ticket-meta div, .ep-ticket-row { display: flex; justify-content: space-between; gap: 8px; margin: 3px 0; }
.ep-ticket-meta span:first-child, .ep-ticket-row span:first-child { color: #555; }
.ep-ticket-line { border-top: 1px dashed #999; margin: 8px 0; }
.ep-ticket-total { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; margin: 8px 0; }
.ep-ticket-foot { text-align: center; font-size: 9px; color: #666; margin-top: 8px; line-height: 1.4; }
#op-recibo .ep-ticket { margin: 0 auto; border: 1px dashed var(--border); border-radius: 8px; }

/* Ticket drawer slide-in desde la derecha */
.ep-ticket-drawer {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none; visibility: hidden;
}
.ep-ticket-drawer.open { pointer-events: auto; visibility: visible; }
.ep-ticket-drawer-overlay {
  position: absolute; inset: 0; background: rgba(15,23,42,.45);
  opacity: 0; transition: opacity .32s ease;
}
.ep-ticket-drawer.visible .ep-ticket-drawer-overlay { opacity: 1; }
.ep-ticket-drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(420px, 100vw);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: -12px 0 40px rgba(15,23,42,.18);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .36s cubic-bezier(.22,1,.36,1);
}
.ep-ticket-drawer.visible .ep-ticket-drawer-panel { transform: translateX(0); }
.ep-ticket-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff;
}
.ep-ticket-drawer-kicker { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; margin: 0 0 .15rem; }
.ep-ticket-drawer-head h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.ep-ticket-drawer-close {
  background: rgba(255,255,255,.15); border: none; color: #fff; width: 36px; height: 36px;
  border-radius: 10px; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.ep-ticket-drawer-close:hover { background: rgba(255,255,255,.25); }
.ep-ticket-drawer-body { flex: 1; overflow: auto; padding: 1.25rem; }
.ep-ticket-drawer-stage {
  background: #fff; border-radius: 14px; padding: 1rem .75rem;
  box-shadow: 0 8px 30px rgba(15,23,42,.08), inset 0 0 0 1px rgba(148,163,184,.25);
  animation: epTicketSlideContent .45s cubic-bezier(.22,1,.36,1) .12s both;
}
@keyframes epTicketSlideContent {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
.ep-ticket-drawer-foot {
  display: flex; gap: .5rem; justify-content: flex-end; padding: 1rem 1.25rem;
  border-top: 1px solid var(--border); background: #fff;
}
.ep-ticket-premium { margin: 0 auto; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 12px 10px; }
body.ep-ticket-open { overflow: hidden; }

.ep-print-frame {
  position: fixed; left: -9999px; top: 0; width: 0; height: 0;
  border: 0; visibility: hidden; pointer-events: none;
}

.ep-cierre-dia-actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.ep-cierre-dia-ciudad { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; margin-top: .1rem; }
.ep-cierre-dia-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem;
  padding: .55rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
}
.ep-cierre-dia-stats small {
  display: block; font-size: .62rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: .1rem;
}
.ep-cierre-dia-stats strong { font-size: .82rem; }
.ep-cierre-ing { color: #065f46; }
.ep-cierre-egr { color: #991b1b; }
.ep-cierre-dia-saldos small {
  display: block; font-size: .62rem; color: var(--muted); text-transform: uppercase; margin-bottom: .35rem;
}
.ep-cierre-saldos-list {
  display: flex; flex-direction: column; gap: .35rem; font-size: .78rem;
}
.ep-cierre-saldos-list span { display: inline-flex; align-items: center; gap: .35rem; }
.ep-cierre-dia-card-item.ok { border-left: 3px solid var(--success); }
.ep-cierre-dia-card-item.warn { border-left: 3px solid var(--warning); background: rgba(245,158,11,.04); }
.ep-cierre-dia-head { flex-wrap: wrap; gap: .5rem; }

/* ── Usuarios móvil ── */
.ep-usr-mobile-cards { display: none; flex-direction: column; gap: .55rem; }
.ep-usr-list-card { padding: .65rem; }
.ep-usr-card {
  border: 1px solid var(--border); border-radius: 12px; padding: .75rem;
  background: var(--card); box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.ep-usr-card.inactive { opacity: .88; background: #f8fafc; }
.ep-usr-card-head {
  display: flex; align-items: center; gap: .65rem; margin-bottom: .5rem;
}
.ep-usr-card-id { flex: 1; min-width: 0; }
.ep-usr-card-id strong { display: block; font-size: .88rem; line-height: 1.2; }
.ep-usr-card-id span { display: block; font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.ep-usr-card-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .55rem; margin-bottom: .35rem;
}
.ep-usr-card-suc { font-size: .75rem; color: var(--text); font-weight: 600; }
.ep-usr-card-contact { font-size: .75rem; color: var(--muted); margin: 0 0 .55rem; line-height: 1.35; }
.ep-usr-card-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: .45rem;
}
.ep-usr-card-actions .ep-btn { width: 100%; justify-content: center; min-height: 38px; }

/* ── Permisos usuario (CRUD) ── */
.ep-perm-panel {
  margin-top: 1rem;
  padding: .85rem .95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.ep-perm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
  flex-wrap: wrap;
}
.ep-perm-head strong { font-size: .88rem; display: block; }
.ep-perm-head p { margin: .15rem 0 0; font-size: .74rem; }
.ep-perm-grid { display: flex; flex-direction: column; gap: .55rem; }
.ep-perm-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.ep-perm-group-title {
  padding: .45rem .65rem;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #1e3a8a;
  background: #eff6ff;
  border-bottom: 1px solid var(--border);
}
.ep-perm-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .35rem .5rem;
  padding: .55rem .65rem;
}
.ep-perm-check {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.ep-perm-check input { accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; }
.ep-hist-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.ep-hist-anulada { opacity: .72; background: #fef2f2; }
.ep-hist-anulada td { text-decoration: line-through; text-decoration-color: rgba(185,28,28,.35); }
.ep-hist-anulada td.ep-hist-col-act,
.ep-hist-anulada td.ep-hist-col-moneda { text-decoration: none; }
.ep-hist-card.ep-hist-anulada .ep-hist-card-det,
.ep-hist-card.ep-hist-anulada .ep-hist-card-foot strong { text-decoration: line-through; text-decoration-color: rgba(185,28,28,.35); }

/* Historial operaciones — columnas fijas, sin solapamiento */
.ep-hist-panel { padding: 0; overflow: hidden; }
.ep-hist-table-wrap { overflow-x: auto; padding: .5rem .65rem; }
.ep-hist-mobile-cards { display: none; flex-direction: column; gap: .55rem; padding: .65rem; }
.ep-table-hist { width: 100%; min-width: 42rem; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.ep-table-hist th,
.ep-table-hist td { overflow: hidden; vertical-align: middle; }
.ep-table-hist .ep-hist-col-doc { width: 20%; }
.ep-table-hist .ep-col-logo { width: 2.75rem; min-width: 2.75rem; max-width: 2.75rem; }
.ep-table-hist .ep-hist-col-tipo { width: 9%; }
.ep-table-hist .ep-hist-col-moneda { width: 6.5rem; min-width: 6.5rem; max-width: 6.5rem; padding: .45rem .35rem !important; text-align: center; }
.ep-table-hist .ep-hist-col-det { width: auto; padding-left: .65rem !important; word-wrap: break-word; overflow-wrap: anywhere; }
.ep-table-hist .ep-hist-col-monto { width: 11%; white-space: nowrap; }
.ep-table-hist .ep-hist-col-act { width: 9.5rem; min-width: 9.5rem; }
.ep-hist-flags {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.ep-hist-flags-single { gap: .35rem; }
.ep-hist-flags .ep-flag-img { display: block; flex-shrink: 0; }
.ep-hist-flag-arrow { font-size: .62rem; color: var(--muted); line-height: 1; flex-shrink: 0; }
.ep-hist-moneda-code { font-size: .68rem; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.ep-hist-hora { color: var(--muted); font-size: .72rem; }
.ep-hist-sub { color: var(--muted); font-size: .74rem; }
.ep-hist-card {
  border: 1px solid var(--border); border-radius: 12px; padding: .7rem .75rem;
  background: var(--card); box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.ep-hist-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .65rem; margin-bottom: .4rem; }
.ep-hist-card-head strong { display: block; font-size: .84rem; }
.ep-hist-card-head .ep-mov-tipo { margin-left: .25rem; }
.ep-hist-card-tipo { display: inline-flex; margin-top: .2rem; }

.ep-hist-card-det { margin: 0 0 .45rem; font-size: .8rem; line-height: 1.35; color: var(--text); }
.ep-hist-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; font-size: .82rem; }

.ep-btn-danger {
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
}
.ep-btn-danger:hover { background: #fee2e2; color: #991b1b; }

/* ── Resumen cierre (reporte gerencia) ── */
.ep-cr-toolbar {
  display: flex; flex-wrap: wrap; gap: .45rem; align-items: stretch;
}
.ep-cr-toolbar input,
.ep-cr-toolbar .ep-btn { min-height: 38px; }
#view-cierre-reporte .ep-cr-head { flex-wrap: wrap; gap: .5rem; }

@media (max-width: 992px) {
  .ep-cli-layout { grid-template-columns: 1fr; }
  .ep-kpi-grid-3 { grid-template-columns: 1fr; }
}

@media print {
  body.ep-printing-ticket .ep-sidebar,
  body.ep-printing-ticket .ep-header,
  body.ep-printing-ticket .ep-no-print,
  body.ep-printing-ticket #main-screen > *:not(.ep-ticket-print-host) { display: none !important; }
  body.ep-printing-ticket .ep-ticket-print-host {
    display: block !important; position: static !important; left: auto !important;
    margin: 0 auto; padding: 0;
  }
  body:not(.ep-printing-ticket) .ep-sidebar, body:not(.ep-printing-ticket) .ep-header, body:not(.ep-printing-ticket) .ep-no-print { display: none !important; }
  body:not(.ep-printing-ticket) .ep-content-wrap { margin-left: 0; }
}

/* ── Operaciones (pantalla única) ── */
.ep-op-single { padding: 1rem 1.15rem; }
.ep-op-block + .ep-op-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ep-op-block-head { margin-bottom: .65rem; }
.ep-op-block-head h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.ep-op-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem .85rem; }
.ep-field-highlight input { font-size: 1.15rem; font-weight: 700; padding: .65rem .75rem; }
.ep-op-cli-bar { display: flex; gap: .45rem; flex-wrap: wrap; align-items: flex-end; }
.ep-op-cli-search { flex: 1; min-width: 160px; margin: 0; }
.ep-op-cli-search input { width: 100%; }
.ep-op-cli-selected { margin-top: .55rem; min-height: 1.75rem; }
.ep-cli-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .65rem; border-radius: 999px; font-size: .82rem;
  background: var(--blue-light); color: var(--blue); border: 1px solid #bfdbfe;
}
.ep-cli-chip.ep-cli-occ { background: #f1f5f9; color: var(--muted); border-color: var(--border); }
.ep-cli-chip button {
  border: none; background: transparent; cursor: pointer; font-size: 1rem; line-height: 1;
  color: inherit; opacity: .65; padding: 0 .1rem;
}
.ep-cli-chip button:hover { opacity: 1; }
.ep-op-cli-results { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; max-height: 140px; overflow: auto; }
.ep-op-cli-pick {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  width: 100%; text-align: left; padding: .5rem .65rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); cursor: pointer; font-size: .84rem;
}
.ep-op-cli-pick:hover { border-color: var(--blue); background: var(--blue-light); }
.ep-op-cli-pick span { color: var(--muted); font-size: .78rem; }
.ep-op-cli-empty { color: var(--muted); font-size: .82rem; margin: .25rem 0 0; }
.ep-op-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; align-items: center; }
.ep-btn-lg { padding: .75rem 1.35rem; font-size: .95rem; font-weight: 700; }
.ep-btn-glow {
  box-shadow: 0 6px 22px rgba(16, 185, 129, .45);
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
}
.ep-btn-glow:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ep-op-success {
  padding: .65rem .85rem; margin-bottom: .85rem; border-radius: 8px;
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; font-size: .875rem;
}

.ep-op-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
.ep-op-summary {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 1.15rem; position: sticky; top: calc(var(--header-h) + 1rem);
}
.ep-op-summary h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 1rem; }
.ep-op-summary .row { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .84rem; }
.ep-op-summary .row span:last-child { text-align: right; font-weight: 600; }
.ep-op-summary .ep-tag-venta { color: #6ee7b7; }
.ep-op-summary .ep-tag-compra { color: #93c5fd; }
.ep-op-summary .row.total { border-bottom: none; font-size: 1.05rem; font-weight: 700; padding-top: .65rem; margin-top: .15rem; border-top: 1px solid rgba(255,255,255,.15); }

/* ── Status badges ── */
.ep-badge-status { padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.ep-badge-status.active { background: #ecfdf5; color: #065f46; }
.ep-badge-status.pending { background: #fffbeb; color: #92400e; }

/* ── Misc ── */
.ep-alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .875rem; }
.ep-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.ep-alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.ep-alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
button[data-action="abrir-turno"]:disabled { opacity: .55; cursor: not-allowed; }
.ep-alert-info { background: var(--blue-light); color: var(--blue-dark); }
.ep-hidden { display: none !important; }

/* SweetAlert2 — ExchangePro */
.ep-swal-popup {
  border-radius: 14px !important;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
  padding: 1.25rem 1.25rem 1rem !important;
}
.ep-swal-toast { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important; border-radius: 10px !important; }
.ep-swal-btn-confirm {
  border-radius: 8px !important;
  font-weight: 600 !important;
  background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35) !important;
}
.ep-swal-btn-cancel {
  border-radius: 8px !important;
  font-weight: 600 !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
}
.ep-swal-form { text-align: left; }
.ep-swal-form label {
  display: block; font-size: .72rem; font-weight: 600; color: var(--muted);
  margin: .5rem 0 .25rem; text-transform: uppercase; letter-spacing: .04em;
}
.ep-swal-form label:first-child { margin-top: 0; }
.ep-swal-form .swal2-input { margin: 0 0 .15rem !important; width: 100% !important; }
.ep-swal-form .swal2-select {
  width: 100% !important; margin: 0 0 .15rem !important;
  padding: .55rem .65rem; border-radius: 8px; border: 1px solid var(--border);
  font-size: .9rem; background: #fff;
}
.ep-swal-saldos {
  font-size: .78rem; color: var(--muted); margin: 0 0 .5rem; line-height: 1.45;
  padding: .45rem .55rem; background: #f8fafc; border-radius: 8px; border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .35rem;
}
.ep-swal-saldo-row {
  display: flex; align-items: center; gap: .45rem; padding: .2rem 0;
  border-bottom: 1px dashed #e2e8f0;
}
.ep-swal-saldo-row:last-child { border-bottom: none; padding-bottom: 0; }
.ep-swal-saldo-code { min-width: 2.5rem; font-weight: 600; color: var(--text); font-size: .75rem; }
.ep-swal-note { text-align: left; font-size: .82rem; color: #64748b; margin: 0 0 .75rem; line-height: 1.45; }
.ep-swal-user {
  display: inline-flex; align-items: center; gap: .35rem;
  vertical-align: middle; white-space: nowrap;
}
.ep-swal-user .ep-avatar-xs,
.ep-swal-user .ep-avatar-sm {
  width: 28px; height: 28px; font-size: .58rem;
}
.ep-swal-user strong { font-size: .82rem; color: var(--text); }

.ep-text-right { text-align: right; }
.ep-mono { font-family: 'Consolas', monospace; }
.ep-view { display: none; }
.ep-view.active { display: block; }
.ep-placeholder-view { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.ep-placeholder-view h3 { color: var(--text); margin-bottom: .5rem; }

/* Cards fuera del dashboard */
.ep-view:not(#view-dashboard) .ep-card { margin-bottom: 1rem; min-height: auto; display: block; }

/* ── Responsive ── */
@media (max-width: 1400px) {
  .ep-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ep-kpi .value { font-size: .95rem; }
}

@media (max-width: 1200px) {
  .ep-dash-layout.ep-dash-layout--aside { grid-template-columns: 1fr; }
  .ep-dash-aside { position: static; max-height: 340px; }
  .ep-dash-row-3 { grid-template-columns: 1fr 1fr; }
  .ep-dash-row-3 .ep-card:last-child { grid-column: 1 / -1; }
  .ep-dash-row-2, .ep-dash-row-3cols { grid-template-columns: 1fr; }
  .ep-op-layout { grid-template-columns: 1fr; }
  .ep-op-grid { grid-template-columns: 1fr; }
  .ep-op-summary { position: static; }
  .ep-op-mode-bar { grid-template-columns: 1fr 1fr; }
  .ep-footer-inner { grid-template-columns: repeat(3, 1fr); }
  .ep-footer-brand { grid-column: 1 / -1; border-left: none; border-top: 1px solid rgba(255,255,255,.08); padding-top: .75rem; justify-content: center; }
  .ep-footer-brands { justify-content: center; }
}

@media (max-height: 820px), (max-width: 1366px) {
  .ep-op-hero { padding: .6rem .75rem .7rem; margin-bottom: .5rem; }
  .ep-op-hero-sub { display: none; }
  .ep-op-hero-top { margin-bottom: .4rem; }
  .ep-op-stats-bar { margin-bottom: .45rem; gap: .35rem; }
  .ep-op-kpi { padding: .35rem .42rem; }
  .ep-op-kpi-val { font-size: .82rem; }
  .ep-op-mode { padding: .5rem .65rem; gap: .5rem; }
  .ep-op-mode-icon { width: 32px; height: 32px; font-size: 1rem; }
  .ep-op-mode-text small { display: none; }
  .ep-op-mode-text strong { font-size: .85rem; }
  .ep-op-subtabs button { padding: .35rem .55rem; font-size: .72rem; }
}

@media (max-width: 992px) {
  .ep-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-dashboard .ep-dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ep-user-menu span { display: none; }
  .ep-op-stats-bar { grid-template-columns: 1fr; }
  .ep-op-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .ep-sidebar-overlay.ep-open { display: block; }
  .ep-layout.ep-sidebar-collapsed { --sidebar-w: var(--sidebar-w-mini); }
  .ep-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  .ep-sidebar.ep-open { transform: translateX(0); }
  .ep-content-wrap { margin-left: 0; width: 100%; }
  .ep-content-wrap > .ep-footer { left: 0; }
  :root { --footer-h: 132px; }
  .ep-login-inner { grid-template-columns: 1fr; }
  .ep-login-hero { display: none; }
  .ep-login-brand-mobile { display: flex; }
  .ep-login-panel { padding: 1.25rem 1rem 1.5rem; align-items: flex-start; padding-top: 1.75rem; }
  .ep-login-card-pro { padding: 1.5rem 1.25rem 1.25rem; border-radius: 14px; }
  .ep-login-card-head h2 { font-size: 1.2rem; }
  .ep-cal-hint { margin-left: 0; width: 100%; }
  #view-reportes .ep-rep-head { flex-direction: column; align-items: stretch; }
  #view-reportes .ep-rep-toolbar { width: 100%; }
  #rep-kpis.ep-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  #rep-kpis .ep-kpi-rep:nth-child(3),
  #rep-kpis .ep-kpi-rep:nth-child(4) { grid-column: span 1; }
  #rep-kpis .ep-rep-kpi-values { font-size: .78rem; gap: .22rem; }
  #rep-kpis .ep-kpi-rep { padding: .55rem .6rem; }
  #rep-kpis .ep-kpi-rep .label { font-size: .68rem; }
  #view-reportes .ep-rep-table-wrap { display: none; }
  #view-reportes .ep-rep-mobile-cards { display: flex; }
  #view-reportes .ep-rep-card-body { max-height: none; overflow: visible; }
  #view-reportes .ep-rep-suc-card { padding: .65rem; }
  #view-tasas .ep-tas-table-wrap { display: none; }
  #view-tasas .ep-tas-mobile-cards { display: flex; }
  #view-tasas .ep-tas-head { flex-direction: column; align-items: stretch; }
  #view-tasas .ep-tas-suc { width: 100%; min-height: 38px; }
  #view-caja .ep-caja-head { flex-direction: column; align-items: stretch; }
  .ep-caja-toolbar { justify-content: flex-start; flex: none; width: 100%; }
  .ep-caja-toolbar .ep-btn { flex: 1 1 calc(50% - .25rem); min-width: 0; justify-content: center; }
  #view-caja .ep-caja-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; width: 100%;
  }
  #view-caja .ep-caja-actions .ep-btn { width: 100%; justify-content: center; min-height: 38px; }
  #view-caja .ep-caja-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  #view-caja .ep-caja-table-wrap { display: none; }
  #view-caja .ep-caja-mobile-cards { display: flex; }
  #view-caja .ep-caja-flujo-strip {
    flex-wrap: wrap; overflow-x: visible; gap: .45rem;
  }
  #view-caja .ep-caja-flujo-strip .ep-flujo-item {
    flex: 1 1 100%; min-width: 0; padding: .55rem .65rem;
  }
  #view-caja .ep-caja-flujo-card .ep-card-head .sub { display: block; margin-top: .15rem; }
  #view-caja .ep-cierre-dia-table-wrap { display: none; }
  #view-caja .ep-cierre-dia-cards { display: flex; }
  #view-caja .ep-cierre-dia-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  #view-operaciones .ep-hist-table-wrap { display: none; }
  #view-operaciones .ep-hist-mobile-cards { display: flex; }
  #view-caja .ep-cierre-dia-head { flex-direction: column; align-items: stretch; }
  #view-caja .ep-cierre-dia-actions {
    display: grid; grid-template-columns: 1fr; gap: .45rem; width: 100%;
  }
  #view-caja .ep-cierre-dia-actions .ep-btn,
  #view-caja .ep-cierre-dia-actions input { width: 100%; min-height: 38px; }
  #view-usuarios .ep-usr-head { flex-direction: column; align-items: stretch; }
  #view-usuarios .ep-usr-new-btn { width: 100%; justify-content: center; min-height: 40px; }
  #view-usuarios .ep-usr-toolbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: .45rem;
  }
  #view-usuarios .ep-usr-toolbar select,
  #view-usuarios .ep-usr-toolbar button { width: 100%; min-height: 38px; }
  #view-usuarios .ep-usr-toolbar button { grid-column: 1 / -1; }
  #view-usuarios .ep-usr-table-wrap { display: none; }
  #view-usuarios .ep-usr-mobile-cards { display: flex; }
  #view-usuarios .ep-perm-items { grid-template-columns: 1fr; }
  #view-usuarios .ep-perm-head { flex-direction: column; align-items: stretch; }
  #view-usuarios .ep-perm-head .ep-btn { width: 100%; justify-content: center; }
  #view-cierre-reporte .ep-cr-head { flex-direction: column; align-items: stretch; }
  #view-cierre-reporte .ep-cr-toolbar {
    display: grid; grid-template-columns: 1fr; gap: .45rem; width: 100%;
  }
  #view-cierre-reporte .ep-cr-toolbar .ep-btn,
  #view-cierre-reporte .ep-cr-toolbar input { width: 100%; justify-content: center; }
  #view-cierre-reporte .ep-cierre-dia-table-wrap { display: none; }
  #view-cierre-reporte .ep-cierre-dia-cards { display: flex; }
  #view-cierre-reporte .ep-cierre-dia-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .ep-rep-cod { display: none; }
  .ep-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem .65rem;
    align-items: start;
  }
  .ep-footer-brand {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: .65rem 0 0;
    min-width: 0;
    justify-content: center;
  }
  .ep-footer-brands {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: .45rem;
    width: 100%;
  }
  .ep-footer-brands > .ep-logo-block {
    flex: 1 1 0;
    min-width: 0;
    gap: .35rem;
  }
  .ep-footer-brands .ep-logo-svg-lg,
  .ep-msoft-logo {
    width: 36px;
    height: 36px;
  }
  .ep-footer-brands .ep-brand-text h1 {
    font-size: .88rem;
    white-space: nowrap;
  }
  .ep-footer-brands .ep-brand-text .ep-brand-tagline {
    font-size: .48rem;
    max-width: none;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ep-footer-brand-divider {
    min-height: 34px;
    align-self: center;
  }
  .ep-msoft-title {
    font-size: .5rem;
    line-height: 1.15;
    white-space: normal;
    text-align: left;
  }
  .ep-footer-item { min-width: 0; gap: .4rem; }
  .ep-footer-item p { font-size: .6rem; line-height: 1.25; }
  .ep-footer-icon { width: 30px; height: 30px; }
  .ep-footer-icon svg { width: 16px; height: 16px; }
  .ep-dash-row-3 { grid-template-columns: 1fr; }
  .ep-dash-row-3 .ep-card:last-child { grid-column: auto; }
  .ep-dash-row-3 .ep-chart-wrap { min-height: 160px; }
  #view-dashboard .ep-dash-row-2 .ep-chart-wrap { height: 130px; min-height: 130px; max-height: 130px; }
}

@media (max-width: 480px) {
  .ep-card-body.ep-sucursal-card { flex-direction: column; align-items: stretch; }
  .ep-sucursal-list { flex: none; max-width: none; }
}

@media (max-width: 640px) {
  #header-branch { display: none; }
  .ep-page-head > div:last-child { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .ep-breadcrumb svg:first-child { display: none; }
}

@media (max-width: 480px) {
  .ep-kpi-grid { grid-template-columns: 1fr 1fr; gap: .4rem; }
  #rep-kpis.ep-kpi-grid { grid-template-columns: 1fr 1fr; }
  .ep-rep-card-money-grid { grid-template-columns: 1fr; }
  .ep-tas-card-rates { grid-template-columns: 1fr; gap: .35rem; }
  .ep-tas-card-rates > div {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .2rem 0;
  }
  .ep-tas-card-rates small { margin: 0; }
  .ep-rep-card-tasa {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    text-align: left; padding: .35rem 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border);
  }
  .ep-rep-card-tasa small { margin: 0; }
  .ep-kpi { padding: .5rem .55rem; }
  .ep-kpi .value { font-size: .85rem; }
  .ep-page-head h2 { font-size: 1rem; }
  .ep-footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .55rem; }
  .ep-footer-item strong { font-size: .54rem; letter-spacing: .07em; }
  .ep-footer-item p { font-size: .58rem; }
  .ep-footer-icon { width: 28px; height: 28px; border-radius: 7px; }
  .ep-notif-btn { width: 34px; height: 34px; }
  .ep-footer-brands .ep-logo-svg-lg,
  .ep-footer-brands .ep-msoft-logo {
    width: 32px;
    height: 32px;
  }
  .ep-footer-brands .ep-brand-text h1 { font-size: .78rem; }
  .ep-footer-brands .ep-brand-text .ep-brand-tagline { -webkit-line-clamp: 1; }
  .ep-msoft-title { font-size: .46rem; }
  .ep-footer-brand-divider { min-height: 30px; }
}

/* Auditoría — tabla con scroll + paginación siempre visible */
#view-auditoria.active {
  display: block;
}

#view-auditoria .ep-aud-layout {
  align-items: stretch;
}

#view-auditoria .ep-aud-layout:has(.ep-aud-detail-card:not(.ep-hidden)) {
  grid-template-columns: 1.2fr .8fr;
}

#view-auditoria .ep-aud-list-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

#view-auditoria .ep-rep-card-body {
  display: flex;
  flex-direction: column;
  max-height: none;
  overflow: visible;
  padding-bottom: 0;
}

#view-auditoria .ep-rep-table-wrap {
  overflow: auto;
  min-height: 220px;
  max-height: calc(100dvh - 17.5rem);
  -webkit-overflow-scrolling: touch;
}

#view-auditoria .ep-table-aud thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  box-shadow: 0 1px 0 var(--border);
}

#view-auditoria .ep-table-aud td,
#view-auditoria .ep-table-aud th {
  padding: .28rem .4rem;
  font-size: .76rem;
  line-height: 1.2;
}

#view-auditoria .ep-table-aud tbody tr { height: 2rem; }

#view-auditoria .ep-aud-pager {
  flex-shrink: 0;
  margin-top: 0;
  padding: .6rem .5rem .45rem;
  border-top: 1px solid var(--border);
  background: var(--card);
}

#view-auditoria .ep-aud-detail-card .ep-card-body {
  overflow: auto;
  max-height: calc(100dvh - 17.5rem);
}

.ep-aud-search { min-width: 140px; max-width: 200px; }
.ep-aud-badge {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .45rem;
  border-radius: 999px; background: #eff6ff; color: #1d4ed8; white-space: nowrap;
}
.ep-aud-meta { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: var(--muted); }
.ep-aud-pager { display: flex; align-items: center; justify-content: center; gap: .75rem; padding-top: .65rem; border-top: 1px solid var(--border); margin-top: .5rem; }
.ep-aud-pager #aud-page-info { font-size: .82rem; color: var(--muted); min-width: 8rem; text-align: center; }
.ep-aud-pager .ep-btn { min-width: 6.5rem; }
.ep-aud-dl { display: grid; grid-template-columns: 100px 1fr; gap: .35rem .65rem; font-size: .85rem; margin: 0; }
.ep-aud-dl dt { color: var(--muted); font-weight: 600; }
.ep-aud-dl dd { margin: 0; word-break: break-word; }
.ep-aud-json {
  margin: 0; padding: .5rem; background: #f8fafc; border: 1px solid var(--border);
  border-radius: 6px; font-size: .72rem; max-height: 160px; overflow: auto;
}
.ep-text-success { color: #059669 !important; }
.ep-text-danger { color: #dc2626 !important; }
.ep-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a5f; padding: .55rem .75rem; border-radius: 8px; }
@media (max-width: 900px) {
  #view-auditoria .ep-aud-layout:has(.ep-aud-detail-card:not(.ep-hidden)) { grid-template-columns: 1fr; }
  #view-auditoria .ep-rep-table-wrap { max-height: calc(100dvh - 20rem); }
  #view-ganancias .ep-rep-table-wrap { display: none; }
  #view-ganancias .ep-rep-mobile-cards { display: flex; }
  #view-auditoria .ep-aud-detail-card:not(.ep-hidden) { display: flex; }
}
