/* ==========================================================================
   LeadBoxPulse · Hoja de estilos (aplicación, autenticación y web pública)
   Sin frameworks. Tipografía Inter autoalojada (sin peticiones a terceros).
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-950: #08132a;
  --navy-900: #0c1b38;
  --navy-800: #13264a;
  --navy-700: #1d3360;
  --blue-600: #2f6bff;
  --blue-700: #1d55e6;
  --blue-500: #4d82ff;
  --blue-100: #dfe8ff;
  --blue-50: #eef3ff;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --border-strong: #cfd7e3;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --success: #0f9d58;
  --success-bg: #e7f6ee;
  --danger: #dc3a40;
  --danger-bg: #fdecec;
  --warning: #c27803;
  --warning-bg: #fff4dd;
  --violet: #7c5cff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 12px 40px rgba(8, 19, 42, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 252px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

*, *::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.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 .75em; }
small { font-size: .82rem; }
:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.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; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip-link:focus { left: 8px; }

/* Utilidades */
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.small { font-size: .85rem; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.center { justify-content: center; }
.pad { padding: 12px 20px; }

/* Iconos */
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; }
.icon-xs { width: 14px; height: 14px; }
.icon-xl { width: 40px; height: 40px; stroke-width: 1.4; }

/* --------------------------------------------------------------- Marca */
.brand { display: inline-flex; align-items: center; line-height: 0; flex: none; }
.brand:hover { text-decoration: none; opacity: .92; }
.brand img { height: auto; }
.brand .logo-full { height: 32px; width: auto; max-width: 100%; }
.brand .logo-icon { display: none; height: 34px; width: 34px; }
.sidebar .brand .logo-full { height: 29px; }
.site-header .brand .logo-full { height: 34px; }
.auth-panel .brand .logo-full { height: 36px; }
.error-page .brand .logo-full { height: 40px; }
.site-footer .brand .logo-full { height: 30px; }

/* --------------------------------------------------------------- Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: none; color: var(--text);
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 1px 2px rgba(47, 107, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--blue-700); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--blue-500); color: var(--blue-700); background: var(--blue-50); }
.btn-text { color: var(--muted); padding: 0 10px; }
.btn-text:hover { color: var(--text); background: rgba(15, 23, 42, .04); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c22f35; color: #fff; }
.btn-danger-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .86rem; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: none; color: inherit; cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: rgba(15, 23, 42, .06); }
.icon-btn-sm { width: 28px; height: 28px; }
.icon-btn-sm .icon { width: 15px; height: 15px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue-600); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-sm { font-size: .85rem; font-weight: 600; }

/* --------------------------------------------------------------- Formularios */
.input {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: .93rem;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #94a3b8; }
.input:hover { border-color: #b7c2d2; }
.input:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(47, 107, 255, .16); }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 58, 64, .1); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
select.input { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.input-sm { min-height: 32px; padding: 4px 10px; font-size: .84rem; }
select.input-sm { padding-right: 28px; background-position: right 6px center; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child { font-size: .84rem; font-weight: 600; color: var(--text-2); }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.label-row { display: flex; justify-content: space-between; gap: 8px; }
.label-row a { font-weight: 500; }
.req { color: var(--danger); font-weight: 600; }
.hint { font-size: .82rem; color: var(--muted); margin: 0; }
.field-error { margin: 0; font-size: .82rem; color: var(--danger); font-weight: 500; }
.check, .radio { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; color: var(--text-2); cursor: pointer; }
.check input, .radio input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--blue-600); flex: none; }
.radio { margin-top: 4px; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field-full { grid-column: 1 / -1; }
.form-section { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.form-section legend { font-weight: 650; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; padding: 0; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-card { padding: 24px; }

/* --------------------------------------------------------------- Tarjetas, badges */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2 .icon { color: var(--blue-600); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: #eef1f6; color: var(--muted); font-size: .74rem; font-weight: 650; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--blue-50); color: var(--blue-700); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-won { background: var(--success-bg); color: var(--success); }
.badge-lost { background: #f1f3f6; color: #6b7280; }
.badge-sm { font-size: .7rem; padding: 2px 7px; }
.badge-lg { font-size: .84rem; padding: 5px 12px; }
.badge-act-new { background: var(--success-bg); color: var(--success); }
.badge-act-update { background: var(--blue-50); color: var(--blue-700); }
.badge-act-skip { background: #f1f3f6; color: #6b7280; }
.badge-act-error { background: var(--danger-bg); color: var(--danger); }
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.pill-muted { background: #f1f4f8; color: var(--text-2); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-warn { background: var(--warning-bg); color: #7a4b00; }
.pill-success { background: var(--success-bg, #e6f6ee); color: var(--success, #127a46); }
.pill-pro { background: linear-gradient(135deg, #ece6ff, #e2ebff); color: #5b3fd6; }

/* --------------------------------------------------------------- Mensajes */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; border-radius: 10px; border: 1px solid; font-size: .92rem; animation: slide-in .25s var(--ease); }
.flash > span { flex: 1; }
.flash-success { background: var(--success-bg); border-color: #bfe6cf; color: #0b6e3e; }
.flash-error { background: var(--danger-bg); border-color: #f5c6c8; color: #a82127; }
.flash-info { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.flash.is-hiding { opacity: 0; transform: translateY(-4px); transition: .25s; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--warning-bg); color: #7a4b00; font-size: .9rem; }
.notice p { margin: 0 0 4px; }
.notice .icon { margin-top: 2px; }
.notice-soft { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); margin-top: 18px; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 28px; background: var(--blue-50); color: var(--navy-800); font-size: .9rem; border-bottom: 1px solid var(--blue-100); }
.banner span { flex: 1; }
.banner-warn { background: var(--warning-bg); color: #7a4b00; border-color: #f3dfb4; }

/* --------------------------------------------------------------- Layout app */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-w);
  display: flex; flex-direction: column; gap: 18px; padding: 18px 14px;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #c6d2ea;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px; }
.sidebar-close { display: none; color: #fff; }
.ws-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); }
.ws-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(77, 130, 255, .22); color: #cddcff; font-weight: 700; font-size: .78rem; flex: none; }
.ws-name { font-weight: 600; font-size: .9rem; color: #eef3ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: #b4c2dd; font-weight: 550; font-size: .93rem; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(47, 107, 255, .2); color: #fff; }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue-500); }
.nav-link.active .icon { color: #8fb0ff; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.trial-box { display: flex; flex-direction: column; padding: 12px; border-radius: 10px; background: linear-gradient(135deg, rgba(47, 107, 255, .28), rgba(124, 92, 255, .2)); color: #fff; font-size: .82rem; }
.trial-box:hover { text-decoration: none; color: #fff; filter: brightness(1.08); }
.trial-box span { color: #c9d6f5; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.user-row form { margin: 0; }
.user-row .icon-btn { color: #9fb0cf; }
.user-row .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.user-meta strong { color: #fff; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: .75rem; color: #8b9bbb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; background: linear-gradient(135deg, #4d82ff, #7c5cff); color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: .02em; }
.avatar-sm { width: 30px; height: 30px; font-size: .7rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.05rem; }
.nav-backdrop { display: none; }

.main-wrap { 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: 14px; height: 64px; padding: 0 28px; background: rgba(244, 246, 250, .85); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.menu-btn, .topbar-brand { display: none; }
.global-search { position: relative; flex: 1; max-width: 520px; }
.global-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.global-search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-size: .9rem; color: var(--text); }
.global-search input:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(47, 107, 255, .14); }
.topbar-new { margin-left: auto; }
.main { padding: 28px; width: 100%; max-width: 1440px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 2px; font-size: .86rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { color: var(--blue-600); text-decoration: none; }

.segmented { display: inline-flex; padding: 3px; background: #e9edf4; border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.segmented a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: .84rem; font-weight: 600; color: var(--text-2); }
.segmented a:hover { text-decoration: none; color: var(--text); }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .icon { width: 16px; height: 16px; }

/* --------------------------------------------------------------- Dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
a.kpi:hover { text-decoration: none; border-color: var(--blue-100); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--text); }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.kpi-label .icon { width: 16px; height: 16px; color: var(--blue-600); }
.kpi-value { font-size: 1.75rem; font-weight: 720; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.kpi-foot { font-size: .8rem; color: var(--muted); }
.kpi-accent { background: linear-gradient(135deg, var(--navy-800), var(--navy-950)); border-color: var(--navy-800); }
.kpi-accent .kpi-label, .kpi-accent .kpi-foot { color: #a9b9da; }
.kpi-accent .kpi-label .icon { color: #8fb0ff; }
.kpi-accent .kpi-value { color: #fff; }
.kpi-alert { border-color: #f6c9cb; background: linear-gradient(180deg, #fff, #fff7f7); }
.kpi-alert .kpi-label .icon { color: var(--danger); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.metric-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; font-size: .8rem; color: var(--muted); }
.metric-note .icon { width: 15px; height: 15px; margin-top: 2px; }
.onboarding { display: grid; gap: 18px; margin-bottom: 18px; background: linear-gradient(135deg, #fff, var(--blue-50)); }
.onboarding-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
.step-card:hover { text-decoration: none; border-color: var(--blue-500); color: var(--text); box-shadow: var(--shadow); }
.step-card .icon { color: var(--blue-600); margin-bottom: 6px; width: 22px; height: 22px; }
.step-card span { font-size: .85rem; color: var(--muted); }
.empty-inline { color: var(--muted); font-size: .9rem; margin: 6px 0; }

.action-list, .feed, .bar-list, .task-list, .error-list { list-style: none; margin: 0; padding: 0; }
.action-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f6; font-size: .9rem; }
.action-list li:last-child { border-bottom: 0; }
.action-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--blue-50); color: var(--blue-600); flex: none; }
.action-ico .icon { width: 16px; height: 16px; }
.action-list li.is-overdue .action-ico { background: var(--danger-bg); color: var(--danger); }
.action-body { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-body > a { color: var(--text); font-weight: 600; }

.bar-row { display: grid; grid-template-columns: minmax(110px, 1.1fr) 2fr 34px minmax(70px, auto); align-items: center; gap: 12px; padding: 7px 0; color: var(--text); font-size: .88rem; }
.bar-row:hover { text-decoration: none; color: var(--blue-700); }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.bar-track { height: 8px; border-radius: 99px; background: #edf0f5; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--blue-500), var(--blue-600)); transition: width .7s var(--ease); }
.bar-won { background: linear-gradient(90deg, #34c27c, var(--success)); }
.bar-lost { background: #b6bfcc; }
.bar-num { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.bar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f6; font-size: .88rem; }
.feed li:last-child { border-bottom: 0; }
.feed p { margin: 0; }
.feed-body { color: var(--text-2); overflow-wrap: anywhere; }
.feed time { font-size: .78rem; }
.feed-ico, .tl-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; background: #eef1f6; color: var(--muted); }
.feed-ico .icon, .tl-ico .icon { width: 15px; height: 15px; }
.feed-call { background: #e5f6ec; color: var(--success); }
.feed-email { background: var(--blue-50); color: var(--blue-600); }
.feed-meeting { background: #efeaff; color: var(--violet); }
.feed-note { background: var(--warning-bg); color: var(--warning); }
.feed-stage_change { background: #e8eefb; color: var(--navy-700); }
.feed-task_completed { background: #e5f6ec; color: var(--success); }

/* --------------------------------------------------------------- Tablas */
.table-card { padding: 0; overflow: hidden; }
.table-card .card-head { padding: 16px 20px 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th a { color: inherit; }
.table th a:hover { color: var(--blue-600); text-decoration: none; }
.table td { padding: 12px 16px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbfd; }
.table-compact td, .table-compact th { padding: 9px 12px; }
.row-title { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.row-title:hover { color: var(--blue-700); text-decoration: none; }
.row-title small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.row-error { background: #fffafa; }
.map-table td { vertical-align: middle; }
.map-table select { min-width: 200px; }

.pagination { display: flex; justify-content: center; gap: 6px; margin: 20px 0 0; flex-wrap: wrap; }
.page-link { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .88rem; }
.page-link:hover { text-decoration: none; border-color: var(--blue-500); color: var(--blue-700); }
.page-link.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.page-gap { display: grid; place-items: center; color: var(--muted); }

/* --------------------------------------------------------------- Filtros */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin-bottom: 18px; padding: 14px; }
.filter-search { position: relative; flex: 1 1 280px; }
.filter-search .icon { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.filter-search .input { padding-left: 38px; }
.filter-more { flex: 0 0 auto; }
.filter-more[open] { flex-basis: 100%; order: 3; }
.filter-more summary { list-style: none; }
.filter-more summary::-webkit-details-marker { display: none; }
.filter-more[open] summary { margin-bottom: 14px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.filter-actions { display: flex; gap: 6px; }
.count-dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 99px; background: var(--blue-600); color: #fff; font-size: .72rem; }
.task-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.task-filters select { width: auto; min-width: 190px; }
.mini-search { position: relative; }
.mini-search .icon { position: absolute; left: 10px; top: 11px; color: var(--muted); width: 16px; height: 16px; }
.mini-search .input { padding-left: 34px; width: 220px; }

/* --------------------------------------------------------------- Estados vacíos */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 24px; }
.empty-state .icon-xl { color: var(--blue-500); background: var(--blue-50); border-radius: 16px; padding: 10px; width: 60px; height: 60px; }
.empty-state.small { padding: 28px; }
.empty-state h2 { font-size: 1.15rem; }
.empty-state p { margin: 0; }

/* --------------------------------------------------------------- Lead */
.lead-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lead-title p { margin: 2px 0 0; }
.lead-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.lead-side, .lead-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-pair > div { display: flex; flex-direction: column; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.stat-pair span { font-size: .78rem; }
.big { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stage-form { display: flex; flex-direction: column; gap: 10px; }
.stage-form .btn { align-self: flex-start; }
.lost-reason { display: flex; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #f4f5f7; font-size: .86rem; color: var(--text-2); }
.details { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; margin: 0; font-size: .9rem; }
.details dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; }
.details dt .icon { width: 15px; height: 15px; }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; text-align: right; }
.notes { white-space: normal; overflow-wrap: anywhere; color: var(--text-2); font-size: .92rem; margin: 0; }
[data-lost-field][hidden] { display: none; }

.task-list .task { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eef1f6; }
.task-list .task:last-child { border-bottom: 0; }
.task-check { margin: 0; }
.check-btn { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; padding: 0; color: #9aa6b8; cursor: pointer; border-radius: 50%; transition: color .15s, background .15s; }
.check-btn:hover { color: var(--success); background: var(--success-bg); }
.check-btn .icon { width: 22px; height: 22px; }
.task.is-done .check-btn { color: var(--success); }
.task-body { flex: 1; min-width: 0; }
.task-title { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.task.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 3px; font-size: .82rem; color: var(--muted); }
.task-meta .due, .task-lead { display: inline-flex; align-items: center; gap: 5px; }
.task-lead { color: var(--text-2); }
.task.is-overdue { background: linear-gradient(90deg, rgba(220, 58, 64, .06), transparent 60%); margin: 0 -20px; padding-left: 20px; padding-right: 20px; box-shadow: inset 3px 0 0 var(--danger); }
.task-desc { margin: 6px 0 0; font-size: .85rem; color: var(--text-2); }
.prio { padding: 1px 8px; border-radius: 99px; font-size: .72rem; font-weight: 650; }
.prio-high { background: var(--danger-bg); color: var(--danger); }
.prio-normal { background: #eef1f6; color: var(--text-2); }
.prio-low { background: #f4f6f9; color: var(--muted); }
.add-task, .done-tasks { margin-top: 12px; }
.add-task > summary, .done-tasks > summary, .new-task > summary { list-style: none; cursor: pointer; display: inline-flex; }
.add-task > summary::-webkit-details-marker, .done-tasks > summary::-webkit-details-marker, .new-task > summary::-webkit-details-marker { display: none; }
.add-task[open] > summary { margin-bottom: 14px; }
.done-tasks > summary { color: var(--blue-600); }
.task-form { padding-top: 4px; }
.task-form .form-actions { margin-top: 14px; }
.new-task { margin-bottom: 18px; padding: 14px 20px; }
.new-task[open] { padding-bottom: 20px; }
.new-task[open] > summary { margin-bottom: 16px; }

.log-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; margin-bottom: 18px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; }
.type-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--surface); font-size: .85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: .15s; }
.type-opt span .icon { width: 15px; height: 15px; }
.type-opt input:checked + span { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-700); }
.type-opt input:focus-visible + span { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.log-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 2px; background: #edf0f5; }
.tl-item { position: relative; display: flex; gap: 14px; padding: 8px 0 14px; }
.tl-ico { position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--surface); }
.tl-body { flex: 1; min-width: 0; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .88rem; }
.tl-head time { font-size: .8rem; }
.tl-del { margin: 0 0 0 auto; }
.tl-text { margin: 4px 0 0; font-size: .9rem; color: var(--text-2); overflow-wrap: anywhere; }
.tl-system .tl-text { color: var(--muted); }
.tl-user { margin: 2px 0 0; font-size: .78rem; }
.origin { padding: 1px 7px; border-radius: 6px; font-size: .7rem; font-weight: 650; letter-spacing: .01em; }
.origin-manual { background: var(--blue-50); color: var(--blue-700); }
.origin-system { background: #f1f3f6; color: var(--muted); }
.origin-integration { background: #efeaff; color: var(--violet); }

/* --------------------------------------------------------------- Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(255px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: start; scroll-snap-type: x proximity; }
.kcol { display: flex; flex-direction: column; min-height: 220px; max-height: calc(100vh - 210px); background: #eceff5; border-radius: var(--radius); scroll-snap-align: start; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px 10px; }
.kcol-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kcol-title h2 { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kdot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); flex: none; }
.kcol-won .kdot { background: var(--success); }
.kcol-lost .kdot { background: #9aa4b2; }
.kcol-sum { font-size: .8rem; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kcol-body { flex: 1; overflow-y: auto; padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 10px; border-radius: 0 0 var(--radius) var(--radius); transition: background .15s; }
.kcol-body.is-over { background: rgba(47, 107, 255, .09); box-shadow: inset 0 0 0 2px rgba(47, 107, 255, .35); }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: var(--shadow-sm); cursor: grab; transition: box-shadow .15s, transform .15s, opacity .15s; }
.kcard:hover { box-shadow: var(--shadow); border-color: #d5ddea; }
.kcard.is-dragging { opacity: .5; transform: rotate(1.5deg); }
.kcard.is-saving { opacity: .6; pointer-events: none; }
.kcard-link { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.kcard-link:hover { text-decoration: none; color: var(--blue-700); }
.kcard-name { font-size: .92rem; overflow-wrap: anywhere; }
.kcard-company { display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--muted); }
.kcard-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.kcard-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kcard-row .badge { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 62%; }
.kcard-task { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed var(--border); font-size: .8rem; color: var(--text-2); }
.kcard-task span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard-task em { font-style: normal; color: var(--muted); white-space: nowrap; }
.kcard-alert { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: .78rem; font-weight: 600; color: var(--danger); }
.kcard-move { margin: 10px 0 0; }
.kcol-lost .kcard { opacity: .82; }
.kcol-add { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--muted); font-size: .84rem; font-weight: 600; }
.kcol-add:hover { text-decoration: none; color: var(--blue-700); border-color: var(--blue-500); background: rgba(255, 255, 255, .6); }
.list-stage { margin-bottom: 18px; }
.inline-move { margin: 0; }
.inline-move select { min-width: 170px; }
@media (hover: hover) and (pointer: fine) { .kcard-move { display: none; } }

/* Modal */
.modal { border: 0; padding: 0; border-radius: 14px; box-shadow: var(--shadow-lg); width: min(440px, calc(100vw - 32px)); color: var(--text); }
.modal::backdrop { background: rgba(8, 19, 42, .45); backdrop-filter: blur(2px); }
.modal-body { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.modal-body p { margin: 0; }

/* --------------------------------------------------------------- Tareas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--blue-700); border-bottom-color: var(--blue-600); }
.tab.active .count { background: var(--blue-50); color: var(--blue-700); }
.tab-alert .count { background: var(--danger-bg); color: var(--danger); }

/* --------------------------------------------------------------- Import / export */
.io-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.steps-mini { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; flex-wrap: wrap; }
.steps-mini li { counter-increment: s; display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 4px 10px 4px 4px; border-radius: 99px; background: #eef1f6; }
.steps-mini li::before { content: counter(s); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; font-size: .72rem; }
.steps-mini li.active { background: var(--blue-50); color: var(--blue-700); }
.steps-mini li.active::before { background: var(--blue-600); color: #fff; }
.steps-mini li.done { color: var(--success); background: var(--success-bg); }
.steps-mini li.done::before { content: "✓"; background: var(--success); color: #fff; }
.dropfile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed var(--border-strong); border-radius: 12px; text-align: center; cursor: pointer; background: var(--surface-2); transition: .15s; }
.dropfile:hover, .dropfile.is-over { border-color: var(--blue-600); background: var(--blue-50); }
.dropfile .icon-xl { color: var(--blue-600); }
.dropfile span { font-size: .82rem; }
.dropfile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.error-list li { padding: 8px 0; border-bottom: 1px solid #eef1f6; font-size: .88rem; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; margin-top: 18px; background: linear-gradient(transparent, var(--bg) 30%); }
.sticky-actions form { margin: 0; }

/* --------------------------------------------------------------- Configuración */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.settings-nav a { padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: .9rem; }
.settings-nav a:hover { background: #e9edf4; text-decoration: none; color: var(--text); }
.settings-nav a.active { background: var(--surface); color: var(--blue-700); box-shadow: var(--shadow-sm); }
.settings-body { display: flex; flex-direction: column; gap: 18px; max-width: 860px; min-width: 0; }
.plan-current { display: flex; gap: 32px; flex-wrap: wrap; }
.plan-current > div { display: flex; flex-direction: column; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.plan-card h3 { margin-bottom: 4px; }
.plan-card.is-current { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.price strong { font-size: 1.5rem; letter-spacing: -.02em; }
.plan-buy { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.plan-buy .btn { width: 100%; justify-content: center; }
.form-actions.form-actions-start { justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.notice-top { margin: 0 0 18px; }
.plan-current + .notice, .plan-current ~ .notice { margin-top: 18px; }
.check-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; gap: 10px; font-size: .9rem; }
.check-list .icon { color: var(--success); margin-top: 2px; width: 17px; height: 17px; }
.danger-zone { border-color: #f3c7c9; }
.danger-zone h2 { color: var(--danger); }

/* --------------------------------------------------------------- Auth */
.auth-body { background: var(--surface); }
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-panel { display: flex; flex-direction: column; padding: 32px clamp(20px, 6vw, 72px); }
.auth-card { width: 100%; max-width: 410px; margin: auto; padding: 32px 0; }
.auth-title { font-size: 1.7rem; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin-bottom: 24px; }
.auth-legal { text-align: center; font-size: .8rem; color: var(--muted); margin: 0; }
.auth-legal a { color: var(--muted); }
.auth-aside { position: relative; display: flex; align-items: center; padding: 56px; color: #fff; overflow: hidden; background: radial-gradient(1000px 500px at 100% 0%, rgba(47, 107, 255, .55), transparent 60%), radial-gradient(800px 500px at 0% 100%, rgba(124, 92, 255, .35), transparent 60%), var(--navy-950); }
.auth-aside h2 { color: #fff; font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.15; margin: 10px 0 26px; letter-spacing: -.03em; }
.auth-aside-inner { max-width: 470px; }
.auth-aside .check-list li { font-size: 1rem; color: #d3ddf3; }
.auth-aside .check-list .icon { color: #7ee2a8; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 700; color: var(--blue-600); margin: 0; }
.auth-aside .eyebrow { color: #8fb0ff; }
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 24px; }
.error-page .brand { margin-bottom: 24px; }
.error-code { font-size: 4.5rem; font-weight: 800; letter-spacing: -.05em; margin: 0; background: linear-gradient(135deg, var(--blue-600), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.error-page p.muted { max-width: 460px; }

/* --------------------------------------------------------------- Administración */
.seg { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 650; white-space: nowrap; background: #f1f3f6; color: var(--text-2); }
.seg-trial { background: var(--blue-50); color: var(--blue-700); }
.seg-gift { background: #efeaff; color: #5b3fd6; }
.seg-paid { background: var(--success-bg); color: var(--success); }
.seg-trial_expired, .seg-expired { background: var(--warning-bg); color: #8a5300; }
.seg-admin { background: var(--navy-800); color: #fff; }
.admin-select { width: auto; min-width: 180px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 8px 0 4px; border-bottom: 1px solid var(--border); }
.spark-bar { flex: 1; min-height: 2px; height: 0; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--blue-500), var(--blue-600)); transition: height .6s var(--ease); }
.spark-bar:hover { background: var(--navy-700); }
.spark-axis { display: flex; justify-content: space-between; margin-top: 6px; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.admin-actions form { margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.input-group { display: flex; align-items: center; }
.input-group .input { width: 90px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-suffix { display: grid; place-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--muted); font-size: .88rem; }
.text-warn { color: var(--warning); }
.icon-line { display: flex; align-items: center; gap: 6px; }
.card-head form { margin: 0; }
.system-card td { vertical-align: top; }
.sys-ico { width: 44px; }
[data-until][hidden] { display: none; }

/* --------------------------------------------------------------- Responsive app */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-grid { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .dash-grid, .io-grid { grid-template-columns: 1fr; }
  .lead-grid { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(8, 19, 42, .45); }
  .sidebar-close { display: inline-grid; }
  .main-wrap { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-brand { display: inline-flex; }
  .topbar-brand .logo-full { display: none; }
  .topbar-brand .logo-icon { display: block; }
  .topbar-new span { display: none; }
  .topbar-new { padding: 0 10px; }
  .main { padding: 18px 14px 40px; }
  .banner { padding: 10px 14px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .onboarding-steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .kpi-grid, .kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 1.35rem; }
  .form-grid { grid-template-columns: 1fr; }
  .log-row { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .form-card { padding: 18px; }
  .card { padding: 16px; }
  .bar-row { grid-template-columns: minmax(90px, 1fr) 1.2fr 26px; }
  .bar-val { display: none; }
  .page-head .segmented { width: 100%; }
  .mini-search, .mini-search .input { width: 100%; }
  .head-actions { width: 100%; }
  .kanban { grid-auto-columns: 86%; }
  .task.is-overdue { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  /* Tablas como tarjetas en móvil */
  .table-responsive thead { display: none; }
  .table-responsive tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table-responsive td { display: block; padding: 4px 0; border: 0; text-align: right; overflow: hidden; }
  .table-responsive td::before { content: attr(data-label); float: left; margin-right: 12px; font-size: .76rem; font-weight: 600; color: var(--muted); text-align: left; line-height: 1.9; }
  .table-responsive td:first-child { text-align: left; padding-bottom: 8px; }
  .table-responsive td:first-child::before { display: none; }
  .table-responsive td.num { text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.details + .hint { margin-top: 14px; }
