:root {
  color-scheme: light;
  --navy: #081b4d;
  --blue: #103b9d;
  --blue-dark: #092c7d;
  --cream: #fffaf1;
  --ink: #16264a;
  --muted: #5b6880;
  --line: #dce2eb;
  --orange: #b84c27;
  --green: #167347;
  --shadow: 0 16px 42px rgb(3 14 45 / 18%);
}
* { box-sizing: border-box; }
body [hidden] { display: none; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(115deg, rgb(4 18 53 / 94%), rgb(5 25 73 / 87%)), url("FONDO.png") center / cover fixed;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #d48a2f; outline-offset: 3px; }
.app-shell { width: min(1200px, calc(100% - 48px)); margin: 0 auto; }
.brand-header { padding-top: 26px; }
.brand-header img { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: var(--shadow); }
.main-content { padding: 36px 0 30px; }
.loading-view { min-height: 300px; display: flex; align-items: center; justify-content: center; gap: 12px; color: white; }
.spinner { width: 20px; height: 20px; border: 2px solid rgb(255 255 255 / 30%); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-layout { min-height: 480px; display: grid; grid-template-columns: 1fr minmax(300px, 440px); align-items: center; gap: clamp(36px, 8vw, 110px); padding: 28px 24px; }
.login-intro { color: white; }
.eyebrow, .section-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .68rem; font-weight: 800; letter-spacing: .14em; line-height: 1.4; }
.light-eyebrow { color: #d5e3ff; }
.eyebrow-dot, .hint-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #eeb755; }
h1, h2, p { margin-top: 0; }
h1, h2 { letter-spacing: -.035em; }
.login-intro h1 { margin: 19px 0; font-family: Georgia, serif; font-size: clamp(2.6rem, 5vw, 4.6rem); font-weight: 700; line-height: 1.05; }
.login-intro h1 em { color: #f6c87a; font-weight: 400; }
.login-intro p { max-width: 430px; color: #d2def4; line-height: 1.7; }
.card { min-width: 0; padding: clamp(24px, 3vw, 34px); background: var(--cream); border: 1px solid rgb(255 255 255 / 60%); border-radius: 16px; box-shadow: var(--shadow); }
.section-kicker { color: var(--orange); }
.card h2 { margin: 10px 0 8px; color: var(--navy); font-family: Georgia, serif; font-size: 1.75rem; }
.muted { color: var(--muted); line-height: 1.55; }
.card > .muted { margin-bottom: 25px; font-size: .93rem; }
label { display: block; margin: 0 0 8px; font-size: .82rem; font-weight: 750; }
input { display: block; width: 100%; min-width: 0; min-height: 50px; padding: 12px 14px; color: var(--ink); background: white; border: 1px solid #bfc9d9; border-radius: 8px; }
input::placeholder { color: #738096; opacity: 1; }
input:focus { border-color: var(--blue); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 48px; padding: 11px 18px; border: 1px solid transparent; border-radius: 8px; font-weight: 750; line-height: 1.3; text-align: center; transition: background-color .15s ease, border-color .15s ease; }
.button-primary { background: var(--blue); color: white; }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button-full { width: 100%; }
form .button-full { margin-top: 18px; }
#login-form input + label { margin-top: 16px; }
.button-secondary { color: var(--blue); background: white; border-color: #bcc9db; }
.button-secondary:hover:not(:disabled) { background: #edf2fa; }
.login-note { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; text-align: center; }
.login-note span { color: var(--orange); }
.form-error { margin: 10px 0 0; color: #a32525; font-size: .85rem; line-height: 1.4; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 38px; color: white; }
.page-heading h1 { margin: 10px 0 5px; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3rem); }
.page-heading p { margin-bottom: 0; color: #d1ddf2; }
.button-ghost { color: white; background: rgb(255 255 255 / 8%); border-color: rgb(255 255 255 / 40%); white-space: nowrap; }
.button-ghost:hover:not(:disabled) { background: rgb(255 255 255 / 18%); }
.page-heading .logout-status { max-width: 260px; margin-top: 8px; font-size: .78rem; line-height: 1.4; }
.stats-section { margin-bottom: 26px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; }
.light-heading { color: white; }
.light-heading h2 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 1.45rem; }
.light-kicker { color: #f2c47b; }
.stats-status { margin: 0; color: #d7e3f9; font-size: .78rem; text-align: right; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat-card { display: flex; gap: 15px; align-items: flex-start; min-width: 0; padding: 21px; background: var(--cream); border-radius: 12px; box-shadow: var(--shadow); }
.stat-icon, .card-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 10px; font-size: 1.3rem; font-weight: 700; }
.stat-icon-blue, .card-icon { color: var(--blue); background: #e6eefb; }
.stat-icon-green { color: var(--green); background: #e2f3e9; }
.stat-icon-orange, .card-icon-orange { color: var(--orange); background: #fae9df; }
.stat-card p { margin: 0 0 6px; font-size: .8rem; font-weight: 750; }
.stat-card strong { display: block; color: var(--navy); font-size: 2rem; line-height: 1.1; }
.stat-card div > span { display: block; margin-top: 5px; color: var(--muted); font-size: .75rem; }
.app-error { margin-bottom: 18px; padding: 14px 16px; color: #8d1f1f; background: #fff0ed; border: 1px solid #edb3aa; border-radius: 8px; line-height: 1.5; }
.workspace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.card-heading { display: flex; align-items: center; gap: 12px; }
.scan-input-wrap, .search-input-wrap { position: relative; }
.scan-input-wrap > span, .search-input-wrap > span { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); color: var(--blue); font-size: 1.3rem; pointer-events: none; }
.scan-input-wrap input, .search-input-wrap input { padding-left: 44px; }
.scan-hint { display: flex; align-items: center; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.hint-dot { background: var(--green); }
.search-status { margin: 16px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.search-results { display: grid; gap: 8px; max-height: 350px; overflow-y: auto; margin: 12px 0 0; padding: 0; list-style: none; }
.result-button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 13px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 8px; text-align: left; }
.result-button:hover { border-color: var(--blue); background: #f2f6ff; }
.result-button strong, .result-button small { display: block; overflow-wrap: anywhere; }
.result-button small { margin-top: 4px; color: var(--muted); }
.result-badge { flex: none; padding: 5px 8px; color: #755009; background: #fff1cb; border-radius: 20px; font-size: .7rem; font-weight: 750; }
.result-badge.is-inside { color: #6b3d11; background: #f9e7d3; }
.users-navigation { margin: 0 0 18px; }
.users-section { margin-top: 16px; }
.users-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 28px; }
.users-layout h3 { margin: 0 0 16px; color: var(--navy); }
.user-form label:not(:first-of-type), .user-password-content label:not(:first-of-type) { margin-top: 16px; }
.user-form select { display: block; width: 100%; min-height: 50px; padding: 12px 14px; color: var(--ink); background: white; border: 1px solid #bfc9d9; border-radius: 8px; font: inherit; }
.users-list-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.users-list-heading h3 { margin: 0; }
.users-list { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.user-item { display: grid; gap: 12px; min-width: 0; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.user-details { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.user-details span { color: var(--muted); font-size: .82rem; }
.user-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.user-actions .button { flex: 1 1 auto; }
.user-password-content { text-align: left; }
@media (max-width: 700px) { .users-layout { grid-template-columns: minmax(0, 1fr); } }
.site-footer { display: flex; justify-content: center; gap: 10px; padding: 8px 0 30px; color: #c5d2ed; font-size: .65rem; font-weight: 700; letter-spacing: .13em; text-align: center; }
.site-footer > span:not(.footer-divider) { color: #e8b867; }
.modal { width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; color: var(--ink); background: var(--cream); border: 0; border-radius: 16px; box-shadow: 0 24px 90px rgb(0 0 0 / 40%); }
.modal::backdrop { background: rgb(2 10 32 / 75%); }
.modal-content { padding: 32px; text-align: center; }
.modal-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%; font-size: 2rem; font-weight: 700; }
.modal-icon-success { color: var(--green); background: #def1e5; }
.modal-icon-duplicate, .modal-icon-orange { color: #8a5106; background: #fff0cc; }
.modal-icon-not_invited, .modal-icon-error { color: #a32525; background: #fbe3df; }
.modal h2 { margin: 9px 0 12px; color: var(--navy); font-family: Georgia, serif; font-size: 1.9rem; }
.modal-person { margin-bottom: 8px; color: var(--navy); font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; }
.modal-code { overflow-wrap: anywhere; }
.modal .muted { font-size: .92rem; }
.modal .button-full { margin-top: 10px; }
.confirm-person { display: grid; gap: 5px; margin: 20px 0; padding: 16px; background: #edf2fa; border-radius: 8px; overflow-wrap: anywhere; }
.confirm-person span { color: var(--muted); font-size: .82rem; }
.confirm-authorization { display: flex; align-items: flex-start; gap: 10px; text-align: left; line-height: 1.4; }
.confirm-authorization input { width: 20px; height: 20px; min-height: 0; flex: none; margin: 0; padding: 0; }
#confirm-phrase { text-align: left; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .button { flex: 1; }
@media (max-width: 700px) {
  .app-shell { width: min(100% - 28px, 1200px); }
  .brand-header { padding-top: 14px; }
  .main-content { padding-top: 26px; }
  .login-layout { min-height: 0; grid-template-columns: 1fr; gap: 28px; padding: 15px 0; }
  .login-intro h1 { font-size: clamp(2.4rem, 9vw, 3.5rem); }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 30px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat-card { display: block; padding: 14px 10px; }
  .stat-icon { width: 34px; height: 34px; margin-bottom: 10px; }
  .stat-card strong { font-size: 1.6rem; }
  .stat-card p, .stat-card div > span { font-size: .7rem; }
  .workspace-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .section-heading { align-items: flex-start; flex-direction: column; }
  .stats-status { text-align: left; }
  .modal-content { padding: 25px 20px; }
  .modal-actions { flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms; animation-iteration-count: 1; transition-duration: .01ms; scroll-behavior: auto; }
}

body:has(.authenticated-layout:not([hidden])) .app-shell { width: min(1200px, calc(100% - 104px)); margin-left: calc(72px + max(16px, (100% - 72px - 1200px) / 2)); margin-right: auto; transition: width .24s ease, margin-left .24s ease; }
@media (min-width: 851px) {
  body:has(.authenticated-layout:not([hidden])[data-sidebar-open="true"]) .app-shell { width: min(1200px, calc(100% - 308px)); margin-left: calc(260px + max(24px, (100% - 260px - 1200px) / 2)); }
}
.authenticated-layout { min-width: 0; }
.authenticated-layout .sidebar-icon { display: block; width: 20px; height: 20px; flex: none; }
.authenticated-layout .sidebar-toggle { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 10px; color: #f2c47b; background: #2b3041; border: 1px solid rgb(242 196 123 / 25%); border-radius: 10px; font: inherit; }
.authenticated-layout .sidebar-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.authenticated-layout .sidebar-toggle:hover { background: #254a9c; }
.authenticated-layout .sidebar-toggle:active { background: #173878; }
.authenticated-layout .app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; width: 72px; height: 100vh; height: 100dvh; overflow-x: hidden; overflow-y: auto; padding: 22px 13px 16px; color: white; background: #101f3b; border-right: 1px solid rgb(255 255 255 / 14%); box-shadow: var(--shadow); transition: width .24s ease; }
.authenticated-layout[data-sidebar-open="true"] .app-sidebar { width: 260px; }
.authenticated-layout .sidebar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; height: 65px; flex: none; padding-bottom: 20px; color: white; border-bottom: 1px solid rgb(255 255 255 / 15%); }
.authenticated-layout .sidebar-brand-text { white-space: nowrap; }
.authenticated-layout[data-sidebar-open="false"] .sidebar-brand-text, .authenticated-layout[data-sidebar-open="false"] .sidebar-section-label, .authenticated-layout[data-sidebar-open="false"] .nav-external { display: none; }
.authenticated-layout[data-sidebar-open="false"] .nav-item > span, .authenticated-layout[data-sidebar-open="false"] .sidebar-logout > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.authenticated-layout .sidebar-brand strong, .authenticated-layout .sidebar-brand small { display: block; }
.authenticated-layout .sidebar-brand strong { font-size: 1rem; letter-spacing: -.02em; }
.authenticated-layout .sidebar-brand small { margin-top: 3px; color: #c2cee2; font-size: .75rem; }
.authenticated-layout .sidebar-section-label { display: block; padding: 0 12px; color: #bdcbe1; font-size: .68rem; font-weight: 750; letter-spacing: .1em; line-height: 1.4; text-transform: uppercase; }
.authenticated-layout .app-navigation { display: grid; gap: 5px; min-width: 0; padding: 22px 0; }
.authenticated-layout .app-navigation .sidebar-section-label { margin-bottom: 8px; }
.authenticated-layout .nav-item, .authenticated-layout .sidebar-logout { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 11px 11px; color: #e7efff; background: transparent; border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: .91rem; font-weight: 650; line-height: 1.35; text-align: left; text-decoration: none; }
.authenticated-layout .nav-item:hover, .authenticated-layout .sidebar-logout:hover:not(:disabled) { color: white; background: rgb(255 255 255 / 10%); }
.authenticated-layout .nav-item:active, .authenticated-layout .sidebar-logout:active:not(:disabled) { background: rgb(255 255 255 / 16%); }
.authenticated-layout .nav-item[aria-current="page"] { color: white; background: #2854a6; border-color: #4d75bf; }
.authenticated-layout .nav-item[aria-current="page"]:hover { background: #315fb5; }
.authenticated-layout .nav-item[aria-disabled="true"] { color: #c1cce0; }
.authenticated-layout .nav-item[aria-disabled="true"] .nav-external { opacity: .7; }
.authenticated-layout .nav-external { width: 16px; height: 16px; margin-left: auto; }
.authenticated-layout .navigation-status, .authenticated-layout .logout-status { margin: 0 0 14px; color: #e3ebfb; font-size: .85rem; line-height: 1.45; overflow-wrap: anywhere; }
.authenticated-layout .navigation-status:empty, .authenticated-layout .logout-status:empty { display: none; }
.authenticated-layout .sidebar-session { display: grid; gap: 8px; min-width: 0; margin-top: auto; padding-top: 18px; border-top: 1px solid rgb(255 255 255 / 15%); }
.authenticated-layout .sidebar-logout:disabled { cursor: not-allowed; opacity: .65; }
.authenticated-layout .app-workspace { min-width: 0; }
.authenticated-layout .page-heading { margin-bottom: 28px; }
.authenticated-layout .users-section { margin-top: 0; }
@media (max-width: 1100px) {
  .authenticated-layout[data-sidebar-open="true"] .workspace-grid { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  .authenticated-layout[data-sidebar-open="true"] .app-sidebar { width: min(260px, calc(100vw - 64px)); }
  .authenticated-layout .app-navigation { padding: 18px 0; }
}
@media (prefers-reduced-motion: reduce) {
  body:has(.authenticated-layout:not([hidden])) .app-shell, .authenticated-layout .app-sidebar { transition: none; }
}
