:root {
    --ink: #17242a;
    --muted: #66747a;
    --line: #dfe6e8;
    --brand: #0d5d61;
    --brand-dark: #083f42;
    --accent: #c78538;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: #eef3f3; }
button, input { font: inherit; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, .9fr) minmax(480px, 1.1fr); }
.auth-brand-panel { min-height: 100vh; display: flex; flex-direction: column; padding: clamp(34px, 5vw, 74px); color: white; background: radial-gradient(circle at 80% 12%, rgba(34,130,134,.32), transparent 33%), linear-gradient(145deg, #17242a 0%, #102d31 58%, #0d5d61 100%); }
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand-mark, .auth-mobile-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: white; background: var(--brand); font-weight: 900; font-size: 19px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { letter-spacing: .06em; }
.auth-brand small { margin-top: 3px; color: #aab8bd; font-size: 12px; }
.auth-brand-copy { max-width: 620px; margin: auto 0; padding: 70px 0; }
.auth-kicker { display: inline-flex; padding: 7px 11px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #d6e4e5; background: rgba(255,255,255,.06); font-size: 11px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.auth-brand-copy h1 { max-width: 590px; margin: 23px 0 18px; font-size: clamp(38px, 5vw, 68px); line-height: .99; letter-spacing: -.055em; }
.auth-brand-copy p { max-width: 560px; margin: 0; color: #c1cfd2; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.65; }
.auth-security-note { display: flex; align-items: center; gap: 13px; padding-top: 25px; border-top: 1px solid rgba(255,255,255,.11); }
.auth-security-note > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; border-radius: 11px; color: #9ce0bc; background: rgba(99,199,148,.13); font-weight: 900; }
.auth-security-note strong, .auth-security-note small { display: block; }
.auth-security-note small { max-width: 500px; margin-top: 4px; color: #97a9ae; line-height: 1.4; }
.auth-form-panel { min-height: 100vh; display: grid; place-items: center; padding: clamp(24px, 5vw, 80px); }
.auth-card { width: min(100%, 490px); padding: clamp(28px, 4vw, 48px); border: 1px solid rgba(207,218,220,.9); border-radius: 26px; background: white; box-shadow: 0 28px 80px rgba(23,36,42,.1); }
.auth-card-heading { margin-bottom: 28px; }
.auth-mobile-mark { display: none; margin: 0 auto 24px; }
/* Centra el logo superior dentro del login */
.auth-card-heading .auth-mobile-mark { justify-self: center; }
.auth-card-heading p, .account-heading p { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.auth-card-heading h2 { margin: 0 0 9px; font-size: clamp(30px, 4vw, 41px); line-height: 1.05; letter-spacing: -.045em; }
.auth-card-heading > span, .account-heading > span { color: var(--muted); line-height: 1.55; }
.auth-card form, .account-card form { display: grid; gap: 18px; }
label > span { display: block; margin-bottom: 7px; color: #405158; font-size: 13px; font-weight: 800; }
label > small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.45; }
input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #cfdadc; border-radius: 12px; color: var(--ink); background: white; }
input:focus { outline: 3px solid rgba(13,93,97,.14); border-color: var(--brand); }
input:disabled { background: #edf2f3; color: #66747a; }
.password-field { position: relative; }
.password-field input { padding-right: 78px; }
.password-field button { position: absolute; top: 7px; right: 7px; min-height: 36px; padding: 0 11px; border: 0; border-radius: 9px; color: var(--brand); background: #eaf2f2; font-size: 12px; font-weight: 850; cursor: pointer; }
.auth-submit { min-height: 50px; margin-top: 3px; border: 0; border-radius: 12px; color: white; background: var(--brand); font-weight: 850; cursor: pointer; box-shadow: 0 12px 25px rgba(13,93,97,.18); }
.auth-submit:hover { background: var(--brand-dark); }
.auth-alert { margin-bottom: 20px; padding: 13px 15px; border: 1px solid transparent; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.auth-alert-error { color: #812d2d; border-color: #e8bcbc; background: #f9e2e2; }
.auth-alert-success { color: #215d45; border-color: #b8ddca; background: #e4f3ec; }
.auth-footer-note { margin: 25px 0 0; color: #89979c; text-align: center; font-size: 11px; }
.account-page { min-height: 100vh; }
.account-topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(20px, 4vw, 58px); color: white; background: var(--ink); }
.account-topbar > a:first-child { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.account-topbar strong, .account-topbar small { display: block; }
.account-topbar small { margin-top: 3px; color: #aab8bd; font-size: 11px; }
.account-back { padding: 10px 14px; border: 1px solid rgba(255,255,255,.15); border-radius: 11px; color: white; text-decoration: none; font-size: 13px; font-weight: 800; }
.account-container { width: min(1120px, calc(100% - 40px)); margin: 48px auto 70px; }
.account-heading { margin-bottom: 28px; }
.account-heading h1 { margin: 0 0 10px; font-size: clamp(34px, 5vw, 52px); letter-spacing: -.045em; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.account-card { padding: clamp(24px, 3vw, 34px); border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 16px 50px rgba(23,36,42,.06); }
.account-card-title { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 25px; }
.account-card-title > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; border-radius: 10px; color: white; background: var(--brand); font-weight: 900; }
.account-card-title h2 { margin: 1px 0 5px; font-size: 20px; }
.account-card-title p { margin: 0; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-mobile-mark { display: grid; }
    .auth-form-panel { min-height: 100vh; }
    .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .auth-form-panel { padding: 16px; }
    .auth-card { padding: 25px 20px; border-radius: 20px; }
    .account-container { width: min(100% - 24px, 1120px); margin-top: 28px; }
    .account-topbar { padding: 10px 12px; }
    .account-topbar .auth-brand-mark { width: 40px; height: 40px; }
    .account-back { padding: 9px 10px; font-size: 11px; }
}

/* Administración de usuarios */
.account-nav { display: flex; align-items: center; gap: 10px; }
.users-container { width: min(1480px, calc(100% - 40px)); margin: 42px auto 70px; }
.users-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.users-stat { min-width: 160px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: white; text-align: right; box-shadow: 0 12px 35px rgba(23,36,42,.05); }
.users-stat strong, .users-stat span { display: block; }
.users-stat strong { font-size: 32px; letter-spacing: -.04em; }
.users-stat span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.users-layout { display: grid; grid-template-columns: minmax(520px, .95fr) minmax(500px, 1.05fr); gap: 22px; align-items: start; }
.user-form-card { position: sticky; top: 20px; }
.user-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.user-active-toggle { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f7f9f9; cursor: pointer; }
.user-active-toggle > input { width: 20px; min-height: 20px; flex: 0 0 20px; accent-color: var(--brand); }
.user-active-toggle > span { margin: 0; }
.user-active-toggle strong, .user-active-toggle small { display: block; }
.user-active-toggle small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.permissions-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 6px; }
.permissions-heading strong, .permissions-heading span { display: block; }
.permissions-heading span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.text-button { padding: 0; border: 0; color: var(--brand); background: transparent; font-size: 12px; font-weight: 850; cursor: pointer; }
.permission-groups { display: grid; gap: 14px; }
.permission-group { display: grid; gap: 9px; margin: 0; padding: 15px; border: 1px solid var(--line); border-radius: 15px; }
.permission-group legend { padding: 0 8px; color: var(--brand); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.permission-option { display: flex; align-items: flex-start; gap: 11px; padding: 11px; border-radius: 11px; cursor: pointer; transition: background .15s ease; }
.permission-option:hover { background: #f1f6f6; }
.permission-option > input { width: 18px; min-height: 18px; margin-top: 2px; flex: 0 0 18px; accent-color: var(--brand); }
.permission-option > span { margin: 0; }
.permission-option strong, .permission-option small { display: block; }
.permission-option strong { color: #304147; font-size: 13px; }
.permission-option small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.4; }
.user-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.user-form-actions .auth-submit { min-width: 180px; margin: 0; padding: 0 18px; }
.secondary-button, .primary-link { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border-radius: 11px; text-decoration: none; font-size: 13px; font-weight: 850; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: white; }
.primary-link { color: white; background: var(--brand); }
.users-list { display: grid; gap: 11px; }
.user-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.user-row.is-disabled { opacity: .68; background: #f4f6f6; }
.user-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--brand); font-weight: 900; }
.user-row-main { min-width: 0; }
.user-row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.user-row-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-main > a { display: block; max-width: 100%; margin-top: 4px; overflow: hidden; color: var(--brand); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; text-decoration: none; }
.user-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.user-badge { padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.user-badge.central { color: #704610; background: #f6e6c9; }
.user-badge.active { color: #215d45; background: #e0f2e9; }
.user-badge.inactive { color: #7c3535; background: #f4dddd; }
.user-badge.manual { color: #72500f; background: #fff0c8; }
.user-row-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.user-row-actions form { display: inline; }
.icon-action { min-height: 34px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--brand); background: white; font-size: 11px; font-weight: 850; text-decoration: none; cursor: pointer; }
.icon-action.danger { color: #9a3b3b; }
.icon-action.manual { color: #72500f; border-color: #e6cf90; background: #fffaf0; }
.denied-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 50% 0, #e4eeee, #eef3f3 45%); }
.denied-card { width: min(100%, 620px); padding: clamp(30px, 5vw, 55px); border: 1px solid var(--line); border-radius: 26px; background: white; text-align: center; box-shadow: 0 25px 80px rgba(23,36,42,.1); }
.denied-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 18px; color: #8b4a20; background: #f6e5d6; font-size: 28px; font-weight: 900; }
.denied-card p { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.denied-card h1 { margin: 0 0 13px; font-size: clamp(30px, 5vw, 46px); line-height: 1.05; letter-spacing: -.045em; }
.denied-card > span:not(.denied-icon) { color: var(--muted); line-height: 1.6; }
.denied-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
@media (max-width: 1100px) {
    .users-layout { grid-template-columns: 1fr; }
    .user-form-card { position: static; }
}
@media (max-width: 700px) {
    .users-container { width: min(100% - 24px, 1480px); margin-top: 28px; }
    .users-heading-row { align-items: stretch; flex-direction: column; }
    .users-stat { text-align: left; }
    .user-fields-grid { grid-template-columns: 1fr; }
    .user-row { grid-template-columns: 40px minmax(0, 1fr); }
    .user-row-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .account-nav { gap: 6px; }
    .account-nav .account-back:first-child { display: none; }
}

/* Histórico de movimientos */
.history-container { width: min(1600px, calc(100% - 40px)); margin: 42px auto 70px; }
.history-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.history-scope-tabs { display: inline-flex; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 12px 35px rgba(23,36,42,.05); }
.history-scope-tabs a { min-width: 125px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 850; }
.history-scope-tabs a.active { color: white; background: var(--brand); }
.history-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.history-stats article { min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; padding: 19px 21px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 12px 35px rgba(23,36,42,.045); }
.history-stats span { color: var(--muted); font-size: 12px; font-weight: 700; }
.history-stats strong { font-size: 32px; letter-spacing: -.045em; }
.history-filter-card { margin-bottom: 18px; padding: 20px; }
.history-filters { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 13px !important; align-items: end; }
.history-filters label > span { margin-bottom: 6px; }
.history-filters input, .history-filters select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #cfdadc; border-radius: 11px; color: var(--ink); background: white; }
.history-filters input:focus, .history-filters select:focus { outline: 3px solid rgba(13,93,97,.14); border-color: var(--brand); }
.history-filter-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; }
.history-filter-actions .auth-submit { min-width: 155px; min-height: 44px; margin: 0; padding: 0 18px; }
.history-filter-actions .secondary-button { min-height: 44px; }
.history-list-card { padding: 0; overflow: hidden; }
.history-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 25px; border-bottom: 1px solid var(--line); }
.history-list-heading p { margin: 0 0 5px; color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.history-list-heading h2 { margin: 0; font-size: 20px; }
.history-list-heading > span { color: var(--muted); font-size: 12px; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; min-width: 1180px; border-collapse: collapse; }
.history-table th { padding: 12px 15px; border-bottom: 1px solid var(--line); color: #718086; background: #f5f8f8; text-align: left; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.history-table td { padding: 15px; border-bottom: 1px solid #e8eeee; vertical-align: top; font-size: 12px; line-height: 1.5; }
.history-table tbody tr:hover { background: #f9fbfb; }
.history-date { white-space: nowrap; }
.history-date strong, .history-date span, .history-user strong, .history-user span, .history-record strong, .history-record span { display: block; }
.history-date span, .history-user span, .history-record span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.history-user { min-width: 195px; }
.history-user strong, .history-record strong { max-width: 285px; overflow-wrap: anywhere; }
.history-action { display: inline-flex; padding: 5px 8px; border-radius: 999px; white-space: nowrap; font-size: 9px; font-weight: 900; letter-spacing: .045em; }
.history-action.success { color: #215d45; background: #e0f2e9; }
.history-action.warning { color: #7b551f; background: #f8ebd4; }
.history-action.danger { color: #8a3535; background: #f4dddd; }
.history-action.neutral { color: #3f5961; background: #e6eef0; }
.history-module { display: inline-block; min-width: 105px; color: var(--brand); }
.history-record { min-width: 220px; }
.history-detail { min-width: 310px; max-width: 460px; color: #4d5e64; overflow-wrap: anywhere; }
.history-empty { display: grid; gap: 7px; place-items: center; padding: 70px 20px; text-align: center; }
.history-empty strong { font-size: 20px; }
.history-empty span { max-width: 590px; color: var(--muted); line-height: 1.55; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px; border-top: 1px solid var(--line); }
.history-pagination a, .history-pagination span { min-height: 38px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--brand); background: white; text-decoration: none; font-size: 12px; font-weight: 850; }
.history-pagination span { color: var(--muted); }
@media (max-width: 1180px) {
    .history-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .history-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .history-heading-row { align-items: stretch; flex-direction: column; }
    .history-scope-tabs { align-self: flex-start; }
}
@media (max-width: 700px) {
    .history-container { width: min(100% - 24px, 1600px); margin-top: 28px; }
    .history-filters { grid-template-columns: 1fr; }
    .history-filter-actions { grid-column: auto; }
    .history-stats { grid-template-columns: 1fr 1fr; }
    .history-list-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
    .history-stats { grid-template-columns: 1fr; }
    .history-scope-tabs { width: 100%; }
    .history-scope-tabs a { min-width: 0; flex: 1; }
}

/* =========================================================
   Identidad visual CRM FISCALMX · Acceso y administración
   ========================================================= */
:root {
    --ink: #091e3b;
    --muted: #64778b;
    --line: #d8e4ee;
    --brand: #0b4f8a;
    --brand-dark: #072f59;
    --accent: #36a6d8;
}
body {
    background:
      radial-gradient(circle at 100% 0, rgba(54,166,216,.08), transparent 31%),
      linear-gradient(180deg, #f5f9fc 0%, #eef4f8 100%);
}
.auth-brand-panel {
    background:
      radial-gradient(circle at 79% 12%, rgba(54,166,216,.35), transparent 34%),
      radial-gradient(circle at 10% 90%, rgba(22,116,173,.18), transparent 34%),
      linear-gradient(145deg, #071d3a 0%, #092b52 58%, #0b4f8a 100%);
}
.auth-brand-mark,
.auth-mobile-mark {
    background: linear-gradient(145deg, #39a9dc 0%, #0b4f8a 68%, #07345f 100%);
    box-shadow: 0 12px 32px rgba(0,0,0,.24), inset 0 0 0 1px rgba(255,255,255,.18);
}
.auth-brand small { color: #b3c7d7; }
.auth-kicker {
    color: #d8effa;
    border-color: rgba(118,202,238,.28);
    background: rgba(54,166,216,.10);
}
.auth-brand-copy p { color: #c3d3df; }
.auth-security-note { border-color: rgba(255,255,255,.13); }
.auth-card,
.account-card,
.users-stat,
.history-scope-tabs,
.history-stats article {
    border-color: var(--line);
    box-shadow: 0 22px 65px rgba(9,30,59,.09);
}
.auth-card-heading p,
.account-heading p,
.history-list-heading p { color: #1681ba; }
input:focus,
select:focus {
    outline-color: rgba(54,166,216,.20);
    border-color: var(--brand);
}
.password-field button { color: #0b5f96; background: #e7f4fb; }
.auth-submit,
.primary-link {
    background: linear-gradient(110deg, #0b4f8a 0%, #1674ad 100%);
    box-shadow: 0 12px 25px rgba(11,79,138,.20);
}
.auth-submit:hover,
.primary-link:hover { background: linear-gradient(110deg, #073d70 0%, #0e6399 100%); }
.account-topbar {
    background:
      radial-gradient(circle at 85% 0, rgba(54,166,216,.20), transparent 30%),
      linear-gradient(100deg, #071d3a 0%, #092b52 72%, #0b4f8a 100%);
}
.account-topbar small { color: #b3c7d7; }
.account-back { border-color: rgba(139,207,236,.24); }
.account-back:hover { background: rgba(54,166,216,.10); }
.account-card-title > span,
.user-avatar { background: linear-gradient(145deg, #36a6d8, #0b4f8a); }
.user-active-toggle,
.permission-option:hover { background: #f3f8fb; }
.permission-group legend,
.text-button,
.user-row-main > a,
.icon-action { color: var(--brand); }
.history-scope-tabs a.active { background: linear-gradient(110deg, #0b4f8a, #1674ad); }
.history-table th { background: #edf5fa; color: #587085; }
.denied-page {
    background: radial-gradient(circle at 50% 0, #e5f2f9, #eef4f8 47%);
}


/* Identidad institucional FISCALMX dentro de los accesos */
.auth-brand-mark-logo {
    padding: 6px;
    overflow: hidden;
    background: rgba(255,255,255,.97);
    box-shadow: 0 12px 32px rgba(0,0,0,.18), inset 0 0 0 1px rgba(8,63,66,.08);
}
.auth-brand-mark-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* CRM FISCALMX */
.auth-brand-mark,.auth-mobile-mark{font-size:15px;font-weight:950;letter-spacing:-.04em}.fiscalmx-wordmark strong{letter-spacing:.08em}.fiscalmx-wordmark small{letter-spacing:.02em}


/* CRM RE&OR · navegación sin parpadeo */
@view-transition {
  navigation: auto;
}
html {
  min-height: 100%;
  background: #eef3f3;
}
.account-topbar { view-transition-name: reor-account-topbar; }
::view-transition-old(root),
::view-transition-new(root),
::view-transition-old(reor-account-topbar),
::view-transition-new(reor-account-topbar) {
  animation: none;
}

/* Permisos por apartado · CRM 26 */
.permission-group legend{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}
.permission-group-toggle{border:0;background:transparent;color:#0b6fa8;font:inherit;font-size:12px;font-weight:800;cursor:pointer;padding:4px 0}
.permission-group-toggle:hover{text-decoration:underline}
.permission-groups{align-items:start}

/* =========================================================
   CRM RE&OR v3.0 · Acceso y administración institucional
   ========================================================= */
:root {
  --ink: #1A2B33;
  --muted: #6B8899;
  --line: #d9e4e2;
  --brand: #1B979A;
  --brand-dark: #043035;
  --accent: #C07A25;
  --bone: #F5F0E8;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(27,151,154,.09), transparent 30%),
    radial-gradient(circle at 0 100%, rgba(192,122,37,.055), transparent 28%),
    linear-gradient(180deg, #f7f9f7, #eef3f1);
}

.auth-brand-panel {
  background:
    radial-gradient(circle at 78% 12%, rgba(27,151,154,.35), transparent 34%),
    radial-gradient(circle at 8% 92%, rgba(192,122,37,.12), transparent 32%),
    linear-gradient(145deg, #03282c 0%, #043035 52%, #07575b 100%);
}

.auth-brand-mark,
.auth-mobile-mark {
  background: #fffefa;
  box-shadow: 0 14px 34px rgba(0,0,0,.24), inset 0 0 0 1px rgba(4,48,53,.08);
}

.auth-brand strong {
  color: #fffefa;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: .025em;
}

.auth-brand small {
  color: rgba(245,240,232,.65);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.auth-kicker {
  color: #d9f4f0;
  border-color: rgba(115,225,218,.28);
  background: rgba(27,151,154,.13);
}

.auth-brand-copy p {
  color: rgba(245,240,232,.78);
}

.auth-security-note {
  border-color: rgba(245,240,232,.13);
}

.auth-card,
.account-card,
.users-stat,
.history-scope-tabs,
.history-stats article {
  border-color: rgba(4,48,53,.11);
  background: rgba(255,254,250,.98);
  box-shadow: 0 24px 68px rgba(4,48,53,.10);
}

.auth-card-heading p,
.account-heading p,
.history-list-heading p {
  color: var(--brand);
}

.auth-card-heading h2,
.account-heading h1 {
  color: var(--brand-dark);
}

input,
select {
  color: var(--ink);
  border-color: #cedbd8;
  background: #fffefa;
}

input:focus,
select:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(27,151,154,.15);
}

.password-field button {
  color: #08777a;
  background: #e3f3f1;
}

.auth-submit,
.primary-link {
  background: linear-gradient(112deg, #075459 0%, #1B979A 100%);
  box-shadow: 0 12px 26px rgba(27,151,154,.20);
}

.auth-submit:hover,
.primary-link:hover {
  background: linear-gradient(112deg, #043035 0%, #117a7d 100%);
}

.account-topbar {
  background:
    radial-gradient(circle at 86% 0, rgba(27,151,154,.22), transparent 30%),
    linear-gradient(100deg, #03282c 0%, #043035 72%, #07575b 100%);
}

.account-topbar small {
  color: rgba(245,240,232,.65);
}

.account-back {
  border-color: rgba(126,224,220,.28);
}

.account-back:hover {
  background: rgba(27,151,154,.13);
}

.account-card-title > span,
.user-avatar {
  background: linear-gradient(145deg, #1B979A, #075459);
}

.user-active-toggle,
.permission-option:hover {
  background: #f1f7f5;
}

.permission-group {
  border-color: #d9e5e2;
  background: rgba(255,254,250,.72);
}

.permission-group legend,
.text-button,
.user-row-main > a,
.icon-action {
  color: #08777a;
}

.history-scope-tabs a.active {
  background: linear-gradient(112deg, #075459, #1B979A);
}

.history-table th {
  color: #607984;
  background: rgba(245,240,232,.45);
}

.denied-page {
  background: radial-gradient(circle at 50% 0, #e2f3f0, #eef3f1 47%);
}
