:root {
  --ink: #10203f;
  --ink-soft: #243656;
  --slate: #4c6280;
  --muted: #6d7f99;
  --line: #d7e1ee;
  --surface: #f3f6fb;
  --card: #ffffff;
  --accent: #12357a;
  --accent-hover: #0c275c;
  --accent-soft: #e7eefb;
  --accent-mid: #2f5cb8;
  --ok: #1c7c45;
  --ok-soft: #e5f6ec;
  --warn: #b86a09;
  --warn-soft: #fff4e4;
  --danger: #b4332a;
  --danger-soft: #fdeceb;
  --info: #1d4f91;
  --info-soft: #e7f0fb;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 16px 40px rgba(16, 32, 63, 0.08);
  --shadow-sm: 0 6px 18px rgba(16, 32, 63, 0.06);
  --sidebar: 272px;
  --sidebar-collapsed: 84px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.asinsa-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 0% -10%, rgba(18, 53, 122, 0.14), transparent 55%),
    radial-gradient(800px 380px at 100% 0%, rgba(47, 92, 184, 0.12), transparent 50%),
    linear-gradient(180deg, #eef3fa 0%, var(--surface) 42%, #e8eef7 100%);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.asinsa-shell { display: flex; min-height: 100vh; }

.asinsa-sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 24px rgba(16, 32, 63, 0.04);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: width .22s ease, transform .25s ease;
  overflow: hidden;
}

.asinsa-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 84px;
  padding: .85rem .9rem;
  border-bottom: 1px solid var(--line);
}

.asinsa-brand-link {
  min-width: 0;
  display: flex;
  align-items: center;
}

.asinsa-brand-logo img {
  display: block;
  height: 52px;
  width: auto;
  max-width: 188px;
  object-fit: contain;
  object-position: left center;
}

.asinsa-brand-mark {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8eb4ef, #12357a 62%);
  color: #fff;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
}

.asinsa-collapse-btn,
.asinsa-menu-toggle {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.asinsa-collapse-btn:hover,
.asinsa-menu-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #c5d4ee;
}

.asinsa-nav {
  padding: .9rem .75rem 1rem;
  overflow: auto;
  flex: 1;
}

.asinsa-nav-label {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: .35rem .7rem .55rem;
}

.asinsa-nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--slate);
  text-align: left;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  border-radius: 12px;
  padding: .72rem .75rem;
  cursor: pointer;
  margin-bottom: .2rem;
}

.asinsa-nav-link i { width: 1.2rem; text-align: center; color: var(--accent); }

.asinsa-nav-link:hover {
  background: #f4f7fc;
  color: var(--ink);
}

.asinsa-nav-link.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
  box-shadow: inset 3px 0 0 var(--accent);
}

.asinsa-sidebar-foot {
  padding: .4rem .75rem 1rem;
  border-top: 1px solid var(--line);
}

.asinsa-logout { color: var(--danger); }
.asinsa-logout i { color: var(--danger); }

.asinsa-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.asinsa-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.4rem;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(215, 225, 238, .9);
}

.asinsa-topbar-left { display: flex; align-items: center; gap: .75rem; min-width: 0; flex: 1; }
.asinsa-topbar-left > div { min-width: 0; }
.asinsa-menu-toggle { display: none; }

.asinsa-topbar-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asinsa-topbar-sub {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.asinsa-user-chip {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: .3rem .35rem .3rem .9rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.asinsa-user-chip .meta-text { display: flex; flex-direction: column; align-items: flex-end; }
.asinsa-user-chip .name { font-size: .88rem; font-weight: 700; color: var(--ink); line-height: 1.15; }
.asinsa-user-chip .role { font-size: .72rem; color: var(--muted); }
.asinsa-user-chip .avatar,
.person-row .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent-mid), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: .78rem;
  flex-shrink: 0;
}

.asinsa-content {
  padding: 1.4rem 1.5rem 2.2rem;
  min-width: 0;
  overflow-x: hidden;
}

.asinsa-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.asinsa-page-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  letter-spacing: -.03em;
  font-weight: 700;
}

.asinsa-page-head p { margin: .35rem 0 0; color: var(--muted); max-width: 62ch; }

.asinsa-actions, .form-actions, .asinsa-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}

.asinsa-toolbar { margin-bottom: 1rem; min-width: 0; max-width: 100%; }
.asinsa-toolbar .form-control { max-width: 420px; flex: 1 1 220px; min-width: 0; }

.btn-asinsa, .btn-ghost, .btn-icon {
  border-radius: 12px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  text-decoration: none;
  font-family: inherit;
}

.btn-asinsa {
  background: linear-gradient(135deg, var(--accent-mid), var(--accent));
  color: #fff;
  padding: .62rem 1rem;
  box-shadow: 0 8px 18px rgba(18, 53, 122, .24);
}

.btn-asinsa:hover { color: #fff; transform: translateY(-1px); }

.btn-ghost {
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: .58rem .95rem;
}

.btn-ghost:hover { background: #f6f9fd; color: var(--ink); }

.btn-icon {
  width: 36px;
  height: 36px;
  background: var(--info-soft);
  color: var(--info);
}

.btn-icon.danger { background: var(--danger-soft); color: var(--danger); }
.btn-icon:hover { transform: translateY(-1px); }

.asinsa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.asinsa-kpi {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: .65rem;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.asinsa-kpi .label {
  grid-column: 1;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.asinsa-kpi .value {
  grid-column: 1 / -1;
  margin-top: .4rem;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}

.asinsa-kpi .meta { grid-column: 1 / -1; margin-top: .45rem; color: var(--slate); font-size: .82rem; }
.asinsa-kpi .icon {
  grid-column: 2;
  grid-row: 1;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.asinsa-kpi.ok .icon { background: var(--ok-soft); color: var(--ok); }
.asinsa-kpi.warn .icon { background: var(--warn-soft); color: var(--warn); }
.asinsa-kpi.info .icon { background: var(--info-soft); color: var(--info); }

.asinsa-grid-2 {
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 1rem;
}

.asinsa-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.asinsa-panel-head, .asinsa-panel-body { padding: 1rem 1.15rem; }
.asinsa-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfe, #f5f8fc);
}
.asinsa-panel-head h3 { margin: 0; font-size: 1.02rem; font-weight: 700; }

.person-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 0;
  border-bottom: 1px solid #eef3f8;
}
.person-row:last-child { border-bottom: 0; }
.person-row div { min-width: 0; flex: 1; }
.person-row strong, .person-row span { display: block; }
.person-row span { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; }

.detail-list { margin: 0; }
.detail-list div { padding: .55rem 0; border-bottom: 1px solid #eef3f8; }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.detail-list dd { margin: .15rem 0 0; font-weight: 600; }
.detail-list-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}

.asinsa-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .18rem .55rem;
  font-size: .75rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}
.asinsa-badge.ok { background: var(--ok-soft); color: var(--ok); }
.asinsa-badge.danger { background: var(--danger-soft); color: var(--danger); }
.asinsa-badge.info { background: var(--info-soft); color: var(--info); }
.asinsa-badge.muted { background: #eef2f7; color: var(--slate); }

.asinsa-alert {
  border-radius: 12px;
  padding: .75rem .9rem;
  margin-bottom: 1rem;
  font-weight: 600;
}
.asinsa-alert.ok { background: var(--ok-soft); color: var(--ok); }
.asinsa-alert.danger { background: var(--danger-soft); color: var(--danger); }

.asinsa-list-wrap { width: 100%; min-width: 0; }

.asinsa-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  table-layout: fixed;
}

.asinsa-table th {
  background: #f5f8fc;
  color: var(--slate);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .75rem .7rem;
  text-align: left;
}

.asinsa-table td {
  padding: .7rem;
  border-top: 1px solid #eef3f8;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asinsa-table th:nth-child(1), .asinsa-table td:nth-child(1) { width: 24%; }
.asinsa-table th:nth-child(2), .asinsa-table td:nth-child(2) { width: 26%; }
.asinsa-table th:nth-child(6), .asinsa-table td:nth-child(6) { width: 132px; overflow: visible; }

.asinsa-table tr:hover td { background: #f8fbfe; }
.cell-primary strong { margin-right: .35rem; }
.empty-cell { text-align: center; color: var(--muted); padding: 1.4rem !important; white-space: normal; }

.row-actions { display: inline-flex; gap: .3rem; align-items: center; }
.row-actions form { margin: 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1rem;
}

.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
.field-error { color: var(--danger); font-weight: 600; }
.check-field { justify-content: flex-end; }
.check-line {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: .35rem 0 .2rem;
}
.check-line input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }

.form-control, select.form-control {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 46px;
  padding: .55rem .8rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.form-control:focus {
  outline: none;
  border-color: #8eaddf;
  box-shadow: 0 0 0 4px rgba(18, 53, 122, .12);
}
.form-actions { margin-top: 1.15rem; }

.asinsa-pager { margin-top: 1rem; }
.asinsa-pager .pagination { flex-wrap: wrap; gap: .25rem; margin: 0; }
.asinsa-pager .page-link {
  border-radius: 10px;
  color: var(--ink-soft);
  border-color: var(--line);
}
.asinsa-pager .page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
}

.asinsa-overlay { display: none; }

.asinsa-shell.sidebar-collapsed { --sidebar: var(--sidebar-collapsed); }
.asinsa-shell.sidebar-collapsed .asinsa-nav-label,
.asinsa-shell.sidebar-collapsed .nav-text,
.asinsa-shell.sidebar-collapsed .asinsa-brand-logo { display: none; }
.asinsa-shell.sidebar-collapsed .asinsa-brand-mark { display: inline-flex; }
.asinsa-shell.sidebar-collapsed .asinsa-sidebar-brand,
.asinsa-shell.sidebar-collapsed .asinsa-nav-link,
.asinsa-shell.sidebar-collapsed .asinsa-logout {
  justify-content: center;
  padding-left: .45rem;
  padding-right: .45rem;
}
.asinsa-shell.sidebar-collapsed .asinsa-sidebar-brand { flex-direction: column; gap: .45rem; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}

.login-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 8vw;
  background:
    radial-gradient(500px 280px at 20% 20%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(160deg, #1d4e9b 0%, #12357a 48%, #0b214d 100%);
  color: #fff;
}

.login-visual img {
  width: min(420px, 100%);
  height: auto;
  background: #fff;
  border-radius: 18px;
  padding: .8rem 1rem;
  margin-bottom: 1.4rem;
}

.login-visual h2 { margin: 0 0 .5rem; font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -.03em; }
.login-visual p { margin: 0; max-width: 38ch; color: rgba(255,255,255,.86); font-size: 1.05rem; }

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 8vw;
  background: rgba(255,255,255,.72);
}

.login-panel h1 { margin: 0; font-size: 1.8rem; letter-spacing: -.03em; }
.login-lead { color: var(--muted); margin: .4rem 0 1.2rem; }
.login-panel .field { margin-bottom: .9rem; }
.login-panel .btn-asinsa { width: 100%; min-height: 48px; margin-top: .4rem; }

.error-card {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.2rem;
  gap: .6rem;
}
.error-card img { height: 64px; width: auto; background: #fff; border-radius: 12px; padding: .4rem .6rem; }
.error-card h1 { margin: .4rem 0 0; }
.error-card p { color: var(--muted); max-width: 36ch; }

@media (max-width: 1100px) {
  .asinsa-kpi-grid { grid-template-columns: 1fr 1fr; }
  .asinsa-grid-2, .detail-list-wide { grid-template-columns: 1fr; }

  html, body.asinsa-body, .asinsa-shell, .asinsa-main, .asinsa-content { overflow-x: hidden; max-width: 100%; }

  .asinsa-table.asinsa-card-table,
  .asinsa-table.asinsa-card-table tbody,
  .asinsa-table.asinsa-card-table tr,
  .asinsa-table.asinsa-card-table td { display: block; width: 100%; }

  .asinsa-table.asinsa-card-table {
    background: transparent;
    border: 0;
    box-shadow: none;
    table-layout: auto;
  }
  .asinsa-table.asinsa-card-table thead { display: none; }
  .asinsa-table.asinsa-card-table tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: .85rem;
    padding: .85rem .95rem .7rem;
  }
  .asinsa-table.asinsa-card-table td {
    border: 0;
    border-bottom: 1px dashed #e4edf6;
    padding: .55rem 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    max-width: none;
  }
  .asinsa-table.asinsa-card-table td:last-child { border-bottom: 0; }
  .asinsa-table.asinsa-card-table td::before {
    content: attr(data-label);
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .15rem;
  }
  .asinsa-table.asinsa-card-table td[data-label=""]::before,
  .asinsa-table.asinsa-card-table td.cell-primary::before { display: none; }
  .asinsa-table.asinsa-card-table td.cell-primary { font-size: 1.05rem; border-bottom: 0; padding-bottom: .2rem; }
  .asinsa-table.asinsa-card-table td.cell-actions .row-actions { display: flex; flex-wrap: wrap; }
  .asinsa-table.asinsa-card-table .btn-icon { width: 44px; height: 44px; }
  .asinsa-page-head { flex-direction: column; align-items: stretch; }
  .asinsa-page-head .btn-asinsa, .asinsa-page-head .btn-ghost { justify-content: center; }
}

@media (max-width: 900px) {
  .asinsa-menu-toggle { display: inline-flex; }
  .asinsa-collapse-btn { display: none; }
  .asinsa-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(86vw, 300px);
    transform: translateX(-105%);
    height: 100vh;
  }
  .asinsa-shell.sidebar-open .asinsa-sidebar { transform: translateX(0); }
  .asinsa-shell.sidebar-open .asinsa-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 32, 63, .42);
    z-index: 1035;
  }
  .asinsa-shell.sidebar-collapsed .asinsa-brand-logo,
  .asinsa-shell.sidebar-collapsed .nav-text,
  .asinsa-shell.sidebar-collapsed .asinsa-nav-label { display: initial; }
  .asinsa-shell.sidebar-collapsed .asinsa-brand-mark { display: none; }
  .asinsa-shell.sidebar-collapsed .asinsa-nav-link,
  .asinsa-shell.sidebar-collapsed .asinsa-sidebar-brand { justify-content: space-between; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { padding: 1.6rem 1.2rem 1.3rem; min-height: auto; }
  .login-visual h2 { font-size: 1.55rem; }
  .login-visual p { font-size: .95rem; }
  .login-visual img { width: min(280px, 100%); margin-bottom: .9rem; }
  .login-panel { padding: 1.4rem 1.15rem 2rem; }
}

@media (max-width: 640px) {
  .asinsa-content { padding: 1rem .9rem 1.6rem; }
  .asinsa-kpi-grid, .form-grid { grid-template-columns: 1fr; }
  .asinsa-user-chip .meta-text, .asinsa-topbar-sub { display: none; }
  .asinsa-user-chip { padding: .25rem; }
  .asinsa-topbar { padding: .75rem .85rem; }
  .asinsa-topbar-title { font-size: 1rem; }
  .asinsa-toolbar { flex-direction: column; align-items: stretch; }
  .asinsa-toolbar .form-control,
  .asinsa-toolbar .btn-ghost,
  .form-actions .btn-asinsa,
  .form-actions .btn-ghost {
    width: 100%;
    max-width: 100%;
    flex: none;
    min-width: 0;
  }
  .check-field { justify-content: flex-start; }
  .asinsa-table.asinsa-card-table td { overflow-wrap: anywhere; }
}

/* Depósitos, correo e IA */
.asinsa-topbar-right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.asinsa-credit-chip {
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: .3rem .9rem .3rem .35rem;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
}
.asinsa-credit-chip:hover { border-color: #c5d4ee; color: var(--ink); }
.asinsa-credit-chip > i {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-soft);
  color: var(--ok);
}
.asinsa-credit-chip.is-mid > i { background: var(--warn-soft); color: var(--warn); }
.asinsa-credit-chip.is-low > i { background: var(--danger-soft); color: var(--danger); }
.asinsa-credit-chip.is-off > i { background: #eef2f7; color: var(--muted); }
.asinsa-credit-chip .meta-text { display: flex; flex-direction: column; line-height: 1.15; }
.asinsa-credit-chip .label { font-size: .72rem; color: var(--muted); }
.asinsa-credit-chip .amount { font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.asinsa-alert.info { background: var(--info-soft); color: var(--info); }
.asinsa-badge.warn { background: var(--warn-soft); color: var(--warn); }
.field-help { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.asinsa-kpi .value.value-sm { font-size: 1.45rem; }

.credit-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.15rem; }
.credit-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.15rem 1rem;
  overflow: hidden;
}
.credit-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--ok); }
.credit-card.is-mid::before { background: var(--warn); }
.credit-card.is-low::before { background: var(--danger); }
.credit-card.is-off::before { background: var(--line); }
.credit-kicker { margin: 0 0 .35rem; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.credit-kicker i { color: var(--accent); margin-right: .2rem; }
.credit-big { margin: 0 0 .45rem; font-size: 1.9rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.credit-line { margin: 0 0 .25rem; font-size: .92rem; color: var(--ink-soft); }
.credit-note { margin: .55rem 0 0; font-size: .82rem; color: var(--muted); line-height: 1.45; }

.mailbox-card { margin-bottom: 1rem; }
.mailbox-card h3 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.mailbox-sub { display: block; color: var(--muted); font-size: .84rem; margin-top: .15rem; overflow-wrap: anywhere; }
.mailbox-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.mailbox-stats div { background: #f7f9fc; border: 1px solid #edf2f8; border-radius: var(--radius-sm); padding: .6rem .75rem; }
.mailbox-stats dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.mailbox-stats dd { margin: .15rem 0 0; font-weight: 700; }
.mailbox-error { white-space: pre-line; font-weight: 500; font-size: .88rem; }
.mailbox-run { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mailbox-run-form { margin: 0; background: #fbfcfe; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: .8rem .9rem; }
.inline-input { display: flex; gap: .5rem; }
.inline-input .form-control { max-width: 110px; }
.inline-input button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2rem; color: var(--accent); }

.table-scroll { width: 100%; overflow-x: auto; }
.asinsa-table.plain-table { border: 0; border-radius: 0; box-shadow: none; table-layout: auto; min-width: 720px; }
.asinsa-table.plain-table th, .asinsa-table.plain-table td { width: auto !important; }
.asinsa-table.plain-table td.wrap-cell { white-space: normal; min-width: 180px; }
.asinsa-panel-body.p-0 { padding: 0; }
.asinsa-panel-head .form-control-sm { min-height: 38px; padding: .35rem .6rem; font-size: .88rem; }

.filter-panel { padding: 1rem 1.15rem; margin-bottom: 1rem; overflow: visible; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; }
.filter-grid .filter-wide { grid-column: span 2; }
.filter-actions { margin-top: .9rem; }

.deposit-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 300px)); gap: 1rem; margin-bottom: 1rem; }
.deposit-table th:nth-child(1), .deposit-table td:nth-child(1) { width: 124px; }
.deposit-table td:nth-child(1) strong { white-space: nowrap; }
.deposit-table th:nth-child(2), .deposit-table td:nth-child(2) { width: auto; }
.deposit-table th:nth-child(3), .deposit-table td:nth-child(3) { width: 110px; }
.deposit-table th:nth-child(4), .deposit-table td:nth-child(4) { width: 130px; }
.deposit-table th:nth-child(5), .deposit-table td:nth-child(5) { width: 17%; }
.deposit-table th:nth-child(6), .deposit-table td:nth-child(6) { width: 22%; overflow: hidden; }
.deposit-table th:nth-child(7), .deposit-table td:nth-child(7) { width: 100px; overflow: visible; }
.deposit-table td { white-space: normal; }
.deposit-table td small { overflow: hidden; text-overflow: ellipsis; }
.amount-cell { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap !important; }
.dept-chip {
  display: inline-block;
  border-radius: 8px;
  padding: .15rem .5rem;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.mail-modal .modal-content { border: 0; border-radius: var(--radius); overflow: hidden; }
.mail-modal .modal-header { background: linear-gradient(180deg, #fbfcfe, #f5f8fc); border-bottom: 1px solid var(--line); }
.mail-modal .modal-title { font-weight: 700; font-size: 1.05rem; }
.mail-modal .modal-title i { color: var(--accent); }
.mail-view { display: flex; flex-direction: column; gap: 1rem; }
.mail-view h6 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 .5rem; }
.mail-deposit-grid { display: grid; gap: .75rem; }
.mail-deposit { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .85rem .95rem; background: #fff; }
.mail-deposit.is-active { border-color: var(--accent-mid); box-shadow: 0 0 0 3px rgba(47, 92, 184, .14); }
.mail-deposit-main { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: .75rem; }
.mail-deposit-main strong { display: block; font-size: 1.02rem; overflow-wrap: anywhere; }
.mini-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.mail-deposit-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .35rem 1rem; margin: .75rem 0 0; padding-top: .65rem; border-top: 1px dashed #e4edf6; }
.mail-deposit-more dt { font-size: .7rem; color: var(--muted); font-weight: 700; }
.mail-deposit-more dd { margin: 0; font-size: .88rem; overflow-wrap: anywhere; }
.mail-note { margin: .6rem 0 0; font-size: .85rem; color: var(--slate); }
.mail-note i { color: var(--accent); margin-right: .25rem; }
.mail-headers { border-top: 1px solid var(--line); padding-top: .9rem; }
.mail-headers h4 { font-size: 1.1rem; font-weight: 700; margin: 0 0 .5rem; overflow-wrap: anywhere; }
.mail-headers dl { margin: 0 0 .65rem; display: grid; gap: .2rem; }
.mail-headers dl div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: .5rem; font-size: .9rem; }
.mail-headers dt { color: var(--muted); font-weight: 700; }
.mail-headers dd { margin: 0; overflow-wrap: anywhere; }
.btn-sm-ghost { padding: .35rem .7rem; font-size: .85rem; }
.mail-attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; }
.mail-attachment {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .5rem;
  color: var(--ink);
  background: #fff;
  min-width: 0;
}
.mail-attachment:hover { border-color: #c5d4ee; background: #f8fbfe; color: var(--ink); }
.mail-attachment img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; background: #f3f6fb; }
.mail-attachment-icon { height: 110px; display: grid; place-items: center; font-size: 2.4rem; color: var(--accent); background: var(--accent-soft); border-radius: 8px; }
.mail-attachment-name { font-size: .82rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-attachment small { color: var(--muted); font-size: .74rem; }
.mail-body iframe { width: 100%; height: 60vh; min-height: 360px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }

@media (max-width: 1100px) {
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mailbox-stats { grid-template-columns: 1fr 1fr; }
  .asinsa-table.asinsa-card-table.deposit-table td { width: 100% !important; }
  .asinsa-table.asinsa-card-table.deposit-table td.amount-cell { font-size: 1.15rem; text-align: left !important; }
}

@media (max-width: 640px) {
  .filter-grid, .mailbox-run { grid-template-columns: 1fr; }
  .filter-grid .filter-wide { grid-column: auto; }
  .mail-deposit-main { grid-template-columns: 1fr 1fr; }
  .asinsa-panel-head { flex-direction: column; align-items: stretch; }
  .inline-input .form-control { max-width: 90px; }
  .asinsa-credit-chip { padding: .25rem .6rem .25rem .25rem; }
  .asinsa-credit-chip .label { display: none; }
}
