/* ==========================================================================
   OOODAAA · Sistema de diseño
   Blanco predominante, grises suaves, texto negro y un color de identidad.
   ========================================================================== */

:root {
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-soft: #eef0ff;
  --brand-softer: #f6f7ff;
  --brand-text: #3730a3;

  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-muted: #f1f3f6;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d4d7dd;

  --text: #0f1115;
  --text-2: #42464f;
  --text-3: #6b7080;

  --success: #0f7a55;  --success-bg: #e8f6ef;
  --warning: #9a5b00;  --warning-bg: #fdf4e3;
  --danger: #c02626;   --danger-bg: #fdeceb;
  --info: #1d5fd6;     --info-bg: #e9f1fe;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 17, 21, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 17, 21, 0.06), 0 1px 2px rgba(15, 17, 21, 0.04);
  --shadow: 0 4px 16px rgba(15, 17, 21, 0.06), 0 1px 3px rgba(15, 17, 21, 0.05);
  --shadow-lg: 0 16px 40px rgba(15, 17, 21, 0.10), 0 2px 6px rgba(15, 17, 21, 0.05);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;

  --sidebar-w: 264px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

[data-theme="dark"] {
  --brand: #818cf8;
  --brand-hover: #a5b4fc;
  --brand-soft: rgba(129, 140, 248, 0.14);
  --brand-softer: rgba(129, 140, 248, 0.07);
  --brand-text: #c7d2fe;

  --bg: #0e1013;
  --bg-soft: #14171b;
  --bg-muted: #1b1f24;
  --surface: #15181c;
  --surface-raised: #1b1f24;
  --border: #262b32;
  --border-strong: #343a43;

  --text: #eceef1;
  --text-2: #b9bec7;
  --text-3: #8a909b;

  --success: #4ade9b;  --success-bg: rgba(74, 222, 155, 0.12);
  --warning: #f5b84a;  --warning-bg: rgba(245, 184, 74, 0.12);
  --danger: #f87171;   --danger-bg: rgba(248, 113, 113, 0.12);
  --info: #7cb0ff;     --info-bg: rgba(124, 176, 255, 0.12);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img, svg { max-width: 100%; }
code { font-family: var(--mono); font-size: .88em; background: var(--bg-muted); padding: .1em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: var(--radius); box-shadow: var(--shadow); }
.skip-link:focus { left: 8px; }

.muted { color: var(--text-3); }
.small { font-size: .85rem; }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1.5rem; }
.inline { display: inline; }
.is-hidden { display: none !important; }
.optional { color: var(--text-3); font-weight: 400; font-size: .85em; }
.stack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }

/* --------------------------------------------------------------------------
   Marca
   -------------------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-weight: 750; letter-spacing: .04em; font-size: 1.02rem; }
.site-logo { display: inline-flex; color: inherit; }
.site-logo:hover { color: inherit; }

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 38px; padding: 0 1rem;
  font: inherit; font-size: .9rem; font-weight: 550; line-height: 1;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-border); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease), color .15s;
}
.btn:hover { color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-border: var(--brand); box-shadow: var(--shadow-xs); }
.btn-primary:hover { --btn-bg: var(--brand-hover); --btn-border: var(--brand-hover); }
[data-theme="dark"] .btn-primary { --btn-fg: #0e1013; }
.btn-secondary { box-shadow: var(--shadow-xs); }
.btn-secondary:hover { --btn-bg: var(--bg-soft); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-bg: var(--bg-muted); --btn-fg: var(--text); }
.btn-danger { --btn-bg: var(--danger); --btn-border: var(--danger); --btn-fg: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-danger-ghost { --btn-bg: transparent; --btn-border: var(--border-strong); --btn-fg: var(--danger); }
.btn-danger-ghost:hover { --btn-bg: var(--danger-bg); --btn-border: var(--danger); }
.btn-light { --btn-bg: #fff; --btn-fg: #111; --btn-border: #fff; }
.btn-light:hover { --btn-bg: #f2f2f5; --btn-fg: #111; }
.btn-sm { min-height: 32px; padding: 0 .75rem; font-size: .84rem; border-radius: 8px; }
.btn-lg { min-height: 46px; padding: 0 1.35rem; font-size: .98rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text-2); cursor: pointer; transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text); }
.icon-btn-sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn-sm .icon { width: 16px; height: 16px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: .85rem; font-weight: 550; cursor: pointer; }
.link-btn:hover { color: var(--brand-hover); text-decoration: underline; }
.small-link { font-size: .84rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; color: var(--text-3); margin-bottom: .4rem; }
.back-link .icon { width: 15px; height: 15px; }
.back-link:hover { color: var(--text); }

.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }

/* --------------------------------------------------------------------------
   Insignias y alertas
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .25rem; padding: .18rem .55rem;
  font-size: .75rem; font-weight: 600; line-height: 1.35; border-radius: var(--radius-full);
  white-space: nowrap; vertical-align: middle;
}
.badge .icon { width: 12px; height: 12px; }
.badge-neutral { background: var(--bg-muted); color: var(--text-2); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-brand { background: var(--brand-soft); color: var(--brand-text); }
[data-theme="dark"] .badge-brand { color: var(--brand-text); }

.flash-stack { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.25rem; }
.site .flash-stack { margin-top: 1.25rem; }
.alert {
  display: flex; align-items: flex-start; gap: .65rem; padding: .8rem 1rem;
  border: 1px solid transparent; border-radius: var(--radius); font-size: .9rem;
  animation: fade-in .25s var(--ease); transition: opacity .3s, transform .3s;
}
.alert > span { flex: 1; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 20%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.alert-close { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; opacity: .7; }
.alert-close:hover { opacity: 1; }
.alert-close .icon { width: 16px; height: 16px; }
.alert.is-leaving { opacity: 0; transform: translateY(-4px); }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.info-band {
  display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; margin-top: 1rem;
  background: var(--brand-softer); border: 1px solid var(--brand-soft); border-radius: var(--radius); color: var(--text-2);
}
.info-band > .icon { color: var(--brand); margin-top: 2px; }
.info-band p { margin: 0; }

/* --------------------------------------------------------------------------
   Tarjetas
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); min-width: 0;
}
.card + .card { margin-top: 0; }
.card-pad { padding: 1.25rem; }
.card-pad-lg { padding: 1.75rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-header h3 { margin: 0; }
.card-body { padding: 1rem 1.25rem; margin: 0; }
.card-footer:not(:empty) { padding: .85rem 1.25rem; border-top: 1px solid var(--border); }
.card-title { font-size: 1rem; margin-bottom: 1rem; }
.card.is-link { display: block; color: inherit; transition: border-color .15s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.card.is-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.form-group-end { justify-content: flex-end; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.settings-layout > .form-actions { margin-top: .25rem; }
.label { font-size: .86rem; font-weight: 600; color: var(--text); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: .55rem .8rem;
  font: inherit; font-size: .92rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-sm { min-height: 34px; padding: .35rem .7rem; font-size: .86rem; }
.textarea { resize: vertical; line-height: 1.55; }
.select {
  appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px;
}
.is-invalid { border-color: var(--danger) !important; }
.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-bg) !important; }
.field-error { margin: 0; font-size: .82rem; color: var(--danger); }
.field-hint { margin: 0; font-size: .82rem; color: var(--text-3); }
.checkbox { display: inline-flex; align-items: flex-start; gap: .55rem; font-size: .9rem; color: var(--text-2); cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.input-with-action { position: relative; }
.input-with-action .input { padding-right: 2.75rem; }
.input-action { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; color: var(--text-3); cursor: pointer; border-radius: 8px; }
.input-action:hover { color: var(--text); background: var(--bg-muted); }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: grid; place-items: center; padding: 0 .75rem; background: var(--bg-muted); border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); color: var(--text-3); font-size: .9rem; }
.input-prefix .input { border-radius: 0 var(--radius) var(--radius) 0; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.5rem 1rem;
  text-align: center; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--bg-soft); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-dragging { border-color: var(--brand); background: var(--brand-softer); }
.dropzone:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.dropzone-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--surface); color: var(--brand); box-shadow: var(--shadow-xs); margin-bottom: .25rem; }
.dropzone-text { font-size: .92rem; color: var(--text-2); }
.dropzone-text strong { color: var(--brand); }
.dropzone-hint { font-size: .8rem; color: var(--text-3); }
.dropzone-files { list-style: none; margin: .5rem 0 0; padding: 0; width: 100%; max-width: 420px; text-align: left; }
.dropzone-files:empty { display: none; }
.dropzone-files li { display: flex; justify-content: space-between; gap: .75rem; padding: .4rem .7rem; margin-top: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: .84rem; overflow: hidden; }
.dropzone-files li span { color: var(--text-3); white-space: nowrap; }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.toolbar .select { width: auto; min-width: 190px; }
.search-input { position: relative; flex: 1; min-width: 200px; }
.search-input > .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; pointer-events: none; }
.search-input .input { padding-left: 2.2rem; }

.theme-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; border: 0; padding: 0; margin: 0; }
.theme-picker legend { margin-bottom: .5rem; }
.theme-option input { position: absolute; opacity: 0; }
.theme-option span { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .9rem .5rem; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: .85rem; cursor: pointer; transition: border-color .15s, background-color .15s; }
.theme-option input:checked + span { border-color: var(--brand); background: var(--brand-softer); color: var(--brand-text); box-shadow: 0 0 0 1px var(--brand); }
.theme-option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Sitio público
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.site-nav { display: flex; align-items: center; gap: .25rem; flex: 1; }
.site-nav > a { padding: .45rem .8rem; border-radius: 8px; color: var(--text-2); font-size: .92rem; font-weight: 500; }
.site-nav > a:hover, .site-nav > a.is-active { color: var(--text); background: var(--bg-muted); }
.site-nav-auth { display: flex; gap: .5rem; margin-left: auto; }
.site-header-actions { display: flex; align-items: center; gap: .25rem; }
.site-nav-toggle { display: none; }
.site-main { min-height: calc(100vh - 64px - 260px); }

.hero { padding: 4.5rem 0 3.5rem; background: radial-gradient(1200px 400px at 85% -10%, var(--brand-softer), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; margin-bottom: 1.25rem; font-size: .8rem; font-weight: 600; color: var(--brand-text); background: var(--brand-soft); border-radius: var(--radius-full); }
.eyebrow .icon { width: 14px; height: 14px; }
.lead { font-size: 1.08rem; color: var(--text-2); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 1.5rem; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; color: var(--text-2); font-size: .9rem; }
.hero-points li { display: inline-flex; align-items: center; gap: .4rem; }
.hero-points .icon { color: var(--success); width: 17px; height: 17px; }
.hero-art img { width: 100%; height: auto; filter: drop-shadow(0 20px 40px rgba(15, 17, 21, .08)); }
[data-theme="dark"] .hero-art img,
[data-theme="dark"] .auth-aside-body img,
[data-theme="dark"] .empty-state img,
[data-theme="dark"] .error-box img { filter: brightness(.82) contrast(.95); }

.page-hero { padding: 3rem 0 1.5rem; text-align: center; }
.page-hero .lead { margin: 0 auto 1.5rem; }
.search-bar { display: flex; align-items: center; gap: .5rem; max-width: 560px; margin: 0 auto; padding: .35rem .35rem .35rem 1rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-full); box-shadow: var(--shadow-sm); }
.search-bar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-bar > .icon { color: var(--text-3); }
.search-bar input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--text); padding: .45rem 0; outline: none; }
.search-bar .btn { border-radius: var(--radius-full); }

.section { padding: 4rem 0; }
.section-tight { padding: 1.5rem 0 4rem; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.section-head p { color: var(--text-2); margin: 0; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; text-align: left; max-width: none; }
.section-subtitle { margin: 3rem 0 1.25rem; font-size: 1.25rem; }

.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.category-card { padding: 1.4rem; }
.category-card h3 { margin: 1rem 0 .35rem; }
.category-card p { color: var(--text-2); font-size: .9rem; margin-bottom: 1rem; }
.category-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.category-icon .icon { width: 21px; height: 21px; }
.category-icon-sm { width: 32px; height: 32px; border-radius: 9px; }
.category-icon-sm .icon { width: 17px; height: 17px; }
.category-meta { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 550; color: var(--brand); }
.category-meta .icon { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.category-card:hover .category-meta .icon { transform: translateX(3px); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: step; }
.step { position: relative; padding: 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.step-num { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-bottom: .9rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .9rem; }
[data-theme="dark"] .step-num { color: #0e1013; }
.step p { color: var(--text-2); font-size: .9rem; margin: 0; }

.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.service-card { display: flex !important; flex-direction: column; padding: 1.25rem; }
.service-card-top { display: flex; align-items: center; gap: .55rem; margin-bottom: .9rem; }
.service-card-top .badge { margin-left: auto; }
.service-card h3 { margin-bottom: .35rem; }
.service-card p { color: var(--text-2); font-size: .9rem; flex: 1; }
.service-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.service-card-foot span { display: inline-flex; align-items: center; gap: .3rem; }
.service-card-foot .icon { width: 14px; height: 14px; }

.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.5rem; border-radius: 20px; background: var(--brand); color: #fff; }
.cta-band h2 { color: #fff; }
.cta-band p { margin: 0; opacity: .9; max-width: 56ch; }
[data-theme="dark"] .cta-band { background: linear-gradient(135deg, #312e81, #3730a3); }

.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; font-size: .86rem; font-weight: 500; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-full); transition: all .15s; }
.chip .icon { width: 15px; height: 15px; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-count { font-size: .75rem; padding: 0 .4rem; border-radius: var(--radius-full); background: var(--bg-muted); color: var(--text-3); }
.chip.is-active .chip-count { background: rgba(255, 255, 255, .2); color: inherit; }

.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.5rem; font-size: .86rem; color: var(--text-3); }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs .icon { width: 14px; height: 14px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.detail-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: .5rem; }
.detail-aside { position: sticky; top: 84px; }
.detail-price { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1rem; }
.detail-meta { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--text-2); }
.detail-meta .icon { color: var(--brand); width: 17px; height: 17px; }
.detail-aside .btn { margin-top: .75rem; }

.prose { color: var(--text-2); line-height: 1.7; overflow-wrap: anywhere; }
.prose > *:last-child { margin-bottom: 0; }
.prose pre { background: var(--bg-muted); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; overflow-x: auto; font-size: .85rem; }
.prose pre code { background: none; padding: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li { margin: .2rem 0; }
.prose h3, .prose h4, .prose h5 { color: var(--text); margin-top: 1em; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.pricing-card { position: relative; display: flex; flex-direction: column; padding: 1.75rem; }
.pricing-card.is-featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.pricing-ribbon { position: absolute; top: 1.1rem; right: 1.1rem; }
.pricing-price { font-size: 2rem; font-weight: 750; letter-spacing: -0.03em; margin: .5rem 0 1.25rem; }
.pricing-price span { display: block; font-size: .85rem; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.check-list { list-style: none; padding: 0; margin: 0 0 1.5rem; flex: 1; }
.check-list li { display: flex; gap: .5rem; padding: .3rem 0; font-size: .92rem; color: var(--text-2); }
.check-list .icon { color: var(--success); width: 17px; height: 17px; margin-top: 2px; }

.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.help-aside { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 84px; }
.help-aside h3 { margin-top: .9rem; }
.help-email { display: flex; align-items: center; gap: .4rem; margin: .9rem 0 0; }
.help-email .icon { width: 15px; height: 15px; }
.faq-group + .faq-group { margin-top: 2rem; }
.faq-title { font-size: 1.05rem; margin-bottom: .75rem; }
.faq { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: .5rem; transition: border-color .15s; }
.faq[open] { border-color: var(--border-strong); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .95rem 1.1rem; cursor: pointer; font-weight: 550; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform .2s var(--ease); color: var(--text-3); }
.faq[open] summary .icon { transform: rotate(180deg); }
.faq-body { padding: 0 1.1rem 1rem; color: var(--text-2); font-size: .93rem; line-height: 1.7; }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 3rem 0 1.5rem; margin-top: 2rem; }
.site-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer-grid p { margin-top: .9rem; font-size: .9rem; max-width: 38ch; }
.site-footer h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: .8rem; }
.site-footer-grid a:not(.site-logo) { display: block; color: var(--text-2); font-size: .9rem; padding: .2rem 0; }
.site-footer-grid a:hover { color: var(--text); }
.site-footer-bottom { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: .84rem; color: var(--text-3); }

/* --------------------------------------------------------------------------
   Autenticación
   -------------------------------------------------------------------------- */
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 100vh; }
.auth-aside { display: flex; flex-direction: column; padding: 2rem 2.5rem; background: var(--bg-soft); border-right: 1px solid var(--border); }
.auth-aside-body { margin: auto 0; max-width: 420px; }
.auth-aside-body img { width: 100%; max-width: 360px; height: auto; margin-bottom: 2rem; }
.auth-aside-body h2 { font-size: 1.6rem; }
.auth-aside-body p { color: var(--text-2); }
.auth-main { display: flex; flex-direction: column; padding: 1.5rem 2rem 3rem; }
.auth-topbar { display: flex; justify-content: flex-end; align-items: center; }
.auth-logo-mobile { display: none; margin-right: auto; }
.auth-card { width: 100%; max-width: 420px; margin: auto; padding-top: 1rem; }
.auth-title { font-size: 1.7rem; margin-bottom: .35rem; }
.auth-subtitle { color: var(--text-2); margin-bottom: 1.75rem; }
.auth-switch { margin-top: 1.5rem; text-align: center; font-size: .9rem; color: var(--text-2); }
.auth-switch a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 550; }
.auth-switch .icon { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   Paneles: estructura
   -------------------------------------------------------------------------- */
.app { background: var(--bg-soft); }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar-w);
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border);
  transition: transform .25s var(--ease);
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; height: var(--topbar-h); padding: 0 1.1rem; border-bottom: 1px solid var(--border); }
.sidebar-cta { padding: 1rem 1rem .25rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; }
.sidebar-section { margin: 1.1rem .6rem .4rem; font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.sidebar-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; margin-bottom: 2px; border-radius: 8px; color: var(--text-2); font-size: .9rem; font-weight: 500; transition: background-color .15s, color .15s; }
.sidebar-link:hover { background: var(--bg-muted); color: var(--text); }
.sidebar-link.is-active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.sidebar-link.is-active .icon { color: var(--brand); }
.sidebar-link span:first-of-type { flex: 1; }
.sidebar-count { min-width: 20px; padding: 0 .4rem; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; color: #fff; background: var(--brand); border-radius: var(--radius-full); }
[data-theme="dark"] .sidebar-count { color: #0e1013; }
.sidebar-footer { padding: .75rem; border-top: 1px solid var(--border); }
.sidebar-backdrop { display: none; }

.app-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem;
  height: var(--topbar-h); padding: 0 1.5rem;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-menu { display: none; }
.topbar-title { flex: 1; margin: 0; font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: .25rem; }
.dot-badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; color: #fff; background: var(--danger); border-radius: var(--radius-full); border: 2px solid var(--surface); box-sizing: content-box; }
.app-content { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; display: flex; flex-direction: column; gap: 1.25rem; }
.app-content.is-flush { max-width: none; padding: 0; gap: 0; }
.app-content > .flash-stack { margin-bottom: 0; }
.app-content.is-flush > .flash-stack { padding: 1rem 1.5rem 0; }

.user-chip { display: flex; align-items: center; gap: .5rem; padding: .25rem .5rem .25rem .25rem; border: 1px solid transparent; border-radius: var(--radius-full); background: none; color: var(--text); font: inherit; font-size: .88rem; font-weight: 550; cursor: pointer; }
.user-chip:hover { background: var(--bg-muted); }
.user-chip .icon { width: 15px; height: 15px; color: var(--text-3); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 230px; padding: .35rem;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.dropdown.is-open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-wide { width: 360px; max-width: calc(100vw - 2rem); padding: 0; }
.dropdown-right { right: 0; text-align: left; }
.dropdown-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem .9rem; border-bottom: 1px solid var(--border); }
.dropdown-user { flex-direction: column; align-items: flex-start; gap: 0; margin: -.35rem -.35rem .35rem; }
.dropdown-user span { font-size: .82rem; }
.dropdown-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .65rem; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: inherit; font-size: .88rem; text-align: left; cursor: pointer; }
.dropdown-item:hover { background: var(--bg-muted); color: var(--text); }
.dropdown-item .icon { width: 16px; height: 16px; }
.dropdown-footer { display: block; padding: .7rem; text-align: center; font-size: .86rem; font-weight: 550; border-top: 1px solid var(--border); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; flex-direction: column; gap: .1rem; padding: .75rem .9rem; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: .86rem; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--bg-soft); color: var(--text-2); }
.notif-item strong { color: var(--text); font-weight: 550; }
.notif-item small { color: var(--text-3); }
.notif-item.is-unread { background: var(--brand-softer); }
.notif-item.is-unread strong::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: .4rem; border-radius: 50%; background: var(--brand); vertical-align: middle; }
.notif-empty { padding: 1.5rem; margin: 0; text-align: center; color: var(--text-3); font-size: .88rem; }

/* --------------------------------------------------------------------------
   Paneles: componentes
   -------------------------------------------------------------------------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-header h2 { margin-bottom: .2rem; font-size: 1.5rem; }
.page-header p { margin: 0; }
.page-header .badge { margin-left: .25rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card { display: flex !important; align-items: flex-start; gap: .9rem; padding: 1.15rem 1.2rem; }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.stat-icon .icon { width: 20px; height: 20px; }
.stat-label { margin: 0; font-size: .82rem; color: var(--text-3); font-weight: 500; }
.stat-value { margin: .1rem 0 0; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); line-height: 1.25; }
.stat-hint { margin: .15rem 0 0; font-size: .78rem; color: var(--text-3); }

.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 1.25rem; align-items: start; }
.settings-layout { display: flex; flex-direction: column; gap: 1.25rem; max-width: 820px; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--border); }
.list-item { display: flex; align-items: center; gap: .85rem; padding: .85rem 1.25rem; color: var(--text); transition: background-color .15s; }
a.list-item:hover { background: var(--bg-soft); color: var(--text); }
.list-item-top { align-items: flex-start; }
.list-flat .list-item { padding: .8rem 0; }
.list-flat > li + li, .list-flat > .list-item + .list-item { border-top: 1px solid var(--border); }
.list-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 9px; background: var(--bg-muted); color: var(--text-2); }
.list-main { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.list-main strong { font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.list-item > .icon { color: var(--text-3); }
.list-item.is-unread { background: var(--brand-softer); }
.list-item.is-unread .list-icon { background: var(--brand-soft); color: var(--brand); }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.ai-promo { display: flex !important; align-items: center; gap: .9rem; padding: 1rem 1.2rem; }
.ai-promo div { flex: 1; }
.ai-promo p { margin: 0; }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2.75rem 1.5rem; }
.empty-state img { width: 150px; height: auto; margin-bottom: 1rem; opacity: .95; }
.empty-state h3 { margin-bottom: .35rem; }
.empty-state p { color: var(--text-3); max-width: 44ch; margin-bottom: 1.25rem; font-size: .92rem; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pagination-info { font-size: .85rem; color: var(--text-3); }

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { padding: .7rem 1.25rem; text-align: left; font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); background: var(--bg-soft); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr { cursor: pointer; transition: background-color .12s; }
.table-hover tbody tr:hover { background: var(--bg-soft); }
.table-link { color: var(--text); font-weight: 550; }
.table-link:hover { color: var(--brand); }
.table .badge + .badge { margin-left: .25rem; }
.user-cell { display: flex; align-items: center; gap: .65rem; }
.inline-icon { display: inline-flex; vertical-align: middle; margin-right: .45rem; color: var(--brand); }
.inline-icon .icon { width: 16px; height: 16px; }

.tabs { display: flex; gap: .25rem; padding: 0 1rem; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: .4rem; padding: .9rem .75rem; border: 0; background: none; color: var(--text-3); font: inherit; font-size: .9rem; font-weight: 550; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: .5rem; right: .5rem; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.tab-count { padding: 0 .45rem; font-size: .72rem; line-height: 18px; border-radius: var(--radius-full); background: var(--bg-muted); color: var(--text-3); }
.tab-count.is-brand { background: var(--brand); color: #fff; }
[data-theme="dark"] .tab-count.is-brand { color: #0e1013; }
.tabs-page { padding: 0; margin-bottom: -.25rem; }
.tab-panel { padding: 1.25rem; animation: fade-in .2s var(--ease); }
.tab-panel-flush { padding: 0; }

.progress-steps { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); margin: 0; padding: 0; }
.progress-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center; }
.progress-step::before { content: ""; position: absolute; top: 14px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; background: var(--border); }
.progress-step:first-child::before { display: none; }
.progress-step.is-done::before, .progress-step.is-current::before { background: var(--brand); }
.progress-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-muted); color: var(--text-3); font-size: .8rem; font-weight: 700; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.progress-dot .icon { width: 15px; height: 15px; }
.progress-step.is-done .progress-dot { background: var(--brand); color: #fff; box-shadow: none; }
.progress-step.is-current .progress-dot { background: var(--surface); color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
[data-theme="dark"] .progress-step.is-done .progress-dot { color: #0e1013; }
.progress-label { font-size: .78rem; font-weight: 550; color: var(--text-3); }
.progress-step.is-current .progress-label, .progress-step.is-done .progress-label { color: var(--text); }
.status-hint { display: flex; align-items: center; gap: .5rem; margin: 1.1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .9rem; color: var(--text-2); }
.status-hint .icon { color: var(--brand); }

.quote-card { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-sm); background: linear-gradient(var(--brand-softer), var(--brand-softer)), var(--surface); }
.quote-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.quote-head p { margin: 0; display: flex; align-items: center; gap: .35rem; }
.quote-head .icon { width: 15px; height: 15px; }
.quote-amount { font-size: 1.9rem; font-weight: 750; letter-spacing: -0.03em; color: var(--text); }
.quote-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.quote-body { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--brand-soft); }

.details { display: grid; grid-template-columns: auto 1fr; gap: .6rem 1rem; margin: 0; font-size: .88rem; }
.details dt { color: var(--text-3); }
.details dd { margin: 0; text-align: right; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.client-card { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.client-card div { display: flex; flex-direction: column; min-width: 0; }
.client-card a { overflow: hidden; text-overflow: ellipsis; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; display: flex; gap: .8rem; padding-bottom: 1rem; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item p { margin: .1rem 0 0; }
.timeline-item strong { font-size: .9rem; font-weight: 600; }
.timeline-dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; flex-shrink: 0; background: var(--text-3); box-shadow: 0 0 0 3px var(--surface); }
.tone-neutral { background: var(--text-3); }
.tone-info { background: var(--info); }
.tone-brand { background: var(--brand); }
.tone-success { background: var(--success); }
.tone-warning { background: var(--warning); }
.tone-danger { background: var(--danger); }

.file-section + .file-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.file-section-head { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .9rem; }
.file-section-head h4 { margin: 0; }
.file-section-head p { margin: .1rem 0 0; }
.file-empty { margin: 0; padding: .85rem 1rem; background: var(--bg-soft); border-radius: var(--radius); }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.file-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.file-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--bg-muted); color: var(--text-2); flex-shrink: 0; }
.file-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.file-main strong { font-weight: 550; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.file-actions form { display: inline; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.preview-item { position: relative; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.preview-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-muted); transition: transform .3s var(--ease); }
.preview-item a:hover img { transform: scale(1.03); }
.preview-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; aspect-ratio: 4 / 3; background: var(--bg-muted); color: var(--text-2); font-weight: 700; font-size: .8rem; }
.preview-file .icon { width: 28px; height: 28px; }
.preview-item figcaption { display: flex; flex-direction: column; padding: .5rem .65rem; font-size: .82rem; }
.preview-delete { position: absolute; top: 6px; right: 6px; background: var(--surface); box-shadow: var(--shadow-sm); }
.upload-inline { display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.upload-inline .dropzone { width: 100%; }
.upload-panel { display: flex; flex-direction: column; gap: .9rem; align-items: flex-start; margin-bottom: 1.5rem; padding: 1.1rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.upload-panel .form-row, .upload-panel .dropzone { width: 100%; }
.upload-panel .dropzone { background: var(--surface); }

.money-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: .9rem; }
.money-summary div { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; background: var(--bg-soft); border-radius: var(--radius); }
.money-summary strong { font-size: 1.05rem; }
.meter { height: 8px; margin-bottom: 1.25rem; border-radius: var(--radius-full); background: var(--bg-muted); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--success); transition: width .5s var(--ease); }
.pay-box { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.pay-box .info-band { margin: 0 0 1.25rem; }
.pay-box .form > .btn { align-self: flex-start; }

.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.bar-list a { display: grid; grid-template-columns: 110px 1fr 32px; align-items: center; gap: .75rem; padding: .35rem .4rem; border-radius: 8px; color: var(--text-2); font-size: .86rem; }
.bar-list a:hover { background: var(--bg-soft); color: var(--text); }
.bar-track { height: 8px; border-radius: var(--radius-full); background: var(--bg-muted); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; min-width: 2px; }
.bar-value { text-align: right; font-weight: 600; color: var(--text); }

.payment-list { list-style: none; margin: 0; padding: 0; }
.payment-item { display: flex; justify-content: space-between; gap: 1.25rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.payment-item:last-child { border-bottom: 0; }
.payment-item:target { background: var(--brand-softer); }
.payment-main { min-width: 0; }
.payment-main > div { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.payment-main p { margin: .15rem 0 0; }
.payment-amount { font-size: 1.15rem; font-weight: 700; }
.payment-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; flex-shrink: 0; width: 320px; max-width: 100%; }
.payment-review { display: flex; flex-direction: column; gap: .45rem; width: 100%; }
.payment-review-buttons { display: flex; justify-content: flex-end; gap: .4rem; }
.note { display: flex; gap: .4rem; align-items: flex-start; padding: .5rem .7rem; margin-top: .5rem !important; background: var(--bg-soft); border-radius: 8px; color: var(--text-2); }
.note .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--text-3); }

.profile-summary { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.profile-summary > div { flex: 1; min-width: 200px; }
.profile-summary h3 { margin: 0; font-size: 1.15rem; }
.profile-summary p { margin: .1rem 0 0; }
.ai-status { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .75rem; }

.mini-steps { margin: 0 0 1.25rem; padding-left: 1.2rem; color: var(--text-2); font-size: .9rem; }
.mini-steps li { padding: .2rem 0; }

/* --------------------------------------------------------------------------
   Chat de solicitud
   -------------------------------------------------------------------------- */
.chat { display: flex; flex-direction: column; height: 560px; max-height: 75vh; }
.chat-header { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--border); }
.chat-header p { margin: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .65rem; background: var(--bg-soft); }
.chat-empty { margin: auto; text-align: center; color: var(--text-3); max-width: 300px; }
.chat-empty .icon { width: 34px; height: 34px; margin-bottom: .5rem; }
.chat-date { display: flex; justify-content: center; margin: .5rem 0; }
.chat-date span { padding: .15rem .7rem; font-size: .74rem; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-full); }
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; animation: fade-in .2s var(--ease); }
.chat-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.chat-author { font-size: .74rem; font-weight: 600; color: var(--text-3); margin: 0 .5rem .2rem; }
.chat-bubble { padding: .6rem .9rem; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--border); font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.chat-msg.is-mine .chat-bubble { border-radius: 14px 14px 4px 14px; background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme="dark"] .chat-msg.is-mine .chat-bubble { color: #0e1013; }
.chat-time { font-size: .7rem; color: var(--text-3); margin: .2rem .5rem 0; }
.chat-composer { display: flex; align-items: flex-end; gap: .5rem; padding: .85rem 1rem; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.chat-composer textarea { flex: 1; min-height: 40px; max-height: 220px; padding: .55rem .85rem; font: inherit; font-size: .92rem; color: var(--text); background: var(--bg-soft); border: 1px solid var(--border-strong); border-radius: 12px; resize: none; }
.chat-composer textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
.chat-closed { display: flex; align-items: center; gap: .4rem; justify-content: center; margin: 0; padding: .9rem; border-top: 1px solid var(--border); }
.chat-closed .icon { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   Modal y toasts
   -------------------------------------------------------------------------- */
.modal { width: min(480px, calc(100vw - 2rem)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(15, 17, 21, .45); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in .2s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-body { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; }
.modal-body h3 { margin: 0; font-size: 1.15rem; }
.modal-body p { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; }

.toast-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast { padding: .75rem 1rem; max-width: 360px; font-size: .9rem; color: var(--bg); background: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: none; }
.toast-error { background: var(--danger); color: #fff; }
.toast-success { background: var(--success); color: #fff; }
[data-theme="dark"] .toast-success, [data-theme="dark"] .toast-error { color: #0e1013; }

/* --------------------------------------------------------------------------
   OOODAAA AI
   -------------------------------------------------------------------------- */
.ai-app { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: calc(100vh - var(--topbar-h)); background: var(--bg); }
.ai-sidebar { display: flex; flex-direction: column; padding: 1rem .75rem; border-right: 1px solid var(--border); background: var(--bg-soft); overflow: hidden; }
.ai-sidebar .sidebar-section { margin-left: .4rem; }
.ai-conversations { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.ai-list-empty { padding: .5rem .5rem; }
.ai-conv { position: relative; display: flex; align-items: center; border-radius: 8px; margin-bottom: 2px; }
.ai-conv:hover, .ai-conv.is-active { background: var(--bg-muted); }
.ai-conv.is-active .ai-conv-title { color: var(--text); font-weight: 600; }
.ai-conv-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .05rem; padding: .55rem .6rem; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.ai-conv-title { width: 100%; font-size: .87rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-conv-time { font-size: .72rem; color: var(--text-3); }
.ai-conv-delete { opacity: 0; font-size: 1.1rem; line-height: 1; margin-right: .2rem; }
.ai-conv:hover .ai-conv-delete, .ai-conv-delete:focus-visible { opacity: 1; }
.ai-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ai-topbar { display: flex; align-items: center; gap: .5rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--border); min-height: 52px; }
.ai-history-toggle { display: none; }
.ai-title { font-size: .93rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-messages { flex: 1; overflow-y: auto; padding: 1.5rem max(1.25rem, calc((100% - 780px) / 2)); display: flex; flex-direction: column; gap: 1.4rem; }
.ai-welcome { margin: auto; max-width: 620px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.ai-welcome img { margin-bottom: 1rem; }
.ai-welcome h2 { font-size: 1.6rem; }
.ai-welcome .alert { text-align: left; margin-top: 1rem; }
.ai-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-top: 1.25rem; width: 100%; }
.ai-suggestion { padding: .85rem 1rem; text-align: left; font: inherit; font-size: .88rem; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: border-color .15s, background-color .15s, transform .15s; }
.ai-suggestion:hover { border-color: var(--border-strong); background: var(--bg-soft); color: var(--text); transform: translateY(-1px); }
.ai-msg { display: flex; gap: .85rem; animation: fade-in .25s var(--ease); }
.ai-msg-user { justify-content: flex-end; }
.ai-bubble { max-width: 80%; padding: .7rem 1rem; background: var(--bg-muted); border-radius: 18px; font-size: .95rem; line-height: 1.6; overflow-wrap: anywhere; }
.ai-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .03em; }
[data-theme="dark"] .ai-avatar { color: #0e1013; }
.ai-answer { flex: 1; min-width: 0; padding-top: .2rem; }
.ai-content { color: var(--text); font-size: .95rem; }
.ai-msg.is-error .ai-content { color: var(--danger); }
.ai-copy { margin-top: .4rem; font-size: .78rem; color: var(--text-3); opacity: 0; transition: opacity .15s; }
.ai-msg:hover .ai-copy, .ai-copy:focus-visible { opacity: 1; }
.ai-typing { display: flex; gap: 5px; padding: .7rem 0; }
.ai-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: typing 1.2s infinite ease-in-out; }
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.ai-composer { padding: .5rem max(1.25rem, calc((100% - 780px) / 2)) 1rem; }
.ai-composer-box { display: flex; align-items: flex-end; gap: .5rem; padding: .5rem .5rem .5rem 1rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.ai-composer-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.ai-composer textarea { flex: 1; min-height: 40px; max-height: 220px; padding: .55rem 0; border: 0; background: none; font: inherit; font-size: .95rem; color: var(--text); resize: none; outline: none; }
.ai-composer .btn-icon { border-radius: 14px; }
.ai-disclaimer { margin: .5rem 0 0; text-align: center; font-size: .74rem; color: var(--text-3); }

.ai-privacy { display: flex; gap: .45rem; align-items: flex-start; margin: .75rem .4rem 0; padding-top: .75rem; border-top: 1px solid var(--border); line-height: 1.45; }
.ai-privacy .icon { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }

/* --------------------------------------------------------------------------
   Solicitudes, pagos y entregas
   -------------------------------------------------------------------------- */
.mb { margin-bottom: 1rem; }
.mono { font-family: var(--mono); font-size: .8em; overflow-wrap: anywhere; }
.grow { flex: 1; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.stack-sm > form, .stack-sm > form > .btn { width: 100%; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.container-narrow { max-width: 820px; }
.section-title { margin: .5rem 0 -.25rem; font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.grid-1-2 { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
.form-grid-2, .form-grid-3 { display: grid; gap: 1rem 1.25rem; align-items: start; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.choice-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span { display: flex; flex-direction: column; gap: .15rem; height: 100%; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, background-color .15s, box-shadow .15s; }
.choice small { color: var(--text-3); font-size: .78rem; line-height: 1.4; }
.choice:hover > span { border-color: var(--border-strong); }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-softer); box-shadow: 0 0 0 1px var(--brand); }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }

.milestones { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1rem .5rem; margin: 0 0 1.25rem; padding: 0; }
.milestone { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; }
.milestone-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-muted); color: var(--text-3); box-shadow: 0 0 0 1px var(--border); }
.milestone-dot .icon { width: 14px; height: 14px; }
.milestone.is-done .milestone-dot { background: var(--brand); color: #fff; box-shadow: none; }
[data-theme="dark"] .milestone.is-done .milestone-dot { color: #0e1013; }
.milestone.is-current .milestone-dot { box-shadow: 0 0 0 3px var(--brand-soft); }
.milestone-label { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.milestone.is-done .milestone-label { color: var(--text); }
.milestone-date { font-size: .72rem; color: var(--text-3); }
.status-history .list-item { padding: .7rem 0; }

.quote-respond { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--brand-soft); }
.quote-respond .form { gap: .6rem; align-items: flex-start; }
.split-value { display: flex; align-items: center; min-height: 42px; font-size: 1.1rem; }

.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; margin-top: .5rem; }
.method-card { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.method-card .prose { color: var(--text); }
.method-card p { margin: 0; }

.file-row.is-stacked { flex-direction: column; align-items: stretch; }
.file-row-main { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.review-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-top: .7rem; border-top: 1px dashed var(--border); }
.review-form .input { flex: 1 1 200px; min-height: 34px; padding: .35rem .7rem; font-size: .86rem; }
.review-panel { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-color: var(--warning); background: linear-gradient(var(--warning-bg), var(--warning-bg)), var(--surface); }
.review-panel.is-overdue { border-color: var(--danger); background: linear-gradient(var(--danger-bg), var(--danger-bg)), var(--surface); }
.review-info { flex: 1; min-width: 260px; }
.review-info h3 { display: flex; align-items: center; gap: .45rem; margin-bottom: .25rem; font-size: 1.05rem; }
.review-info p { margin: 0; }
.review-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.delivery-box { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-soft); }
.delivery-box .file-main strong { white-space: normal; }
.inline-edit { margin-top: .5rem; }
.inline-edit > summary { list-style: none; display: inline-flex; }
.inline-edit > summary::-webkit-details-marker { display: none; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.inline-form { display: inline; }

/* --------------------------------------------------------------------------
   Administración: filtros, gráficos, permisos y registros
   -------------------------------------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.filter-bar .form-group { margin: 0; min-width: 150px; flex: 1 1 150px; }
.filter-bar > .input, .filter-bar > .select { width: auto; flex: 1 1 160px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-inline { align-items: center; }
.filter-inline > .input { flex: 0 1 auto; }
.chip-group { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.chip-group .chip { padding: .3rem .75rem; font-size: .82rem; }
.chip-scroll { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: .25rem; scrollbar-width: thin; }
.chip-scroll .chip { flex-shrink: 0; }
.tabs-links { padding: 0 1rem; }
.notif-row { padding: .9rem 1.25rem; }

.chart { display: block; width: 100%; height: 200px; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-bar { fill: var(--brand); opacity: .85; transition: opacity .15s; }
.chart-bar:hover { opacity: 1; }
.chart-label { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart-caption { margin: .5rem 0 0; }

.setup-checklist { border-color: var(--brand); background: linear-gradient(var(--brand-softer), var(--brand-softer)), var(--surface); }
.setup-checklist .card-title { display: flex; align-items: center; gap: .45rem; }
.checklist { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .45rem 1.25rem; margin: 0; padding: 0; font-size: .9rem; }
.checklist li { display: flex; align-items: center; gap: .5rem; color: var(--text); }
.checklist li .icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--warning); }
.checklist li.is-done { color: var(--text-3); text-decoration: line-through; }
.checklist li.is-done .icon { color: var(--success); }

.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 40px; align-items: center; gap: .75rem; padding: .35rem 0; font-size: .86rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-row .bar-fill { background: var(--brand); }

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list > li { position: relative; display: flex; gap: .75rem; padding: .6rem 0; font-size: .88rem; }
.activity-list > li + li { border-top: 1px solid var(--border); }
.activity-list > li > div { min-width: 0; overflow-wrap: anywhere; }
.activity-dot { width: 8px; height: 8px; margin-top: .45rem; flex-shrink: 0; border-radius: 50%; background: var(--brand); }

.perm-group { margin: 0 0 1rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
.perm-group legend { padding: 0 .4rem; font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.perm-item { display: flex; padding: .35rem 0; }
.perm-item > span { display: flex; flex-direction: column; gap: .05rem; }
.perm-item strong { font-weight: 550; color: var(--text); }

.transcript { display: flex; flex-direction: column; gap: .75rem; max-height: 65vh; overflow-y: auto; padding: 1rem; background: var(--bg-soft); border-radius: var(--radius); }
.transcript-msg { max-width: 85%; padding: .65rem .9rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.transcript-msg.is-user { align-self: flex-end; background: var(--brand-soft); border-color: transparent; }
.transcript-msg .prose { margin-top: .25rem; color: var(--text); }
.code-block { max-height: 260px; overflow: auto; margin: .4rem 0 0; padding: .7rem .85rem; font-family: var(--mono); font-size: .78rem; line-height: 1.5; white-space: pre-wrap; color: var(--text-2); background: var(--bg-muted); border-radius: var(--radius-sm); }

.color-field { display: flex; align-items: center; gap: .5rem; }
.color-field input[type="color"] { width: 44px; height: 42px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.color-field .input { width: 120px; font-family: var(--mono); }
.brand-preview { display: flex; align-items: center; min-height: 56px; margin-bottom: .6rem; padding: .6rem .9rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg-soft); }
.brand-preview img { max-height: 40px; width: auto; }

/* Sitio público: precios y textos legales */
.pricing-rules { display: grid; margin-bottom: 2rem; }
.pricing-rules h3 { margin: .75rem 0 .35rem; font-size: 1.05rem; }
.pricing-rules p { margin: 0; }
.price-list { display: flex; flex-direction: column; gap: .45rem; margin: .25rem 0 1rem; font-size: .88rem; }
.price-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem .75rem; padding-bottom: .45rem; border-bottom: 1px solid var(--border); }
.price-list small { flex-basis: 100%; }
.legal-text h2 { margin: 1.5rem 0 .5rem; font-size: 1.2rem; color: var(--text); }
.legal-text h2:first-child { margin-top: 0; }

/* --------------------------------------------------------------------------
   Página de error
   -------------------------------------------------------------------------- */
.error-page { display: grid; place-items: center; min-height: 100vh; padding: 2rem; background: var(--bg-soft); }
.error-box { text-align: center; max-width: 460px; }
.error-box img { margin-bottom: 1rem; }
.error-code { margin: 0; font-size: .9rem; font-weight: 700; letter-spacing: .1em; color: var(--brand); }
.error-actions { display: flex; justify-content: center; gap: .6rem; margin-top: 1.5rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .hero-grid, .detail-grid, .help-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; max-width: 520px; margin: 0 auto; }
  .detail-aside, .help-aside { position: static; }
  .category-grid, .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .money-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(15, 17, 21, .4); }
  .app-main { margin-left: 0; }
  .topbar { padding: 0 1rem; }
  .topbar-menu { display: inline-flex; }
  .app-content { padding: 1.25rem 1rem 2.5rem; }

  .ai-app { grid-template-columns: minmax(0, 1fr); position: relative; }
  .ai-sidebar { position: absolute; inset: 0 auto 0 0; width: 280px; z-index: 20; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .ai-app.sidebar-visible .ai-sidebar { transform: none; }
  .ai-history-toggle { display: inline-flex; }
}

@media (max-width: 760px) {
  .site-nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: .15rem;
    padding: .75rem 1.25rem 1.25rem; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav-auth { margin: .5rem 0 0; flex-direction: column; }
  .site-header-actions { margin-left: auto; }

  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-logo-mobile { display: inline-flex; }
  .auth-main { padding: 1.25rem 1.25rem 2.5rem; }

  .hero { padding: 2.5rem 0; }
  .section { padding: 3rem 0; }
  .category-grid, .service-grid, .steps, .stat-grid, .stat-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-row, .form-row-4, .form-grid-2, .form-grid-3, .quote-respond { grid-template-columns: minmax(0, 1fr); }
  .delivery-box { flex-wrap: wrap; }
  .bar-row { grid-template-columns: 90px 1fr 36px; }
  .filter-bar > .input, .filter-bar > .select, .filter-bar .form-group { flex-basis: 100%; }
  .transcript-msg { max-width: 100%; }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 1.75rem; }
  .section-head-row { flex-direction: column; align-items: flex-start; }
  .site-footer-grid { grid-template-columns: minmax(0, 1fr); }

  .progress-steps { grid-template-columns: repeat(3, 1fr); row-gap: 1rem; }
  .progress-step:nth-child(4)::before { display: none; }
  .user-chip-name { display: none; }
  .file-row { flex-wrap: wrap; }
  .file-actions { width: 100%; justify-content: flex-end; }
  .payment-item { flex-direction: column; }
  .payment-actions { width: 100%; align-items: stretch; }
  .chat-msg { max-width: 90%; }
  .ai-suggestions { grid-template-columns: minmax(0, 1fr); }
  .ai-bubble { max-width: 90%; }
  .theme-picker { grid-template-columns: minmax(0, 1fr); }
  .toolbar .select { width: 100%; }
  .pagination .btn { padding: 0 .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
