:root {
  --brand: #ff9937; --brand-dark: #ad4c04; --brand-soft: #fff0e2; --ink: #19212d;
  --muted: #667080; --line: #e7e8eb; --white: #fff; --surface: #f7f8fa;
  --danger: #b92334; --success: #247443; --sidebar: 225px; --header: 82px;
  --shadow: 0 10px 35px rgba(26,36,48,.07); --radius: 18px;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--ink); font-size: 15px; font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #eff1f3; }
body::before { content: ''; position: fixed; inset: 0; background: linear-gradient(115deg,rgba(20,29,35,.22),rgba(20,29,35,.08)),url('./assets/fondo.jpg') center center/cover no-repeat; z-index: -2; }
button,input,select,textarea { font: inherit; }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 3px; }
button,input,textarea,select { transition: background .16s, border-color .16s, box-shadow .16s; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { font-weight: 650; letter-spacing: -.035em; }
h1 { font-size: 32px; line-height: 1.2; }
h2 { font-size: 24px; }
h3 { font-size: 17px; }
p { line-height: 1.55; }
small { font-size: 12px; }
.icon { width: 22px; height: 22px; flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line); background: #fff; min-height: 43px; padding: 10px 17px; border-radius: 10px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.button:hover { background: #f4f5f7; border-color: #cdd1d8; }
.button.primary { background: var(--brand); border-color: var(--brand); color: #261b10; box-shadow: 0 4px 12px rgba(255,153,55,.17); }
.button.primary:hover { background: #ffa64f; border-color: #ffa64f; }
.button.danger { background: var(--danger); border-color: var(--danger); color: white; }
.button.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.button.ghost:hover { background: #f1f2f5; }
.button.small { min-height: 35px; padding: 7px 12px; font-size: 12px; }
.button .icon { width: 18px; height: 18px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #647083; flex-shrink: 0; }
.icon-button:hover { color: var(--brand-dark); background: var(--brand-soft); }
.icon-button.danger:hover { color: var(--danger); background: #fff0f1; }
.icon-button .icon { width: 19px; height: 19px; }
.text-button { border: 0; background: transparent; color: var(--brand-dark); padding: 3px 0; font-size: 13px; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 6px; background: #f0f2f5; color: #5e6877; font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.badge.orange { background: var(--brand-soft); color: var(--brand-dark); }
.badge.green { background: #eaf5ef; color: #21693d; }
.badge.red { background: #ffedef; color: var(--danger); }
.badge .icon { width: 13px; height: 13px; }
.spinner { width: 24px; height: 24px; border: 2px solid #e6ded7; border-top-color: var(--brand-dark); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot-screen { min-height: 100dvh; display: flex; justify-content: center; align-items: center; gap: 20px; flex-direction: column; background: rgba(255,255,255,.96); color: var(--muted); text-align: center; padding: 30px; }
.boot-screen img { margin-bottom: 10px; max-width: 80vw; }
.login-screen,.error-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 36px 20px; }
.login-card { width: min(100%, 455px); padding: 38px 40px 29px; background: rgba(255,255,255,.985); border: 1px solid rgba(255,255,255,.8); border-radius: 24px; box-shadow: 0 25px 85px rgba(22,31,44,.24),0 2px 8px rgba(22,31,44,.04); text-align: center; }
.login-logo { width: 244px; max-width: 90%; display: block; margin: 0 auto 25px; }
.login-heading h1 { font-size: 28px; letter-spacing: -.045em; }
.login-heading p { color: var(--muted); font-size: 13px; margin-top: 9px; }
.login-form { text-align: left; margin-top: 28px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field + .field { margin-top: 17px; }
.field label,.field-label { font-size: 12px; font-weight: 600; color: #3a4554; }
.field small { line-height: 1.45; color: var(--muted); font-size: 11px; }
input:not([type=checkbox]), select,textarea { width: 100%; min-height: 44px; padding: 11px 12px; border: 1px solid #dfe2e7; border-radius: 9px; color: var(--ink); background: #fff; outline: none; }
input::placeholder,textarea::placeholder { color: #89909e; }
input:not([type=checkbox]):focus,select:focus,textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,153,55,.13); }
input[readonly] { background: #f5f6f8; color: var(--muted); }
textarea { resize: vertical; min-height: 83px; line-height: 1.45; }
.input-wrap { display: flex; align-items: center; position: relative; }
.input-wrap > .icon { position: absolute; left: 14px; color: #8891a0; width: 19px; height: 19px; pointer-events: none; }
.input-wrap input { padding-left: 43px; padding-right: 43px; min-height: 48px; }
.input-wrap > .icon-button { position: absolute; right: 5px; width: 35px; }
.login-options { margin: 19px 0 25px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; line-height: 1.4; cursor: pointer; font-size: 13px; }
input[type=checkbox] { accent-color: #c25b07; width: 16px; height: 16px; margin: 0; flex-shrink: 0; cursor: pointer; }
.login-submit { width: 100%; min-height: 49px; font-size: 15px; }
.login-submit .icon { margin-left: 5px; }
.login-note { font-size: 11px; color: #7d8694; margin-top: 24px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.login-note .icon { width: 13px; height: 13px; }
.form-error { margin: 0 0 16px; padding: 11px 13px; color: #a01e30; background: #fff0f1; border: 1px solid #f3d1d6; border-radius: 8px; font-size: 12px; text-align: left; line-height: 1.5; }
.error-page h1 { font-size: 24px; margin-bottom: 16px; }
.error-page p { color: var(--muted); margin-bottom: 25px; }
.shell { min-height: 100dvh; }
.topbar { position: fixed; top: 16px; left: 16px; right: 16px; z-index: 20; min-height: var(--header); display: flex; align-items: center; gap: 24px; padding: 12px 25px; background: rgba(255,255,255,.965); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.7); border-radius: 17px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; justify-content: center; width: 159px; flex-shrink: 0; }
.brand img { width: 137px; height: 60px; object-fit: contain; }
.top-title { border-left: 1px solid #dce0e5; padding-left: 26px; flex-shrink: 0; font-weight: 650; font-size: 17px; letter-spacing: -.025em; }
.global-search { margin-left: auto; position: relative; flex: 1; max-width: 440px; min-width: 120px; }
.global-search .icon { position: absolute; top: 13px; left: 15px; color: #7c8795; width: 19px; height: 19px; }
.global-search input { background: #f8f9fb; padding-left: 44px; padding-right: 64px; height: 45px; font-size: 13px; border-color: #e7e9ee; }
kbd { position: absolute; top: 14px; right: 13px; background: #edeff3; border: 1px solid #e4e7ec; border-radius: 4px; padding: 1px 5px; color: #838b99; font: 10px inherit; }
.account { position: relative; margin-left: auto; }
.account summary { list-style: none; display: flex; align-items: center; gap: 11px; cursor: pointer; border-radius: 10px; padding: 4px; }
.account summary::-webkit-details-marker { display: none; }
.avatar { width: 39px; height: 39px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #f6e9db; color: #9d4d0e; font-size: 13px; font-weight: 650; flex-shrink: 0; }
.account-name { display: block; font-size: 13px; font-weight: 600; max-width: 154px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role { font-size: 11px; color: var(--muted); display: block; margin-top: 3px; }
.account summary > .icon { width: 15px; height: 15px; margin-left: 4px; }
.account-popup { position: absolute; right: 0; top: calc(100% + 15px); width: 245px; background: white; border: 1px solid var(--line); border-radius: 13px; padding: 8px; box-shadow: 0 18px 50px rgba(23,32,45,.16); }
.account-popup .nav-button { min-height: 42px; font-size: 13px; }
.account-popup .popup-caption { padding: 11px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.mobile-menu { display: none; }
.sidebar { position: fixed; left: 16px; top: 112px; bottom: 16px; z-index: 21; width: var(--sidebar); background: rgba(255,255,255,.97); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,.9); border-radius: 16px; display: flex; flex-direction: column; padding: 21px 13px; box-shadow: var(--shadow); overflow-y: auto; }
.nav-caption { font-size: 10px; color: #8c929d; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; padding: 7px 15px 13px; }
.nav-caption.second { margin-top: 23px; }
.nav-button { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 47px; border: 0; padding: 11px 14px; background: transparent; border-radius: 10px; color: #647082; text-align: left; font-size: 13px; margin-bottom: 5px; }
.nav-button:hover { background: #f5f6f8; color: var(--ink); }
.nav-button.active { background: var(--brand-soft); color: #a74b08; font-weight: 600; }
.nav-button .icon { width: 20px; height: 20px; }
.nav-button .nav-count { margin-left: auto; font-size: 10px; border: 1px solid #efdcca; border-radius: 5px; padding: 1px 5px; }
.sidebar-bottom { margin-top: auto; padding-top: 26px; }
.sidebar-meta { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding: 18px 14px 0; font-size: 10px; color: #89929e; }
.sidebar-meta .icon { width: 12px; height: 12px; }
.workspace { margin-left: calc(var(--sidebar) + 16px); padding: 148px 42px 32px; position: relative; min-height: 100dvh; }
.workspace::before { content: ''; position: fixed; inset: 105px 0 0 calc(var(--sidebar) + 26px); background: linear-gradient(180deg,rgba(36,46,52,.38),rgba(36,46,52,.08) 36%,rgba(245,246,248,.93) 93%); z-index: -1; pointer-events: none; }
.page-inner { max-width: 1500px; margin: 0 auto; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 29px; min-height: 77px; }
.welcome h1 { font-size: clamp(27px,2.6vw,39px); color: white; text-shadow: 0 2px 8px rgba(0,0,0,.15); margin-bottom: 9px; }
.welcome p { color: rgba(255,255,255,.95); font-size: 15px; }
.date-pill { border: 1px solid rgba(255,255,255,.32); background: rgba(255,255,255,.14); backdrop-filter: blur(14px); padding: 10px 14px; border-radius: 9px; color: white; font-size: 11px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.date-pill .icon { width: 16px; height: 16px; }
.menu-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.category-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid rgba(255,255,255,.45); padding: 8px 13px; background: rgba(255,255,255,.85); color: #4d5968; border-radius: 8px; font-size: 11px; font-weight: 600; }
.chip:hover,.chip.active { background: white; color: #95420a; border-color: white; }
.chip.active { box-shadow: inset 0 -2px var(--brand); }
.menu-total { font-size: 11px; color: #fff; white-space: nowrap; text-shadow: 0 1px 4px #333; }
.modules-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.module-card { position: relative; border: 1px solid rgba(255,255,255,.85); border-radius: var(--radius); background: rgba(255,255,255,.97); backdrop-filter: blur(10px); box-shadow: 0 6px 22px rgba(26,36,45,.07); min-width: 0; transition: transform .17s,box-shadow .17s,border-color .17s; }
.module-card:hover { transform: translateY(-3px); box-shadow: 0 13px 30px rgba(24,33,44,.12); border-color: #f6c99f; }
.card-link { padding: 24px 22px 19px; display: block; height: 100%; border-radius: inherit; }
.card-top { display: flex; gap: 16px; align-items: flex-start; }
.module-icon { background: #fff1e5; color: #c65c0e; width: 54px; height: 54px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.module-icon .icon { width: 27px; height: 27px; stroke-width: 1.65; }
.card-text { min-width: 0; padding-top: 1px; }
.card-text h2 { font-size: 17px; line-height: 1.2; margin: 0 0 9px; letter-spacing: -.025em; overflow-wrap: anywhere; }
.card-text p { color: #6e7887; font-size: 12px; line-height: 1.55; min-height: 38px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding-right: 31px; gap: 8px; font-size: 10px; color: #7e8997; }
.card-open { display: inline-flex; align-items: center; gap: 5px; color: #905123; font-weight: 500; }
.card-open .icon { width: 13px; height: 13px; }
.favorite { position: absolute; bottom: 12px; right: 12px; width: 29px; height: 29px; color: #8d96a3; }
.favorite .icon { width: 16px; height: 16px; }
.favorite.selected { color: #a9550d; }
.favorite.selected .icon { fill: #ffd6ac; }
.menu-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 25px; padding-top: 18px; font-size: 11px; color: #586573; }
.menu-footer .text-button { font-size: 11px; }
.menu-footer p { display: flex; align-items: center; gap: 6px; }
.menu-footer .icon { width: 13px; height: 13px; }
.empty-state { grid-column: 1 / -1; padding: 55px 25px; background: rgba(255,255,255,.96); border-radius: 17px; text-align: center; }
.empty-state > .icon { color: #b76b2b; width: 36px; height: 36px; margin-bottom: 16px; }
.empty-state h2 { margin-bottom: 11px; font-size: 22px; }
.empty-state p { font-size: 13px; color: var(--muted); max-width: 480px; margin: auto; }
.empty-state .button { margin-top: 22px; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #fff; margin-bottom: 24px; }
.admin-heading p { margin-top: 9px; font-size: 13px; color: #f5f6f7; }
.admin-heading h1 { font-size: 32px; }
.admin-heading .button { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(10px); }
.admin-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { border-radius: 12px; background: rgba(255,255,255,.96); display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.stat-card .module-icon { width: 40px; height: 40px; border-radius: 10px; }
.stat-card .module-icon .icon { width: 21px; height: 21px; }
.stat-value { font-size: 22px; line-height: 1.2; font-weight: 650; display: block; }
.stat-label { color: var(--muted); font-size: 11px; display: block; margin-top: 2px; }
.admin-panel { background: #fff; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.admin-tabs { display: flex; gap: 20px; padding: 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.admin-tab { min-height: 61px; display: inline-flex; align-items: center; gap: 8px; padding: 14px 2px; border: 0; border-bottom: 2px solid transparent; color: #727b89; background: white; font-weight: 500; font-size: 12px; white-space: nowrap; }
.admin-tab.active { color: #9d490d; border-color: var(--brand); font-weight: 650; }
.admin-tab .icon { width: 17px; height: 17px; }
.admin-toolbar { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.admin-toolbar h2 { font-size: 18px; }
.admin-toolbar p { font-size: 11px; color: var(--muted); margin-top: 5px; }
.toolbar-actions { display: flex; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: .065em; color: #828a97; background: #f9fafb; padding: 12px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 600; }
td { padding: 14px 16px; border-bottom: 1px solid #edf0f3; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }
th:first-child,td:first-child { padding-left: 24px; }
th:last-child,td:last-child { padding-right: 24px; }
.cell-title { display: flex; gap: 11px; align-items: center; min-width: 165px; }
.cell-title .module-icon { width: 36px; height: 36px; border-radius: 9px; }
.cell-title .module-icon .icon { width: 20px; height: 20px; }
.cell-title strong { font-size: 12px; display: block; font-weight: 600; }
.cell-title small { color: #86909b; font-size: 10px; display: block; margin-top: 5px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-title .avatar { width: 33px; height: 33px; font-size: 10px; }
.table-actions { display: flex; justify-content: flex-end; gap: 3px; }
.table-actions .icon-button { width: 30px; height: 30px; }
.table-actions .icon { width: 16px; height: 16px; }
.align-right { text-align: right; }
.table-foot { padding: 15px 24px; font-size: 11px; color: #7b8491; background: #fcfcfd; border-top: 1px solid var(--line); }
.table-empty { padding: 38px 24px; color: var(--muted); text-align: center; }
.table-inline-button { background: none; border: 0; color: #9b4b12; font-size: 11px; padding: 6px 0; text-align: left; }
.table-inline-button:hover { text-decoration: underline; }
.config-body { padding: 24px; }
.notice { padding: 15px 16px; background: #fff7ee; border: 1px solid #f2dfc9; border-radius: 10px; display: flex; gap: 11px; color: #89511c; font-size: 12px; line-height: 1.55; }
.notice .icon { width: 19px; height: 19px; margin-top: 1px; }
.notice.neutral { background: #f5f7fa; color: #5e6a7c; border-color: #e8ebf0; }
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 24px; }
.config-card { border: 1px solid var(--line); padding: 21px; border-radius: 12px; min-width: 0; }
.config-card h3 { margin-bottom: 17px; }
.config-card p { font-size: 12px; color: var(--muted); }
.config-card pre { margin-top: 16px; }
.detail-row { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid #eef0f2; font-size: 11px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row span { color: var(--muted); }
.detail-row strong { text-align: right; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
pre { background: #f7f8fa; border: 1px solid #e6e9ee; border-radius: 9px; padding: 15px; font-size: 11px; line-height: 1.65; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: #3d4857; }
code { font-family: Consolas, 'Courier New', monospace; font-size: .92em; }
.dialog { border: 1px solid #e7e8ec; border-radius: 18px; padding: 0; width: min(720px,calc(100vw - 32px)); max-height: calc(100dvh - 44px); color: var(--ink); box-shadow: 0 25px 100px rgba(19,27,39,.25); overflow: auto; }
.dialog[open] { display: flex; flex-direction: column; }
.dialog > form { min-height: 0; display: flex; flex-direction: column; }
.dialog .dialog-body { min-height: 0; overflow-y: auto; }
.dialog .dialog-head,.dialog .dialog-foot { flex-shrink: 0; }
.dialog::backdrop { background: rgba(18,28,40,.45); backdrop-filter: blur(4px); }
.dialog-head { padding: 22px 27px 20px; display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 22px; }
.dialog-head p { font-size: 12px; color: var(--muted); margin-top: 7px; }
.dialog-body { padding: 23px 27px; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 17px 27px; border-top: 1px solid var(--line); background: #fcfcfd; border-radius: 0 0 18px 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; }
.form-grid .field + .field { margin-top: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }
.dialog-body .notice { margin-bottom: 20px; }
.field-checkboxes { display: flex; gap: 25px; flex-wrap: wrap; margin-top: 20px; }
.form-section { margin-top: 24px; padding-top: 21px; border-top: 1px solid var(--line); }
.form-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.form-section-head h3 { font-size: 15px; margin-bottom: 5px; }
.form-section-head p { font-size: 11px; color: var(--muted); }
.form-section-head .text-button { font-size: 11px; }
.icon-picker { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.icon-option { width: 34px; height: 34px; background: #f7f8fa; border: 1px solid #e9ecf1; border-radius: 8px; color: #687386; display: flex; align-items: center; justify-content: center; }
.icon-option .icon { width: 18px; height: 18px; }
.icon-option.active { background: var(--brand-soft); color: #ae5210; border-color: #e7b280; }
.permissions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 280px; overflow-y: auto; padding: 3px; }
.permission-item { border: 1px solid #e5e8ed; border-radius: 9px; padding: 11px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.permission-item:has(input:checked) { background: #fff9f3; border-color: #f0c99d; }
.permission-item .icon { color: #a96d3a; width: 18px; height: 18px; }
.permission-item strong { display: block; font-size: 11px; font-weight: 600; }
.permission-item small { display: block; color: #828b97; font-size: 10px; margin-top: 3px; }
.permission-item input { margin-left: auto; }
.permission-item .permission-text { min-width: 0; overflow-wrap: anywhere; }
.permission-item:has(input:disabled) { opacity: .65; }
.permissions-tools { display: flex; gap: 12px; flex-wrap: wrap; }
.account-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.account-summary .avatar { width: 52px; height: 52px; font-size: 17px; }
.account-summary h3 { font-size: 18px; margin-bottom: 6px; }
.account-summary p { color: var(--muted); font-size: 12px; }
.confirm-dialog { max-width: 445px; }
.confirm-dialog .dialog-body p { font-size: 13px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 80; background: #253140; color: white; border-radius: 10px; box-shadow: 0 8px 30px rgba(22,31,44,.2); padding: 14px 21px; font-size: 12px; max-width: min(520px,calc(100vw - 36px)); line-height: 1.5; }
.toast.error { background: #9c2635; }
.mobile-overlay { display: none; }
.noscript { position: fixed; inset: 20px; padding: 30px; background: white; z-index: 100; }
@media (min-width: 1850px) { .modules-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } .workspace { padding-top: 175px; } .card-link { padding: 27px 24px 20px; } }
@media (max-width: 1270px) {
  :root { --sidebar: 200px; }
  .topbar { gap: 15px; padding-left: 15px; padding-right: 20px; }
  .brand { width: 156px; }
  .top-title { font-size: 15px; padding-left: 17px; }
  .global-search { max-width: 350px; }
  .account-name { max-width: 115px; }
  .workspace { padding-left: 28px; padding-right: 28px; }
  .card-link { padding-left: 18px; padding-right: 18px; }
  .card-top { gap: 12px; }
  .module-icon { width: 45px; height: 45px; border-radius: 11px; }
  .card-text h2 { font-size: 15px; }
  .card-text p { font-size: 11px; }
  .date-pill { display: none; }
}
@media (max-width: 1070px) {
  .modules-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .top-title { display: none; }
  .global-search { max-width: none; }
  .admin-stats { gap: 9px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-label { font-size: 10px; }
  .config-grid { grid-template-columns: 1fr; }
  .admin-tabs { gap: 17px; }
}
@media (max-width: 760px) {
  :root { --header: 68px; --sidebar: 235px; }
  .topbar { top: 10px; left: 10px; right: 10px; min-height: var(--header); padding: 7px 12px; gap: 7px; border-radius: 13px; flex-wrap: wrap; }
  .mobile-menu { display: inline-flex; width: 34px; }
  .brand { width: auto; justify-content: flex-start; margin-right: auto; }
  .brand img { width: 109px; height: 47px; }
  .global-search { order: 5; flex-basis: 100%; margin-top: 2px; max-width: none; }
  .global-search input { height: 38px; min-height: 38px; font-size: 12px; }
  .global-search .icon { top: 10px; width: 17px; height: 17px; }
  kbd { display: none; }
  .account { margin-left: 0; }
  .account summary { gap: 5px; }
  .account-name { display: none; }
  .account-role { display: none; }
  .account summary > .icon { width: 13px; }
  .avatar { width: 34px; height: 34px; font-size: 11px; }
  .account-popup { top: 58px; }
  .sidebar { left: -260px; top: 130px; bottom: 10px; transition: left .2s; z-index: 32; background: white; padding: 18px 13px; }
  .sidebar-open .sidebar { left: 10px; }
  .mobile-overlay { position: fixed; inset: 125px 0 0; background: rgba(17,26,38,.35); z-index: 30; border: 0; backdrop-filter: blur(2px); }
  .sidebar-open .mobile-overlay { display: block; }
  .workspace { margin-left: 0; padding: 153px 20px 24px; }
  .workspace::before { left: 0; top: 120px; }
  .welcome { margin-bottom: 23px; min-height: auto; }
  .welcome h1 { font-size: 26px; }
  .welcome p { font-size: 12px; }
  .menu-toolbar { display: block; }
  .menu-total { display: block; margin: 13px 2px 0; }
  .category-list { gap: 5px; }
  .chip { font-size: 10px; padding: 7px 10px; }
  .modules-grid { gap: 12px; }
  .card-link { padding: 18px 15px 16px; }
  .card-top { flex-direction: column; gap: 13px; }
  .card-text h2 { font-size: 16px; }
  .card-text p { font-size: 11px; min-height: 36px; }
  .card-bottom { margin-top: 18px; font-size: 9px; }
  .card-bottom > .card-category { display: none; }
  .menu-footer { display: block; font-size: 10px; }
  .menu-footer .text-button { margin-top: 9px; }
  .admin-heading h1 { font-size: 28px; }
  .admin-heading p { font-size: 11px; }
  .admin-heading { gap: 12px; }
  .admin-heading .button { min-height: 36px; width: 36px; padding: 8px; }
  .admin-heading .button span { display: none; }
  .admin-stats { grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 15px; }
  .stat-card { display: block; padding: 13px 10px; }
  .stat-card .module-icon { display: none; }
  .stat-value { font-size: 21px; }
  .stat-label { font-size: 9px; line-height: 1.4; margin-top: 5px; }
  .admin-tabs { padding: 0 16px; gap: 19px; }
  .admin-tab { font-size: 11px; min-height: 52px; }
  .admin-toolbar { padding: 18px 16px; flex-wrap: wrap; }
  .admin-toolbar h2 { font-size: 17px; }
  .admin-toolbar .button { font-size: 11px; min-height: 36px; padding: 8px 10px; }
  .admin-toolbar p { font-size: 10px; }
  .table-foot { padding: 13px 16px; font-size: 10px; }
  .config-body { padding: 17px; }
  .config-card { padding: 16px; }
  .notice { padding: 13px; font-size: 11px; }
  .config-grid { margin-top: 17px; gap: 17px; }
}
@media (max-width: 460px) {
  .login-screen { padding: 22px 16px; }
  .login-card { padding: 31px 25px 26px; border-radius: 20px; }
  .login-logo { width: 220px; margin-bottom: 24px; }
  .login-heading h1 { font-size: 25px; }
  .login-heading p { font-size: 12px; }
  .login-form { margin-top: 25px; }
  .login-options { gap: 8px; }
  .login-options .text-button { font-size: 11px; }
  .login-options .checkbox { font-size: 11px; }
  .workspace { padding-left: 15px; padding-right: 15px; }
  .welcome h1 { font-size: 25px; }
  .modules-grid { grid-template-columns: 1fr; }
  .card-top { flex-direction: row; align-items: flex-start; gap: 17px; }
  .card-link { padding: 21px 19px 17px; }
  .module-icon { width: 49px; height: 49px; }
  .card-text h2 { font-size: 17px; }
  .card-text p { font-size: 12px; min-height: 0; }
  .card-bottom { margin-top: 18px; font-size: 10px; }
  .card-bottom > .card-category { display: inline; }
  .form-grid { grid-template-columns: 1fr; gap: 17px; }
  .form-grid .span-2 { grid-column: auto; }
  .dialog { max-height: calc(100dvh - 26px); width: calc(100vw - 22px); border-radius: 14px; }
  .dialog-head { padding: 20px; }
  .dialog-head h2 { font-size: 21px; }
  .dialog-body { padding: 20px; }
  .dialog-foot { padding: 15px 20px; }
  .permissions-grid { grid-template-columns: 1fr; }
  .form-section-head { flex-direction: column; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* v2.1: la navegacion permanece montada mientras el iframe ocupa el area central. */
.sidebar { overflow: hidden; }
.sidebar > nav:first-of-type { flex-shrink: 0; }
.sidebar .access-caption { padding-top: 18px; display: flex; justify-content: space-between; flex-shrink: 0; }
.access-caption span { letter-spacing: 0; }
.sidebar-accesses { flex: 1 1 auto; min-height: 65px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.module-nav { font-size: 12px; min-height: 42px; gap: 10px; margin-bottom: 3px; }
.module-nav > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.module-nav > .icon { flex-shrink: 0; width: 18px; height: 18px; }
.module-nav .nav-external { margin-left: auto; width: 13px; height: 13px; opacity: .7; }
.sidebar-empty { padding: 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.sidebar .sidebar-bottom { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); flex-shrink: 0; }
.sidebar .sidebar-bottom .nav-button { min-height: 37px; padding-top: 7px; padding-bottom: 7px; font-size: 12px; }
.sidebar .sidebar-meta { border: 0; padding-top: 9px; }
.top-title { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace.workspace-embedded { padding: 112px 16px 16px; height: 100vh; height: 100dvh; min-height: 400px; }
.workspace-embedded .page-inner { max-width: none; height: 100%; min-height: 0; }
.embedded-panel { height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; border: 1px solid #e5e8ee; box-shadow: var(--shadow); background: #fff; }
.embedded-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.embedded-heading { display: flex; gap: 13px; align-items: center; min-width: 0; }
.embedded-heading > div { min-width: 0; }
.embedded-heading .module-icon { width: 46px; height: 46px; border-radius: 11px; }
.embedded-heading .module-icon .icon { width: 24px; height: 24px; }
.embedded-heading h1 { font-size: 22px; line-height: 1.25; margin: 3px 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.embedded-heading p { color: var(--muted); font-size: 11px; line-height: 1.4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.embedded-eyebrow { font-size: 9px; font-weight: 650; letter-spacing: .09em; color: #ad4c04; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.embedded-eyebrow span { font-weight: 400; color: var(--muted); letter-spacing: 0; }
.embedded-actions { display: flex; gap: 6px; flex-shrink: 0; }
.button.compact { min-height: 36px; padding: 8px 11px; font-size: 11px; gap: 6px; }
.button.compact .icon { width: 15px; height: 15px; }
.embedded-info { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 9px 20px; background: #fcfcfd; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.frame-status { font-size: 10px; color: var(--muted); line-height: 1.5; }
.frame-status.waiting::before { content: ''; display: inline-block; height: 8px; width: 8px; border: 1.5px solid #e5c4a3; border-top-color: #ad4c04; border-radius: 50%; margin-right: 6px; animation: spin 1s linear infinite; }
.embedded-info .text-button { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; flex-shrink: 0; }
.embedded-info .text-button .icon { width: 14px; height: 14px; }
.frame-help { padding: 13px 20px; background: #fff8ef; color: #744b25; font-size: 12px; line-height: 1.55; border-bottom: 1px solid #f6e0c7; flex-shrink: 0; max-height: 180px; overflow-y: auto; }
.frame-help p { margin-top: 5px; }
.frame-container { min-height: 0; flex: 1 1 auto; background: #fff; position: relative; }
.access-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.frame-restriction { height: 100%; min-height: 170px; overflow-y: auto; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; background: #fafbfc; }
.frame-restriction > .icon { width: 35px; height: 35px; color: #ad4c04; flex-shrink: 0; }
.frame-restriction h2 { font-size: 22px; }
.frame-restriction p { max-width: 590px; color: var(--muted); line-height: 1.6; }
.access-mode-field { margin-top: 20px; }
.opening-label { color: var(--brand-dark) !important; margin-top: 3px; }
@media (max-width: 1180px) {
  .embedded-heading { gap: 10px; }
  .embedded-heading h1 { font-size: 19px; }
  .embedded-actions .button span { display: none; }
  .embedded-actions .button { width: 36px; padding: 8px; }
}
@media (max-width: 760px) {
  .workspace.workspace-embedded { padding: 132px 10px 10px; min-height: 440px; }
  .embedded-toolbar { padding: 12px; gap: 8px; }
  .embedded-heading .module-icon { display: none; }
  .embedded-heading h1 { font-size: 18px; }
  .embedded-heading p { display: none; }
  .embedded-eyebrow { font-size: 8px; }
  .embedded-eyebrow span { display: none; }
  .embedded-actions { gap: 4px; }
  .embedded-actions .button { width: 34px; min-height: 34px; }
  .embedded-info { padding: 8px 12px; align-items: flex-start; }
  .embedded-info .text-button { max-width: 150px; font-size: 9px; line-height: 1.4; text-align: right; }
  .frame-status { font-size: 9px; }
  .embedded-panel { border-radius: 12px; }
  .frame-help { padding: 12px; font-size: 11px; }
  .frame-restriction { padding: 22px; font-size: 12px; justify-content: flex-start; }
  .frame-restriction h2 { font-size: 19px; }
  .frame-restriction .button { font-size: 11px; }
}
@media (max-height: 630px) { .sidebar { overflow-y: auto; } .sidebar-accesses { flex-shrink: 0; min-height: 120px; } }
\n/* v2.5 - Informes AG Studio */
.access-agstudio-zone textarea { min-height: 180px; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 1.5; resize: vertical; }
.agstudio-panel { min-height: 0; }
.agstudio-meta { display: flex; gap: 10px; align-items: center; padding: 8px 20px; border-bottom: 1px solid var(--line); background: #fcfcfd; color: var(--muted); font-size: 10px; flex-shrink: 0; }
.agstudio-meta span { padding-right: 10px; border-right: 1px solid var(--line); }
.agstudio-meta span:last-child { border-right: 0; }
.ag-studio-host { flex: 1 1 auto; min-height: 0; width: 100%; background: #fff; }
.ag-studio-host > * { width: 100%; height: 100%; }
@media (max-width: 760px) {
  .agstudio-meta { padding: 7px 12px; overflow-x: auto; white-space: nowrap; }
  .access-agstudio-zone textarea { min-height: 150px; }
}

.sql-test-row { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:7px; }
.sql-test-row small { margin:0; }
.sql-test-result { margin-top:8px; font-size:11px; color:#217a43; }
.sql-test-result.error { color:#a62828; }

/* v2.5.2 - Carga diferida de AG Studio desde la API */
.frame-loading { min-height: 220px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #667085; font-size: 14px; }
.frame-loading .spinner { width: 22px; height: 22px; }

/* v2.5.8 - KPIs configurables en informes AG Studio */
.kpi-config-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:10px; }
.kpi-config-head label { display:block; margin-bottom:4px; }
.kpi-config-head small { margin:0; }
.kpi-config-list { display:flex; flex-direction:column; gap:10px; }
.kpi-config-row { display:grid; grid-template-columns:minmax(130px,1.25fr) minmax(130px,1fr) minmax(105px,.8fr) minmax(120px,.9fr) 86px 36px; gap:8px; align-items:end; padding:11px; border:1px solid var(--line); border-radius:12px; background:#fafbfc; }
.kpi-config-row .field { min-width:0; }
.kpi-config-row .field label { font-size:10px; }
.kpi-config-row input,.kpi-config-row select { min-width:0; }
.kpi-remove { margin-bottom:1px; }
.agstudio-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:10px; padding:12px 18px; border-bottom:1px solid var(--line); background:#f8fafc; flex-shrink:0; }
.agstudio-kpi { min-width:0; padding:12px 14px; border:1px solid #e6e9ef; border-radius:12px; background:#fff; box-shadow:0 1px 2px rgba(16,24,40,.035); }
.agstudio-kpi span { display:block; color:var(--muted); font-size:10px; font-weight:600; letter-spacing:.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.agstudio-kpi strong { display:block; margin-top:5px; font-size:21px; line-height:1.15; color:#20252b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.agstudio-kpi.has-error strong { color:#a62828; }
@media (max-width: 900px) { .kpi-config-row { grid-template-columns:1fr 1fr; } .kpi-remove { justify-self:end; } }
@media (max-width: 760px) { .agstudio-kpis { display:flex; overflow-x:auto; padding:9px 12px; } .agstudio-kpi { flex:0 0 160px; } .agstudio-kpi strong { font-size:18px; } .kpi-config-row { grid-template-columns:1fr; } .kpi-remove { justify-self:start; } }

/* v2.6.0 - Area de trabajo con un unico informe principal */
.workspace-report-loading .idle-content { gap:12px; flex-direction:row; }
.workspace-empty-message { max-width:520px; text-align:center; display:grid; justify-items:center; gap:10px; color:var(--muted); }
.workspace-empty-message svg { width:42px; height:42px; color:#b5bdc8; }
.workspace-empty-message h2 { margin:0; color:var(--text); font-size:18px; }
.workspace-empty-message p { margin:0 0 8px; line-height:1.55; }
.workspace-report-option { padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:#fafbfc; }


/* v2.6.2 - loader AG Studio y asignacion directa de usuarios */
.agstudio-loading-panel { display:flex; align-items:stretch; justify-content:stretch; min-height:420px; }
.agstudio-loading-screen { flex:1; min-height:420px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:10px; padding:32px; background:#fff; }
.agstudio-loading-screen h2 { margin:10px 0 0; font-size:18px; color:var(--text); }
.agstudio-loading-screen p { margin:0; color:var(--muted); font-size:14px; }
.agstudio-loading-screen small { color:#98a2b3; max-width:520px; }
.agstudio-big-spinner { width:42px; height:42px; border-width:4px; }
.report-user-assignment { border-top:1px solid var(--line); padding-top:18px; margin-top:4px; }
.report-user-tools { display:flex; align-items:center; gap:12px; margin:6px 0 10px; }
.report-user-tools .muted { margin-left:auto; font-size:12px; }
.report-users-grid { max-height:240px; border:1px solid var(--line); border-radius:10px; padding:8px; background:#fafafa; }
.report-users-grid .permission-item { background:#fff; }
@media (max-width:720px) { .agstudio-loading-screen { min-height:340px; padding:22px; } .report-user-tools { flex-wrap:wrap; } .report-user-tools .muted { width:100%; margin-left:0; } }




/* v2.6.4 - Loader corporativo con logo Esperanza */
.agstudio-loading-panel {
  min-height: calc(100dvh - 180px);
  overflow: hidden;
  border: 1px solid rgba(233, 236, 241, 0.95);
  background:
    radial-gradient(circle at top left, rgba(255, 163, 59, 0.10), transparent 32%),
    linear-gradient(180deg, #f6f8fb 0%, #ffffff 100%);
}
.agstudio-loading-screen.agstudio-loading-screen-corporate {
  position: relative;
  isolation: isolate;
  min-height: calc(100dvh - 180px);
  display: grid;
  place-items: center;
  padding: 28px;
}
.agstudio-loader-card {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  min-height: 620px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 18px;
  padding: 42px 36px 38px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  border: 1px solid rgba(229, 232, 238, .95);
  box-shadow: 0 28px 60px rgba(15, 23, 42, .08), 0 8px 18px rgba(15, 23, 42, .04);
}
.agstudio-loader-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(90deg, #ff981f 0%, #ffb154 50%, #ffd6a5 100%);
}
.agstudio-loader-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.agstudio-loader-brand-logo {
  width: 170px;
  height: auto;
  object-fit: contain;
}
.agstudio-loader-brand-line {
  width: 1px;
  height: 28px;
  background: #e4e7ec;
}
.agstudio-loader-brand-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #667085;
}
.agstudio-loader-orbit {
  position: relative;
  width: 228px;
  height: 228px;
  display: grid;
  place-items: center;
  margin-top: 6px;
}
.agstudio-loader-ring {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 9px solid rgba(245, 156, 62, 0.12);
  background: radial-gradient(circle at center, rgba(255,255,255,.65), rgba(255,255,255,0) 68%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.agstudio-loader-ring::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 9px solid transparent;
  border-top-color: #ff981f;
  border-right-color: #ff981f;
  transform: rotate(6deg);
  animation: loaderOrbitSpin 3s linear infinite;
  filter: drop-shadow(0 0 12px rgba(255,152,31,.18));
}
.agstudio-loader-dot {
  position: absolute;
  top: 19px;
  right: 29px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff981f;
  box-shadow: 0 0 0 8px rgba(255,152,31,.08), 0 0 20px rgba(255,152,31,.32);
  animation: loaderPulse 1.8s ease-in-out infinite;
}
.agstudio-loader-shadow {
  position: absolute;
  bottom: 28px;
  left: 50%;
  width: 92px;
  height: 12px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 152, 31, .24) 0%, rgba(255, 152, 31, .06) 48%, rgba(255,152,31,0) 78%);
  filter: blur(7px);
}
.agstudio-loader-logo {
  position: relative;
  width: 98px;
  height: 98px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(255,152,31,.16));
}
.agstudio-loader-copy {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  max-width: 720px;
}
.agstudio-loader-kicker {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 152, 31, .08);
  color: #f08d1f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.agstudio-loading-screen h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.03;
  color: #101828;
  font-weight: 800;
  letter-spacing: -.04em;
}
.agstudio-loading-screen p {
  margin: 0;
  color: #667085;
  font-size: clamp(15px, 1.8vw, 18px);
  max-width: 660px;
  line-height: 1.5;
}
.agstudio-loading-screen .agstudio-loader-report {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eaecf0;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(16,24,40,.05);
}
.agstudio-loader-report::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff981f;
  box-shadow: 0 0 0 5px rgba(255,152,31,.10);
}
.agstudio-loader-progress {
  width: min(560px, 82vw);
  height: 12px;
  padding: 2px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf1f5, #f6f8fa);
  border: 1px solid rgba(228, 232, 238, .8);
  overflow: hidden;
}
.agstudio-loader-progress span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff981f, #ffb65f);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 12px rgba(255,152,31,.18);
  animation: loaderBarCorporate 2.4s ease-in-out infinite;
}
.agstudio-loading-screen small {
  color: #98a2b3;
  max-width: 620px;
  line-height: 1.55;
}
.agstudio-loader-deco {
  position: absolute;
  pointer-events: none;
}
.agstudio-loader-deco.deco-a {
  width: 380px;
  height: 380px;
  top: -150px;
  right: -120px;
  border-radius: 50%;
  border: 1px solid rgba(240,141,31,.15);
}
.agstudio-loader-deco.deco-b {
  width: 420px;
  height: 120px;
  left: -130px;
  top: 72px;
  border-radius: 999px;
  background: rgba(243, 181, 125, .10);
  transform: rotate(-28deg);
}
.agstudio-loader-deco.deco-c {
  width: 460px;
  height: 460px;
  left: -240px;
  bottom: -250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243,181,125,.08) 0%, rgba(243,181,125,.04) 42%, rgba(243,181,125,0) 70%);
}
@keyframes loaderOrbitSpin { to { transform: rotate(366deg); } }
@keyframes loaderPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes loaderBarCorporate {
  0% { transform: translateX(-8%); width: 32%; }
  50% { transform: translateX(150%); width: 28%; }
  100% { transform: translateX(-8%); width: 32%; }
}
@media (max-width: 980px) {
  .agstudio-loading-panel, .agstudio-loading-screen.agstudio-loading-screen-corporate { min-height: calc(100dvh - 168px); }
  .agstudio-loader-card { min-height: 560px; padding: 36px 26px 32px; }
  .agstudio-loader-brand-logo { width: 150px; }
  .agstudio-loader-orbit { width: 208px; height: 208px; }
  .agstudio-loader-ring { inset: 10px; border-width: 8px; }
  .agstudio-loader-ring::after { inset: -8px; border-width: 8px; }
  .agstudio-loader-dot { top: 18px; right: 26px; }
  .agstudio-loader-logo { width: 90px; height: 90px; }
}
@media (max-width: 720px) {
  .agstudio-loading-panel, .agstudio-loading-screen.agstudio-loading-screen-corporate { min-height: calc(100dvh - 150px); padding: 16px; }
  .agstudio-loader-card { min-height: 500px; padding: 26px 18px 24px; border-radius: 22px; }
  .agstudio-loader-brand { flex-direction: column; gap: 8px; margin-bottom: 2px; }
  .agstudio-loader-brand-line { display: none; }
  .agstudio-loader-brand-logo { width: 138px; }
  .agstudio-loader-brand-text { font-size: 11px; }
  .agstudio-loader-orbit { width: 174px; height: 174px; }
  .agstudio-loader-ring { inset: 12px; border-width: 7px; }
  .agstudio-loader-ring::after { inset: -7px; border-width: 7px; }
  .agstudio-loader-dot { width: 12px; height: 12px; top: 20px; right: 24px; }
  .agstudio-loader-logo { width: 78px; height: 78px; }
  .agstudio-loader-shadow { bottom: 20px; width: 76px; }
  .agstudio-loading-screen h2 { font-size: clamp(24px, 8vw, 36px); }
  .agstudio-loader-progress { height: 10px; }
  .agstudio-loading-screen small { font-size: 12px; }
}


/* v2.6.6 - Loader de informes extra compacto */
.agstudio-loading-panel {
  min-height: 380px !important;
  padding: 0 !important;
}
.agstudio-loading-screen.agstudio-loading-screen-corporate {
  min-height: 380px !important;
  padding: 12px 18px !important;
}
.agstudio-loader-card {
  width: min(760px, 100%) !important;
  min-height: 335px !important;
  gap: 8px !important;
  padding: 18px 26px 16px !important;
  border-radius: 20px !important;
}
.agstudio-loader-card::before {
  height: 4px !important;
  border-radius: 20px 20px 0 0 !important;
}
.agstudio-loader-brand {
  gap: 10px !important;
  margin-bottom: 0 !important;
}
.agstudio-loader-brand-logo {
  width: 122px !important;
}
.agstudio-loader-brand-line {
  height: 20px !important;
}
.agstudio-loader-brand-text {
  font-size: 10px !important;
  letter-spacing: .10em !important;
}
.agstudio-loader-orbit {
  width: 128px !important;
  height: 128px !important;
  margin-top: 0 !important;
}
.agstudio-loader-ring {
  inset: 8px !important;
  border-width: 5px !important;
}
.agstudio-loader-ring::after {
  inset: -5px !important;
  border-width: 5px !important;
}
.agstudio-loader-dot {
  width: 9px !important;
  height: 9px !important;
  top: 14px !important;
  right: 18px !important;
  box-shadow: 0 0 0 5px rgba(255,152,31,.08), 0 0 12px rgba(255,152,31,.28) !important;
}
.agstudio-loader-logo {
  width: 55px !important;
  height: 55px !important;
}
.agstudio-loader-shadow {
  bottom: 15px !important;
  width: 58px !important;
  height: 8px !important;
}
.agstudio-loader-copy {
  gap: 5px !important;
  max-width: 620px !important;
}
.agstudio-loader-kicker {
  padding: 5px 9px !important;
  font-size: 9px !important;
  letter-spacing: .11em !important;
}
.agstudio-loading-screen h2 {
  font-size: clamp(22px, 2.7vw, 34px) !important;
  letter-spacing: -.025em !important;
}
.agstudio-loading-screen p {
  font-size: 13px !important;
  line-height: 1.35 !important;
}
.agstudio-loading-screen .agstudio-loader-report {
  padding: 6px 10px !important;
  font-size: 10px !important;
}
.agstudio-loader-report::before {
  width: 6px !important;
  height: 6px !important;
  box-shadow: 0 0 0 3px rgba(255,152,31,.10) !important;
}
.agstudio-loader-progress {
  width: min(430px, 72vw) !important;
  height: 8px !important;
  padding: 1px !important;
  margin-top: 3px !important;
}
.agstudio-loading-screen small {
  font-size: 10px !important;
  line-height: 1.35 !important;
}
.agstudio-loader-deco.deco-a { width: 240px !important; height: 240px !important; top: -110px !important; right: -90px !important; }
.agstudio-loader-deco.deco-b { width: 300px !important; height: 76px !important; left: -110px !important; top: 48px !important; }
.agstudio-loader-deco.deco-c { width: 300px !important; height: 300px !important; left: -170px !important; bottom: -180px !important; }
@media (max-width: 720px) {
  .agstudio-loading-panel { min-height: 330px !important; }
  .agstudio-loading-screen.agstudio-loading-screen-corporate { min-height: 330px !important; padding: 8px !important; }
  .agstudio-loader-card { min-height: 300px !important; padding: 14px 14px 12px !important; gap: 6px !important; border-radius: 16px !important; }
  .agstudio-loader-brand { flex-direction: row !important; gap: 8px !important; }
  .agstudio-loader-brand-line { display: block !important; height: 16px !important; }
  .agstudio-loader-brand-logo { width: 96px !important; }
  .agstudio-loader-brand-text { font-size: 8px !important; }
  .agstudio-loader-orbit { width: 108px !important; height: 108px !important; }
  .agstudio-loader-logo { width: 46px !important; height: 46px !important; }
  .agstudio-loader-dot { top: 12px !important; right: 15px !important; }
  .agstudio-loading-screen h2 { font-size: clamp(20px, 6vw, 28px) !important; }
  .agstudio-loading-screen p { font-size: 12px !important; max-width: 430px !important; }
  .agstudio-loader-progress { width: min(360px, 76vw) !important; }
}


/* v2.6.7 - Reglas visuales / formato condicional */
.conditional-config { display:block; padding:16px; border:1px solid var(--line); border-radius:14px; background:#fbfcfd; }
.conditional-config-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:12px; }
.conditional-config-head .field-label { display:block; font-weight:700; color:var(--text); margin-bottom:4px; }
.conditional-config-head small { display:block; color:var(--muted); max-width:640px; line-height:1.45; }
.conditional-rules-list { display:flex; flex-direction:column; gap:10px; }
.conditional-rule-row { display:grid; grid-template-columns:minmax(125px,1.15fr) minmax(125px,1fr) minmax(95px,.8fr) minmax(95px,.8fr) minmax(90px,.7fr) minmax(105px,.8fr) minmax(120px,.9fr) 38px; gap:8px; align-items:end; padding:11px; border:1px solid #e6e9ef; border-radius:12px; background:#fff; }
.conditional-rule-row .field { min-width:0; }
.conditional-rule-row .field label { font-size:10px; }
.conditional-rule-row input,.conditional-rule-row select { min-width:0; }
.conditional-rule-remove { margin-bottom:1px; }
.conditional-help { margin-top:10px; font-size:12px; }
@media (max-width:1100px) { .conditional-rule-row { grid-template-columns:repeat(4,minmax(0,1fr)); } .conditional-rule-remove { justify-self:end; } }
@media (max-width:760px) { .conditional-config { padding:12px; } .conditional-config-head { flex-direction:column; } .conditional-rule-row { grid-template-columns:1fr 1fr; } }
@media (max-width:520px) { .conditional-rule-row { grid-template-columns:1fr; } .conditional-rule-remove { justify-self:start; } }


/* v2.6.9 - preservacion de borrador AG Studio al navegar a Administracion */
.agstudio-meta .agstudio-draft-status { color:#9a5b08; background:#fff7e8; border:1px solid #f6d7a8; border-radius:999px; padding:3px 9px; font-weight:700; }


/* v2.6.10 - Loader minimalista y sutil para informes */
.agstudio-loading-panel {
  min-height: 0 !important;
  height: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.agstudio-loading-screen.agstudio-loading-screen-minimal {
  min-height: 0 !important;
  height: 100% !important;
  width: 100% !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  background: transparent !important;
}
.agstudio-mini-loader {
  position: relative;
  width: clamp(74px, 7vw, 104px);
  height: clamp(74px, 7vw, 104px);
  display: grid;
  place-items: center;
}
.agstudio-mini-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 152, 31, .12);
  border-top-color: #ff981f;
  border-right-color: rgba(255, 152, 31, .55);
  animation: agstudioMiniSpin 1.6s linear infinite;
  box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset;
}
.agstudio-mini-logo {
  width: 46%;
  height: 46%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(255, 152, 31, .12));
}
@keyframes agstudioMiniSpin { to { transform: rotate(360deg); } }
@media (max-width: 720px) {
  .agstudio-mini-loader { width: 72px; height: 72px; }
  .agstudio-mini-ring { border-width: 2.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .agstudio-mini-ring { animation-duration: 3.2s; }
}


/* v2.6.12 - tarjetas descriptivas e iconos ampliados */
.module-card .card-link { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:start; column-gap:14px; }
.module-card .card-text { align-self:center; }
.module-card .card-text h2 { margin-bottom:5px; }
.module-card .card-text p { margin:0; min-height:0; }
.module-card .card-arrow { align-self:center; margin-top:0; }
.icon-picker { max-height:220px; overflow-y:auto; padding-right:4px; }
@media (max-width:760px) { .module-card .card-link { column-gap:12px; } }


/* v2.6.21 - loader corporativo Esperanza mas visible + progreso animado */
.frame-status.waiting {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.80);
  backdrop-filter:blur(1.5px);
  z-index:3;
  padding:0;
  border:0;
  color:transparent;
}
.esperanza-frame-loader {
  display:grid;
  place-items:center;
  gap:11px;
  width:204px;
  min-height:106px;
  padding:16px 18px 14px;
  border-radius:18px;
  background:rgba(255,255,255,.94);
  box-shadow:0 10px 34px rgba(15,23,42,.09);
  animation:esperanzaLoaderPulse 1.45s ease-in-out infinite;
}
.esperanza-frame-logo {
  display:block;
  width:166px;
  max-width:100%;
  height:auto;
  object-fit:contain;
  filter:drop-shadow(0 4px 10px rgba(255,152,31,.11));
}
.esperanza-frame-progress {
  display:block;
  position:relative;
  width:154px;
  height:5px;
  overflow:hidden;
  border-radius:999px;
  background:#f3f4f6;
}
.esperanza-frame-progress span {
  position:absolute;
  inset:0 auto 0 0;
  width:42%;
  border-radius:999px;
  background:#ff981f;
  animation:esperanzaLoaderBar 1.05s ease-in-out infinite;
}
@keyframes esperanzaLoaderPulse {
  0%,100% { opacity:.82; transform:scale(.985); }
  50% { opacity:1; transform:scale(1.015); }
}
@keyframes esperanzaLoaderBar {
  0% { transform:translateX(-115%); }
  55% { transform:translateX(120%); }
  100% { transform:translateX(265%); }
}
.frame-status:not(.waiting):not(.notice-visible) { display:none; }
.frame-status.notice-visible { display:block; }
@media (max-width:720px) {
  .esperanza-frame-loader { width:174px; min-height:92px; padding:13px 15px 12px; border-radius:16px; }
  .esperanza-frame-logo { width:142px; }
  .esperanza-frame-progress { width:132px; }
}
@media (prefers-reduced-motion:reduce) {
  .esperanza-frame-loader, .esperanza-frame-progress span { animation-duration:2.4s; }
}

/* v2.6.24 - loader ASP identico a AG Studio + orden personal por arrastrar */
.frame-status.waiting {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.82);
  backdrop-filter:blur(1.5px);
  z-index:3;
  padding:0;
  border:0;
  color:transparent;
}
.frame-status.waiting .agstudio-mini-loader { color:initial; }
.module-nav[draggable="true"] { cursor:grab; }
.module-nav[draggable="true"]:active { cursor:grabbing; }
.module-nav.dragging { opacity:.42; }
.module-nav.drag-over-before,
.module-nav.drag-over-after { position:relative; }
.module-nav.drag-over-before::before,
.module-nav.drag-over-after::after {
  content:"";
  position:absolute;
  left:12px;
  right:12px;
  height:3px;
  border-radius:999px;
  background:#ff981f;
  box-shadow:0 0 0 1px rgba(255,152,31,.12);
}
.module-nav.drag-over-before::before { top:-2px; }
.module-nav.drag-over-after::after { bottom:-2px; }


/* v2.6.25 - loader ASP centrado + drag & drop real en tarjetas de Modulos */
.frame-container > .frame-status.waiting {
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  margin:0 !important;
  padding:0 !important;
  transform:none !important;
  background:#fff !important;
  z-index:5 !important;
}
.frame-container > .frame-status.waiting::before {
  content:none !important;
  display:none !important;
}
.frame-container > .frame-status.waiting .agstudio-mini-loader {
  flex:0 0 auto;
  margin:0 !important;
}
.access-frame.frame-is-loading {
  visibility:hidden !important;
  opacity:0 !important;
}
.module-card.module-sortable[draggable="true"] {
  cursor:grab;
  user-select:none;
  -webkit-user-select:none;
}
.module-card.module-sortable[draggable="true"]:active { cursor:grabbing; }
.module-card.dragging {
  opacity:.38;
  transform:scale(.985);
}
.module-card.drag-over-before,
.module-card.drag-over-after {
  position:relative;
  outline:2px solid rgba(255,152,31,.20);
  outline-offset:2px;
}
.module-card.drag-over-before::before,
.module-card.drag-over-after::after {
  content:"";
  position:absolute;
  top:10px;
  bottom:10px;
  width:4px;
  border-radius:999px;
  background:#ff981f;
  box-shadow:0 0 0 1px rgba(255,152,31,.12);
  z-index:4;
}
.module-card.drag-over-before::before { left:-7px; }
.module-card.drag-over-after::after { right:-7px; }
body.module-drag-active .module-card.module-sortable { transition:opacity .12s, transform .12s, outline-color .12s; }
