/* ============================================================================
   FACTORA by Millora — Stylesheet principal
   Estilo: dark premium, DM Sans + JetBrains Mono, brand ámbar dorado
============================================================================ */

:root {
    --bg-deep: #06090f;
    --bg-nav: rgba(6, 9, 15, .78);
    --bg-footer: #04060c;
    --bg-card: #111827;
    --bg-card-hover: #161f2e;
    --bg-input: #0a0e17;

    --ink: #e8eaed;
    --ink-soft: #9ca3af;
    --ink-muted: #6b7280;

    --brand: #f59e0b;
    --brand-hover: #fbbf24;
    --brand-glow: rgba(245, 158, 11, .25);
    --brand-glow-strong: rgba(245, 158, 11, .4);

    --accent: #06b6d4;
    --accent-hover: #22d3ee;
    --accent-glow: rgba(6, 182, 212, .2);

    --success: #22c55e;
    --warning: #eab308;
    --error: #ef4444;
    --info: #06b6d4;

    --border: rgba(255, 255, 255, .07);
    --border-hover: rgba(255, 255, 255, .14);
    --border-strong: rgba(255, 255, 255, .22);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --font: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
    --shadow: 0 8px 32px rgba(0, 0, 0, .4);
    --shadow-glow: 0 0 32px var(--brand-glow);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    min-height: 100vh;
}

body { display: flex; flex-direction: column; overflow-x: hidden; }

a { color: var(--brand); text-decoration: none; transition: color .2s; }
a:hover { color: var(--brand-hover); }

img { max-width: 100%; height: auto; display: block; }

code, pre, .mono { font-family: var(--mono); font-size: .9em; }

h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ============================================================================
   NAVBAR
============================================================================ */
.site-header {
    position: sticky; top: 0; left: 0; width: 100%; height: 64px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-nav); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000; transition: background .3s, box-shadow .3s;
}
.site-header.scrolled { background: rgba(6, 9, 15, .96); box-shadow: 0 4px 30px rgba(0, 0, 0, .4); }

.header-inner {
    width: 100%; max-width: 1120px; padding: 0 24px;
    display: flex; justify-content: space-between; align-items: center;
}

.brand-group { display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand-logo { height: 40px; width: auto; }
.brand-sep { width: 1px; height: 28px; background: var(--border-hover); }
.brand-by {
    display: flex; align-items: center; gap: 8px; text-decoration: none;
    font-size: .78rem; color: var(--ink-muted); transition: color .2s;
}
.brand-by:hover { color: var(--ink-soft); }
.brand-by img { height: 22px; opacity: .8; transition: opacity .2s; }
.brand-by:hover img { opacity: 1; }

nav.site-nav { display: flex; align-items: center; gap: 4px; }
nav.site-nav a {
    padding: 8px 14px; font-size: .86rem; font-weight: 500; color: var(--ink-muted);
    text-decoration: none; border-radius: var(--radius-sm); transition: all .2s;
}
nav.site-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
nav.site-nav a.active { color: var(--brand); }
nav.site-nav .nav-sep { width: 1px; height: 18px; background: var(--border); margin: 0 6px; padding: 0; }
nav.site-nav a.btn-nav-primary {
    background: var(--brand); color: #1a1208; padding: 8px 18px; font-weight: 600;
    box-shadow: 0 2px 12px var(--brand-glow);
}
nav.site-nav a.btn-nav-primary:hover { background: var(--brand-hover); transform: translateY(-1px); }

/* ============================================================================
   MAIN + FOOTER
============================================================================ */
main { flex: 1; }
main.padded { padding: 48px 0 64px; }

.site-footer {
    background: var(--bg-footer); border-top: 1px solid var(--border);
    padding: 64px 0 36px; margin-top: 80px;
}
.footer-grid {
    display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px;
    margin-bottom: 40px;
}
.footer-brand-block { max-width: 320px; }
.footer-logos { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.footer-logos img { height: 36px; width: auto; }
.footer-logos .x { color: var(--ink-muted); font-size: 1.1rem; }
.footer-brand-block p {
    color: var(--ink-muted); font-size: .86rem; line-height: 1.65;
}
.footer-partner {
    margin-top: 16px; padding: 12px 16px; border-radius: var(--radius);
    background: rgba(245, 158, 11, .05);
    border: 1px solid rgba(245, 158, 11, .15);
    font-size: .78rem; color: var(--ink-soft); line-height: 1.55;
}
.footer-partner strong { color: var(--brand); }
.footer-col h4 {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--ink-soft); margin-bottom: 16px; font-weight: 600;
}
.footer-col a {
    display: block; color: var(--ink-muted); text-decoration: none;
    font-size: .86rem; padding: 5px 0; transition: color .2s;
}
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
    padding-top: 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px;
    font-size: .78rem; color: var(--ink-muted);
}
.footer-bottom a { color: var(--brand); }

/* ============================================================================
   BUTTONS
============================================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 11px 22px; border-radius: var(--radius);
    font-family: var(--font); font-size: .92rem; font-weight: 600;
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
    transition: all .2s; white-space: nowrap;
}
.btn-primary {
    background: var(--brand); color: #1a1208;
    box-shadow: 0 2px 16px var(--brand-glow);
}
.btn-primary:hover {
    background: var(--brand-hover); color: #1a1208;
    transform: translateY(-1px); box-shadow: 0 8px 28px var(--brand-glow-strong);
}
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-hover); }
.btn-ghost:hover { background: rgba(255, 255, 255, .04); border-color: var(--border-strong); }
.btn-danger {
    background: rgba(239, 68, 68, .1); color: #fca5a5; border-color: rgba(239, 68, 68, .3);
}
.btn-danger:hover { background: rgba(239, 68, 68, .2); border-color: var(--error); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 30px; font-size: 1rem; }
.btn-xl { padding: 16px 36px; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ============================================================================
   HERO (landing)
============================================================================ */
.hero {
    text-align: center; padding: 96px 0 80px; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -200px; left: 50%;
    transform: translateX(-50%); width: 1000px; height: 1000px;
    background: radial-gradient(circle, var(--brand-glow) 0%, transparent 55%);
    opacity: .4; pointer-events: none; z-index: 0;
}
.hero::after {
    content: ''; position: absolute; bottom: -200px; right: -100px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    opacity: .25; pointer-events: none; z-index: 0;
}
.hero-content { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; }

.hero-brand {
    display: flex; align-items: center; justify-content: center;
    gap: 28px; margin-bottom: 40px; flex-wrap: wrap;
}
.hero-brand-main img {
    height: 88px; width: auto;
    filter: drop-shadow(0 4px 24px var(--brand-glow));
}
.hero-brand-divider {
    width: 1px; height: 56px; background: linear-gradient(
        to bottom, transparent, var(--border-hover), transparent
    );
}
.hero-brand-by {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    text-decoration: none;
}
.hero-brand-by span {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .18em;
    color: var(--ink-muted); font-weight: 500;
}
.hero-brand-by img {
    height: 34px; width: auto; opacity: .9; transition: opacity .2s;
}
.hero-brand-by:hover img { opacity: 1; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 16px; background: var(--bg-card); border: 1px solid var(--border-hover);
    border-radius: 999px; font-size: .82rem; color: var(--ink-soft); margin-bottom: 28px;
}
.hero-badge .pulse {
    width: 8px; height: 8px; background: var(--success); border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); }
    50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}
.hero h1 {
    font-size: 3.8rem; font-weight: 800; line-height: 1.05; margin-bottom: 22px;
    letter-spacing: -.025em;
}
.hero h1 .grad {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 50%, #fde68a 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .lead {
    font-size: 1.2rem; color: var(--ink-soft); max-width: 620px;
    margin: 0 auto 36px; line-height: 1.6;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }

.hero-stats {
    display: flex; justify-content: center; gap: 64px; margin-top: 24px;
    flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-value {
    font-family: var(--mono); font-size: 2.2rem; font-weight: 700;
    color: var(--brand); line-height: 1;
}
.hero-stat-label {
    color: var(--ink-muted); font-size: .78rem; text-transform: uppercase;
    letter-spacing: .08em; margin-top: 6px;
}

/* ============================================================================
   SECTIONS (landing)
============================================================================ */
.section { padding: 88px 0; position: relative; }
.section-alt { background: rgba(255, 255, 255, .015); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-header { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section-badge {
    display: inline-block; padding: 5px 14px; background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .25); border-radius: 999px;
    font-size: .72rem; color: var(--brand); font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px;
}
.section-header h2 {
    font-size: 2.4rem; font-weight: 800; margin-bottom: 14px;
    letter-spacing: -.02em;
}
.section-header p { font-size: 1.08rem; color: var(--ink-soft); }

/* ============================================================================
   FEATURES
============================================================================ */
.features {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.feature {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px 28px; transition: all .25s;
    position: relative; overflow: hidden;
}
.feature:hover {
    border-color: var(--border-strong); transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.feature-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 14px;
    background: rgba(245, 158, 11, .1); color: var(--brand);
    font-size: 1.7rem; margin-bottom: 18px;
}
.feature h3 { font-size: 1.15rem; margin-bottom: 10px; color: var(--ink); }
.feature p { color: var(--ink-soft); font-size: .92rem; line-height: 1.65; }

/* ============================================================================
   STEPS (cómo funciona)
============================================================================ */
.steps {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
    position: relative;
}
.step {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 36px 28px; position: relative;
}
.step-number {
    position: absolute; top: -20px; left: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--brand); color: #1a1208;
    font-family: var(--mono); font-size: 1.2rem; font-weight: 700;
    box-shadow: 0 4px 16px var(--brand-glow);
}
.step h3 { margin-top: 16px; margin-bottom: 10px; font-size: 1.15rem; }
.step p { color: var(--ink-soft); font-size: .92rem; line-height: 1.65; }
.step code { color: var(--brand); }

/* ============================================================================
   PRICING
============================================================================ */
.pricing {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
    max-width: 800px; margin: 0 auto;
}
.pricing-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 40px 32px; position: relative;
    transition: all .25s;
}
.pricing-card.featured {
    border-color: var(--brand); background: linear-gradient(135deg, var(--bg-card), rgba(245, 158, 11, .04));
    box-shadow: 0 0 48px var(--brand-glow);
}
.pricing-card.featured::before {
    content: 'Recomendado'; position: absolute; top: -12px; left: 50%;
    transform: translateX(-50%); background: var(--brand); color: #1a1208;
    padding: 5px 16px; border-radius: 999px;
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.pricing-name {
    color: var(--ink-soft); font-size: .82rem; text-transform: uppercase;
    letter-spacing: .08em; font-weight: 600; margin-bottom: 12px;
}
.pricing-price {
    font-family: var(--mono); font-size: 3rem; font-weight: 700; color: var(--ink);
    line-height: 1; margin-bottom: 6px;
}
.pricing-price .currency { font-size: 1.5rem; color: var(--ink-muted); }
.pricing-price .period { font-size: .9rem; color: var(--ink-muted); font-family: var(--font); font-weight: 400; }
.pricing-desc {
    color: var(--ink-muted); font-size: .88rem; margin-bottom: 24px;
    padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.pricing-features { list-style: none; padding: 0; margin: 0 0 28px 0; }
.pricing-features li {
    padding: 8px 0; padding-left: 28px; position: relative;
    color: var(--ink-soft); font-size: .92rem;
}
.pricing-features li::before {
    content: '✓'; position: absolute; left: 0; top: 8px;
    color: var(--success); font-weight: 700;
}

/* ============================================================================
   CTA BANNER (cierre de landing)
============================================================================ */
.cta-banner {
    text-align: center; padding: 80px 40px;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 158, 11, .08) 100%);
    border: 1px solid var(--border-hover); border-radius: 24px;
    position: relative; overflow: hidden;
}
.cta-banner::before {
    content: ''; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); width: 600px; height: 600px;
    background: radial-gradient(circle, var(--brand-glow) 0%, transparent 55%);
    opacity: .5; pointer-events: none;
}
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner h2 { font-size: 2.4rem; margin-bottom: 14px; letter-spacing: -.02em; }
.cta-banner p { font-size: 1.1rem; color: var(--ink-soft); margin-bottom: 28px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ============================================================================
   AUTH CARD
============================================================================ */
.auth-wrapper {
    min-height: calc(100vh - 64px - 200px);
    display: flex; align-items: center; justify-content: center;
    padding: 48px 16px;
}
.auth-card {
    width: 100%; max-width: 420px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 44px; box-shadow: var(--shadow);
}
.auth-card h2 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-card .muted { margin-bottom: 28px; color: var(--ink-soft); font-size: .92rem; }

.auth-brand {
    display: flex; align-items: center; justify-content: center;
    gap: 18px; margin-bottom: 32px; padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.auth-brand > img {
    height: 52px; width: auto;
    filter: drop-shadow(0 2px 12px var(--brand-glow));
}
.auth-brand-by {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    text-decoration: none;
}
.auth-brand-by span {
    font-size: .62rem; text-transform: uppercase; letter-spacing: .16em;
    color: var(--ink-muted); font-weight: 500;
}
.auth-brand-by img {
    height: 20px; width: auto; opacity: .85; transition: opacity .2s;
}
.auth-brand-by:hover img { opacity: 1; }
.auth-card label {
    display: block; margin-bottom: 18px;
    color: var(--ink-soft); font-size: .82rem; font-weight: 500;
}
.auth-card input {
    display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
    background: var(--bg-input); border: 1px solid var(--border-hover);
    border-radius: var(--radius); color: var(--ink);
    font-family: var(--font); font-size: .95rem; transition: all .15s;
}
.auth-card input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* ============================================================================
   FLASH MESSAGES
============================================================================ */
.flash {
    padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px;
    border: 1px solid; font-size: .92rem; display: flex; align-items: center; gap: 10px;
}
.flash-error   { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .3); color: #fca5a5; }
.flash-success { background: rgba(34, 197, 94, .08); border-color: rgba(34, 197, 94, .3); color: #86efac; }
.flash-info    { background: rgba(6, 182, 212, .08); border-color: rgba(6, 182, 212, .3); color: #67e8f9; }
.flash-warning { background: rgba(234, 179, 8, .08); border-color: rgba(234, 179, 8, .3); color: #fde047; }

/* ============================================================================
   PAGE HEADER
============================================================================ */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 2rem; margin-bottom: 6px; letter-spacing: -.01em; }
.page-header .muted { color: var(--ink-soft); font-size: .96rem; }
.page-header-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; flex-wrap: wrap;
}
.page-header-actions { display: flex; gap: 12px; }
.back-link {
    display: inline-block; color: var(--ink-muted); font-size: .85rem;
    margin-bottom: 12px; text-decoration: none;
}
.back-link:hover { color: var(--brand); }

/* ============================================================================
   METRICS GRID (dashboard)
============================================================================ */
.metrics {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px;
}
.metric {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 22px 24px;
    display: flex; flex-direction: column; transition: all .25s;
}
.metric:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.metric-label {
    color: var(--ink-muted); font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
}
.metric-value {
    font-family: var(--mono); font-size: 2.2rem; font-weight: 600;
    color: var(--ink); margin-top: 8px; line-height: 1;
}
.metric-suffix { color: var(--ink-muted); font-size: .76rem; margin-top: 6px; }
.metric-highlight {
    border-color: rgba(245, 158, 11, .35);
    background: linear-gradient(135deg, var(--bg-card), rgba(245, 158, 11, .06));
}
.metric-highlight .metric-value { color: var(--brand); }

/* ============================================================================
   PANELS
============================================================================ */
.panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px; margin-bottom: 24px;
}
.panel-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.panel-header h2 { font-size: 1.15rem; font-weight: 600; }
.panel-info { border-color: rgba(6, 182, 212, .25); background: linear-gradient(135deg, var(--bg-card), rgba(6, 182, 212, .04)); }
.panel-danger { border-color: rgba(239, 68, 68, .25); }

/* ============================================================================
   TABLES
============================================================================ */
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th {
    text-align: left; padding: 12px 14px; color: var(--ink-muted);
    font-weight: 600; font-size: .68rem; text-transform: uppercase;
    letter-spacing: .1em; border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 14px; border-bottom: 1px solid var(--border); color: var(--ink);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.row-clickable { cursor: pointer; transition: background .15s; }
.data-table tr.row-clickable:hover { background: var(--bg-card-hover); }
.data-table code {
    background: var(--bg-input); padding: 3px 8px; border-radius: var(--radius-sm);
    color: var(--brand); font-size: .85rem;
}

/* ============================================================================
   BADGES
============================================================================ */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .68rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; vertical-align: middle;
}
.badge-active     { background: rgba(34, 197, 94, .12); color: #86efac; }
.badge-onboarding { background: rgba(6, 182, 212, .12); color: #67e8f9; }
.badge-suspended  { background: rgba(234, 179, 8, .12); color: #fde047; }
.badge-churned    { background: rgba(239, 68, 68, .12); color: #fca5a5; }
.badge-success    { background: rgba(34, 197, 94, .12); color: #86efac; }
.badge-warning    { background: rgba(234, 179, 8, .12); color: #fde047; }
.badge-error      { background: rgba(239, 68, 68, .12); color: #fca5a5; }

/* ============================================================================
   EMPTY STATES
============================================================================ */
.empty-state {
    color: var(--ink-muted); text-align: center; padding: 56px 36px;
    font-size: .92rem;
}
.empty-state h3 {
    color: var(--ink); font-size: 1.15rem; margin: 14px 0 8px;
    font-style: normal; font-weight: 600;
}
.empty-state p {
    color: var(--ink-muted); margin-bottom: 22px;
    font-style: normal; max-width: 360px; margin-left: auto; margin-right: auto;
}
.empty-state-icon {
    font-size: 2.6rem; opacity: .55; margin-bottom: 4px;
}
.empty-state-large { text-align: center; padding: 96px 20px; }
.empty-state-large h1 {
    font-size: 5rem; margin-bottom: 16px; color: var(--brand);
    font-weight: 800; letter-spacing: -.03em;
}
.empty-state-large p { color: var(--ink-soft); margin-bottom: 24px; font-size: 1.05rem; }

/* Dashboard extras */
.metric-warn {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 1px var(--brand-glow), 0 0 24px var(--brand-glow) !important;
}
.metric-pill {
    display: inline-block; margin-left: 8px; padding: 2px 8px;
    font-size: .62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; border-radius: 999px; vertical-align: middle;
}
.metric-pill-warn { background: var(--brand); color: #1a1208; }

.panel-meta {
    color: var(--ink-muted); font-size: .78rem; font-weight: 500;
}
.panel-collapsible { padding: 0; }
.panel-collapsible > summary {
    padding: 22px 26px; cursor: pointer; list-style: none;
    user-select: none; transition: background .15s;
}
.panel-collapsible > summary::-webkit-details-marker { display: none; }
.panel-collapsible > summary:hover { background: rgba(255, 255, 255, .015); }
.panel-collapsible[open] > summary { border-bottom: 1px solid var(--border); }
.panel-collapsible .roadmap { padding: 8px 26px 22px; }

/* Panel de prueba destacado */
.panel-test {
    border-color: rgba(245, 158, 11, .3);
    background: linear-gradient(135deg, var(--bg-card), rgba(245, 158, 11, .04));
}
.test-warn {
    padding: 12px 16px; margin-bottom: 16px;
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .3);
    border-radius: var(--radius);
    color: var(--ink-soft); font-size: .88rem;
}
.test-timbrado-form {
    display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
}
.test-timbrado-form label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: .8rem; color: var(--ink-soft); font-weight: 500;
    flex: 1; min-width: 180px;
}
.test-timbrado-form input {
    padding: 10px 12px; background: var(--bg-input);
    border: 1px solid var(--border-hover); border-radius: var(--radius);
    color: var(--ink); font-family: var(--mono); font-size: .88rem;
    transition: all .15s;
}
.test-timbrado-form input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}
.test-timbrado-hint {
    margin-top: 14px; font-size: .8rem;
}

/* Select inline en el header del detalle */
.inline-select {
    padding: 7px 12px; background: var(--bg-input);
    border: 1px solid var(--border-hover); border-radius: var(--radius-sm);
    color: var(--ink); font-size: .82rem; font-family: var(--font);
    cursor: pointer;
}
.inline-select:focus { outline: none; border-color: var(--brand); }

/* Celda de error en tabla de transacciones */
.td-error { max-width: 320px; }
.td-error small { line-height: 1.4; display: block; }
.uuid-short { font-size: .78rem; }

/* Métrica clickeable */
.metric-link { text-decoration: none; display: block; }
.metric-link:hover .metric { transform: translateY(-2px); }

/* Pool form (reusa .form-grid) */
.pool-form .form-actions { padding-top: 16px; }

.th-actions, .td-actions { width: 60px; text-align: right; }
.row-action {
    color: var(--brand); text-decoration: none; font-size: .85rem;
    font-weight: 500; padding: 4px 10px; border-radius: var(--radius-sm);
    transition: all .15s;
}
.row-action:hover { background: var(--brand-glow); }

/* ============================================================================
   ROADMAP LIST
============================================================================ */
.roadmap { list-style: none; padding: 0; margin: 0; }
.roadmap li {
    padding: 12px 0 12px 32px; color: var(--ink-soft);
    border-bottom: 1px solid var(--border); position: relative; font-size: .92rem;
}
.roadmap li:last-child { border-bottom: none; }
.roadmap li::before {
    content: "○"; position: absolute; left: 8px; color: var(--ink-muted);
}
.roadmap li.done {
    color: var(--success); text-decoration: line-through;
    text-decoration-color: rgba(34, 197, 94, .4);
}
.roadmap li.done::before { content: "✓"; color: var(--success); text-decoration: none; }

/* ============================================================================
   FORM LARGO (tenant_form)
============================================================================ */
.tenant-form { max-width: 960px; }
.form-section {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px; margin-bottom: 24px;
}
.form-section h2 {
    font-size: 1.2rem; font-weight: 600; margin-bottom: 4px;
    display: flex; align-items: center; gap: 10px;
}
.form-section > p.muted {
    color: var(--ink-muted); font-size: .88rem; margin-bottom: 24px;
}
.subsection-title {
    font-size: .82rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .08em; color: var(--ink-soft);
    margin: 24px 0 14px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.form-grid .span-1 { grid-column: span 1; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }

.form-grid label {
    display: flex; flex-direction: column;
    color: var(--ink-soft); font-size: .8rem; font-weight: 500; gap: 6px;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%; padding: 11px 14px;
    background: var(--bg-input); border: 1px solid var(--border-hover);
    border-radius: var(--radius); color: var(--ink);
    font-family: var(--font); font-size: .92rem; transition: all .15s;
}
.form-grid textarea { font-family: var(--mono); font-size: .85rem; resize: vertical; min-height: 60px; }
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-grid input[readonly] {
    background: rgba(255, 255, 255, .02); color: var(--ink-muted);
    cursor: not-allowed;
}
.form-grid input::placeholder,
.form-grid textarea::placeholder { color: var(--ink-muted); }
.form-grid small {
    color: var(--ink-muted); font-size: .72rem; font-weight: 400; line-height: 1.4;
}

.test-connection-wrap {
    display: flex; flex-direction: column; gap: 10px; justify-content: flex-end;
}
.test-result {
    padding: 10px 12px; border-radius: var(--radius-sm);
    font-size: .8rem; font-family: var(--mono); min-height: 38px;
    display: flex; align-items: center; word-break: break-word;
}
.test-result:empty { display: none; }
.test-result-loading { background: rgba(255, 255, 255, .04); color: var(--ink-soft); }
.test-result-ok { background: rgba(34, 197, 94, .1); color: #86efac; border: 1px solid rgba(34, 197, 94, .3); }
.test-result-error { background: rgba(239, 68, 68, .1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .3); }

.form-actions {
    display: flex; justify-content: flex-end; gap: 12px;
    padding-top: 24px; border-top: 1px solid var(--border);
}

/* ============================================================================
   DETAIL VIEW (tenant_detail)
============================================================================ */
.data-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 32px; }
.data-list > div {
    display: flex; flex-direction: column; gap: 4px;
    padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.data-list dt {
    color: var(--ink-muted); font-size: .68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
}
.data-list dd { color: var(--ink); font-size: .94rem; }
.data-list dd code {
    background: var(--bg-input); padding: 2px 8px; border-radius: var(--radius-sm);
    color: var(--brand); font-size: .85rem;
}
.notes-block {
    margin-top: 20px; padding: 14px 16px; background: rgba(255, 255, 255, .02);
    border-left: 3px solid var(--brand); border-radius: var(--radius-sm);
}
.notes-block strong { color: var(--ink); font-size: .82rem; }
.notes-block p { color: var(--ink-soft); font-size: .9rem; margin-top: 6px; }

.code-block {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px; margin: 12px 0;
    color: var(--ink); font-family: var(--mono); font-size: .82rem;
    overflow-x: auto; line-height: 1.6; white-space: pre;
}

/* ============================================================================
   UTILITIES
============================================================================ */
.muted { color: var(--ink-muted); }
.accent { color: var(--brand); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-center { text-align: center; }
.mt-4 { margin-top: 32px; }

/* ============================================================================
   RESPONSIVE
============================================================================ */
@media (max-width: 1024px) {
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .features, .steps { grid-template-columns: repeat(2, 1fr); }
    .data-list { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand-block { grid-column: 1 / -1; max-width: none; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .hero { padding: 64px 0 56px; }
    .hero-brand { gap: 18px; margin-bottom: 32px; }
    .hero-brand-main img { height: 60px; }
    .hero-brand-divider { height: 42px; }
    .hero-brand-by img { height: 24px; }
    .hero-brand-by span { font-size: .65rem; }
    .hero h1 { font-size: 2.4rem; }
    .hero .lead { font-size: 1.05rem; }
    .hero-stats { gap: 32px; }
    .hero-stat-value { font-size: 1.7rem; }
    .section { padding: 64px 0; }
    .section-header h2 { font-size: 1.8rem; }
    .features, .steps, .pricing { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-1, .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
    .form-section { padding: 22px; }
    .panel { padding: 20px; }
    .auth-card { padding: 28px; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .header-inner { padding: 0 16px; }
    .brand-logo { height: 32px; }
    .brand-sep { display: none; }
    .brand-by span { display: none; }
    .brand-by img { height: 18px; }
    .footer-logos img { height: 28px; }
    nav.site-nav a { padding: 6px 10px; font-size: .8rem; }
    nav.site-nav .nav-sep { display: none; }
    .page-header h1 { font-size: 1.6rem; }
    .page-header-row { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .cta-banner { padding: 56px 24px; }
    .cta-banner h2 { font-size: 1.8rem; }
}