/* =====================================================
       PAGE HEADER
    ===================================================== */

.recommendation-page {
    padding-bottom: 1rem;
}

.page-icon-badge {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    box-shadow: 0 10px 22px rgba(15, 118, 110, .28);
    flex-shrink: 0;
}

.page-title {
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--text-main, #0f172a);
    font-size: 1.45rem;
}

.page-subtitle {
    color: var(--text-muted, #64748b);
    font-size: .88rem;
    max-width: 720px;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: .55rem 1rem;
    border-radius: 12px;
    background: #ECFDF5;
    color: #0F766E;
    border: 1px solid #BBF7D0;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .3px;
}

.meta-chip i {
    font-size: .95rem;
}

/* =====================================================
       KPI CARD
    ===================================================== */

.kpi-card {
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.kpi-card.accent-success::before {
    background: #16A34A;
}

.kpi-card.accent-warning::before {
    background: #F59E0B;
}

.kpi-card.accent-primary::before {
    background: #6366F1;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .10);
}

.kpi-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #94A3B8;
}

.kpi-value {
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -.5px;
    color: #0f172a;
}

.kpi-hint {
    font-size: .74rem;
    color: #94A3B8;
    font-weight: 500;
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* =====================================================
       FORM CARD
    ===================================================== */

.form-card,
.section-card {
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
}

.form-card-header,
.section-card-header {
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    padding: 1rem 1.25rem;
}

.form-card-header h5,
.section-card-header h5 {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.3px;
}

.action-header-danger {
    background: linear-gradient(135deg, #FEF2F2, #FFF1F2);
    border-bottom: 1px solid #FECACA;
}

.action-header-primary {
    background: linear-gradient(135deg, #EFF6FF, #EEF2FF);
    border-bottom: 1px solid #C7D2FE;
}

/* =====================================================
       BUTTON
    ===================================================== */

.btn-gradient {
    background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: .88rem;
    padding: .7rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    box-shadow: 0 8px 20px rgba(15, 118, 110, .28);
    transition: all .2s ease;
}

.btn-gradient:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15, 118, 110, .35);
}

.btn-gradient:disabled {
    opacity: .7;
    transform: none;
}

.btn-reset {
    border-radius: 12px;
    font-weight: 600;
    font-size: .88rem;
    padding: .7rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: all .2s ease;
}

/* =====================================================
       EMPTY STATE
    ===================================================== */

.empty-state {
    text-align: center;
    color: #94A3B8;
    padding: 2rem 1rem;
}

.empty-state i {
    color: #CBD5E1;
}

.empty-state.small {
    padding: 1rem;
}

/* =====================================================
       TIMELINE
    ===================================================== */

.timeline-item {
    position: relative;
    padding: .85rem 1rem .85rem 1.15rem;
    border-radius: 12px;
    border-left: 4px solid #16A34A;
    background: #F8FAFC;
    margin-bottom: .65rem;
    font-size: .88rem;
    font-weight: 600;
    color: #334155;
    transition: all .2s ease;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item:hover {
    transform: translateX(3px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

.timeline-item.border-danger {
    border-left-color: #DC2626;
    background: #FEF2F2;
}

.timeline-item.border-danger .fw-semibold {
    color: #991B1B;
}

.timeline-item.border-primary {
    border-left-color: #6366F1;
    background: #EEF2FF;
}

.timeline-item.border-primary .fw-semibold {
    color: #3730A3;
}

.timeline-item i {
    font-size: .9rem;
}

/* =====================================================
       SUMMARY ALERT
    ===================================================== */

#recommendationSummary .alert {
    border-radius: 14px;
    border: 1px solid transparent;
    padding: 1.25rem;
}

#recommendationSummary .alert .bi-stars {
    font-size: 1.9rem;
}

#recommendationSummary .alert h5 {
    font-weight: 800;
    letter-spacing: -.3px;
}

#recommendationSummary hr {
    opacity: .2;
    margin: 1rem 0;
}

.score-progress {
    height: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .5);
    overflow: hidden;
}

.score-progress .progress-bar {
    font-weight: 700;
    font-size: .78rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
       SIMILAR TABLE
    ===================================================== */

#recommendationList table {
    margin-bottom: 0;
}

#recommendationList table thead th {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #64748B;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    padding: .9rem 1.1rem;
    white-space: nowrap;
}

#recommendationList table tbody td {
    padding: .9rem 1.1rem;
    font-size: .86rem;
    color: #334155;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}

#recommendationList table tbody tr:last-child td {
    border-bottom: none;
}

#recommendationList table tbody tr:hover {
    background: #F8FAFC;
}

.similarity-progress {
    height: 8px;
    border-radius: 999px;
    background: #E2E8F0;
    overflow: hidden;
}

.similarity-progress .progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #0F766E, #14B8A6) !important;
}

/* =====================================================
       DARK MODE
    ===================================================== */

body.dark-mode .kpi-card,
body.dark-mode .form-card,
body.dark-mode .section-card {
    background: #1E293B;
    border-color: #334155;
}

body.dark-mode .kpi-value,
body.dark-mode .page-title,
body.dark-mode .form-card-header h5,
body.dark-mode .section-card-header h5 {
    color: #F1F5F9;
}

body.dark-mode .form-card-header,
body.dark-mode .section-card-header {
    background: #0F172A;
    border-bottom-color: #334155;
}

body.dark-mode .action-header-danger {
    background: linear-gradient(135deg, #2A0E0E, #3B1212);
    border-bottom-color: #7F1D1D;
}

body.dark-mode .action-header-primary {
    background: linear-gradient(135deg, #0B1224, #0F1A3A);
    border-bottom-color: #3730A3;
}

body.dark-mode .timeline-item {
    background: #0F172A;
    color: #CBD5E1;
    border-left-color: #14B8A6;
}

body.dark-mode .timeline-item.border-danger {
    background: #2A0E0E;
    border-left-color: #DC2626;
}

body.dark-mode .timeline-item.border-danger .fw-semibold {
    color: #FCA5A5;
}

body.dark-mode .timeline-item.border-primary {
    background: #0B1224;
    border-left-color: #818CF8;
}

body.dark-mode .timeline-item.border-primary .fw-semibold {
    color: #A5B4FC;
}

body.dark-mode #recommendationList table thead th {
    background: #0F172A;
    color: #94A3B8;
    border-bottom-color: #334155;
}

body.dark-mode #recommendationList table tbody td {
    color: #CBD5E1;
    border-bottom-color: #1E293B;
}

body.dark-mode #recommendationList table tbody tr:hover {
    background: #0F172A;
}

body.dark-mode .similarity-progress {
    background: #334155;
}

body.dark-mode .meta-chip {
    background: #052E2B;
    color: #2DD4BF;
    border-color: #0F766E;
}

body.dark-mode .empty-state {
    color: #64748B;
}

body.dark-mode .empty-state i {
    color: #475569;
}

body.dark-mode .form-control {
    background: #0F172A;
    border-color: #334155;
    color: #F1F5F9;
}

body.dark-mode .form-control:focus {
    background: #0F172A;
    border-color: #14B8A6;
    color: #F1F5F9;
    box-shadow: 0 0 0 .2rem rgba(20, 184, 166, .2);
}

/* =====================================================
       RESPONSIVE
    ===================================================== */

@media (max-width: 575.98px) {
    .page-icon-badge {
        width: 46px;
        height: 46px;
        font-size: 1.25rem;
    }

    .page-title {
        font-size: 1.15rem;
    }

    .kpi-value {
        font-size: 1.35rem;
    }

    .btn-gradient,
    .btn-reset {
        width: 100%;
    }
}