:root {
    --bg: #f4efe6;
    --panel: #fffdf8;
    --panel-strong: #ffffff;
    --text: #17212b;
    --muted: #66717d;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #f59e0b;
    --border: #e7ddcf;
    --shadow: 0 24px 60px rgba(23, 33, 43, 0.08);
    --radius: 22px;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.15), transparent 24%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.18), transparent 20%),
        var(--bg);
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 8px; }
p { color: var(--muted); line-height: 1.6; }
code { background: #f3ede3; padding: 2px 6px; border-radius: 8px; word-break: break-word; }

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}
.sidebar {
    background: rgba(255,255,255,0.9);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(12px);
    padding: 28px;
}
.sidebar-stack {
    position: sticky;
    top: 28px;
    display: grid;
    gap: 24px;
    align-content: start;
}
.brand { font-size: 1.4rem; font-weight: 700; }
.brand-subtitle { color: var(--muted); margin-top: 6px; }
.nav-menu { display: grid; gap: 12px; }
.nav-link {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f6f2ea;
    font-weight: 600;
}
.sidebar-footer { display: grid; gap: 12px; }
.main-content {
    min-width: 0;
    padding: 28px;
    overflow-x: hidden;
}
.page-header, .section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}
.page-header { margin-bottom: 24px; }
.project-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
    align-items: start;
}
.project-header-sticky {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 18px 0 14px;
    background: linear-gradient(to bottom, rgba(244, 239, 230, 0.97), rgba(244, 239, 230, 0.88));
    backdrop-filter: blur(8px);
}

.project-title-with-logo {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.project-title-with-logo > div {
    min-width: 0;
}

.project-logo {
    width: auto;
    height: auto;
    max-width: 140px;
    max-height: 100px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px;
    flex-shrink: 0;
}

.report-brand-block {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.report-company-logo {
    width: auto;
    height: auto;
    max-width: 120px;
    max-height: 78px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    flex-shrink: 0;
}

.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 10px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card, .panel-card, .login-card {
    background: var(--panel);
    border: 1px solid rgba(231, 221, 207, 0.8);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.stat-card { padding: 18px 20px; }
.stat-card span { display: block; color: var(--muted); margin-bottom: 8px; }
.stat-card strong { font-size: 1.75rem; }
.panel-card { padding: 24px; margin-bottom: 24px; overflow: hidden; min-width: 0; }
.badge {
    background: #e6fffb;
    color: var(--primary-dark);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}
.table-responsive { overflow-x: auto; max-width: 100%; width: 100%; }
.small-table table td, .small-table table th { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th, td {
    border-bottom: 1px solid var(--border);
    text-align: left;
    padding: 14px 10px;
    vertical-align: top;
}
th { color: var(--muted); font-weight: 700; }
.filter-bar, .form-grid, .compact-form, .compact-grid {
    display: grid;
    gap: 14px;
}
.filter-bar {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: end;
}
.compact-filter-form {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
}
.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.compact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label { display: grid; gap: 8px; font-weight: 600; }
label span { color: var(--muted); font-size: 0.92rem; }
input, textarea, select, button { font: inherit; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--panel-strong);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text);
}
textarea.code-block {
    font-family: Consolas, monospace;
    min-height: 110px;
    white-space: pre;
    overflow: auto;
}
.btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: #efe7da; color: var(--text); }
.btn-block { width: 100%; }
.actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.align-end { align-items: end; }
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
    min-width: 0;
}
.chart-card { min-height: 320px; }
.chart-frame {
    position: relative;
    height: 260px;
}
.chart-frame.compact { height: 190px; }
.chart-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-weight: 600;
}
.alert-error { background: #fef2f2; color: #b91c1c; }
.alert-success { background: #ecfdf5; color: #047857; }
.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.guest-wrapper { width: min(100%, 480px); }
.login-card { padding: 32px; display: grid; gap: 20px; }
.login-help {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f5efe4;
    color: var(--muted);
    line-height: 1.6;
}
.report-cover {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.report-meta { display: grid; gap: 8px; color: var(--muted); }
.script-heading { align-items: center; }
.script-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.section-copy {
    margin: 0;
    max-width: 760px;
}
.copy-feedback {
    min-height: 22px;
    margin-top: 10px;
    color: var(--primary-dark);
    font-weight: 600;
}
.whatsapp-config-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.wa-config-card {
    background: #fffaf1;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
}
.filters-box { margin-bottom: 18px; }
.detail-panel {
    padding-top: 0;
}
.detail-header-sticky,
.detail-filters-sticky {
    position: sticky;
    z-index: 8;
    background: var(--panel);
}
.detail-header-sticky {
    top: 0;
    padding: 24px 24px 14px;
    margin: 0 -24px 0;
    border-bottom: 1px solid rgba(231, 221, 207, 0.6);
}
.detail-filters-sticky {
    top: 92px;
    padding: 18px 24px 18px;
    margin: 0 -24px 0;
    border-bottom: 1px solid rgba(231, 221, 207, 0.6);
}
.no-print { print-color-adjust: exact; }

@media (max-width: 1200px) {
    .project-header,
    .whatsapp-config-grid,
    .grid-2,
    .form-grid,
    .compact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
    .sidebar-stack { position: static; }
    .compact-filter-form,
    .filter-bar { grid-template-columns: 1fr; }
    .project-title-with-logo,
    .report-brand-block {
        align-items: flex-start;
    }
    .project-logo {
        max-width: 96px;
        max-height: 72px;
        padding: 8px;
    }
    .report-company-logo {
        max-width: 96px;
        max-height: 64px;
        padding: 6px;
    }
    .project-header-sticky,
    .detail-header-sticky,
    .detail-filters-sticky {
        position: static;
        margin: 0;
        padding: 0;
        border-bottom: 0;
        background: transparent;
    }
}

.wide-table {
    width: max-content;
    min-width: 1950px;
    max-width: none;
    table-layout: auto;
}

.wide-table th,
.wide-table td {
    white-space: nowrap;
}

.visit-detail-table-wrap {
    overflow: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: 72vh;
    padding-bottom: 6px;
}

.visit-detail-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--panel-strong);
    box-shadow: inset 0 -1px 0 var(--border);
}


.full-width {
    grid-column: 1 / -1;
}

@media (min-width: 1280px) {
    .grid-3-xl {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.report-insights-card {
    display: grid;
    gap: 1.25rem;
}

.report-summary-text {
    margin: 0;
    color: var(--muted, #5b6b84);
    line-height: 1.7;
}

.compact-insights-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.report-insights-grid {
    align-items: start;
}

.subpanel-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(12, 37, 63, 0.08);
    border-radius: 1rem;
    padding: 1.1rem 1.15rem;
    box-shadow: 0 12px 30px rgba(12, 37, 63, 0.05);
}

.subpanel-card h3 {
    margin: 0 0 0.85rem;
    font-size: 1rem;
}

.insight-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted, #5b6b84);
    line-height: 1.65;
}

.insight-list li + li {
    margin-top: 0.55rem;
}


/* v4.3: usuarios, 2FA y claves de reporting */
.project-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

.check-card {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .9rem 1rem;
    border: 1px solid var(--border);
    border-radius: .9rem;
    background: rgba(255,255,255,.65);
}

.check-card input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: .15rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.secret-code {
    overflow-wrap: anywhere;
    word-break: break-word;
    user-select: all;
}

.security-note {
    padding: .9rem 1rem;
    border: 1px solid var(--border);
    border-radius: .9rem;
    background: rgba(255,255,255,.72);
    color: var(--muted, #5b6b84);
}


/* v4.4: tablas filtrables con scroll vertical y cabecera fija */
.data-scroll {
    overflow: auto;
    width: 100%;
    max-width: 100%;
    max-height: 58vh;
    min-height: 180px;
    padding-bottom: 6px;
    scrollbar-gutter: stable both-edges;
}
.data-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--panel-strong);
    box-shadow: inset 0 -1px 0 var(--border);
}
.section-filter-form {
    margin: 14px 0 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.48);
}

/* v4.4: bloques de configuración plegables */
.config-details {
    margin-bottom: 18px;
    border: 1px solid rgba(231, 221, 207, .9);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.config-details > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    font-weight: 800;
    color: var(--text);
    user-select: none;
}
.config-details > summary::-webkit-details-marker { display: none; }
.config-details > summary span { font-size: 1.05rem; }
.config-details > summary small {
    color: var(--muted);
    font-weight: 600;
    text-align: right;
}
.config-details > summary::after {
    content: "▾";
    color: var(--primary);
    font-size: 1.1rem;
    transition: transform .18s ease;
}
.config-details[open] > summary::after { transform: rotate(180deg); }
.config-details-body { padding: 0 14px 14px; }
.config-details-body > .panel-card {
    margin: 0;
    box-shadow: none;
    border-radius: 14px;
}
@media (max-width: 720px) {
    .config-details > summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
    .config-details > summary small { text-align: left; }
    .data-scroll { max-height: 68vh; }
}

.temporary-password-row { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.temporary-password-row code { font-size:1.05rem; padding:12px 14px; background:#f3ede3; border-radius:12px; word-break:break-all; }
.user-actions { flex-wrap:wrap; }
.password-once-card { border-color:rgba(15,118,110,.35); }

/* v4.8.1: cabecera multiweb, scroll compacto y utilidades de integración */
.project-url-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 2px 0 6px;
}
.project-url-list a {
    font-size: .92rem;
    word-break: break-all;
}
.compact-data-scroll {
    max-height: min(42vh, 360px);
    min-height: 0;
}
.copy-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}
.shopify-webhook-box {
    border-color: rgba(15,118,110,.28);
}
.report-view-mode-note {
    margin: 0;
    font-size: .92rem;
}
.report-chart-grid {
    margin-bottom: 24px;
}
.report-chart-section .chart-card {
    margin-bottom: 0;
}
@media (max-width: 720px) {
    .copy-input-row { grid-template-columns: 1fr; }
}

/* v4.8.2: 2FA persistente y responsive móvil */
.twofactor-setup-card,
.twofactor-challenge-card {
    width: 100%;
    min-width: 0;
}
.twofactor-heading h1 {
    font-size: clamp(1.65rem, 5vw, 2.15rem);
    line-height: 1.15;
}
.twofactor-heading p { margin-bottom: 0; }
.twofactor-info-grid {
    display: grid;
    gap: 12px;
}
.twofactor-data-card {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f7f1e8;
}
.twofactor-data-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 700;
}
.twofactor-account {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.twofactor-secret-row,
.twofactor-uri-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.twofactor-secret {
    display: block;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: .92rem;
    line-height: 1.5;
    letter-spacing: .035em;
}
.twofactor-uri-details {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,.58);
    padding: 12px 14px;
}
.twofactor-uri-details summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text);
}
.twofactor-uri-details p {
    margin: 8px 0 10px;
    font-size: .9rem;
}
.twofactor-uri {
    display: block;
    min-width: 0;
    max-height: 110px;
    overflow: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: .78rem;
    line-height: 1.45;
}
.twofactor-copy-feedback {
    display: block;
    min-height: 0;
    margin-top: 6px;
    font-size: .82rem;
}
.twofactor-code-input {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .35em;
    padding-left: calc(14px + .35em);
}

@media (max-width: 720px) {
    body { font-size: 15px; }
    .guest-body {
        display: block;
        padding: 12px;
    }
    .guest-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    .login-card {
        padding: 20px 16px;
        gap: 16px;
        border-radius: 18px;
    }
    .twofactor-secret-row,
    .twofactor-uri-row {
        grid-template-columns: 1fr;
    }
    .twofactor-copy-btn { width: 100%; }

    .sidebar { padding: 14px; }
    .sidebar-stack { gap: 14px; }
    .nav-menu {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 8px;
    }
    .nav-link {
        padding: 11px 12px;
        font-size: .92rem;
        text-align: center;
    }
    .main-content { padding: 14px; }
    .page-header,
    .section-heading,
    .report-cover {
        flex-direction: column;
        align-items: stretch;
    }
    .panel-card { padding: 16px; border-radius: 18px; }
    .stat-card { padding: 14px 15px; }
    .stats-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 10px;
    }
    .stat-card strong { font-size: 1.4rem; }
    .actions-row {
        flex-wrap: wrap;
        width: 100%;
    }
    .actions-row > .btn,
    .actions-row > button,
    .actions-row > a.btn {
        flex: 1 1 140px;
    }
    .project-title-with-logo,
    .report-brand-block {
        flex-direction: column;
    }
    .project-url-list { flex-direction: column; gap: 4px; }
    .form-grid,
    .compact-grid,
    .filter-bar,
    .compact-filter-form {
        grid-template-columns: 1fr !important;
    }
    .chart-card { min-height: 280px; }
    .chart-frame { height: 230px; }
    .wide-table { min-width: 1250px; }
}

@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card span { font-size: .84rem; }
    .stat-card strong { font-size: 1.25rem; }
    .nav-menu { grid-template-columns: 1fr; }
    .twofactor-code-input { font-size: 1.15rem; }
}

/* v4.9.0 - diagnóstico del tracker por web */
.tracker-health-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 10px 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,.55);
    font-size: .86rem;
    overflow-wrap: anywhere;
}
@media (max-width: 720px) {
    .tracker-health-row { display: grid; grid-template-columns: 1fr; gap: 6px; }
}


/* v4.9.1 - alta de 2FA por QR local */
.twofactor-qr-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:24px; align-items:center; padding:20px; margin:18px 0; border:1px solid var(--border); border-radius:20px; background:#fff; }
.twofactor-qr-card h2 { margin:4px 0 8px; font-size:1.18rem; }
.twofactor-qr-card p { margin:0; color:var(--muted); line-height:1.55; }
.totp-qr { width:240px; min-width:240px; min-height:240px; display:grid; place-items:center; padding:8px; border:1px solid var(--border); border-radius:16px; background:#fff; overflow:hidden; }
.totp-qr svg { display:block; width:100%; height:auto; }
.twofactor-manual-intro { margin:18px 0 10px; color:var(--muted); }
.looker-csv-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.looker-csv-note { padding:12px 14px; border-radius:14px; background:rgba(15,118,110,.08); border:1px solid rgba(15,118,110,.16); }
@media (max-width: 700px) { .twofactor-qr-card { grid-template-columns:1fr; } .totp-qr { width:min(240px,100%); min-width:0; margin:0 auto; } .looker-csv-actions .btn { width:100%; justify-content:center; } }

/* v4.9.3 - rebranding Trackly y simplificación visual */
.brand-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.brand-logo {
    display: block;
    width: 138px;
    max-width: 100%;
    height: auto;
}
.brand-wordmark {
    font-size: 0;
}
.guest-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 10px 4px;
    color: var(--text);
}
.guest-brand-logo {
    width: 148px;
    max-width: 55vw;
    height: auto;
    display: block;
}
.guest-brand strong {
    display: block;
    font-size: 1.05rem;
}
.guest-brand span {
    display: block;
    font-size: .92rem;
    color: var(--muted);
}
.report-cover-enhanced {
    gap: 24px;
}
.report-platform-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.report-platform-brand img {
    width: 108px;
    height: auto;
    display: block;
}
.report-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.report-meta-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255,255,255,.68);
}
.report-meta-card span {
    display: block;
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: 4px;
}
.report-meta-card strong {
    display: block;
    font-size: .96rem;
    overflow-wrap: anywhere;
}
.report-summary-text {
    margin-top: 16px;
}
.report-limit-note,
.table-limit-note {
    margin-top: 10px;
    font-size: .88rem;
    color: var(--muted);
}
.load-more-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}
.module-note {
    margin: 6px 0 0;
    font-size: .85rem;
    color: var(--muted);
}
.module-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,.55);
    padding: 14px 16px;
}
.module-card .checkbox-row {
    margin-bottom: 0;
}
.module-section {
    padding-top: 2px;
}
.module-section[hidden] {
    display: none !important;
}
.simple-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}
.simple-kpi {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    background: rgba(255,255,255,.72);
}
.simple-kpi span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .9rem;
}
.simple-kpi strong {
    display: block;
    font-size: 1.55rem;
}
.report-chart-grid .chart-card {
    min-height: 330px;
}
.report-chart-grid .chart-frame {
    height: 265px;
}
.inline-muted {
    color: var(--muted);
    font-size: .9rem;
}

/* Ajuste QR: texto arriba y QR debajo */
.twofactor-qr-card {
    grid-template-columns: 1fr;
    justify-items: start;
    align-items: start;
}
.totp-qr {
    margin-top: 6px;
}
.twofactor-qr-copy {
    max-width: 620px;
}

@media (max-width: 720px) {
    .brand-logo { width: 120px; }
    .guest-brand { align-items: flex-start; }
    .guest-brand-logo { width: 128px; }
    .report-chart-grid .chart-card { min-height: 300px; }
    .report-chart-grid .chart-frame { height: 235px; }
    .simple-kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* v4.9.5 - logos resilientes */
.project-logo-fallback,
.report-logo-fallback {
    display: grid;
    place-items: center;
    background: rgba(15,118,110,.10);
    color: #0f766e;
    font-weight: 800;
    letter-spacing: .03em;
    border: 1px solid rgba(15,118,110,.18);
}
.project-logo-fallback {
    min-width: 56px;
    min-height: 56px;
    border-radius: 14px;
}
.report-logo-fallback {
    width: 86px;
    height: 64px;
    border-radius: 12px;
    font-size: 1.15rem;
}

/* v4.9.6 - graficas sin dependencia externa */
.chart-frame canvas.chart-canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.dashboard-chart-grid,
.report-chart-grid {
    align-items: stretch;
}
.chart-card-wide {
    grid-column: span 2;
}
@media (min-width: 1240px) {
    .dashboard-chart-grid .chart-card-wide,
    .report-chart-grid .chart-card-wide {
        grid-column: span 2;
    }
}
@media (max-width: 900px) {
    .chart-card-wide {
        grid-column: auto;
    }
}

/* v4.9.8 - mayor espacio inferior para etiquetas de gráficas */
.dashboard-chart-grid .chart-frame,
.report-chart-grid .chart-frame {
    height: 290px;
}
@media (max-width: 720px) {
    .dashboard-chart-grid .chart-frame,
    .report-chart-grid .chart-frame {
        height: 270px;
    }
}
