/* SETAX · Sistema visual compartido. Tokens → base → componentes → responsive. */
@font-face {
  font-family: Manrope;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #fff;
  --surface-soft: #f8faf9;
  --text: #202b31;
  --muted: #65716f;
  --border: #e4eae7;
  --accent: #20654e;
  --accent-hover: #174e3c;
  --tint: #e2f2e9;
  --banner: #d8ede1;
  --banner-text: #214c3b;
  --button: #253e34;
  --on-button: #fff;
  --focus: #408469;
  --shadow: 0 4px 18px #1a382805;
  --danger: #b42e40;
  --danger-bg: #fff0f1;
  --success: #22714d;
  --success-bg: #eaf7ef;
  --radius: 18px;
  font-family: Manrope,'Segoe UI',Arial,sans-serif;
  font-synthesis: none;
}

html[data-theme=lavender] {
  --bg: #f6f5fa;
  --surface-soft: #faf9fd;
  --border: #e7e3ef;
  --accent: #66528d;
  --accent-hover: #514071;
  --tint: #ece5f8;
  --banner: #e8dff5;
  --banner-text: #503e72;
  --button: #57436e;
  --focus: #8f77b4;
}

html[data-theme=sky] {
  --bg: #f2f7fb;
  --surface-soft: #f7fafc;
  --border: #dfe9f0;
  --accent: #326b8d;
  --accent-hover: #245271;
  --tint: #e0effb;
  --banner: #dbeefa;
  --banner-text: #2f5674;
  --button: #2d526a;
  --focus: #538ab0;
}

html[data-theme=peach] {
  --bg: #fcf6f1;
  --surface-soft: #fffbf8;
  --border: #eee4db;
  --accent: #986036;
  --accent-hover: #794920;
  --tint: #fce9db;
  --banner: #f7e2d1;
  --banner-text: #795039;
  --button: #79513d;
  --focus: #b3774c;
}

html[data-theme=rose] {
  --bg: #fcf5f7;
  --surface-soft: #fdf9fa;
  --border: #efdee5;
  --accent: #96506b;
  --accent-hover: #7c3d56;
  --tint: #f8e3ec;
  --banner: #f5dde7;
  --banner-text: #794358;
  --button: #794358;
  --focus: #b5698b;
}

html[data-theme=light] {
  --bg: #fff;
  --surface: #fff;
  --surface-soft: #f8f9fb;
  --border: #e5e7eb;
  --accent: #3d5866;
  --accent-hover: #273d49;
  --tint: #eef1f5;
  --banner: #f1f3f6;
  --banner-text: #354652;
  --button: #263741;
  --focus: #557989;
}

html[data-theme=dark] {
  color-scheme: dark;
  --bg: #090a0b;
  --surface: #141618;
  --surface-soft: #1a1d20;
  --text: #eef1f2;
  --muted: #a4afad;
  --border: #2a3030;
  --accent: #a8d8bd;
  --accent-hover: #cee8d9;
  --tint: #24372e;
  --banner: #20382c;
  --banner-text: #d5eedd;
  --button: #b9dec9;
  --on-button: #15241b;
  --focus: #acd5bd;
  --shadow: none;
  --danger: #ffacb6;
  --danger-bg: #351c22;
  --success: #a0d6b5;
  --success-bg: #1d3529;
}

/* Temas tecnológicos: fondos oscuros y acentos de alto contraste. */
html:is([data-theme=red],[data-theme=yellow],[data-theme=cyan]) {
  color-scheme:dark;
  --bg:#0c0e12; --surface:#14171c; --surface-soft:#1c2027;
  --text:#f4f5f7; --muted:#b1b8c5; --border:#333943;
  --on-button:#111318; --shadow:none;
  --danger:#ffb1bd; --danger-bg:#351c25;
  --success:#a5e6c4; --success-bg:#18372a;
}
html[data-theme=red] {
  --accent:#ff536d; --accent-hover:#ff8194; --button:#ff536d;
  --tint:#3d202a; --banner:#25141d; --banner-text:#ffc7d0; --focus:#ff8194;
}
html[data-theme=yellow] {
  --accent:#ffe05b; --accent-hover:#ffec99; --button:#ffe05b;
  --tint:#36301d; --banner:#252216; --banner-text:#fff0ac; --focus:#ffe981;
}
html[data-theme=cyan] {
  --accent:#4cdcff; --accent-hover:#9aeeff; --button:#4cdcff;
  --tint:#183641; --banner:#102a35; --banner-text:#b5f0ff; --focus:#8ceaff;
}
.swatch-red { background:#ff536d; }
.swatch-yellow { background:#ffe05b; }
.swatch-cyan { background:#4cdcff; }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
}

button,input,select,textarea {
  font: inherit;
}

button,a,input,select,summary {
  -webkit-tap-highlight-color: transparent;
}

button,a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

h1,h2,h3,p {
  margin: 0;
}

h1,h2,h3 {
  line-height: 1.25;
  letter-spacing: -.04em;
}

h1 {
  font-size: 2.05rem;
  font-weight: 800;
}

h2 {
  font-size: 1.12rem;
  font-weight: 800;
}

h3 {
  font-size: 1rem;
  font-weight: 800;
}

p {
  color: var(--muted);
}

button {
  border: 0;
  background: none;
}

img,svg {
  vertical-align: middle;
}

input,select {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--text);
  font-size: .9rem;
}

input: :placeholder {
  color: var(--muted);
  opacity: .85;
}

input: hover,select:hover {
  border-color: var(--muted);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

input: focus,select:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

button: disabled {
  opacity: .5;
  cursor: not-allowed;
}

button[aria-busy=true] {
  cursor: wait;
}

input[type=number] {
  appearance: textfield;
}

input: :-webkit-inner-spin-button {
  appearance: none;
}

strong {
  font-weight: 800;
}

[hidden] {
  display: none!important;
}

.icon {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  background: var(--surface);
  padding: 12px;
  z-index: 200;
}

.skip-link:focus {
  top: 12px;
}

.muted {
  color: var(--muted);
}

.accent {
  color: var(--accent);
}

.nowrap {
  white-space: nowrap;
}

.eyebrow {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .17em;
  color: var(--muted);
  margin-bottom: 8px;
}

.section-gap {
  margin-top: 24px;
}

/* Botones, formularios y estados compartidos. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  min-height: 44px;
  padding: 11px 17px;
  font-size: .85rem;
  font-weight: 800;
  line-height: 1.5;
  transition: background-color .15s,border-color .15s;
}

.btn-primary {
  background: var(--button);
  color: var(--on-button);
}

.btn-primary:hover {
  filter: brightness(1.12);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-soft);
  border-color: var(--muted);
}

.btn-small {
  padding: 8px 12px;
  font-size: .8rem;
  min-height: 40px;
}

.btn-wide {
  width: 100%;
}

.btn-danger {
  background: var(--danger);
  color: var(--surface);
}

.btn-banner {
  background: var(--surface);
  color: var(--text);
  border-color: transparent;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--tint);
}

.danger {
  color: var(--danger);
}

.text-link,.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 800;
  padding: 0;
}

.text-link:hover,.text-button:hover {
  text-decoration: underline;
}

.text-link .icon,.text-button .icon {
  width: 16px;
  height: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.4;
}

.pill .icon {
  width: 14px;
  height: 14px;
}

.neutral {
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--border);
}

.available,.status-success {
  background: var(--success-bg);
  color: var(--success);
}

.status-success {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-success:before,.status-dot {
  content: '';
  background: var(--success);
  width: 6px;
  height: 6px;
  border-radius: 100%;
  flex-shrink: 0;
}

.status-dot {
  display: block;
  width: 8px;
  height: 8px;
}

.icon-tile {
  height: 40px;
  width: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: var(--tint);
  color: var(--accent);
  flex-shrink: 0;
}

.icon-tile.mint {
  background: #e2f2e9;
  color: #337455;
}

.icon-tile.lavender {
  background: #efe9fb;
  color: #7a5cac;
}

.icon-tile.peach {
  background: #fff0e1;
  color: #a26e39;
}

.icon-tile.sky {
  background: #e9f2fd;
  color: #507ca9;
}

html:is([data-theme=dark],[data-theme=red],[data-theme=yellow],[data-theme=cyan]) .icon-tile {
  background: var(--tint);
  color: var(--accent);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: .85rem;
  line-height: 1.6;
  margin: 16px 0;
}

.notice .icon {
  margin-top: 2px;
}

.notice.error {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.notice.success {
  background: var(--success-bg);
  color: var(--success);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: .83rem;
  font-weight: 800;
}

.field-hint {
  font-size: .73rem;
  color: var(--muted);
  font-weight: 500;
  float: right;
  margin-left: 8px;
}

.input-icon {
  position: relative;
}

.input-icon> .icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 18px;
}

.input-icon>input {
  padding-left: 44px;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 4px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  border-radius: 8px;
}

.password-toggle:hover {
  color: var(--accent);
  background: var(--tint);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-stack>.notice {
  margin: 0;
}

.form-stack>.btn {
  margin-top: 4px;
}

.captcha {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 6px 6px 14px;
  background: var(--surface-soft);
}

.captcha>span {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  color: var(--accent);
}

.captcha input {
  min-height: 36px;
  padding: 8px 12px;
  background: var(--surface);
  border: 0;
  margin-left: auto;
  width: 45%;
}

.captcha .icon {
  width: 18px;
}

/* Marca y autenticación: sin filtros gráficos ni dependencias de terceros. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: max-content;
}

.brand>span {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.09em;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 5px;
  font-size: .49rem;
  letter-spacing: .27em;
  font-weight: 800;
  color: var(--muted);
}

.brand-dot {
  color: #db6665;
}

.brand img {
  object-fit: contain;
}

.auth-page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 44% 56%;
}

.auth-story {
  background: var(--banner);
  color: var(--banner-text);
  padding: 42px 12% 28px 11%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.auth-story .brand {
  color: var(--banner-text);
}

.auth-story-content {
  margin: auto 0;
  padding: 74px 0;
}

.auth-story-content>.pill {
  border: 1px solid currentColor;
  font-size: .63rem;
  letter-spacing: .14em;
  padding: 7px 11px;
  opacity: .8;
}

.auth-story h1 {
  font-size: clamp(2.6rem,4.35vw,4.8rem);
  font-weight: 800;
  line-height: 1.09;
  margin: 30px 0 24px;
  letter-spacing: -.06em;
}

.auth-story h1>span {
  color: var(--accent);
}

.auth-story-content>p {
  font-size: .95rem;
  color: var(--banner-text);
  opacity: .8;
  line-height: 1.8;
}

.story-features {
  display: grid;
  gap: 16px;
  margin-top: 44px;
  font-size: .82rem;
  font-weight: 600;
}

.story-features>div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.story-features .icon {
  width: 18px;
  height: 18px;
}

.auth-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: .63rem;
  letter-spacing: .04em;
  opacity: .7;
}

.auth-main {
  display: flex;
  flex-direction: column;
  padding: 28px 7% 24px;
  background: var(--surface);
}

.auth-top {
  display: flex;
  justify-content: flex-end;
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 32px 0 16px;
}

.auth-heading>h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.055em;
  margin: 8px 0 12px;
}

.auth-heading>p {
  font-size: .84rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-soft);
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 11px;
  margin: 26px 0;
}

.auth-tabs a {
  padding: 9px;
  text-align: center;
  font-size: .83rem;
  font-weight: 700;
  color: var(--muted);
  border-radius: 7px;
}

.auth-tabs a[aria-current=page] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 6px #00000009;
}

.auth-contact {
  margin-top: 28px;
}

.divider-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
}

.divider-label:before,.divider-label:after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--border);
}

.auth-contact>p {
  text-align: center;
  font-size: .75rem;
  margin: 9px 0 18px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.social-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: .72rem;
  font-weight: 700;
  padding: 0;
  color: var(--muted);
}

.social-circle {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  transition: background-color .15s;
}

.social-link:hover .social-circle {
  background: var(--tint);
  border-color: var(--accent);
}

.telegram .social-circle {
  color: #287cac;
}

.whatsapp .social-circle {
  color: #298354;
}

.discord .social-circle {
  color: #6b63b6;
}

html:is([data-theme=dark],[data-theme=red],[data-theme=yellow],[data-theme=cyan]) .social-circle {
  color: var(--accent);
}

.social-circle .icon {
  width: 22px;
  height: 22px;
}

.auth-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: .66rem;
  margin-top: 26px;
  color: var(--muted);
}

.auth-note .icon {
  width: 13px;
  height: 13px;
}

.mobile-brand,.mobile-only {
  display: none;
}

/* Navegación y estructura del panel. */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  z-index: 40;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 19px 0;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 8px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-label {
  font-size: .59rem;
  letter-spacing: .13em;
  color: var(--muted);
  font-weight: 800;
  margin: 0 13px 12px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 29px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 10px;
  min-height: 44px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  width: 100%;
}

.nav-link .icon {
  width: 18px;
  height: 18px;
}

.nav-link:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-link.active {
  background: var(--tint);
  color: var(--accent);
}

.nav-active-dot {
  margin-left: auto;
}

.active .nav-active-dot {
  background: var(--accent);
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.sidebar-bottom {
  margin-top: auto;
}

.credit-promo {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 17px 13px;
  margin: 14px 0 22px;
}

.credit-promo .icon-tile {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin-bottom: 13px;
}

.credit-promo h3 {
  font-size: .82rem;
}

.credit-promo p {
  font-size: .73rem;
  line-height: 1.7;
  margin: 7px 0 16px;
}

.credit-promo .btn {
  font-size: .71rem;
}

.sidebar-user {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

.avatar {
  height: 34px;
  width: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tint);
  color: var(--accent);
  font-size: .9rem;
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-user>div {
  min-width: 0;
  flex: 1;
}

.sidebar-user strong {
  display: block;
  font-size: .73rem;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95px;
}

.sidebar-user small {
  display: block;
  font-size: .6rem;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-user .icon-btn {
  width: 32px;
  height: 34px;
}

.sidebar-user .icon {
  width: 17px;
}

.workspace {
  margin-left: 238px;
  min-width: 0;
}

.topbar {
  height: 76px;
  padding: 0 34px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
}

.breadcrumb {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: .78rem;
  color: var(--muted);
}

.breadcrumb strong {
  color: var(--text);
  font-weight: 700;
}

.breadcrumb-slash {
  opacity: .5;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 17px;
}

.top-date {
  font-size: .73rem;
  color: var(--muted);
}

.topbar-actions>.icon-btn {
  border: 1px solid var(--border);
  width: 35px;
  height: 35px;
  border-radius: 50%;
}

.main-content {
  padding: 29px 34px 0;
  max-width: 1600px;
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.page-heading .eyebrow {
  font-size: .61rem;
  margin-bottom: 7px;
}

.page-heading p:not(.eyebrow) {
  font-size: .81rem;
  margin-top: 10px;
}

.page-heading>.btn {
  font-size: .79rem;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  padding: 26px 0 22px;
  font-size: .66rem;
  color: var(--muted);
  gap: 20px;
}

.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  background: var(--banner);
  color: var(--banner-text);
  border-radius: var(--radius);
  padding: 27px 30px;
  margin-bottom: 23px;
}

.welcome-banner .pill {
  background: #ffffff57;
  color: var(--banner-text);
  font-size: .59rem;
  letter-spacing: .08em;
  font-weight: 800;
}

.welcome-banner h2 {
  font-size: 1.8rem;
  letter-spacing: -.045em;
  margin: 12px 0 7px;
  overflow-wrap: anywhere;
}

.welcome-banner p {
  font-size: .81rem;
  color: var(--banner-text);
  opacity: .83;
}

.hello-dot {
  display: inline-block;
  font-size: 1.5rem;
  vertical-align: middle;
  margin-left: 8px;
}

.welcome-banner .btn {
  flex-shrink: 0;
  font-size: .75rem;
}

.welcome-banner .btn .icon {
  width: 17px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 17px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 19px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.4;
}

.stat-top .icon-tile {
  height: 33px;
  width: 33px;
  border-radius: 10px;
}

.stat-top .icon {
  width: 17px;
  height: 17px;
}

.stat-number {
  display: block;
  font-size: 2rem;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -.05em;
  margin: 11px 0 6px;
  font-variant-numeric: tabular-nums;
}

.stat-date {
  font-size: 1.3rem;
  line-height: 2.08;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.stat-meta,.stat-card .text-button {
  font-size: .64rem;
  color: var(--muted);
  line-height: 1.6;
}

.stat-card .text-button {
  color: var(--accent);
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0,1fr) 304px;
  gap: 23px;
}

.dashboard-primary,.dashboard-secondary {
  display: flex;
  flex-direction: column;
  gap: 23px;
  min-width: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 23px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-heading h2 {
  font-size: .97rem;
}

.panel-heading p {
  font-size: .72rem;
  margin-top: 5px;
}

.panel-heading>.icon {
  color: var(--muted);
  width: 18px;
}

.panel-heading .text-link {
  font-size: .72rem;
  white-space: nowrap;
}

.activity-chart {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  height: 192px;
  background: repeating-linear-gradient(to top,transparent 0,transparent 39px,var(--border) 40px,transparent 41px);
  background-size: 100% 123px;
  background-repeat: no-repeat;
  background-position: 0 27px;
}

.chart-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.chart-value {
  font-size: .67rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--muted);
}

.chart-track {
  height: 121px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
}

.chart-bar {
  display: block;
  width: 65%;
  max-width: 35px;
  min-height: 3px;
  height: var(--bar-height);
  background: var(--tint);
  border-radius: 6px 6px 2px 2px;
  border: 1px solid var(--banner);
}

.chart-bar-today {
  background: var(--accent);
  border-color: var(--accent);
}

.chart-label {
  font-size: .68rem;
  color: var(--muted);
  margin-top: 12px;
}

.chart-date {
  font-size: .57rem;
  color: var(--muted);
  opacity: .8;
}

.chart-caption {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .63rem;
  color: var(--muted);
  margin-top: 13px;
  flex-wrap: wrap;
}

.chart-caption>span:last-child:not(.legend-dot) {
  margin-left: auto;
}

.legend-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 2px;
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
}

table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: .75rem;
}

th {
  font-size: .65rem;
  font-weight: 700;
  color: var(--muted);
  padding: 11px 13px;
  background: var(--surface-soft);
  white-space: nowrap;
}

td {
  padding: 16px 13px;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-service {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: .71rem;
  white-space: nowrap;
}

.table-service>.icon {
  width: 17px;
  color: var(--muted);
}

.recent-panel {
  padding-bottom: 12px;
}

.recent-panel .table-scroll {
  margin-left: -10px;
  margin-right: -10px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 23px;
}

.avatar-large {
  height: 49px;
  width: 49px;
  font-size: 1.25rem;
  border-radius: 15px;
}

.profile-identity>div {
  min-width: 0;
}

.profile-identity h3 {
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.profile-identity .pill {
  font-size: .6rem;
  margin-top: 7px;
  padding: 3px 6px;
}

.account-details {
  margin: 0 0 19px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-details dt {
  font-size: .66rem;
  color: var(--muted);
  margin-bottom: 3px;
}

.account-details dd {
  font-size: .74rem;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-card>.btn {
  font-size: .72rem;
  min-height: 38px;
  padding: 8px 12px;
}

.appearance-card>.panel-heading {
  margin-bottom: 9px;
}

.appearance-card>p {
  font-size: .72rem;
}

.theme-picker {
  border: 0;
  margin: 20px 0 16px;
  padding: 0;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.theme-option {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-size: .55rem;
  color: var(--muted);
  min-width: 23px;
}

.theme-option>input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.swatch {
  border: 1px solid #0000001f;
  border-radius: 50%;
  height: 25px;
  width: 25px;
  display: grid;
  place-items: center;
}

.swatch .icon {
  width: 14px;
  height: 14px;
  opacity: 0;
  color: #263c31;
  stroke-width: 2.4;
}

.swatch-mint {
  background: #d8ebde;
}

.swatch-lavender {
  background: #e6ddf5;
}

.swatch-sky {
  background: #d8ebf8;
}

.swatch-peach {
  background: #f7e0cf;
}

.swatch-rose {
  background: #f2d9e3;
}

.swatch-light {
  background: #fff;
}

.swatch-dark {
  background: #17191b;
}

.swatch-dark .icon {
  color: #fff;
}

.theme-option input:checked+.swatch {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-option input:checked+.swatch>.icon {
  opacity: 1;
}

.theme-option input:focus-visible+.swatch {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.preference-note {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .59rem;
  color: var(--muted);
}

.preference-note .icon {
  width: 12px;
  height: 12px;
}

.contact-card {
  background: var(--tint);
  color: var(--text);
  border-radius: var(--radius);
  padding: 23px;
}

.contact-card .eyebrow {
  font-size: .56rem;
  color: var(--accent);
}

.contact-card h3 {
  font-size: .91rem;
  margin: 7px 0;
}

.contact-card p {
  font-size: .7rem;
}

.contact-card .social-links {
  justify-content: flex-start;
  gap: 22px;
  margin-top: 18px;
}

.compact .social-circle {
  width: 35px;
  height: 35px;
  background: var(--surface);
}

.compact .social-circle .icon {
  width: 18px;
  height: 18px;
}

.compact .social-link {
  font-size: .59rem;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
}

.empty-state>.icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  margin-bottom: 15px;
}

.empty-state h3 {
  font-size: .95rem;
}

.empty-state p {
  font-size: .78rem;
  margin: 8px 0 17px;
}

/* Dialog nativo: foco contenido, Escape y soporte de teclado. */
.modal {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  width: min(480px,calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  box-shadow: 0 25px 100px #00000030;
}

.modal::backdrop {
  background: #121d27a6;
}

.modal[open] {
  animation: dialog-in .15s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.modal h2 {
  font-size: 1.4rem;
}

.modal-header .eyebrow {
  font-size: .61rem;
}

.modal>p {
  font-size: .84rem;
  margin-bottom: 24px;
}

.modal-header>.icon-btn {
  margin: -8px -8px 0 0;
}

.modal .social-links {
  margin: 24px 0;
}

.modal .theme-picker {
  gap: 12px;
}

.modal .theme-option {
  font-size: .68rem;
}

.modal .swatch {
  width: 35px;
  height: 35px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.password-details {
  border-top: 1px solid var(--border);
  padding-top: 15px;
}

.password-details summary {
  cursor: pointer;
  font-size: .8rem;
  font-weight: 700;
  padding: 4px 0;
}

.password-details summary>span {
  font-size: .7rem;
  margin-left: 9px;
}

.password-details .field {
  margin-top: 16px;
}

body: has(dialog[open]) {
  overflow: hidden;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  width: max-content;
  background: var(--text);
  color: var(--surface);
  padding: 14px 22px;
  border-radius: 12px;
  box-shadow: 0 8px 40px #0002;
  font-size: .83rem;
  z-index: 150;
}

.toast.error {
  background: var(--danger);
  color: var(--surface);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Catálogo e historial: contenido acotado y filtros locales. */
.catalog-filters {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 25px 0;
}

.catalog-filters .input-icon {
  flex: 1;
}

.catalog-filters select {
  width: 230px;
}

.catalog-filters>span {
  font-size: .75rem;
  white-space: nowrap;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 20px;
}

.service-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.service-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}

.service-card .eyebrow {
  font-size: .57rem;
  margin-bottom: 10px;
}

.service-card h2 {
  font-size: .95rem;
  line-height: 1.5;
  letter-spacing: -.02em;
}

.service-card p {
  font-size: .72rem;
  margin: 9px 0 24px;
  line-height: 1.8;
}

.service-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 17px;
  margin-top: auto;
}

.service-card-footer>span {
  font-size: .65rem;
  color: var(--muted);
}

.service-card-footer strong {
  font-size: 1rem;
  color: var(--text);
}

.service-card-footer .btn {
  font-size: .65rem;
}

.service-card-footer .icon {
  width: 14px;
  height: 14px;
}

.modal-wide {
  width: min(750px,calc(100% - 32px));
}

.query-form {
  display: flex;
  gap: 14px;
  align-items: flex-end;
}

.query-form .field {
  flex: 1;
}

.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 25px 0 15px;
  flex-wrap: wrap;
}

.result-actions {
  display: flex;
  gap: 10px;
}

#pdf-details {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

#pdf-details summary {
  cursor: pointer;
  font-size: .85rem;
  font-weight: 700;
}

#query-preview {
  width: 100%;
  height: 430px;
  border: 1px solid var(--border);
  margin-top: 15px;
  border-radius: 8px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  font-size: .72rem;
  color: var(--muted);
}

.pagination>div {
  display: flex;
  gap: 9px;
}

.browser-info {
  display: block;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-three {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-search input {
  min-height: 40px;
  padding: 8px 12px;
  font-size: .77rem;
  max-width: 240px;
}

.admin-table {
  font-size: .73rem;
}

.admin-table td {
  padding: 15px 10px;
}

.admin-table th {
  padding: 12px 10px;
}

.table-user {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 220px;
}

.table-user strong {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-user small {
  display: block;
  font-size: .61rem;
  color: var(--muted);
  margin-top: 3px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.row-actions .btn {
  font-size: .67rem;
  padding: 7px 10px;
}

.row-actions .icon {
  width: 15px;
  height: 15px;
}

.service-ranking {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 12px 0;
  font-size: .74rem;
}

.service-ranking>span {
  flex: 1;
  min-width: 0;
}

.service-ranking meter {
  width: 40%;
  height: 12px;
  accent-color: var(--accent);
}

.service-ranking meter::-webkit-meter-optimum-value {
  background: var(--accent);
}

.service-ranking strong {
  min-width: 30px;
  text-align: right;
}

.error-page {
  max-width: 650px;
  margin: 70px auto;
  padding: 25px;
}

.error-page>.brand {
  margin-bottom: 35px;
}

.error-page .panel>* {
  margin-bottom: 20px;
}

/* Adaptación a pantallas pequeñas y preferencias de movimiento. */
@media(min-width:1600px) {
  .main-content {
    padding-top: 36px;
  }
  .dashboard-columns {
    grid-template-columns: minmax(0,1fr) 335px;
  }
  .stat-card {
    padding: 23px;
  }
  .stat-top {
    font-size: .8rem;
  }
  .stat-meta,.stat-card .text-button {
    font-size: .72rem;
  }
  .panel-heading h2 {
    font-size: 1.1rem;
  }
  .panel-heading p {
    font-size: .8rem;
  }
}

@media(max-width:1200px) {
  .sidebar {
    width: 210px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .workspace {
    margin-left: 210px;
  }
  .main-content {
    padding: 26px 24px 0;
  }
  .topbar {
    padding: 0 24px;
  }
  .dashboard-columns {
    grid-template-columns: minmax(0,1fr) 275px;
    gap: 18px;
  }
  .dashboard-primary,.dashboard-secondary {
    gap: 18px;
  }
  .stats-grid {
    gap: 12px;
  }
  .stat-card {
    padding: 15px;
  }
  .stat-top {
    font-size: .66rem;
  }
  .stat-top .icon-tile {
    height: 29px;
    width: 29px;
  }
  .panel {
    padding: 19px;
  }
  .stat-date {
    font-size: 1.17rem;
    line-height: 2.3;
  }
  .theme-picker {
    gap: 5px;
  }
  .swatch {
    width: 23px;
    height: 23px;
  }
  .chart-caption>span:last-child:not(.legend-dot) {
    margin-left: 0;
  }
  .service-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .contact-card {
    padding: 19px;
  }
  .welcome-banner {
    padding: 25px;
  }
  .auth-story {
    padding-left: 10%;
    padding-right: 9%;
  }
}

@media(max-width:1020px) {
  .dashboard-columns {
    grid-template-columns: minmax(0,1fr);
  }
  .dashboard-secondary {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    align-items: start;
  }
  .profile-card {
    grid-row: span 2;
  }
  .stats-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .stats-three {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .stat-date {
    font-size: 1.4rem;
    line-height: 1.93;
  }
  .auth-story h1 {
    font-size: 3rem;
  }
  .auth-story {
    padding: 32px 9%;
  }
  .auth-main {
    padding: 24px 8%;
  }
  .auth-footer {
    flex-direction: column;
    gap: 5px;
  }
  .theme-picker {
    justify-content: flex-start;
    gap: 12px;
  }
  .panel-heading h2 {
    font-size: 1rem;
  }
  .panel-heading p {
    font-size: .78rem;
  }
  .stat-meta,.stat-card .text-button {
    font-size: .72rem;
  }
  .stat-top {
    font-size: .78rem;
  }
}

@media(max-width:760px) {
  .mobile-only {
    display: inline-grid;
  }
  .mobile-brand {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    width: 265px;
    transition: transform .2s;
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: #13212880;
  }
  .sidebar-brand {
    padding-bottom: 30px;
  }
  .workspace {
    margin-left: 0;
  }
  .main-content {
    padding: 22px 20px 0;
  }
  .topbar {
    height: 65px;
    padding: 0 16px;
  }
  .breadcrumb {
    gap: 10px;
    font-size: .73rem;
  }
  .topbar-actions {
    gap: 10px;
  }
  .top-date {
    display: none;
  }
  .top-avatar {
    width: 30px;
    height: 30px;
    font-size: .75rem;
  }
  .topbar-actions>.icon-btn {
    width: 32px;
    height: 32px;
  }
  .page-heading {
    gap: 15px;
  }
  .page-heading h1 {
    font-size: 1.8rem;
  }
  .page-heading p:not(.eyebrow) {
    font-size: .77rem;
  }
  .page-heading>.btn {
    font-size: .72rem;
    padding: 10px 13px;
    min-width: max-content;
  }
  .welcome-banner {
    padding: 22px;
  }
  .welcome-banner h2 {
    font-size: 1.55rem;
  }
  .welcome-banner>.btn {
    font-size: .7rem;
    padding: 9px 12px;
  }
  .welcome-banner>.btn>.icon:last-child {
    display: none;
  }
  .auth-page {
    display: block;
  }
  .auth-story {
    display: none;
  }
  .auth-main {
    padding: 18px 22px 24px;
    min-height: 100svh;
  }
  .auth-top {
    justify-content: space-between;
    align-items: center;
  }
  .auth-top .brand>span {
    font-size: 1.6rem;
  }
  .auth-top .brand img {
    width: 32px;
    height: 32px;
  }
  .auth-form-wrap {
    padding: 36px 0 10px;
  }
  .auth-heading h2 {
    font-size: 1.9rem;
  }
  .service-card p {
    font-size: .78rem;
  }
  .catalog-filters {
    flex-wrap: wrap;
    gap: 12px;
  }
  .catalog-filters .input-icon {
    flex-basis: 100%;
  }
  .catalog-filters select {
    flex: 1;
    width: auto;
  }
  .admin-search input {
    max-width: 180px;
  }
  .admin-table {
    min-width: 860px;
  }
  .page-footer {
    font-size: .61rem;
  }
  .sidebar-user strong {
    max-width: 130px;
  }
}

@media(max-width:480px) {
  .main-content {
    padding: 21px 16px 0;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }
  .page-heading>.btn {
    align-self: flex-start;
    font-size: .79rem;
  }
  .welcome-banner {
    gap: 19px;
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 17px;
  }
  .welcome-banner h2 {
    font-size: 1.55rem;
  }
  .welcome-banner>.btn {
    font-size: .76rem;
  }
  .stats-grid {
    gap: 11px;
    margin-bottom: 18px;
  }
  .stat-card {
    padding: 15px 13px;
  }
  .stat-top {
    align-items: flex-start;
    font-size: .68rem;
    gap: 4px;
  }
  .stat-top .icon-tile {
    height: 27px;
    width: 27px;
    border-radius: 8px;
  }
  .stat-top .icon {
    width: 15px;
    height: 15px;
  }
  .stat-number {
    font-size: 1.8rem;
  }
  .stat-date {
    font-size: 1.15rem;
    line-height: 2.1;
  }
  .stat-meta,.stat-card .text-button {
    font-size: .63rem;
  }
  .dashboard-secondary {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .dashboard-secondary>* {
    width: 100%;
  }
  .dashboard-columns {
    gap: 18px;
  }
  .panel {
    padding: 18px;
  }
  .panel-heading {
    gap: 10px;
  }
  .panel-heading h2 {
    font-size: .97rem;
  }
  .panel-heading p {
    font-size: .69rem;
  }
  .panel-heading>.pill {
    font-size: .6rem;
  }
  .panel-heading .text-link {
    font-size: .65rem;
  }
  .activity-chart {
    gap: 13px;
  }
  .chart-caption {
    font-size: .61rem;
  }
  .theme-picker {
    gap: 14px;
    justify-content: space-between;
  }
  .swatch {
    width: 27px;
    height: 27px;
  }
  .theme-option {
    font-size: .6rem;
  }
  .account-details dt {
    font-size: .74rem;
  }
  .account-details dd {
    font-size: .82rem;
  }
  .appearance-card>p {
    font-size: .79rem;
  }
  .preference-note {
    font-size: .65rem;
  }
  .profile-card>.btn {
    font-size: .8rem;
    min-height: 43px;
  }
  .contact-card h3 {
    font-size: 1rem;
  }
  .contact-card p {
    font-size: .79rem;
  }
  .compact .social-link {
    font-size: .7rem;
  }
  .compact .social-circle {
    width: 42px;
    height: 42px;
  }
  .contact-card .social-links {
    gap: 30px;
  }
  .stats-three {
    grid-template-columns: 1fr;
  }
  .stats-three .stat-card {
    padding: 20px;
  }
  .stats-three .stat-top {
    font-size: .8rem;
  }
  .service-grid {
    grid-template-columns: 1fr;
  }
  .service-card-footer .btn {
    font-size: .75rem;
  }
  .service-card h2 {
    font-size: 1.02rem;
  }
  .service-card-footer>span {
    font-size: .76rem;
  }
  .pagination {
    flex-direction: column;
    align-items: flex-start;
    font-size: .7rem;
  }
  .modal {
    padding: 22px 19px;
    max-height: calc(100dvh - 24px);
  }
  .modal h2 {
    font-size: 1.25rem;
  }
  .modal .theme-picker {
    gap: 12px;
    justify-content: flex-start;
  }
  .modal .swatch {
    width: 31px;
    height: 31px;
  }
  .modal .theme-option {
    font-size: .62rem;
  }
  .form-two {
    gap: 12px;
  }
  .query-form {
    align-items: stretch;
    flex-direction: column;
  }
  .query-form>.btn {
    align-self: flex-start;
  }
  .admin-search {
    width: 100%;
  }
  .admin-search input {
    max-width: none;
    flex: 1;
  }
  .panel-heading:has(.admin-search) {
    flex-direction: column;
    align-items: stretch;
  }
  .auth-main {
    padding: 18px 23px;
  }
  .auth-heading>h2 {
    font-size: 1.8rem;
  }
  .social-links {
    gap: 32px;
  }
  .breadcrumb>span:first-of-type,.breadcrumb-slash {
    display: none;
  }
  .chart-date {
    font-size: .6rem;
  }
}

@media(max-height:800px) and (min-width:761px) {
  .sidebar {
    padding-top: 20px;
  }
  .sidebar-brand {
    padding-bottom: 26px;
  }
  .nav-list {
    margin-bottom: 18px;
    gap: 3px;
  }
  .nav-label {
    margin-bottom: 8px;
  }
  .nav-link {
    min-height: 40px;
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .credit-promo {
    padding: 13px;
    margin-bottom: 14px;
  }
  .credit-promo .icon-tile {
    margin-bottom: 8px;
  }
  .credit-promo p {
    margin-bottom: 12px;
  }
  .sidebar-user {
    padding: 13px 0;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    animation: none!important;
    transition: none!important;
    scroll-behavior: auto!important;
  }
}
