:root {
    --bg: #f4f1ea;
    --surface: #fffdf8;
    --surface-alt: #f1ebe0;
    --text: #1f2937;
    --muted: #64748b;
    --line: #ddd1bc;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --danger: #b42318;
    --success: #0f766e;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

button,
input,
select,
textarea {
    font: inherit;
}

form {
    margin: 0;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 30%),
        linear-gradient(180deg, #f7f3ec 0%, #efe7da 100%);
    color: var(--text);
    overflow-x: hidden;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
}

.sidebar {
    padding: 28px;
    background: rgba(20, 30, 47, 0.95);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-title {
    margin: 14px 0 0;
    font-size: 1.5rem;
}

.nav-links {
    display: grid;
    gap: 10px;
}

.nav-links a {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.content-shell {
    padding: 28px;
    min-width: 0;
    overflow-x: hidden;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.35;
}

.breadcrumbs a,
.breadcrumbs span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.16s ease;
}

.breadcrumbs a:hover {
    color: var(--brand-dark);
}

.breadcrumbs a::after {
    content: "/";
    color: rgba(100, 116, 139, 0.7);
}

.breadcrumbs span[aria-current="page"] {
    color: var(--brand-dark);
    font-weight: 700;
}

.guest-breadcrumb-shell {
    padding: 18px 24px 0;
}

.page-title {
    margin: 0;
    font-size: 2rem;
    line-height: 1.08;
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.user-badge {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--line);
}

.button-full {
    width: 100%;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 460px);
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid rgba(221, 209, 188, 0.8);
    border-radius: 28px;
    padding: 34px;
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 14px 0 10px;
    font-size: 2.3rem;
}

.login-card p {
    color: var(--muted);
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card,
.panel-card {
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid rgba(221, 209, 188, 0.8);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.stat-card {
    display: grid;
    gap: 12px;
}

.stat-card .stat-value {
    font-size: 2.1rem;
    font-weight: 700;
}

.stat-card .eyebrow {
    width: fit-content;
    font-size: 0.82rem;
    line-height: 1;
}

.stat-card small {
    color: var(--muted);
    line-height: 1.5;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.filter-panel {
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.report-detail-stack {
    display: grid;
    gap: 34px;
}

.report-detail-stack > .panel-grid,
.report-detail-stack > .panel-card {
    margin: 0;
}

.report-admin-shell {
    border: 1px solid rgba(221, 209, 188, 0.82);
    border-radius: 28px;
    background: rgba(255, 252, 246, 0.78);
    overflow: hidden;
}

.report-admin-shell + .panel-card,
.report-admin-shell + .panel-grid,
.report-admin-shell + .report-story-section,
.report-admin-shell + .report-visual-section {
    margin-top: 4px;
}

.report-admin-toggle {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 24px;
    cursor: pointer;
    color: var(--brand-dark);
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.report-admin-toggle::-webkit-details-marker {
    display: none;
}

.report-admin-toggle::after {
    content: "+";
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--brand-dark);
    font-size: 1.25rem;
    line-height: 1;
}

.report-admin-shell[open] .report-admin-toggle::after {
    content: "−";
}

.report-admin-body {
    display: grid;
    gap: 24px;
    padding: 0 24px 24px;
}

.report-story-section {
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 36%),
        rgba(255, 252, 246, 0.9);
}

.report-story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.report-story-card {
    padding: 22px;
    border-radius: 22px;
    border: 1px solid rgba(221, 209, 188, 0.82);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.report-story-card h3 {
    margin: 0 0 12px;
    color: var(--brand-dark);
    font-size: 1rem;
}

.report-story-card p {
    margin: 0;
    color: #334155;
    line-height: 1.7;
}

.report-metric-section {
    background:
        radial-gradient(circle at top right, rgba(29, 78, 216, 0.08), transparent 36%),
        rgba(255, 252, 246, 0.9);
}

.report-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.report-metric-card {
    padding: 22px;
    border-radius: 22px;
    border: 1px solid rgba(221, 209, 188, 0.82);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.report-metric-card h3 {
    margin: 0 0 14px;
    color: var(--brand-dark);
    font-size: 1rem;
}

.report-metric-list {
    display: grid;
    gap: 10px;
}

.report-metric-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(250, 245, 235, 0.78);
    border: 1px solid rgba(221, 209, 188, 0.72);
}

.report-metric-item span {
    color: #475569;
    font-size: 0.92rem;
}

.report-metric-item strong {
    color: var(--brand-dark);
    font-size: 1rem;
    line-height: 1;
    white-space: nowrap;
}

.simple-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: grid;
    gap: 16px;
}

.simple-list li {
    display: grid;
    gap: 10px;
    padding: 18px 20px;
    border: 1px solid rgba(221, 209, 188, 0.82);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 34%),
        rgba(255, 253, 248, 0.76);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.page-actions > *,
.actions-inline > *,
.wizard-actions > * {
    flex: 0 0 auto;
}

.form-stack {
    display: grid;
    gap: 24px;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 16px;
    border: 1px solid rgba(221, 209, 188, 0.8);
    border-radius: 20px;
    background: rgba(255, 253, 248, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table thead {
    background: rgba(241, 235, 224, 0.88);
}

.data-table th,
.data-table td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--brand-dark);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.data-table td {
    color: var(--text);
}

.data-table tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.38);
}

.data-table tbody tr:hover {
    background: rgba(15, 118, 110, 0.05);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-title-cell {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.table-title-cell strong {
    font-size: 0.98rem;
    line-height: 1.35;
}

.table-title-cell small {
    color: var(--muted);
    line-height: 1.45;
}

.table-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    min-width: max-content;
}

.table-actions .inline-form {
    flex: 0 0 auto;
}

.table-actions .button-small,
.table-actions > a {
    flex: 0 0 auto;
    white-space: nowrap;
}

.data-table td.actions-cell {
    width: 1%;
    white-space: nowrap;
}

.data-table td > a:not(.button-primary):not(.button-secondary):not(.button-danger),
.table-actions > a:not(.button-primary):not(.button-secondary):not(.button-danger),
.actions-inline > a:not(.button-primary):not(.button-secondary):not(.button-danger) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    text-decoration: none;
}

.report-visual-section {
    margin-bottom: 24px;
}

.visual-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.visual-kpi-card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(221, 209, 188, 0.86);
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.15), transparent 38%),
        rgba(250, 245, 235, 0.74);
}

.visual-kpi-card span,
.visual-kpi-card small {
    display: block;
    color: var(--muted);
}

.visual-kpi-card span {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    font-weight: 800;
}

.visual-kpi-card strong {
    display: block;
    margin: 10px 0 6px;
    color: var(--chart-brand-dark, var(--brand-dark));
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    line-height: 1;
}

.kpi-trend {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-bottom: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.kpi-trend-verde {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d !important;
}

.kpi-trend-amarillo {
    background: rgba(202, 138, 4, 0.14);
    color: #a16207 !important;
}

.kpi-trend-rojo {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c !important;
}

.kpi-trend-gris {
    background: rgba(100, 116, 139, 0.14);
    color: #475569 !important;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.chart-grid-rich {
    align-items: stretch;
}

.chart-card {
    min-width: 0;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(221, 209, 188, 0.86);
    background:
        linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(246, 241, 232, 0.86)),
        #fffdfa;
}

.chart-card-glass {
    position: relative;
    overflow: hidden;
}

.chart-card-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 34%);
    pointer-events: none;
}

.chart-card-wide {
    grid-column: span 2;
}

.chart-card h3 {
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.visual-kpi-grid-premium {
    margin-bottom: 10px;
}

.visual-kpi-card-premium {
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.18), transparent 36%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(246, 241, 232, 0.86));
    border-color: rgba(208, 195, 173, 0.88);
}

.report-interactive-grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.report-visual-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.report-visual-panel {
    min-width: 0;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(221, 209, 188, 0.82);
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.11), transparent 36%),
        linear-gradient(145deg, rgba(255, 253, 248, 0.99), rgba(246, 241, 232, 0.90));
    box-shadow: var(--shadow);
}

.report-visual-panel-chart {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.report-visual-panel-wide {
    grid-column: 1 / -1;
}

.report-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.report-panel-head h3 {
    margin: 4px 0 0;
}

.report-chart-frame {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.report-chart-fallback {
    display: block;
}

.report-chart-frame-bar {
    height: 280px;
    max-height: 280px;
}

.report-chart-frame-doughnut {
    height: 250px;
    max-height: 250px;
}

.report-chart-canvas {
    display: none;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    flex: 0 0 auto;
    align-self: stretch;
}

.report-visual-panel.is-enhanced .report-chart-fallback {
    display: none;
}

.report-visual-panel.is-enhanced .report-chart-canvas {
    display: block;
}

.report-map-shell {
    position: relative;
    min-height: 320px;
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(15, 118, 110, 0.12), transparent 35%),
        linear-gradient(145deg, rgba(240, 247, 245, 0.96), rgba(245, 239, 229, 0.94));
    border: 1px solid rgba(221, 209, 188, 0.74);
}

.report-map-fallback {
    padding: 22px;
}

.report-live-map {
    display: none;
    width: 100%;
    height: 320px;
}

.report-map-shell.is-enhanced .report-map-fallback {
    display: none;
}

.report-map-shell.is-enhanced .report-live-map {
    display: block;
}

.report-live-map .leaflet-control-attribution {
    font-size: 0.72rem;
}

.report-live-map .leaflet-popup-content-wrapper {
    border-radius: 14px;
}

.report-leaflet-marker {
    background: transparent;
    border: 0;
}

.report-leaflet-marker__rank {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #1f2937;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.92);
}

.report-leaflet-marker__tag {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--chart-brand, var(--brand)) 0%, var(--chart-brand-dark, var(--brand-dark)) 100%);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.24);
}

.report-map-svg {
    display: block;
    width: 100%;
    height: 320px;
}

.report-map-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.report-map-legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(221, 209, 188, 0.82);
    background: rgba(255, 255, 255, 0.76);
    min-width: 0;
}

.report-map-legend-item strong,
.report-map-legend-item small {
    display: block;
}

.report-map-legend-item strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-map-legend-item small {
    color: var(--muted);
    margin-top: 2px;
}

.report-map-legend-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    flex: 0 0 32px;
}

.report-post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 18px;
}

.report-post-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.report-post-compare-column {
    display: grid;
    gap: 14px;
    align-content: start;
}

.report-compare-column-title {
    margin: 0;
    font-size: 0.98rem;
    color: var(--brand-dark);
    letter-spacing: 0.02em;
}

.report-post-card {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(221, 209, 188, 0.86);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 16px 26px rgba(15, 23, 42, 0.08);
    display: grid;
    grid-template-rows: auto 1fr;
}

.report-post-thumb {
    position: relative;
    aspect-ratio: 4 / 5;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.10), transparent 35%),
        #f4ede2;
    padding: 12px;
}

.report-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 16px;
    background: #fff;
}

.report-post-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.report-post-body {
    padding: 16px;
    display: grid;
    gap: 14px;
    align-content: start;
}

.report-post-body h4 {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.35;
    min-height: 2.8em;
}

.report-post-copy {
    margin: -4px 0 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.report-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.report-post-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.report-post-chip-muted {
    background: rgba(31, 41, 55, 0.08);
    color: #334155;
}

.report-post-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.report-post-metrics div {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(221, 209, 188, 0.78);
    border-radius: 14px;
    background: rgba(250, 245, 235, 0.72);
}

.report-post-metrics div:first-child {
    border-top: 1px solid rgba(221, 209, 188, 0.78);
}

.report-post-metrics span {
    color: var(--muted);
    font-size: 0.8rem;
}

.report-post-metrics strong {
    font-size: 1.05rem;
    line-height: 1.1;
}

.report-post-footer {
    margin-top: auto;
}

.report-tag-cloud-premium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.report-tag-chip-premium {
    min-width: 0;
    padding: 14px 18px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 55%),
        rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.report-tag-chip-premium strong,
.report-tag-chip-premium span {
    display: block;
}

.report-tag-chip-premium span {
    color: var(--muted);
    margin-top: 4px;
}

.visual-bar-list {
    display: grid;
    gap: 14px;
}

.visual-bar-row {
    display: grid;
    gap: 8px;
}

.visual-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.visual-bar-head strong {
    min-width: 0;
    font-size: 0.95rem;
    line-height: 1.35;
}

.visual-bar-head span {
    color: var(--brand-dark);
    font-weight: 800;
    white-space: nowrap;
}

.visual-bar-track {
    position: relative;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(221, 209, 188, 0.7);
}

.visual-bar-fill {
    height: 100%;
    border-radius: 999px;
    background:
        linear-gradient(90deg, var(--chart-brand-dark, var(--brand-dark)) 0%, var(--chart-brand, var(--brand)) 60%, rgba(15, 118, 110, 0.55) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.column-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
    gap: 14px;
    align-items: end;
    min-height: 280px;
    position: relative;
    z-index: 1;
}

.column-chart-item {
    display: grid;
    gap: 10px;
    align-items: end;
    justify-items: center;
}

.column-chart-value {
    font-weight: 800;
    color: var(--brand-dark);
    font-size: 0.92rem;
}

.column-chart-bar-wrap {
    display: flex;
    align-items: flex-end;
    width: 100%;
    height: 190px;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(222, 212, 194, 0.32));
}

.column-chart-bar {
    width: 100%;
    border-radius: 16px 16px 10px 10px;
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.88), rgba(31, 41, 55, 0.88));
    box-shadow: 0 14px 24px rgba(15, 118, 110, 0.18);
}

.column-chart-item strong {
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.3;
}

.donut-card-shell {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.donut-chart {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--donut-fill);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.donut-chart::after {
    content: "";
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: rgba(255, 253, 248, 0.96);
    box-shadow: inset 0 0 0 1px rgba(221, 209, 188, 0.8);
}

.donut-chart-center {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    text-align: center;
}

.donut-chart-center strong {
    display: block;
    font-size: 1.4rem;
    color: var(--brand-dark);
}

.donut-chart-center span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.donut-legend {
    display: grid;
    gap: 10px;
}

.donut-legend-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(221, 209, 188, 0.74);
}

.donut-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-top: 4px;
    flex: 0 0 12px;
}

.donut-legend-item strong,
.donut-legend-item small {
    display: block;
}

.donut-legend-item small {
    color: var(--muted);
    margin-top: 2px;
}

.geo-tile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    position: relative;
    z-index: 1;
}

.geo-tile {
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(15, 118, 110, var(--geo-alpha, 0.3)), rgba(15, 23, 42, calc(var(--geo-alpha, 0.3) * 0.72)));
    color: #fff;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.geo-tile strong {
    font-size: 1.02rem;
    line-height: 1.3;
}

.geo-tile span {
    font-size: 1.3rem;
    font-weight: 800;
}

.post-showcase {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
}

.post-showcase-card {
    position: relative;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(221, 209, 188, 0.86);
    background:
        radial-gradient(circle at top right, rgba(29, 78, 216, 0.12), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(246, 241, 232, 0.92));
}

.post-rank {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--brand-dark);
    font-size: 0.82rem;
    font-weight: 800;
}

.post-showcase-card h4 {
    margin: 14px 0 16px;
    font-size: 1.08rem;
    line-height: 1.35;
}

.post-metrics-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid rgba(221, 209, 188, 0.72);
}

.post-metrics-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.post-showcase-card small {
    display: inline-block;
    margin-top: 14px;
    color: var(--muted);
}

.hashtag-cluster {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    position: relative;
    z-index: 1;
}

.hashtag-node {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 16px 18px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 55%),
        rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(221, 209, 188, 0.86);
}

.hashtag-node strong {
    font-size: 0.95rem;
    color: var(--brand-dark);
    line-height: 1.35;
}

.hashtag-node span {
    font-size: 0.82rem;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--brand-dark);
    font-size: 0.85rem;
    font-weight: 700;
}

.actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.wizard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.table-client {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-client-logo,
.table-client-fallback {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    flex: 0 0 44px;
}

.table-client-logo {
    object-fit: cover;
    border: 1px solid rgba(221, 209, 188, 0.9);
    background: #fff;
}

.table-client-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.12);
    color: var(--brand-dark);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.csv-guide {
    margin: 12px 0 18px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px dashed rgba(15, 118, 110, 0.28);
    background: rgba(15, 118, 110, 0.05);
}

.csv-guide p {
    margin: 0 0 10px;
}

.csv-guide p:last-child {
    margin-bottom: 0;
}

.csv-guide code,
.muted-text code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.csv-sample {
    display: block;
    max-width: 100%;
    margin: 8px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(221, 209, 188, 0.9);
    font-size: 0.92rem;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.csv-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 14px;
}

.csv-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--brand-dark);
    font-size: 0.9rem;
    font-weight: 700;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.bulk-account-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.bulk-account-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 253, 248, 0.72);
}

.bulk-account-item input {
    width: auto;
    margin-top: 4px;
}

.bulk-account-item strong,
.bulk-account-item small {
    display: block;
}

.bulk-account-item small {
    color: var(--muted);
    margin-top: 4px;
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: auto;
    max-width: 100%;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: auto;
    max-width: 100%;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid rgba(180, 35, 24, 0.22);
    background: rgba(180, 35, 24, 0.08);
    color: var(--danger);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.button-small {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.9rem;
}

.button-meta-review {
    min-height: 40px;
    padding: 0 16px;
    font-size: 0.8rem;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    flex: 0 0 auto;
    max-width: 100%;
}

.report-cover {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: flex-start;
}

.report-cover-branded {
    border-top: 0;
}

.report-hero-visual {
    display: grid;
    gap: 24px;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 36%),
        linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(250, 244, 233, 0.92));
}

.report-hero-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.report-hero-panel {
    min-height: 100%;
    padding: 22px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(221, 209, 188, 0.92);
    box-shadow: 0 18px 38px rgba(31, 41, 55, 0.08);
}

.report-operational-section {
    gap: 1.5rem;
}

.report-operational-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.report-operational-card {
    padding: 1.25rem;
    border-radius: 24px;
    border: 1px solid rgba(205, 191, 168, 0.72);
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.report-operational-card h3 {
    margin: 0 0 1rem;
}

.report-cover-side {
    display: grid;
    gap: 18px;
}

.report-brand-card,
.public-brand-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(250, 245, 235, 0.92);
    border: 1px solid var(--line);
}

.report-brand-card strong,
.public-brand-card strong {
    display: block;
    color: var(--brand-dark);
}

.report-brand-card small,
.public-brand-card small {
    color: var(--muted);
}

.report-brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(221, 209, 188, 0.8);
    padding: 6px;
}

.report-brand-placeholder {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--report-brand, var(--brand)) 0%, var(--report-brand-dark, var(--brand-dark)) 100%);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.comparison-panel {
    display: grid;
    gap: 18px;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.comparison-reference {
    min-width: 220px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(250, 245, 235, 0.92);
    border: 1px solid var(--line);
    display: grid;
    gap: 6px;
}

.metrics-copy-reference {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.metrics-copy-reference p,
.metrics-copy-reference small {
    margin: 0;
}

.metrics-sync-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.metrics-sync-card {
    min-height: 100%;
}

.metrics-result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.metrics-result-card {
    min-height: 100%;
}

.csv-chip-soft {
    background: rgba(61, 86, 116, 0.08);
    color: var(--ink-soft);
}

.metrics-pending-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 6px;
}

.metrics-advanced-shell {
    display: grid;
    gap: 18px;
}

.metrics-advanced-shell[open] {
    padding-top: 8px;
}

.metrics-advanced-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-radius: 22px;
    border: 1px solid rgba(221, 209, 188, 0.8);
    background: rgba(255, 253, 248, 0.94);
    box-shadow: var(--shadow);
}

.metrics-advanced-summary::-webkit-details-marker {
    display: none;
}

.metrics-advanced-summary h2,
.metrics-advanced-summary p {
    margin: 0;
}

.metrics-advanced-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--brand-dark);
    font-weight: 700;
    white-space: nowrap;
}

.metrics-advanced-shell[open] .metrics-advanced-toggle::after {
    content: " activo";
}

.comparison-reference span,
.comparison-card span {
    font-size: 0.8rem;
    color: var(--muted);
}

.comparison-reference strong,
.comparison-card strong {
    font-size: 1.3rem;
    color: var(--brand-dark);
}

.comparison-reference small,
.comparison-card small {
    color: var(--muted);
}

.comparison-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.comparison-card,
.nested-card {
    background: rgba(250, 245, 235, 0.92);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
}

.comparison-card {
    display: grid;
    gap: 8px;
}

.comparison-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.dashboard-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-grid-uneven {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
}

.dashboard-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: var(--brand-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.dashboard-bars {
    display: grid;
    gap: 16px;
    margin-top: 10px;
}

.dashboard-bar-row {
    display: grid;
    gap: 8px;
}

.dashboard-bar-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.dashboard-bar-topline span {
    color: var(--muted);
}

.dashboard-bar-track,
.progress-inline-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(221, 209, 188, 0.7);
    overflow: hidden;
}

.dashboard-bar-fill,
.progress-inline-fill {
    height: 100%;
    border-radius: 999px;
}

.dashboard-bar-verde {
    background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
}

.dashboard-bar-amarillo {
    background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%);
}

.dashboard-bar-gris {
    background: linear-gradient(90deg, #64748b 0%, #94a3b8 100%);
}

.dashboard-bar-brand,
.progress-inline-fill {
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dark) 100%);
}

.progress-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.progress-inline span {
    color: var(--muted);
    white-space: nowrap;
}

.metrics-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.metrics-page-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

#metrics-form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#metrics-form > .panel-card,
.metrics-page-shell > .panel-card {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

#metrics-form,
#metrics-form > section,
.metrics-hero > *,
.section-head > *,
.editor-head > *,
.field-grid > label,
.field-grid > div {
    min-width: 0;
}

.section-head,
.editor-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.integrations-head {
    flex-wrap: wrap;
    align-items: center;
}

.integrations-head .page-actions {
    margin-bottom: 0;
    flex: 0 0 auto;
}

.metrics-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.metrics-editor-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metrics-editor-card {
    background: rgba(250, 245, 235, 0.92);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    min-width: 0;
    overflow-x: clip;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    margin-top: 16px;
    -webkit-overflow-scrolling: touch;
}

.repeater-table {
    min-width: max-content;
}

#metrics-form .panel-card,
#metrics-form .metrics-editor-card,
#metrics-form .table-wrap {
    max-width: 100%;
}

.repeater-table input {
    min-width: 120px;
    padding: 11px 12px;
    border-radius: 12px;
}

.repeater-table td:last-child,
.repeater-table th:last-child {
    width: 1%;
    white-space: nowrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.inline-form {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.top-gap {
    margin-top: 14px;
}

.muted-text {
    color: var(--muted);
}

.helper-card {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.1), transparent 48%),
        rgba(248, 252, 251, 0.92);
}

.helper-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.badge-verde {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.badge-borrador {
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
}

.badge-en_revision {
    background: rgba(217, 119, 6, 0.14);
    color: #b45309;
}

.badge-publicado {
    background: rgba(22, 163, 74, 0.14);
    color: #15803d;
}

.badge-archivado {
    background: rgba(31, 41, 55, 0.12);
    color: #334155;
}

.badge-activo,
.badge-activa {
    background: rgba(22, 163, 74, 0.14);
    color: #15803d;
}

.badge-inactivo,
.badge-inactiva {
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
}

.badge-amarillo {
    background: rgba(202, 138, 4, 0.14);
    color: #a16207;
}

.badge-rojo {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.badge-gris {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
}

a {
    color: inherit;
    text-decoration: none;
}

.metrics-page-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.metrics-page-shell .panel-card,
#metrics-form,
#metrics-form > section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.metrics-page-shell .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.metrics-page-shell .repeater-table {
    width: max-content;
    min-width: 100%;
}

.metrics-page-shell p,
.metrics-page-shell code,
.metrics-page-shell span,
.metrics-page-shell strong {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.guest-shell,
.error-shell {
    min-height: 100vh;
    padding: 32px 20px;
}

.install-page {
    max-width: 1180px;
    margin: 0 auto;
}

.install-hero {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.public-report-shell {
    position: relative;
}

.public-report-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--public-brand, var(--brand)) 16%, transparent), transparent 34%),
        linear-gradient(180deg, #f7f3ec 0%, #efe7da 100%);
}

.public-report-hero .install-copy {
    border-top: 4px solid var(--public-brand, var(--brand));
}

.install-copy,
.install-status-card,
.install-card,
.error-card {
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid rgba(221, 209, 188, 0.8);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.install-copy {
    padding: 36px;
}

.install-copy h1,
.error-card h1 {
    margin: 12px 0 14px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
}

.install-copy p,
.install-card p,
.error-card p,
.status-list span {
    color: var(--muted);
    line-height: 1.6;
}

.eyebrow {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--brand-dark);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.install-status-card,
.install-card,
.error-card {
    padding: 28px;
}

.status-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.status-list li {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    display: grid;
    gap: 4px;
}

.status-list li.ok {
    border-color: rgba(15, 118, 110, 0.28);
    background: rgba(15, 118, 110, 0.08);
}

.status-list li.fail {
    border-color: rgba(180, 35, 24, 0.22);
    background: rgba(180, 35, 24, 0.06);
}

.install-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.install-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

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

.filter-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) repeat(4, minmax(130px, 0.8fr)) auto;
    gap: 10px;
    align-items: end;
    width: 100%;
}

.filter-toolbar-reports {
    grid-template-columns: minmax(280px, 1.65fr) repeat(4, minmax(130px, 0.72fr)) auto;
}

.filter-toolbar-accounts {
    grid-template-columns: minmax(300px, 1.7fr) repeat(3, minmax(145px, 0.82fr)) auto;
}

.filter-toolbar-integrations {
    grid-template-columns: minmax(340px, 1.85fr) repeat(2, minmax(150px, 0.82fr)) auto;
}

.filter-toolbar-clients {
    grid-template-columns: minmax(360px, 1.9fr) minmax(160px, 0.8fr) auto;
}

.filter-toolbar > label {
    min-width: 0;
    gap: 4px;
    font-size: 0.9rem;
    margin: 0;
}

.filter-toolbar > label > span {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.filter-toolbar input,
.filter-toolbar select {
    min-height: 38px;
    height: 38px;
    padding: 8px 12px;
    border-radius: 11px;
    font-size: 0.9rem;
}

.filter-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
    margin: 0;
    white-space: nowrap;
}

.filter-toolbar-actions .button-primary,
.filter-toolbar-actions .button-secondary {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.84rem;
}

.filter-toolbar > label:first-child {
    grid-column: span 2;
}

.filter-toolbar-accounts > label:first-child,
.filter-toolbar-integrations > label:first-child,
.filter-toolbar-clients > label:first-child {
    grid-column: auto;
}

.panel-card > .filter-toolbar {
    margin-top: 8px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 15px;
    font: inherit;
    background: #fff;
    color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgba(15, 118, 110, 0.2);
    border-color: var(--brand);
}

.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: auto;
    max-width: 100%;
    padding: 0 22px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.button-primary:hover,
.button-secondary:hover,
.button-danger:hover {
    transform: translateY(-1px);
}

.button-primary:hover {
    box-shadow: 0 16px 28px rgba(15, 118, 110, 0.22);
    filter: saturate(1.04);
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 118, 110, 0.28);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.button-danger:hover {
    border-color: rgba(180, 35, 24, 0.3);
    background: rgba(180, 35, 24, 0.12);
    box-shadow: 0 10px 20px rgba(180, 35, 24, 0.12);
}

.button-primary:focus-visible,
.button-secondary:focus-visible,
.button-danger:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.18);
    outline-offset: 2px;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid;
}

.alert-error {
    background: rgba(180, 35, 24, 0.08);
    border-color: rgba(180, 35, 24, 0.18);
    color: var(--danger);
}

.alert-success {
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.18);
    color: var(--success);
}

.error-card {
    max-width: 720px;
    margin: 9vh auto 0;
}

.error-debug {
    overflow: auto;
    padding: 16px;
    border-radius: 16px;
    background: #1f2937;
    color: #f8fafc;
}

.legal-page {
    max-width: 980px;
    margin: 0 auto;
}

.legal-card {
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid rgba(221, 209, 188, 0.8);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.legal-card h1 {
    margin: 12px 0 18px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.legal-card h2 {
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.legal-card p {
    color: var(--text);
    line-height: 1.7;
}

@media (max-width: 900px) {
    .app-shell,
    .install-hero,
    .install-grid,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .filter-toolbar {
        grid-template-columns: 1fr;
    }

    .filter-toolbar > label:first-child {
        grid-column: auto;
    }

    .filter-toolbar-actions {
        justify-self: stretch;
        width: 100%;
    }

    .filter-toolbar-actions .button-primary,
    .filter-toolbar-actions .button-secondary {
        flex: 1 1 0;
    }

    .integrations-head .page-actions {
        width: 100%;
    }

    .button-meta-review {
        width: 100%;
        justify-content: center;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .install-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid,
    .dashboard-stats-grid,
    .panel-grid,
    .chart-grid,
    .report-cover,
    .comparison-strip,
    .metrics-editor-grid,
    .report-detail-stack,
    .dashboard-grid-uneven {
        grid-template-columns: 1fr;
    }

    .page-actions,
    .actions-inline,
    .report-cover,
    .inline-form,
    .comparison-header,
    .metrics-copy-reference,
    .metrics-advanced-summary,
    .metrics-hero,
    .section-head,
    .editor-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .visual-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-card-wide {
        grid-column: auto;
    }

    .report-interactive-grid,
    .report-hero-grid,
    .report-operational-grid,
    .report-metric-grid,
    .report-story-grid,
    .report-visual-row,
    .report-post-compare-grid,
    .donut-card-shell,
    .post-showcase {
        grid-template-columns: 1fr;
    }

    .report-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-tag-cloud-premium,
    .hashtag-cluster {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metrics-sync-grid {
        grid-template-columns: 1fr;
    }

    .metrics-result-grid {
        grid-template-columns: 1fr;
    }

    .report-admin-body {
        padding: 0 18px 18px;
    }

    .report-chart-frame-bar {
        height: 250px;
        max-height: 250px;
    }

    .report-chart-frame-doughnut {
        height: 230px;
        max-height: 230px;
    }
}

@media (max-width: 560px) {
    .visual-kpi-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        padding: 14px;
    }

    .column-chart {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-height: auto;
    }

    .column-chart-bar-wrap {
        height: 140px;
    }

    .donut-card-shell {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .geo-tile-grid {
        grid-template-columns: 1fr;
    }

    .report-post-metrics {
        grid-template-columns: 1fr;
    }

    .report-map-legend {
        grid-template-columns: 1fr;
    }

    .report-map-marker-card {
        min-width: 78px;
        padding: 8px 10px;
    }

    .report-chart-frame-bar {
        height: 240px;
        max-height: 240px;
    }

    .report-chart-frame-doughnut {
        height: 220px;
        max-height: 220px;
    }

    .report-post-grid {
        grid-template-columns: 1fr;
    }

    .report-tag-cloud-premium,
    .hashtag-cluster {
        grid-template-columns: 1fr;
    }
}
