:root {
    --app-bg: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #d9e0e7;
    --text: #111827;
    --muted: #667085;
    --sidebar: #ffffff;
    --sidebar-2: #eef4ff;
    --primary: #1769e0;
    --primary-soft: #e8f1ff;
    --success: #168a54;
    --success-soft: #e8f6ef;
    --warning: #b7791f;
    --danger: #c24135;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 8px 24px rgba(16, 24, 40, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

.app-layout {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 270px;
    min-height: 100vh;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    background: var(--sidebar);
    color: var(--text);
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 24px rgba(16, 24, 40, 0.04);
    transition: width 0.2s ease;
}

.sidebar.collapsed {
    width: 78px;
    padding-left: 12px;
    padding-right: 12px;
}

.sidebar-start-collapsed .sidebar {
    width: 78px;
    padding-left: 12px;
    padding-right: 12px;
}

.sidebar-top {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 26px;
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: #344054;
}

.sidebar-toggle:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: #bfd5ff;
}

.sidebar-brand {
    margin: 0 8px 26px;
    padding: 14px 12px;
    border-radius: 8px;
    background: var(--surface-muted);
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 800;
    text-align: left;
    letter-spacing: 0;
}

.sidebar-nav .nav-link {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #475467;
    font-weight: 650;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: var(--sidebar-2);
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-user {
    margin-top: auto;
    padding: 16px 8px 0;
    border-top: 1px solid var(--border);
}

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

.sidebar-logout {
    width: 100%;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: #344054;
    font-weight: 650;
}

.sidebar-logout:hover {
    background: #fff1f0;
    border-color: #ffccc7;
    color: var(--danger);
}

.sidebar.collapsed .link-text,
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-user .small,
.sidebar.collapsed .sidebar-user .fw-semibold {
    display: none;
}

.sidebar-start-collapsed .sidebar .link-text,
.sidebar-start-collapsed .sidebar .sidebar-brand,
.sidebar-start-collapsed .sidebar .sidebar-user .small,
.sidebar-start-collapsed .sidebar .sidebar-user .fw-semibold {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link,
.sidebar.collapsed .sidebar-logout {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar-start-collapsed .sidebar .sidebar-nav .nav-link,
.sidebar-start-collapsed .sidebar .sidebar-logout {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar.collapsed .sidebar-nav .nav-link[data-tooltip]:hover::after,
.sidebar.collapsed .sidebar-logout[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 88px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #111827;
    color: #fff;
    white-space: nowrap;
    z-index: 1000;
    font-size: 0.875rem;
    box-shadow: var(--shadow);
}

.sidebar-start-collapsed .sidebar .sidebar-nav .nav-link[data-tooltip]:hover::after,
.sidebar-start-collapsed .sidebar .sidebar-logout[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 88px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #111827;
    color: #fff;
    white-space: nowrap;
    z-index: 1000;
    font-size: 0.875rem;
    box-shadow: var(--shadow);
}

.app-main {
    flex: 1;
    min-width: 0;
    padding: 28px 32px 40px;
}

.page-shell {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

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

.page-kicker {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 2vw, 2.35rem);
    font-weight: 800;
    letter-spacing: 0;
    color: #0b1220;
}

.page-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

.status-pill {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #b7dfc9;
    border-radius: 999px;
    background: var(--success-soft);
    color: #10633d;
    font-weight: 600;
    font-size: 0.9rem;
}

.message-stack {
    max-width: 1280px;
    margin: 0 auto 22px;
    display: grid;
    gap: 10px;
}

.app-alert {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 48px 12px 14px;
    border-radius: 8px;
    border-width: 1px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.alert-icon {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
}

.upload-form {
    display: grid;
    gap: 18px;
}

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

.upload-card {
    min-height: 230px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.upload-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.upload-card h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 750;
}

.upload-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.upload-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    font-size: 1.25rem;
}

.upload-icon-blue {
    background: var(--primary-soft);
    color: var(--primary);
}

.upload-icon-green {
    background: var(--success-soft);
    color: var(--success);
}

.file-field {
    display: grid;
    gap: 8px;
}

.file-field span {
    color: #344054;
    font-size: 0.88rem;
    font-weight: 650;
}

.file-field .form-control {
    min-height: 44px;
    border-color: var(--border);
    border-radius: 8px;
}

.upload-hint {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.86rem;
}

.upload-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.toolbar-card {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.compact-toolbar .toolbar-form {
    flex: 1;
}

.compact-toolbar .filter-field {
    min-width: 260px;
}

.compact-toolbar .filter-field-small {
    min-width: 190px;
}

.toolbar-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-action {
    flex: 0 0 auto;
}

.rfm-filter-card {
    display: block;
}

.rfm-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) minmax(150px, 0.7fr) minmax(170px, 0.85fr) minmax(170px, 0.85fr) minmax(260px, 1.25fr) auto;
    align-items: end;
    gap: 14px;
    width: 100%;
}

.rfm-filter-form .filter-field {
    min-width: 0;
}

.filter-field-date {
    max-width: 210px;
}

.rfm-filter-submit {
    min-width: 170px;
    white-space: nowrap;
}

.inline-metric {
    min-width: 180px;
    padding: 12px 16px;
    border: 1px solid #b7dfc9;
    border-radius: 8px;
    background: var(--success-soft);
}

.inline-metric-group {
    margin-left: auto;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-metric span {
    display: block;
    color: #10633d;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.inline-metric strong {
    display: block;
    margin-top: 2px;
    color: #063f28;
    font-size: 1.45rem;
    line-height: 1.2;
}

.inline-metric small {
    display: block;
    margin-top: 2px;
    color: #3f6f59;
    font-size: 0.78rem;
    font-weight: 650;
}

.customers-filter-card {
    padding: 26px 28px;
    border: 1px solid #d9e3ee;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.customers-filter-form {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(190px, 0.75fr) minmax(190px, 0.75fr) auto;
    align-items: end;
    gap: 16px;
}

.customers-filter-form .filter-field {
    min-width: 0;
}

.customers-submit {
    min-width: 150px;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(23, 105, 224, 0.22);
}

.customers-filter-card .inline-metric-group {
    align-items: stretch;
}

.customers-filter-card .inline-metric {
    min-width: 190px;
    padding: 16px 18px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.filter-field {
    min-width: 320px;
    display: grid;
    gap: 8px;
}

.filter-field-small {
    min-width: 180px;
}

.filter-field span {
    color: #344054;
    font-size: 0.88rem;
    font-weight: 650;
}

.grid-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.metric-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

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

.metric-grid-1 {
    grid-template-columns: minmax(220px, 360px);
}

.metric-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
}

.metric-card strong {
    display: block;
    color: var(--text);
    font-size: 1.55rem;
    line-height: 1.2;
}

.grid-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.grid-card-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 750;
}

.grid-card-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.rfm-table-wrap {
    max-height: 620px;
}

.rfm-table {
    margin: 0;
    min-width: 1180px;
}

.rfm-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px 14px;
    background: var(--surface-muted);
    color: #344054;
    font-size: 0.78rem;
    font-weight: 750;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.rfm-table tbody td {
    padding: 12px 14px;
    color: #1f2937;
    border-color: #edf1f5;
    white-space: nowrap;
}

.rfm-table tbody tr:hover {
    background: #f8fbff;
}

.score-badge {
    min-width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 750;
    font-size: 0.82rem;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
}

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

.pagination-current {
    color: #344054;
    font-weight: 700;
    white-space: nowrap;
}

.btn {
    border-radius: 8px !important;
}

.card {
    border-color: var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow);
}

.card-graph {
    position: relative;
    overflow: hidden;
}

.card-graph::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
}

.card-graph.orange-bar::before {
    background-color: #f59f00;
}

.card-graph.gray-bar::before {
    background-color: #8d99a6;
}

.card-graph.green-bar::before {
    background-color: #2fb344;
}

.card-graph.pink-bar::before {
    background-color: #d6336c;
}

.card-graph.blue-bar::before {
    background-color: #228be6;
}

.chart-box {
    width: 100%;
    min-height: 210px;
}

.chart-box-large {
    min-height: 330px;
}

.dashboard-page {
    gap: 24px;
    padding-top: 2px;
}

.app-main:has(.dashboard-page) {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.dashboard-header {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 140px;
    padding: 22px 26px;
    border: 1px solid #dce6f2;
    border-radius: 18px;
    background:
        radial-gradient(circle at 82% 0%, rgba(124, 58, 237, 0.055), transparent 27%),
        radial-gradient(circle at 100% 100%, rgba(6, 182, 212, 0.045), transparent 25%),
        #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.075);
}

.dashboard-header::before {
    content: "";
    position: absolute;
    inset: 0 22px auto;
    width: auto;
    height: 3px;
    pointer-events: none;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, #7c3aed 0%, #2563eb 52%, #06b6d4 100%);
    opacity: 0.85;
}

.dashboard-header-content,
.dashboard-updated {
    position: relative;
    z-index: 1;
}

.dashboard-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-bottom: 10px;
    padding: 6px 11px;
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    background: rgba(245, 243, 255, 0.82);
    color: #6d28d9;
    font-size: 0.68rem;
    font-weight: 820;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.dashboard-header h1 {
    margin: 0;
    color: #17233d;
    font-size: clamp(2rem, 2.65vw, 2.5rem);
    font-weight: 780;
    letter-spacing: -0.02em;
    line-height: 1.02;
}

.dashboard-header p {
    max-width: 680px;
    margin: 11px 0 0;
    color: #64748b;
    font-size: 0.96rem;
    font-weight: 560;
    line-height: 1.45;
}

.dashboard-updated {
    min-width: 260px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 13px;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #dfe7f1;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
}

.dashboard-updated i {
    grid-row: span 2;
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    background: #f5f3ff;
    color: #7c3aed;
    font-size: 1.14rem;
}

.dashboard-updated span {
    color: #64748b;
    font-size: 0.69rem;
    font-weight: 780;
    text-transform: uppercase;
}

.dashboard-updated strong {
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 780;
}

.dashboard-theme-toggle {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    background: #f5f3ff;
    color: #7c3aed;
    font-size: 1.08rem;
    box-shadow: 0 10px 22px rgba(124, 58, 237, 0.1);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-theme-toggle:hover,
.dashboard-theme-toggle:focus-visible {
    transform: translateY(-1px);
    border-color: #a78bfa;
    background: #ede9fe;
    box-shadow: 0 12px 26px rgba(124, 58, 237, 0.18);
}

.dashboard-theme-toggle:focus-visible {
    outline: 3px solid rgba(124, 58, 237, 0.2);
    outline-offset: 3px;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: minmax(170px, 0.95fr) minmax(250px, 1.25fr) minmax(170px, 0.95fr) minmax(170px, 0.95fr);
    gap: 18px;
    margin-top: 6px;
}

.dashboard-kpi-card {
    min-height: 108px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 17px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    transition: all 0.25s ease;
}

.dashboard-kpi-card::after {
    content: "";
    position: absolute;
    inset: 16px auto 16px 0;
    width: 3px;
    height: auto;
    border-radius: 999px;
    background: #e2e8f0;
}

.dashboard-kpi-primary {
    min-height: 116px;
    padding: 18px 20px;
    border-color: #d7f7df;
    background: linear-gradient(180deg, #ffffff 0%, #f7fef9 100%);
    box-shadow: 0 10px 26px rgba(22, 101, 52, 0.09), 0 8px 22px rgba(15, 23, 42, 0.045);
}

.dashboard-kpi-primary::after {
    width: 2px;
    background: rgba(22, 163, 74, 0.58);
}

.dashboard-kpi-card:hover,
.dashboard-chart-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
    transform: translateY(-3px);
}

.dashboard-kpi-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    font-size: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.kpi-blue {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: #475569;
}

.kpi-green {
    background: linear-gradient(135deg, #ecfdf5, #dcfce7);
    color: #059669;
}

.kpi-amber {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #d97706;
}

.kpi-purple {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #7c3aed;
}

.dashboard-kpi-card span:not(.dashboard-kpi-icon) {
    display: block;
    color: #64748b;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.dashboard-kpi-card strong {
    display: block;
    margin-top: 8px;
    color: #0f172a;
    font-size: clamp(1.25rem, 1.65vw, 1.6rem);
    font-weight: 700;
    line-height: 1.1;
}

.dashboard-kpi-primary strong {
    margin-top: 9px;
    color: #064e3b;
    font-size: clamp(1.58rem, 2.15vw, 2.05rem);
    letter-spacing: 0;
}

.dashboard-chart-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 10px;
}

.dashboard-chart-card {
    min-height: 312px;
    position: relative;
    overflow: hidden;
    padding: 21px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.065);
    transition: all 0.25s ease;
}

.dashboard-chart-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 21px;
    right: 21px;
    height: 2px;
    border-radius: 0 0 999px 999px;
    background: #e2e8f0;
}

.chart-recencia::before {
    background: #f59e0b;
}

.chart-frequencia::before {
    background: #8b5cf6;
}

.chart-monetario::before {
    background: #06b6d4;
}

.dashboard-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.dashboard-chart-header span {
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-chart-header h2 {
    margin: 5px 0 0;
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 600;
}

.dashboard-chart-header i {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.chart-recencia .dashboard-chart-header i {
    color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.chart-frequencia .dashboard-chart-header i {
    color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
}

.chart-monetario .dashboard-chart-header i {
    color: #06b6d4;
    background: linear-gradient(135deg, #ecfeff, #cffafe);
}

.dashboard-bar-chart {
    height: 190px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    align-items: end;
    padding: 12px 4px 2px;
}

.dashboard-bar-item {
    position: relative;
    height: 100%;
    min-width: 0;
    display: grid;
    grid-template-rows: 24px 1fr 24px;
    justify-items: center;
    align-items: end;
}

.dashboard-bar-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 3;
    min-width: max-content;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.dashboard-bar-item:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.dashboard-bar-value {
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
}

.dashboard-bar-track {
    width: min(34px, 62%);
    height: 124px;
    display: flex;
    align-items: end;
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.58);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.045);
}

.dashboard-bar-fill {
    width: 100%;
    min-height: 3px;
    border-radius: 999px 999px 0 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 -8px 18px rgba(15, 23, 42, 0.1);
    animation: dashboardBarGrow 0.58s ease both;
    transition: height 0.25s ease, filter 0.18s ease;
}

.dashboard-bar-item:hover .dashboard-bar-fill {
    filter: brightness(0.96) saturate(1.08);
}

.dashboard-bar-label {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
}

.dashboard-segment-card {
    position: relative;
    overflow: visible;
    margin-top: 18px;
    padding: 20px 22px 22px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.065);
    transition: all 0.25s ease;
}

.dashboard-segment-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
    transform: translateY(-3px);
}

.dashboard-segment-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 21px;
    right: 21px;
    height: 2px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, #f59e0b, #8b5cf6, #06b6d4);
}

.dashboard-segment-card .dashboard-chart-header i {
    color: #2563eb;
    background: #eff6ff;
}

body.dashboard-dark-mode .app-main:has(.dashboard-page) {
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.2), transparent 32%),
        linear-gradient(180deg, #020617 0%, #0f172a 100%);
}

body.dashboard-dark-mode .dashboard-header,
body.dashboard-dark-mode .dashboard-kpi-card,
body.dashboard-dark-mode .dashboard-chart-card,
body.dashboard-dark-mode .dashboard-segment-card,
body.dashboard-dark-mode .dashboard-updated,
body.dashboard-dark-mode .rfm-matrix-legend span {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.88);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

body.dashboard-dark-mode .dashboard-header h1,
body.dashboard-dark-mode .dashboard-kpi-card strong,
body.dashboard-dark-mode .dashboard-chart-header h2,
body.dashboard-dark-mode .dashboard-updated strong {
    color: #f8fafc;
}

body.dashboard-dark-mode .dashboard-header p,
body.dashboard-dark-mode .dashboard-kpi-card span:not(.dashboard-kpi-icon),
body.dashboard-dark-mode .dashboard-chart-header span,
body.dashboard-dark-mode .dashboard-updated span,
body.dashboard-dark-mode .dashboard-bar-value,
body.dashboard-dark-mode .dashboard-bar-label,
body.dashboard-dark-mode .rfm-matrix-axis,
body.dashboard-dark-mode .rfm-matrix-y-labels,
body.dashboard-dark-mode .rfm-matrix-x-labels,
body.dashboard-dark-mode .rfm-matrix-legend span {
    color: #cbd5e1;
}

body.dashboard-dark-mode .dashboard-kicker {
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(30, 64, 175, 0.26);
    color: #bfdbfe;
}

body.dashboard-dark-mode .dashboard-updated i,
body.dashboard-dark-mode .dashboard-segment-card .dashboard-chart-header i {
    background: rgba(37, 99, 235, 0.18);
    color: #93c5fd;
}

body.dashboard-dark-mode .dashboard-theme-toggle {
    border-color: rgba(255, 255, 255, 0.72);
    background: transparent;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

body.dashboard-dark-mode .dashboard-theme-toggle:hover,
body.dashboard-dark-mode .dashboard-theme-toggle:focus-visible {
    border-color: #ffffff;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

body.dashboard-dark-mode .dashboard-kpi-primary {
    border-color: rgba(34, 197, 94, 0.24);
    background: rgba(6, 78, 59, 0.28);
}

body.dashboard-dark-mode .dashboard-kpi-primary strong {
    color: #bbf7d0;
}

body.dashboard-dark-mode .dashboard-bar-track {
    background: rgba(30, 41, 59, 0.82);
}

body.dashboard-dark-mode .rfm-matrix-stage {
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.24);
}

body.dashboard-dark-mode .rfm-zone {
    filter: brightness(0.88) saturate(0.92);
}

body.dashboard-dark-mode .rfm-bubble {
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.42);
}

.rfm-matrix-shell {
    display: grid;
    grid-template-columns: 20px 20px 1fr;
    grid-template-rows: 1fr auto auto;
    gap: 8px 9px;
    align-items: stretch;
}

.rfm-matrix-stage {
    position: relative;
    min-height: 470px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(58px, 1fr));
    gap: 0;
    padding: 0;
    overflow: visible;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #dbe4ee;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.rfm-zone {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 12px;
    color: rgba(15, 23, 42, 0.78);
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.rfm-zone:hover,
.rfm-zone-group-hover {
    z-index: 2;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    transform: translateY(-2px);
}

.rfm-zone.zone-loyal[data-rfm-segmento="leais"]:hover,
.rfm-zone.zone-loyal[data-rfm-segmento="leais"].rfm-zone-group-hover,
.rfm-zone.zone-loyal[data-rfm-segmento="leais"]:focus,
.rfm-zone.zone-loyal[data-rfm-segmento="leais"]:focus-visible,
.rfm-zone.zone-loyal[data-rfm-segmento="leais"]:active {
    z-index: 2;
    outline: none;
    box-shadow: none;
    transform: none;
}

.rfm-zone.zone-lost[data-rfm-segmento="perdidos"]:hover,
.rfm-zone.zone-lost[data-rfm-segmento="perdidos"].rfm-zone-group-hover {
    z-index: 1;
    box-shadow: 0 0 0 1px #df7c75;
    transform: none;
}

.rfm-zone:focus {
    outline: none;
}

.rfm-zone:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.55);
    outline-offset: -3px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    transform: translateY(-2px);
}

.rfm-zone > span {
    max-width: 100%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
}

.rfm-zone-title {
    display: block;
    width: 100%;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.46);
    color: #243047;
    font-size: 0.73rem;
    font-weight: 850;
    line-height: 1.15;
    text-align: right;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.rfm-zone-metrics {
    display: grid;
    gap: 4px;
    justify-items: end;
    width: 100%;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.42);
    color: #243047;
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1.05;
    text-align: right;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.rfm-zone-metrics span {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    max-width: 100%;
    color: inherit;
    white-space: nowrap;
}

.rfm-zone-metrics i {
    font-size: 0.72rem;
    line-height: 1;
}

.rfm-zone.zone-loyal[data-rfm-segmento="leais"] {
    align-items: flex-end;
    justify-content: flex-end;
    padding-right: 12px;
    padding-bottom: 38px;
}

.rfm-zone.zone-loyal[data-rfm-segmento="leais"] .rfm-zone-title,
.rfm-zone.zone-loyal[data-rfm-segmento="leais"] .rfm-zone-metrics {
    width: auto;
    min-width: 150px;
    text-align: right;
    justify-items: end;
}

.rfm-zone-label {
    position: absolute;
    z-index: 5;
    max-width: 140px;
    color: rgba(15, 23, 42, 0.78);
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.15;
    text-align: center;
    pointer-events: none;
    text-shadow: 0 1px 8px rgba(255, 255, 255, 0.28);
    transform: translate(-50%, -50%);
}

.rfm-zone-label-loyal {
    left: 70%;
    top: 30%;
}

.zone-keep {
    background: #c9e5ef;
}

.zone-loyal {
    background: #d2e59d;
    box-shadow: 0 0 0 1px #d2e59d;
}

.zone-champions {
    background: #f1ad7e;
}

.zone-risk {
    background: #f3d58e;
}

.zone-attention {
    background: #6ba9b4;
}

.zone-potential {
    background: #b2927e;
}

.zone-lost {
    background: #df7c75;
    box-shadow: 0 0 0 1px #df7c75;
}

.rfm-zone[data-rfm-segmento="leais"],
.rfm-zone[data-rfm-segmento="perdidos"] {
    margin: -1px;
}

.zone-hibernating {
    background: #aaa5cf;
}

.zone-sleep {
    background: #c4a85e;
}

.zone-promising {
    background: #be91ae;
}

.zone-recent {
    background: #9ad4c8;
}

.rfm-segment-matrix {
    position: absolute;
    inset: 0;
    z-index: 40;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.rfm-bubble {
    position: absolute;
    z-index: 41;
    display: grid;
    place-items: center;
    border: 3px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: linear-gradient(180deg, #164d82, #0f355f);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 52, 95, 0.3);
    pointer-events: auto;
    transform: translate(-50%, -50%);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.rfm-bubble:hover {
    z-index: 42;
    box-shadow: 0 12px 26px rgba(15, 52, 95, 0.38);
    transform: translate(-50%, -50%) scale(1.08);
}

.rfm-bubble span {
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
}

.rfm-bubble::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 12;
    min-width: max-content;
    padding: 8px 11px;
    border-radius: 11px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.rfm-bubble:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.rfm-matrix-axis {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rfm-matrix-axis-y {
    grid-column: 2;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
}

.rfm-matrix-axis-x {
    grid-column: 3;
    text-align: right;
}

.rfm-matrix-y-labels {
    grid-column: 1;
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    align-items: center;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    text-align: center;
}

.rfm-matrix-x-labels {
    grid-column: 3;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    text-align: center;
}

.rfm-matrix-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 14px 0 0 49px;
}

.rfm-matrix-legend span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.rfm-matrix-legend i {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

@media (min-width: 1200px) {
    .rfm-matrix-legend {
        flex-wrap: nowrap;
        justify-content: center;
        gap: 6px;
        margin: 14px auto 0;
        padding-left: 49px;
        max-width: 1420px;
    }

    .rfm-matrix-legend span {
        min-height: 26px;
        gap: 5px;
        padding: 4px 8px;
        font-size: 0.69rem;
    }

    .rfm-matrix-legend i {
        width: 9px;
        height: 9px;
    }
}

@keyframes dashboardBarGrow {
    from {
        transform: scaleY(0.72);
        transform-origin: bottom;
        opacity: 0.76;
    }
    to {
        transform: scaleY(1);
        transform-origin: bottom;
        opacity: 1;
    }
}

@media (max-width: 1180px) {
    .dashboard-kpi-grid,
    .dashboard-chart-grid {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }

    .dashboard-segment-card {
        overflow-x: auto;
    }

    .rfm-bubble::after {
        top: calc(100% + 8px);
        bottom: auto;
        transform: translate(-50%, -6px);
    }

    .rfm-bubble:hover::after {
        transform: translate(-50%, 0);
    }

    .rfm-matrix-shell {
        min-width: 820px;
    }
}

@media (max-width: 760px) {
    .dashboard-header {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-updated {
        min-width: 0;
    }

    .dashboard-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .dashboard-kpi-grid,
    .dashboard-chart-grid {
        grid-template-columns: 1fr;
    }

    .rfm-matrix-shell {
        min-width: 760px;
    }
}

/* Main RFM aligned with the evolution workspace */
.rfm-main-page {
    gap: 0 !important;
}

.page-shell.insight-page .rfm-main-header {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 152px;
    gap: 24px;
    margin: 0;
    padding: 24px 28px 28px;
    border: 1px solid #dce6f2;
    border-color: #dce6f2;
    border-bottom-color: #eef2f7;
    border-radius: 16px 16px 0 0;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}

.page-shell.insight-page .rfm-main-header > div {
    position: relative;
    z-index: 1;
}

.page-shell.insight-page .rfm-main-header::before {
    content: none;
}

.page-shell.insight-page .rfm-main-header::after {
    content: "";
    position: absolute;
    inset: 66px 250px auto auto;
    width: 280px;
    height: 86px;
    border: 1px solid rgba(124, 58, 237, 0.14);
    border-left: 0;
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
    transform: rotate(-8deg);
    pointer-events: none;
}

.page-shell.insight-page .rfm-main-header-content {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 850px;
}

.rfm-main-hero-icon {
    width: 66px;
    height: 66px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    background: #f3e8ff;
    color: #7c3aed;
    font-size: 1.75rem;
    box-shadow: 0 16px 30px rgba(124, 58, 237, 0.14);
}

.page-shell.insight-page .rfm-main-header h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.72rem, 2.25vw, 2.24rem);
    font-weight: 900;
    line-height: 1.05;
}

.page-shell.insight-page .rfm-main-header p {
    max-width: 760px;
    margin-top: 7px;
    margin-bottom: 0;
    color: #5f708a;
    font-size: 0.92rem;
    font-weight: 650;
}

.page-shell.insight-page .rfm-main-status {
    min-width: 238px;
    min-height: 84px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    align-items: center;
    gap: 3px 13px;
    padding: 13px 16px;
    border: 1px solid #e1e8f2;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.page-shell.insight-page .rfm-main-status i {
    grid-row: 1 / 4;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #f3e8ff;
    color: #7c3aed;
}

.page-shell.insight-page .rfm-main-status span {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 850;
    line-height: 1.1;
    text-transform: uppercase;
}

.page-shell.insight-page .rfm-main-status strong {
    color: #0f172a;
    font-size: 1.42rem;
    font-weight: 900;
    line-height: 1;
}

.page-shell.insight-page .rfm-main-status small {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 750;
}

.rfm-main-page .rfm-main-filter-card {
    padding: 22px 28px 26px;
    border-color: #dce6f2;
    border-top: 0;
    border-radius: 0 0 16px 16px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.07);
}

.rfm-main-filter-form {
    gap: 16px 12px;
}

.rfm-main-page .rfm-main-filter-card .rfm-input-shell {
    min-height: 50px;
    border-color: #dbe5ef;
    border-radius: 10px;
    background: #fbfdff;
}

.rfm-main-page .rfm-main-filter-card .rfm-input-shell .form-control,
.rfm-main-page .rfm-main-filter-card .rfm-input-shell .form-select {
    min-height: 48px;
    font-size: 0.92rem;
}

.rfm-main-page .rfm-main-filter-card .rfm-filter-actions {
    gap: 14px;
    padding: 0 0 0 22px;
    border-left: 1px solid #e5edf6;
}

.rfm-main-page .rfm-main-filter-card .rfm-filter-submit,
.rfm-main-page .rfm-main-filter-card .rfm-clear-filter {
    min-width: 150px;
    min-height: 48px;
    font-size: 0.92rem;
}

.rfm-main-page .rfm-main-filter-card .rfm-filter-submit {
    border-color: #2563eb;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.rfm-main-page .rfm-main-filter-card .rfm-clear-filter {
    min-width: 126px;
}

.rfm-main-result-card {
    margin-top: 20px;
}

.rfm-main-result-card .grid-card-header {
    min-height: 68px;
    padding: 12px 18px;
    border-bottom-color: #e8eef6;
    background: #ffffff;
}

.rfm-main-result-card .grid-card-header h2 {
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 850;
}

.rfm-main-result-card .grid-card-header p {
    margin-top: 5px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
}

.rfm-main-result-card .grid-card-header .rfm-column-toggle,
.rfm-main-result-card .grid-card-header .rfm-export-button {
    min-width: 156px;
    min-height: 44px;
    padding: 10px 15px;
    font-size: 0.86rem;
}

.rfm-main-result-card .rfm-table-wrap {
    max-height: 640px;
    background: #ffffff;
}

.rfm-main-result-card .rfm-table thead th {
    padding: 11px 14px;
    border-color: #e8eef6;
    background: #f8fbff;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 820;
}

.rfm-main-result-card .rfm-table tbody td {
    height: 50px;
    padding: 10px 14px;
    color: #334155;
    font-size: 0.9rem;
}

.rfm-main-result-card .rfm-table tbody tr:nth-child(even) td {
    background: #fbfdff;
}

@media (max-width: 1180px) {
    .rfm-main-page .rfm-main-filter-card .rfm-filter-actions {
        padding-left: 0;
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .page-shell.insight-page .rfm-main-header {
        align-items: stretch;
        flex-direction: column;
        padding: 20px;
        border-radius: 14px 14px 0 0;
    }

    .page-shell.insight-page .rfm-main-header-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .rfm-main-page .rfm-main-filter-card {
        padding: 18px;
        border-radius: 0 0 14px 14px;
    }

    .rfm-main-result-card .grid-card-header,
    .rfm-main-result-card .rfm-result-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .rfm-main-result-card .grid-card-header .rfm-column-toggle,
    .rfm-main-result-card .grid-card-header .rfm-export-button {
        width: 100%;
    }
}

.dashboard-rfm-strip {
    display: grid;
    grid-template-columns: minmax(170px, 0.8fr) repeat(3, minmax(220px, 1fr));
    gap: 10px;
    padding: 8px;
    border: 1px solid #1f2933;
    border-radius: 6px;
    background: #101516;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.dashboard-summary-card,
.dashboard-mini-card {
    min-height: 150px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    background: #171d1d;
    color: #eef2f6;
}

.dashboard-summary-card {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    padding: 14px 16px;
}

.summary-metric span,
.summary-metric small {
    display: block;
    color: #aab4bd;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.summary-metric small {
    margin-top: 12px;
    color: #7d8992;
    font-size: 0.68rem;
}

.summary-metric strong {
    display: block;
    margin-top: 10px;
    color: #f4f7fb;
    font-size: 1.55rem;
    font-weight: 760;
    line-height: 1.1;
}

.summary-divider {
    height: 2px;
    margin: 9px -16px;
    background: rgba(255, 255, 255, 0.56);
}

.dashboard-mini-card {
    position: relative;
    display: grid;
    grid-template-columns: 8px 1fr;
    overflow: hidden;
}

.mini-accent {
    width: 5px;
    align-self: stretch;
    margin: 14px 0;
    border-radius: 999px;
}

.mini-recencia .mini-accent {
    background: #ff9f1c;
    box-shadow: 0 0 20px rgba(255, 159, 28, 0.45);
}

.mini-frequencia .mini-accent {
    background: #ec0aa6;
    box-shadow: 0 0 20px rgba(236, 10, 166, 0.45);
}

.mini-valor .mini-accent {
    background: #27b7ee;
    box-shadow: 0 0 20px rgba(39, 183, 238, 0.45);
}

.mini-content {
    min-width: 0;
    padding: 13px 16px 12px;
}

.mini-content h2 {
    margin: 0 0 8px;
    color: #c8d0d7;
    font-size: 0.78rem;
    font-weight: 850;
    text-align: center;
    text-transform: uppercase;
}

.mini-bars {
    height: 104px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    gap: 10px;
}

.mini-bar-item {
    height: 100%;
    min-width: 0;
    display: grid;
    grid-template-rows: 18px 1fr 18px;
    align-items: end;
    justify-items: center;
}

.mini-bar-value {
    color: #cfd6de;
    font-size: 0.68rem;
    font-weight: 750;
    line-height: 1;
}

.mini-bar-track {
    width: 28px;
    height: 68px;
    display: flex;
    align-items: end;
}

.mini-bar-fill {
    width: 100%;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.mini-bar-label {
    color: #aab4bd;
    font-size: 0.72rem;
    font-weight: 800;
}

@media (max-width: 1180px) {
    .dashboard-rfm-strip {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }
}

@media (max-width: 680px) {
    .dashboard-rfm-strip {
        grid-template-columns: 1fr;
    }
}

.login-page {
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 16% 18%, rgba(59, 130, 246, 0.16), transparent 30%),
        radial-gradient(circle at 84% 12%, rgba(16, 185, 129, 0.12), transparent 28%),
        linear-gradient(135deg, #f8fafc 0%, #eef4fb 50%, #f7fafc 100%);
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 440px);
    align-items: center;
    gap: 64px;
    width: min(1120px, calc(100vw - 48px));
    margin: 0 auto;
    padding: 48px 0;
}

.login-panel {
    width: 100%;
    padding: 34px;
    border: 1px solid rgba(210, 222, 235, 0.82);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
}

.login-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #d9e6f5;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff, #eef5ff);
    color: #2f5f9f;
    font-size: 1.18rem;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.login-glow {
    position: fixed;
    pointer-events: none;
    filter: blur(10px);
    opacity: 0.9;
}

.login-glow-one {
    width: 360px;
    height: 360px;
    left: -120px;
    top: -110px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.16);
}

.login-glow-two {
    width: 320px;
    height: 320px;
    right: -90px;
    bottom: -120px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.13);
}

.login-hero {
    max-width: 560px;
}

.login-brand-pill {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #d9e6f5;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #385d87;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.login-hero h1 {
    margin: 18px 0 12px;
    color: #0b1730;
    font-size: clamp(2rem, 4vw, 3.3rem);
    font-weight: 760;
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.login-hero p {
    max-width: 520px;
    margin: 0;
    color: #667085;
    font-size: 1.06rem;
    line-height: 1.62;
}

.login-proof {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.login-proof span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #dbe6f2;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    color: #344054;
    font-size: 0.86rem;
    font-weight: 700;
}

.login-panel-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 28px;
}

.login-kicker {
    display: block;
    color: #496985;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.login-panel h2 {
    margin: 4px 0 6px;
    color: #111827;
    font-size: 1.45rem;
    font-weight: 780;
    letter-spacing: -0.01em;
}

.login-panel p {
    margin: 0;
    color: #667085;
    font-size: 0.95rem;
    line-height: 1.45;
}

.login-alert {
    border-radius: 12px;
    font-size: 0.9rem;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-field {
    display: grid;
    gap: 8px;
}

.login-field .form-label {
    margin: 0;
    color: #18243a;
    font-size: 0.84rem;
    font-weight: 800;
}

.login-input {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid #d3dfeb;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    color: #667085;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.login-input:hover {
    border-color: #b9c8da;
    background: #fff;
}

.login-input:focus-within {
    border-color: #9ebcf0;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.10), 0 12px 28px rgba(15, 23, 42, 0.08);
}

.login-input .form-control {
    min-height: 54px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #111827;
    font-weight: 600;
}

.login-input .form-control:focus {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.login-submit {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 4px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #1769e0, #0f7bf2);
    color: #fff;
    font-weight: 850;
    box-shadow: 0 18px 36px rgba(23, 105, 224, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.login-submit:hover {
    color: #fff;
    filter: saturate(1.05);
    box-shadow: 0 22px 44px rgba(23, 105, 224, 0.34);
    transform: translateY(-1px);
}

@media (max-width: 920px) {
    .login-shell {
        grid-template-columns: 1fr;
        gap: 28px;
        width: min(520px, calc(100vw - 32px));
    }

    .login-hero {
        text-align: left;
    }
}

@media (max-width: 560px) {
    .login-shell {
        padding: 28px 0;
    }

    .login-panel {
        padding: 26px;
        border-radius: 16px;
    }

    .login-panel-header {
        flex-direction: column;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 78px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .sidebar .link-text,
    .sidebar .sidebar-brand,
    .sidebar .sidebar-user .small,
    .sidebar .sidebar-user .fw-semibold {
        display: none;
    }

    .sidebar .sidebar-nav .nav-link,
    .sidebar .sidebar-logout {
        justify-content: center;
        padding-left: 10px;
        padding-right: 10px;
    }

    .app-main {
        padding: 22px;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    .toolbar-card {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-metric,
    .inline-metric-group {
        width: 100%;
        margin-left: 0;
    }

    .filter-field {
        min-width: 100%;
    }

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

    .filter-field-date {
        max-width: none;
    }

    .rfm-filter-submit {
        width: 100%;
    }

    .metric-grid-3 {
        grid-template-columns: 1fr;
    }

    .pagination-bar {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-top,
    .sidebar-user {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row !important;
        gap: 8px;
    }

    .app-main {
        padding: 18px;
    }

    .page-header,
    .upload-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

.rfm-filter-card {
    display: block;
    padding: 22px 24px;
    border-color: #d8e4ef;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96));
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.rfm-filter-form {
    display: grid !important;
    grid-template-columns: minmax(210px, 1.2fr) minmax(130px, 0.65fr) minmax(230px, 1.1fr) minmax(145px, 0.72fr) minmax(145px, 0.72fr);
    align-items: end;
    gap: 16px;
    width: 100%;
}

.rfm-filter-form .filter-field,
.rfm-filter-form .filter-field-small,
.rfm-filter-form .filter-field-date,
.rfm-filter-form .filter-field-document,
.rfm-filter-form .filter-field-store {
    min-width: 0;
    max-width: none;
}

.rfm-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
}

.rfm-column-picker {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
}

.rfm-column-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.rfm-column-toggle {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #cbd8e6;
    border-radius: 8px;
    background: #fff;
    color: #18243a;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.rfm-column-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.rfm-column-toggle .bi-chevron-down {
    transition: transform 0.18s ease;
}

.rfm-column-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.rfm-column-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rfm-column-action {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    background: #fff;
    color: #344054;
    font-size: 0.78rem;
    font-weight: 800;
}

.rfm-column-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.rfm-column-reset {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.rfm-column-reset:hover {
    text-decoration: underline;
}

.rfm-column-options {
    max-height: 150px;
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 8px 12px;
    overflow: auto;
    padding: 14px;
    border: 1px solid #d7e0ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.rfm-column-option {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 8px;
    border-radius: 8px;
    color: #344054;
    font-size: 0.86rem;
    font-weight: 650;
}

.rfm-column-option:hover {
    background: #f3f7fc;
}

.rfm-column-option input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    accent-color: var(--primary);
}

.rfm-filter-submit,
.rfm-clear-filter {
    min-width: 160px;
    min-height: 44px;
    white-space: nowrap;
    font-weight: 700;
}

.rfm-filter-card .form-control,
.rfm-filter-card .form-select {
    min-height: 48px;
    border-color: #d7e0ea;
    border-radius: 10px;
    background-color: #fff;
    color: #0f172a;
    font-size: 0.98rem;
    box-shadow: none;
}

.rfm-filter-card .form-control:focus,
.rfm-filter-card .form-select:focus {
    border-color: #7aaef7;
    box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.12);
}

.rfm-filter-card .filter-field span {
    color: #18243a;
    font-size: 0.82rem;
    font-weight: 800;
}

.rfm-filter-submit {
    border: 0;
    background: linear-gradient(135deg, #1769e0, #0f7bf2);
    box-shadow: 0 10px 20px rgba(23, 105, 224, 0.22);
}

.rfm-filter-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(23, 105, 224, 0.28);
}

.rfm-clear-filter {
    background: #fff;
    border-color: #cfd8e3;
    color: #475467;
}

.rfm-clear-filter:hover {
    background: #f8fafc;
    border-color: #aebbc9;
    color: #1f2937;
}

.grid-card {
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
}

.grid-card-header {
    padding: 16px 20px;
}

.grid-card-header h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0b1220;
}

.grid-card-header p {
    font-size: 0.86rem;
}

.rfm-export-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-inline: 14px;
    border: 0;
    background: linear-gradient(135deg, #168a54, #16a163);
    color: #fff;
    font-weight: 750;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(22, 138, 84, 0.18);
}

.rfm-export-button:hover {
    background: linear-gradient(135deg, #107446, #168a54);
    color: #fff;
    transform: translateY(-1px);
}

.segment-badge {
    display: inline-flex;
    align-items: center;
    max-width: 260px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid #d8e2ee;
    background: #f5f8fb;
    color: #344054;
    font-size: 0.82rem;
    font-weight: 750;
    white-space: nowrap;
}

.segment-a,
.segment-b,
.segment-c {
    border-color: #a7e3bf;
    background: #e9f9ef;
    color: #08743d;
}

.segment-d,
.segment-e {
    border-color: #bfd7ff;
    background: #eef5ff;
    color: #155dc7;
}

.segment-f,
.segment-g {
    border-color: #ffe1a6;
    background: #fff7e6;
    color: #9a5b00;
}

.segment-h,
.segment-i,
.segment-j,
.segment-k {
    border-color: #ffc9c9;
    background: #fff0f0;
    color: #b42318;
}

.rfm-table thead th:first-child,
.rfm-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 130px;
    background: var(--surface);
}

.rfm-table thead th:nth-child(2),
.rfm-table tbody td:nth-child(2) {
    position: sticky;
    left: 130px;
    z-index: 2;
    min-width: 300px;
    background: var(--surface);
}

.rfm-table thead th:first-child,
.rfm-table thead th:nth-child(2) {
    z-index: 3;
    background: var(--surface-muted);
}

@media (max-width: 1180px) {
    .rfm-filter-form {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .rfm-column-options {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .rfm-filter-submit {
        width: 100%;
    }

    .rfm-clear-filter {
        width: 100%;
    }

    .rfm-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .rfm-filter-form {
        grid-template-columns: 1fr;
    }

    .rfm-column-options {
        grid-template-columns: 1fr;
    }
}

/* RFM premium layout */
.page-shell:has(.rfm-filter-card) {
    gap: 28px;
    padding-top: 12px;
}

.page-shell:has(.rfm-filter-card) .page-header {
    margin-bottom: 12px;
    padding: 0 2px;
}

.page-shell:has(.rfm-filter-card) .page-header h1 {
    color: #07152f;
    margin: 0;
    font-size: 2.05rem;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.12;
}

.rfm-page-title {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    max-width: 920px;
}

.rfm-page-title-icon {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    margin-top: 6px;
    border: 1px solid #dce7f3;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    color: #2f5f9f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 24px rgba(15, 23, 42, 0.05);
}

.rfm-page-title-icon i {
    font-size: 1.18rem;
}

.rfm-page-kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-bottom: 8px;
    padding: 5px 10px;
    border: 1px solid #d9e6f5;
    border-radius: 999px;
    background: #f4f8fd;
    color: #496985;
    font-size: 0.72rem;
    font-weight: 760;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.page-shell:has(.rfm-filter-card) .rfm-page-title h1 {
    color: #101828;
    font-size: 1.86rem;
    font-weight: 720;
    letter-spacing: -0.01em;
    line-height: 1.12;
}

.rfm-page-title p {
    max-width: 680px;
    margin: 8px 0 0;
    color: #667085;
    font-size: 1.02rem;
    line-height: 1.55;
    font-weight: 450;
}

.rfm-filter-card {
    padding: 30px 34px 34px;
    border: 1px solid #d9e3ee;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.rfm-filter-form {
    grid-template-columns:
        minmax(250px, 1.2fr)
        minmax(230px, 1fr)
        minmax(165px, 0.7fr)
        minmax(280px, 1.3fr);
    align-items: start;
    gap: 18px 12px;
}

.rfm-field-data-inicial {
    grid-column: 1 / 2;
}

.rfm-field-data-final {
    grid-column: 2 / 3;
}

.rfm-filter-actions {
    grid-column: 3 / -1;
    align-self: end;
}

.rfm-modern-field {
    gap: 8px;
}

.rfm-field-label,
.rfm-filter-card .filter-field span.rfm-field-label {
    color: #0f1f3d;
    font-size: 0.82rem;
    font-weight: 800;
}

.rfm-input-shell {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid #d6e1ed;
    border-radius: 10px;
    background: #fff;
    color: #667085;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.rfm-input-shell:hover {
    border-color: #b9c8da;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.rfm-input-shell:focus-within {
    border-color: #cbd8e6;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.rfm-input-shell > i {
    width: 18px;
    flex: 0 0 auto;
    color: #5b6b82;
    font-size: 1rem;
}

.rfm-input-shell .form-control,
.rfm-input-shell .form-select {
    min-width: 0;
    min-height: 54px;
    padding: 0;
    border: 0;
    background-color: transparent;
    box-shadow: none;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 550;
}

.rfm-input-shell .form-control:focus,
.rfm-input-shell .form-select:focus {
    border: 0;
    box-shadow: none;
    background-color: transparent;
    outline: 0;
}

.rfm-input-shell .form-control::selection {
    background: #d9e3ee;
    color: #07152f;
}

.rfm-input-shell .form-control:-webkit-autofill,
.rfm-input-shell .form-control:-webkit-autofill:hover,
.rfm-input-shell .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: #111827;
    box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 9999s ease-out;
}

.rfm-column-picker {
    margin-top: 2px;
    padding-top: 4px;
    position: absolute;
    width: 0;
    height: 0;
    overflow: visible;
}

.rfm-column-picker-header {
    align-items: center;
    padding: 0;
}

.rfm-column-toggle {
    min-height: 50px;
    padding: 12px 16px;
    border-color: #cfdceb;
    border-radius: 10px;
    background: #fff;
    color: #0f1f3d;
    font-size: 0.92rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.rfm-column-toggle:hover,
.rfm-column-toggle[aria-expanded="true"] {
    border-color: #9ebcf0;
    background: #f8fbff;
    color: var(--primary);
}

.rfm-column-tools {
    gap: 10px;
}

.rfm-column-action,
.rfm-column-reset {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #d3deeb;
    border-radius: 9px;
    background: #fff;
    color: #18243a;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
    transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.rfm-column-action:hover,
.rfm-column-reset:hover {
    border-color: #9ebcf0;
    color: var(--primary);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
    text-decoration: none;
    transform: translateY(-1px);
}

.rfm-column-groups {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.rfm-column-group {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.rfm-column-group-title {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
    color: #0f1f3d;
    font-size: 0.82rem;
    font-weight: 850;
}

.rfm-column-group-title .bi-chevron-down {
    color: #667085;
    font-size: 0.82rem;
    transition: transform 0.18s ease;
}

.rfm-column-group-title[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.rfm-column-options {
    max-height: none;
    grid-template-columns: 1fr;
    gap: 6px;
    overflow: visible;
    padding: 10px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.rfm-column-option {
    min-height: 38px;
    gap: 10px;
    padding: 8px 9px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #25324a;
    font-size: 0.84rem;
    font-weight: 700;
    transition: background-color 0.16s ease, border-color 0.16s ease;
}

.rfm-column-option:hover {
    border-color: #d9e7fb;
    background: #f7fbff;
}

.rfm-column-option input {
    width: 18px;
    height: 18px;
    border-radius: 5px;
}

.rfm-filter-actions {
    padding-top: 14px;
}

.rfm-result-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.grid-card-header .rfm-column-toggle,
.grid-card-header .rfm-export-button {
    min-width: 190px;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 850;
    line-height: 1;
}

.grid-card-header .rfm-column-toggle {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.grid-card-header .rfm-export-button {
    border-color: #15965d;
    background: #15965d;
    box-shadow: 0 12px 28px rgba(21, 150, 93, 0.18);
}

.rfm-filter-submit,
.rfm-clear-filter {
    min-width: 200px;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1;
}

.rfm-filter-submit {
    border-color: #1769e0;
    background: #1769e0;
    box-shadow: 0 16px 34px rgba(23, 105, 224, 0.25);
    transition: box-shadow 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.rfm-filter-submit:hover {
    background: #0f5fd1;
    box-shadow: 0 18px 38px rgba(23, 105, 224, 0.32);
    transform: translateY(-1px);
}

.rfm-filter-submit.is-loading {
    opacity: 0.82;
    cursor: wait;
}

.rfm-filter-submit.is-loading i {
    animation: rfm-spin 0.8s linear infinite;
}

.rfm-clear-filter {
    border-color: #d2dbe7;
    background: #fff;
    color: #475467;
}

.rfm-clear-filter:hover {
    border-color: #aebdd0;
    background: #f8fafc;
    color: #18243a;
}

@keyframes rfm-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1380px) {
    .rfm-column-groups {
        grid-template-columns: repeat(3, minmax(190px, 1fr));
    }
}

@media (max-width: 1180px) {
    .rfm-filter-form {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .rfm-field-data-inicial,
    .rfm-field-data-final,
    .rfm-filter-actions {
        grid-column: auto;
    }

    .rfm-filter-actions {
        grid-column: 1 / -1;
    }

    .rfm-column-groups {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 760px) {
    .rfm-filter-card {
        padding: 20px;
    }

    .rfm-filter-form,
    .rfm-column-groups {
        grid-template-columns: 1fr;
    }

    .rfm-column-picker-header,
    .rfm-column-tools,
    .rfm-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .rfm-column-toggle,
    .rfm-column-action,
    .rfm-column-reset,
    .rfm-filter-submit,
    .rfm-clear-filter {
        width: 100%;
    }

    .rfm-result-actions {
        width: 100%;
        justify-content: stretch;
    }
}

@media (max-width: 1180px) {
    .customers-filter-form {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 760px) {
    .customers-filter-card {
        padding: 20px;
    }

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

    .customers-submit {
        width: 100%;
    }
}

/* RFM column drawer: keeps results fixed while editing columns */
.rfm-column-offcanvas {
    width: min(560px, 100vw);
    border-left: 1px solid #d8e3ef;
    background: #f8fafc;
    box-shadow: -28px 0 60px rgba(15, 23, 42, 0.16);
}

.rfm-column-offcanvas-header {
    align-items: flex-start;
    padding: 24px 24px 18px;
    border-bottom: 1px solid #e3ebf4;
    background: #fff;
}

.rfm-column-offcanvas-header h2 {
    margin: 0;
    color: #07152f;
    font-size: 1.25rem;
    font-weight: 850;
    letter-spacing: 0;
}

.rfm-column-offcanvas-header p {
    margin: 5px 0 0;
    color: #667085;
    font-size: 0.9rem;
}

.rfm-column-offcanvas-body {
    padding: 18px 20px 24px;
}

.rfm-column-offcanvas .rfm-column-tools {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    padding: 0 0 14px;
    background: #f8fafc;
}

.rfm-column-offcanvas .rfm-column-groups {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 0;
}

.rfm-column-offcanvas .rfm-column-group {
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.rfm-column-offcanvas .rfm-column-group-title {
    min-height: 46px;
    background: #fff;
}

.rfm-column-offcanvas .rfm-column-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
}

.rfm-column-toggle .bi-sliders {
    color: #5b6b82;
}

.rfm-column-toggle:hover .bi-sliders {
    color: var(--primary);
}

@media (max-width: 760px) {
    .rfm-column-offcanvas {
        width: 100vw;
    }

    .rfm-column-offcanvas .rfm-column-tools,
    .rfm-column-offcanvas .rfm-column-options {
        grid-template-columns: 1fr;
    }
}

/* Shared insight header */
.insight-page {
    gap: 24px;
    padding-top: 2px;
}

.app-main:has(.insight-page) {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.page-shell.insight-page .insight-header {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 8px;
    padding: 15px 22px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.page-shell.insight-page .insight-header::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    pointer-events: none;
    background: linear-gradient(180deg, #2563eb, #06b6d4);
    opacity: 0.9;
}

.page-shell.insight-page .insight-header > div {
    position: relative;
    z-index: 1;
}

.page-shell.insight-page .insight-header-content {
    max-width: 760px;
}

.page-shell.insight-page .rfm-page-title {
    max-width: 760px;
}

.page-shell.insight-page .rfm-page-title-icon {
    display: none;
}

.page-shell.insight-page .insight-kicker,
.page-shell.insight-page .rfm-page-kicker,
.page-shell.insight-page .page-kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-bottom: 7px;
    padding: 6px 10px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: rgba(239, 246, 255, 0.72);
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.page-shell.insight-page .insight-header h1,
.page-shell.insight-page .rfm-page-title h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.65rem, 2.35vw, 2.15rem);
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1.08;
}

.page-shell.insight-page .insight-header p,
.page-shell.insight-page .rfm-page-title p {
    max-width: 680px;
    margin: 6px 0 0;
    color: #64748b;
    font-size: 0.94rem;
    font-weight: 500;
    line-height: 1.55;
}

.page-shell.insight-page .insight-status {
    min-width: 245px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 12px;
    align-items: center;
    padding: 10px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    color: inherit;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.055);
    backdrop-filter: blur(10px);
}

.page-shell.insight-page .insight-status i {
    grid-row: span 2;
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.1rem;
}

.page-shell.insight-page .insight-status span {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
}

.page-shell.insight-page .insight-status strong {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
}

@media (max-width: 760px) {
    .page-shell.insight-page .insight-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-shell.insight-page .insight-status {
        min-width: 0;
    }
}

/* Insight header polish */
.page-shell.insight-page {
    gap: 22px;
}

.page-shell.insight-page .insight-header {
    min-height: 148px;
    gap: 28px;
    margin-bottom: 0;
    padding: 18px 26px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.88) 100%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.075);
}

.page-shell.insight-page .insight-header::before {
    width: 5px;
}

.page-shell.insight-page .insight-header-content {
    display: grid;
    gap: 0;
    max-width: 780px;
}

.page-shell.insight-page .insight-title-stack {
    display: contents;
}

.page-shell.insight-page .insight-kicker,
.page-shell.insight-page .rfm-page-kicker,
.page-shell.insight-page .page-kicker {
    min-height: 28px;
    margin-bottom: 10px;
    padding: 6px 11px;
    font-size: 0.68rem;
    font-weight: 800;
}

.page-shell.insight-page .insight-header h1,
.page-shell.insight-page .rfm-page-title h1 {
    font-size: clamp(2rem, 2.7vw, 2.55rem);
    font-weight: 820;
    line-height: 1.02;
}

.page-shell.insight-page .insight-header p,
.page-shell.insight-page .rfm-page-title p {
    margin-top: 12px;
    font-size: 0.98rem;
    font-weight: 560;
    line-height: 1.45;
}

.page-shell.insight-page .insight-status {
    min-width: 256px;
    gap: 4px 13px;
    padding: 12px 15px;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.065);
}

.page-shell.insight-page .insight-status i {
    width: 40px;
    height: 40px;
    border-radius: 15px;
    font-size: 1.16rem;
}

.page-shell.insight-page .insight-status span {
    font-size: 0.7rem;
    font-weight: 760;
}

.page-shell.insight-page .insight-status strong {
    font-size: 0.95rem;
    font-weight: 780;
}

@media (max-width: 760px) {
    .page-shell.insight-page .insight-header {
        min-height: 0;
        padding: 18px 20px;
    }
}

/* RFM 2 segment evolution */
.rfm2-command-center {
    position: relative;
    overflow: hidden;
    padding: 24px 26px 26px;
    border: 1px solid #dce6f2;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}

.rfm2-command-center::before {
    content: "";
    position: absolute;
    inset: 70px 230px auto auto;
    width: 280px;
    height: 86px;
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-left: 0;
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
    transform: rotate(-8deg);
    pointer-events: none;
}

.rfm2-command-hero {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.rfm2-command-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rfm2-hero-icon {
    width: 66px;
    height: 66px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    color: #7c3aed;
    font-size: 1.8rem;
    box-shadow: 0 16px 30px rgba(124, 58, 237, 0.14);
}

.rfm2-command-title h1 {
    margin: 3px 0 0;
    color: #17233d;
    font-size: clamp(1.72rem, 2.25vw, 2.24rem);
    font-weight: 780;
    letter-spacing: -0.015em;
    line-height: 1.05;
}

.rfm2-command-title p {
    max-width: 760px;
    margin: 7px 0 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.45;
    font-weight: 560;
}

.rfm2-command-title .insight-kicker {
    min-height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6d28d9;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    box-shadow: none;
}

.rfm2-total-card {
    min-width: 255px;
    min-height: 84px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 17px;
    border: 1px solid #e1e8f2;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.rfm2-total-icon {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #f3e8ff;
    color: #7c3aed;
    font-size: 1.3rem;
}

.rfm2-total-card span:not(.rfm2-total-icon) {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.rfm2-total-card strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-size: 1.42rem;
    line-height: 1;
    font-weight: 900;
}

.rfm2-total-card small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 750;
}

.rfm2-filter-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 16px;
    width: 100%;
}

.rfm2-filter-form .filter-field {
    min-width: 0;
}

.rfm2-command-center .rfm-input-shell {
    min-height: 50px;
}

.rfm2-command-center .rfm-input-shell .form-control,
.rfm2-command-center .rfm-input-shell .form-select {
    min-height: 48px;
    font-size: 0.92rem;
}

.rfm2-filter-top {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.95fr) auto;
    align-items: end;
    gap: 24px;
}

.rfm2-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding-left: 24px;
    border-left: 1px solid #e5edf6;
}

.rfm2-filter-actions .rfm-filter-submit,
.rfm2-filter-actions .rfm-clear-filter {
    min-width: 150px;
    min-height: 46px;
    font-size: 0.92rem;
}

.rfm2-filter-actions .rfm-filter-submit {
    border-color: #2563eb;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.rfm2-filter-actions .rfm-clear-filter {
    min-width: 126px;
    padding-inline: 18px;
}

.rfm2-period-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.rfm2-period-panel {
    min-width: 0;
    margin: 0;
    padding: 14px 16px 16px;
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    background: #fbfdff;
}

.rfm2-period-panel legend {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    float: none;
    width: auto;
    margin: 0 0 8px;
    padding: 0;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.rfm2-period-panel legend i {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
}

.rfm2-period-panel:nth-of-type(2) legend {
    color: #6d28d9;
}

.rfm2-period-panel:nth-of-type(2) legend i {
    background: #f5f3ff;
    color: #7c3aed;
}

.rfm2-period-switch {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    background: #fff;
    color: #475569;
    font-size: 1rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.rfm2-period-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 12px;
}

.rfm2-card {
    position: relative;
    overflow: hidden;
    border-color: #d8e3ef;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.065);
}

.rfm2-card::before {
    content: none;
}

.rfm2-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 52px;
    padding: 12px 18px;
    border-bottom: 1px solid #e8eef6;
    background: #ffffff;
}

.rfm2-compact-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 820;
    letter-spacing: 0;
}

.rfm2-compact-header span {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 650;
}

.rfm2-compact-header strong {
    color: #2563eb;
    font-weight: 850;
}

.rfm2-executive-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 9px 18px;
    border-bottom: 1px solid #e8eef6;
    background: #fbfdff;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.rfm2-executive-strip span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rfm2-executive-strip span + span::before {
    content: "";
    width: 4px;
    height: 4px;
    margin-right: 5px;
    border-radius: 50%;
    background: #cbd5e1;
}

.rfm2-executive-strip strong {
    color: #0f172a;
    font-weight: 900;
}

.rfm2-table-wrap {
    max-height: 680px;
    background: #fff;
}

.rfm2-table {
    min-width: 1540px;
    margin: 0;
    font-size: 0.92rem;
    table-layout: fixed;
}

.rfm2-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 10px 12px;
    border-color: #e8eef6;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 820;
    text-align: center;
    vertical-align: middle;
}

.rfm2-table thead tr:nth-child(2) th {
    top: 41px;
    background: #ffffff;
    font-size: 0.76rem;
}

.rfm2-table thead .rfm2-head-previous,
.rfm2-table thead tr:nth-child(2) th:nth-child(1),
.rfm2-table thead tr:nth-child(2) th:nth-child(2),
.rfm2-table thead tr:nth-child(2) th:nth-child(3),
.rfm2-table thead tr:nth-child(2) th:nth-child(4) {
    background: #f8fbff;
    color: #1d4ed8;
}

.rfm2-table thead .rfm2-head-current,
.rfm2-table thead tr:nth-child(2) th:nth-child(5),
.rfm2-table thead tr:nth-child(2) th:nth-child(6),
.rfm2-table thead tr:nth-child(2) th:nth-child(7),
.rfm2-table thead tr:nth-child(2) th:nth-child(8) {
    background: #fbf9ff;
    color: #6d28d9;
}

.rfm2-table thead .rfm2-head-variation,
.rfm2-table thead tr:nth-child(2) th:nth-child(9),
.rfm2-table thead tr:nth-child(2) th:nth-child(10) {
    background: #fffaf0;
    color: #9a6700;
}

.rfm2-table thead .rfm2-head-movement,
.rfm2-table thead tr:nth-child(2) th:nth-child(11),
.rfm2-table thead tr:nth-child(2) th:nth-child(12) {
    background: #f7fafc;
    color: #334155;
}

.rfm2-head-previous,
.rfm2-head-current,
.rfm2-head-variation,
.rfm2-head-movement {
    border-left: 1px solid #dce5f0 !important;
}

.rfm2-table tbody td,
.rfm2-table tfoot th {
    height: 46px;
    padding: 8px 12px;
    border-color: rgba(15, 23, 42, 0.07);
    color: #111827;
    font-size: 0.94rem;
    line-height: 1.15;
    white-space: nowrap;
}

.rfm2-table tbody tr:hover td {
    filter: brightness(0.98);
}

.rfm2-segment-col,
.rfm2-segment-name {
    width: 270px;
    min-width: 270px;
    text-align: left !important;
}

.rfm2-segment-name {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 780;
    white-space: nowrap;
}

.rfm2-segment-name::before {
    content: none;
}

.rfm2-segment-icon {
    width: 25px;
    height: 25px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    color: #fff;
    font-size: 0.82rem;
    box-shadow: none;
}

.rfm2-quadrante-verde td {
    background: #ffffff;
}

.rfm2-quadrante-azul td {
    background: #ffffff;
}

.rfm2-quadrante-amarelo td {
    background: #ffffff;
}

.rfm2-quadrante-vermelho td {
    background: #ffffff;
}

.rfm2-table tbody tr:nth-child(even) td {
    background: #fbfdff;
}

.rfm2-quadrante-verde .rfm2-segment-icon {
    background: #16a34a;
}

.rfm2-quadrante-azul .rfm2-segment-icon {
    background: #2563eb;
}

.rfm2-quadrante-amarelo .rfm2-segment-icon {
    background: #d97706;
}

.rfm2-quadrante-vermelho .rfm2-segment-icon {
    background: #dc2626;
}

.rfm2-arrow-cell {
    width: 86px;
    background: #ffffff !important;
}

.rfm2-money-cell {
    min-width: 132px;
    font-variant-numeric: tabular-nums;
}

.rfm2-arrow {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    background: #fff;
    font-size: 1.15rem;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.rfm2-arrow-green {
    color: #00a651;
}

.rfm2-arrow-red {
    color: #ff0000;
}

.rfm2-arrow-gray {
    color: #b6b6b6;
}

.rfm2-arrow-black {
    color: #4b4b4b;
}

.rfm2-arrow-orange {
    color: #ffbe00;
}

.rfm2-table tfoot th {
    position: sticky;
    bottom: 0;
    z-index: 2;
    border-color: rgba(255, 255, 255, 0.22);
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 900;
}

.rfm2-flow-in-text {
    color: #059669 !important;
    font-weight: 850;
}

.rfm2-flow-out-text {
    color: #ef4444 !important;
    font-weight: 850;
}

.rfm2-table .rfm2-flow-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 34px;
    color: inherit !important;
    font-weight: 900;
    text-decoration: none;
}

.rfm2-table .rfm2-flow-link:hover,
.rfm2-table .rfm2-flow-link:focus {
    color: inherit !important;
    text-decoration: underline;
}

.rfm2-detail-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 30px;
    border: 1px solid #dce6f2;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}

.rfm2-detail-hero::after {
    content: "";
    position: absolute;
    inset: auto 34px -56px auto;
    width: 220px;
    height: 105px;
    border: 1px solid rgba(37, 99, 235, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.rfm2-detail-title {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.rfm2-detail-icon {
    width: 62px;
    height: 62px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    color: #ffffff;
    font-size: 1.55rem;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.13);
}

.rfm2-detail-icon-in {
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
}

.rfm2-detail-icon-out {
    background: linear-gradient(135deg, #ef4444 0%, #7c3aed 100%);
}

.rfm2-detail-title h1 {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: clamp(1.65rem, 2vw, 2.15rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.08;
}

.rfm2-detail-title p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 650;
}

.rfm2-detail-title strong {
    color: #2563eb;
}

.rfm2-detail-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.rfm2-detail-metric {
    min-width: 112px;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fbfdff;
}

.rfm2-detail-metric::before {
    content: "\F4CF";
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    font-family: "bootstrap-icons";
    font-size: 0.95rem;
}

.rfm2-detail-metric span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.rfm2-detail-metric strong {
    display: block;
    margin-top: 2px;
    color: #0f172a;
    font-size: 1.18rem;
    line-height: 1;
    font-weight: 900;
}

.rfm2-detail-export {
    min-width: 132px;
    min-height: 44px;
    padding-inline: 16px;
    border-color: #2563eb;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.rfm2-detail-actions .rfm-clear-filter {
    min-width: 118px;
    min-height: 44px;
    padding-inline: 16px;
    font-weight: 800;
}

.rfm2-detail-card {
    overflow: hidden;
}

.rfm2-detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 62px;
    padding: 14px 18px;
    border-bottom: 1px solid #e8eef6;
    background: #ffffff;
}

.rfm2-detail-toolbar h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 880;
}

.rfm2-detail-toolbar span:not(.rfm2-detail-chip) {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 650;
}

.rfm2-detail-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 850;
}

.rfm2-detail-chip-in {
    background: #ecfdf5;
    color: #047857;
}

.rfm2-detail-chip-out {
    background: #fef2f2;
    color: #dc2626;
}

.rfm2-detail-table {
    min-width: 1480px;
    table-layout: auto;
}

.rfm2-detail-table th,
.rfm2-detail-table td {
    text-align: left !important;
    vertical-align: middle;
}

.rfm2-detail-table thead th {
    padding-block: 13px;
    background: #f8fbff;
    color: #475569;
    font-size: 0.73rem;
    text-transform: uppercase;
}

.rfm2-detail-table thead tr:nth-child(2) th {
    top: 43px;
}

.rfm2-detail-table thead .rfm2-detail-rfm-head,
.rfm2-detail-table thead .rfm2-detail-score-head {
    text-align: center !important;
}

.rfm2-detail-table thead .rfm2-detail-rfm-head-previous,
.rfm2-detail-table thead .rfm2-detail-score-head-previous {
    border-color: #dbeafe;
    background: #f5f9ff;
    color: #1d4ed8;
}

.rfm2-detail-table thead .rfm2-detail-rfm-head-current,
.rfm2-detail-table thead .rfm2-detail-score-head-current {
    border-color: #ede9fe;
    background: #faf7ff;
    color: #6d28d9;
}

.rfm2-detail-table tbody td {
    height: 54px;
    white-space: normal;
}

.rfm2-detail-cpf {
    width: 136px;
    color: #475569;
    font-weight: 620;
    white-space: nowrap !important;
}

.rfm2-detail-client {
    min-width: 270px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
}

.rfm2-detail-score-cell {
    width: 52px;
    padding-inline: 6px !important;
    text-align: center !important;
}

.rfm2-score-pill {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #dbeafe;
    border-radius: 50%;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}

.rfm2-score-pill-current {
    border-color: #ede9fe;
    background: #f5f3ff;
    color: #6d28d9;
}

.rfm2-code-pill,
.rfm2-segment-pill,
.rfm2-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 780;
    white-space: nowrap;
}

.rfm2-code-pill {
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
}

.rfm2-code-pill-current {
    border-color: #ede9fe;
    background: #f5f3ff;
    color: #6d28d9;
}

.rfm2-segment-pill {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
}

.rfm2-segment-pill-current {
    border-color: #d1fae5;
    background: #ecfdf5;
    color: #047857;
}

.rfm2-status-pill {
    background: #f8fafc;
    color: #475569;
}

.rfm2-table-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px 18px 18px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fbfdff;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 650;
}

.rfm2-legend-info,
.rfm2-legend-items,
.rfm2-legend-items span {
    display: flex;
    align-items: center;
    gap: 9px;
}

.rfm2-legend-info i {
    color: #3b82f6;
    font-size: 1rem;
}

.rfm2-legend-items {
    gap: 18px;
    flex-wrap: wrap;
}

.rfm2-legend-items i {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
}

.rfm2-legend-green {
    color: #22c55e;
}

.rfm2-legend-red {
    color: #ef4444;
}

.rfm2-legend-gray {
    color: #64748b;
}

.rfm2-legend-orange {
    color: #ffbe00;
}

@media (max-width: 1380px) {
    .rfm2-command-hero {
        align-items: stretch;
    }

    .rfm2-filter-top {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }

    .rfm2-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-left: 0;
        border-left: 0;
    }

    .rfm2-period-grid {
        grid-template-columns: 1fr;
    }

    .rfm2-period-switch {
        justify-self: center;
        transform: rotate(90deg);
    }
}

@media (max-width: 760px) {
    .rfm2-command-center {
        padding: 20px;
    }

    .rfm2-command-hero,
    .rfm2-command-title,
    .rfm2-filter-top,
    .rfm2-period-fields {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .rfm2-total-card {
        min-width: 0;
    }

    .rfm2-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .rfm2-filter-actions .rfm-filter-submit,
    .rfm2-filter-actions .rfm-clear-filter {
        width: 100%;
    }

    .rfm2-compact-header,
    .rfm2-table-legend {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Main RFM command center - final precedence */
.rfm-main-page {
    gap: 20px !important;
}

.rfm-main-command-center {
    padding: 24px 28px 26px;
}

.rfm-main-command-center .rfm2-command-hero {
    align-items: center;
    margin-bottom: 18px;
}

.rfm-main-command-center .rfm-main-title-stack {
    display: block;
    min-width: 0;
}

.rfm-main-hero-tools {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 12px;
}

.rfm-dashboard-shortcut {
    min-width: 100px;
    min-height: 84px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    padding: 12px 15px;
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
    color: #6d28d9;
    font-size: 0.78rem;
    font-weight: 850;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.08);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.rfm-dashboard-shortcut i {
    font-size: 1.35rem;
}

.rfm-dashboard-shortcut:hover,
.rfm-dashboard-shortcut:focus-visible {
    border-color: #8b5cf6;
    color: #5b21b6;
    box-shadow: 0 16px 32px rgba(124, 58, 237, 0.16);
    transform: translateY(-2px);
}

.rfm-dashboard-shortcut:focus-visible {
    outline: 3px solid rgba(139, 92, 246, 0.18);
    outline-offset: 2px;
}

.rfm-main-command-center .rfm-main-total-card {
    min-width: 238px;
}

.rfm-main-command-center .rfm-main-filter-form {
    grid-template-columns:
        minmax(230px, 1.15fr)
        minmax(220px, 1fr)
        minmax(165px, 0.7fr)
        minmax(270px, 1.25fr);
    gap: 14px 12px;
    padding-top: 18px;
    border-top: 1px solid #e8eef6;
}

.rfm-main-command-center .rfm-main-date-range {
    grid-column: 1 / 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(210px, 235px));
    gap: 12px;
}

.rfm-main-command-center .rfm-field-segmento {
    grid-column: 3 / 4;
}

.rfm-main-command-center .rfm-filter-actions {
    grid-column: 4 / 5;
    align-self: end;
    justify-content: flex-end;
    gap: 14px;
    padding: 0;
    border-left: 0;
}

.rfm-main-command-center .rfm-input-shell {
    min-height: 50px;
    border-color: #dbe5ef;
    background: #fbfdff;
}

.rfm-main-command-center .rfm-input-shell .form-control,
.rfm-main-command-center .rfm-input-shell .form-select {
    min-height: 48px;
    font-size: 0.92rem;
}

.rfm-main-command-center .rfm-filter-submit,
.rfm-main-command-center .rfm-clear-filter {
    min-width: 150px;
    min-height: 48px;
    font-size: 0.92rem;
}

.rfm-main-command-center .rfm-filter-submit {
    border-color: #2563eb;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.rfm-main-command-center .rfm-clear-filter {
    min-width: 126px;
}

.rfm-main-page .rfm-main-result-card {
    margin-top: 0;
}

@media (max-width: 1180px) {
    .rfm-main-command-center .rfm-main-filter-form {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .rfm-main-command-center .rfm-main-date-range {
        grid-column: 1 / -1;
    }

    .rfm-main-command-center .rfm-field-segmento {
        grid-column: 1 / -1;
        max-width: 360px;
    }

    .rfm-main-command-center .rfm-filter-actions {
        grid-column: 1 / -1;
        padding-left: 0;
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .rfm-main-command-center {
        padding: 20px;
    }

    .rfm-main-hero-tools {
        width: 100%;
        flex-direction: column;
    }

    .rfm-dashboard-shortcut {
        min-height: 48px;
        flex-direction: row;
    }

    .rfm-main-command-center .rfm-main-filter-form {
        grid-template-columns: 1fr;
    }

    .rfm-main-command-center .rfm-main-date-range {
        grid-template-columns: 1fr;
    }

    .rfm-main-command-center .rfm-field-segmento {
        max-width: none;
    }

    .rfm-main-command-center .rfm-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .rfm-main-command-center .rfm-filter-submit,
    .rfm-main-command-center .rfm-clear-filter {
        width: 100%;
    }
}

/* Notes command center */
.notes-page {
    gap: 20px !important;
}

.notes-command-center {
    padding: 24px 28px 26px;
}

.notes-command-center .rfm2-command-hero {
    align-items: center;
    margin-bottom: 18px;
}

.notes-command-center .notes-hero-icon {
    background: linear-gradient(135deg, #ede9fe 0%, #f3e8ff 100%);
    color: #7c3aed;
}

.notes-command-center .notes-total-card {
    min-width: 238px;
}

.notes-command-center .notes-filter-form {
    grid-template-columns: minmax(260px, 1.05fr) minmax(180px, 0.62fr) minmax(300px, 1.2fr) auto;
    align-items: end;
    gap: 14px 12px;
    padding-top: 18px;
    border-top: 1px solid #e8eef6;
}

.notes-command-center .notes-filter-actions {
    grid-column: 4;
    align-self: end;
    justify-content: flex-end;
    gap: 12px;
    padding-left: 0;
    border-left: 0;
}

.notes-command-center .rfm-filter-submit,
.notes-command-center .rfm-clear-filter {
    min-height: 48px;
    font-size: 0.92rem;
}

.notes-command-center .rfm-filter-submit {
    min-width: 154px;
    border-color: #2563eb;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.notes-command-center .rfm-clear-filter {
    min-width: 112px;
}

.notes-result-card .grid-card-header {
    min-height: 64px;
}

.notes-summary-strip {
    min-height: 42px;
}

@media (max-width: 1180px) {
    .notes-command-center .notes-filter-form {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .notes-command-center .notes-filter-actions {
        grid-column: 1 / -1;
        padding-left: 0;
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .notes-command-center {
        padding: 20px;
    }

    .notes-command-center .rfm2-command-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .notes-command-center .notes-filter-form {
        grid-template-columns: 1fr;
    }

    .notes-command-center .notes-total-card {
        min-width: 0;
    }

    .notes-command-center .notes-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .notes-command-center .rfm-filter-submit,
    .notes-command-center .rfm-clear-filter {
        width: 100%;
    }
}

/* New customers command center */
.customers-page {
    gap: 20px !important;
}

.customers-command-center {
    padding: 24px 28px 26px;
}

.customers-command-center .rfm2-command-hero {
    align-items: center;
    margin-bottom: 18px;
}

.customers-command-center .customers-hero-icon {
    background: linear-gradient(135deg, #ede9fe 0%, #f3e8ff 100%);
    color: #7c3aed;
}

.customers-command-center .customers-total-card {
    min-width: 250px;
}

.customers-command-center .customers-modern-filter-form {
    grid-template-columns: minmax(280px, 1.15fr) minmax(210px, 0.72fr) minmax(210px, 0.72fr) auto;
    align-items: end;
    gap: 14px 12px;
    padding-top: 18px;
    border-top: 1px solid #e8eef6;
}

.customers-command-center .customers-modern-filter-actions {
    grid-column: 4;
    align-self: end;
    justify-content: flex-end;
    gap: 12px;
    padding-left: 0;
    border-left: 0;
}

.customers-command-center .rfm-filter-submit,
.customers-command-center .rfm-clear-filter {
    min-height: 48px;
    font-size: 0.92rem;
}

.customers-command-center .rfm-filter-submit {
    min-width: 142px;
    border-color: #2563eb;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.customers-command-center .rfm-clear-filter {
    min-width: 112px;
}

.customers-result-card .grid-card-header {
    min-height: 64px;
}

.customers-summary-strip {
    min-height: 42px;
}

@media (max-width: 1180px) {
    .customers-command-center .customers-modern-filter-form {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .customers-command-center .customers-modern-filter-actions {
        grid-column: 1 / -1;
        padding-left: 0;
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .customers-command-center {
        padding: 20px;
    }

    .customers-command-center .rfm2-command-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .customers-command-center .customers-modern-filter-form {
        grid-template-columns: 1fr;
    }

    .customers-command-center .customers-total-card {
        min-width: 0;
    }

    .customers-command-center .customers-modern-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .customers-command-center .rfm-filter-submit,
    .customers-command-center .rfm-clear-filter {
        width: 100%;
    }
}

/* Database upload command center */
.upload-page {
    gap: 20px !important;
}

.upload-command-center {
    display: block;
    padding: 24px 28px 26px;
}

.upload-command-center .upload-command-hero {
    align-items: center;
    margin-bottom: 18px;
}

.upload-command-center .upload-hero-icon {
    background: linear-gradient(135deg, #ede9fe 0%, #f3e8ff 100%);
    color: #7c3aed;
}

.upload-command-center .upload-status-card {
    min-width: 238px;
}

.upload-modern-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid #e8eef6;
}

.upload-modern-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid #dbe5ef;
    border-radius: 13px;
    background: #fbfdff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.upload-modern-card:hover {
    border-color: #c7d5e5;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
}

.upload-modern-card-header {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 16px;
}

.upload-modern-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.2rem;
}

.upload-modern-card-sales .upload-modern-icon {
    background: #ecfdf5;
    color: #059669;
}

.upload-modern-eyebrow {
    display: block;
    margin-bottom: 2px;
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.upload-modern-card-sales .upload-modern-eyebrow {
    color: #059669;
}

.upload-modern-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.02rem;
    font-weight: 850;
}

.upload-modern-card p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 560;
    line-height: 1.4;
}

.upload-drop-field {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 5px 12px;
    padding: 14px;
    border: 1px dashed #b9c9dc;
    border-radius: 11px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.upload-drop-field:hover,
.upload-drop-field:focus-within {
    border-color: #7c3aed;
    background: #fcfaff;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.08);
}

.upload-drop-icon {
    grid-row: 1;
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    background: #f5f3ff;
    color: #7c3aed;
    font-size: 1.05rem;
}

.upload-drop-copy {
    min-width: 0;
}

.upload-drop-copy strong,
.upload-drop-copy small {
    display: block;
}

.upload-drop-copy strong {
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 800;
}

.upload-drop-copy small {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 560;
}

.upload-drop-field .form-control {
    grid-column: 1 / -1;
    min-height: 44px;
    margin-top: 7px;
    border-color: #dbe5ef;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.83rem;
}

.upload-drop-field .form-control::file-selector-button {
    min-height: 42px;
    margin: -1px 12px -1px -12px;
    padding-inline: 14px;
    border: 0;
    border-right: 1px solid #dbe5ef;
    background: #f1f5f9;
    color: #334155;
    font-weight: 750;
}

.upload-modern-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8eef6;
}

.upload-modern-actions p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
}

.upload-modern-actions p i {
    color: #2563eb;
}

.upload-modern-actions > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-modern-actions .rfm-clear-filter,
.upload-modern-actions .rfm-filter-submit {
    min-height: 48px;
    font-size: 0.92rem;
}

.upload-modern-actions .rfm-clear-filter {
    min-width: 112px;
}

.upload-modern-actions .rfm-filter-submit {
    min-width: 176px;
    border-color: #2563eb;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

@media (max-width: 900px) {
    .upload-modern-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .upload-command-center {
        padding: 20px;
    }

    .upload-command-center .upload-command-hero,
    .upload-modern-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .upload-command-center .upload-status-card {
        min-width: 0;
    }

    .upload-modern-actions > div {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .upload-modern-actions .rfm-clear-filter,
    .upload-modern-actions .rfm-filter-submit {
        width: 100%;
    }
}

/* RFM column drawer layering and readability */
.rfm-main-command-center .rfm-main-filter-form {
    z-index: auto;
}

.offcanvas-backdrop.show {
    z-index: 2000 !important;
    opacity: 0.58;
}

.rfm-column-offcanvas {
    --bs-offcanvas-width: 600px;
    z-index: 2005 !important;
    width: min(600px, 100vw) !important;
    border-left-color: #dce6f2;
    box-shadow: -32px 0 72px rgba(15, 23, 42, 0.22);
}

body:has(.rfm-column-offcanvas.show) .rfm-table thead th:first-child,
body:has(.rfm-column-offcanvas.show) .rfm-table thead th:nth-child(2),
body:has(.rfm-column-offcanvas.show) .rfm-table tbody td:first-child,
body:has(.rfm-column-offcanvas.show) .rfm-table tbody td:nth-child(2) {
    z-index: 0 !important;
}

.rfm-column-offcanvas .rfm-column-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.rfm-column-offcanvas .rfm-column-action,
.rfm-column-offcanvas .rfm-column-reset {
    width: 100%;
    min-height: 42px;
    padding-inline: 10px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.rfm-column-offcanvas .rfm-column-option {
    align-items: center;
    min-height: 42px;
    line-height: 1.25;
}

@media (max-width: 620px) {
    .rfm-column-offcanvas .rfm-column-tools,
    .rfm-column-offcanvas .rfm-column-options {
        grid-template-columns: 1fr;
    }
}

/* Detail RFM headers use their semantic period colors. */
.rfm2-command-center::before {
    content: none !important;
}

.rfm2-detail-table thead th.rfm2-detail-rfm-head-previous,
.rfm2-detail-table thead th.rfm2-detail-score-head-previous {
    border-color: #dbeafe !important;
    background: #f5f9ff !important;
    color: #1d4ed8 !important;
}

.rfm2-detail-table thead th.rfm2-detail-rfm-head-current,
.rfm2-detail-table thead th.rfm2-detail-score-head-current {
    border-color: #ede9fe !important;
    background: #faf7ff !important;
    color: #6d28d9 !important;
}
