/* List pagination (Properties, Customers, Sales) */
.list-pagination {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}
.list-pagination-info {
    margin-right: auto;
}
.list-pagination-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.list-pagination-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    color: #334155;
}
.list-pagination-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.list-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.list-pagination-nums {
    font-weight: 600;
    color: #475569;
}

/* Main CSS for general styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'IranSans';
    src: url('/Panel/fonts/custom/iranSans/IRANSansWeb.eot');
    src: url('/Panel/fonts/custom/iranSans/IRANSansWeb.eot?#iefix') format('embedded-opentype'),
         url('/Panel/fonts/custom/iranSans/IRANSansWeb.woff2') format('woff2'),
         url('/Panel/fonts/custom/iranSans/IRANSansWeb.woff') format('woff'),
         url('/Panel/fonts/custom/iranSans/IRANSansWeb.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'IranSans', Tahoma, Arial, sans-serif;
    direction: rtl;
}

/* باکس راهنمای بالای صفحه (قابل بستن با ضربدر) */
.page-help-alert {
    margin-bottom: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #e8f4fd 0%, #d6ebf9 100%);
    border: 1px solid #0052ff;
    box-shadow: 0 2px 8px rgba(0, 82, 255, 0.12);
    max-width: 100%;
    min-width: 0;
}
.page-help-alert-content {
    padding: 1rem 1.25rem;
    position: relative;
}
.page-help-alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.page-help-alert-icon {
    color: #0052ff;
    font-size: 1.25rem;
}
.page-help-alert-header strong {
    flex: 1;
    color: #1a365d;
    font-size: 0.95rem;
}
.page-help-alert-close {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}
.page-help-alert-close:hover {
    color: #0052ff;
    background: rgba(0, 82, 255, 0.1);
}
.page-help-alert-body {
    margin-top: 0.5rem;
    padding-right: 1.75rem;
}
.page-help-alert-body p {
    margin: 0.25em 0 0.5em 0;
    font-size: 0.875rem;
    color: #2d3748;
    line-height: 1.6;
    text-align: justify;
}
.page-help-alert-body p:first-child { margin-top: 0; }
.page-help-alert-body strong { color: #1a365d; }

/* صفحه راهنما - خوانایی بهتر متن طولانی */
.guide-page {
    max-width: 1100px;
    margin: 0 auto;
}

.guide-page .card-section {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

.guide-page h2 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: #0f172a;
}

.guide-page h3 {
    font-size: 1rem;
    margin-top: 0.75rem;
    margin-bottom: 0.4rem;
    color: #1e293b;
}

.guide-page p {
    font-size: 0.9rem;
    line-height: 1.9;
    color: #334155;
    margin-bottom: 0.75rem;
}

.guide-page ul,
.guide-page ol {
    padding-right: 1.3rem;
    margin-bottom: 0.5rem;
}

.guide-page li {
    font-size: 0.9rem;
    line-height: 1.9;
    color: #1f2933;
}

.guide-page code {
    background: #f1f5f9;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* باکس خلاصه مالی در هدر (مانند موجودی حساب) */
.financial-header-summary {
    margin-bottom: 1rem;
}

.financial-header-box {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e5fba 0%, #2563eb 50%, #0ea5e9 100%);
    color: #f0f9ff;
    box-shadow: 0 6px 20px rgba(30, 91, 186, 0.28);
    border: 1px solid rgba(147, 197, 253, 0.25);
}

.financial-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.financial-header-icon i {
    font-size: 1.1rem;
}

.financial-header-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
    flex: 1;
    align-items: stretch;
}

.financial-header-metric {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
}

.financial-header-metric-label {
    font-size: 0.68rem;
    opacity: 0.88;
    line-height: 1.35;
}

.financial-header-metric-value {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 0.1rem;
}

.financial-header-metric-value .unit {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-right: 0.25rem;
}

.financial-header-divider {
    display: none;
}

.financial-header-box.financial-header-box-dense {
    padding: 0.55rem 0.85rem;
    gap: 0.5rem;
}

.financial-header-box.financial-header-box-dense .financial-header-content {
    grid-template-columns: 1fr;
}

.financial-header-box.financial-header-box-dense .financial-header-ceo {
    gap: 0.45rem;
}

.financial-header-box.financial-header-box-dense .financial-header-ceo-columns {
    gap: 0.4rem 0.5rem;
}

.financial-header-box.financial-header-box-dense .financial-header-ceo-col-metrics {
    gap: 0.3rem;
}

.financial-header-box.financial-header-box-dense .financial-header-ceo-col-metrics .financial-header-metric {
    padding: 0.35rem 0.45rem;
}

.financial-header-box.financial-header-box-dense .financial-header-ceo-col-metrics .financial-header-metric-label {
    font-size: 0.62rem;
    line-height: 1.25;
}

.financial-header-box.financial-header-box-dense .financial-header-ceo-col-metrics .financial-header-metric-value {
    font-size: 0.78rem;
}

.financial-header-box.financial-header-box-dense .financial-header-ceo-col-title {
    font-size: 0.72rem;
    padding: 0.25rem 0.35rem;
}

.financial-header-box.financial-header-box-dense .financial-header-ceo-intro .financial-header-metric-label {
    font-size: 0.72rem;
}

.financial-header-box.financial-header-box-dense .financial-header-ceo-intro .financial-header-metric-value {
    font-size: 0.82rem;
}

/* گزارش تفکیکی مدیرعامل: دو ستون فروش / اجاره */
.financial-header-ceo {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
}

.financial-header-ceo-intro {
    margin: 0;
}

.financial-header-ceo-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.65rem;
    align-items: start;
    width: 100%;
}

.financial-header-ceo-col {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.financial-header-ceo-col-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    padding: 0.35rem 0.4rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(236, 254, 255, 0.15);
}

.financial-header-ceo-col-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.financial-header-ceo-col-metrics .financial-header-metric {
    padding: 0.5rem 0.55rem;
}

.financial-header-ceo-col-metrics .financial-header-metric-label {
    font-size: 0.68rem;
    line-height: 1.35;
}

.financial-header-ceo-col-metrics .financial-header-metric-value {
    font-size: 0.88rem;
}

.financial-header-ceo-extras {
    margin-top: 0.15rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(236, 254, 255, 0.22);
}

.financial-header-ceo-extras-title {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    opacity: 0.95;
}

.financial-header-ceo-extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.financial-header-commission-info {
    background: none;
    border: none;
    color: rgba(248, 250, 252, 0.8);
    cursor: pointer;
    padding: 0 0.25rem;
    vertical-align: middle;
    font-size: 0.9rem;
}
.financial-header-commission-info:hover {
    color: #fff;
}

/* مودال جزئیات کمیسیون (هدر داشبورد) */
.commission-breakdown-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.commission-breakdown-modal.show {
    display: flex;
}
.commission-breakdown-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.commission-breakdown-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.commission-breakdown-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}
.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
}
.btn-close-modal:hover {
    color: #334155;
}
.commission-breakdown-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    max-height: 60vh;
}
.commission-breakdown-modal-body .breakdown-table {
    font-size: 0.9rem;
    width: 100%;
    border-collapse: collapse;
}
.commission-breakdown-modal-body .breakdown-table th,
.commission-breakdown-modal-body .breakdown-table td {
    padding: 0.5rem 0.75rem;
    text-align: right;
    border-bottom: 1px solid #eee;
}
.commission-breakdown-modal-body .loading-row {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}
.commission-breakdown-modal-body .loading-row .spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top-color: #0052ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .financial-header-box {
        flex-direction: column;
        align-items: stretch;
        padding: 0.85rem;
        gap: 0.65rem;
    }

    .financial-header-content {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 0.55rem;
    }

    .financial-header-ceo-extras-grid {
        grid-template-columns: 1fr;
    }

    .financial-header-icon {
        width: 34px;
        height: 34px;
    }

    .financial-header-metric {
        padding: 0.55rem 0.6rem;
        border-radius: 9px;
    }

    .financial-header-metric-label {
        font-size: 0.72rem;
        line-height: 1.35;
    }

    .financial-header-metric-value {
        font-size: 0.95rem;
        line-height: 1.4;
        word-break: break-word;
    }
}

/* جلوگیری از زوم خودکار در موبایل هنگام فوکوس روی input (iOS و اندروید) */
@media (max-width: 768px) {
    .panel-wrapper input,
    .panel-wrapper select,
    .panel-wrapper textarea {
        font-size: 16px !important;
    }
}

