@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
    --font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: #eef2ff;
    --color-primary-dark: #3730a3;
    --color-sidebar-bg: #0c111d;
    --color-sidebar-item-hover: #1e293b;
    --color-sidebar-active: #6366f1;
    --color-bg: #f8fafc;
    --color-card-bg: #ffffff;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --color-text-main: #0f172a;
    --color-text-muted: #64748b;
    --color-text-sub: #94a3b8;

    --color-saludable-bg: #ecfdf5;
    --color-saludable-text: #059669;
    --color-saludable-border: #a7f3d0;

    --color-observacion-bg: #fffbeb;
    --color-observacion-text: #d97706;
    --color-observacion-border: #fde68a;

    --color-riesgo-bg: #fef2f2;
    --color-riesgo-text: #dc2626;
    --color-riesgo-border: #fecaca;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* App Layout Grid */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    height: 100vh;
    background-color: var(--color-sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    flex-shrink: 0;
    border-right: 1px solid #1e293b;
    z-index: 40;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-icon img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    display: block;
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--color-sidebar-item-hover);
    color: #ffffff;
}

.nav-link.active {
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Main Content Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    margin-left: 260px;
    min-width: 0;
}

/* Top Navbar */
.app-header {
    height: 70px;
    background-color: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.breadcrumbs a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
}

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

.breadcrumbs .current {
    color: var(--color-text-main);
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar-header {
    position: relative;
    width: 380px;
}

.search-bar-header input {
    width: 100%;
    padding: 9px 16px 9px 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: #f8fafc;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--color-text-main);
    outline: none;
    transition: all 0.2s;
}

.search-bar-header input:focus {
    background-color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-bar-header svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-sub);
    width: 18px;
    height: 18px;
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.user-profile-menu:hover {
    background-color: var(--color-border-light);
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: #e0e7ff;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main);
}

/* Page Body */
.page-content {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

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

.page-title-group h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-text-main);
    letter-spacing: -0.02em;
}

.page-title-group p {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--color-text-main);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-border-light);
}

.btn-danger {
    background-color: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Metric KPI Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-card.card-risk {
    border-color: var(--color-riesgo-border);
}

.metric-card-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-card-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1;
}

.metric-card-value.text-saludable {
    color: #059669;
}

.metric-card-value.text-observacion {
    color: #d97706;
}

.metric-card-value.text-riesgo {
    color: #dc2626;
}

.metric-card-trend {
    margin-top: 10px;
    font-size: 12.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-card-trend.trend-up {
    color: #059669;
}

.metric-card-trend.trend-risk {
    color: #dc2626;
}

.metric-card-trend.trend-neutral {
    color: var(--color-text-muted);
}

/* Alert Banner */
.alert-risk-banner {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.alert-risk-banner svg {
    width: 24px;
    height: 24px;
    color: #dc2626;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-risk-title {
    font-weight: 700;
    color: #991b1b;
    font-size: 15px;
}

.alert-risk-desc {
    color: #b91c1c;
    font-size: 13.5px;
    margin-top: 2px;
}

/* Data Tables */
.table-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-toolbar {
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.table-search-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.input-search-table {
    width: 280px;
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    outline: none;
    font-family: inherit;
}

.input-search-table:focus {
    border-color: var(--color-primary);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 14px 20px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background-color: #f8fafc;
    border-bottom: 1px solid var(--color-border);
}

.custom-table td {
    padding: 16px 20px;
    font-size: 13.5px;
    color: var(--color-text-main);
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

.custom-table tbody tr:hover {
    background-color: #f8fafc;
}

.table-pagination {
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border-light);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-saludable {
    background-color: var(--color-saludable-bg);
    color: var(--color-saludable-text);
    border-color: var(--color-saludable-border);
}

.badge-observacion {
    background-color: var(--color-observacion-bg);
    color: var(--color-observacion-text);
    border-color: var(--color-observacion-border);
}

.badge-riesgo {
    background-color: var(--color-riesgo-bg);
    color: var(--color-riesgo-text);
    border-color: var(--color-riesgo-border);
}

/* Priority Badges */
.badge-priority-critical {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-priority-high {
    background-color: #f3f4f6;
    color: #374151;
}

.badge-priority-medium {
    background-color: #f3f4f6;
    color: #4b5563;
}

.badge-priority-low {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Status Badges */
.badge-status-open {
    background-color: #f1f5f9;
    color: #334155;
}

.badge-status-in-progress {
    color: #6366f1;
    background-color: #eef2ff;
}

.badge-status-resolved {
    color: #059669;
    background-color: #ecfdf5;
}

.badge-status-closed {
    color: #64748b;
    background-color: #f8fafc;
}

/* Health Score Bar */
.health-score-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-score-val {
    font-weight: 700;
    font-size: 13.5px;
    min-width: 24px;
}

.health-bar-bg {
    width: 70px;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
}

.health-bar-fill.fill-green {
    background-color: #10b981;
}

.health-bar-fill.fill-amber {
    background-color: #f59e0b;
}

.health-bar-fill.fill-red {
    background-color: #ef4444;
}

/* Days Badge */
.badge-days-circle {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background-color: #fee2e2;
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

/* Auth / Wizard Pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    padding: 32px 16px;
}

.auth-card {
    background-color: var(--color-card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.auth-header {
    padding: 36px 36px 20px 36px;
    text-align: center;
}

.auth-logo {
    width: 110px;
    height: 110px;
    margin: 0 auto 18px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    display: block;
}

.auth-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-text-main);
}

.auth-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-top: 20px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.auth-body {
    padding: 32px 36px 36px 36px;
}

/* Wizard Steps Indicator */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    position: relative;
}

.wizard-steps::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 20%;
    right: 20%;
    height: 2px;
    background-color: var(--color-border);
    z-index: 1;
}

.wizard-step-circle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background-color: #e2e8f0;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    z-index: 2;
    position: relative;
    margin: 0 30px;
}

.wizard-step-circle.active {
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.wizard-step-circle.completed {
    background-color: var(--color-primary);
    color: #ffffff;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text-main);
    outline: none;
    transition: all 0.2s;
    background-color: #ffffff;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Chat & Messages Thread */
.conversation-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

.chat-bubble {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.chat-bubble.from-client {
    align-self: flex-start;
}

.chat-bubble.from-agent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bubble-content {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.5;
}

.chat-bubble.from-client .bubble-content {
    background-color: #f1f5f9;
    color: var(--color-text-main);
    border-bottom-left-radius: var(--radius-sm);
}

.chat-bubble.from-agent .bubble-content {
    background-color: #eef2ff;
    color: #1e1b4b;
    border-bottom-right-radius: var(--radius-sm);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--color-text-muted);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    background-color: #f8fafc;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   DASHBOARD SPECIALIZED STYLES (Match Prototypes & Enterprise UX)
   ========================================================================== */

/* Period Selector */
.dashboard-period-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    box-shadow: var(--shadow-sm);
}

.dashboard-period-selector svg {
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
}

.dashboard-period-selector select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main);
    outline: none;
    cursor: pointer;
}

/* KPI Top Grid */
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.dash-kpi-card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.dash-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dash-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dash-kpi-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dash-kpi-icon-box {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-kpi-icon-box svg {
    width: 18px;
    height: 18px;
}

.kpi-icon-blue {
    background-color: #eff6ff;
    color: #2563eb;
}

.kpi-icon-purple {
    background-color: #f5f3ff;
    color: #7c3aed;
}

.kpi-icon-yellow {
    background-color: #fef3c7;
    color: #d97706;
}

.kpi-icon-green {
    background-color: #ecfdf5;
    color: #059669;
}

.dash-kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1.1;
    margin-bottom: 10px;
}

.dash-kpi-unit {
    font-size: 18px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.dash-kpi-unit-bold {
    font-size: 18px;
    color: var(--color-text-main);
    font-weight: 700;
}

.dash-kpi-footer {
    font-size: 13px;
    font-weight: 500;
}

.text-trend-green {
    color: #059669;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dash-kpi-alert-red {
    color: var(--color-text-main);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot-red {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #dc2626;
    display: inline-block;
}

.text-muted-desc {
    color: var(--color-text-muted);
    font-size: 13px;
}

/* Two Column Grid */
.dashboard-two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Generic Dashboard Card */
.dash-card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dash-card-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-title-icon {
    width: 22px;
    height: 22px;
}

.icon-purple {
    color: #7c3aed;
}
.icon-blue {
    color: #2563eb;
}
.icon-yellow {
    color: #d97706;
}
.icon-red {
    color: #dc2626;
}

.dash-card-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-text-main);
}

.dash-card-link {
    font-size: 13px;
    font-weight: 600;
    color: #7c3aed;
    text-decoration: none;
    transition: color 0.15s ease;
}

.dash-card-link:hover {
    color: #5b21b6;
    text-decoration: underline;
}

.dash-card-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.dash-card-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Multi Segment Distribution Bar */
.health-multi-bar {
    display: flex;
    height: 10px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background-color: #f1f5f9;
    margin-bottom: 20px;
    gap: 2px;
}

.health-bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.segment-green {
    background-color: #10b981;
}
.segment-yellow {
    background-color: #f59e0b;
}
.segment-red {
    background-color: #ef4444;
}

/* Health Metrics 3 Boxes */
.health-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.health-metric-box {
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.box-green {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.box-yellow {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
}

.box-red {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
}

.health-box-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.dot-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-green {
    background-color: #10b981;
}
.dot-yellow {
    background-color: #f59e0b;
}
.dot-red {
    background-color: #ef4444;
}
.dot-blue {
    background-color: #3b82f6;
}
.dot-purple {
    background-color: #8b5cf6;
}
.dot-darkred {
    background-color: #991b1b;
}

.health-box-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1.1;
}

.health-box-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Tickets Status Grid (6 Tiles) */
.tickets-status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.ticket-tile {
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
    border: 1px solid transparent;
}

.ticket-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.tile-blue {
    background-color: #eff6ff;
    border-color: #dbeafe;
}
.tile-purple {
    background-color: #f5f3ff;
    border-color: #ede9fe;
}
.tile-yellow {
    background-color: #fffbeb;
    border-color: #fef3c7;
}
.tile-red {
    background-color: #fef2f2;
    border-color: #fee2e2;
}
.tile-darkred {
    background-color: #fff1f2;
    border-color: #ffe4e6;
}
.tile-green {
    background-color: #ecfdf5;
    border-color: #d1fae5;
}

.ticket-tile-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-tile-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-main);
}

.ticket-tile-badge {
    font-size: 13px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.badge-blue {
    background-color: #dbeafe;
    color: #1d4ed8;
}
.badge-purple {
    background-color: #ede9fe;
    color: #6d28d9;
}
.badge-yellow {
    background-color: #fef3c7;
    color: #b45309;
}
.badge-red {
    background-color: #fee2e2;
    color: #b91c1c;
}
.badge-darkred {
    background-color: #ffe4e6;
    color: #9f1239;
}
.badge-green {
    background-color: #d1fae5;
    color: #047857;
}

/* Renovaciones Filter Chip Tabs */
.renovaciones-chip-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chip-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.15s ease;
}

.chip-tab:hover {
    background-color: #e2e8f0;
    color: var(--color-text-main);
}

.chip-tab.active {
    background-color: #ffffff;
    color: var(--color-text-main);
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.chip-tab.active.chip-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.chip-tab.active.chip-success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}

/* Renovaciones Table Enhancements */
.dash-renovaciones-table td {
    padding: 14px 16px;
}

.cliente-link-bold {
    font-weight: 700;
    color: var(--color-text-main);
    text-decoration: none;
}

.cliente-link-bold:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.dias-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}

.dias-danger {
    background-color: #fee2e2;
    color: #dc2626;
}

.dias-warning {
    background-color: #fef3c7;
    color: #d97706;
}

.dias-neutral {
    background-color: #f1f5f9;
    color: var(--color-text-muted);
}

.health-score-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}

.hs-saludable {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.hs-observacion {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.hs-riesgo {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* CSAT Card */
.csat-hero-block {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px;
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.csat-score-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 20px;
    border-right: 1px solid var(--color-border);
}

.csat-big-number {
    font-size: 34px;
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1;
    margin-bottom: 6px;
}

.csat-number-unit {
    font-size: 16px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.csat-stars-row {
    display: flex;
    gap: 2px;
    font-size: 16px;
}

.star-filled {
    color: #f59e0b;
}
.star-half {
    color: #f59e0b;
    opacity: 0.6;
}

.csat-text-col {
    flex: 1;
}

.csat-headline {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 4px;
}

.csat-subdesc {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.csat-boxes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.csat-metric-box {
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.box-neutral {
    background-color: #f8fafc;
    border: 1px solid var(--color-border);
}

.box-green-csat {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.box-yellow-csat {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
}

.csat-box-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.csat-box-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text-main);
}

.text-green {
    color: #059669;
}
.text-yellow {
    color: #d97706;
}

/* Alerts Card */
.badge-alert-count {
    background-color: #dc2626;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.15s ease;
}

.alert-item-row:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.alert-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-color-bar {
    width: 4px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}

.bar-danger {
    background-color: #dc2626;
}
.bar-warning {
    background-color: #d97706;
}
.bar-neutral {
    background-color: #94a3b8;
}

.alert-item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 2px;
}

.alert-item-desc {
    font-size: 12px;
    color: var(--color-text-muted);
}

.alert-item-chevron {
    font-size: 20px;
    color: #94a3b8;
    font-weight: 700;
}

.dash-card-link-sub {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 12px;
}

.dash-card-link-sub:hover {
    text-decoration: underline;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #f8fafc;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}

.activity-item-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.activity-avatar-box {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-avatar-box svg {
    width: 18px;
    height: 18px;
}

.act-icon-ticket-critico {
    background-color: #fee2e2;
    color: #dc2626;
}
.act-icon-csat-recibido {
    background-color: #d1fae5;
    color: #059669;
}
.act-icon-cliente-nuevo {
    background-color: #dbeafe;
    color: #2563eb;
}
.act-icon-renovacion-cambio {
    background-color: #ede9fe;
    color: #7c3aed;
}
.act-icon-ticket-resuelto {
    background-color: #d1fae5;
    color: #059669;
}

.activity-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 2px;
}

.activity-detail {
    font-size: 12px;
    color: var(--color-text-muted);
}

.activity-item-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.activity-time {
    font-size: 12px;
    color: var(--color-text-sub);
    font-weight: 500;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-two-col-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }
    .tickets-status-grid {
        grid-template-columns: 1fr 1fr;
    }
    .health-metrics-grid {
        grid-template-columns: 1fr;
    }
    .csat-hero-block {
        flex-direction: column;
        align-items: flex-start;
    }
    .csat-score-col {
        border-right: none;
        padding-right: 0;
        margin-bottom: 12px;
    }
}
