/* TELOR AITEND — design tokens (SaaS enterprise, dark) */
:root {
    --aitend-bg: #070b14;
    --aitend-bg-elevated: #0c1222;
    --aitend-surface: #111827;
    --aitend-surface-hover: #1a2332;
    --aitend-border: #1e293b;
    --aitend-border-strong: #334155;
    --aitend-text: #e2e8f0;
    --aitend-text-muted: #94a3b8;
    --aitend-text-dim: #64748b;
    --aitend-accent: #3b82f6;
    --aitend-accent-hover: #2563eb;
    --aitend-accent-muted: rgba(59, 130, 246, 0.15);
    --aitend-success: #22c55e;
    --aitend-success-bg: rgba(34, 197, 94, 0.12);
    --aitend-warning: #eab308;
    --aitend-danger: #f87171;
    --aitend-danger-bg: rgba(248, 113, 113, 0.1);
    --aitend-radius: 10px;
    --aitend-radius-sm: 8px;
    --aitend-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    --aitend-font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: var(--aitend-font);
    background: var(--aitend-bg);
    color: var(--aitend-text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: #93c5fd;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ——— Shell & sidebar ——— */
.aitend-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.aitend-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #0c1322 100%);
    border-right: 1px solid var(--aitend-border);
    padding: 1.25rem 1rem 2rem;
    display: flex;
    flex-direction: column;
}

.aitend-brand {
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--aitend-text);
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.aitend-brand-sub {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--aitend-text-dim);
    margin-top: 0.35rem;
    text-transform: none;
}

.aitend-nav {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}

.aitend-nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.aitend-nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--aitend-text-dim);
    padding: 0 0.5rem;
    margin-bottom: 0.25rem;
}

.aitend-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--aitend-radius-sm);
    color: #cbd5e1 !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.aitend-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9 !important;
}

.aitend-nav-link.active {
    background: var(--aitend-accent-muted);
    border-color: rgba(59, 130, 246, 0.35);
    color: #fff !important;
    box-shadow: var(--aitend-shadow);
}

.aitend-nav-link--muted {
    color: var(--aitend-text-muted) !important;
    font-size: 0.8125rem;
}

.aitend-main {
    padding: 2rem 2.5rem 3rem;
    max-width: 1440px;
}

@media (max-width: 960px) {
    .aitend-shell {
        grid-template-columns: 1fr;
    }

    .aitend-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--aitend-border);
        padding-bottom: 1rem;
    }

    .aitend-main {
        padding: 1.25rem 1rem 2rem;
    }
}

/* ——— Page chrome ——— */
.aitend-page {
    animation: aitend-fade-in 0.25s ease;
}

@keyframes aitend-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.aitend-page-header {
    margin-bottom: 1.75rem;
}

.aitend-page-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.625rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.aitend-page-subtitle {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--aitend-text-muted);
    max-width: 52rem;
    line-height: 1.5;
}

.aitend-page h1:not(.aitend-login-title) {
    margin-top: 0;
}

.aitend-muted {
    color: var(--aitend-text-muted);
}

.aitend-hero {
    max-width: 720px;
    padding: 3rem 0 2rem;
}

.aitend-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.aitend-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ——— Buttons ——— */
.aitend-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--aitend-radius-sm);
    background: var(--aitend-accent);
    color: #fff !important;
    border: 1px solid var(--aitend-accent-hover);
    text-decoration: none !important;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.aitend-btn:hover {
    filter: brightness(1.08);
}

.aitend-btn:active {
    transform: translateY(1px);
}

.aitend-btn--ghost {
    background: transparent;
    border-color: var(--aitend-border-strong);
    color: var(--aitend-text) !important;
}

.aitend-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    filter: none;
}

.aitend-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.aitend-btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
}

/* ——— Auth ——— */
.aitend-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(59, 130, 246, 0.22), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(99, 102, 241, 0.12), transparent),
        var(--aitend-bg);
}

.aitend-card {
    width: min(420px, 100%);
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    padding: 2rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.aitend-login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.aitend-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.aitend-field label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--aitend-text-muted);
}

.aitend-input {
    padding: 0.6rem 0.85rem;
    border-radius: var(--aitend-radius-sm);
    border: 1px solid var(--aitend-border-strong);
    background: var(--aitend-bg);
    color: var(--aitend-text);
    font-size: 0.9375rem;
}

.aitend-input:focus {
    outline: none;
    border-color: var(--aitend-accent);
    box-shadow: 0 0 0 3px var(--aitend-accent-muted);
}

.aitend-error {
    background: var(--aitend-danger-bg);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
    padding: 0.65rem 0.85rem;
    border-radius: var(--aitend-radius-sm);
    margin: 0.5rem 0 1rem;
    font-size: 0.875rem;
}

.aitend-success {
    background: var(--aitend-success-bg);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
    padding: 0.65rem 0.85rem;
    border-radius: var(--aitend-radius-sm);
    margin: 0.5rem 0 1rem;
    font-size: 0.875rem;
}

.aitend-hint {
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: var(--aitend-text-dim);
    line-height: 1.5;
}

.aitend-demo-pill {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

/* ——— Stats & grid ——— */
.aitend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.aitend-stat {
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--aitend-shadow);
}

.aitend-stat span {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--aitend-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.aitend-stat strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.aitend-dashboard-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1100px) {
    .aitend-dashboard-layout {
        grid-template-columns: 1fr 320px;
        align-items: start;
    }
}

.aitend-panel {
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    padding: 1.25rem 1.35rem;
}

.aitend-panel-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--aitend-text-dim);
    margin: 0 0 1rem;
}

.aitend-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--aitend-radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.aitend-alert--danger {
    background: var(--aitend-danger-bg);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.aitend-alert--success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.aitend-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.aitend-quick-actions a {
    text-decoration: none !important;
}

.aitend-loading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--aitend-text-muted);
    font-size: 0.9375rem;
}

.aitend-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aitend-accent);
    animation: aitend-pulse 1s ease infinite;
}

@keyframes aitend-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1); }
}

.aitend-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border: 1px dashed var(--aitend-border-strong);
    border-radius: var(--aitend-radius);
    color: var(--aitend-text-muted);
    font-size: 0.9375rem;
}

.aitend-empty-title {
    font-weight: 600;
    color: var(--aitend-text);
    margin-bottom: 0.35rem;
}

#blazor-error-ui {
    background: #450a0a;
    bottom: 0;
    display: none;
    left: 0;
    padding: 10px 16px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #fecaca;
}

/* ——— Badges ——— */
.aitend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
    background: var(--aitend-bg-elevated);
    border: 1px solid var(--aitend-border-strong);
    color: var(--aitend-text);
}

.aitend-badge-ok {
    border-color: rgba(34, 197, 94, 0.45);
    background: var(--aitend-success-bg);
    color: #86efac;
}

.aitend-badge-warn {
    border-color: rgba(234, 179, 8, 0.45);
    background: rgba(234, 179, 8, 0.1);
    color: #fde047;
}

.aitend-badge-err {
    border-color: rgba(248, 113, 113, 0.45);
    background: var(--aitend-danger-bg);
    color: #fecaca;
}

.aitend-badge-neutral {
    border-color: var(--aitend-border-strong);
    background: rgba(148, 163, 184, 0.08);
    color: var(--aitend-text-muted);
}

.aitend-badge--pulse {
    animation: aitend-pulse-badge 1.5s ease infinite;
}

@keyframes aitend-pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.aitend-badge-inline {
    margin-bottom: 0;
    font-size: 0.6875rem;
    vertical-align: middle;
}

.aitend-table .aitend-badge {
    margin-bottom: 0;
}

/* ——— Tables ——— */
.aitend-table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: var(--aitend-radius-sm);
    border: 1px solid var(--aitend-border);
}

.aitend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.aitend-table th,
.aitend-table td {
    border-bottom: 1px solid var(--aitend-border);
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: middle;
}

.aitend-table th {
    color: var(--aitend-text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(0, 0, 0, 0.2);
}

.aitend-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.aitend-table tbody tr:last-child td {
    border-bottom: none;
}

.aitend-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.aitend-file-wrap {
    position: relative;
}

.aitend-file-wrap input[type=file] {
    font-size: 0.8125rem;
    color: var(--aitend-text-muted);
}

.aitend-h2 {
    font-size: 1rem;
    font-weight: 650;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--aitend-text);
}

.aitend-activity {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--aitend-text-muted);
}

.aitend-activity li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--aitend-border);
    line-height: 1.45;
}

.aitend-activity li:last-child {
    border-bottom: none;
}

.aitend-feed-meta {
    font-size: 0.7rem;
    color: var(--aitend-text-dim);
    display: block;
    margin-top: 0.2rem;
}

/* ——— Chat ——— */
.aitend-chat {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 920px;
}

.aitend-chat-log {
    min-height: 240px;
    max-height: min(560px, 62vh);
    overflow-y: auto;
    padding: 1rem;
    background: var(--aitend-bg-elevated);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    scroll-behavior: smooth;
}

.aitend-msg {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--aitend-radius-sm);
    max-width: 92%;
}

.aitend-msg-user {
    margin-left: auto;
    background: linear-gradient(135deg, #1e3a5f 0%, #172554 100%);
    border: 1px solid rgba(59, 130, 246, 0.45);
}

.aitend-msg-assistant {
    margin-right: auto;
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border-strong);
}

.aitend-thinking {
    opacity: 0.95;
    font-style: normal;
}

.aitend-thinking-dots::after {
    content: "…";
    animation: aitend-dots 1.2s steps(4, end) infinite;
}

@keyframes aitend-dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "…"; }
}

.aitend-msg-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.aitend-msg-head .aitend-msg-role {
    margin-bottom: 0;
}

.aitend-msg-body {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.aitend-msg-role {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--aitend-text-dim);
    margin-bottom: 0.35rem;
}

.aitend-msg-time {
    font-size: 0.7rem;
    color: var(--aitend-text-dim);
    margin-top: 0;
}

.aitend-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #e9d5ff;
}

.aitend-chat-input {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.aitend-chat-input textarea.aitend-input {
    resize: vertical;
    min-height: 5rem;
}

.aitend-chat-actions {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.aitend-sources {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--aitend-border);
    font-size: 0.8125rem;
    color: var(--aitend-text-muted);
}

.aitend-sources span {
    font-weight: 600;
    color: #a5b4fc;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.aitend-sources ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.aitend-card-wide {
    max-width: 720px;
    margin-bottom: 1.5rem;
}

.aitend-faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 880px;
}

.aitend-faq-item {
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    padding: 1.1rem 1.25rem;
}

.aitend-faq-item p {
    margin: 0.65rem 0 1rem;
    color: #cbd5e1;
    line-height: 1.55;
}

.aitend-h3 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--aitend-text-dim);
    margin: 0 0 0.65rem;
}

.aitend-chat-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 1.5rem;
    align-items: start;
    max-width: 1120px;
}

@media (max-width: 800px) {
    .aitend-chat-layout {
        grid-template-columns: 1fr;
    }
}

.aitend-chat-sidebar {
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    padding: 1rem;
}

.aitend-btn-block {
    width: 100%;
    text-align: center;
}

.aitend-conv-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(420px, 50vh);
    overflow-y: auto;
}

.aitend-conv-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.35rem;
    border-radius: var(--aitend-radius-sm);
    border: 1px solid var(--aitend-border-strong);
    background: var(--aitend-bg);
    color: var(--aitend-text);
    cursor: pointer;
    font-size: 0.8125rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.aitend-conv-btn span {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    color: var(--aitend-text-dim);
}

.aitend-conv-btn:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

.aitend-conv-btn-active {
    border-color: var(--aitend-accent);
    background: var(--aitend-accent-muted);
}

.aitend-chat-main {
    min-width: 0;
}

.aitend-notif-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 800px;
}

.aitend-notif-item {
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    padding: 1rem 1.15rem;
}

.aitend-notif-item strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.aitend-notif-item p {
    margin: 0.5rem 0 0;
    color: #cbd5e1;
    font-size: 0.875rem;
    line-height: 1.5;
}

.aitend-notif-err {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.2);
}

.aitend-notif-warn {
    border-color: rgba(234, 179, 8, 0.45);
}

/* ——— Público — landing / marketing ——— */
html {
    scroll-behavior: smooth;
}

.aitend-public-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(1200px 600px at 10% -10%, rgba(59, 130, 246, 0.12), transparent 55%),
        radial-gradient(900px 500px at 90% 0%, rgba(34, 197, 94, 0.06), transparent 50%),
        var(--aitend-bg);
}

.aitend-public-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--aitend-border);
    background: rgba(7, 11, 20, 0.92);
    backdrop-filter: blur(10px);
}

.aitend-public-header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.aitend-public-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    text-decoration: none !important;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.aitend-public-brand-mark {
    font-size: 0.72rem;
    color: var(--aitend-text-dim);
}

.aitend-public-brand-name {
    font-size: 0.95rem;
    color: var(--aitend-text);
}

.aitend-public-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    flex: 1;
    justify-content: center;
}

.aitend-public-nav-link {
    color: var(--aitend-text-muted) !important;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none !important;
    padding: 0.25rem 0;
}

.aitend-public-nav-link:hover {
    color: var(--aitend-text) !important;
}

.aitend-public-header-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}

.aitend-public-btn-sm {
    padding: 0.45rem 0.85rem !important;
    font-size: 0.8125rem !important;
}

.aitend-public-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Login (y otras vistas con .aitend-auth) dentro del layout público: centrar sin forzar doble scroll */
.aitend-public-main .aitend-auth {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 2.5rem 1.25rem 3rem;
    box-sizing: border-box;
}

.aitend-public-footer {
    border-top: 1px solid var(--aitend-border);
    padding: 2rem 1.25rem;
    background: rgba(15, 23, 42, 0.35);
}

.aitend-public-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}

.aitend-public-footer-brand {
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.aitend-public-footer-tag {
    margin: 0.35rem 0 0;
    color: var(--aitend-text-muted);
    font-size: 0.875rem;
    max-width: 520px;
    line-height: 1.55;
}

.aitend-public-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.aitend-public-footer-links a {
    color: #93c5fd !important;
    font-size: 0.875rem;
}

.aitend-public-footer-copy {
    margin: 0;
    font-size: 0.75rem;
    color: var(--aitend-text-dim);
}

/* Landing: banda a ancho completo + contenedor interior único (misma columna de contenido en todas las secciones) */
.aitend-lp-container {
    width: 100%;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    padding: 2.5rem 1.25rem;
    box-sizing: border-box;
}

.aitend-lp-hero {
    width: 100%;
    box-sizing: border-box;
}

.aitend-lp-hero .aitend-lp-container {
    padding-top: 3rem;
    padding-bottom: 2.5rem;
}

.aitend-lp-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .aitend-lp-hero-grid {
        grid-template-columns: 1fr;
    }
    .aitend-public-nav {
        justify-content: flex-start;
    }
}

.aitend-lp-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--aitend-accent);
    margin: 0 0 0.75rem;
}

.aitend-lp-h1 {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.aitend-lp-lead {
    font-size: 1.05rem;
    line-height: 1.65;
    color: #cbd5e1;
    margin: 0 0 1.5rem;
}

.aitend-lp-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.aitend-lp-micro {
    font-size: 0.8125rem;
    color: var(--aitend-text-dim);
    margin: 0;
}

.aitend-lp-hero-visual {
    display: flex;
    justify-content: center;
}

.aitend-lp-panel {
    width: 100%;
    max-width: 380px;
    background: linear-gradient(160deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.85));
    border: 1px solid var(--aitend-border-strong);
    border-radius: var(--aitend-radius);
    padding: 1rem 1.1rem 1.25rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.aitend-lp-panel-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.aitend-lp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aitend-success);
}

.aitend-lp-panel-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--aitend-text-dim);
}

.aitend-lp-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    height: 72px;
    margin-bottom: 1rem;
}

.aitend-lp-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.85), rgba(59, 130, 246, 0.15));
}

.aitend-lp-chat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.aitend-lp-bubble {
    font-size: 0.8125rem;
    line-height: 1.45;
    padding: 0.55rem 0.7rem;
    border-radius: var(--aitend-radius-sm);
    max-width: 95%;
}

.aitend-lp-bubble--user {
    align-self: flex-end;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.aitend-lp-bubble--ai {
    align-self: flex-start;
    background: var(--aitend-bg);
    border: 1px solid var(--aitend-border);
    color: #cbd5e1;
}

.aitend-lp-section {
    width: 100%;
    box-sizing: border-box;
}

/* Fondo a todo el ancho del viewport; el contenido alineado va en .aitend-lp-container */
.aitend-lp-section--alt {
    background: rgba(15, 23, 42, 0.35);
    border-top: 1px solid var(--aitend-border);
    border-bottom: 1px solid var(--aitend-border);
}

.aitend-lp-h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.aitend-lp-intro {
    margin: 0;
    font-size: 1rem;
    line-height: 1.65;
    color: #cbd5e1;
    max-width: 820px;
}

.aitend-lp-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.25rem;
}

.aitend-lp-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.25rem;
}

@media (max-width: 900px) {
    .aitend-lp-grid-3 {
        grid-template-columns: 1fr;
    }
    .aitend-lp-grid-2 {
        grid-template-columns: 1fr;
    }
}

.aitend-lp-card {
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    padding: 1.25rem 1.35rem;
}

.aitend-lp-card h3 {
    margin: 0 0 0.5rem;
}

.aitend-lp-card p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.55;
}

.aitend-lp-h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

/* Mismo ancho útil que la grid de Beneficios (contenedor .aitend-lp-section, sin capar a 820px) */
.aitend-lp-steps {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 1.25rem 0 0;
    padding-left: 1.25rem;
    color: #cbd5e1;
    line-height: 1.55;
}

.aitend-lp-steps li {
    margin-bottom: 0.65rem;
}

.aitend-lp-feature {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    padding: 1rem 1.15rem;
}

.aitend-lp-icon {
    color: var(--aitend-accent);
    font-size: 0.75rem;
    line-height: 1.8;
}

.aitend-lp-feature strong {
    display: block;
    margin-bottom: 0.25rem;
}

.aitend-lp-feature p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.875rem;
    line-height: 1.5;
}

.aitend-lp-pills {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.aitend-lp-pills span {
    font-size: 0.8125rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--aitend-border-strong);
    background: rgba(15, 23, 42, 0.35);
    color: #cbd5e1;
}

.aitend-lp-pricing-note {
    margin: 0 0 1rem;
    color: var(--aitend-text-muted);
    font-size: 0.9rem;
    max-width: 720px;
}

.aitend-lp-pricing {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
    align-items: stretch;
}

@media (max-width: 900px) {
    .aitend-lp-pricing {
        grid-template-columns: minmax(0, 1fr);
    }
}

.aitend-lp-plan {
    position: relative;
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    padding: 1.35rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    min-height: 100%;
    box-sizing: border-box;
}

.aitend-lp-plan--featured {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
    padding-top: 2.15rem;
}

.aitend-lp-plan--featured .aitend-lp-plan-name {
    padding-right: 5.5rem;
}

.aitend-lp-plan-badge {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--aitend-accent);
    background: var(--aitend-accent-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.aitend-lp-plan-name {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 800;
}

.aitend-lp-plan-price {
    margin: 0 0 1rem;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.aitend-lp-plan-list {
    margin: 0;
    padding-left: 1.1rem;
    color: #cbd5e1;
    font-size: 0.875rem;
    line-height: 1.55;
    flex: 1 1 auto;
    min-height: 0;
    list-style-position: outside;
}

.aitend-lp-plan-footer {
    margin-top: auto;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    padding-top: 1.1rem;
    box-sizing: border-box;
}

.aitend-lp-plan-footer .aitend-btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: block;
    text-align: center;
}

.aitend-lp-faq {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin-top: 1.25rem;
}

.aitend-lp-details {
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius-sm);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.5rem;
    background: rgba(15, 23, 42, 0.25);
}

.aitend-lp-details summary {
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.aitend-lp-details p {
    margin: 0.65rem 0 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.55;
}

.aitend-lp-cta-final {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.aitend-lp-cta-final .aitend-lp-container {
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.aitend-lp-cta-final .aitend-lp-intro {
    margin: 0 auto 1.25rem;
}

.aitend-lp-cta-final .aitend-lp-hero-actions {
    justify-content: center;
}

/* Formularios públicos */
.aitend-form-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 2.5rem;
}

.aitend-form-card {
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
    padding: 1.75rem 1.5rem;
}

.aitend-form-back {
    display: inline-block;
    font-size: 0.8125rem;
    color: var(--aitend-text-muted) !important;
    margin-bottom: 1rem;
}

.aitend-form-title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
}

.aitend-form-lead {
    margin: 0 0 1.25rem;
    color: #cbd5e1;
    line-height: 1.55;
    font-size: 0.95rem;
}

.aitend-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .aitend-form-grid {
        grid-template-columns: 1fr;
    }
}

.aitend-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--aitend-text-muted);
}

.aitend-field--full {
    grid-column: 1 / -1;
}

.aitend-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.65rem;
    border-radius: var(--aitend-radius-sm);
    border: 1px solid var(--aitend-border-strong);
    background: var(--aitend-bg);
    color: var(--aitend-text);
    font-size: 0.9rem;
}

.aitend-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.aitend-input--area {
    resize: vertical;
    min-height: 100px;
}

.aitend-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.aitend-validation-summary {
    color: var(--aitend-danger);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.aitend-alert {
    border-radius: var(--aitend-radius-sm);
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    line-height: 1.55;
}

.aitend-alert--success {
    color: #bbf7d0;
    background: var(--aitend-success-bg);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.aitend-alert--error {
    color: #fecaca;
    background: var(--aitend-danger-bg);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

/* ——— Document lifecycle (Documents) ——— */
.aitend-doc-page {
    max-width: 1100px;
}

.aitend-doc-group {
    margin-bottom: 1.25rem;
    padding: 1.15rem 1.25rem;
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border);
    border-radius: var(--aitend-radius);
}

.aitend-doc-group__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--aitend-border);
}

.aitend-doc-group__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--aitend-text);
}

.aitend-doc-group__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--aitend-text-muted);
}

.aitend-doc-group__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.aitend-doc-callout {
    font-size: 0.8125rem;
    color: #fde68a;
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: var(--aitend-radius-sm);
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.45;
}

.aitend-doc-table-wrap {
    overflow-x: auto;
    margin: 0 -0.25rem;
}

.aitend-doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.aitend-doc-table th,
.aitend-doc-table td {
    padding: 0.5rem 0.45rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--aitend-border);
}

.aitend-doc-table th {
    color: var(--aitend-text-dim);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.aitend-doc-table tbody tr:last-child td {
    border-bottom: none;
}

.aitend-doc-table tr.aitend-doc-row--hl td {
    background: rgba(59, 130, 246, 0.08);
}

.aitend-ref-id {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.75rem;
    color: var(--aitend-text-muted);
}

.aitend-file-label-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--aitend-radius-sm);
    background: var(--aitend-accent);
    color: #fff !important;
    border: 1px solid var(--aitend-accent-hover);
    cursor: pointer;
    margin: 0;
}

.aitend-file-label-btn:hover {
    filter: brightness(1.08);
}

.aitend-file-label-btn input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.aitend-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.aitend-modal {
    width: min(720px, 100%);
    max-height: min(88vh, 900px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--aitend-surface);
    border: 1px solid var(--aitend-border-strong);
    border-radius: var(--aitend-radius);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.aitend-modal--lg {
    width: min(920px, 100%);
}

.aitend-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--aitend-border);
}

.aitend-modal__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.aitend-modal__sub {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--aitend-text-muted);
    line-height: 1.45;
}

.aitend-modal__body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
}

.aitend-modal__foot {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--aitend-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ——— Document timeline (modal historial) ——— */
.aitend-doc-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem 1rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--aitend-radius-sm);
    font-size: 0.8125rem;
}

.aitend-doc-summary dt {
    margin: 0;
    color: var(--aitend-text-dim);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.aitend-doc-summary dd {
    margin: 0.2rem 0 0;
    color: var(--aitend-text);
    font-weight: 600;
}

.aitend-timeline-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--aitend-border);
}

.aitend-timeline-section h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--aitend-text);
}

.aitend-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.5rem;
    border-left: 2px solid var(--aitend-border);
}

.aitend-timeline__item {
    position: relative;
    padding: 0 0 1rem 1rem;
    margin-left: 2px;
}

.aitend-timeline__item:last-child {
    padding-bottom: 0;
}

.aitend-timeline__dot {
    position: absolute;
    left: -0.55rem;
    top: 0.35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--aitend-text-dim);
    border: 2px solid var(--aitend-surface);
}

.aitend-timeline__dot--neutral {
    background: #64748b;
}

.aitend-timeline__dot--info {
    background: #3b82f6;
}

.aitend-timeline__dot--success {
    background: var(--aitend-success);
}

.aitend-timeline__dot--warning {
    background: var(--aitend-warning);
}

.aitend-timeline__dot--error {
    background: var(--aitend-danger);
}

.aitend-timeline__time {
    font-size: 0.72rem;
    color: var(--aitend-text-dim);
    margin-bottom: 0.2rem;
}

.aitend-timeline__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--aitend-text);
    line-height: 1.35;
}

.aitend-timeline__sub {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--aitend-text-muted);
    line-height: 1.45;
}

.aitend-timeline__actor {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: var(--aitend-text-dim);
}

.aitend-timeline__empty {
    font-size: 0.8125rem;
    color: var(--aitend-text-muted);
    padding: 0.5rem 0;
}
