    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --brand:    #1a3a5c;
      --accent:   #e8a020;
      --panel-bg: #0f2540;
      --bg:       #e2e8ef;
      --surface:  #ffffff;
      --border:   #e2e8f0;
      --text:     #1a2d42;
      --muted:    #718096;
      --green:    #2f855a;
      --red:      #c53030;
      --radius:   .75rem;
    }
    body {
      font-family: 'DM Sans', system-ui, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
    }

    /* ---- NAVBAR ---- */
    .navbar {
      background: #2d3748;
      padding: 0 24px;
      min-height: 56px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      color: white;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    .navbar-brand { font-size: 16px; font-weight: 600; letter-spacing: 0.3px; }
    .navbar-brand span { color: #63b3ed; }
    .navbar-user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #a0aec0; }
    @media (max-width: 600px) {
      .navbar { padding: 10px 16px; gap: 6px; }
      .navbar-brand { flex: 1; }
      .navbar-user { order: 2; }
      .nav-tabs { order: 3; width: 100%; justify-content: center; padding-bottom: 6px; }
    }

    /* ---- LOGIN SCREEN ---- */
    #loginScreen { min-height: 100vh; display: flex; overflow: hidden; }
    .lx-wrapper { display: grid; grid-template-columns: 25fr 75fr; width: 100%; min-height: 100vh; }
    .lx-brand {
      background: #0f2540; position: relative; overflow: hidden;
      display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem;
    }
    .lx-brand::before {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: radial-gradient(ellipse 80% 60% at 110% 0%, rgba(232,160,32,.18) 0%, transparent 70%),
                  radial-gradient(ellipse 60% 80% at -10% 100%, rgba(232,160,32,.10) 0%, transparent 60%);
    }
    .lx-geo-grid {
      position: absolute; inset: 0; pointer-events: none;
      background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
                        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
      background-size: 48px 48px;
    }
    .lx-geo-circle { position: absolute; border-radius: 50%; border: 1px solid rgba(232,160,32,.15); pointer-events: none; }
    .lx-geo-c1 { width: 300px; height: 300px; bottom: -60px; right: -60px; }
    .lx-geo-c2 { width: 160px; height: 160px; bottom: 50px; right: 30px; }
    .lx-brand-logo {
      position: relative; z-index: 1; display: flex; align-items: center; gap: .75rem;
      animation: lxSlideDown .7s cubic-bezier(.25,.8,.25,1) both;
    }
    .lx-brand-icon {
      width: 40px; height: 40px; background: #e8a020; border-radius: .5rem; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center; font-size: 1.25rem; color: #0f2540;
    }
    .lx-brand-name {
      font-family: 'Lexend', sans-serif; font-weight: 700; font-size: .75rem;
      letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.52); line-height: 1.3;
    }
    .lx-brand-name strong { display: block; color: #fff; font-size: .9rem; letter-spacing: .04em; }
    .lx-brand-mid {
      position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; justify-content: center;
      animation: lxSlideDown .75s cubic-bezier(.25,.8,.25,1) .2s both;
    }
    .lx-brand-hl {
      font-family: 'Lexend', sans-serif; font-weight: 300;
      font-size: clamp(1.5rem, 2.2vw, 2rem); color: #fff; line-height: 1.25; margin-bottom: 1rem;
    }
    .lx-brand-hl em { font-style: normal; color: #e8a020; font-weight: 600; }
    .lx-brand-sub { font-size: .875rem; color: rgba(255,255,255,.52); line-height: 1.6; }
    .lx-brand-stats {
      position: relative; z-index: 1; display: flex; gap: 1.75rem;
      animation: lxSlideUp .7s cubic-bezier(.25,.8,.25,1) .35s both;
    }
    .lx-stat { border-top: 2px solid rgba(255,255,255,.12); padding-top: .75rem; }
    .lx-stat-v { font-family: 'Lexend', sans-serif; font-weight: 700; font-size: 1.35rem; color: #e8a020; line-height: 1; margin-bottom: .2rem; }
    .lx-stat-l { font-size: .7rem; color: rgba(255,255,255,.52); text-transform: uppercase; letter-spacing: .08em; }
    .lx-form { display: flex; align-items: center; justify-content: center; background: #f0f4f8; padding: 2rem; }
    .lx-card {
      width: 100%; max-width: 420px; background: #fff;
      border-radius: 1.25rem; box-shadow: 0 24px 64px rgba(0,0,0,.18);
      padding: 2.75rem 2.5rem; animation: lxSlideRight .65s cubic-bezier(.25,.8,.25,1) .15s both;
    }
    .lx-eyebrow { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #e8a020; margin-bottom: .5rem; }
    .lx-title { font-family: 'Lexend', sans-serif; font-weight: 700; font-size: 1.6rem; color: #1a3a5c; margin-bottom: .375rem; line-height: 1.2; }
    .lx-subtitle { font-size: .875rem; color: #8898aa; margin-bottom: 1.75rem; }
    .lx-fg { margin-bottom: 1.25rem; }
    .lx-label { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #495057; margin-bottom: .45rem; }
    .lx-iw { position: relative; }
    .lx-iico { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #aab2bd; font-size: 1rem; pointer-events: none; transition: color .2s; }
    .lx-iw:focus-within .lx-iico { color: #1a3a5c; }
    .lx-inp {
      width: 100%; padding: .75rem 1rem .75rem 2.75rem;
      font-family: 'DM Sans', sans-serif; font-size: .925rem; color: #1a3a5c;
      background: #f8fafc; border: 1.5px solid #dee2e6; border-radius: .625rem;
      outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
      appearance: none; -webkit-appearance: none;
    }
    .lx-inp:focus { border-color: #1a3a5c !important; background: #fff; box-shadow: 0 0 0 3px rgba(26,58,92,.1) !important; }
    .lx-inp::placeholder { color: #b0bec5; font-weight: 300; }
    .lx-pw-toggle { position: absolute; right: .875rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: #aab2bd; font-size: 1rem; cursor: pointer; padding: 0; line-height: 1; transition: color .2s; }
    .lx-pw-toggle:hover { color: #1a3a5c; }
    .lx-btn-login {
      display: block; width: 100%; padding: .875rem 1.5rem; margin-top: .5rem;
      font-family: 'Lexend', sans-serif; font-weight: 600; font-size: .95rem;
      letter-spacing: .04em; color: #fff; background: #1a3a5c; border: none;
      border-radius: .625rem; cursor: pointer; position: relative; overflow: hidden;
      transition: background .25s, transform .15s, box-shadow .25s;
      box-shadow: 0 4px 16px rgba(26,58,92,.3);
    }
    .lx-btn-login::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%); transform: translateX(-100%); transition: transform .5s; }
    .lx-btn-login:hover { background: #0f2540; box-shadow: 0 6px 24px rgba(26,58,92,.4); transform: translateY(-1px); }
    .lx-btn-login:hover::after { transform: translateX(100%); }
    .lx-btn-login:active { transform: translateY(0); }
    .lx-btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }
    .lx-div { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0 0; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #b0bec5; }
    .lx-div::before, .lx-div::after { content: ''; flex: 1; height: 1px; background: #e9ecef; }
    .lx-foot { font-size: .75rem; color: #b0bec5; display: flex; align-items: center; justify-content: center; gap: .375rem; margin-top: 1rem; }
    .lx-forgot { display: block; width: 100%; margin-top: .875rem; background: none; border: none; font-family: 'DM Sans', sans-serif; font-size: .8rem; color: #8898aa; cursor: pointer; text-align: center; text-decoration: underline; text-underline-offset: 2px; transition: color .2s; padding: 0; }
    .lx-forgot:hover { color: #1a3a5c; }
    .lx-recovery { display: none; }
    .lx-recovery-back { display: inline-flex; align-items: center; gap: .375rem; background: none; border: none; font-family: 'DM Sans', sans-serif; font-size: .8rem; color: #8898aa; cursor: pointer; text-decoration: none; margin-bottom: 1.25rem; transition: color .2s; padding: 0; }
    .lx-recovery-back:hover { color: #1a3a5c; }
    .lx-alert-ok { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; border-radius: .5rem; padding: .75rem 1rem; font-size: .875rem; margin-bottom: 1rem; }
    @keyframes lxSlideDown  { from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:translateY(0); } }
    @keyframes lxSlideUp    { from { opacity:0; transform:translateY(16px);  } to { opacity:1; transform:translateY(0); } }
    @keyframes lxSlideRight { from { opacity:0; transform:translateX(24px);  } to { opacity:1; transform:translateX(0); } }
    @media (max-width: 768px) {
      .lx-wrapper { grid-template-columns: 1fr; }
      .lx-brand { display: none; }
      .lx-form { background: #0f2540; }
    }

    /* ── Main App ───────────────────────────────────────────────────────────── */
    #app { display: none; min-height: 100vh; }
    .c-page { width: 80%; margin: 0 auto; padding: 28px 28px 48px; }
    .ct-page { padding: 1.5rem 1.5rem 3rem; }

    /* ── Sidebar ─────────────────────────────────────────────────────────────── */
    .c-sidebar {
      width: 252px; background: #0f2540; flex-shrink: 0;
      display: flex; flex-direction: column;
      position: fixed; inset: 0 auto 0 0; z-index: 50; overflow: hidden;
    }
    .c-sidebar::before {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: radial-gradient(ellipse 120% 50% at 120% 0%, rgba(232,160,32,.10) 0%, transparent 60%),
                  radial-gradient(ellipse 80% 60% at -20% 100%, rgba(232,160,32,.07) 0%, transparent 60%);
    }
    .c-sidebar-geo {
      position: absolute; inset: 0; pointer-events: none;
      background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
                        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
      background-size: 36px 36px;
    }
    .c-brand {
      display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.25rem;
      border-bottom: 1px solid rgba(255,255,255,.07); position: relative; z-index: 1; flex-shrink: 0;
    }
    .c-brand-icon {
      width: 34px; height: 34px; background: var(--accent); border-radius: .4rem; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center; font-size: 1.05rem; color: var(--panel-bg);
    }
    .c-brand-text {
      font-family: 'Lexend', sans-serif; font-weight: 700; font-size: .68rem;
      letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.45); line-height: 1.3;
    }
    .c-brand-text strong { display: block; color: #fff; font-size: .8rem; letter-spacing: .03em; }
    .c-nav { flex: 1; padding: .75rem 0; position: relative; z-index: 1; overflow-y: auto; }
    .c-nav-label {
      font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
      color: rgba(255,255,255,.28); padding: .65rem 1.25rem .3rem;
    }
    .c-nav-item {
      display: flex; align-items: center; gap: .65rem; padding: .6rem 1.25rem;
      color: rgba(255,255,255,.58); font-size: .84rem; font-weight: 500;
      cursor: pointer; position: relative; transition: color .2s, background .2s;
      border: none; background: none; width: 100%; text-align: left;
      font-family: 'DM Sans', sans-serif; user-select: none;
    }
    .c-nav-item:hover { color: rgba(255,255,255,.9); background: rgba(255,255,255,.05); }
    .c-nav-item.active { color: #fff; background: rgba(232,160,32,.12); }
    .c-nav-item.active::before {
      content: ''; position: absolute; left: 0; top: 0; bottom: 0;
      width: 3px; background: var(--accent); border-radius: 0 2px 2px 0;
    }
    .c-nav-item i { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
    .c-nav-item.active i { color: var(--accent); }
    .c-user {
      padding: .875rem 1.25rem; border-top: 1px solid rgba(255,255,255,.07);
      display: flex; align-items: center; gap: .6rem; position: relative; z-index: 1; flex-shrink: 0;
    }
    .c-user-avatar {
      width: 32px; height: 32px; border-radius: 50%;
      background: rgba(232,160,32,.2); border: 2px solid rgba(232,160,32,.4);
      display: flex; align-items: center; justify-content: center; font-size: .85rem; color: #e8a020; flex-shrink: 0;
    }
    .c-user-info { flex: 1; min-width: 0; }
    .c-username { font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
    .c-user-role { font-size: .68rem; color: rgba(255,255,255,.38); }
    .c-changepw { background: none; border: none; color: rgba(255,255,255,.35); font-size: .95rem; cursor: pointer; padding: .2rem; transition: color .2s; line-height: 1; }
    .c-changepw:hover { color: #e8a020; }
    .c-logout { background: none; border: none; color: rgba(255,255,255,.35); font-size: .95rem; cursor: pointer; padding: .2rem; transition: color .2s; line-height: 1; }
    .c-logout:hover { color: #ef4444; }

    /* ── Main content ────────────────────────────────────────────────────────── */
    .c-main { margin-left: 252px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

    /* ── Mobile header + hamburger ───────────────────────────────────────────── */
    .c-hamburger { display: none; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; padding: .2rem; line-height: 1; }
    .c-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 49; backdrop-filter: blur(2px); }
    .c-overlay.show { display: block; }
    .c-mobile-hdr {
      display: none; background: var(--panel-bg); height: 52px; align-items: center;
      padding: 0 16px; gap: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.3);
      position: sticky; top: 0; z-index: 40;
    }
    .c-mobile-brand { display: flex; align-items: center; gap: .5rem; flex: 1; }
    .c-mobile-brand-icon { width: 28px; height: 28px; background: var(--accent); border-radius: .35rem; display: flex; align-items: center; justify-content: center; font-size: .85rem; color: var(--panel-bg); }
    .c-mobile-brand-text { font-family: 'Lexend', sans-serif; font-size: .78rem; font-weight: 700; color: #fff; }
    /* ── Modal cambiar contraseña (cliente) ── */
    .cpw-modal-bg {
      display: none; position: fixed; inset: 0; z-index: 200;
      background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
      align-items: flex-start; justify-content: center;
      overflow-y: auto; padding: 1.5rem 0;
    }
    .cpw-modal-bg.show { display: flex; }
    .cpw-modal {
      background: #fff; border-radius: .75rem; padding: 1.75rem;
      width: 90%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
    }
    .cpw-modal h3 { margin: 0 0 1.25rem; font-family: 'Lexend', sans-serif; font-size: 1rem; color: #1a3a5c; }
    .cpw-fg { margin-bottom: 1rem; }
    .cpw-label { display: block; font-size: .78rem; font-weight: 600; color: #495057; margin-bottom: .35rem; }
    .cpw-inp {
      width: 100%; padding: .6rem .875rem; border: 1.5px solid #e2e8f0;
      border-radius: .5rem; font-size: .875rem; font-family: 'DM Sans', sans-serif;
      color: #1a3a5c; background: #f8fafc; box-sizing: border-box;
    }
    .cpw-inp:focus { outline: none; border-color: #1a3a5c; background: #fff; box-shadow: 0 0 0 3px rgba(26,58,92,.1); }
    .cpw-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
    .cpw-btn-cancel {
      padding: .5rem 1.1rem; border-radius: .4rem; border: 1.5px solid #e2e8f0;
      background: #fff; color: #64748b; font-size: .85rem; font-family: 'DM Sans', sans-serif; cursor: pointer;
    }
    .cpw-btn-cancel:hover { background: #f1f5f9; }
    .cpw-btn-save {
      padding: .5rem 1.25rem; border-radius: .4rem; border: none;
      background: #1a3a5c; color: #fff; font-size: .85rem; font-family: 'Lexend', sans-serif; font-weight: 600; cursor: pointer;
      transition: background .2s;
    }
    .cpw-btn-save:hover { background: #0f2540; }
    .cpw-btn-save:disabled { opacity: .6; cursor: not-allowed; }
    .cpw-alert { padding: .65rem .875rem; border-radius: .4rem; font-size: .84rem; margin-bottom: 1rem; }
    .cpw-alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
    .cpw-alert-ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

    /* ── Tenant admin sections ── */
    .ct-section-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 20px rgba(0,0,0,.05); overflow: hidden; margin-bottom: 20px; border: 1px solid var(--border); }
    .ct-toolbar { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1.5rem; border-bottom: 1px solid #b7c4d2; flex-wrap: wrap; gap: .5rem; background: #cdd9e6; }
    .ct-toolbar h3 { font-family: 'Lexend', sans-serif; font-weight: 700; font-size: .72rem; color: var(--brand); margin: 0; letter-spacing: .07em; text-transform: uppercase; display: flex; align-items: center; gap: .4rem; }
    .ct-toolbar h3 i { font-size: .85rem; opacity: .65; }
    .ct-table-wrap { overflow-x: auto; }
    .ct-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
    .ct-table th { background: #f8fafc; color: #475569; font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: .6rem 1rem; text-align: left; border-bottom: 1.5px solid var(--border); white-space: nowrap; }
    .ct-table td { padding: .65rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
    .ct-table tr:last-child td { border-bottom: none; }
    .ct-table tr:hover td { background: #fafbfc; }
    .ct-badge { display: inline-flex; align-items: center; padding: .2rem .55rem; border-radius: .3rem; font-size: .75rem; font-weight: 600; }
    .ct-badge-active   { background: #dcfce7; color: #166534; }
    .ct-badge-inactive { background: #fee2e2; color: #991b1b; }
    .ct-badge-ok  { background: #dcfce7; color: #166534; }
    .ct-badge-err { background: #fee2e2; color: #991b1b; }
    .ct-filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; padding: .875rem 1.5rem; background: #fafbfc; border-bottom: 1px solid var(--border); }
    .ct-filters .c-fg { gap: 3px; }
    .ct-inp-sm { padding: .45rem .7rem; border: 1.5px solid var(--border); border-radius: .45rem; font-size: .82rem; font-family: 'DM Sans', sans-serif; color: var(--text); background: #f8fafc; }
    .ct-inp-sm:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(26,58,92,.1); }
    .ct-pagination { display: flex; align-items: center; justify-content: space-between; padding: .875rem 1.5rem; border-top: 1px solid var(--border); flex-wrap: wrap; gap: .5rem; }
    .ct-pagination-info { font-size: .78rem; color: var(--muted); }
    .ct-page-btns { display: flex; gap: .25rem; flex-wrap: wrap; }
    .ct-page-btn { padding: .3rem .65rem; border: 1.5px solid var(--border); border-radius: .35rem; background: #fff; font-size: .8rem; cursor: pointer; transition: background .15s; line-height: 1.4; }
    .ct-page-btn:hover:not(:disabled) { background: #f1f5f9; }
    .ct-page-btn:disabled { opacity: .4; cursor: not-allowed; }
    .ct-page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
    .ct-page-ellipsis { padding: .3rem .2rem; color: var(--muted); font-size: .8rem; user-select: none; }
    .ct-empty { text-align: center; padding: 2rem; color: var(--muted); font-size: .875rem; }

    /* ── Tenant Usuarios · stats strip + filters + tabla rediseñada ────────── */
    .tu-stats {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 12px; padding: 1.1rem 1.5rem;
      background: #fafbfd; border-bottom: 1px solid var(--border);
    }
    .tu-stat {
      background: #fff; border: 1px solid var(--border); border-radius: 10px;
      padding: .75rem .95rem; display: flex; align-items: center; gap: .7rem;
      position: relative; overflow: hidden;
    }
    .tu-stat::before {
      content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
      background: var(--brand);
    }
    .tu-stat.is-active::before  { background: #16a34a; }
    .tu-stat.is-warn::before    { background: var(--accent); }
    .tu-stat.is-muted::before   { background: #cbd5e1; }
    .tu-stat-icon {
      width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px;
      display: inline-flex; align-items: center; justify-content: center;
      font-size: 1rem; background: rgba(26,58,92,.08); color: var(--brand);
    }
    .tu-stat.is-active .tu-stat-icon { background: rgba(22,163,74,.10); color: #15803d; }
    .tu-stat.is-warn   .tu-stat-icon { background: rgba(232,160,32,.10); color: #b45309; }
    .tu-stat.is-muted  .tu-stat-icon { background: #f1f5f9; color: var(--muted); }
    .tu-stat-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
    .tu-stat-val {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-size: 1.15rem; font-weight: 700; color: var(--brand); line-height: 1.1;
    }
    .tu-stat.is-active .tu-stat-val { color: #15803d; }
    .tu-stat-lbl {
      font-family: 'Lexend', sans-serif; font-size: .65rem; letter-spacing: .08em;
      text-transform: uppercase; color: var(--muted); font-weight: 600;
    }

    .tu-filters {
      display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
      padding: .85rem 1.5rem; background: #fafbfc; border-bottom: 1px solid var(--border);
    }
    .tu-search { flex: 1 1 320px; min-width: 220px; position: relative; }
    .tu-search > i {
      position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
      color: var(--muted); font-size: .92rem; pointer-events: none;
    }
    .tu-search input {
      width: 100%; padding: .52rem .85rem .52rem 2.15rem;
      border: 1px solid var(--border); border-radius: 9px;
      font-family: 'DM Sans', sans-serif; font-size: .87rem; background: #fff;
      transition: border-color .15s, box-shadow .15s;
    }
    .tu-search input:focus {
      outline: none; border-color: var(--brand);
      box-shadow: 0 0 0 3px rgba(26,58,92,.10);
    }
    .tu-search-clear {
      position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
      background: transparent; border: 0; cursor: pointer; color: var(--muted);
      padding: 4px 6px; border-radius: 6px; display: none;
    }
    .tu-search.has-text .tu-search-clear { display: inline-flex; }
    .tu-search-clear:hover { background: rgba(15,37,64,.06); color: var(--brand); }
    .tu-filter-sep { width: 1px; height: 22px; background: var(--border); margin: 0 .15rem; }
    .tu-filter-chip {
      display: inline-flex; align-items: center; gap: .35rem;
      padding: .4rem .7rem; border-radius: 99px;
      background: #fff; border: 1px solid var(--border);
      font-family: 'Lexend', sans-serif; font-size: .7rem; font-weight: 600;
      letter-spacing: .04em; color: var(--brand); cursor: pointer; user-select: none;
      transition: background .15s, border-color .15s, color .15s;
    }
    .tu-filter-chip:hover { border-color: var(--brand); background: #f1f5fb; }
    .tu-filter-chip.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }
    .tu-filter-chip.is-on .bi { color: var(--accent); }

    .tu-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
    .tu-table thead th {
      background: #f8fafc; color: #475569;
      font-family: 'Lexend', sans-serif; font-size: .67rem;
      font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
      padding: .65rem 1rem; text-align: left; border-bottom: 1.5px solid var(--border);
      white-space: nowrap;
    }
    .tu-table tbody td {
      padding: .8rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
    }
    .tu-table tbody tr:last-child td { border-bottom: none; }
    .tu-table tbody tr { transition: background .15s; }
    .tu-table tbody tr:hover td { background: #fafbff; }
    .tu-table tbody tr.is-inactive td { opacity: .6; }

    .tu-user { display: flex; align-items: center; gap: .7rem; min-width: 0; }
    .tu-avatar {
      width: 36px; height: 36px; border-radius: 50%;
      display: inline-flex; align-items: center; justify-content: center;
      font-family: 'Lexend', sans-serif; font-weight: 700; font-size: .76rem;
      color: #fff; flex-shrink: 0; letter-spacing: .02em;
      box-shadow: inset 0 -8px 16px rgba(0,0,0,.18);
    }
    .tu-avatar.bg-0 { background: linear-gradient(135deg, #1a3a5c, #2d5e8e); }
    .tu-avatar.bg-1 { background: linear-gradient(135deg, #b45309, #e8a020); }
    .tu-avatar.bg-2 { background: linear-gradient(135deg, #15803d, #4ade80); }
    .tu-avatar.bg-3 { background: linear-gradient(135deg, #7c2d12, #c2410c); }
    .tu-avatar.bg-4 { background: linear-gradient(135deg, #4338ca, #818cf8); }
    .tu-avatar.bg-5 { background: linear-gradient(135deg, #0f766e, #2dd4bf); }
    .tu-avatar.bg-muted { background: #94a3b8; }
    .tu-user-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
    .tu-user-name {
      font-family: 'Lexend', sans-serif; font-weight: 600; font-size: .88rem;
      color: var(--brand); display: inline-flex; align-items: center; gap: .35rem;
    }
    .tu-user-self {
      font-family: 'DM Sans', sans-serif; font-size: .62rem; font-weight: 600;
      letter-spacing: .06em; text-transform: uppercase;
      background: rgba(232,160,32,.15); color: #b45309;
      padding: 1px 6px; border-radius: 4px;
    }
    .tu-user-email { font-size: .76rem; color: var(--muted); }
    .tu-id-cell { font-family: 'JetBrains Mono', monospace; font-size: .74rem; color: var(--muted); }
    .tu-desc-cell { font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: var(--brand); }
    .tu-desc-cell.is-empty { color: #cbd5e1; font-family: 'DM Sans', sans-serif; font-size: .78rem; }

    .tu-status {
      display: inline-flex; align-items: center; gap: .4rem;
      padding: 3px 9px 3px 8px; border-radius: 99px;
      font-family: 'Lexend', sans-serif; font-size: .66rem; font-weight: 600;
      letter-spacing: .05em; text-transform: uppercase;
    }
    .tu-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
    .tu-status.is-active {
      background: rgba(22,163,74,.10); color: #15803d; border: 1px solid #bbf7d0;
    }
    .tu-status.is-active::before { background: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,.18); }
    .tu-status.is-inactive {
      background: #f1f5f9; color: var(--muted); border: 1px solid #e2e8f0;
    }
    .tu-status.is-inactive::before { background: #94a3b8; }

    .tu-perms { display: inline-flex; gap: 4px; flex-wrap: wrap; }
    .tu-perm {
      display: inline-flex; align-items: center; justify-content: center;
      width: 28px; height: 28px; border-radius: 8px;
      background: #f1f5f9; color: #cbd5e1; font-size: .82rem;
      border: 1px solid #e2e8f0; position: relative; cursor: default;
      transition: transform .12s;
    }
    .tu-perm.is-on.t-block { background: rgba(220,38,38,.08); color: #dc2626; border-color: rgba(220,38,38,.20); }
    .tu-perm.is-on.t-xls   { background: rgba(22,163,74,.10); color: #15803d; border-color: #bbf7d0; }
    .tu-perm.is-on.t-cred  { background: rgba(232,160,32,.12); color: #b45309; border-color: rgba(232,160,32,.30); }
    .tu-perm.is-on.t-cap   { background: rgba(67,56,202,.10); color: #4338ca; border-color: rgba(67,56,202,.25); }
    .tu-perm.is-on.t-mora  { background: rgba(20,184,166,.10); color: #0f766e; border-color: rgba(20,184,166,.25); }
    .tu-perm:hover { transform: translateY(-1px); }
    .tu-perm[data-tip]:hover::after {
      content: attr(data-tip);
      position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
      font-family: 'DM Sans', sans-serif; font-size: .68rem; font-weight: 500;
      background: var(--brand); color: #fff;
      padding: 4px 8px; border-radius: 5px; white-space: nowrap; pointer-events: none;
      letter-spacing: .02em; z-index: 5;
    }

    .tu-date-cell { font-size: .76rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }

    .tu-actions { display: flex; gap: .3rem; justify-content: flex-end; align-items: center; }
    .tu-action-icon {
      width: 30px; height: 30px; border-radius: 8px;
      display: inline-flex; align-items: center; justify-content: center;
      background: transparent; border: 1px solid transparent; cursor: pointer;
      color: var(--muted); transition: background .15s, color .15s, border-color .15s;
      font-size: .95rem;
    }
    .tu-action-icon:hover { background: #f1f5fb; color: var(--brand); border-color: var(--border); }
    .tu-action-icon.is-danger:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

    .tu-footer {
      display: flex; align-items: center; justify-content: space-between;
      padding: .85rem 1.5rem; border-top: 1px solid var(--border);
      background: #fafbfc; flex-wrap: wrap; gap: .5rem;
    }
    .tu-footer-info { font-size: .77rem; color: var(--muted); }
    .tu-footer-info strong { color: var(--brand); font-family: 'JetBrains Mono', monospace; }
    .tu-legend { display: inline-flex; gap: .65rem; flex-wrap: wrap; align-items: center; font-size: .7rem; color: var(--muted); }
    .tu-legend-item { display: inline-flex; align-items: center; gap: .3rem; }
    .tu-legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

    .tu-empty-state { padding: 3rem 1.5rem; text-align: center; }
    .tu-empty-icon {
      width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 50%;
      background: linear-gradient(135deg, rgba(26,58,92,.08), rgba(232,160,32,.08));
      display: inline-flex; align-items: center; justify-content: center;
      font-size: 1.55rem; color: var(--brand);
    }
    .tu-empty-title { font-family: 'Lexend', sans-serif; font-weight: 600; font-size: 1rem; color: #1f2937; margin-bottom: 4px; }
    .tu-empty-sub { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }

    .tu-noresult { padding: 2.5rem 1.5rem; text-align: center; }
    .tu-noresult > i { font-size: 1.75rem; color: #cbd5e1; }
    .tu-noresult-title { font-family: 'Lexend', sans-serif; font-weight: 500; font-size: .95rem; color: #475569; margin-top: .5rem; }
    .tu-noresult-sub { font-size: .82rem; color: var(--muted); margin-top: .25rem; }

    @media (max-width: 880px) {
      .tu-table thead { display: none; }
      .tu-table, .tu-table tbody, .tu-table tr, .tu-table td { display: block; width: 100%; }
      .tu-table tbody tr {
        padding: .9rem 1rem; border-bottom: 1px solid #f1f5f9;
        display: grid; grid-template-columns: auto 1fr; gap: .55rem .9rem;
        align-items: center;
      }
      .tu-table tbody td { padding: 0; border: 0; }
      .tu-table tbody td.tu-id-cell { display: none; }
      .tu-table tbody td.tu-cell-user { grid-column: 1 / -1; }
      .tu-table tbody td.tu-cell-status,
      .tu-table tbody td.tu-cell-perms,
      .tu-table tbody td.tu-cell-desc { grid-column: 1 / -1; }
      .tu-table tbody td.tu-cell-actions { grid-column: 1 / -1; text-align: right; }
      .tu-table tbody td.tu-cell-actions .tu-actions { justify-content: flex-end; }
      .tu-table tbody td.tu-cell-date { grid-column: 1 / -1; }
    }

    /* ── Tenant Logs · stats + filtros + tabla rediseñada (tl-*) ──────────── */
    .tl-filters {
      display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
      padding: .85rem 1.5rem; background: #fafbfc; border-bottom: 1px solid var(--border);
    }
    .tl-filters .tl-fg {
      display: flex; flex-direction: column; gap: 4px;
    }
    .tl-filters .tl-fg-label {
      font-family: 'Lexend', sans-serif; font-size: .62rem; font-weight: 600;
      letter-spacing: .08em; text-transform: uppercase; color: #64748b;
    }
    .tl-inp {
      padding: .45rem .7rem; border: 1px solid var(--border); border-radius: 8px;
      font-family: 'DM Sans', sans-serif; font-size: .82rem; background: #fff;
      transition: border-color .15s, box-shadow .15s;
    }
    .tl-inp:focus {
      outline: none; border-color: var(--brand);
      box-shadow: 0 0 0 3px rgba(26,58,92,.10);
    }
    .tl-chip-group { display: inline-flex; gap: 4px; align-items: center; }
    .tl-chip {
      display: inline-flex; align-items: center; gap: .3rem;
      padding: .4rem .65rem; border-radius: 99px;
      background: #fff; border: 1px solid var(--border);
      font-family: 'Lexend', sans-serif; font-size: .68rem; font-weight: 600;
      letter-spacing: .04em; color: var(--brand); cursor: pointer; user-select: none;
      transition: background .15s, border-color .15s, color .15s;
    }
    .tl-chip:hover { border-color: var(--brand); background: #f1f5fb; }
    .tl-chip.is-on    { background: var(--brand); color: #fff; border-color: var(--brand); }
    .tl-chip.is-on.is-ok  { background: #15803d; border-color: #15803d; }
    .tl-chip.is-on.is-err { background: #dc2626; border-color: #dc2626; }

    .tl-filters-clear {
      align-self: flex-end; padding: .42rem .65rem; border-radius: 8px;
      background: transparent; border: 1px solid transparent;
      color: #64748b; cursor: pointer; font-size: .78rem;
      font-family: 'DM Sans', sans-serif; display: inline-flex; align-items: center; gap: .3rem;
    }
    .tl-filters-clear:hover { background: #f1f5fb; color: var(--brand); border-color: var(--border); }

    .tl-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
    .tl-table thead th {
      background: #f8fafc; color: #475569;
      font-family: 'Lexend', sans-serif; font-size: .65rem;
      font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
      padding: .65rem 1rem; text-align: left; border-bottom: 1.5px solid var(--border);
      white-space: nowrap;
    }
    .tl-table tbody td {
      padding: .7rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
    }
    .tl-table tbody tr:last-child td { border-bottom: none; }
    .tl-table tbody tr { transition: background .15s; }
    .tl-table tbody tr:hover td { background: #fafbff; }
    .tl-table tbody tr.is-err td { background: rgba(220,38,38,.02); }
    .tl-table tbody tr.is-err:hover td { background: rgba(220,38,38,.05); }

    .tl-date {
      display: flex; flex-direction: column; line-height: 1.15;
      font-family: 'JetBrains Mono', monospace;
    }
    .tl-date-time { font-size: .85rem; color: var(--brand); font-weight: 600; }
    .tl-date-day  { font-size: .7rem;  color: var(--muted); }

    .tl-op {
      display: inline-flex; align-items: center; gap: .3rem;
      padding: 2px 8px 2px 7px; border-radius: 6px;
      font-family: 'Lexend', sans-serif; font-size: .66rem; font-weight: 600;
      letter-spacing: .05em; text-transform: uppercase;
      border: 1px solid transparent;
    }
    .tl-op i { font-size: .78rem; }
    .tl-op.tl-op-consulta {
      background: rgba(26,58,92,.08); color: var(--brand); border-color: rgba(26,58,92,.20);
    }
    .tl-op.tl-op-alta {
      background: rgba(232,160,32,.12); color: #b45309; border-color: rgba(232,160,32,.30);
    }
    .tl-op.tl-op-other {
      background: #f1f5f9; color: #64748b; border-color: #e2e8f0;
    }

    .tl-user { font-family: 'Lexend', sans-serif; font-weight: 500; color: var(--brand); font-size: .82rem; }
    .tl-doc-num { font-family: 'JetBrains Mono', monospace; font-size: .82rem; color: #1f2937; }
    .tl-doc-tipo { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; font-family: 'Lexend', sans-serif; }
    .tl-origin { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; gap: 1px; max-width: 220px; }
    .tl-origin-ip { font-family: 'JetBrains Mono', monospace; font-size: .76rem; color: #1f2937; }
    .tl-origin-line { font-size: .7rem; color: #64748b; display: inline-flex; align-items: center; gap: .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tl-origin-line i { font-size: .72rem; color: #94a3b8; flex: none; }
    .tl-origin.is-empty .tl-origin-ip { color: #cbd5e1; }

    .tl-status {
      display: inline-flex; align-items: center; gap: .35rem;
      padding: 2px 8px 2px 7px; border-radius: 99px;
      font-family: 'Lexend', sans-serif; font-size: .65rem; font-weight: 600;
      letter-spacing: .05em; text-transform: uppercase;
    }
    .tl-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; }
    .tl-status.is-ok {
      background: rgba(22,163,74,.10); color: #15803d; border: 1px solid #bbf7d0;
    }
    .tl-status.is-ok::before { background: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,.18); }
    .tl-status.is-err {
      background: rgba(220,38,38,.08); color: #dc2626; border: 1px solid #fecaca;
    }
    .tl-status.is-err::before { background: #dc2626; }
    button.tl-status {
      font: inherit; font-family: 'Lexend', sans-serif; font-size: .65rem; font-weight: 600;
      letter-spacing: .05em; text-transform: uppercase;
      cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .1s ease;
    }
    button.tl-status.is-err:hover { background: rgba(220,38,38,.16); border-color: #fca5a5; }
    button.tl-status.is-err:active { transform: scale(.96); }

    /* SweetAlert error detail */
    .amdz-swal-err .swal2-html-container { margin: .5rem 0 0; padding: 0 1rem; }
    .tl-err-pre {
      margin: 0; padding: .85rem 1rem;
      background: #fff5f5; border: 1px solid #fecaca; border-left: 3px solid #dc2626;
      border-radius: 8px;
      font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: .8rem; line-height: 1.5;
      color: #7f1d1d;
      white-space: pre-wrap; word-break: break-word;
      max-height: 50vh; overflow-y: auto; text-align: left;
    }

    .tl-duration {
      font-family: 'JetBrains Mono', monospace; font-size: .8rem;
      font-feature-settings: 'tnum';
    }
    .tl-duration.fast { color: #15803d; }
    .tl-duration.mid  { color: var(--muted); }
    .tl-duration.slow { color: #b45309; }

    .tl-comp { display: inline-flex; align-items: center; gap: .35rem; }
    .tl-comp-num {
      font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: #1f2937;
    }
    .tl-comp-dash { color: #cbd5e1; }
    .tl-comp-cad {
      width: 26px; height: 26px; border-radius: 6px;
      display: inline-flex; align-items: center; justify-content: center;
      background: rgba(26,58,92,.08); color: var(--brand); border: 1px solid rgba(26,58,92,.20);
      transition: background .15s, transform .12s; text-decoration: none;
      font-size: .82rem;
    }
    .tl-comp-cad:hover { background: rgba(26,58,92,.15); transform: translateY(-1px); }
    .tl-comp-cad.is-socio {
      background: rgba(232,160,32,.10); color: #b45309; border-color: rgba(232,160,32,.30);
    }
    .tl-comp-cad.is-socio:hover { background: rgba(232,160,32,.20); }

    .tl-error-cell {
      max-width: 220px; overflow: hidden; text-overflow: ellipsis;
      white-space: nowrap; color: #dc2626; font-size: .76rem;
      font-family: 'DM Sans', sans-serif;
    }
    .tl-error-cell:empty::before { content: '—'; color: #cbd5e1; }

    .tl-empty {
      padding: 2.5rem 1.5rem; text-align: center;
    }
    .tl-empty > i { font-size: 1.75rem; color: #cbd5e1; }
    .tl-empty-title { font-family: 'Lexend', sans-serif; font-weight: 500; font-size: .95rem; color: #475569; margin-top: .5rem; }
    .tl-empty-sub { font-size: .82rem; color: var(--muted); margin-top: .25rem; }

    .tl-footer {
      display: flex; align-items: center; justify-content: space-between;
      padding: .85rem 1.5rem; border-top: 1px solid var(--border);
      background: #fafbfc; flex-wrap: wrap; gap: .65rem;
    }
    .tl-footer-info {
      font-size: .77rem; color: var(--muted);
      display: inline-flex; align-items: center; gap: .35rem;
    }
    .tl-footer-info strong { color: var(--brand); font-family: 'JetBrains Mono', monospace; }
    .tl-footer-actions { display: inline-flex; gap: .4rem; align-items: center; }

    /* Botones export (con sus colores característicos) */
    .tl-btn-xlsx {
      display: inline-flex; align-items: center; gap: .35rem;
      padding: .42rem .75rem; border-radius: 8px;
      background: #16a34a; color: #fff; border: 1px solid #16a34a;
      font-family: 'Lexend', sans-serif; font-weight: 500; font-size: .78rem;
      cursor: pointer; transition: background .15s;
    }
    .tl-btn-xlsx:hover { background: #15803d; }
    .tl-btn-xlsx:disabled { opacity: .65; cursor: not-allowed; }
    .tl-btn-pdf {
      display: inline-flex; align-items: center; gap: .35rem;
      padding: .42rem .75rem; border-radius: 8px;
      background: #fff; color: #dc2626; border: 1px solid #fecaca;
      font-family: 'Lexend', sans-serif; font-weight: 500; font-size: .78rem;
      cursor: pointer; transition: background .15s, border-color .15s;
    }
    .tl-btn-pdf:hover { background: #fef2f2; border-color: #dc2626; }
    .tl-btn-pdf:disabled { opacity: .65; cursor: not-allowed; }

    /* ── Tenant Usuarios · modal (tum-*) ──────────────────────────────────── */
    /* Modal container: flex column + scroll interno */
    #tenantUserModal .cpw-modal {
      display: flex; flex-direction: column;
      max-height: calc(100vh - 2rem); overflow: hidden;
    }
    /* El form debe ser flex también para que .tum-body pueda scrollear */
    #tenantUserModal form {
      display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
    }
    .tum-header {
      background: linear-gradient(135deg, var(--brand) 0%, #142d48 100%);
      padding: .7rem 1.1rem; display: flex; align-items: center; gap: .75rem;
      position: relative; overflow: hidden; flex-shrink: 0;
    }
    .tum-header::after {
      content: ''; position: absolute; right: -40px; top: -40px;
      width: 160px; height: 160px; border-radius: 50%;
      background: radial-gradient(circle, rgba(232,160,32,.25) 0%, transparent 65%);
      pointer-events: none;
    }
    .tum-avatar-preview {
      width: 38px; height: 38px; border-radius: 50%;
      display: inline-flex; align-items: center; justify-content: center;
      font-family: 'Lexend', sans-serif; font-weight: 700; font-size: .82rem;
      color: #fff; letter-spacing: .03em; flex-shrink: 0;
      box-shadow: inset 0 -8px 14px rgba(0,0,0,.2), 0 0 0 2px rgba(255,255,255,.12);
      background: linear-gradient(135deg, #2d5e8e, #4a7cb0);
      transition: background .35s ease;
      position: relative; z-index: 1;
    }
    .tum-header-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; position: relative; z-index: 1; }
    .tum-header-title {
      margin: 0; color: #fff;
      font-family: 'Lexend', sans-serif; font-size: .92rem; font-weight: 600;
      letter-spacing: .01em;
    }
    .tum-header-sub {
      color: rgba(255,255,255,.7); font-size: .72rem;
      letter-spacing: .02em;
    }

    .tum-body {
      padding: .7rem 1.1rem; display: flex; flex-direction: column; gap: .5rem;
      overflow-y: auto; flex: 1; min-height: 0;
      scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent;
    }
    .tum-body::-webkit-scrollbar { width: 5px; }
    .tum-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
    .tum-section {
      border: 1px solid var(--border); border-radius: 9px; overflow: hidden;
      background: #fff;
    }
    .tum-section-title {
      background: #f7f9fc; border-bottom: 1px solid var(--border);
      padding: .28rem .75rem;
      font-family: 'Lexend', sans-serif; font-size: .63rem; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase; color: var(--brand);
      display: flex; align-items: center; gap: .4rem;
    }
    .tum-section-title i { opacity: .65; font-size: .8rem; }
    .tum-section-body { padding: .6rem .75rem; }
    .tum-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    /* ── Productor multi-select (chips) — compartido con admin ── */
    .pm-wrap { display: flex; flex-direction: column; gap: 5px; }
    .pm-chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; }
    .pm-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--brand); color: #fff; border-radius: 4px; padding: 3px 8px 3px 9px; font-size: .76rem; font-family: 'JetBrains Mono','Consolas',monospace; font-feature-settings: 'tnum'; line-height: 1.4; }
    .pm-chip-x { cursor: pointer; opacity: .65; font-size: .9rem; line-height: 1; padding: 0 1px; transition: opacity .15s; }
    .pm-chip-x:hover { opacity: 1; }
    .pm-nofilter { font-size: .76rem; color: #94a3b8; display: flex; align-items: center; gap: 5px; font-style: italic; }
    .pm-nofilter i { font-size: .8rem; }
    .pm-add-select { margin-top: 1px; }
    @media (max-width: 540px) { .tum-grid-2 { grid-template-columns: 1fr; } }

    /* Active switch (status) */
    .tum-status-row {
      display: flex; align-items: center; gap: .7rem;
      padding: .45rem .75rem;
      background: #f7f9fc; border: 1px solid var(--border); border-radius: 9px;
      transition: background .2s, border-color .2s;
    }
    .tum-status-row.is-on {
      background: rgba(22,163,74,.06); border-color: #bbf7d0;
    }
    .tum-status-info { flex: 1; min-width: 0; }
    .tum-status-name {
      font-family: 'Lexend', sans-serif; font-weight: 600; font-size: .85rem;
      color: #1f2937; display: inline-flex; align-items: center; gap: .35rem;
    }
    .tum-status-name i { color: var(--muted); font-size: .92rem; }
    .tum-status-row.is-on .tum-status-name i { color: #15803d; }
    .tum-status-desc { font-size: .74rem; color: var(--muted); margin-top: 1px; }
    .tum-status-row.is-on .tum-status-desc { color: #166534; }
    .tum-switch {
      position: relative; width: 42px; height: 22px; cursor: pointer; flex-shrink: 0;
    }
    .tum-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
    .tum-switch-track {
      position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px;
      transition: background .2s;
    }
    .tum-switch-thumb {
      position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
      background: #fff; border-radius: 50%;
      box-shadow: 0 1px 3px rgba(0,0,0,.2);
      transition: transform .2s;
    }
    .tum-switch input:checked ~ .tum-switch-track { background: #16a34a; }
    .tum-switch input:checked ~ .tum-switch-thumb { transform: translateX(20px); }

    /* Permission cards grid — 3 cols, compactas */
    .tum-perm-grid {
      display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
    }
    @media (max-width: 480px) { .tum-perm-grid { grid-template-columns: 1fr 1fr; } }
    .tum-perm-card {
      position: relative; display: flex; align-items: center; gap: .45rem;
      padding: .45rem .55rem;
      background: #fff; border: 1px solid var(--border); border-radius: 8px;
      cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
      user-select: none;
    }
    .tum-perm-card:hover { border-color: #b7c4d2; background: #fafbfd; }
    .tum-perm-card input { position: absolute; opacity: 0; pointer-events: none; }
    .tum-perm-card .tum-perm-ico {
      width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px;
      display: inline-flex; align-items: center; justify-content: center;
      background: #f1f5f9; color: #94a3b8; font-size: .8rem;
      border: 1px solid #e2e8f0; transition: background .15s, color .15s, border-color .15s;
    }
    .tum-perm-card .tum-perm-info { flex: 1; min-width: 0; line-height: 1.2; }
    .tum-perm-card .tum-perm-name {
      font-family: 'Lexend', sans-serif; font-weight: 600; font-size: .75rem;
      color: #1f2937; display: block;
    }
    .tum-perm-card .tum-perm-desc {
      font-size: .67rem; color: var(--muted); display: block; margin-top: 1px;
    }
    .tum-perm-card .tum-perm-check {
      width: 18px; height: 18px; border-radius: 5px;
      border: 1.5px solid #cbd5e1; background: #fff;
      display: inline-flex; align-items: center; justify-content: center;
      flex-shrink: 0; transition: background .15s, border-color .15s, color .15s;
      color: transparent; font-size: .75rem;
    }
    .tum-perm-card:has(input:checked) {
      background: rgba(26,58,92,.04); border-color: rgba(26,58,92,.30);
      box-shadow: 0 1px 3px rgba(26,58,92,.06);
    }
    .tum-perm-card:has(input:checked) .tum-perm-check {
      background: var(--brand); border-color: var(--brand); color: #fff;
    }
    /* Coloreado por tipo cuando está activo (alineado con la tabla) */
    .tum-perm-card.t-block:has(input:checked) { background: rgba(220,38,38,.05); border-color: rgba(220,38,38,.30); }
    .tum-perm-card.t-block:has(input:checked) .tum-perm-ico { background: rgba(220,38,38,.10); color: #dc2626; border-color: rgba(220,38,38,.30); }
    .tum-perm-card.t-block:has(input:checked) .tum-perm-check { background: #dc2626; border-color: #dc2626; }
    .tum-perm-card.t-xls:has(input:checked) { background: rgba(22,163,74,.05); border-color: #bbf7d0; }
    .tum-perm-card.t-xls:has(input:checked) .tum-perm-ico { background: rgba(22,163,74,.10); color: #15803d; border-color: #bbf7d0; }
    .tum-perm-card.t-xls:has(input:checked) .tum-perm-check { background: #15803d; border-color: #15803d; }
    .tum-perm-card.t-cred:has(input:checked) { background: rgba(232,160,32,.06); border-color: rgba(232,160,32,.35); }
    .tum-perm-card.t-cred:has(input:checked) .tum-perm-ico { background: rgba(232,160,32,.12); color: #b45309; border-color: rgba(232,160,32,.30); }
    .tum-perm-card.t-cred:has(input:checked) .tum-perm-check { background: #b45309; border-color: #b45309; }
    .tum-perm-card.t-mora:has(input:checked) { background: rgba(20,184,166,.06); border-color: rgba(20,184,166,.35); }
    .tum-perm-card.t-mora:has(input:checked) .tum-perm-ico { background: rgba(20,184,166,.10); color: #0f766e; border-color: rgba(20,184,166,.25); }
    .tum-perm-card.t-mora:has(input:checked) .tum-perm-check { background: #0f766e; border-color: #0f766e; }
    .tum-perm-card.t-cap:has(input:checked) { background: rgba(67,56,202,.05); border-color: rgba(67,56,202,.25); }
    .tum-perm-card.t-cap:has(input:checked) .tum-perm-ico { background: rgba(67,56,202,.10); color: #4338ca; border-color: rgba(67,56,202,.25); }
    .tum-perm-card.t-cap:has(input:checked) .tum-perm-check { background: #4338ca; border-color: #4338ca; }
    .tum-perm-card.t-mora:has(input:checked) { background: rgba(15,118,110,.05); border-color: rgba(15,118,110,.30); }
    .tum-perm-card.t-mora:has(input:checked) .tum-perm-ico { background: rgba(15,118,110,.10); color: #0f766e; border-color: rgba(15,118,110,.30); }
    .tum-perm-card.t-mora:has(input:checked) .tum-perm-check { background: #0f766e; border-color: #0f766e; }
    /* Variante full-width (una columna ocupa toda la fila del grid) */
    .tum-perm-card.is-full { grid-column: 1 / -1; }

    .tum-footer {
      display: flex; align-items: center; gap: .5rem;
      padding: .6rem 1.1rem; background: #fafbfc; border-top: 1px solid var(--border);
      flex-shrink: 0;
    }
    .tum-footer-hint {
      font-size: .73rem; color: var(--muted); margin-right: auto;
      display: inline-flex; align-items: center; gap: .3rem;
    }
    .tum-footer-hint i { color: var(--accent); }

    /* ── Tenant Params layout (tp-*) ── */
    .tp-section-title {
      font-family: 'Lexend', sans-serif;
      font-weight: 600;
      font-size: .68rem;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--brand);
      padding: .55rem .9rem;
      background: linear-gradient(180deg, #eef3f9 0%, #e6edf6 100%);
      border-left: 3px solid var(--accent);
      border-radius: .35rem;
      display: flex;
      align-items: center;
      gap: .5rem;
      margin: 0 0 .9rem;
    }
    .tp-section-title:not(:first-of-type) { margin-top: 1.4rem; }
    .tp-section-title i { color: var(--accent); font-size: .85rem; opacity: .9; }
    .tp-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 1rem;
      padding-left: .5rem;
    }
    .tp-fg-check { justify-content: flex-end; padding-bottom: .35rem; }
    .tp-check {
      display: inline-flex;
      align-items: center;
      gap: .55rem;
      cursor: pointer;
      font-size: .84rem;
      color: #334155;
      padding: .55rem .75rem;
      background: #f7f9fc;
      border: 1px solid #e2e8f0;
      border-radius: .45rem;
      transition: border-color .15s, background .15s;
      user-select: none;
    }
    .tp-check:hover { border-color: #cbd5e1; background: #fff; }
    .tp-check input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; }
    .tp-actions {
      margin-top: 1.5rem;
      padding-top: 1rem;
      border-top: 1px solid var(--border);
      display: flex;
      justify-content: flex-end;
    }

    /* ── Cards ──────────────────────────────────────────────────────────────── */
    .c-card {
      background: var(--surface); border-radius: var(--radius);
      box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 20px rgba(0,0,0,.05);
      padding: 24px; margin-bottom: 20px;
    }
    .c-card-title {
      font-family: 'Lexend', sans-serif; font-size: .7rem; font-weight: 700;
      letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
      margin-bottom: 18px; display: flex; align-items: center; gap: .5rem;
    }
    .c-card-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
    /* Sufijo de empresa: case original, font de cuerpo, tinte brand — contrasta
       con el uppercase técnico del título y lee como "contexto". */
    .c-card-title-empresa {
      font-family: 'DM Sans', sans-serif;
      font-size: .82rem; font-weight: 500;
      letter-spacing: .01em; text-transform: none;
      color: var(--brand);
      margin-left: .15rem;
      display: inline-flex; align-items: center; gap: .35rem;
    }
    .c-card-title-empresa::before {
      content: ''; width: 4px; height: 4px; border-radius: 50%;
      background: var(--accent);
      box-shadow: 0 0 0 3px rgba(232,160,32,.18);
    }
    .c-card-title-empresa:empty { display: none; }

    /* ── Forms ──────────────────────────────────────────────────────────────── */
    .c-search-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
    .c-fg { display: flex; flex-direction: column; gap: 5px; }
    .c-label { font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #4a5568; }
    .c-sel, .c-inp {
      padding: .6rem .85rem; border: 1.5px solid var(--border); border-radius: .5rem;
      font-family: 'DM Sans', sans-serif; font-size: .925rem; color: var(--text);
      background: #f8fafc; outline: none; transition: border-color .2s, box-shadow .2s; appearance: none;
    }
    .c-sel:focus, .c-inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,58,92,.1); background: #fff; }
    .c-inp::placeholder { color: #b0bec5; }
    .c-sel { cursor: pointer; }

    /* ── Buttons ────────────────────────────────────────────────────────────── */
    .c-btn {
      display: inline-flex; align-items: center; gap: .4rem; padding: .65rem 1.4rem;
      font-family: 'Lexend', sans-serif; font-weight: 600; font-size: .875rem;
      border: none; border-radius: .5rem; cursor: pointer;
      transition: background .2s, transform .15s, box-shadow .2s; white-space: nowrap;
    }
    .c-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
    .c-btn-primary { background: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(26,58,92,.25); }
    .c-btn-primary:hover:not(:disabled) { background: var(--panel-bg); transform: translateY(-1px); box-shadow: 0 5px 16px rgba(26,58,92,.3); }
    .c-btn-danger  { background: #e53e3e; color: #fff; box-shadow: 0 2px 8px rgba(197,48,48,.2); }
    .c-btn-danger:hover:not(:disabled)  { background: var(--red); }
    .c-btn-ghost   { background: #edf2f7; color: #4a5568; }
    .c-btn-ghost:hover:not(:disabled)   { background: #e2e8f0; }
    .c-btn-accent  { background: var(--accent); color: var(--panel-bg); box-shadow: 0 3px 10px rgba(232,160,32,.25); }
    .c-btn-accent:hover:not(:disabled)  { background: #d4911c; transform: translateY(-1px); }
    .c-btn-sm { font-size: .8rem !important; padding: .4rem .9rem !important; }

    /* ── Alerts ─────────────────────────────────────────────────────────────── */
    .c-alert { padding: 10px 14px; border-radius: .5rem; font-size: .875rem; margin-bottom: 12px; }
    .c-alert-error   { background: #fff5f5; border: 1px solid #fed7d7; color: var(--red); }
    .c-alert-info    { background: #ebf8ff; border: 1px solid #bee3f8; color: #2b6cb0; }
    .c-alert-success { background: #dcfce7; border: 1px solid #86efac; color: #166534; }

    /* ── Loading ────────────────────────────────────────────────────────────── */
    #loadingState { text-align: center; padding: 60px 20px; }
    .c-spinner {
      width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--brand);
      border-radius: 50%; animation: cSpin .8s linear infinite; margin: 0 auto 16px;
    }
    @keyframes cSpin { to { transform: rotate(360deg); } }
    .c-loading-text { font-family: 'Lexend', sans-serif; font-size: .95rem; color: #4a5568; font-weight: 600; }
    .c-loading-sub  { font-size: .82rem; color: var(--muted); margin-top: 6px; }
    .c-loading-meta {
      margin: 14px auto 0; max-width: 460px; padding: 10px 14px;
      background: #f7f9fc; border: 1px solid var(--border); border-radius: 10px;
      font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: .8rem;
      color: #2d3748; line-height: 1.55; text-align: left;
    }
    .c-loading-meta .lm-row { display: flex; gap: .6rem; align-items: baseline; }
    .c-loading-meta .lm-k { color: var(--muted); min-width: 78px; font-size: .72rem;
      text-transform: uppercase; letter-spacing: .05em; }
    .c-loading-meta .lm-v { color: var(--brand); font-weight: 600; word-break: break-all; }
    .c-loading-bar {
      margin: 12px auto 0; max-width: 460px; height: 6px; background: #e2e8f0;
      border-radius: 999px; overflow: hidden;
    }
    .c-loading-fill {
      height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent));
      width: 0%; transition: width .25s ease;
    }
    .c-loading-cancel { margin-top: 16px; }

    /* ── Person Card (refresh cf-style) ───────────────────────────────────── */
    .c-person {
      position: relative;
      background: var(--surface); border-radius: var(--radius);
      box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 20px rgba(0,0,0,.05);
      padding: 22px 24px 18px; margin-bottom: 14px;
      display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap;
      overflow: hidden; border: 1px solid #e2e8f0;
    }
    .c-person::before {
      content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px;
      background: linear-gradient(90deg, var(--brand) 0%, var(--brand) 55%, var(--accent) 55%, var(--accent) 100%);
    }
    .c-avatar {
      width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0;
      background: linear-gradient(135deg, #233e62, #0f2540);
      display: flex; align-items: center; justify-content: center;
      color: #fff; font-family: 'Lexend', sans-serif; font-weight: 700; font-size: 1.15rem;
      letter-spacing: .04em; border: 3px solid #fff;
      box-shadow: 0 2px 10px rgba(15,37,64,.18);
    }
    .c-person-info { flex: 1; min-width: 0; }
    .c-person-name {
      font-family: 'Lexend', sans-serif; font-size: 1.4rem; font-weight: 700;
      color: var(--brand); line-height: 1.1; letter-spacing: -.01em;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .c-person-doc {
      font-size: .85rem; color: var(--muted); margin-top: 4px;
    }
    .c-person-doc strong {
      font-family: 'JetBrains Mono', monospace; font-weight: 600;
      color: var(--text); margin-left: .35rem; letter-spacing: .02em;
    }
    .c-person-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
    .c-tag {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 4px 10px; border-radius: 99px;
      background: linear-gradient(90deg, rgba(26,58,92,.08), rgba(232,160,32,.06));
      border: 1px solid #d8e2ee;
      font-size: .78rem; color: var(--text); font-weight: 500;
    }
    .c-tag .bi { color: var(--brand); font-size: .9rem; }
    .c-tag strong { color: var(--brand); font-weight: 700; }
    .c-tag-legajos { /* hereda gradiente */ }
    .c-tag-active  {
      background: linear-gradient(90deg, rgba(22,163,74,.10), rgba(22,163,74,.04));
      border-color: #bbf7d0; color: #166534;
    }
    .c-tag-active .bi, .c-tag-active strong { color: #15803d; }
    .c-tag-mora    {
      background: linear-gradient(90deg, rgba(220,38,38,.10), rgba(220,38,38,.04));
      border-color: #fecaca; color: #991b1b;
    }
    .c-tag-mora .bi, .c-tag-mora strong { color: #b91c1c; }
    .c-cupo-total { text-align: right; }
    .c-cupo-lbl {
      font-family: 'Lexend', sans-serif; font-size: .66rem; font-weight: 700;
      text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
      margin-bottom: 4px;
    }
    .c-cupo-val {
      font-family: 'JetBrains Mono', monospace; font-weight: 700;
      font-size: 2rem; line-height: 1; color: #15803d;
      letter-spacing: -.02em; font-feature-settings: 'tnum';
    }
    .c-person-btns { display: flex; gap: 8px; align-items: center; }

    /* ── Bloqueo inline panel (boxed) ───────────────────────────────────────── */
    .c-bloqueo-panel {
      flex-basis: 100%; margin-top: 14px;
      border: 1px solid var(--line, #d8e2ee); border-radius: 10px;
      background: var(--soft, #f4f7fb); overflow: hidden;
    }
    .c-bloqueo-hdr {
      display: flex; align-items: center; gap: .5rem;
      padding: .6rem 1rem;
      background: #fff; border-bottom: 1px solid #d8e2ee;
    }
    .c-bloqueo-title {
      font-family: 'Lexend', sans-serif; font-size: .68rem; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase; color: #b91c1c;
      display: flex; align-items: center; gap: .4rem; margin: 0;
    }
    .c-bloqueo-target {
      margin-left: auto; color: var(--brand);
      font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: .78rem;
      letter-spacing: .02em;
    }
    .c-bloqueo-fields {
      display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
      padding: 14px 16px 12px;
    }
    .c-fg label.c-label {
      font-family: 'Lexend', sans-serif; font-size: .68rem; font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
    }
    .c-bloqueo-inp {
      padding: .55rem .75rem; border: 1px solid #d8e2ee; border-radius: 8px;
      font-family: 'DM Sans', sans-serif; font-size: .9rem; color: var(--text);
      background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
    }
    .c-bloqueo-inp.c-money,
    input.c-bloqueo-inp[inputmode="decimal"] {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-weight: 500;
    }
    .c-bloqueo-inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,58,92,.08); }
    .c-bloqueo-inp[readonly] {
      background: #eef3fa; color: #5d6e85; cursor: not-allowed;
      border-style: solid; border-color: #d8e2ee;
    }
    .c-bloqueo-total {
      padding: .55rem .75rem; border: 1px solid #fde0a4; border-radius: 8px;
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-size: .9rem; font-weight: 700;
      color: #854d0e; background: #fff8e7; min-width: 130px; line-height: 1.4;
      white-space: nowrap;
    }
    .c-bloqueo-foot {
      display: flex; align-items: center; gap: .6rem;
      padding: .7rem 1rem;
      background: #fff; border-top: 1px solid #d8e2ee;
    }
    .c-bloqueo-foot-msg {
      font-family: 'DM Sans', sans-serif; font-size: .78rem; color: var(--muted);
      display: inline-flex; align-items: center; gap: .4rem;
    }
    .c-bloqueo-foot-msg .bi { color: var(--accent); }
    .c-bloqueo-foot-spacer { flex: 1; }

    /* ── Botón rojo sólido (acción irreversible) ───────────────────────────── */
    .c-btn-warn {
      background: linear-gradient(180deg, #dc2626, #b91c1c); color: #fff;
      box-shadow: 0 1px 0 rgba(0,0,0,.04), inset 0 -1px 0 rgba(0,0,0,.12);
    }
    .c-btn-warn:hover:not(:disabled) {
      transform: translateY(-1px); filter: brightness(1.05);
    }
    .c-btn-warn .bi { color: #ffd6d6; }

    /* ── Legajo Card ───────────────────────────────────────────────────────── */
    .c-legajo {
      background: var(--surface); border: 1px solid #e2e8f0; border-radius: var(--radius);
      box-shadow: 0 1px 4px rgba(0,0,0,.05);
      margin-bottom: 14px; overflow: hidden;
    }
    .c-legajo-hdr {
      background: linear-gradient(90deg, #f4f7fb 0%, #fafbfd 100%);
      padding: 14px 20px; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    }
    .c-legajo-code {
      font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.05rem;
      color: var(--brand); letter-spacing: .02em;
    }
    .c-legajo-id {
      font-size: .78rem; color: var(--muted); margin-top: 3px;
    }
    .c-legajo-id strong {
      font-family: 'JetBrains Mono', monospace; color: #475569; font-weight: 600;
    }
    .c-legajo-right { display: flex; align-items: center; gap: 10px; }
    .c-legajo-cupo-lbl {
      font-family: 'Lexend', sans-serif; font-size: .6rem; font-weight: 700;
      text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
    }
    .c-legajo-cupo {
      font-family: 'JetBrains Mono', monospace; font-weight: 700;
      color: #15803d; font-size: 1rem;
    }
    .c-legajo-cupo.zero { color: #94a3b8; } /* cupo agotado — gris neutro */
    .c-legajo-bloqueo {
      margin: 14px 20px;
      border: 1px solid #d8e2ee; border-radius: 10px;
      background: #f4f7fb; overflow: hidden;
      border-bottom: 1px solid #d8e2ee;
    }
    .c-legajo-body { padding: 4px 20px 18px; }

    /* ── Table ─────────────────────────────────────────────────────────────── */
    .c-tbl-wrap { overflow-x: auto; }
    .c-tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
    .c-tbl th {
      background: #cdd9e6; color: var(--brand);
      font-family: 'Lexend', sans-serif; font-size: .66rem; font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase;
      padding: .55rem 1rem; text-align: left;
      border-bottom: 1px solid #b7c4d2; white-space: nowrap;
    }
    .c-tbl td {
      padding: .65rem 1rem; border-bottom: 1px solid #eef2f7; color: var(--text);
      vertical-align: middle;
    }
    .c-tbl td.c-tbl-date {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      color: #475569; font-weight: 500;
    }
    .c-tbl tr:last-child td { border-bottom: none; }
    .c-tbl tr:hover td { background: #fafbfd; }

    /* ── Badges (período estado + socio) ───────────────────────────────────── */
    .c-badge {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 2px 9px; border-radius: 99px;
      font-family: 'Lexend', sans-serif; font-size: .7rem; font-weight: 600;
      letter-spacing: .04em; text-transform: uppercase;
    }
    .c-badge-active   {
      background: rgba(22,163,74,.08); color: #15803d; border: 1px solid #bbf7d0;
    }
    .c-badge-active::before {
      content: ''; width: 6px; height: 6px; border-radius: 50%; background: #16a34a;
      box-shadow: 0 0 0 3px rgba(22,163,74,.15);
    }
    .c-badge-inactive {
      background: #f1f5f9; color: var(--muted); border: 1px solid #e2e8f0;
    }
    .c-badge-socio    {
      background: linear-gradient(90deg, rgba(26,58,92,.10), rgba(26,58,92,.04));
      color: var(--brand); border: 1px solid rgba(26,58,92,.25);
    }
    .c-badge-socio::before {
      content: ''; width: 6px; height: 6px; border-radius: 50%;
      background: var(--brand); display: inline-block;
    }
    .c-badge-socio .bi { display: none; }
    .c-cupo {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-size: .95rem; font-weight: 700; color: #15803d;
    }
    .c-cupo.inactive  { color: var(--muted); font-weight: 400; }

    /* ── Debts ───────────────────────────────────────────────────────────────── */
    .c-debts { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
    .c-debts-title {
      font-size: .78rem; font-weight: 700; color: #e53e3e; letter-spacing: .06em;
      text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: .35rem;
    }
    .c-debt-row {
      display: flex; justify-content: space-between; align-items: center;
      padding: 8px 0; border-bottom: 1px solid #f7fafc; font-size: .875rem;
    }
    .c-debt-row:last-child { border-bottom: none; }
    .c-debt-ent { color: #4a5568; }
    .c-debt-amt { font-weight: 700; color: var(--red); }

    /* ── Empty ───────────────────────────────────────────────────────────────── */
    .c-empty { text-align: center; padding: 56px 20px; color: var(--muted); }
    .c-empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: .4; }
    .c-empty-text { font-family: 'Lexend', sans-serif; font-size: 1rem; color: #4a5568; }
    .c-empty-sub  { font-size: .85rem; margin-top: 6px; }

    /* ── Excel / File drop ───────────────────────────────────────────────────── */
    .c-drop {
      border: 2px dashed var(--border); border-radius: .75rem;
      padding: 32px 20px; text-align: center; cursor: pointer;
      transition: border-color .18s, background .18s; background: #f8fafc; position: relative;
    }
    .c-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
    .c-drop:hover, .c-drop.has-file { border-color: var(--brand); background: #eef2f7; }
    .c-drop-icon  { font-size: 2.25rem; color: var(--muted); margin-bottom: 10px; }
    .c-drop-lbl   { font-size: .9rem; color: var(--muted); line-height: 1.5; }
    .c-drop-lbl strong { color: var(--text); }
    .c-drop-hint  {
      display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: center;
      font-size: .85rem; color: #0f2540; font-weight: 500;
      background: #e0ecff; border: 1px solid #b8d4ff; border-radius: .5rem;
      padding: .5rem .85rem; margin-top: 14px; line-height: 1.4;
    }
    .c-drop-hint .bi { font-size: 1rem; color: var(--brand); }
    .c-drop-hint .c-col-tag {
      display: inline-block; font-family: 'Consolas', 'Monaco', monospace;
      font-size: .78rem; font-weight: 700; letter-spacing: .03em;
      background: #fff; color: var(--brand); border: 1px solid #b8d4ff;
      border-radius: .25rem; padding: .1rem .45rem;
    }
    .c-drop-file  { font-size: .875rem; font-weight: 600; color: var(--brand); margin-top: 10px; display: none; }

    /* ── Procesar Excel · toolbar (estilo cf-toolbar) ───────────────────────── */
    .mx-toolbar {
      display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
    }
    .mx-toolbar-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 520px; min-width: 260px; }
    .mx-toolbar-field > label {
      font-size: .68rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
      color: #4a5568; font-family: 'Lexend', sans-serif;
    }
    .mx-file {
      display: flex; align-items: center; gap: .65rem;
      padding: .55rem .7rem .55rem .55rem;
      background: #fff; border: 1px dashed #b7c4d2; border-radius: 10px;
      cursor: pointer; transition: border-color .15s, background .15s; position: relative;
      min-height: 56px;
    }
    .mx-file:hover { border-color: var(--brand); background: #f1f5fb; }
    .mx-file-icon {
      width: 36px; height: 36px; flex-shrink: 0;
      display: inline-flex; align-items: center; justify-content: center;
      background: rgba(26,58,92,.08); color: var(--brand); border-radius: 9px;
      font-size: 1.05rem; transition: background .15s, color .15s;
    }
    .mx-file-body { flex: 1; min-width: 0; line-height: 1.3; }
    .mx-file-lbl  { font-size: .88rem; font-weight: 500; color: #1f2937; display: block; }
    .mx-file-lbl strong { color: var(--brand); font-weight: 700; }
    .mx-file-sub  { font-size: .73rem; color: var(--muted); margin-top: 2px; display: block; }
    .mx-file .mx-file-loaded { display: none; }
    .mx-file.has-file { border-style: solid; border-color: var(--brand); background: #f1f5fb; }
    .mx-file.has-file .mx-file-icon { background: var(--brand); color: #fff; }
    .mx-file.has-file .mx-file-empty  { display: none; }
    .mx-file.has-file .mx-file-loaded { display: block; }
    .mx-file.has-file .mx-file-loaded .mx-file-lbl { color: var(--brand); }

    .mx-hint {
      display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
      margin-top: 14px; padding: .7rem .95rem;
      background: rgba(232,160,32,.07);
      border: 1px solid rgba(232,160,32,.25); border-left: 3px solid var(--accent);
      border-radius: 8px;
      font-size: .82rem; color: #1f2937;
    }
    .mx-hint > .bi { color: var(--accent); font-size: 1rem; }
    .mx-hint .c-col-tag {
      display: inline-block; font-family: 'JetBrains Mono', monospace;
      font-size: .72rem; font-weight: 700;
      background: #fff; border: 1px solid var(--border); border-radius: 5px;
      padding: 1px 8px; color: var(--brand); letter-spacing: .04em;
    }

    /* Opción de envío por mail al terminar */
    .c-mail-opt {
      display: flex; align-items: flex-start; gap: 12px;
      margin-top: 14px; padding: 14px 16px;
      background: linear-gradient(90deg, rgba(26,58,92,.04), rgba(26,58,92,0));
      border: 1px solid #dbe4ee;
      border-left: 3px solid var(--accent);
      border-radius: 8px;
      cursor: pointer;
      transition: background .15s, border-color .15s;
      user-select: none;
    }
    .c-mail-opt:hover { background: linear-gradient(90deg, rgba(26,58,92,.07), rgba(26,58,92,.01)); border-color: #c5d4e6; }
    .c-mail-opt input[type=checkbox] {
      margin: 3px 0 0; width: 17px; height: 17px;
      accent-color: var(--brand); cursor: pointer; flex-shrink: 0;
    }
    .c-mail-opt-body { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
    .c-mail-opt-title {
      font-family: 'Lexend', sans-serif; font-weight: 600;
      font-size: .9rem; color: var(--ink);
    }
    .c-mail-opt-title .bi { color: var(--accent); margin-right: 2px; }
    .c-mail-opt-sub { font-size: .8rem; color: var(--muted); }
    .c-mail-opt-sub strong { color: var(--brand); font-weight: 600; }
    .c-mail-opt.disabled { opacity: .55; cursor: not-allowed; }
    .c-mail-opt.disabled input[type=checkbox] { cursor: not-allowed; }

    .c-excel-actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
    .c-excel-status    { font-size: .85rem; color: var(--muted); }
    .c-excel-status.ok { color: var(--green); font-weight: 600; }
    .c-progress-row  { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
    .c-progress-bar  { flex: 1; background: #e2e8f0; border-radius: 99px; height: 8px; overflow: hidden; }
    .c-progress-fill { background: linear-gradient(90deg, var(--brand), var(--accent)); height: 100%; border-radius: 99px; transition: width .35s ease; width: 0%; }
    .c-progress-lbl  { font-size: .8rem; color: #4a5568; white-space: nowrap; min-width: 80px; text-align: right; }
    .mx-current {
      margin-top: 8px; padding: 8px 12px; background: #f7f9fc; border: 1px solid var(--border);
      border-radius: 8px; font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: .78rem;
      color: #2d3748; display: flex; gap: 1.1rem; flex-wrap: wrap; align-items: baseline;
    }
    .mx-current .mxc-k { color: var(--muted); font-size: .68rem; text-transform: uppercase;
      letter-spacing: .05em; margin-right: .35rem; }
    .mx-current .mxc-v { color: var(--brand); font-weight: 600; }

    /* ── Banner "Preparando el proceso" ─────────────────────────────────────── */
    .c-prep-banner {
      display: none; margin-top: 14px;
      padding: 1.15rem 1.4rem;
      background: linear-gradient(135deg, #eef3f8 0%, #dce6f3 100%);
      border: 1px solid #c7d4e3; border-radius: .6rem;
      align-items: center; gap: 1.1rem;
      box-shadow: 0 2px 8px rgba(15,37,64,.06);
    }
    .c-prep-banner.show { display: flex; }
    .c-prep-icon {
      width: 46px; height: 46px; border-radius: 50%;
      background: var(--brand); color: #fff;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.4rem; flex-shrink: 0;
      animation: c-prep-pulse 1.6s ease-in-out infinite;
    }
    @keyframes c-prep-pulse {
      0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0   rgba(26,58,92,.45); }
      50%      { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(26,58,92,0);  }
    }
    .c-prep-text { flex: 1; min-width: 0; }
    .c-prep-title {
      font-family: 'Lexend', sans-serif; font-weight: 600;
      color: var(--brand); font-size: 1.05rem; letter-spacing: .01em;
      display: flex; align-items: center; gap: .5rem;
    }
    .c-prep-dots { display: inline-flex; gap: 3px; margin-left: .25rem; }
    .c-prep-dots span {
      width: 5px; height: 5px; border-radius: 50%; background: var(--brand);
      animation: c-prep-dot 1.1s ease-in-out infinite;
    }
    .c-prep-dots span:nth-child(2) { animation-delay: .15s; }
    .c-prep-dots span:nth-child(3) { animation-delay: .3s; }
    @keyframes c-prep-dot {
      0%, 80%, 100% { transform: translateY(0);    opacity: .35; }
      40%           { transform: translateY(-4px); opacity: 1;   }
    }
    .c-prep-sub {
      color: #4a5a73; font-size: .85rem; margin-top: .2rem; line-height: 1.4;
    }

    /* ── Créditos a finalizar (cf-*) ────────────────────────────────────────── */
    .cf-toolbar {
      display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
      padding: 10px 14px; margin-bottom: 10px;
      background: #f4f7fb; border: 1px solid #d8e2ee; border-radius: 8px;
    }
    /* Filtro de productor — select inline en la toolbar */
    .cf-prod-sel {
      min-width: 200px; max-width: 320px;
      font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: .8rem;
      font-feature-settings: 'tnum';
    }
    .cf-toolbar-field { display: flex; flex-direction: column; gap: 4px; }
    .cf-toolbar-field label {
      font-family: 'Lexend', sans-serif; font-size: .7rem; font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
    }
    .cf-period-sel {
      min-width: 220px;
      font-family: 'Lexend', sans-serif; font-weight: 600;
      text-transform: uppercase; letter-spacing: .04em;
      color: var(--brand);
    }
    .cf-num-inp  { width: 110px; font-variant-numeric: tabular-nums; }
    .cf-money-inp {
      width: 170px;
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
    }
    .cf-toolbar-check {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 8px 12px; margin-bottom: 0;
      background: #fff; border: 1px solid #d8e2ee; border-radius: 8px;
      cursor: pointer; user-select: none;
      transition: all .15s ease;
      font-size: .85rem; color: var(--ink); font-weight: 500;
      align-self: stretch;
    }
    .cf-toolbar-check:hover { border-color: var(--brand); }
    .cf-toolbar-check input[type=checkbox] {
      width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer;
      margin: 0;
    }
    .cf-toolbar-check input[type=checkbox]:checked + .cf-toolbar-check-text {
      color: var(--brand); font-weight: 600;
    }
    .cf-toolbar-check.is-on {
      background: linear-gradient(135deg, rgba(26,58,92,.06), rgba(232,160,32,.06));
      border-color: var(--brand);
    }
    .cf-toolbar-check .bi-shield-check { color: var(--brand); font-size: 1rem; }
    .cf-search-btn { margin-bottom: 0; margin-left: auto; }

    .cf-truncated-banner {
      display: none; align-items: center; gap: 10px;
      padding: 6px 12px; margin-bottom: 8px;
      background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
      color: #854d0e; font-size: .82rem;
    }
    .cf-truncated-banner.show { display: flex; }
    .cf-truncated-banner .bi { color: #ca8a04; font-size: 1.05rem; flex-shrink: 0; }
    .cf-truncated-banner strong { color: #713f12; font-weight: 700; }
    .cf-empty { margin: 20px 0; flex-direction: column; align-items: center; }
    .cf-spin { animation: cf-spin 1s linear infinite; display: inline-block; }
    @keyframes cf-spin { to { transform: rotate(360deg); } }

    .cf-summary {
      display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
      padding: 6px 12px; margin-bottom: 0;
      background: #fff; border: 1px solid #e2e8f0; border-radius: 8px 8px 0 0;
      border-bottom: none;
    }
    .cf-summary-left { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    .cf-summary-chip {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 4px 10px; border-radius: 99px;
      background: linear-gradient(90deg, rgba(26,58,92,.08), rgba(232,160,32,.06));
      border: 1px solid #d8e2ee;
      font-size: .8rem; color: var(--ink);
    }
    .cf-summary-chip .bi { color: var(--brand); }
    .cf-summary-chip strong { color: var(--brand); font-weight: 700; }
    .cf-summary-chip-muted {
      background: #f7f9fc; color: var(--muted);
    }
    .cf-summary-chip-muted .bi { color: var(--muted); }
    .cf-summary-chip-muted strong { color: var(--ink); font-weight: 600; }
    /* Dentro del chip de "$ total", el importe va en mono. */
    .cf-summary-chip-mono strong {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-weight: 600; letter-spacing: -.01em;
    }

    .cf-table-wrap {
      border: 1px solid #e2e8f0; border-radius: 0 0 8px 8px;
      overflow: hidden; max-height: clamp(220px, 38vh, 420px); overflow-y: auto;
      background: #fff;
    }
    .cf-table {
      width: 100%; border-collapse: collapse;
      font-size: .85rem;
    }
    .cf-table thead th {
      position: sticky; top: 0; z-index: 1;
      background: #cdd9e6; color: var(--brand);
      font-family: 'Lexend', sans-serif; font-size: .66rem; font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase;
      padding: .4rem .7rem; text-align: left;
      border-bottom: 1px solid #b7c4d2; white-space: nowrap;
    }
    .cf-table tbody td {
      padding: .3rem .7rem; border-bottom: 1px solid #eef2f7;
      color: var(--ink); vertical-align: middle;
      line-height: 1.35;
    }
    .cf-table tbody tr:hover { background: #f7f9fc; cursor: pointer; }
    .cf-table tbody tr.cf-selected { background: rgba(232,160,32,.06); }
    .cf-table tbody tr.cf-selected:hover { background: rgba(232,160,32,.1); }
    .cf-table tbody tr:last-child td { border-bottom: none; }
    .cf-table input[type=checkbox] {
      width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer;
    }
    .cf-th-check   { width: 34px; text-align: center; }
    .cf-th-soc     { width: 108px; text-align: right; }
    .cf-th-dni     { width: 110px; }
    .cf-th-num     { width: 80px; text-align: center; }
    .cf-th-date    { width: 110px; }
    .cf-th-importe { width: 140px; text-align: right; }
    .cf-th-mora    { width: 120px; text-align: right; }
    .cf-table td.cf-cell-num     { text-align: center; }
    /* Celda Importe con mini-barra de fondo (proporcional al máximo de la página).
       El --cf-bar-pct se setea inline por fila. */
    .cf-table td.cf-cell-importe {
      position: relative; text-align: right; color: var(--brand);
      font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: .85rem;
      letter-spacing: -.01em; font-feature-settings: 'tnum';
      overflow: hidden; isolation: isolate;
    }
    .cf-table td.cf-cell-importe::before {
      content: ''; position: absolute; inset: 0 auto 0 0;
      width: var(--cf-bar-pct, 0%);
      background: linear-gradient(90deg,
        rgba(26,58,92,.04) 0%,
        rgba(26,58,92,.14) 70%,
        rgba(232,160,32,.20) 100%);
      z-index: -1;
      transition: width .35s cubic-bezier(.25,.8,.35,1);
    }
    .cf-table tbody tr.cf-selected td.cf-cell-importe::before {
      background: linear-gradient(90deg,
        rgba(232,160,32,.10) 0%,
        rgba(232,160,32,.22) 70%,
        rgba(232,160,32,.32) 100%);
    }
    .cf-table td.cf-cell-date    { font-variant-numeric: tabular-nums; color: #475569; }
    .cf-table td.cf-cell-dni     {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-weight: 600; font-size: .85rem; color: var(--brand);
      letter-spacing: -.01em;
    }
    .cf-table td.cf-cell-soc     {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-size: .85rem; text-align: right; color: #334155;
      letter-spacing: -.01em;
    }
    /* Ceros de padding en gris muy claro — el número "real" se lee instantáneo. */
    .cf-table td.cf-cell-soc .cf-soc-pad { color: #cbd5e1; font-weight: 400; }
    /* Pill dorado cuando un socio tiene > 1 crédito cerrando. */
    .cf-creds-pill {
      display: inline-flex; align-items: center; justify-content: center;
      min-width: 22px; height: 18px; padding: 0 6px; border-radius: 99px;
      font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .68rem;
      background: rgba(232,160,32,.14); color: #92670f;
      border: 1px solid rgba(232,160,32,.35);
      line-height: 1;
    }
    .cf-creds-plain {
      font-family: 'JetBrains Mono', monospace; color: #94a3b8;
      font-size: .82rem; font-weight: 500;
    }
    .cf-table td.cf-cell-mora    {
      text-align: right;
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-size: .85rem; letter-spacing: -.01em;
    }
    .cf-table td.cf-cell-mora.cf-mora-zero {
      color: #cbd5e0; font-weight: 400; font-family: 'DM Sans', sans-serif;
      font-size: 1rem; letter-spacing: 0;
    }
    .cf-table td.cf-cell-mora.cf-mora-pos {
      color: #b91c1c; font-weight: 600;
    }
    .cf-table .cf-name           { font-weight: 500; }
    .cf-table tbody tr.cf-hidden { display: none; }
    .cf-table .cf-th-actions,
    .cf-table td.cf-cell-actions { width: 1%; white-space: nowrap; text-align: right; }
    .cf-btn-cupo {
      display: inline-flex; align-items: center; gap: 4px;
      padding: .2rem .5rem; font-size: .72rem;
      border: 1px solid var(--brand); border-radius: 5px;
      background: transparent; color: var(--brand); cursor: pointer;
      font-family: 'Lexend', sans-serif; font-weight: 600;
      transition: all .15s;
    }
    .cf-btn-cupo:hover { background: var(--brand); color: #fff; }

    /* ── Sub-toolbar: filtro live + top-N + count ──────────────────────────── */
    .cf-subtoolbar {
      display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
      padding: 6px 12px; margin-bottom: 0;
      background: #fafbfc; border: 1px solid #e2e8f0; border-bottom: none;
      border-radius: 8px 8px 0 0;
    }
    .cf-subtoolbar + .cf-summary {
      border-radius: 0; border-top: none;
    }
    .cf-quickfilter {
      position: relative; flex: 1 1 240px; max-width: 320px;
    }
    .cf-quickfilter .bi-search {
      position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
      color: #94a3b8; font-size: .85rem; pointer-events: none;
    }
    .cf-quickfilter input {
      width: 100%; padding: 6px 28px 6px 30px; font-size: .82rem;
      font-family: 'DM Sans', sans-serif;
      background: #fff; border: 1px solid #d8e2ee; border-radius: 6px;
      color: var(--ink);
      transition: border-color .15s, box-shadow .15s;
    }
    .cf-quickfilter input:focus {
      outline: none; border-color: var(--brand);
      box-shadow: 0 0 0 3px rgba(26,58,92,.08);
    }
    .cf-quickfilter .cf-quickfilter-clear {
      position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
      width: 20px; height: 20px; border-radius: 50%;
      background: none; border: none; cursor: pointer;
      color: #94a3b8; font-size: 1rem; line-height: 1;
      display: none; align-items: center; justify-content: center;
      padding: 0;
    }
    .cf-quickfilter.has-value .cf-quickfilter-clear { display: inline-flex; }
    .cf-quickfilter .cf-quickfilter-clear:hover { color: var(--brand); background: #eef2f7; }

    .cf-topn {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: .78rem; color: var(--muted);
      font-family: 'DM Sans', sans-serif;
    }
    .cf-topn select {
      padding: 5px 10px; font-size: .78rem;
      background: #fff; border: 1px solid #d8e2ee; border-radius: 6px;
      color: var(--brand); font-weight: 600;
      cursor: pointer;
    }
    .cf-topn select:hover { border-color: var(--brand); }
    .cf-visible-count {
      margin-left: auto;
      font-size: .75rem; color: var(--muted);
      font-family: 'JetBrains Mono', monospace;
    }
    .cf-visible-count strong { color: var(--brand); font-weight: 700; }

    /* ── Summary chips: chip principal grande + secundario promedio ───────── */
    .cf-summary-chip-main {
      padding: 6px 14px; font-size: .9rem;
      background: linear-gradient(135deg, rgba(26,58,92,.10), rgba(232,160,32,.10));
      border: 1px solid rgba(26,58,92,.25);
    }
    .cf-summary-chip-main strong.cf-amount {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-weight: 700; font-size: 1.02rem; color: var(--brand);
      letter-spacing: -.01em; margin-right: 2px;
    }
    .cf-summary-chip-main .cf-divider {
      display: inline-block; width: 1px; height: 14px;
      background: rgba(26,58,92,.25); margin: 0 8px;
    }
    .cf-summary-chip-main .cf-count {
      font-family: 'DM Sans', sans-serif; font-size: .82rem; color: var(--ink);
    }
    .cf-summary-chip-main .cf-count strong {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-weight: 700;
    }
    .cf-summary-chip-avg .cf-avg-lbl {
      font-size: .72rem; color: var(--muted);
      text-transform: uppercase; letter-spacing: .06em; margin-right: 4px;
    }
    .cf-summary-chip-avg .cf-avg-val {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-weight: 600; color: var(--ink);
    }

    /* ── Banner truncado con CTA ──────────────────────────────────────────── */
    .cf-truncated-cta {
      background: none; border: none; padding: 0;
      color: #713f12; font-weight: 700; cursor: pointer;
      text-decoration: underline; text-decoration-color: rgba(202,138,4,.5);
      text-underline-offset: 3px; text-decoration-thickness: 1.5px;
      transition: color .15s, text-decoration-color .15s;
      font-family: inherit; font-size: inherit;
    }
    .cf-truncated-cta:hover {
      color: #422006; text-decoration-color: #ca8a04;
    }
    .cf-truncated-cta .bi { margin-left: 2px; font-size: .85em; }

    /* ── Skeleton de loading ──────────────────────────────────────────────── */
    .cf-skel-wrap {
      border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden;
      background: #fff; margin: 20px 0;
    }
    .cf-skel-row {
      display: grid; gap: 14px;
      grid-template-columns: 34px 90px 110px minmax(180px, 1fr) 60px 90px 130px 100px;
      align-items: center;
      padding: 14px 16px; border-bottom: 1px solid #eef2f7;
    }
    .cf-skel-row:last-child { border-bottom: none; }
    .cf-skel-row > div {
      height: 14px; border-radius: 4px;
      background: linear-gradient(90deg, #eef2f7 0%, #f7f9fc 50%, #eef2f7 100%);
      background-size: 200% 100%;
      animation: cf-shimmer 1.4s ease-in-out infinite;
    }
    .cf-skel-row > div.cf-skel-sm { width: 60%; }
    .cf-skel-row > div.cf-skel-md { width: 80%; }
    .cf-skel-row:nth-child(1) > div { animation-delay: .00s; }
    .cf-skel-row:nth-child(2) > div { animation-delay: .08s; }
    .cf-skel-row:nth-child(3) > div { animation-delay: .16s; }
    .cf-skel-row:nth-child(4) > div { animation-delay: .24s; }
    .cf-skel-row:nth-child(5) > div { animation-delay: .32s; }
    .cf-skel-label {
      padding: 10px 16px; border-bottom: 1px solid #eef2f7;
      background: #f4f7fb;
      font-size: .78rem; color: var(--brand); font-weight: 600;
      font-family: 'Lexend', sans-serif; letter-spacing: .04em;
      display: flex; align-items: center; gap: 8px;
    }
    .cf-skel-label .cf-skel-pulse {
      width: 6px; height: 6px; border-radius: 50%;
      background: var(--accent);
      animation: cf-pulse-dot 1.1s ease-in-out infinite;
    }
    @keyframes cf-shimmer {
      0%   { background-position: 100% 0; }
      100% { background-position: -100% 0; }
    }
    @keyframes cf-pulse-dot {
      0%, 100% { opacity: .35; transform: scale(.9); }
      50%      { opacity: 1;   transform: scale(1.2); }
    }

    .cf-actions { margin-top: 10px; }

    /* ── Créditos vigentes (cv-*) ────────────────────────────────────────────── */
    .cv-toolbar {
      display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
      padding: .85rem 1rem; border-bottom: 1px solid #dde6f0; background: #f7f9fc;
    }
    /* buscador en toolbar */
    .cv-toolbar-field.cv-field-search { min-width: 200px; max-width: 280px; flex: 1 1 200px; }
    .cv-toolbar-search {
      position: relative; display: flex; align-items: center;
    }
    .cv-toolbar-search-icon {
      position: absolute; left: 9px; color: #8899bb; font-size: .85rem; pointer-events: none;
    }
    .cv-search-inp {
      padding-left: 28px !important; width: 100%; height: 34px; font-size: .82rem;
      background: #fff; border: 1px solid #c8d8e8; border-radius: 6px;
    }
    .cv-search-inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(26,58,92,.12); }
    .cv-toolbar-field { display: flex; flex-direction: column; gap: 4px; }
    .cv-toolbar-field label {
      font-family: 'Lexend', sans-serif; font-size: .7rem; font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
    }
    .cv-num-inp  { width: 110px; font-variant-numeric: tabular-nums; }
    .cv-money-inp {
      width: 170px;
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
    }
    .cv-toolbar-check {
      display: inline-flex; align-items: center; gap: 8px;
      border: 1px solid #c8d8e8; border-radius: 8px; padding: .4rem .75rem;
      cursor: pointer; user-select: none; background: #fff;
      font-family: 'Lexend', sans-serif; font-size: .78rem; color: #4a5a73;
    }
    .cv-toolbar-check:hover { border-color: var(--brand); }
    .cv-toolbar-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
    .cv-toolbar-check.is-on {
      background: linear-gradient(135deg, rgba(26,58,92,.06), rgba(232,160,32,.06));
      border-color: rgba(26,58,92,.3);
    }
    .cv-toolbar-check .bi-shield-check { color: var(--brand); font-size: 1rem; }
    .cv-search-btn { margin-bottom: 0; margin-left: auto; }

    /* Filtro de productor — select inline en la toolbar */
    .cv-prod-sel {
      min-width: 200px; max-width: 320px;
      font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: .8rem;
      font-feature-settings: 'tnum';
    }

    /* Tabla */
    .cv-table-wrap {
      border: 1px solid #e2e8f0; border-radius: 0 0 8px 8px;
      overflow-x: auto; max-height: clamp(260px, 52vh, 600px); overflow-y: auto;
    }
    .cv-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
    .cv-table thead th {
      position: sticky; top: 0; z-index: 1;
      background: #f0f5fa; border-bottom: 2px solid #c8d8e8;
      padding: .4rem .7rem; text-align: left;
      font-family: 'Lexend', sans-serif; font-size: .7rem; font-weight: 700;
      letter-spacing: .06em; text-transform: uppercase; color: var(--brand);
      white-space: nowrap;
    }
    .cv-table tbody td {
      padding: .3rem .7rem; border-bottom: 1px solid #eef2f7; vertical-align: middle;
      white-space: nowrap;
    }
    .cv-table tbody tr:hover { background: #f7f9fc; }
    .cv-table tbody tr:last-child td { border-bottom: none; }

    /* Columna Referencia */
    .cv-cell-ref {
      font-family: 'JetBrains Mono', monospace; font-size: .75rem;
      color: var(--brand); font-weight: 600;
    }
    /* Columna % Cobranza — barra de progreso inline */
    .cv-cell-pct { min-width: 110px; }
    .cv-pct-wrap { display: flex; align-items: center; gap: 5px; }
    .cv-pct-bar {
      flex: 1; min-width: 50px; height: 6px;
      background: #e2e8f0; border-radius: 3px; overflow: hidden;
    }
    .cv-pct-fill {
      height: 100%; border-radius: 3px;
      background: linear-gradient(90deg, var(--brand), #2d6cb3);
      transition: width .4s ease;
    }
    .cv-pct-fill.is-high { background: linear-gradient(90deg, #16a34a, #22c55e); }
    .cv-pct-fill.is-low  { background: linear-gradient(90deg, #b45309, #d97706); }
    .cv-pct-val { font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: #4a5a73; min-width: 38px; text-align: right; }
    /* Columnas numéricas */
    .cv-cell-num  { text-align: right; font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--brand); font-weight: 600; }
    .cv-cell-mora { text-align: right; font-family: 'JetBrains Mono', monospace; font-size: .78rem; }
    .cv-cell-mora.has-mora { color: #dc2626; font-weight: 600; }
    .cv-cell-date { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: #4a5a73; }
    .cv-cell-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
    .cv-cell-actions { width: 1%; white-space: nowrap; }

    /* Botón Consultar Cupo en cada fila */
    .cv-btn-cupo {
      display: inline-flex; align-items: center; gap: 4px;
      padding: .2rem .5rem; font-size: .72rem;
      border: 1px solid var(--brand); border-radius: 5px;
      background: transparent; color: var(--brand); cursor: pointer;
      font-family: 'Lexend', sans-serif; font-weight: 600;
      transition: all .15s;
    }
    .cv-btn-cupo:hover { background: var(--brand); color: #fff; }
    @keyframes cv-spin { to { transform: rotate(360deg); } }

    /* Summary strip */
    .cv-summary {
      display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
      padding: .6rem 1rem; border-top: 1px solid #e2e8f0; background: #fafbfc;
    }
    .cv-summary-chip {
      display: inline-flex; align-items: center; gap: 6px;
      background: #e8f0f8; border: 1px solid #c5d8ec; border-radius: 20px;
      padding: .3rem .8rem;
      font-family: 'Lexend', sans-serif; font-size: .75rem; color: var(--brand);
    }
    .cv-summary-chip strong { font-size: .85rem; }
    .cv-summary-chip-count { background: #f0f5e8; border-color: #c5d8b5; color: #2d6b2d; }

    /* SweetAlert cupo — estado de carga */
    .cv-swal-loading-body {
      display: flex; flex-direction: column; align-items: center;
      padding: .5rem 0 .2rem; gap: 10px; text-align: center;
    }
    .cv-swal-spinner-ring {
      width: 42px; height: 42px; border-radius: 50%;
      border: 4px solid rgba(26,58,92,.12);
      border-top-color: var(--brand);
      animation: cv-spin .75s linear infinite;
    }
    .cv-swal-phase {
      font-family: 'Lexend', sans-serif; font-size: .82rem; font-weight: 600;
      color: var(--brand); letter-spacing: .02em;
    }
    .cv-swal-bar-wrap {
      width: 100%; height: 5px; background: #dde6f0; border-radius: 99px; overflow: hidden;
    }
    .cv-swal-bar-fill {
      height: 100%; background: var(--brand); border-radius: 99px;
      transition: width .4s ease;
    }
    .cv-swal-bar-indeterminate {
      width: 40% !important;
      animation: cv-swal-slide 1.3s ease-in-out infinite;
    }
    @keyframes cv-swal-slide {
      0%   { transform: translateX(-100%); }
      100% { transform: translateX(300%); }
    }
    .cv-swal-meta {
      width: 100%; background: #f7f9fc; border: 1px solid #dde6f0;
      border-radius: 7px; padding: .45rem .7rem; text-align: left;
    }
    .cv-swal-prog-row {
      display: flex; justify-content: space-between; font-size: .76rem;
      padding: .15rem 0; border-bottom: 1px solid #eef2f7;
    }
    .cv-swal-prog-row:last-child { border-bottom: none; }
    .cv-swal-prog-k { color: #718096; }
    .cv-swal-prog-v { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: var(--brand); font-weight: 600; }
    .cv-swal-cancel-btn {
      margin-top: 2px; background: none; border: 1px solid #c8d8e8; border-radius: 6px;
      padding: .3rem .8rem; font-size: .75rem; color: #718096; cursor: pointer;
      font-family: 'DM Sans', sans-serif; transition: border-color .15s, color .15s;
    }
    .cv-swal-cancel-btn:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
    .cv-swal-cancel-btn:disabled { opacity: .5; cursor: not-allowed; }
    /* Botón Cerrar (fin de consulta) — dentro del HTML, no nativo de Swal */
    .cv-swal-close-btn {
      background: var(--brand); color: #fff; border: none; border-radius: 7px;
      padding: .38rem 1.4rem; font-size: .82rem; font-family: 'Lexend', sans-serif;
      font-weight: 600; cursor: pointer; letter-spacing: .02em;
      transition: background .15s, transform .1s;
    }
    .cv-swal-close-btn:hover { background: #254e7a; transform: translateY(-1px); }
    .cv-swal-close-btn.cv-swal-close-err { background: #b91c1c; }
    .cv-swal-close-btn.cv-swal-close-err:hover { background: #991b1b; }
    /* Barra de acciones al finalizar (Imprimir + Cerrar) */
    .cv-swal-done-actions {
      display: flex; justify-content: center; align-items: center;
      gap: 8px; margin-top: 10px;
    }
    .cv-swal-print-btn {
      background: none; border: 1px solid var(--brand); border-radius: 7px;
      padding: .38rem 1.1rem; font-size: .82rem; font-family: 'Lexend', sans-serif;
      font-weight: 600; color: var(--brand); cursor: pointer; letter-spacing: .02em;
      display: inline-flex; align-items: center; gap: 5px;
      transition: background .15s, color .15s, transform .1s;
    }
    .cv-swal-print-btn:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }
    /* SweetAlert cupo — resultados */
    .cv-swal-result-body { text-align: left; max-height: 55vh; overflow-y: auto; margin-bottom: 4px; }
    /* SweetAlert cupo result */
    .cv-swal-legajo {
      background: #f7f9fc; border: 1px solid #dde6f0; border-radius: 8px;
      padding: .6rem .9rem; margin-bottom: .5rem; text-align: left;
    }
    .cv-swal-legajo-title {
      font-family: 'Lexend', sans-serif; font-weight: 700; font-size: .82rem;
      color: var(--brand); margin-bottom: .3rem;
    }
    .cv-swal-period { display: flex; justify-content: space-between; font-size: .79rem; padding: .1rem 0; border-bottom: 1px solid #eef2f7; }
    .cv-swal-period:last-child { border-bottom: none; }
    .cv-swal-period-lbl { color: #4a5a73; }
    .cv-swal-period-val { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--brand); }
    .cv-swal-total { margin-top: .6rem; padding-top: .4rem; border-top: 2px solid var(--brand); display: flex; justify-content: space-between; font-size: .85rem; }
    .cv-swal-total-lbl { font-family: 'Lexend', sans-serif; font-weight: 700; color: var(--brand); }
    .cv-swal-total-val { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: #a66c0b; font-size: .95rem; }
    .cv-swal-no-activos { color: #b45309; font-size: .82rem; margin-top: .4rem; }

    /* ═══════════════════════════════════════════════════════════════════════
       DASHBOARD  (db-*)
       ═══════════════════════════════════════════════════════════════════════ */
    .db-welcome {
      margin-bottom: 1.75rem;
    }
    .db-welcome-title {
      font-family: 'Lexend', sans-serif; font-size: 1.35rem; font-weight: 700;
      color: var(--brand); line-height: 1.2;
    }
    .db-welcome-title span { color: var(--accent); }
    .db-welcome-sub {
      font-size: .875rem; color: var(--muted); margin-top: .35rem;
    }

    .db-section-label {
      font-family: 'Lexend', sans-serif; font-size: .62rem; font-weight: 700;
      letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
      margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem;
    }
    .db-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

    .db-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 1.125rem;
    }

    /* — stat card — */
    .db-card {
      background: var(--surface); border-radius: var(--radius);
      box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 6px 24px rgba(0,0,0,.06);
      overflow: hidden; position: relative;
      transition: box-shadow .2s, transform .2s;
    }
    .db-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12), 0 12px 32px rgba(0,0,0,.08); transform: translateY(-2px); }

    .db-card-hd {
      padding: .875rem 1.125rem .7rem;
      display: flex; align-items: center; justify-content: space-between;
      border-bottom: 1px solid rgba(255,255,255,.08);
    }
    .db-card-hd-mes     { background: var(--brand); }
    .db-card-hd-ant     { background: #2c4a6e; }

    .db-card-lbl {
      font-family: 'Lexend', sans-serif; font-size: .6rem; font-weight: 700;
      letter-spacing: .13em; text-transform: uppercase;
      color: rgba(255,255,255,.55); line-height: 1.2;
    }
    .db-card-lbl strong { display: block; color: rgba(255,255,255,.88); font-size: .72rem; letter-spacing: .05em; }

    .db-card-ico {
      width: 34px; height: 34px; border-radius: .45rem;
      background: rgba(255,255,255,.13);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.05rem; color: rgba(255,255,255,.9); flex-shrink: 0;
    }

    .db-card-body { padding: 1.125rem; }
    .db-card-count {
      font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum';
      font-size: 3rem; font-weight: 700; color: var(--brand); line-height: 1;
      letter-spacing: -.02em;
    }
    .db-card-mes-ant .db-card-count { color: var(--muted); }
    .db-card-count-skel {
      width: 4.5rem; height: 3rem; background: #e8edf4;
      border-radius: .4rem; animation: dbPulse 1.4s ease-in-out infinite;
    }
    .db-card-desc {
      font-size: .78rem; color: var(--muted); margin-top: .4rem;
      font-family: 'DM Sans', sans-serif;
    }
    .db-card-badge {
      display: inline-flex; align-items: center; gap: .3rem; margin-top: .8rem;
      font-family: 'Lexend', sans-serif; font-size: .65rem; font-weight: 700;
      letter-spacing: .04em; text-transform: uppercase;
      border-radius: 2rem; padding: .25rem .7rem;
    }
    .db-badge-ok  { background: #e6f5ec; color: var(--green); }
    .db-badge-ant { background: #f0f4f8; color: var(--muted); }
    .db-badge-zero { background: #fdf3e3; color: #b45309; }

    /* accent bar left */
    .db-card::before {
      content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
    }

    /* — empresa card variant — */
    .db-card-hd-emp-mes { background: #155e44; }
    .db-card-hd-emp-ant { background: #1a3d2e; }
    .db-card-emp .db-card-count { color: #155e44; }
    .db-badge-emp-ok  { background: #e6f5ed; color: #155e44; }
    .db-badge-emp-ant { background: #edf5f0; color: #3a7a5a; }
    .db-badge-emp-zero { background: #fdf3e3; color: #b45309; }

    /* separador entre sección personal y empresa */
    .db-section-gap { margin-top: 2rem; }

    /* ── Card "Tiempos promedio del mes" (db-tiempos) ─────────────────── */
    .db-tiempos-card {
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 2px 10px rgba(15,37,64,.08);
      overflow: hidden;
      margin-top: 1rem;
    }
    .db-tiempos-hd {
      padding: .85rem 1.15rem;
      display: flex; align-items: center; gap: .55rem;
      background: linear-gradient(135deg, var(--brand) 0%, #2c4a6e 100%);
      color: #fff;
    }
    .db-tiempos-hd.is-emp {
      background: linear-gradient(135deg, #155e44 0%, #1a3d2e 100%);
    }
    .db-tiempos-hd-ico {
      width: 28px; height: 28px; border-radius: 7px;
      display: inline-flex; align-items: center; justify-content: center;
      background: rgba(255,255,255,.16); color: #fff; font-size: .95rem;
      flex-shrink: 0;
    }
    .db-tiempos-hd-lbl {
      flex: 1; min-width: 0;
      font-family: 'Lexend', sans-serif; font-size: .82rem;
      font-weight: 600; letter-spacing: .015em; color: #fff;
    }
    .db-tiempos-hd-lbl strong {
      display: block; color: rgba(255,255,255,.78);
      font-size: .62rem; font-weight: 600; letter-spacing: .1em;
      text-transform: uppercase; margin-bottom: .1rem;
    }
    .db-tiempos-grid {
      display: grid; grid-template-columns: 1fr 1fr;
      gap: .9rem; padding: 1.1rem 1.15rem 1.2rem;
    }
    @media (max-width: 480px) { .db-tiempos-grid { grid-template-columns: 1fr; } }
    .db-tiempo {
      position: relative; overflow: hidden;
      padding: 1.05rem 1rem .95rem;
      border-radius: 10px;
      background: linear-gradient(135deg, rgba(26,58,92,.04) 0%, rgba(26,58,92,.11) 100%);
      border: 1px solid rgba(26,58,92,.12);
    }
    .db-tiempo.is-alta {
      background: linear-gradient(135deg, rgba(232,160,32,.06) 0%, rgba(232,160,32,.16) 100%);
      border-color: rgba(232,160,32,.22);
    }
    .db-tiempo::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
      background: var(--brand);
    }
    .db-tiempo.is-alta::before { background: #e8a020; }
    .db-tiempo::after {
      content: ''; position: absolute; right: -20px; bottom: -24px;
      width: 76px; height: 76px; border-radius: 50%;
      background: rgba(26,58,92,.06);
    }
    .db-tiempo.is-alta::after { background: rgba(232,160,32,.10); }
    .db-tiempos-card.is-emp .db-tiempo {
      background: linear-gradient(135deg, rgba(21,94,68,.05) 0%, rgba(21,94,68,.13) 100%);
      border-color: rgba(21,94,68,.18);
    }
    .db-tiempos-card.is-emp .db-tiempo::before { background: #155e44; }
    .db-tiempos-card.is-emp .db-tiempo::after  { background: rgba(21,94,68,.08); }
    .db-tiempos-card.is-emp .db-tiempo.is-alta {
      background: linear-gradient(135deg, rgba(232,160,32,.06) 0%, rgba(232,160,32,.16) 100%);
      border-color: rgba(232,160,32,.22);
    }
    .db-tiempos-card.is-emp .db-tiempo.is-alta::before { background: #e8a020; }
    .db-tiempo-top {
      display: flex; align-items: center; gap: .45rem;
      font-family: 'Lexend', sans-serif; font-size: .68rem;
      font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
      color: var(--brand);
    }
    .db-tiempo.is-alta .db-tiempo-top { color: #b45309; }
    .db-tiempos-card.is-emp .db-tiempo .db-tiempo-top { color: #155e44; }
    .db-tiempos-card.is-emp .db-tiempo.is-alta .db-tiempo-top { color: #b45309; }
    .db-tiempo-top i {
      font-size: 1rem; width: 22px; height: 22px;
      display: inline-flex; align-items: center; justify-content: center;
      background: rgba(26,58,92,.12); border-radius: 5px;
    }
    .db-tiempo.is-alta .db-tiempo-top i { background: rgba(232,160,32,.18); }
    .db-tiempos-card.is-emp .db-tiempo .db-tiempo-top i { background: rgba(21,94,68,.15); }
    .db-tiempos-card.is-emp .db-tiempo.is-alta .db-tiempo-top i { background: rgba(232,160,32,.18); }
    .db-tiempo-val {
      margin-top: .7rem; position: relative; z-index: 1;
      font-family: 'Lexend', sans-serif; font-weight: 700;
      font-size: 2.15rem; line-height: 1; letter-spacing: -.025em;
      color: #0f2540; font-feature-settings: 'tnum';
    }
    .db-tiempo.is-alta .db-tiempo-val { color: #6b3a02; }
    .db-tiempos-card.is-emp .db-tiempo .db-tiempo-val { color: #0e3a2b; }
    .db-tiempos-card.is-emp .db-tiempo.is-alta .db-tiempo-val { color: #6b3a02; }
    .db-tiempo-unit {
      font-size: 1rem; font-weight: 600; color: #64748b; margin-left: .22rem;
      letter-spacing: 0;
    }
    .db-tiempo-sub {
      margin-top: .42rem; position: relative; z-index: 1;
      font-size: .74rem; color: #64748b;
      font-family: 'DM Sans', sans-serif;
    }
    .db-tiempo-sub strong {
      color: var(--brand); font-weight: 700;
      font-family: 'JetBrains Mono', 'Consolas', monospace;
      font-feature-settings: 'tnum';
    }
    .db-tiempo.is-alta .db-tiempo-sub strong { color: #b45309; }
    .db-tiempos-card.is-emp .db-tiempo .db-tiempo-sub strong { color: #155e44; }
    .db-tiempos-card.is-emp .db-tiempo.is-alta .db-tiempo-sub strong { color: #b45309; }
    .db-tiempo-empty {
      margin-top: .65rem; font-style: italic; color: #94a3b8; font-size: .76rem;
    }

    /* pill "empresa" en el header de las cards */
    .db-emp-pill {
      display: inline-flex; align-items: center; gap: .3rem;
      font-family: 'Lexend', sans-serif; font-size: .55rem; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase;
      background: rgba(255,255,255,.18); color: rgba(255,255,255,.75);
      border-radius: 2rem; padding: .18rem .55rem; margin-top: .25rem;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12rem;
    }

    /* skeleton pulse */
    @keyframes dbPulse {
      0%, 100% { opacity: 1; }
      50% { opacity: .45; }
    }

    /* error state */
    .db-error {
      background: #fff8f8; border: 1px solid #fde8e8; border-radius: var(--radius);
      padding: 1rem 1.25rem; color: var(--red); font-size: .82rem;
      display: flex; align-items: center; gap: .6rem;
    }

    /* ── Responsive ─────────────────────────────────────────────────────────── */
    @media (max-width: 768px) {
      .c-sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: none; }
      .c-sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.4); }
      .c-main { margin-left: 0; }
      .c-hamburger { display: block; }
      .c-mobile-hdr { display: flex; }
      /* 95% del viewport con un cachito de aire a los costados */
      .c-page { width: 95%; padding: 16px 0 48px; }
      .ct-page { padding: 1rem 1rem 3rem; }

      /* Person card: layout en columna, sin overflow del botón Bloquear */
      .c-person { flex-direction: column; align-items: stretch; padding: 18px 18px 20px; gap: 14px; }
      .c-person-info { width: 100%; }
      .c-person-name { white-space: normal; }
      .c-bloqueo-panel { width: 100%; }
      .c-cupo-total { text-align: left; width: 100%; }
      /* Override del inline style: en mobile va columna y full-width para que el botón nunca se salga */
      .c-cupo-actions { flex-direction: column !important; align-items: stretch !important; width: 100%; gap: 10px !important; }
      .c-cupo-actions > div:last-child { align-items: stretch !important; }
      /* En mobile la fila PDF+Bloquear toma todo el ancho, cada botón al 50% */
      .c-person-btns { width: 100%; gap: 8px; }
      .c-person-btns .c-btn { flex: 1; justify-content: center; padding: .65rem .8rem; }
      .c-cupo-actions .c-btn + div { text-align: right; }

      /* Legajo card: padding y tabla compactos para que entren las 3 columnas */
      .c-legajo-hdr { padding: 12px 14px; }
      .c-legajo-bloqueo { padding: 12px 14px; }
      .c-legajo-body { padding: 12px 12px; }
      .c-tbl { font-size: .82rem; table-layout: fixed; }
      .c-tbl th { padding: 8px 6px; font-size: .62rem; letter-spacing: .04em; }
      .c-tbl td { padding: 10px 6px; }
      .c-tbl td:first-child, .c-tbl th:first-child { padding-left: 4px; }
      .c-tbl td:last-child,  .c-tbl th:last-child  { padding-right: 4px; }
      .c-cupo { font-size: .85rem; }
      .c-badge { padding: 2px 7px; font-size: .65rem; }
      /* No queremos scroll horizontal en mobile — todo tiene que entrar */
      .c-tbl-wrap { overflow-x: visible; }

      /* Bloqueo inline */
      .c-bloqueo-fields { flex-direction: column; width: 100%; }
      .c-bloqueo-inp { width: 100% !important; }
      .c-bloqueo-total { width: 100%; }
      .c-bloqueo-btns { width: 100%; justify-content: flex-end; }
      .c-search-row { flex-direction: column; }
      .c-search-row .c-btn { width: 100%; justify-content: center; }
      .c-fg { width: 100% !important; min-width: unset !important; max-width: unset !important; }
      .c-sel, .c-inp { width: 100%; }
    }

    /* Pantallas muy chicas: comprimo todavía más la tabla para que no scrollee */
    @media (max-width: 380px) {
      .c-tbl { font-size: .78rem; }
      .c-tbl th { padding: 7px 4px; font-size: .58rem; }
      .c-tbl td { padding: 9px 4px; }
      .c-cupo { font-size: .8rem; }
    }

    /* ── SweetAlert2 — tema API MDZ ──────────────────────────────────── */
    .amdz-swal {
      border-radius: .75rem !important;
      font-family: 'DM Sans', sans-serif !important;
      padding: 0 !important;
      overflow: hidden !important;
      box-shadow: 0 24px 60px rgba(15,37,64,.28), 0 2px 6px rgba(15,37,64,.08) !important;
      border: 1px solid #e2e8f0 !important;
    }
    .amdz-swal-title {
      font-family: 'Lexend', sans-serif !important;
      font-weight: 600 !important;
      color: var(--brand) !important;
      font-size: 1.15rem !important;
      padding: 1.1rem 1.5rem .25rem !important;
    }
    .amdz-swal-text {
      font-family: 'DM Sans', sans-serif !important;
      color: #4a5a73 !important;
      font-size: .92rem !important;
      padding: .25rem 1.5rem 1rem !important;
      line-height: 1.45 !important;
    }
    .amdz-swal .swal2-icon { margin: 1.25rem auto .25rem !important; }
    .amdz-swal .swal2-actions {
      background: #fafbfc !important;
      border-top: 1px solid #e2e8f0 !important;
      margin: 0 !important;
      padding: .85rem 1.25rem !important;
      gap: .55rem !important;
      justify-content: flex-end !important;
    }
    .amdz-swal-confirm {
      background: var(--accent) !important;
      color: #fff !important;
      border: none !important;
      font-family: 'Lexend', sans-serif !important;
      font-weight: 500 !important;
      letter-spacing: .01em !important;
      padding: .55rem 1.15rem !important;
      border-radius: .4rem !important;
      box-shadow: 0 2px 4px rgba(232,160,32,.25) !important;
    }
    .amdz-swal-confirm:hover { background: #d18d10 !important; }
    .amdz-swal-confirm:focus { box-shadow: 0 0 0 3px rgba(232,160,32,.3) !important; }
    .amdz-swal-cancel {
      background: #fff !important;
      color: #4a5a73 !important;
      border: 1px solid #cbd5e0 !important;
      font-family: 'Lexend', sans-serif !important;
      font-weight: 500 !important;
      padding: .55rem 1.15rem !important;
      border-radius: .4rem !important;
    }
    .amdz-swal-cancel:hover { background: #f7f9fc !important; }
    .swal2-backdrop-show { background: rgba(15,37,64,.55) !important; }
    .amdz-swal .swal2-icon.swal2-warning  { border-color: var(--accent) !important; color: var(--accent) !important; }
    .amdz-swal .swal2-icon.swal2-question { border-color: var(--brand)  !important; color: var(--brand)  !important; }
    .amdz-swal .swal2-icon.swal2-error    { border-color: var(--red) !important; color: var(--red) !important; }
    .amdz-swal .swal2-icon.swal2-error [class^=swal2-x-mark-line] { background-color: var(--red) !important; }
    .amdz-swal .swal2-icon.swal2-success  { border-color: var(--green) !important; }
    .amdz-swal .swal2-icon.swal2-success [class^=swal2-success-line] { background-color: var(--green) !important; }
    .amdz-swal .swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(47,133,90,.3) !important; }
    .amdz-swal .swal2-icon.swal2-info     { border-color: var(--brand) !important; color: var(--brand) !important; }