@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #1c2925;
  --muted: #73817c;
  --line: #e4ebe6;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --green: #16734f;
  --green-dark: #105d40;
  --green-soft: #e8f4ed;
  --amber: #9a6411;
  --amber-soft: #fbf2df;
  --red: #9f4542;
  --red-soft: #fae9e7;
  font-family: 'DM Sans', sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.page-shell { width: min(1440px, 100%); margin: 0 auto; padding: 0 48px; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e7ece8; }
.brand { display: inline-flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; letter-spacing: -.02em; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 10px 10px 10px 3px; font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 800; }
.privacy-pill { display: flex; align-items: center; gap: 8px; color: #5e7168; font-size: 12px; font-weight: 600; }
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: #3d9a6c; box-shadow: 0 0 0 3px #e2f1e8; }

.hero { padding: 45px 0 27px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.eyebrow { margin: 0 0 10px; color: #638074; font-size: 10px; font-weight: 700; letter-spacing: .13em; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: 'Manrope', sans-serif; letter-spacing: -.045em; }
h1 { margin-bottom: 10px; font-size: clamp(28px, 3.2vw, 39px); line-height: 1.17; font-weight: 800; }
.hero-description { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.hero-actions, .panel-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; transition: background .16s ease, border-color .16s ease, transform .16s ease; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 3px 8px #176b4b1c; }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: #33443c; background: #fff; border-color: #dfe7e1; }
.button-secondary:hover { background: #f9fbf9; border-color: #cbd8ce; }
.button span { font-size: 17px; line-height: 0; }

.notice { display: flex; align-items: center; gap: 10px; padding: 12px 15px; background: #edf5ef; border: 1px solid #dfebe1; border-radius: 9px; color: #52675b; font-size: 11px; }
.notice p { margin: 0; }
.notice-icon { width: 17px; height: 17px; display: grid; place-items: center; flex: 0 0 17px; color: #fff; background: #6c947b; border-radius: 50%; font: 700 11px Georgia, serif; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 21px 0; }
.stat-card { min-height: 112px; display: flex; flex-direction: column; align-items: flex-start; padding: 17px 19px; background: var(--surface); border: 1px solid #e7ece8; border-radius: 10px; box-shadow: 0 2px 6px #21342a05; }
.stat-label { color: #7a8781; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.stat-card strong { margin: 8px 0 2px; font-family: 'Manrope', sans-serif; font-size: 25px; line-height: 1; letter-spacing: -.04em; }
.stat-note { color: #8b9791; font-size: 10px; }
.stat-total strong { color: var(--green); }

.scope-panel { margin: 0 0 14px; padding: 19px 21px 15px; display: grid; grid-template-columns: minmax(210px, 1fr) minmax(360px, 1.3fr); align-items: center; gap: 10px 28px; background: #fff; border: 1px solid #e5ebe7; border-radius: 10px; }
.scope-heading .eyebrow { margin-bottom: 5px; }
.scope-heading h2 { margin: 0; font-size: 17px; }
.scope-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.scope-field { display: flex; flex-direction: column; gap: 6px; color: #68766f; font-size: 10px; font-weight: 700; }
.scope-field select { min-height: 38px; width: 100%; padding: 0 10px; border: 1px solid #dfe7e1; border-radius: 7px; color: #35463d; background: #fff; font-size: 11px; font-weight: 500; outline: 0; }
.scope-field select:focus { border-color: #69a782; box-shadow: 0 0 0 3px #dff0e4; }
.scope-field select:disabled { color: #9aa59f; background: #f4f6f5; }
.scope-hint { grid-column: 1 / -1; margin: 0; color: #87938c; font-size: 10px; }
.scope-prompt { margin-bottom: 15px; padding: 18px; border: 1px dashed #d6e1d9; border-radius: 9px; color: #7c8982; background: #fafcfb; text-align: center; font-size: 11px; }

.records-panel { overflow: hidden; background: var(--surface); border: 1px solid #e5ebe7; border-radius: 11px; box-shadow: 0 5px 17px #25392e07; }
.panel-heading { min-height: 92px; padding: 19px 21px 15px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.panel-heading h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.file-caption { margin: 5px 0 0; color: #8a958f; font-size: 10px; }
.panel-actions { gap: 12px; }
.panel-actions .button { min-height: 37px; }
.sheet-picker { display: flex; align-items: center; gap: 7px; color: #73817a; font-size: 11px; }
.sheet-picker select { max-width: 160px; min-height: 34px; padding: 0 27px 0 10px; border: 1px solid var(--line); border-radius: 7px; background-color: #fff; color: var(--ink); font-size: 11px; }
.toolbar { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 8px 21px; border-top: 1px solid #eef1ef; border-bottom: 1px solid #edf1ee; background: #fcfdfc; }
.search-box { width: min(360px, 60%); height: 35px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid #e2e9e4; border-radius: 7px; background: #fff; color: #86928c; }
.search-icon { font-size: 21px; line-height: 1; transform: rotate(-25deg); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); font-size: 11px; background: transparent; }
.search-box input::placeholder { color: #a2ada7; }
.filter-box { display: flex; align-items: center; gap: 8px; color: #87928d; font-size: 11px; }
.filter-box select { min-height: 34px; border: 0; background: transparent; color: #45564d; font-size: 11px; font-weight: 600; outline: 0; }
.table-wrap { max-width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 11px; }
thead { background: #f7f9f7; }
th { height: 39px; padding: 0 13px; color: #7c8982; text-align: left; font-size: 9px; font-weight: 700; letter-spacing: .05em; }
td { max-width: 260px; height: 51px; padding: 0 13px; overflow: hidden; border-top: 1px solid #eff2f0; color: #54625b; text-overflow: ellipsis; }
tbody tr:hover { background: #fbfcfb; }
th:first-child, td:first-child { padding-left: 21px; }
.row-number { color: #9aa59f; font-size: 10px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 30px; font-size: 9px; font-weight: 700; }
.status-badge::before { width: 5px; height: 5px; content: ''; border-radius: 50%; background: currentColor; }
.status-pending { color: var(--amber); background: var(--amber-soft); }
.status-yes { color: var(--green); background: var(--green-soft); }
.status-no { color: var(--red); background: var(--red-soft); }
.tenure-badge { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.tenure-badge::before { width: 7px; height: 7px; flex: 0 0 7px; content: ''; border-radius: 50%; background: currentColor; }
.tenure-red { color: #ad3434; background: #fff0f0; }
.tenure-yellow { color: #90620d; background: #fff5d9; }
.tenure-green { color: #247a58; background: #eaf7ef; }
.record-action { padding: 6px 10px; border: 1px solid #dbe8de; border-radius: 6px; color: var(--green); background: white; font-size: 10px; font-weight: 700; }
.record-action:hover { background: #eef6f0; }
.no-results { padding: 35px 15px; color: #89958f; text-align: center; font-size: 12px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 21px; border-top: 1px solid #edf1ee; color: #8a9690; font-size: 10px; }

.empty-state { min-height: 355px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 21px 0 32px; padding: 30px; border: 1px dashed #d6e1d9; border-radius: 11px; background: #fafcfb; text-align: center; }
.empty-illustration { position: relative; width: 76px; height: 68px; margin-bottom: 18px; display: grid; place-items: center; }
.sheet-icon { width: 48px; height: 58px; padding: 16px 10px 8px; display: flex; flex-direction: column; gap: 5px; border: 1px solid #c9d8ce; border-radius: 5px; background: #fff; box-shadow: 0 5px 10px #244b3410; transform: rotate(-5deg); }
.sheet-icon::before { position: absolute; content: ''; width: 12px; height: 12px; margin: -16px 0 0 17px; border-radius: 0 4px 0 4px; background: #e5f0e8; }
.sheet-icon span { height: 3px; border-radius: 3px; background: #dbe8df; }
.sheet-icon span:first-child { width: 100%; background: #8bb69b; }
.sheet-icon span:nth-child(even) { width: 80%; }
.empty-plus { position: absolute; right: 4px; bottom: 1px; width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid #fafcfb; border-radius: 50%; color: white; background: #4c9b6d; font-size: 18px; line-height: 1; }
.empty-state .eyebrow { margin-bottom: 8px; }
.empty-state h2 { margin-bottom: 8px; font-size: 20px; }
.empty-state > p:not(.eyebrow) { max-width: 410px; margin-bottom: 19px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.empty-state .button { min-height: 39px; }
.file-types { margin-top: 12px; color: #98a39d; font-size: 10px; }

.footer { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid #e7ece8; color: #8e9993; font-size: 10px; }
.toast { position: fixed; right: 26px; bottom: 24px; z-index: 20; max-width: min(420px, calc(100vw - 40px)); padding: 12px 16px; border: 1px solid #d8e6dc; border-radius: 8px; color: #345943; background: #f1f8f3; box-shadow: 0 8px 30px #203c2b20; font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { color: #873e39; border-color: #f0d6d4; background: #fff5f4; }

.record-dialog { width: min(700px, calc(100vw - 28px)); max-height: min(90vh, 850px); padding: 0; overflow: auto; border: 1px solid #e0e8e2; border-radius: 13px; color: var(--ink); background: #fff; box-shadow: 0 25px 80px #1c322448; }
.record-dialog::backdrop { background: #17271f78; backdrop-filter: blur(2px); }
.record-dialog form { padding: 24px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-heading .eyebrow { margin-bottom: 5px; }
.dialog-heading h2 { margin: 0; font-size: 21px; }
.icon-button { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #e5ebe6; border-radius: 7px; color: #75827b; background: #fff; font-size: 21px; line-height: 1; }
.dialog-intro { margin: 8px 0 16px; color: #7d8983; font-size: 11px; }
.employee-details { max-height: 190px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; overflow: auto; padding: 13px 15px; border: 1px solid #edf1ee; border-radius: 8px; background: #fafcfb; }
.detail-item { min-width: 0; padding: 7px 0; border-bottom: 1px solid #edf1ee; }
.detail-item dt { margin-bottom: 4px; color: #849189; font-size: 9px; font-weight: 700; }
.detail-item dd { margin: 0; overflow-wrap: anywhere; color: #35453c; font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 19px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { color: #46564d; font-size: 11px; font-weight: 700; }
.field > span b { margin-left: 5px; color: #9d6054; font-size: 9px; font-weight: 600; }
.field select, .field input, .field textarea { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid #dfe7e1; border-radius: 7px; outline: 0; color: #31423a; background: white; font-size: 11px; }
.field textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
.field select:focus, .field input:focus, .field textarea:focus { border-color: #69a782; box-shadow: 0 0 0 3px #dff0e4; }
.field input:disabled { color: #6f7c74; background: #f2f5f3; }
.field small { color: #8a9690; font-size: 9px; }
.field-reason { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 17px; border-top: 1px solid #edf1ee; }

.preview-dialog { width: min(1040px, calc(100vw - 28px)); max-height: min(92vh, 900px); padding: 0; overflow: auto; border: 1px solid #e0e8e2; border-radius: 13px; color: var(--ink); background: #fff; box-shadow: 0 25px 80px #1c322448; }
.preview-dialog::backdrop { background: #17271f78; backdrop-filter: blur(2px); }
.preview-content { padding: 24px; }
.preview-content .dialog-heading h2 { margin: 0; font-size: 21px; }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.preview-stats > div { min-height: 68px; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 6px; border: 1px solid #e8eeea; border-radius: 8px; background: #fafcfb; }
.preview-stats span { color: #829087; font-size: 8px; font-weight: 700; letter-spacing: .09em; }
.preview-stats strong { color: #294536; font-family: 'Manrope', sans-serif; font-size: 18px; line-height: 1; }
.mapping-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 8px; }
.mapping-hint, .preview-limit { color: #839087; font-size: 10px; }
.mapping-hint { margin: 0 0 12px; }
.preview-table-wrap { max-height: 290px; overflow: auto; border: 1px solid #e8eeea; border-radius: 8px; }
.preview-table-wrap table { width: max-content; min-width: 100%; }
.preview-table-wrap td { height: 38px; }
.preview-limit { margin: 8px 0 0; }
.preview-warning { margin-top: 12px; padding: 10px 12px; border: 1px solid #f1e5c6; border-radius: 7px; color: #846327; background: #fff9eb; font-size: 10px; }
.preview-content .dialog-actions { margin-top: 15px; }

@media (max-width: 850px) {
  .page-shell { padding: 0 25px; }
  .hero { align-items: flex-start; flex-direction: column; padding-top: 35px; }
  .hero-actions { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scope-panel { grid-template-columns: 1fr; gap: 12px; }
  .scope-hint { grid-column: auto; }
}
@media (max-width: 600px) {
  .page-shell { padding: 0 16px; }
  .topbar { height: 63px; }
  .privacy-pill { font-size: 0; }
  .privacy-dot { width: 9px; height: 9px; }
  .hero { padding: 30px 0 20px; gap: 18px; }
  h1 { font-size: 29px; }
  .hero-description { max-width: 390px; line-height: 1.55; }
  .hero-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .button { padding: 0 10px; font-size: 11px; }
  .notice { align-items: flex-start; line-height: 1.5; }
  .stats-grid { gap: 8px; margin: 14px 0; }
  .stat-card { min-height: 94px; padding: 13px; }
  .stat-label { font-size: 8px; }
  .stat-card strong { font-size: 23px; }
  .panel-heading { align-items: flex-start; flex-direction: column; padding: 17px 14px 13px; gap: 13px; }
  .panel-actions { width: 100%; justify-content: space-between; }
  .panel-actions .button { font-size: 10px; }
  .toolbar { padding: 8px 12px; }
  .search-box { width: 54%; }
  .filter-box { gap: 3px; font-size: 10px; }
  .filter-box select { max-width: 120px; font-size: 10px; }
  .table-footer { align-items: flex-start; flex-direction: column; padding: 10px 14px; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 5px; padding: 12px 0; }
  .empty-state { min-height: 330px; padding: 23px 18px; }
  .record-dialog form { padding: 18px; }
  .preview-content { padding: 18px; }
  .preview-stats { gap: 6px; }
  .preview-stats > div { padding: 10px 8px; }
  .preview-stats span { font-size: 7px; }
  .preview-stats strong { font-size: 16px; }
  .mapping-grid { grid-template-columns: 1fr; }
  .scope-selects { grid-template-columns: 1fr; }
  .employee-details { grid-template-columns: 1fr; max-height: 170px; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .field-reason { grid-column: auto; }
  .dialog-actions .button { flex: 1; }
}

/* BN / A365 renewals workspace */
:root {
  --ink: #202b45;
  --muted: #7a849a;
  --line: #e7eaf2;
  --surface: #fff;
  --canvas: #f5f7fb;
  --green: #2f548f;
  --green-dark: #234372;
  --green-soft: #e8eff9;
  --amber: #ad761d;
  --amber-soft: #fff4df;
  --red: #c82032;
  --red-soft: #fdecef;
}

body { min-width: 320px; background: #f5f7fb; color: #202b45; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; min-height: 680px; display: flex; flex-direction: column; overflow-y: auto; padding: 22px 15px 15px; border-right: 1px solid #e6e9f1; background: #fff; }
.sidebar-brand { min-height: 56px; display: flex; align-items: center; gap: 11px; padding: 0 9px; color: inherit; text-decoration: none; }
.a365-logo { width: 78px; height: 38px; display: block; flex: 0 0 78px; object-fit: contain; }
.sidebar-brand-copy { display: flex; flex-direction: column; gap: 3px; }
.sidebar-brand-copy strong { color: #2c3650; font-size: 12px; font-weight: 700; }
.sidebar-brand-copy small { color: #8b94a7; font-size: 10px; }
.sidebar-section-label { margin: 34px 9px 10px; color: #a2a9b7; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.main-nav { display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 11px; border: 0; border-radius: 8px; color: #69748b; background: transparent; text-align: left; font-size: 11px; font-weight: 600; transition: color .16s, background .16s; }
.nav-item:hover { color: #2f548f; background: #edf2fa; }
.nav-item.is-active { color: #fff; background: #2f548f; box-shadow: 0 5px 12px #2f548f24; }
.nav-icon { width: 21px; display: inline-grid; place-items: center; color: #8893aa; font-size: 17px; font-weight: 500; }
.nav-item.is-active .nav-icon { color: #fff; }
.nav-count { min-width: 20px; height: 20px; display: grid; place-items: center; margin-left: auto; padding: 0 5px; border-radius: 12px; color: #5c6dbb; background: #eef0ff; font-size: 9px; font-weight: 700; }
.nav-item.is-active .nav-count { color: #3449a9; background: #fff; }
.sidebar-divider { height: 1px; margin: 21px 6px 19px; background: #edf0f5; }
.scope-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #36b78e; box-shadow: 0 0 0 3px #e4f7f0; }
.scope-field { display: flex; flex-direction: column; gap: 6px; color: #78839a; font-size: 10px; font-weight: 600; }
.scope-field + .scope-field { margin-top: 12px; }
.scope-field select { width: 100%; min-height: 39px; padding: 0 10px; border: 1px solid #e2e6ef; border-radius: 7px; outline: 0; color: #39455e; background: #fff; font-size: 10px; }
.scope-field select:focus { border-color: #7b8ada; box-shadow: 0 0 0 3px #edf0ff; }
.scope-field select:disabled { color: #a5adbb; background: #f7f8fa; }
.sidebar-bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 13px 8px 2px; border-top: 1px solid #edf0f5; color: #939cae; font-size: 9px; }
.local-lock { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; color: #2f548f; background: #eaf0f8; font-size: 14px; }
.main-shell { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 70px; flex: 0 0 70px; padding: 0 42px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e9ecf3; background: #fff; }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #9aa2b2; font-size: 11px; }
.breadcrumb strong { color: #35415d; font-weight: 700; }
.breadcrumb-slash { color: #c7ccd6; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.online-indicator { display: flex; align-items: center; gap: 7px; color: #7d879b; font-size: 10px; }
.online-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #35b78b; }
.bn-logo { width: 56px; height: 44px; display: block; flex: 0 0 56px; object-fit: contain; }
.main-content { width: 100%; max-width: 1480px; flex: 1; margin: 0 auto; padding: 34px 42px 30px; }
.page-view[hidden] { display: none !important; }
.files-page-heading { align-items: flex-end; }
.base-files-panel { overflow: hidden; border: 1px solid #e5e9f2; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px #263b7307; }
.base-files-panel-heading { min-height: 83px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid #edf0f5; }
.base-files-panel-heading .eyebrow { margin: 0 0 5px; }
.base-files-panel-heading h2 { margin: 0; color: #293653; font-size: 17px; }
.base-files-panel-heading > span { color: #7c879d; font-size: 10px; font-weight: 600; }
.base-files-page-list { display: grid; gap: 10px; padding: 18px 22px; }
.base-file-card { min-width: 0; min-height: 75px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #e7eaf2; border-radius: 9px; background: #fff; }
.base-file-card:not(.is-current) { grid-template-columns: 42px minmax(0, 1fr) auto auto; }
.base-file-card.is-current { border-color: #dce2ff; background: #fafbff; }
.base-file-icon { width: 40px; height: 44px; display: grid; place-items: center; border: 1px solid #cfe8dc; border-radius: 7px; color: #fff; background: #32a878; font-size: 8px; font-weight: 800; letter-spacing: .04em; box-shadow: 0 3px 8px #277d5a18; }
.base-file-copy { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.base-file-copy strong { overflow: hidden; color: #34415e; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.base-file-copy small { overflow: hidden; color: #929bad; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.base-source-files { display: grid; gap: 4px; margin: 1px 0 0; padding: 0; list-style: none; }
.base-source-files li { overflow: hidden; color: #64718c; font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.base-source-files li::before { display: inline-block; width: 14px; margin-right: 4px; color: #34a77b; content: 'XLS'; font-size: 6px; font-weight: 800; letter-spacing: .02em; }
.base-file-status { padding: 6px 9px; border-radius: 20px; color: #3150b1; background: #e9edff; font-size: 9px; font-weight: 700; white-space: nowrap; }
.base-file-status.is-previous { color: #768096; background: #f0f2f6; }
.base-file-view { min-height: 34px; white-space: nowrap; font-size: 10px; }
.base-file-delete { min-height: 34px; color: #98515a; border-color: #f0dfe1; font-size: 10px; }
.base-file-delete:hover { color: #fff; border-color: #b44f5a; background: #b44f5a; }
.base-view-dialog { width: min(1450px, calc(100vw - 34px)); }
.base-view-source-pickers { display: grid; grid-template-columns: minmax(240px, 1fr); max-width: 520px; gap: 12px; margin: 14px 0 4px; }
.base-view-source-pickers label { display: grid; gap: 6px; color: #78839a; font-size: 10px; font-weight: 600; }
.base-view-source-pickers select { min-width: 0; min-height: 36px; padding: 0 10px; border: 1px solid #e2e6ef; border-radius: 7px; color: #39455e; background: #fff; font-size: 10px; }
.base-view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 14px 0 10px; }
.base-view-toolbar .search-box { width: min(460px, 55%); }
.base-view-toolbar-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.base-view-toolbar-actions > span, .base-view-pagination > span { color: #818ba0; font-size: 10px; }
.base-view-toolbar-actions .button { min-height: 34px; padding: 0 11px; font-size: 9px; white-space: nowrap; }
.base-view-table-wrap { max-height: min(58vh, 620px); }
.base-view-table-wrap table { width: max-content; min-width: 100%; }
.base-view-editable { min-width: 80px; cursor: text; }
.base-view-editable:hover { background: #f5f8ff; }
.base-view-editable:focus { outline: 1px solid var(--brand-blue); outline-offset: -1px; background: #fff; }
.base-view-table-wrap th { position: sticky; top: 0; z-index: 1; background: #f5f6fb; }
.base-view-table-wrap td { height: 42px; }
.base-view-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.base-view-pagination > div { display: flex; gap: 7px; }
.base-view-pagination .button { min-height: 32px; font-size: 9px; }
.base-files-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 25px; border: 1px dashed #dce2ef; border-radius: 9px; background: #fbfcff; }
.base-files-empty strong { color: #3d4965; font-size: 13px; }
.base-files-empty p { margin: 0 0 4px; color: #8993a7; font-size: 10px; }
.page-heading { min-height: 88px; display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin: 0 0 24px; }
.page-heading .eyebrow { margin-bottom: 9px; color: #6376c0; font-size: 9px; }
.page-heading h1 { margin: 0 0 6px; color: #222e4b; font-size: clamp(25px, 2.7vw, 32px); letter-spacing: -.05em; }
.page-heading p:not(.eyebrow) { margin: 0; color: #838da2; font-size: 11px; line-height: 1.6; }
.heading-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #e6eaf5; border-radius: 30px; color: #68779b; background: #fff; font-size: 9px; font-weight: 600; white-space: nowrap; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: #31b486; }
.upload-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(250px, .78fr); gap: 17px; }
.upload-card { min-height: 345px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; border: 1px solid #e5e9f2; border-radius: 12px; background: #fff; text-align: center; box-shadow: 0 5px 18px #263b7307; }
.upload-visual { position: relative; width: 76px; height: 70px; margin-bottom: 17px; display: grid; place-items: center; }
.upload-sheet { width: 47px; height: 56px; display: flex; flex-direction: column; gap: 6px; padding: 8px 8px; border: 1px solid #cfd8f8; border-radius: 7px; background: #f6f8ff; transform: rotate(-5deg); box-shadow: 0 5px 12px #3048b112; }
.upload-sheet b { width: 16px; height: 16px; display: grid; place-items: center; margin: -1px auto 1px 0; border-radius: 4px; color: #fff; background: #2db27f; font-size: 9px; }
.upload-sheet span { height: 3px; border-radius: 4px; background: #dce3fb; }
.upload-sheet span:first-of-type { width: 100%; background: #aab8f1; }
.upload-arrow { position: absolute; right: 2px; bottom: 0; width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; color: white; background: #334bb4; font-size: 17px; }
.upload-card .eyebrow { margin-bottom: 7px; color: #6c7dc0; font-size: 9px; }
.upload-card h2 { margin: 0 0 8px; color: #273451; font: 700 18px 'Manrope', sans-serif; letter-spacing: -.035em; }
.upload-copy { max-width: 490px; margin: 0 auto 17px; color: #818ca1; font-size: 10px; line-height: 1.7; }
.upload-copy strong { color: #4358b5; }
.upload-actions { display: flex; justify-content: center; }
.button { min-height: 39px; padding: 0 15px; border-radius: 7px; font-size: 10px; }
.button-primary { background: #324ab3; box-shadow: 0 4px 11px #3048b12b; }
.button-primary:hover { background: #293f9f; }
.button-secondary { border-color: #e1e5ee; color: #4b5874; }
.button-secondary:hover { background: #f7f8fc; border-color: #cfd5e5; }
.file-types { margin-top: 11px; color: #a1a9b7; font-size: 9px; }
.loaded-base { width: 100%; display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 11px 13px; border: 1px solid #dcefe7; border-radius: 8px; background: #f7fcf9; text-align: left; }
.loaded-check { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 22px; border-radius: 50%; color: #168764; background: #e5f6ee; font-size: 12px; font-weight: 800; }
.loaded-base div { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 3px; }
.loaded-base strong { color: #3c6d59; font-size: 10px; }
.loaded-base span:not(.loaded-check) { overflow: hidden; color: #8a9b92; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 5px 0 5px 8px; border: 0; color: #4057b2; background: transparent; font-size: 9px; font-weight: 700; white-space: nowrap; }
.upload-guide { min-width: 0; display: flex; flex-direction: column; align-items: stretch; padding: 25px 22px 17px; border: 1px solid #e5e9f2; border-radius: 12px; background: #fff; }
.guide-step { min-width: 0; display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: start; column-gap: 11px; }
.guide-step > div:last-child { min-width: 0; }
.guide-number { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: #354db5; font-size: 9px; font-weight: 700; }
.guide-number-muted { color: #8390c1; background: #eef0fb; }
.upload-guide h3 { margin: 2px 0 4px; color: #45516a; font-size: 10px; font-weight: 700; }
.upload-guide p { margin: 0; color: #8d96a8; font-size: 9px; line-height: 1.55; }
.guide-line { width: 1px; height: 17px; flex: 0 0 17px; margin: 3px 0 3px 12px; border-left: 1px dashed #d9deeb; }
.guide-note { display: flex; gap: 8px; margin-top: 16px; padding: 11px 10px; border: 1px solid #e8eafb; border-radius: 7px; background: #f7f8ff; }
.guide-note > span { width: 15px; height: 15px; display: grid; place-items: center; flex: 0 0 15px; border-radius: 50%; color: #fff; background: #8795db; font: 700 10px Georgia, serif; }
.guide-note p { color: #7883a3; }
.empty-state { min-height: 93px; display: flex; flex-direction: row; justify-content: flex-start; gap: 14px; margin: 17px 0 0; padding: 20px; border: 1px solid #e7eaf1; border-radius: 10px; background: #fff; text-align: left; }
.empty-state-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; border-radius: 9px; color: #5266bb; background: #eff1ff; font-size: 18px; }
.empty-state h2 { margin: 0 0 4px; color: #47536e; font-size: 11px; letter-spacing: -.01em; }
.empty-state > div > p { margin: 0; color: #939bad; font-size: 9px; }
.loaded-summary { display: flex; align-items: center; gap: 15px; margin-top: 17px; padding: 18px 21px; border: 1px solid #dceee5; border-radius: 10px; background: #f9fdfa; }
.loaded-summary-icon { width: 33px; height: 33px; display: grid; place-items: center; flex: 0 0 33px; border-radius: 50%; color: #178862; background: #e5f6ec; font-size: 14px; font-weight: 800; }
.loaded-summary .eyebrow { margin: 0 0 4px; color: #3e9b76; font-size: 8px; }
.loaded-summary h2 { margin: 0 0 3px; color: #3e5b4c; font-size: 12px; }
.loaded-summary p:not(.eyebrow) { margin: 0; color: #84978d; font-size: 9px; }
.loaded-summary-stats { display: flex; gap: 22px; margin-left: auto; }
.loaded-summary-stats div { display: flex; flex-direction: column; gap: 3px; }
.loaded-summary-stats strong { color: #415e4e; font: 700 16px 'Manrope', sans-serif; }
.loaded-summary-stats span { color: #89998f; font-size: 8px; }
.dashboard-heading { align-items: flex-end; }
.dashboard-filters { display: grid; grid-template-columns: minmax(145px, 1fr) minmax(150px, 1fr); gap: 10px; width: min(390px, 48%); }
.dashboard-filters .scope-field + .scope-field { margin-top: 0; }
.dashboard-filters .scope-field select { min-height: 38px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 15px; }
.stat-card { min-height: 100px; position: relative; padding: 16px 17px; border-color: #e7eaf2; border-radius: 9px; box-shadow: 0 3px 12px #24386905; }
.stat-card::before { position: absolute; top: 17px; right: 16px; width: 7px; height: 7px; content: ''; border-radius: 50%; background: #c9cfde; }
.stat-total::before { background: #5469c5; }
.stat-card:nth-child(2)::before { background: #e5ac46; }
.stat-card:nth-child(3)::before { background: #3bb88c; }
.stat-card:nth-child(4)::before { background: #dc737b; }
.stat-label { color: #8b94a7; font-size: 8px; letter-spacing: .08em; }
.stat-card strong { margin: 10px 0 3px; color: #293552; font-size: 24px; }
.stat-note { color: #9aa2b2; font-size: 9px; }
.dashboard-stats .stat-card:not(.stat-total) .stat-note { color: #6f7d98; font-weight: 600; }
.stat-total strong { color: #384fb0; }
.charts-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 14px; }
.chart-card { min-width: 0; min-height: 263px; padding: 19px 20px 16px; border: 1px solid #e6e9f1; border-radius: 10px; background: #fff; box-shadow: 0 4px 14px #25396f06; }
.chart-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 24px; }
.chart-card-heading .eyebrow { margin-bottom: 4px; color: #8190c9; font-size: 8px; }
.chart-card-heading h2 { margin: 0; color: #35415d; font-size: 14px; letter-spacing: -.02em; }
.chart-total { color: #9099ab; font-size: 9px; white-space: nowrap; }
.bar-chart { display: grid; gap: 18px; }
.bar-row { min-width: 0; display: grid; grid-template-columns: 89px minmax(55px, 1fr) 63px; align-items: center; gap: 11px; }
.bar-label { color: #68738b; font-size: 9px; }
.bar-track { height: 9px; overflow: hidden; border-radius: 10px; background: #f0f2f7; }
.bar-fill { height: 100%; display: block; min-width: 0; border-radius: inherit; transition: width .24s ease; }
.bar-pending { background: #eeb751; }
.bar-yes { background: #42b98e; }
.bar-no { background: #dc747c; }
.bar-value { color: #4a5671; text-align: right; font-size: 9px; font-weight: 700; }
.chart-legend { display: flex; gap: 14px; margin-top: 24px; padding-top: 13px; border-top: 1px solid #f0f2f6; color: #8791a4; font-size: 8px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 7px; height: 7px; border-radius: 50%; }
.legend-pending { background: #eeb751; }
.legend-yes { background: #42b98e; }
.legend-no { background: #dc747c; }
.supervisor-chart { max-height: 218px; display: grid; align-content: start; gap: 11px; overflow-y: auto; padding-right: 3px; }
.supervisor-bar-row { min-width: 0; display: grid; grid-template-columns: minmax(130px, 205px) minmax(55px, 1fr) 28px; align-items: center; gap: 10px; }
.supervisor-bar-label { overflow: hidden; color: #68738b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.supervisor-bar-track { height: 8px; overflow: hidden; border-radius: 10px; background: #f0f2f7; }
.supervisor-bar-track span { height: 100%; display: block; border-radius: inherit; background: #7888d7; transition: width .24s ease; }
.supervisor-bar-row.is-selected .supervisor-bar-label { color: #354bb0; font-weight: 700; }
.supervisor-bar-row.is-selected .supervisor-bar-track span { background: #3049b4; }
.supervisor-bar-row strong { color: #4a5671; text-align: right; font-size: 9px; }
.tenure-chart-card { grid-column: 1 / -1; min-height: 205px; }
.tenure-chart { display: grid; gap: 15px; }
.tenure-summary-row { min-width: 0; display: grid; grid-template-columns: minmax(190px, 270px) minmax(60px, 1fr) 82px; align-items: center; gap: 12px; }
.tenure-summary-label { overflow: hidden; color: #68738b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tenure-summary-track { height: 10px; overflow: hidden; border-radius: 10px; background: #f0f2f7; }
.tenure-summary-fill { height: 100%; display: block; min-width: 0; border-radius: inherit; transition: width .24s ease; }
.tenure-summary-fill.tenure-green { background: #42b98e; }
.tenure-summary-fill.tenure-yellow { background: #eeb751; }
.tenure-summary-fill.tenure-red { background: #dc747c; }
.tenure-summary-fill.tenure-unknown { background: #9aa2b2; }
.tenure-summary-value { color: #4a5671; text-align: right; font-size: 9px; font-weight: 700; white-space: nowrap; }
.chart-empty { grid-column: 1 / -1; margin: 10px 0; color: #9aa2b2; text-align: center; font-size: 10px; }
.dashboard-footnote { margin: 12px 2px 0; color: #9aa2b2; font-size: 9px; }
.page-empty { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; border: 1px dashed #d9deea; border-radius: 11px; background: #fff; text-align: center; }
.page-empty > span { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 12px; color: #5368bf; background: #eff1ff; font-size: 21px; }
.page-empty h2 { margin: 0 0 7px; color: #3b4762; font-size: 15px; }
.page-empty p { margin: 0 0 15px; color: #8e97a9; font-size: 10px; }
.register-scope-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; margin-bottom: 14px; padding: 16px 18px; border: 1px solid #e5e9f2; border-radius: 10px; background: #fff; box-shadow: 0 3px 12px #24386905; }
.register-scope-picker-heading { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; }
.register-scope-picker-heading .eyebrow { margin: 0; color: #28558f; font-size: 8px; }
.register-scope-picker-heading > p:last-child { margin: 0; color: #818ca1; font-size: 10px; }
.register-scope-picker .scope-field { gap: 7px; }
.register-scope-picker .scope-field + .scope-field { margin-top: 0; }
.register-scope-picker .scope-field select { min-height: 40px; color: #39455e; font-size: 10px; }
.register-context { min-height: 82px; display: flex; align-items: center; gap: 13px; margin-bottom: 13px; padding: 15px 18px; border: 1px solid #e6e9f1; border-radius: 10px; background: #fff; }
.register-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border-radius: 12px; color: #4057b4; background: #eff1ff; font: 700 15px 'Manrope', sans-serif; }
.register-context .eyebrow { margin: 0 0 3px; color: #8792c7; font-size: 8px; }
.register-context h2 { margin: 0 0 3px; color: #36425e; font-size: 12px; letter-spacing: -.02em; }
.register-context p:not(.eyebrow) { margin: 0; color: #8d96a8; font-size: 9px; }
.register-count { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin-left: auto; }
.register-count strong { color: #344bb1; font: 700 20px 'Manrope', sans-serif; }
.register-count span { color: #9099aa; font-size: 8px; }
.scope-prompt { margin: 0 0 15px; padding: 19px; border: 1px dashed #d8deed; border-radius: 9px; color: #7c879d; background: #fff; text-align: center; font-size: 10px; }
.records-panel { border-color: #e5e9f1; border-radius: 10px; box-shadow: 0 4px 14px #25396f06; }
.panel-heading { min-height: 75px; padding: 15px 18px 12px; }
.panel-heading .eyebrow { color: #8290c7; font-size: 8px; }
.panel-heading h2 { color: #37435e; font-size: 15px; }
.panel-heading .file-caption { color: #9aa2b1; font-size: 9px; }
.toolbar { min-height: 50px; padding: 7px 18px; border-color: #eef0f5; background: #fbfcfe; }
.search-box { border-color: #e5e8ef; }
.filter-box select { color: #485570; }
.record-action { color: #384fb0; border-color: #dfe4f2; }
.record-action:hover { color: #263b97; background: #f3f5ff; }
.record-action:disabled { color: #8a93a4; border-color: #e5e8ef; background: #f6f7fa; cursor: not-allowed; }
.footer { min-height: 49px; padding: 0 42px; border-color: #e9ecf3; color: #9aa2b2; background: #fff; font-size: 9px; }
.record-dialog, .preview-dialog { border-color: #e2e6f0; }
.record-dialog .button-primary, .preview-dialog .button-primary { background: #324ab3; }
.bulk-action-buttons { display: flex; gap: 8px; }
.bulk-action-buttons .button { min-height: 36px; font-size: 9px; }
.bulk-action-buttons .button span { font-size: 14px; }
.return-stats > div:last-child strong { color: #ad4a52; }
.return-preview-note { margin: 10px 0; padding: 10px 12px; border: 1px solid #dceee5; border-radius: 7px; color: #4c7963; background: #f5fbf7; font-size: 10px; line-height: 1.5; }
.return-preview-note.has-errors { border-color: #f0d6d8; color: #98515a; background: #fff7f8; }
.return-error-list { max-height: 145px; overflow: auto; margin: 10px 0; padding: 8px 12px; border: 1px solid #f0d6d8; border-radius: 7px; color: #934d55; background: #fff9fa; }
.return-error-list p { margin: 4px 0; font-size: 9px; line-height: 1.45; }
.return-preview-dialog .preview-table-wrap { max-height: 240px; }
.return-preview-dialog .preview-table-wrap td { height: 35px; }
.return-preview-dialog .preview-table-wrap th { position: sticky; top: 0; z-index: 1; background: #f5f6fb; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { padding-right: 12px; padding-left: 12px; }
  .main-content { padding-right: 26px; padding-left: 26px; }
  .topbar { padding-right: 26px; padding-left: 26px; }
  .topbar-right { gap: 12px; }
  .bn-logo { width: 48px; height: 38px; flex-basis: 48px; }
  .footer { padding-right: 26px; padding-left: 26px; }
  .upload-layout { grid-template-columns: minmax(0, 1.2fr) minmax(225px, .8fr); }
}
@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; top: auto; height: auto; min-height: 0; padding: 10px 18px 13px; border-right: 0; border-bottom: 1px solid #e6e9f1; }
  .sidebar-brand { min-height: 43px; }
  .sidebar-section-label, .sidebar-divider, .sidebar-bottom { display: none; }
  .main-nav { display: flex; gap: 5px; margin: 9px 0 11px; overflow-x: auto; }
  .nav-item { width: auto; flex: 0 0 auto; min-height: 36px; padding: 0 10px; font-size: 10px; }
  .nav-icon { width: 17px; font-size: 14px; }
  .scope-field + .scope-field { margin-top: 0; }
  .main-content { padding-top: 25px; }
  .upload-layout { grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr); }
}
@media (max-width: 620px) {
  .sidebar { padding: 8px 12px 12px; }
  .register-scope-picker { grid-template-columns: 1fr; padding: 14px; }
  .register-scope-picker-heading { grid-column: 1; }
  .base-files-panel-heading { min-height: 72px; padding: 14px; }
  .base-files-page-list { gap: 8px; padding: 12px; }
  .base-file-card { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 10px; }
  .base-file-icon { width: 34px; height: 39px; }
  .base-file-copy { grid-column: 2; }
  .base-file-copy strong { font-size: 10px; }
  .base-source-files li { font-size: 8px; }
  .base-file-status, .base-file-view, .base-file-delete { grid-column: 2; justify-self: start; }
  .base-file-status { padding: 5px 7px; font-size: 8px; }
  .base-file-view { min-height: 30px; padding: 0 9px; font-size: 9px; }
  .base-file-delete { min-height: 30px; padding: 0 8px; font-size: 9px; }
  .base-view-toolbar { align-items: stretch; flex-direction: column; }
  .base-view-toolbar .search-box { width: 100%; max-width: none; }
  .base-view-toolbar-actions { justify-content: flex-start; }
  .base-view-source-pickers { grid-template-columns: 1fr; }
  .base-view-table-wrap { max-height: 57vh; }
  .base-view-pagination { align-items: flex-start; flex-direction: column; }
  .topbar { height: 57px; flex-basis: 57px; padding: 0 16px; }
  .breadcrumb { font-size: 9px; }
  .topbar-right { gap: 0; }
  .online-indicator { display: none; }
  .bn-logo { width: 44px; height: 35px; flex-basis: 44px; }
  .main-content { padding: 23px 15px 22px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 18px; }
  .page-heading h1 { font-size: 25px; }
  .heading-chip { align-self: flex-start; }
  .upload-layout { grid-template-columns: 1fr; }
  .upload-card { min-height: 300px; padding: 23px 17px; }
  .upload-guide { padding: 18px; }
  .loaded-summary { flex-wrap: wrap; }
  .loaded-summary-stats { width: 100%; justify-content: space-around; margin: 8px 0 0; padding-top: 11px; border-top: 1px solid #e6f1ea; }
  .dashboard-filters { width: 100%; grid-template-columns: 1fr 1fr; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 88px; padding: 12px; }
  .stat-label { max-width: 90%; font-size: 7px; }
  .stat-card::before { top: 13px; right: 11px; }
  .stat-card strong { font-size: 21px; }
  .stat-note { font-size: 8px; }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card { min-height: 230px; padding: 16px 14px; }
  .tenure-chart-card { grid-column: 1; }
  .tenure-summary-row { grid-template-columns: minmax(0, 1fr) 58px; gap: 6px 9px; }
  .tenure-summary-label { grid-column: 1 / -1; }
  .tenure-summary-value { grid-column: 2; grid-row: 2; }
  .tenure-summary-track { grid-column: 1; grid-row: 2; }
  .bar-row { grid-template-columns: 79px minmax(38px, 1fr) 55px; gap: 8px; }
  .supervisor-bar-row { grid-template-columns: minmax(75px, 105px) minmax(45px, 1fr) 20px; }
  .register-context { gap: 9px; padding: 13px; }
  .register-context h2 { max-width: 210px; font-size: 10px; }
  .register-context p:not(.eyebrow) { max-width: 215px; line-height: 1.4; }
  .register-avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .bulk-action-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .bulk-action-buttons .button { white-space: normal; }
  .panel-heading { padding: 14px; }
  .panel-heading .panel-actions { width: 100%; }
  .toolbar { padding: 7px 11px; }
  .search-box { width: 58%; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; padding: 11px 15px; }
}

/* Preparation and merge de los archivos de origen */
.upload-card { min-height: 420px; }
.source-upload-grid { width: 100%; max-width: 620px; display: grid; gap: 9px; margin: 4px auto 0; text-align: left; }
.source-upload-step { min-height: 66px; display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid #e7eaf2; border-radius: 8px; background: #fbfcff; }
.source-step-number { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; color: #5368bd; background: #eff1ff; font-size: 10px; font-weight: 800; }
.source-upload-step > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.source-upload-step strong { color: #3d4963; font-size: 10px; }
.source-upload-step small { overflow: hidden; color: #8c96a9; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.source-upload-step .button { min-height: 32px; padding: 0 10px; font-size: 9px; white-space: nowrap; }
.source-upload-step .button:disabled { color: #a4acba; background: #f1f2f6; box-shadow: none; cursor: not-allowed; }
.upload-card .file-types { margin-top: 9px; }
.merge-review { margin-top: 18px; padding: 22px; border: 1px solid #e3e8f1; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px #263b7307; }
.merge-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.merge-review-heading .eyebrow { margin: 0 0 7px; color: #6376c0; font-size: 9px; }
.merge-review-heading h2 { margin: 0 0 5px; color: #273451; font-size: 18px; letter-spacing: -.03em; }
.merge-review-heading p:not(.eyebrow) { margin: 0; color: #858fa3; font-size: 10px; line-height: 1.55; }
.merge-ready-badge { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #e5e9f1; border-radius: 20px; color: #8690a4; background: #fafbfc; font-size: 9px; font-weight: 700; }
.merge-ready-badge.is-ready { border-color: #d6eee3; color: #218362; background: #f1faf5; }
.merge-ready-badge.has-errors { border-color: #f0d9db; color: #a04d56; background: #fff7f8; }
.merge-stats { margin: 17px 0; }
.merge-stats > div { min-width: 0; }
.merge-stats strong { color: #3448a5; }
.merge-stats > div:last-child strong { color: #ad4a52; }
.merge-section-title, .merge-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 9px; }
.merge-section-title h3, .merge-preview-heading h3 { margin: 0 0 3px; color: #43506a; font-size: 11px; }
.merge-section-title p { margin: 0; color: #929bad; font-size: 9px; }
.campaign-correction-wrap { max-height: 260px; overflow: auto; border: 1px solid #e7eaf1; border-radius: 8px; }
.campaign-correction-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.campaign-correction-table th { position: sticky; top: 0; z-index: 1; padding: 9px 11px; border-bottom: 1px solid #e6e9f0; color: #78839a; background: #f7f8fc; font-size: 8px; text-align: left; }
.campaign-correction-table td { padding: 7px 9px; border-bottom: 1px solid #f0f2f6; color: #5a657c; font-size: 9px; }
.campaign-correction-table tr:last-child td { border-bottom: 0; }
.campaign-correction-table td:first-child { width: 42%; overflow-wrap: anywhere; }
.campaign-correction-table input { width: 100%; min-height: 32px; padding: 6px 9px; border: 1px solid #e0e5ef; border-radius: 6px; outline: 0; color: #37445e; background: #fff; font-size: 9px; }
.campaign-correction-table input:focus { border-color: #8191dc; box-shadow: 0 0 0 3px #edf0ff; }
.merge-error-list { max-height: 165px; overflow: auto; margin: 12px 0; padding: 9px 12px; border: 1px solid #f0d6d8; border-radius: 7px; color: #934d55; background: #fff8f9; }
.merge-error-list p { margin: 4px 0; font-size: 9px; line-height: 1.45; }
.merge-preview-heading { margin-top: 22px; }
.merge-preview-heading span, .preview-limit { color: #929bad; font-size: 9px; }
.merge-table-wrap { max-height: 370px; }
.merge-table-wrap table { min-width: 1280px; }
.merge-table-wrap th, .merge-table-wrap td { white-space: nowrap; }
.merge-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 14px; padding-top: 13px; border-top: 1px solid #edf0f5; }
.merge-actions > span { color: #8b95a8; font-size: 9px; line-height: 1.45; }
.merge-action-buttons { display: flex; gap: 8px; }
.merge-action-buttons .button { min-height: 36px; font-size: 9px; white-space: nowrap; }
.merge-actions .button:disabled { color: #a5adbb; background: #eef0f5; box-shadow: none; cursor: not-allowed; }
@media (max-width: 620px) {
  .source-upload-step { grid-template-columns: 23px minmax(0, 1fr); }
  .source-upload-step .button { grid-column: 2; justify-self: start; }
  .merge-review { padding: 16px 12px; }
  .merge-review-heading { flex-direction: column; gap: 10px; }
  .merge-stats { gap: 7px; }
  .merge-stats > div { padding: 10px; }
  .merge-stats > div span { font-size: 7px; }
  .merge-actions { align-items: stretch; flex-direction: column; }
  .merge-action-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .merge-action-buttons .button { width: 100%; white-space: normal; }
}

/* A365 brand colors: blue for navigation and actions, red for brand accents. */
:root {
  --brand-blue: #28558f;
  --brand-blue-dark: #1f426f;
  --brand-blue-soft: #edf3fb;
  --brand-red: #c82032;
}

.nav-item:hover { color: var(--brand-blue); background: var(--brand-blue-soft); }
.nav-item:hover .nav-icon { color: var(--brand-blue); }
.nav-item.is-active { color: #fff; background: var(--brand-blue); box-shadow: 0 5px 12px #28558f24; }
.nav-item.is-active .nav-icon { color: #fff; }
.nav-item.is-active:hover { color: #fff; background: var(--brand-blue-dark); }
.nav-item.is-active:hover .nav-icon { color: #fff; }
.sidebar-start-button { background: var(--brand-blue); }
.nav-count { color: var(--brand-blue); background: var(--brand-blue-soft); }
.nav-item.is-active .nav-count { color: var(--brand-blue-dark); background: #fff; }

.change-log-toolbar { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 21px; border-bottom: 1px solid #edf0f5; background: #fcfdff; }
.change-log-toolbar .search-box { width: min(520px, 72%); }
.change-log-toolbar > span, .change-log-pagination > span { color: #818ba0; font-size: 10px; }
.change-log-table-wrap { max-height: min(64vh, 700px); }
.change-log-table { min-width: 1120px; }
.change-log-table th { position: sticky; top: 0; z-index: 1; background: #f5f6fb; }
.change-log-table td { height: 45px; }
.change-log-table .change-log-summary { min-width: 300px; max-width: 460px; height: auto; padding-top: 10px; padding-bottom: 10px; overflow: visible; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.change-log-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 21px; border-top: 1px solid #edf0f5; }
.change-log-pagination > div { display: flex; gap: 7px; }
.change-log-pagination .button { min-height: 32px; font-size: 9px; }

@media (max-width: 620px) {
  .change-log-toolbar { align-items: flex-start; flex-direction: column; padding: 12px; }
  .change-log-toolbar .search-box { width: 100%; max-width: none; }
  .change-log-pagination { align-items: flex-start; flex-direction: column; padding: 12px; }
}

.profile-session { display: flex; align-items: center; gap: 10px; }
.profile-session > span { display: grid; gap: 2px; text-align: right; }
.profile-session strong { color: #34415e; font-size: 10px; }
.profile-session small { color: #8490a2; font-size: 8px; }
.profile-session .button { min-height: 31px; padding: 0 10px; font-size: 9px; }
.admin-security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.admin-security-card { min-width: 0; }
.admin-supervisor-access { grid-column: 1 / -1; }
.admin-form { display: grid; gap: 12px; padding: 18px 21px 21px; }
.admin-form .scope-field input { min-height: 39px; padding: 0 11px; border: 1px solid #e1e6ef; border-radius: 7px; outline: none; color: #34415e; background: #fff; font-size: 11px; }
.admin-form .scope-field input:focus { border-color: #8195df; box-shadow: 0 0 0 3px #657be217; }
.admin-form .button { justify-self: start; min-height: 36px; font-size: 10px; }
.admin-form-help { margin: 0; color: #7f8aa0; font-size: 10px; line-height: 1.55; }
.admin-form-message { min-height: 15px; margin: 0; color: #23835e; font-size: 10px; }
.admin-form-message.is-error { color: #a64b55; }
.supervisor-access-form { grid-template-columns: minmax(240px, 1.4fr) minmax(160px, .7fr) auto; align-items: end; }
.supervisor-access-form .button { min-height: 39px; }
.supervisor-access-table-wrap { max-height: 350px; border-top: 1px solid #edf0f5; }
.supervisor-access-table-wrap th { position: sticky; top: 0; background: #f5f6fb; }
.supervisor-access-table-wrap td { height: 42px; }
.supervisor-access-actions { display: flex; align-items: center; gap: 7px; }
.supervisor-access-actions .button { min-height: 29px; padding: 0 9px; font-size: 9px; white-space: nowrap; }
.account-card { max-width: 760px; }
.account-password-form { max-width: 540px; }

.auth-screen { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; overflow-y: auto; padding: 24px; background: radial-gradient(ellipse at 15% 10%, #e5ecff 0, transparent 38%), #f4f7fb; }
.auth-card { width: min(100%, 410px); padding: 30px; border: 1px solid #e3e8f2; border-radius: 15px; background: #fff; box-shadow: 0 18px 55px #24385d1a; }
.auth-brand { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.auth-brand .a365-logo { width: 125px; height: 52px; object-fit: contain; }
.auth-brand .bn-logo { width: 62px; height: 48px; flex-basis: 62px; }
.auth-card > .eyebrow { margin: 0 0 7px; color: #536dbf; font-size: 9px; }
.auth-card h1 { margin: 0 0 6px; color: #253450; font-size: 27px; }
.auth-description { margin: 0 0 20px; color: #8390a4; font-size: 11px; }
.auth-role-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 8px; background: #f2f4f9; }
.auth-role-tabs button { min-height: 35px; border: 0; border-radius: 6px; color: #78849a; background: transparent; font-size: 10px; font-weight: 700; }
.auth-role-tabs button.is-active { color: #2f4fac; background: #fff; box-shadow: 0 2px 7px #263b7310; }
.auth-form { display: grid; gap: 13px; }
.auth-form > div:not(.auth-message) { display: grid; gap: 12px; }
.auth-form .scope-field input { min-height: 41px; padding: 0 11px; border: 1px solid #e0e6f0; border-radius: 7px; outline: 0; color: #33405a; background: #fff; font-size: 12px; }
.auth-form .scope-field input:focus { border-color: #8294dc; box-shadow: 0 0 0 3px #536dc51a; }
.auth-hint { margin: -3px 0 0; color: #8390a4; font-size: 9px; line-height: 1.5; }
.auth-submit { width: 100%; min-height: 42px; margin-top: 2px; }
.auth-recovery-link { justify-self: center; padding: 4px 8px; border: 0; color: #5068b7; background: transparent; font-size: 10px; }
.auth-message { min-height: 15px; margin: 0; color: #a64b55; font-size: 10px; line-height: 1.5; }
.auth-recovery-form { padding-top: 17px; border-top: 1px solid #edf0f5; }
.auth-recovery-form h2 { margin: 0; color: #293653; font-size: 16px; }
.auth-local-note { margin: 19px 0 0; padding-top: 13px; border-top: 1px solid #edf0f5; color: #909bad; text-align: center; font-size: 9px; }

@media (max-width: 800px) {
  .admin-security-grid { grid-template-columns: 1fr; }
  .admin-supervisor-access { grid-column: 1; }
  .supervisor-access-form { grid-template-columns: 1fr 1fr; }
  .supervisor-access-form .button { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .profile-session { gap: 6px; }
  .profile-session > span { display: none; }
  .topbar-right { gap: 8px; }
  .auth-screen { padding: 14px; }
  .auth-card { padding: 23px 19px; }
  .auth-brand .a365-logo { width: 95px; }
  .auth-brand .bn-logo { width: 50px; flex-basis: 50px; }
  .admin-form { padding: 14px; }
  .supervisor-access-form { grid-template-columns: 1fr; }
  .supervisor-access-form .button { grid-column: 1; }
}
.sidebar-start-button:hover { background: var(--brand-blue-dark); }
.bn-logo { color: var(--brand-red); }
.button-primary,
.record-dialog .button-primary,
.preview-dialog .button-primary { background: var(--brand-blue); box-shadow: 0 4px 11px #28558f24; }
.button-primary:hover,
.record-dialog .button-primary:hover,
.preview-dialog .button-primary:hover { background: var(--brand-blue-dark); }
.scope-field select:focus,
.campaign-correction-table input:focus { border-color: #7897c2; box-shadow: 0 0 0 3px var(--brand-blue-soft); }
.guide-number,
.source-step-number { color: #fff; background: var(--brand-blue); }
.guide-number-muted { color: var(--brand-blue); background: var(--brand-blue-soft); }
.context-icon,
.empty-state-icon,
.register-avatar { color: var(--brand-blue); background: var(--brand-blue-soft); }
.stat-total strong,
.chart-card-heading .eyebrow,
.supervisor-bar-row.is-selected .supervisor-bar-label,
.register-context .eyebrow,
.register-count strong,
.panel-heading .eyebrow,
.record-action,
.merge-review-heading .eyebrow,
.merge-stats strong { color: var(--brand-blue); }
.stat-total::before,
.supervisor-bar-row.is-selected .supervisor-bar-track span,
.supervisor-bar-track span { background: var(--brand-blue); }
.record-action:hover { color: var(--brand-blue-dark); background: var(--brand-blue-soft); }
.merge-preview-heading .eyebrow { color: var(--brand-blue); }


/* Compact registration summary and Excel actions in the page heading. */
.register-page-heading { min-height: 104px; display: grid; grid-template-columns: minmax(285px, .95fr) minmax(0, 2fr); align-items: stretch; gap: 17px; }
.register-heading-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.register-heading-panels { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.register-context { min-width: 0; min-height: 92px; gap: 9px; margin: 0; padding: 11px 12px; border-color: #e3e8f2; border-radius: 9px; box-shadow: 0 3px 12px #24386905; }
.register-avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; font-size: 13px; }
.register-context-copy { min-width: 0; flex: 1; }
.register-context .eyebrow { font-size: 7px; }
.register-context h2 { display: -webkit-box; overflow: hidden; font-size: 9px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.register-context p:not(.eyebrow) { overflow: hidden; font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.register-count strong { font-size: 18px; }
.register-action-card { min-width: 0; min-height: 92px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 11px 12px; border: 1px solid #e3e8f2; border-radius: 9px; background: #fff; box-shadow: 0 3px 12px #24386905; }
.register-action-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.register-action-copy strong { color: #3e4a66; font-size: 9px; }
.register-action-copy span { overflow: hidden; color: #8791a5; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.register-action-controls { min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.register-action-controls > .button, .bulk-action-buttons .button { min-height: 30px; padding: 0 8px; font-size: 8px; white-space: nowrap; }
.bulk-action-buttons { min-width: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.bulk-action-buttons .button span, .register-action-controls > .button span { font-size: 12px; }
@media (max-width: 1100px) {
  .register-page-heading { grid-template-columns: 1fr; gap: 12px; }
  .register-heading-copy { min-height: 82px; }
  .register-heading-panels { grid-column: 1; }
}
@media (max-width: 620px) {
  .register-page-heading { display: grid; align-items: stretch; }
  .register-heading-copy { min-height: 0; }
  .register-heading-panels { grid-template-columns: 1fr; }
  .register-context { min-height: 76px; }
  .register-action-card { align-items: stretch; }
  .register-action-controls { align-items: stretch; flex-direction: column; }
  .bulk-action-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .register-action-controls > .button, .bulk-action-buttons .button { justify-content: center; white-space: normal; }
}


.admin-supervisor-access { grid-column: auto; }
.admin-form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.admin-form-actions .button { min-height: 36px; }
.supervisor-access-form { grid-template-columns: minmax(0, 1fr) minmax(0, .72fr) auto; }
.supervisor-access-actions .button-primary { min-height: 29px; padding: 0 9px; font-size: 9px; white-space: nowrap; }
.admin-recovery-dialog { width: min(560px, calc(100vw - 28px)); }
.admin-recovery-dialog .admin-form { padding: 0; }
.admin-recovery-dialog .dialog-actions { margin-top: 4px; padding-top: 14px; }
@media (max-width: 1100px) {
  .admin-security-grid { grid-template-columns: 1fr; }
  .admin-supervisor-access { grid-column: 1; }
}
@media (max-width: 800px) {
  .supervisor-access-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .supervisor-access-form .button { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .supervisor-access-form { grid-template-columns: 1fr; }
  .supervisor-access-form .button { grid-column: 1; }
}


/* ========================================================
   GESTIÓN DE USUARIOS Y ROLES (NUEVO MÓDULO)
   ======================================================== */
.heading-actions { display: flex; align-items: center; gap: 10px; }

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e2e7f0;
  padding-bottom: 8px;
}
.admin-tab-btn {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .16s ease;
}
.admin-tab-btn:hover {
  color: var(--brand-blue);
  background: var(--brand-blue-soft);
}
.admin-tab-btn.is-active {
  color: #fff;
  background: var(--brand-blue);
  box-shadow: 0 4px 10px #28558f20;
}

.users-toolbar-actions { display: flex; align-items: center; gap: 12px; }
.users-table-wrap { overflow-x: auto; max-height: 600px; }
.users-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 11px; }
.users-table th { padding: 12px 14px; background: #f8fafc; color: #64748b; font-size: 10px; font-weight: 700; border-bottom: 1px solid #e2e8f0; }
.users-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; color: #334155; }
.users-table tbody tr:hover { background: #f8fafc; }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.role-badge.role-admin { color: #1e40af; background: #dbeafe; border: 1px solid #bfdbfe; }
.role-badge.role-supervisor { color: #065f46; background: #d1fae5; border: 1px solid #a7f3d0; }
.role-badge.role-analyst { color: #6b21a8; background: #f3e8ff; border: 1px solid #e9d5ff; }

.status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 700;
}
.status-badge.status-active { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.status-badge.status-inactive { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }

.table-actions { display: flex; align-items: center; gap: 6px; }
.btn-action {
  padding: 4px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-action:hover {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  border-color: #cbd5e1;
}
.btn-action.btn-danger { color: #dc2626; border-color: #fecaca; }
.btn-action.btn-danger:hover { background: #fee2e2; color: #b91c1c; }

/* Grid de Roles */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.role-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 12px #0f172a08;
}
.role-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}
.role-card-title { margin: 0 0 4px; font-size: 16px; color: #1e293b; }
.role-card-desc { margin: 0; color: #64748b; font-size: 11px; line-height: 1.4; }
.role-permissions-title { margin: 0 0 8px; font-size: 10px; font-weight: 700; color: #94a3b8; letter-spacing: .05em; text-transform: uppercase; }
.role-permissions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
  font-size: 11px;
}
.role-permissions-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
}
.perm-check { color: #10b981; font-weight: bold; }
.perm-cross { color: #cbd5e1; font-weight: bold; }
.role-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #64748b;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  cursor: pointer;
  font-size: 11px !important;
  color: #334155 !important;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.readonly-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 15px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}
.user-modal-dialog { width: min(520px, calc(100vw - 28px)); }


/* ========================================================
   PANTALLA DE CARGA Y PROGRESO (LOADING OVERLAY)
   ======================================================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}
.loading-overlay[hidden] {
  display: none !important;
}
.loading-card {
  width: min(440px, 100%);
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 28px 24px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.loading-spinner-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
}
.loading-spinner {
  position: absolute;
  inset: 0;
  border: 4px solid #e2e8f0;
  border-top-color: var(--brand-blue);
  border-right-color: var(--brand-red);
  border-radius: 50%;
  animation: spin 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}
.loading-logo-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  z-index: 1;
  animation: pulse 1.8s ease-in-out infinite;
}
.loading-content {
  width: 100%;
}
.loading-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
}
.loading-desc {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}
.loading-progress-container {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.loading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-blue) 0%, #3b82f6 100%);
  border-radius: 99px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.loading-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
.loading-percent {
  color: var(--brand-blue);
  font-weight: 700;
  font-size: 13px;
}
.loading-time {
  color: #94a3b8;
  font-size: 11px;
}
.loading-hint {
  margin: 0;
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.4;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.94); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
