
@font-face {
    font-family: "IRANSans";
    src: url("fonts/IRANSans(FaNum)_Light.ttf") format("truetype");
    font-weight: 300;
}

@font-face {
    font-family: "IRANSans";
    src: url("fonts/IRANSans(FaNum)_Regular.ttf") format("truetype");
    font-weight: 400;
}

@font-face {
    font-family: "IRANSans";
    src: url("fonts/IRANSans(FaNum)_Medium.ttf") format("truetype");
    font-weight: 500;
}

@font-face {
    font-family: "IRANSans";
    src: url("fonts/IRANSans(FaNum)_Bold.ttf") format("truetype");
    font-weight: 700;
}

@font-face {
    font-family: "IRANSans";
    src: url("fonts/IRANSans(FaNum)_Black.ttf") format("truetype");
    font-weight: 900;
}

* {  
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IRANSans", Tahoma, Arial, sans-serif;
    background: #f5f6f8;
    direction: rtl;
    color: #222;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px ;
}

h2 {
    margin-top: 0;
    margin-bottom: 20px;
}


/* =========================
   ورودی‌ها
========================= */

input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    font-family: "IRANSans", Tahoma, Arial, sans-serif;
}

/* =========================
   فروش ماهیانه
========================= */

.months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.month {
    background: transparent;
    padding: 5px;
    border-radius: 10px;
}

.month label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}


/* =========================
   خلاصه فروش
========================= */

.sales-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.result-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
}

.result-box span {
    display: block;
    margin-bottom: 12px;
    font-weight: bold;
}

.result-box strong {
    font-size: 24px;
    display: inline-block;
}

.result-box small {
    margin-right: 5px;
}


/* =========================
   مصرف مواد / بازار / پیش‌بینی
========================= */

.top-three-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.top-three-sections section {
    background: white;
    padding: 20px;
    border-radius: 10px;
}

.two-inputs > div {
    margin-bottom: 15px;
}

.two-inputs > div:last-child {
    margin-bottom: 0;
}

.two-inputs label {
    display: block;
    margin-bottom: 7px;
    font-weight: bold;
}


/* =========================
   صورت‌های مالی
========================= */

.financial-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 30px;
    align-items: center;
}


/* سود و زیان + جریان وجوه نقد */

.financial-left {
    display: flex;
    flex-direction: column;
    gap: 25px;
}


/* ترازنامه */

.financial-right {
    width: 100%;
}


/* کارت‌های صورت مالی */

.financial-left section,
.financial-right section {
    background: white;
    padding: 20px;
    border-radius: 10px;
}


/* =========================
   جدول‌ها
========================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

th {
    font-weight: bold;
    background: #f5f6f8;
}

td:first-child,
th:first-child {
    text-align: right;
}

td input {
    width: 100%;
}

td strong {
    font-size: 16px;
}


/* =========================
   بخش‌های پایانی
========================= */

/* =====================================================
   بخش‌های اصلی فرم
   ===================================================== */

.container > section {
    margin-top: 30px;
    background: white;
    padding: 20px;
    border-radius: 10px;
}
/* بخش‌های فرم داخل inputSection */
#inputSection {
    width: 100%;
}
#inputSection > section {
    margin-top: 30px;
    background: white;
    padding: 20px;
    border-radius: 10px;
}



/* =========================
   نمایش در موبایل
========================= */

@media (max-width: 900px) {

    .top-three-sections {
        grid-template-columns: 1fr;
    }

    .financial-layout {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 700px) {

    .months-grid {
        grid-template-columns: 1fr;
    }

    .sales-summary {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 10px;
        margin: 20px auto;
    }

}
/* =====================================================
   DASHBOARD OUTPUT
===================================================== */

.output-section {
    margin-top: 50px;
    padding: 30px !important;
    background: #ffffff !important;
    border-radius: 18px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.06);
}

.output-section h1 {
    text-align: center;
    margin-bottom: 35px;
    color: #0d004c;
}

.output-section h2 {
    text-align: center;
    color: #0d004c;
    margin-bottom: 25px;
}


/* =====================================================
   کارت‌های اصلی
===================================================== */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 25px;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 14px;
    padding: 25px 15px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
}

.dashboard-card span {
    display: block;
    font-weight: bold;
    color: #0d004c;
    margin-bottom: 15px;
}

.dashboard-card strong {
    display: block;
    font-size: 27px;
    color: #0d004c;
    margin-bottom: 5px;
}

.dashboard-card small {
    color: #777;
}


/* =====================================================
   ردیف نمودارها
===================================================== */

.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.dashboard-box {
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 330px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}


/* =====================================================
   کارت‌های شاخص
===================================================== */

.indicator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.eps-section-grid {
    grid-template-columns: repeat(5, 1fr);
}

.indicator-card {
    background: linear-gradient(135deg, #f4f1ff, #eeeafa);
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    min-height: 135px;

    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* ================= نسبت‌های نقدینگی ================= */

.liquidity-grid {
    grid-template-columns: repeat(3, 1fr);
}


/* ================= نسبت‌های اهرمی ================= */

.leverage-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* ================= ارزش‌گذاری نهایی ================= */

.valuation-final-grid {
    grid-template-columns: repeat(4, 1fr);
}

.indicator-card span {
    font-size: 14px;
    font-weight: bold;
    color: #0d004c;
    margin-bottom: 15px;
}

.indicator-card strong {
    font-size: 30px;
    color: #0d004c;
}


/* =====================================================
   جدول خروجی
===================================================== */

.output-table {
    width: 100%;
    border-collapse: collapse;
}

.output-table th {
    background: #f5f6f8;
    color: #0d004c;
    font-weight: bold;
}

.output-table th,
.output-table td {
    padding: 14px;
    border-bottom: 1px solid #eeeeee;
    text-align: center;
}

.output-table td {
    font-size: 15px;
}


/* =====================================================
   موبایل
===================================================== */

@media (max-width: 900px) {

    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-row {
        grid-template-columns: 1fr;
    }

    .indicator-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 600px) {

    .output-section {
        padding: 15px !important;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .indicator-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 280px;
    }

}
/* =====================================================
   شاخص‌های سودآوری - Gauge
   ===================================================== */

.profitability-gauge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}


.gauge-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px 15px;
    text-align: center;
    position: relative;
}


.gauge-card > span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}


.gauge-container {
    position: relative;
    width: 100%;
    max-width: 220px;
    height: 125px;
    margin: 0 auto;
}


.gauge-container canvas {
    width: 100% !important;
    height: 100% !important;
}


.gauge-value {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    text-align: center;
}


.gauge-value strong {
    font-size: 24px;
    font-weight: 700;
}


/* نمایش مناسب در صفحه‌های کوچک‌تر */

@media (max-width: 1100px) {

    .profitability-gauge-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 600px) {

    .profitability-gauge-grid {
        grid-template-columns: 1fr;
    }

}
/* =====================================================
   اطلاعات متفرقه + سودسازی سالانه
   ===================================================== */

.misc-earnings-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 25px;
    margin-top: 30px;
    align-items: start;
}

.misc-earnings-row > section {
    margin-top: 0;
}

.misc-section,
.earnings-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
}


/* موبایل */

@media (max-width: 900px) {

    .misc-earnings-row {
        grid-template-columns: 1fr;
    }

}

button,
input,
textarea,
select,
table,
th,
td,
label {
    font-family: "IRANSans", Tahoma, Arial, sans-serif;
}

canvas {
    font-family: "IRANSans", Tahoma, Arial, sans-serif;
}
/* =====================================================
   Legend اختصاصی نمودار مواد اولیه و فروش
   ===================================================== */

.sales-market-legend {
    width: 100%;
    margin-top: 5px;
    padding: 0 10px 5px;
    text-align: center;
    font-family: "IRANSans", Tahoma, sans-serif;
    box-sizing: border-box;
}

.sales-market-legend-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 4px;
}

.sales-market-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.sales-market-item i {
    width: 11px;
    height: 11px;
    min-width: 11px;
    border-radius: 50%;
    display: inline-block;
}

/* =====================================================
   تنظیم نمودار مواد اولیه و بازار فروش
   ===================================================== */

.sales-market-box .chart-container {
    height: 300px;
}

.sales-market-legend {
    margin-top: -8px;
    padding-bottom: 10px;
}
/* =====================================================
   مرحله دوم - گزارش مالی
   ===================================================== */
/* =====================================================
   دکمه‌های فرم
   ===================================================== */

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.form-actions button {
    font-family: "IRANSans", Tahoma, Arial, sans-serif;
    border: none;
    border-radius: 8px;
    padding: 11px 22px;
    font-size: 14px;
    cursor: pointer;
}

.clear-data-btn {
    background: #750000;
    color: #ffffff;
}

.show-results-btn {
    background: #0D004C;
    color: #ffffff;
}


/* ================================
   دکمه بازگشت به ورود اطلاعات
   ================================ */

.back-to-input-wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 40px;
    margin-bottom: 30px;
}

.back-to-input-btn {
    font-family: "IRANSans", Tahoma, Arial, sans-serif;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 14px;
    cursor: pointer;
    background: #0d004c;
    color: #ffffff;
}

/* =========================================
   نوار مراحل فرم
   ========================================= */

.form-progress {
    width: 100%;
    margin-bottom: 30px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.progress-header strong {
    color: #0d004c;
    font-size: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    width: 50%;
    height: 100%;
    background: #0d004c;
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* =========================================
   صفحه Loading
   ========================================= */

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    background: rgba(255, 255, 255, 0.92);

    direction: rtl;
}


/* دایره چرخان */

.loader-spinner {
    width: 48px;
    height: 48px;

    border: 5px solid #e5e5e5;
    border-top: 5px solid #0d004c;

    border-radius: 50%;

    animation: loaderSpin 0.8s linear infinite;

    margin-bottom: 18px;
}


.loader-text {
    font-family: "IRANSans", Tahoma, Arial, sans-serif;

    font-size: 15px;
    font-weight: bold;

    color: #0d004c;
}


/* انیمیشن چرخش */

@keyframes loaderSpin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}

/* =========================================
   Popup تایید پاک کردن اطلاعات
   ========================================= */

.clear-confirm-modal {
    display: none; /* پیش‌فرض مخفی */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px; /* ایجاد فاصله در صفحات کوچک */
    overflow-y: auto; /* اجازه اسکرول در صورت بزرگ بودن پاپ‌آپ */
}


.clear-confirm-box {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    width: 100%;
    max-width: 550px; /* حداکثر عرض پیش‌فرض که در صورت نیاز می‌توانید زیادتر کنید */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-align: right;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto; /* اسکرول داخلی اگر متن خیلی طولانی بود */
}


.clear-confirm-title {
    font-size: 19px;
    font-weight: bold;

    color: #0d004c;

    margin-bottom: 15px;
}


.clear-confirm-message {
    font-size: 14px;
    line-height: 1.9;

    color: #444;

    margin-bottom: 25px;
}


.clear-confirm-actions {
    display: flex;

    justify-content: center;

    gap: 12px;
}


.clear-confirm-actions button {
    border: none;

    border-radius: 8px;

    padding: 11px 22px;

    font-family: "IRANSans", Tahoma, Arial, sans-serif;

    font-size: 14px;

    cursor: pointer;

    transition: opacity 0.2s ease;
}


.clear-confirm-actions button:hover {
    opacity: 0.85;
}


/* بله */
.confirm-clear-btn {
    background: #0d004c;
    color: #ffffff;
}


/* خیر */
.cancel-clear-btn {
    background: #d32f2f;
    color: #ffffff;
}

/* =========================================
   سیستم مراحل فرم
   ========================================= */

.wizard-step {
    display: none;
}


/* مرحله خوش آمدگویی */

.welcome-step {
    min-height: 420px;

    display: none;

    align-items: center;
    justify-content: center;
}


.welcome-box {
    width: 100%;

    background: white;

    border-radius: 14px;

    padding: 50px 40px;

    text-align: center;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}


.welcome-box h1 {
    margin-bottom: 25px;

    color: #0d004c;
}


.welcome-box p {
    line-height: 2;

    color: #555;

    max-width: 700px;

    margin: 10px auto;
}


/* دکمه شروع */

.start-analysis-btn {
    margin-top: 35px;

    background: #0d004c;
    color: white;

    border: none;

    border-radius: 8px;

    padding: 13px 32px;

    font-family: "IRANSans", Tahoma, Arial, sans-serif;

    font-size: 15px;

    cursor: pointer;
}


/* Navigation */

.step-navigation {
    display: flex;

    justify-content: space-between;

    align-items: center;

    width: 100%;

    margin-top: 35px;

    margin-bottom: 30px;
}


.step-navigation-right {
    display: flex;

    gap: 12px;

    align-items: center;
}


.step-navigation button {
    border: none;

    border-radius: 8px;

    padding: 12px 25px;

    font-family: "IRANSans", Tahoma, Arial, sans-serif;

    font-size: 14px;

    cursor: pointer;
}


/* شروع مجدد */

.restart-form-btn {
    background: #eeeeee;

    color: #333;
}


/* مرحله قبل */

.prev-step-btn {
    background: #eeeeee;

    color: #333;
}


/* مرحله بعد */

.next-step-btn {
    background: #0d004c;

    color: white;
}


/* شروع تحلیل */

.start-analysis-btn:hover,
.next-step-btn:hover {
    opacity: 0.9;
}

/* =========================================
   کارت یکپارچه مرحله ۲ - فروش ماهیانه
   ========================================= */

.sales-step-card {
    width: 100%;
    box-sizing: border-box;

    background: #ffffff;

    border-radius: 16px;

    padding: 28px 25px 25px;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
}


/* عنوان داخل کارت */

.sales-step-card h1 {
    margin-top: 0;
    margin-bottom: 22px;
    font-size: 26px;
}


/* فاصله بین ماه‌ها و خلاصه فروش */

.sales-step-card .sales-summary {
    margin-top: 10px;
}

/* =========================================
   استایل صفحه ۳ - صورت‌های مالی
   ========================================= */

#step3 h2 {
    font-size: 20px;
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
}

#step3 .financial-left section,
#step3 .financial-right section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
}

/* =========================================
   فشرده‌سازی مرحله 3 - صورت‌های مالی
   ========================================= */

/* عنوان اصلی صفحه */
.financial-page-title {
    font-size: 26px;
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
}


/* عنوان هر کارت */
#step3 h2 {
    font-size: 18px;
    text-align: center;
    margin-top: 0;
    margin-bottom: 14px;
}


/* فضای داخلی کارت‌های صورت مالی */
#step3 .financial-left section,
#step3 .financial-right section {
    padding: 14px;
    border-radius: 10px;
}


/* کوچک‌تر شدن نوشته‌های ردیف‌ها */
#step3 td:first-child,
#step3 th:first-child {
    font-size: 14px;
    white-space: nowrap;
}


/* فشرده‌تر شدن سلول‌های جدول */
#step3 th,
#step3 td {
    padding: 6px 8px;
}


/* کوچک‌تر شدن inputها */
#step3 td input {
    padding: 6px 7px;
    font-size: 13px;
    height: 34px;
}


/* ارتفاع کلی ردیف‌ها کمتر شود */
#step3 table {
    line-height: 1.2;
}

#step3 .financial-layout {
    align-items: center;
}

#step3 .financial-right {
    align-self: center;
}

#step3 .financial-right section {
    padding: 22px 20px;
}

#step3 .financial-right h2 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 18px;
}

#step3 .financial-right th,
#step3 .financial-right td {
    padding: 8px 10px;
}

#step3 .financial-right td:first-child,
#step3 .financial-right th:first-child {
    font-size: 13px;
}

#step3 .financial-right td input {
    height: 36px;
    padding: 7px 8px;
    font-size: 13px;
}

/* =========================================
   استایل مرحله ۴ - اطلاعات تکمیلی
   ========================================= */

#step4 {
    width: 100%;
}


/* کارت اصلی مرحله ۴ */

#step4 .top-three-sections,
#step4 .misc-earnings-row {
    width: 100%;
}


/* کارت‌های بخش‌های مرحله ۴ */

#step4 .top-three-sections section,
#step4 .misc-section,
#step4 .earnings-section {
    background: #ffffff;
    border-radius: 10px;
}


/* تیترهای داخلی */

#step4 h2 {
    font-size: 18px;
    text-align: center;
    margin-top: 0;
    margin-bottom: 18px;
}


/* ورودی‌ها کمی جمع‌وجورتر */

#step4 input {
    padding: 7px 8px;
    font-size: 13px;
    height: 36px;
}


/* فاصله داخلی کارت‌های سه‌تایی */

#step4 .top-three-sections section {
    padding: 16px;
}


/* فاصله بخش اطلاعات متفرقه و سودسازی */

#step4 .misc-section,
#step4 .earnings-section {
    padding: 16px;
}

/* وسط‌چین شدن متن تمام input ها */
input {
    text-align: center;
}

/* =========================================
   انتخاب داشبورد
   ========================================= */

.dashboard-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;

    margin-top: 10px;
    margin-bottom: 30px;
}


.dashboard-selector-btn {
    min-width: 190px;

    padding: 13px 28px;

    border: 1px solid #d9d9d9;
    border-radius: 10px;

    background: #f5f6f8;
    color: #555;

    font-family: "IRANSans", Tahoma, Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;

    cursor: pointer;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.2s ease;
}


.dashboard-selector-btn:hover {
    transform: translateY(-1px);
}


.dashboard-selector-btn.active {
    background: #0d004c;
    border-color: #0d004c;
    color: #ffffff;
}

/* =========================================
   نمایش داشبوردها
   ========================================= */

#operationalDashboard {
    display: block;
}

#financialDashboard {
    display: none;
}