/* =====================================================
   REVIPRO DASHBOARD - ESTILOS MODERNOS SAAS
   ===================================================== */

/* ==================== BASE ==================== */
.dashboard-body {
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease;
}


/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}


.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    transition: all 0.3s;
}

.sidebar-logo-image {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.sidebar.collapsed .sidebar-logo span {
    display: none;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    z-index: 1001;
}

.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 3px;
    background: var(--text-primary);
    margin: 4px 0;
    transition: all 0.3s;
    border-radius: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: #f7fafc;
    color: var(--primary);
}

.sidebar-link.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

/* Coming Soon Links */
.sidebar-link.coming-soon {
    position: relative;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.sidebar-link.coming-soon:hover {
    background: transparent;
    color: var(--text-secondary);
}

.coming-soon-indicator {
    position: absolute;
    top: 0.4rem;
    right: 0.3rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 2.5px;
    padding: 0.08rem 0.5rem;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
    z-index: 10;
    transform: rotate(-1deg);
    animation: pulse 3s infinite;
    opacity: 0.85;
    height: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coming-soon-text {
    color: white;
    font-size: 0.47rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1;
    white-space: nowrap;
}

.coming-soon-indicator::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 6px;
    opacity: 0.3;
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: rotate(-1deg) scale(1);
        opacity: 0.85;
    }
    50% {
        transform: rotate(-1deg) scale(1.02);
        opacity: 0.75;
    }
}

.sidebar-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.sidebar.collapsed .sidebar-text {
    display: none;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .user-info {
    display: none;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #ef4444;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ==================== MAIN CONTENT ==================== */
.dashboard-main {
    margin-left: 280px;
    flex: 1;
    padding: 2rem;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background: #f8fafc;
}


.sidebar.collapsed + .dashboard-main {
    margin-left: 80px;
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

/* ==================== DASHBOARD HEADER ==================== */
.dashboard-header {
    margin-bottom: 2rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.beta-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mode-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid;
}

.mode-badge.mode-real {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: #10b981;
}

.mode-badge.mode-test {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: #f59e0b;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.toggle-label-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.3s;
}

.toggle-label-inline:hover {
    border-color: var(--primary);
    background: #fafbfc;
}

.toggle-label-inline input[type="checkbox"] {
    display: none;
}

.toggle-label-inline .toggle-switch {
    width: 44px;
    height: 24px;
    background: #cbd5e0;
    border-radius: 50px;
    position: relative;
    transition: all 0.3s;
}

.toggle-label-inline .toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
}

.toggle-label-inline input[type="checkbox"]:checked + .toggle-switch {
    background: var(--primary);
}

.toggle-label-inline input[type="checkbox"]:checked + .toggle-switch::after {
    left: 23px;
}

.toggle-text-inline {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn-generate {
    padding: 0.875rem 1.5rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    white-space: normal;
    text-align: center;
}

.btn-generate .btn-hint {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 500;
    display: inline-block;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
}

/* ==================== KPIs ==================== */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: white;
    padding: 1.75rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.2s; }
.kpi-card:nth-child(3) { animation-delay: 0.3s; }


.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.kpi-change {
    font-size: 0.85rem;
    font-weight: 500;
}

.kpi-change.positive {
    color: #10b981;
}

.kpi-change.warning {
    color: #f59e0b;
}

.kpi-change.negative {
    color: #ef4444;
}

/* ==================== REVIEWS CONTROLS ==================== */
.reviews-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--primary);
    outline: none;
}

.search-box {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box input::placeholder {
    color: var(--text-light);
}

/* ==================== REVIEWS TABLE ==================== */
.reviews-container {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}


.reviews-table-wrapper {
    overflow-x: auto;
}

.reviews-table {
    width: 100%;
    border-collapse: collapse;
}

.reviews-table thead {
    background: #f7fafc;
}

.reviews-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.reviews-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.reviews-table tbody tr {
    transition: all 0.2s;
}

.reviews-table tbody tr:hover {
    background: #fafbfc;
}

.reviewer-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.reviewer-avatar-small {
    width: 36px;
    height: 36px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.rating-stars {
    font-size: 1rem;
    white-space: nowrap;
}

.review-text-cell {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-pendiente {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.status-respondida {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.btn-respond {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    white-space: nowrap;
}

.btn-respond:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-respond:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.btn-view-response {
    background: #3b82f6;
}

.btn-view-response:hover {
    background: #2563eb;
}

/* ==================== CHARTS ==================== */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInUp 0.8s ease-out;
    animation-fill-mode: both;
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.chart-card:hover::before {
    opacity: 1;
}

.chart-card:nth-child(1) { animation-delay: 0.2s; }
.chart-card:nth-child(2) { animation-delay: 0.4s; }

.chart-card.full-width {
    display: none; /* Hide the third chart to focus on the two main charts */
}

.chart-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-card h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.chart-container {
    position: relative;
    height: 320px;
    background: white;
    border-radius: 12px;
    padding: 1rem;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ==================== INSIGHTS ==================== */
.insights-container {
    margin-top: 2rem;
}

.insights-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.insight-card {
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: all 0.3s;
}

.insight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.insight-card.positive {
    background: rgba(16, 185, 129, 0.05);
    border-color: #10b981;
}

.insight-card.warning {
    background: rgba(245, 158, 11, 0.05);
    border-color: #f59e0b;
}

.insight-card.info {
    background: rgba(59, 130, 246, 0.05);
    border-color: #3b82f6;
}

.insight-icon {
    font-size: 2rem;
    line-height: 1;
}

.insight-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.insight-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== CONFIGURACIÓN ==================== */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.config-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}


.config-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.config-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    width: 50px;
    height: 28px;
    background: #cbd5e0;
    border-radius: 50px;
    position: relative;
    transition: all 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
    background: var(--primary);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
    left: 25px;
}

.toggle-text {
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-left: 58px;
}

.config-card.beta-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-color: var(--primary);
}

.config-card.beta-info h3 {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.config-card.beta-info p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.btn-outline {
    padding: 0.875rem 1.5rem;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ==================== MODAL DE RESPUESTA ==================== */
.response-modal-content {
    max-width: 700px;
    padding: 2.5rem;
}

.response-modal-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.review-preview {
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.review-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.reviewer-avatar {
    width: 48px;
    height: 48px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.reviewer-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.reviewer-rating {
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.review-date {
    font-size: 0.875rem;
    color: var(--text-light);
}

.review-comment {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

.response-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.response-header h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0;
}

.btn-regenerate {
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-regenerate:hover {
    background: rgba(102, 126, 234, 0.2);
}

#responseTextarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    transition: all 0.2s;
}

#responseTextarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#responseTextarea:disabled {
    background: #f7fafc;
    cursor: not-allowed;
}

.response-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-secondary {
    padding: 0.875rem 1.5rem;
    background: #f7fafc;
    color: var(--text-primary);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}


/* ==================== INSIGHTS ==================== */
.insights-container {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.insights-container h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.insight-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.insight-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.insight-card:nth-child(1) { animation-delay: 0.1s; }
.insight-card:nth-child(2) { animation-delay: 0.2s; }
.insight-card:nth-child(3) { animation-delay: 0.3s; }
.insight-card:nth-child(4) { animation-delay: 0.4s; }
.insight-card:nth-child(5) { animation-delay: 0.5s; }
.insight-card:nth-child(6) { animation-delay: 0.6s; }

.insight-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.insight-content h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.insight-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.insight-content li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.insight-content li:last-child {
    border-bottom: none;
}

.sentiment-score {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.sentiment-score.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.sentiment-score.neutral {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.sentiment-score.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.seo-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.seo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.seo-item:last-child {
    border-bottom: none;
}

.seo-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.seo-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
}

.sentiment-detail {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.5rem 0;
    text-align: center;
}

.sentiment-breakdown {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    gap: 1rem;
}

.sentiment-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: 6px;
}

.sentiment-item.positive {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.sentiment-item.negative {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.sentiment-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.sentiment-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}

.sentiment-item.positive .sentiment-value {
    color: #10b981;
}

.sentiment-item.negative .sentiment-value {
    color: #ef4444;
}

.insight-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.insight-list li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.5;
}

.insight-list li:last-child {
    border-bottom: none;
}

.insight-list strong {
    color: var(--text-primary);
    font-weight: 600;
}

.performance-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    justify-items: center;
    align-items: center;
    padding: 1rem 0;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    animation: fadeInScale 0.5s ease-out;
    animation-fill-mode: both;
}

.metric-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #f1f5f9;
}

.metric-item:nth-child(1) { animation-delay: 0.1s; }
.metric-item:nth-child(2) { animation-delay: 0.2s; }
.metric-item:nth-child(3) { animation-delay: 0.3s; }
.metric-item:nth-child(4) { animation-delay: 0.4s; }

.metric-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sentiment-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.seo-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

/* ==================== ANIMACIONES ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.insight-icon {
    animation: pulse 2s ease-in-out infinite;
}

.insight-icon:nth-child(1) { animation-delay: 0s; }
.insight-icon:nth-child(2) { animation-delay: 0.2s; }
.insight-icon:nth-child(3) { animation-delay: 0.4s; }
.insight-icon:nth-child(4) { animation-delay: 0.6s; }
.insight-icon:nth-child(5) { animation-delay: 0.8s; }
.insight-icon:nth-child(6) { animation-delay: 1s; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    
    .dashboard-main {
        margin-left: 250px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
        z-index: 1002;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    /* Overlay oscuro cuando el sidebar está abierto */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        backdrop-filter: blur(2px);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    /* Botón de menú en el header para móvil */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.5rem;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1000;
        transition: all 0.3s;
    }
    
    .mobile-menu-btn:active {
        transform: scale(0.95);
    }
    
    .dashboard-main {
        margin-left: 0;
        padding: 1.5rem 1rem;
    }
    
    .header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .toggle-label-inline,
    .btn-generate {
        width: 100%;
        justify-content: center;
    }

    .btn-generate .btn-hint {
        display: block;
        margin-top: 0.25rem;
        font-size: 0.7rem;
    }

    .kpis-grid {
        grid-template-columns: 1fr;
    }
    
    .reviews-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    /* Table to cards on mobile */
    .reviews-table thead {
        display: none;
    }
    
    .reviews-table tbody tr {
        display: block;
        padding: 1.25rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.06);
        margin-bottom: 1rem;
    }
    
    .reviews-table tbody tr:hover {
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
    }
    
    .reviews-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.5rem 0;
        border: 0;
    }
    
    .reviews-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.85rem;
        min-width: 80px;
        flex-shrink: 0;
    }
    
    .reviews-table td:first-child {
        padding-top: 0;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #f1f5f9;
        margin-bottom: 0.5rem;
    }
    
    .reviews-table td:first-child::before {
        display: none;
    }
    
    .reviewer-cell {
        flex: 1;
    }
    
    .review-text-cell {
        max-width: none;
        white-space: normal;
        text-align: right;
        flex: 1;
    }
    
    .btn-respond,
    .btn-view-response {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .charts-grid,
    .insights-grid,
    .config-grid {
        grid-template-columns: 1fr;
    }

    .response-modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .response-actions {
        flex-direction: column;
    }
    
    .btn-secondary,
    .btn-primary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .kpi-value {
        font-size: 2rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
}

/* ==================== UTILIDADES ==================== */
.notification {
    animation: slideInRight 0.3s ease, slideOutRight 0.3s ease 2.7s;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
