:root {
  --navy: #0d2346;
  --navy-2: #17365f;
  --blue: #1769d2;
  --blue-soft: #eaf3ff;
  --gold: #d4b16a;
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #dce4ef;
  --text: #14213a;
  --muted: #65738a;
  --green: #167343;
  --green-soft: #dcf5e7;
  --red: #b42318;
  --red-soft: #fee8e6;
  --amber: #8a5300;
  --amber-soft: #fff1d5;
  --shadow: 0 14px 38px rgba(26, 45, 75, .09);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }

.nav-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.office-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(205, 216, 231, .88);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 7px 24px rgba(18, 42, 74, .055);
  backdrop-filter: blur(14px);
}
.office-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 1540px;
  min-height: 78px;
  margin: auto;
  padding: 10px 24px;
  gap: 16px;
}
.office-brand { flex: 0 0 auto; display: inline-flex; align-items: center; border-radius: 12px; }
.office-brand:focus-visible, .office-nav a:focus-visible, .nav-dropdown > summary:focus-visible, .link-button:focus-visible { outline: 3px solid rgba(23, 105, 210, .25); outline-offset: 3px; }
.office-logo { width: 174px; height: 52px; object-fit: contain; object-position: left center; }
.office-nav svg, .office-user svg { width: 20px; height: 20px; fill: currentColor; }
.office-nav { display: flex; align-items: center; gap: 3px; min-width: 0; margin: 0 auto; }
.office-nav__link, .nav-dropdown > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 11px;
  color: #53647b;
  font-size: 12px;
  font-weight: 780;
  line-height: 1.05;
  text-decoration: none;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.office-nav__link svg, .nav-dropdown > summary > svg { flex: 0 0 18px; width: 18px; height: 18px; }
.office-nav__link:hover, .office-nav__link[aria-current="page"], .nav-dropdown > summary:hover, .nav-dropdown[open] > summary, .nav-dropdown.is-active > summary { color: #0d5db8; background: #eaf3ff; }
.office-nav__link:hover, .nav-dropdown > summary:hover { transform: translateY(-1px); }
.office-nav__link[aria-current="page"] { box-shadow: inset 0 -2px 0 #1769d2; }
.nav-dropdown { position: relative; }
.nav-dropdown > summary, .nav-submenu > summary { list-style: none; cursor: pointer; }
.nav-dropdown > summary::-webkit-details-marker, .nav-submenu > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::after { content: ""; width: 6px; height: 6px; margin: -3px 1px 0 2px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(45deg); transition: transform .16s ease; }
.nav-dropdown[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.nav-dropdown__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  width: 370px;
  padding: 10px;
  border: 1px solid #d8e2ee;
  border-radius: 18px;
  background: white;
  box-shadow: 0 24px 70px rgba(18, 42, 74, .18);
}
.nav-admin__panel::before { content: ""; position: absolute; top: -6px; right: 34px; width: 11px; height: 11px; border-top: 1px solid #d8e2ee; border-left: 1px solid #d8e2ee; background: white; transform: rotate(45deg); }
.nav-admin__heading { padding: 7px 9px 12px; border-bottom: 1px solid #edf1f6; margin-bottom: 5px; }
.nav-admin__heading strong, .nav-admin__heading small { display: block; }
.nav-admin__heading strong { color: var(--navy); font-size: 14px; }
.nav-admin__heading small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.nav-dropdown__panel > a, .nav-submenu > summary { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; color: var(--text); text-decoration: none; transition: background .15s ease; }
.nav-dropdown__panel > a:hover, .nav-dropdown__panel > a[aria-current="page"], .nav-submenu > summary:hover, .nav-submenu[open] > summary { background: #f0f6fd; }
.nav-dropdown__panel strong, .nav-dropdown__panel small { display: block; }
.nav-dropdown__panel strong { font-size: 13px; }
.nav-dropdown__panel small { margin-top: 2px; color: var(--muted); font-size: 10.5px; font-weight: 550; }
.nav-admin__icon { flex: 0 0 36px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #1769d2; background: #eaf3ff; }
.nav-admin__icon svg { width: 18px; height: 18px; }
.nav-submenu > summary::after { content: ""; width: 6px; height: 6px; margin-left: auto; border-right: 1.7px solid #738198; border-bottom: 1.7px solid #738198; transform: rotate(45deg); }
.nav-submenu[open] > summary::after { transform: rotate(225deg); }
.nav-submenu__links { margin: 2px 9px 6px 57px; padding: 4px 0 4px 11px; border-left: 2px solid #dceafb; }
.nav-submenu__links a { display: block; padding: 8px 10px; border-radius: 8px; color: #5b6a80; font-size: 11.5px; font-weight: 700; text-decoration: none; }
.nav-submenu__links a:hover, .nav-submenu__links a[aria-current="page"] { color: #0d5db8; background: #f0f6fd; }
.office-user { flex: 0 0 auto; display: grid; grid-template-columns: 34px minmax(0, auto) 36px; align-items: center; gap: 9px; padding-left: 13px; border-left: 1px solid var(--line); color: var(--muted); }
.office-user__avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: white; background: linear-gradient(145deg, #0d2346, #1769d2); font-size: 13px; font-weight: 900; box-shadow: 0 5px 14px rgba(23, 105, 210, .2); }
.office-user__identity { max-width: 150px; }
.office-user__identity strong, .office-user__identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-user__identity strong { color: var(--text); font-size: 12px; }
.office-user__identity small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.office-user form { margin: 0; }
.link-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 11px; color: #a92b23; background: #fff0ef; cursor: pointer; transition: color .16s ease, background .16s ease, transform .16s ease; }
.link-button:hover { color: #8f1f18; background: #ffe3e1; transform: translateY(-1px); }

.office-main { max-width: 1440px; margin: 0 auto; padding: 32px 30px 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { color: var(--blue); text-transform: uppercase; letter-spacing: .09em; font-weight: 900; font-size: 13px; margin: 0 0 8px; }
h1 { font-size: 36px; line-height: 1.1; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.toolbar { display: flex; align-items: flex-end; gap: 14px; }
.toolbar .field { min-width: 210px; }
.field label { display: block; font-weight: 800; color: var(--navy-2); margin: 0 0 7px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #bbc8d9; border-radius: 10px; padding: 12px 13px; background: white; color: var(--text); }
.field textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.full { grid-column: 1 / -1; }
.field-errors, .errorlist { color: var(--red); font-weight: 700; margin: 6px 0 0; }

.btn { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 11px; padding: 13px 19px; font-weight: 900; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--blue); color: white; }
.btn-secondary { background: #50657f; color: white; }
.btn-soft { background: var(--blue-soft); color: var(--blue); }
.btn:hover { filter: brightness(.97); transform: translateY(-1px); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 19px; box-shadow: 0 8px 24px rgba(26, 45, 75, .06); }
.metric span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.metric strong { display: block; font-size: 26px; line-height: 1.05; }
.metric small { display: block; color: var(--muted); margin-top: 7px; }

.notice { border-radius: 12px; padding: 14px 16px; margin: 16px 0; border: 1px solid transparent; }
.notice strong { font-weight: 900; }
.notice-info { color: #14506a; background: #e5f6fc; border-color: #b9e2ef; }
.notice-warning { color: var(--amber); background: var(--amber-soft); border-color: #f1d18a; }
.notice-danger { color: var(--red); background: var(--red-soft); border-color: #f3bbb6; }
.notice-success { color: var(--green); background: var(--green-soft); border-color: #b7e5ca; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
td { padding: 15px 12px; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
.table-wrap td > strong, .table-wrap td > small { display: block; }
.table-wrap td > small { color: var(--muted); margin-top: 4px; }
tr:last-child td { border-bottom: 0; }
.money, .number { text-align: right; white-space: nowrap; }
.person { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: white; display: grid; place-items: center; font-weight: 900; }
.person strong { display: block; }
.person small { color: var(--muted); }
.badge { display: inline-block; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 900; }
.badge-pending { background: var(--amber-soft); color: var(--amber); }
.badge-ok { background: var(--green-soft); color: var(--green); }
.progress { width: 130px; height: 8px; border-radius: 999px; overflow: hidden; background: #e6ebf2; margin-top: 6px; }
.progress span { display: block; height: 100%; width: var(--progress); background: var(--blue); }

.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.status-line { border-radius: 12px; font-weight: 900; padding: 14px 16px; margin-top: 16px; }
.status-ok { background: var(--green-soft); color: var(--green); }
.status-bad { background: var(--red-soft); color: var(--red); }
.status-warn { background: var(--amber-soft); color: var(--amber); }

.report-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.report-card { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.report-card:hover { border-color: #a9c9ef; transform: translateY(-2px); }
.report-card span { color: var(--blue); text-transform: uppercase; letter-spacing: .07em; font-size: 12px; font-weight: 900; }

.supervision-search { min-width: 330px; flex: 1; }
.supervision-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.detail-list { display: grid; grid-template-columns: 170px 1fr; gap: 0; margin: 0; }
.detail-list dt, .detail-list dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-weight: 800; }
.detail-list dd { font-weight: 700; }
.data-box { white-space: pre-wrap; overflow-wrap: anywhere; background: #f3f6fa; border: 1px solid var(--line); border-radius: 12px; padding: 18px; max-height: 420px; overflow: auto; }
.trace-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.trace-row small { grid-column: 1 / -1; color: var(--muted); }
.manager-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
.manager-card { border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: #fbfcfe; display: grid; grid-template-columns: minmax(310px, 1.4fr) minmax(460px, 2fr) 200px; align-items: center; gap: 24px; }
.manager-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.manager-stats span { padding: 10px; border-radius: 10px; background: white; color: var(--muted); font-size: 12px; }
.manager-stats strong { display: block; color: var(--text); font-size: 20px; }
.progress.wide { width: 100%; grid-column: 1 / 3; }
.manager-card > .btn { grid-column: 3; grid-row: 1 / 3; }
.correction-card { border-left: 5px solid var(--amber); }
.btn-danger { color: #fff; background: var(--red); }
@media (max-width: 800px) { .supervision-grid { grid-template-columns: 1fr; } .detail-list { grid-template-columns: 1fr; } .detail-list dt { padding-bottom: 2px; border: 0; } .detail-list dd { padding-top: 2px; } }

/* Expedientes integrales: vistas consolidadas, sin almacenamiento propio. */
.expediente-hero { gap: 1.5rem; align-items: flex-start; }
.expediente-meta { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .85rem; }
.expediente-meta span { padding: .42rem .7rem; border: 1px solid #dbe5ea; border-radius: 999px; background: #f7fafc; color: #486174; font-size: .8rem; font-weight: 700; }
.expediente-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }
.expediente-tabs { position: sticky; top: 82px; z-index: 8; margin-bottom: 1rem; padding: .55rem; border: 1px solid #dbe5ea; border-radius: 1rem; background: rgba(255,255,255,.96); box-shadow: 0 12px 30px rgba(18,59,87,.08); backdrop-filter: blur(10px); }
.expediente-tabs button { flex: 1 1 auto; min-height: 44px; white-space: nowrap; }
.expediente-panels .record-panel { min-height: 380px; padding: clamp(1rem, 2.2vw, 1.65rem); box-shadow: 0 14px 34px rgba(18,59,87,.07); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.panel-title h2 { margin: .2rem 0 0; }
.detail-list-modern { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.detail-list-modern div { display: block; padding: .85rem 1rem; border: 1px solid #e0e8ee; border-radius: .75rem; background: #f8fafc; }
.detail-list-modern div.wide { grid-column: 1 / -1; }
.detail-list-modern dt, .detail-list-modern dd { padding: 0; border: 0; }
.detail-list-modern dt { margin-bottom: .3rem; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.status-pill { display: inline-flex; padding: .25rem .55rem; border-radius: 999px; background: #e7f6ee; color: #087443; font-size: .76rem; }
.client-profile-layout { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.client-profile-photo-card { overflow: hidden; padding: 1rem; border: 1px solid #d9e4ed; border-radius: 1rem; background: linear-gradient(145deg, #f6faff, #fff); box-shadow: 0 10px 26px rgba(18,59,87,.07); }
.client-profile-photo-card header { margin-bottom: .8rem; }
.client-profile-photo-card h3 { margin: .2rem 0 0; color: #123b57; }
.client-profile-photo { position: relative; display: block; overflow: hidden; border-radius: .85rem; color: #fff; background: #eaf1f6; text-decoration: none; }
.client-profile-photo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.client-profile-photo span { position: absolute; right: 0; bottom: 0; left: 0; padding: .7rem; background: linear-gradient(transparent, rgba(5,24,43,.88)); font-size: .8rem; font-weight: 800; text-align: center; }
.client-profile-photo-empty { display: grid; min-height: 245px; place-items: center; align-content: center; gap: .45rem; padding: 1.2rem; border: 1px dashed #aebfcd; border-radius: .85rem; color: #536b7d; background: #f8fafc; text-align: center; }
.client-profile-photo-empty > span { font-size: 2rem; }
.client-profile-photo-empty strong { color: #123b57; }
.client-profile-photo-empty small { line-height: 1.4; }
.client-profile-photo-upload { display: grid; gap: .55rem; margin-top: .85rem; }
.client-profile-photo-upload label { color: #607483; font-size: .72rem; font-weight: 800; }
.client-profile-photo-upload input[type="file"] { width: 100%; padding: .55rem; border: 1px solid #d9e4ed; border-radius: .65rem; background: #fff; font-size: .76rem; }
.client-profile-photo-upload .button { width: 100%; }
.expediente-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.expediente-split > div { min-width: 0; padding: 1rem; border: 1px solid #e0e8ee; border-radius: .85rem; }
.source-note { margin: 1rem 0 0; padding: .75rem 1rem; border-left: 4px solid #1f6fdd; background: #eef5ff; color: #486174; font-size: .86rem; }
.gallery-section + .gallery-section { margin-top: 1.5rem; }
.expediente-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .85rem; }
.gallery-card { overflow: hidden; border: 1px solid #dbe5ea; border-radius: .85rem; background: #fff; color: #123b57; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.gallery-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(18,59,87,.13); }
.gallery-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #edf2f6; }
.gallery-card span { display: block; padding: .7rem; font-weight: 750; }
.gallery-card small { display: block; padding: 0 .7rem .7rem; color: #607483; }
.gallery-card .gallery-document { display: grid; min-height: 145px; place-items: center; background: #eef5ff; color: #185daf; }
.gallery-pagination { display: flex; align-items: center; gap: .85rem; margin-top: 1rem; flex-wrap: wrap; }
.gallery-pagination span { color: #607483; }
.empty-state { padding: 2.5rem; border: 1px dashed #b9c8d3; border-radius: .85rem; text-align: center; color: #64748b; }
.expediente-metrics { margin-bottom: 1.2rem; }
.statement-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-bottom: 1.35rem; }
.statement-summary div { padding: .85rem; border: 1px solid #dbe5ea; border-radius: .75rem; background: #f8fafc; }
.statement-summary span, .statement-summary strong { display: block; }
.statement-summary span { color: #64748b; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.statement-summary strong { margin-top: .3rem; color: #123b57; }
.statement-table td { vertical-align: middle; }
.movement-type { display: inline-flex; padding: .28rem .5rem; border-radius: .45rem; background: #eef5ff; color: #185daf; font-weight: 750; }
.movement-pago { background: #e7f6ee; color: #087443; }
.movement-desembolso { background: #fff2d9; color: #915900; }
.statement-plan { margin-top: 1rem; padding: 1rem; border: 1px solid #dbe5ea; border-radius: .8rem; }
.statement-plan summary { cursor: pointer; color: #185daf; font-weight: 800; }
.document-highlight { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1rem; border: 1px solid #bcd7f8; border-radius: .8rem; background: #eef5ff; }
.document-highlight strong, .document-highlight span { display: block; }
.document-highlight span { margin-top: .2rem; color: #486174; }

/* Expediente del préstamo: lectura ejecutiva inspirada en el perfil histórico. */
.loan-file-hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; overflow: hidden; margin-bottom: 1rem; padding: clamp(1.5rem, 3vw, 2.35rem); border-radius: 1.5rem; color: #fff; background: linear-gradient(135deg, #071b37 0%, #103767 62%, #1769d2 145%); box-shadow: 0 22px 48px rgba(7,27,55,.2); }
.loan-file-hero::after { content: ""; position: absolute; top: -65%; right: -8%; width: 390px; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 52px rgba(255,255,255,.035), 0 0 0 108px rgba(255,255,255,.025); pointer-events: none; }
.loan-file-hero__main, .loan-file-hero__actions { position: relative; z-index: 1; }
.loan-file-eyebrow { display: block; margin-bottom: .45rem; color: #8dc5ff; font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.loan-file-number { margin-bottom: .42rem; color: #fff; font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 900; }
.loan-file-hero h1 { max-width: 860px; margin: 0; font-size: clamp(1.65rem, 3.3vw, 2.55rem); line-height: 1.08; }
.loan-file-hero__meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.loan-file-hero__meta > span { padding: .48rem .72rem; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #e6effa; background: rgba(255,255,255,.08); font-size: .78rem; }
.loan-file-hero__meta b { margin-right: .25rem; color: #fff; }
.loan-file-hero__meta .loan-file-status { border-color: rgba(115,235,169,.42); color: #bff7d6; background: rgba(22,141,78,.25); font-weight: 900; }
.loan-file-hero__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .65rem; min-width: 260px; }
.loan-file-button-light { color: #0c315d; background: #fff; }
.loan-file-button-ghost { border: 1px solid rgba(255,255,255,.28); color: #fff; background: rgba(255,255,255,.08); }
.loan-file-metrics { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: .8rem; margin: 0 0 1rem; }
.loan-file-metric { min-width: 0; padding: 1rem 1.05rem; border: 1px solid #dce5ef; border-radius: 1rem; background: #fff; box-shadow: 0 8px 24px rgba(18,59,87,.055); }
.loan-file-metric span, .loan-file-metric strong, .loan-file-metric small { display: block; }
.loan-file-metric > span { color: #6b7c90; font-size: .68rem; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.loan-file-metric strong { overflow-wrap: anywhere; margin-top: .45rem; color: #0b294b; font-size: clamp(1.05rem, 1.65vw, 1.35rem); }
.loan-file-metric small { margin-top: .32rem; color: #718096; font-size: .72rem; }
.loan-file-metric--primary { border-color: #a8c9f1; background: linear-gradient(145deg,#edf6ff,#fff); }
.loan-file-metric--primary strong { color: #0b5fc7; }
.loan-file-metric--status { border-color: #bde2cc; background: #f1fbf5; }
.loan-file-metric--status strong { color: #087443; }
.loan-next-date__item { display: none!important; }
.loan-next-date__item:first-child { display: block!important; }
.loan-next-date:has(.loan-next-date__item) .loan-next-date__empty { display: none; }
.loan-file-tabs { top: 74px; }
.loan-file-tabs button { font-size: .78rem; }
.loan-file-panels .record-panel { border-radius: 1.15rem; }
.loan-file-overview { background: #f8fafc!important; }
.loan-file-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.loan-file-section-heading h2 { margin: 0; color: #0b294b; font-size: clamp(1.25rem,2vw,1.6rem); }
.loan-file-readonly { padding: .42rem .68rem; border-radius: 999px; color: #315e8c; background: #e8f2fd; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.loan-file-dual-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.loan-file-card { padding: 1.15rem; border: 1px solid #dce5ef; border-radius: 1rem; background: #fff; box-shadow: 0 8px 24px rgba(18,59,87,.045); }
.loan-file-card--financial { border-top: 3px solid #1769d2; }
.loan-file-card--client { margin-top: 1rem; }
.loan-file-card__header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; padding-bottom: .85rem; border-bottom: 1px solid #e7edf3; }
.loan-file-card__header > div { min-width: 0; flex: 1; }
.loan-file-card__header small { display: block; margin-bottom: .12rem; color: #6b7c90; font-size: .66rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.loan-file-card__header h3 { margin: 0; color: #113452; font-size: 1rem; }
.loan-file-card__header > a { color: #1769d2; font-size: .78rem; font-weight: 800; text-decoration: none; }
.loan-file-card__icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: .75rem; color: #fff; background: linear-gradient(145deg,#0c315d,#1769d2); font-weight: 900; }
.loan-file-data-grid, .loan-file-client-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; margin: 0; }
.loan-file-data-grid > div, .loan-file-client-grid > div { min-width: 0; padding: .72rem .78rem; border-radius: .7rem; background: #f7f9fc; }
.loan-file-data-grid dt, .loan-file-data-grid dd, .loan-file-client-grid dt, .loan-file-client-grid dd { margin: 0; }
.loan-file-data-grid dt, .loan-file-client-grid dt { margin-bottom: .28rem; color: #738196; font-size: .64rem; font-weight: 900; letter-spacing: .045em; text-transform: uppercase; }
.loan-file-data-grid dd, .loan-file-client-grid dd { color: #122e4a; font-size: .84rem; font-weight: 800; overflow-wrap: anywhere; }
.loan-file-data-grid dd small { display: block; margin-top: .18rem; color: #6b7c90; font-size: .64rem; font-weight: 700; }
.loan-file-data-grid__total { color: #fff; background: #0c315d!important; }
.loan-file-data-grid__total dt { color: #a9c8e8; }
.loan-file-data-grid__total dd { color: #fff; font-size: .98rem; }
.loan-file-client-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.loan-file-client-grid__wide { grid-column: span 2; }
.loan-file-client-grid dd small { display: block; margin-top: .2rem; color: #6b7c90; }
.loan-file-classification { display: inline-flex; padding: .3rem .52rem; border-radius: 999px; color: #087443; background: #e4f7ec; font-size: .74rem; }
.loan-file-actions { margin-top: 1rem; padding: 1.15rem; border: 1px solid #dce5ef; border-radius: 1rem; background: #fff; }
.loan-file-action-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; }
.loan-file-action { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; gap: .14rem .7rem; min-width: 0; padding: .82rem; border: 1px solid #dce5ef; border-radius: .8rem; color: #123452; background: #f8fafc; text-align: left; text-decoration: none; cursor: pointer; font: inherit; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.loan-file-action:hover { border-color: #8bb9ee; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(18,59,87,.08); }
.loan-file-action > span { grid-row: 1/3; display: grid; place-items: center; width: 34px; height: 34px; border-radius: .65rem; color: #1769d2; background: #e8f2fd; font-size: .67rem; font-weight: 900; }
.loan-file-action strong { font-size: .82rem; }
.loan-file-action small { color: #718096; font-size: .68rem; }
.loan-file-action--primary { border-color: #1769d2; color: #fff; background: linear-gradient(145deg,#0d56ae,#1769d2); }
.loan-file-action--primary > span { color: #fff; background: rgba(255,255,255,.16); }
.loan-file-action--primary small { color: #d9eaff; }

@media (max-width: 900px) {
  .expediente-tabs { position: static; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
  .expediente-tabs button { flex: 0 0 auto; }
  .client-profile-layout, .detail-list-modern, .expediente-split, .statement-summary { grid-template-columns: 1fr; }
  .client-profile-photo-card { width: 100%; max-width: 430px; }
  .panel-title, .document-highlight { align-items: flex-start; flex-direction: column; }
  .loan-file-hero { align-items: flex-start; flex-direction: column; }
  .loan-file-hero__actions { justify-content: flex-start; width: 100%; }
  .loan-file-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .loan-file-dual-grid { grid-template-columns: 1fr; }
  .loan-file-client-grid, .loan-file-action-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 560px) {
  .expediente-actions, .expediente-actions .button { width: 100%; }
  .expediente-actions .button { text-align: center; }
  .expediente-gallery { grid-template-columns: 1fr 1fr; }
  .loan-file-hero { padding: 1.2rem; border-radius: 1.15rem; }
  .loan-file-hero__actions .button { width: 100%; text-align: center; }
  .loan-file-metrics, .loan-file-client-grid, .loan-file-action-grid { grid-template-columns: 1fr; }
  .loan-file-client-grid__wide { grid-column: auto; }
  .loan-file-section-heading { flex-direction: column; }
  .loan-file-readonly { white-space: normal; }
}
@media (max-width: 1100px) { .manager-card { grid-template-columns: 1fr; } .manager-card > .btn, .progress.wide { grid-column: auto; grid-row: auto; } }
@media (max-width: 900px) { .manager-stats { grid-template-columns: repeat(2, 1fr); } }
.report-card h2 { margin-top: 10px; }
.report-card p { color: var(--muted); margin-bottom: 0; }

.report-sheet { background: white; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 34px 42px; max-width: 1100px; margin: 0 auto; }
.report-letterhead { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-bottom: 18px; border-bottom: 3px solid var(--navy); }
.report-letterhead img { width: 250px; height: 80px; object-fit: contain; object-position: left center; }
.report-letterhead div { text-align: right; }
.report-letterhead h1 { font-size: 22px; margin: 0; }
.report-letterhead p { color: var(--muted); margin: 5px 0 0; }
.report-meta { display: grid; grid-template-columns: 1fr 2fr 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 18px 0 24px; }
.report-meta div { background: #f8fafc; padding: 10px 12px; }
.report-meta span { display: block; color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 800; margin-bottom: 4px; }
.report-meta strong { font-size: 13px; }
.report-section { margin: 25px 0; break-inside: auto; }
.report-section__title { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; border-bottom: 2px solid var(--navy); padding-bottom: 8px; margin-bottom: 8px; }
.report-section h2 { font-size: 17px; }
.report-section__title > strong { font-size: 13px; white-space: nowrap; }
.report-help { color: var(--muted); font-size: 12px; margin: 8px 0 12px; }
.report-table { font-size: 12px; }
.report-table th { background: #eef2f7; color: var(--text); padding: 8px 9px; }
.report-table td { padding: 8px 9px; }
.report-table tfoot th { border-top: 2px solid var(--navy); border-bottom: 0; }
.empty-row { color: var(--muted); text-align: center; padding: 18px !important; }
.report-summary { border: 1px solid #cfd8e5; }
.report-summary h2 { background: var(--navy); color: white; padding: 10px 13px; }
.report-summary dl { margin: 0; }
.report-summary dl > div { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 8px 13px; border-top: 1px solid #e4e9f0; }
.report-summary dt small { display: block; color: var(--muted); }
.report-summary dd { margin: 0; font-weight: 800; white-space: nowrap; }
.report-summary .report-total { background: #eef2f7; font-weight: 900; border-top: 2px solid var(--navy); }
.signature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 90px; margin: 75px 30px 25px; break-inside: avoid; }
.signature-grid div { text-align: center; }
.signature-grid span { display: block; border-top: 1px solid #222; margin-bottom: 8px; }
.signature-grid strong, .signature-grid small { display: block; }
.signature-grid small { color: var(--muted); margin-top: 4px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: white; }
.login-brand { background: linear-gradient(145deg, var(--navy), #174a88); color: white; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand img { width: min(420px, 90%); background: white; border-radius: 18px; padding: 18px; }
.login-brand h1 { font-size: 48px; max-width: 560px; }
.login-form-wrap { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.login-card { width: min(460px, 100%); background: white; border: 1px solid var(--line); border-radius: 20px; padding: 34px; box-shadow: var(--shadow); }
.login-card .field { margin-top: 18px; }
.login-card .btn { width: 100%; margin-top: 22px; }

/* Centro de control institucional */
.backoffice-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  padding: 34px 38px;
  margin-bottom: 20px;
  border-radius: 22px;
  color: white;
  background: linear-gradient(120deg, #0b2144 0%, #153d73 65%, #1e68b7 100%);
  box-shadow: 0 18px 45px rgba(13, 35, 70, .2);
}
.backoffice-hero::after {
  content: "";
  position: absolute;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  right: -110px;
  top: -175px;
  border: 50px solid rgba(255, 255, 255, .07);
}
.backoffice-hero > * { position: relative; z-index: 1; }
.backoffice-hero .eyebrow { color: #acd4ff; }
.backoffice-hero h1 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 12px; }
.backoffice-hero > div > p:last-child { max-width: 720px; margin: 0; color: #d8e8fb; font-size: 17px; }
.access-card { min-width: 330px; display: flex; align-items: center; gap: 14px; padding: 17px 19px; border: 1px solid rgba(255,255,255,.24); border-radius: 16px; background: rgba(255,255,255,.11); backdrop-filter: blur(8px); }
.access-card__avatar { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; display: grid; place-items: center; background: white; color: var(--navy); font-size: 20px; font-weight: 900; }
.access-card small, .access-card strong, .access-card span { display: block; }
.access-card small { color: #bcd7f5; text-transform: uppercase; font-size: 10px; letter-spacing: .08em; font-weight: 900; }
.access-card strong { margin: 3px 0; }
.access-card div > span { color: #dceafa; font-size: 12px; }

.backoffice-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 30px; }
.backoffice-metrics article { position: relative; overflow: hidden; min-height: 126px; padding: 19px 20px; background: white; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 24px rgba(26,45,75,.055); }
.backoffice-metrics article::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.backoffice-metrics .metric-alert::before { background: var(--red); }
.backoffice-metrics .metric-warning::before { background: #d48a00; }
.backoffice-metrics span, .backoffice-metrics small { display: block; color: var(--muted); }
.backoffice-metrics span { font-size: 12px; font-weight: 800; }
.backoffice-metrics strong { display: block; margin: 8px 0 5px; color: var(--navy); font-size: 31px; line-height: 1; }
.backoffice-metrics small { font-size: 11px; }

.module-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 0 16px; }
.module-heading h2 { font-size: 25px; }
.module-heading p { color: var(--muted); margin: 5px 0 0; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.module-card { --module: var(--blue); background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 28px rgba(26,45,75,.065); overflow: hidden; }
.module-card--violet { --module: #7356b9; }
.module-card--green { --module: #20845c; }
.module-card--orange { --module: #c46a21; }
.module-card--cyan { --module: #197f9a; }
.module-card--navy { --module: #0d2346; }
.module-card__head { display: flex; gap: 15px; align-items: flex-start; padding: 23px 24px 18px; border-top: 4px solid var(--module); }
.module-symbol { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 14px; color: var(--module); background: color-mix(in srgb, var(--module) 11%, white); font-weight: 950; letter-spacing: .04em; }
.module-card__head h2 { font-size: 20px; }
.module-card__head p { color: var(--muted); margin: 6px 0 0; font-size: 13px; line-height: 1.45; }
.module-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #edf1f6; }
.module-actions a { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; text-decoration: none; border-right: 1px solid #edf1f6; border-bottom: 1px solid #edf1f6; transition: background .15s ease, color .15s ease; }
.module-actions a:nth-child(even) { border-right: 0; }
.module-actions a:hover { background: color-mix(in srgb, var(--module) 7%, white); color: var(--module); }
.module-actions strong, .module-actions small { display: block; }
.module-actions strong { font-size: 14px; }
.module-actions small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.module-actions b { color: var(--module); font-size: 20px; }
.superuser-note { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 20px; padding: 20px 22px; background: #edf4fd; border: 1px solid #cadcf2; border-radius: 16px; }
.superuser-note strong, .superuser-note span { display: block; }
.superuser-note strong { color: var(--navy); }
.superuser-note span { color: var(--muted); margin-top: 4px; font-size: 13px; }

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px 34px;
  margin-bottom: 18px;
  border-radius: 22px;
  color: white;
  background: linear-gradient(120deg, #0b2144 0%, #153d73 62%, #1e68b7 100%);
  box-shadow: 0 18px 45px rgba(13, 35, 70, .18);
}
.dashboard-hero h1 { margin: 4px 0 10px; font-size: clamp(31px, 4vw, 47px); }
.dashboard-hero p:last-child { margin: 0; color: #d8e8fb; }
.initial-balance-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  margin-bottom: 18px;
  border: 1px solid #f0b8b2;
  border-left: 6px solid var(--red);
  border-radius: 15px;
  background: #fff2f0;
}
.initial-balance-alert strong, .initial-balance-alert span { display: block; }
.initial-balance-alert strong { color: #8e1d15; font-size: 16px; }
.initial-balance-alert span { margin-top: 4px; color: #76514e; font-size: 13px; }
.initial-balance-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.executive-navigation {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 26px;
}
.executive-navigation a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  color: var(--navy);
  text-decoration: none;
  box-shadow: 0 7px 21px rgba(26, 45, 75, .05);
  transition: transform .15s ease, border-color .15s ease;
}
.executive-navigation a:hover { transform: translateY(-2px); border-color: #8bb7ea; }
.executive-navigation__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eaf3ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}
.executive-navigation strong, .executive-navigation small { display: block; }
.executive-navigation small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.dashboard-section { margin: 0 0 25px; scroll-margin-top: 100px; }
.dashboard-section__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}
.dashboard-section__heading h2 { margin: 3px 0 0; font-size: 25px; }
.dashboard-state { padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 850; }
.dashboard-state--ok { color: #176a45; background: #e7f7ee; }
.dashboard-state--warning { color: #986000; background: #fff3d8; }
.dashboard-generated { color: var(--muted); font-size: 12px; }
.dashboard-filters {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(190px, 1fr) minmax(190px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 13px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.dashboard-filters label { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.dashboard-filters input, .dashboard-filters select {
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid #cbd6e3;
  border-radius: 9px;
  background: white;
}
.executive-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.executive-kpi {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 24px rgba(26, 45, 75, .055);
}
.executive-kpi--primary { color: white; border: 0; background: linear-gradient(135deg, #0c4da2, #1678e8); }
.executive-kpi--danger { border-top-color: var(--red); }
.executive-kpi span, .executive-kpi strong, .executive-kpi small { display: block; }
.executive-kpi span { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.executive-kpi strong { margin: 9px 0 6px; font-size: clamp(25px, 3vw, 34px); line-height: 1; }
.executive-kpi small { color: var(--muted); font-size: 12px; }
.executive-kpi--primary span, .executive-kpi--primary small { color: rgba(255,255,255,.8); }
.executive-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr); gap: 15px; align-items: start; }
.dashboard-panel {
  padding: 16px;
  margin-bottom: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 24px rgba(26, 45, 75, .05);
}
.dashboard-panel__heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.dashboard-panel__heading h3 { margin: 0; font-size: 17px; }
.dashboard-panel__heading span { color: var(--muted); font-size: 11px; }
.responsive-table { overflow-x: auto; }
.responsive-table table { width: 100%; border-collapse: collapse; }
.responsive-table th, .responsive-table td { padding: 10px 8px; border-bottom: 1px solid #edf1f6; text-align: right; font-size: 12px; }
.responsive-table th:first-child, .responsive-table td:first-child { text-align: left; }
.responsive-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.table-empty { padding: 20px !important; color: var(--muted); text-align: center !important; }
.closing-status { display: flex; justify-content: space-between; gap: 12px; padding: 13px; border-radius: 11px; background: #eaf3ff; }
.closing-status span { color: var(--muted); }
.closing-status strong { color: var(--blue); }
.closing-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 9px; }
.closing-summary div { padding: 11px; border: 1px solid var(--line); border-radius: 11px; }
.closing-summary span, .closing-summary strong { display: block; }
.closing-summary span { color: var(--muted); font-size: 10px; text-transform: uppercase; font-weight: 800; }
.closing-summary strong { margin-top: 5px; font-size: 18px; }
.executive-alert { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf1f6; }
.executive-alert:last-child { border-bottom: 0; }
.executive-alert strong, .executive-alert span { display: block; }
.executive-alert strong { font-size: 13px; }
.executive-alert span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.executive-alert b { min-width: 27px; height: 27px; display: grid; place-items: center; border-radius: 999px; color: #925b00; background: #fff1d1; font-size: 11px; }
.executive-alert--critica b { color: #971b12; background: #ffe3df; }

@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .backoffice-metrics { grid-template-columns: repeat(3, 1fr); }
  .executive-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .executive-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .office-main { padding: 22px 14px 50px; }
  .office-header__inner { padding: 10px 14px; }
  .office-logo { width: 155px; height: 46px; }
  .office-user { padding-left: 9px; }
  .page-heading, .toolbar { align-items: stretch; flex-direction: column; }
  .metrics, .summary-grid, .form-grid { grid-template-columns: 1fr; }
  .report-catalog, .report-meta { grid-template-columns: 1fr; }
  .report-sheet { padding: 20px 15px; }
  .report-letterhead { align-items: flex-start; flex-direction: column; }
  .report-letterhead div { text-align: left; }
  .signature-grid { gap: 25px; margin-left: 0; margin-right: 0; }
  .full { grid-column: auto; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form-wrap { padding: 20px; }
  .backoffice-hero { align-items: flex-start; flex-direction: column; padding: 28px 24px; }
  .access-card { width: 100%; min-width: 0; }
  .backoffice-metrics, .module-grid { grid-template-columns: 1fr; }
  .dashboard-hero, .initial-balance-alert, .dashboard-section__heading { align-items: flex-start; flex-direction: column; }
  .executive-navigation, .executive-kpis, .dashboard-filters { grid-template-columns: 1fr; }
  .initial-balance-actions, .initial-balance-actions .btn { width: 100%; }
  .module-actions { grid-template-columns: 1fr; }
  .module-actions a { border-right: 0; }
  .module-heading, .superuser-note { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 1080px) {
  .office-header__inner { flex-wrap: wrap; }
  .office-nav { order: 3; width: 100%; }
}
@media (max-width: 560px) {
  .office-header__inner { min-height: 68px; gap: 8px; }
  .office-logo { width: 138px; height: 43px; }
  .office-user { grid-template-columns: 32px 34px; gap: 6px; border-left: 0; }
  .office-user__avatar { width: 32px; height: 32px; border-radius: 10px; }
  .office-user__identity { display: none; }
  .link-button { width: 34px; height: 34px; }
}

.consultation-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.consultation-metrics article {
  padding: 1rem 1.1rem;
  border: 1px solid #dbe5ea;
  border-radius: .8rem;
  background: #fff;
}
.consultation-metrics span { display: block; color: #64748b; font-size: .78rem; font-weight: 750; text-transform: uppercase; }
.consultation-metrics strong { display: block; margin-top: .35rem; color: #123b57; font-size: 1.35rem; }
.consultation-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: .85rem;
  align-items: end;
  margin-bottom: 1rem;
}
.consultation-filters label { display: grid; gap: .35rem; }
.consultation-filters label span { color: #52616b; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.consultation-filters input, .consultation-filters select {
  width: 100%; box-sizing: border-box; padding: .7rem .75rem;
  border: 1px solid #cbd5e1; border-radius: .55rem; background: #fff; font: inherit;
}
.consultation-table { min-width: 1000px; }
.category-tabs, .record-tabs {
  display: flex; gap: .45rem; overflow-x: auto; padding: .35rem 0 1rem;
}
.category-tabs a, .record-tabs button {
  flex: 0 0 auto; padding: .62rem .85rem; border: 1px solid #cbd5e1;
  border-radius: 999px; background: #fff; color: #334155;
  font: inherit; font-size: .82rem; font-weight: 800; text-decoration: none; cursor: pointer;
}
.category-tabs a.active, .record-tabs button.active { border-color: #0f766e; background: #0f766e; color: #fff; }
.record-panel { display: none; padding: 1.25rem; border: 1px solid #dbe5ea; border-radius: .85rem; background: #fff; }
.record-panel.active { display: block; }
.record-panel h2 { margin-top: 0; color: #123b57; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.photo-grid figure { margin: 0; padding: .65rem; border: 1px solid #dbe5ea; border-radius: .75rem; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .5rem; }
.photo-grid figcaption { padding-top: .55rem; font-weight: 700; }
.photo-placeholder { min-height: 220px; display: grid; place-items: center; border: 2px dashed #cbd5e1; border-radius: .75rem; color: #64748b; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 1rem 0 0; }
.pagination a { color: #0f766e; font-weight: 800; }
@media (max-width: 760px) {
  .consultation-metrics, .consultation-filters { grid-template-columns: 1fr; }
}

@media print {
  @page { size: Letter portrait; margin: 10mm 9mm 12mm; }
  body { background: white; color: black; font-family: Arial, sans-serif; }
  .office-header, .no-print { display: none !important; }
  .office-main { max-width: none; margin: 0; padding: 0; }
  .report-sheet { max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .report-letterhead img { width: 210px; height: 66px; }
  .report-letterhead h1 { font-size: 18px; }
  .report-section { margin: 18px 0; }
  .report-table { font-size: 10px; }
  .report-table thead { display: table-header-group; }
  .report-table tr { break-inside: avoid; }
  .report-table th, .report-table td { padding: 5px 6px; }
  .report-summary, .signature-grid { break-inside: avoid; }
  .signature-grid { margin-top: 58px; }
}
.access-admin-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;margin-bottom:1.25rem;padding:1.5rem;border-radius:24px;background:linear-gradient(135deg,#0b1f3a,#153968);color:#fff}.access-admin-hero h1{margin:.2rem 0 .45rem;font-size:clamp(1.8rem,4vw,2.7rem)}.access-admin-hero p{margin:0;max-width:760px;color:#dce9f8}.access-admin-hero .eyebrow{color:#7fc3ff}.temporary-password{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:0 0 1.25rem;padding:1.15rem 1.25rem;border:2px solid #d39b16;border-radius:18px;background:#fff8df}.temporary-password div{display:grid;gap:.35rem}.temporary-password code{font-size:1.25rem;font-weight:800;letter-spacing:.05em;color:#102542}.temporary-password span{color:#654f19}.access-search{margin-bottom:1.25rem;padding:1rem 1.2rem;border:1px solid #dce3ec;border-radius:18px;background:#fff}.access-search label{display:block;margin-bottom:.45rem;font-weight:800;color:#293c56}.access-search form>div{display:flex;gap:.65rem}.access-search input{flex:1;min-width:0}.access-users{display:grid;gap:1.15rem}.access-user-card{padding:1.25rem;border:1px solid #d7e0ea;border-radius:22px;background:#fff;box-shadow:0 10px 30px rgba(18,42,74,.07)}.access-user-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.access-identity{display:flex;align-items:center;gap:.9rem}.access-avatar{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#102a4f;color:#fff;font-size:1.2rem;font-weight:900}.access-identity h2{margin:0 0 .2rem;font-size:1.18rem;color:#13233a}.access-identity p{margin:0;color:#66758a}.access-status{padding:.38rem .72rem;border-radius:999px;font-size:.82rem;font-weight:900}.access-status--success{background:#e3f7eb;color:#16703d}.access-status--danger{background:#fee8e8;color:#ad2020}.access-status--warning{background:#fff1cc;color:#7a5200}.access-status--neutral{background:#edf1f5;color:#46566b}.access-user-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.65rem;margin:1rem 0}.access-user-metrics div{display:grid;gap:.25rem;padding:.75rem;border-radius:14px;background:#f5f8fc}.access-user-metrics span{font-size:.78rem;color:#6d7a8d}.access-user-metrics strong{font-size:.92rem;color:#1a2d49;overflow-wrap:anywhere}.access-devices{margin:1rem 0}.access-devices h3{margin:0 0 .65rem;font-size:1rem;color:#243a58}.access-device{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 0;border-top:1px solid #e6ebf1}.access-device>div{display:grid;gap:.18rem}.access-device span{font-size:.8rem;color:#6d7a8d}.device-revoke-form{display:flex;align-items:center;gap:.5rem}.device-revoke-form input{max-width:220px}.access-actions{display:grid;grid-template-columns:minmax(180px,.75fr) minmax(260px,1.5fr) auto;align-items:end;gap:.75rem;padding-top:1rem;border-top:1px solid #e1e7ee}.access-actions label{display:grid;gap:.35rem;font-size:.82rem;font-weight:800;color:#3f5067}.access-actions input,.access-actions select,.device-revoke-form input,.access-search input{padding:.72rem .8rem;border:1px solid #bdc9d8;border-radius:10px;background:#fff;color:#172a45}.access-empty{margin:0;color:#718096}.access-empty--large{padding:2rem;text-align:center;border:1px dashed #c7d2df;border-radius:18px;background:#fff}.btn-small{padding:.58rem .72rem;font-size:.78rem}@media(max-width:900px){.access-user-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.access-actions{grid-template-columns:1fr}.access-device{align-items:flex-start;flex-direction:column}.device-revoke-form{width:100%}.device-revoke-form input{flex:1;max-width:none}}@media(max-width:600px){.access-admin-hero,.temporary-password{align-items:stretch;flex-direction:column}.access-search form>div{align-items:stretch;flex-direction:column}.access-user-card>header{align-items:flex-start;flex-direction:column}.access-user-metrics{grid-template-columns:1fr}.device-revoke-form{align-items:stretch;flex-direction:column}}
.activation-dialog{width:min(680px,calc(100% - 2rem));max-height:calc(100vh - 2rem);padding:0;border:0;border-radius:22px;color:#172a45;box-shadow:0 24px 80px rgba(8,25,49,.32)}.activation-dialog::backdrop{background:rgba(8,25,49,.64)}.activation-dialog__content{display:grid;gap:1rem;padding:1.4rem}.activation-dialog__content header h2{margin:.15rem 0 0}.activation-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.65rem;margin:0}.activation-summary div{padding:.75rem;border-radius:12px;background:#f3f7fb}.activation-summary dt{font-size:.78rem;color:#66758a}.activation-summary dd{margin:.2rem 0 0;font-weight:800;overflow-wrap:anywhere}.activation-dialog__content h3{margin:0}.activation-dialog__content pre{max-height:300px;overflow:auto;white-space:pre-wrap;padding:1rem;border:1px solid #d7e0ea;border-radius:12px;background:#f8fafc;font:inherit;line-height:1.5}.activation-dialog__content footer{display:flex;justify-content:flex-end;gap:.65rem}@media(max-width:600px){.activation-summary{grid-template-columns:1fr}.activation-dialog__content footer{align-items:stretch;flex-direction:column}}
.audit-hero {
  align-items: center;
}

.audit-filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(5, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}

.audit-filters label {
  display: grid;
  gap: 7px;
  color: #53627a;
  font-size: 0.82rem;
  font-weight: 700;
}

.audit-filters input,
.audit-filters select {
  min-height: 44px;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  padding: 9px 11px;
  color: #162033;
}

.audit-filter-actions {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
}

.audit-table {
  min-width: 1500px;
  font-size: 0.82rem;
}

.audit-table td {
  vertical-align: top;
}

.audit-table td:nth-child(6),
.audit-table td:nth-child(11) {
  min-width: 220px;
  white-space: normal;
}

.audit-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}

.audit-pagination a {
  color: #126bd6;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .audit-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .audit-filters {
    grid-template-columns: 1fr;
  }
}
.system-admin-nav,
.catalog-tabs {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.system-admin-nav a,
.catalog-tabs a {
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 999px;
  color: #26364d;
  font-weight: 700;
  padding: .65rem 1rem;
  text-decoration: none;
}
.system-admin-nav a.active,
.catalog-tabs a.active { background: #0d5db8; color: #fff; border-color: #0d5db8; }
.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}
.admin-module-grid > a,
.admin-module-grid > article {
  background: #f7f9fc;
  border: 1px solid #dce4ee;
  border-radius: 14px;
  color: #17263c;
  display: grid;
  gap: .4rem;
  padding: 1.1rem;
  text-decoration: none;
}
.admin-module-grid span,
.admin-module-grid small { color: #607087; }
.admin-split { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(0, 1.6fr); gap: 1.2rem; }
.system-admin-form { align-self: start; background: #f7f9fc; border: 1px solid #dce4ee; border-radius: 14px; padding: 1rem; }
.system-admin-form p,
.system-admin-form label { display: grid; gap: .35rem; font-weight: 700; }
.system-admin-form input,
.system-admin-form select,
.system-admin-form textarea,
.inline-search input,
.row-actions input,
.row-actions select {
  border: 1px solid #bdc9d8;
  border-radius: 9px;
  box-sizing: border-box;
  min-height: 42px;
  padding: .55rem .7rem;
  width: 100%;
}
.system-admin-form textarea { min-height: 75px; }
.inline-search { display: flex; gap: .6rem; margin-bottom: .8rem; }
.row-actions { min-width: 220px; }
.row-actions form { display: grid; gap: .35rem; margin-top: .45rem; }
.row-actions button,
.responsive-table td form button { background: #405a77; border: 0; border-radius: 7px; color: #fff; cursor: pointer; padding: .5rem; }
.responsive-table td small { display: block; color: #708097; }
.system-message,
.temporary-password { border-radius: 10px; margin: .8rem 0; padding: .85rem 1rem; }
.system-message--success { background: #e8f7ef; color: #166239; }
.system-message--error { background: #fff0f0; color: #9b2525; }
.temporary-password { background: #fff7d8; display: flex; gap: 1rem; align-items: center; }
.temporary-password code { font-size: 1.05rem; }
@media (max-width: 900px) { .admin-split { grid-template-columns: 1fr; } }
.committee-summary { margin-bottom: 1.5rem; }
.committee-card {
  display: flex; min-height: 185px; flex-direction: column;
  color: inherit; text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.committee-card:hover {
  transform: translateY(-2px); border-color: #0f766e;
  box-shadow: 0 12px 30px rgba(15, 118, 110, .12);
}
.committee-card__action { margin-top: auto; padding-top: 1rem; color: #0f766e; font-weight: 800; }
.committee-flow { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.committee-flow span {
  padding: .65rem .9rem; border: 1px solid #d9e2e8;
  border-radius: 999px; background: #f8fafc; font-weight: 750;
}
.committee-flow i { color: #0f766e; font-style: normal; font-weight: 900; }
.committee-filters { align-items: end; }
.committee-filters label { min-width: 210px; }
.committee-filters label span {
  display: block; margin-bottom: .35rem; color: #52616b;
  font-size: .8rem; font-weight: 750; text-transform: uppercase;
}
.committee-table { min-width: 1120px; }
.button-small { padding: .48rem .68rem; white-space: nowrap; font-size: .82rem; }
.status-pill {
  display: inline-flex; padding: .32rem .55rem; border-radius: 999px;
  background: #e7f5f1; color: #0b665c; font-size: .75rem; font-weight: 800;
}
.empty-state { padding: 2.5rem !important; text-align: center; color: #697780; }
@media (max-width: 760px) {
  .committee-flow i { display: none; }
  .committee-flow span { width: 100%; text-align: center; }
}
.committee-work-row {
  cursor: pointer;
}

.committee-work-row:hover,
.committee-work-row:focus {
  background: #eef6ff;
  outline: none;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.avanza-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: .4rem;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .7rem .8rem;
  border: 1px solid #cbd5e1;
  border-radius: .6rem;
  font: inherit;
}

.form-field small {
  font-weight: 400;
  color: #64748b;
}

.form-field .field-error {
  color: #b91c1c;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.detail-list div {
  padding: .85rem;
  border: 1px solid #e2e8f0;
  border-radius: .65rem;
}

.detail-list dt {
  color: #64748b;
  font-size: .8rem;
  text-transform: uppercase;
}

.detail-list dd {
  margin: .25rem 0 0;
  font-weight: 700;
}

@media (max-width: 760px) {
  .avanza-form .form-grid,
  .detail-list {
    grid-template-columns: 1fr;
  }
}
