/* KPI Estimation Page Styles */

:root {
    --primary: #a20a0a;
    --primary-dark: #7c0808;
    --accent: #f3a83b;
    --bg: #f7f4ee;
    --card-bg: #ffffff;
    --text-main: #2b2d42;
    --text-light: #6c757d;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
}

body.dark-theme {
    --bg: #0c0707;
    --card-bg: #180f0f;
    --text-main: #f8fafc;
    --text-light: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
}

.kpi-main {
    padding-top: 40px;
    padding-bottom: 80px;
}

.kpi-hero {
    text-align: center;
    margin-bottom: 40px;
}

.kpi-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--primary);
}

.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

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

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
}

/* Tabs */
.funnel-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.funnel-tab-btn {
    padding: 10px 24px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.funnel-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Form inputs */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 575px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.form-group input {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.slider-group {
    margin-bottom: 20px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.slider-label {
    color: var(--text-main);
}

.slider-value {
    color: var(--primary);
}

.slider-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    outline: none;
    accent-color: var(--primary);
}

/* Funnel Visualization */
.funnel-viz-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    position: relative;
}

.funnel-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 450px;
}

.funnel-stage-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.funnel-stage {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-radius: 8px;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.95rem;
    transition: width 0.5s ease, background 0.5s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    min-width: 120px;
    box-sizing: border-box;
}

.funnel-stage-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funnel-stage-qty {
    font-size: 1.1rem;
    font-weight: 800;
}

.funnel-arrow {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 4px 0;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.funnel-arrow span {
    background: var(--primary);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* Modal and layout overrides */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

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

.modal-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}
