/* Profile module — modern blue / slate UI */

.pf-page {
    --pf-bg: #f3f6fb;
    --pf-card: #ffffff;
    --pf-text: #0f172a;
    --pf-muted: #64748b;
    --pf-line: rgba(148, 163, 184, 0.32);
    --pf-blue: #3b82f6;
    --pf-indigo: #4f46e5;
    --pf-purple: #6366f1;
    --pf-ok: #059669;
    --pf-danger: #dc2626;
    direction: rtl;
    text-align: right;
    font-family: iransans, yekan, Tahoma, sans-serif;
    color: var(--pf-text);
    padding: 16px 0 40px;
    position: relative;
    background-color: var(--pf-bg);
    background-image: linear-gradient(
        180deg,
        #e7eef9 0%,
        #eef3fa 120px,
        #f3f6fb 260px,
        #f3f6fb 100%
    );
}

.pf-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 280px;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 55% 70% at 92% 0%, rgba(59, 130, 246, 0.14), transparent 70%),
        radial-gradient(ellipse 45% 60% at 8% 10%, rgba(14, 165, 233, 0.1), transparent 68%);
}

.pf-page > .container {
    position: relative;
    z-index: auto;
}

.pf-page a { text-decoration: none !important; }

/* Bootstrap modals must sit above site header; backdrop under modal dialog */
.modal-backdrop {
    z-index: 12000 !important;
}

.modal {
    z-index: 12010 !important;
}

.pf-page .modal,
.modal.pf-modal {
    z-index: 12010 !important;
}

.pf-modal .modal-dialog {
    margin: 1.75rem auto;
    max-width: 420px;
}

.pf-modal .modal-content {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
}

.pf-modal .modal-header {
    position: relative;
    display: block;
    padding: 16px 18px 16px 52px;
    border-bottom: 1px solid #eef2f7;
    direction: rtl;
    text-align: right;
}

.pf-modal .modal-title {
    margin: 0;
    font-family: iransans, yekan;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
    color: #0f172a;
}

.pf-modal .modal-header .close {
    position: absolute;
    top: 12px;
    left: 12px;
    right: auto;
    float: none;
    margin: 0;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 22px;
    font-weight: 400;
    line-height: 28px;
    opacity: 1;
    text-shadow: none;
}

.pf-modal .modal-header .close:hover {
    background: #eef2ff;
    color: #4338ca;
}

.pf-modal .modal-body {
    padding: 16px 18px 18px;
}

.pf-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--pf-muted);
}

.pf-crumb a {
    color: #4338ca !important;
    font-weight: 600;
}

.pf-crumb a:hover { color: #7c3aed !important; }

.pf-crumb-sep { opacity: 0.4; }

.pf-crumb-current {
    margin: 0;
    display: inline;
    font-family: yekan, iransans;
    font-size: 16px;
    font-weight: 700;
    color: var(--pf-text);
}

.pf-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.pf-nav {
    position: sticky;
    top: 88px;
    padding: 14px;
    background: var(--pf-card);
    border: 1px solid var(--pf-line);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.pf-nav-toggle,
.pf-nav-backdrop,
.pf-nav-close {
    display: none;
}

.pf-nav-head {
    display: block;
}

.pf-nav-title {
    margin: 0 0 12px;
    padding: 0 4px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-family: yekan, iransans;
    font-size: 14px;
    font-weight: 700;
    color: var(--pf-text);
}

.pf-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 12px;
    color: #475569 !important;
    font-family: yekan, iransans;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s ease, color .15s ease;
}

.pf-nav-link i {
    width: 18px;
    text-align: center;
    color: #818cf8;
}

.pf-nav-link:hover {
    background: #f8fafc;
    color: #4338ca !important;
}

.pf-nav-link.is-active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.14), rgba(59, 130, 246, 0.08));
    color: #4338ca !important;
}

.pf-nav-link.is-active i { color: #4f46e5; }

.pf-nav-sep {
    height: 1px;
    margin: 10px 0;
    background: #f1f5f9;
}

.pf-main {
    min-width: 0;
}

.pf-panel {
    padding: 18px 18px 20px;
    background: var(--pf-card);
    border: 1px solid var(--pf-line);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.pf-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-family: yekan, iransans;
    font-size: 17px;
    font-weight: 700;
}

.pf-panel-title i {
    color: #6366f1;
    margin-left: 8px;
}

.pf-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pf-info-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--pf-line);
}

.pf-info-item.full { grid-column: 1 / -1; }

.pf-info-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--pf-muted);
    font-family: yekan, iransans;
}

.pf-info-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--pf-text);
    word-break: break-word;
}

.pf-field {
    margin-bottom: 14px;
}

.pf-field-label {
    display: block;
    margin-bottom: 6px;
    font-family: yekan, iransans;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.pf-field-label .req {
    color: #dc2626;
    font-size: 12px;
    font-weight: 600;
}

.pf-input,
.pf-select,
.pf-textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--pf-line);
    border-radius: 12px;
    background-color: #fff;
    color: #0f172a;
    font-family: iransans, yekan, sans-serif;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.pf-select {
    /* Keep native OS dropdown — avoid Bootstrap custom-select conflicts */
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: menulist !important;
    background: #fff none !important;
    background-image: none !important;
    color: #0f172a !important;
    cursor: pointer;
    line-height: 1.4;
    padding-left: 12px;
    padding-right: 12px;
}

.pf-select option,
.pf-select optgroup {
    color: #0f172a !important;
    background-color: #fff !important;
    font-family: iransans, yekan, Tahoma, sans-serif;
    font-size: 14px;
}

.pf-select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.pf-textarea { min-height: 110px; resize: vertical; }

.pf-input:focus,
.pf-select:focus,
.pf-textarea:focus {
    background-color: #fff;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.pf-field,
.pf-form-grid,
.pf-panel,
.pf-main,
#cities_container {
    overflow: visible;
}

.pf-error {
    margin-top: 6px;
    color: #dc2626;
    font-size: 12px;
}

.pf-alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.8;
}

.pf-alert.ok {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.pf-alert.err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.pf-alert.warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.pf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: yekan, iransans;
    font-size: 14px;
    font-weight: 700;
    transition: filter .15s ease, background .15s ease, transform .12s ease;
}

.pf-btn-primary {
    color: #fff !important;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 55%, #7c3aed 100%);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.28);
}

.pf-btn-primary:hover {
    filter: brightness(1.05);
    color: #fff !important;
}

.pf-btn-ghost {
    color: #4338ca !important;
    background: #fff;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.pf-btn-ghost:hover {
    background: #eef2ff;
    color: #3730a3 !important;
}

.pf-btn-danger {
    color: #fff !important;
    background: #e53935;
}

.pf-btn-danger:hover {
    filter: brightness(1.05);
    color: #fff !important;
}

.pf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.pf-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--pf-muted);
    font-size: 14px;
    line-height: 1.9;
}

.pf-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--pf-line);
    border-radius: 14px;
}

.pf-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.pf-table th,
.pf-table td {
    padding: 12px 10px;
    text-align: center;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.pf-table th {
    background: #1e3a5f;
    color: #fff;
    font-family: yekan, iransans;
    font-weight: 700;
    white-space: nowrap;
}

.pf-table tr:nth-child(even) td { background: #f7fafc; }

.pf-table tr:hover td { background: #eff6ff; }

.pf-table a {
    color: #4338ca !important;
    font-weight: 700;
}

.pf-card {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--pf-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.pf-card-title {
    margin: 0 0 8px;
    font-family: yekan, iransans;
    font-size: 16px;
    font-weight: 700;
}

.pf-product-link {
    color: #1d4ed8 !important;
    text-decoration: none !important;
    transition: color .15s ease;
}

.pf-product-link:hover {
    color: #2563eb !important;
    text-decoration: underline !important;
}

.pf-product-missing {
    color: #94a3b8;
    font-weight: 600;
}

.pf-card-text {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.9;
    color: #475569;
}

.pf-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--pf-muted);
}

.pf-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 700;
}

.pf-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 14px;
}

.pf-form-grid .full { grid-column: 1 / -1; }

.pf-page select.pf-select {
    height: 44px;
}

/* Do not use Bootstrap .custom-select styling inside profile forms */
.pf-page select.custom-select {
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
    background: #fff none !important;
    background-image: none !important;
    color: #0f172a !important;
    height: 44px;
    padding: 10px 12px;
    line-height: 1.4;
}

@media screen and (max-width: 992px) {
    .pf-layout {
        grid-template-columns: 1fr;
    }

    body.pf-nav-lock {
        overflow: hidden;
    }

    .pf-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        margin-bottom: 12px;
        padding: 12px 14px;
        border: 1px solid var(--pf-line);
        border-radius: 16px;
        background: var(--pf-card);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
        color: var(--pf-text);
        font-family: yekan, iransans;
        cursor: pointer;
        text-align: right;
        appearance: none;
        -webkit-appearance: none;
    }

    .pf-nav-toggle-main {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
    }

    .pf-nav-toggle-main > i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(59, 130, 246, 0.12));
        color: #4f46e5;
        font-size: 15px;
        flex: 0 0 auto;
    }

    .pf-nav-toggle-text {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .pf-nav-toggle-text strong {
        font-size: 13px;
        font-weight: 700;
        color: var(--pf-text);
    }

    .pf-nav-toggle-text small {
        font-size: 12px;
        color: var(--pf-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pf-nav-toggle-chevron {
        color: #94a3b8;
        font-size: 12px;
        transition: transform .2s ease;
    }

    .pf-nav-toggle[aria-expanded="true"] .pf-nav-toggle-chevron {
        transform: rotate(-90deg);
        color: #4f46e5;
    }

    .pf-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 6200;
        background: rgba(15, 23, 42, 0.42);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }

    .pf-nav-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }

    .pf-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: min(300px, 88vw);
        margin: 0;
        padding: 16px 14px 24px;
        border-radius: 18px 0 0 18px;
        border: none;
        border-left: 1px solid var(--pf-line);
        box-shadow: -18px 0 48px rgba(15, 23, 42, 0.18);
        z-index: 6300;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(105%);
        transition: transform .28s ease;
        display: block;
        grid-template-columns: none;
    }

    .pf-nav.is-open {
        transform: translateX(0);
    }

    .pf-nav-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 8px;
    }

    .pf-nav-title {
        margin: 0;
        padding: 0;
        border: none;
        flex: 1 1 auto;
    }

    .pf-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #f8fafc;
        color: #475569;
        cursor: pointer;
        flex: 0 0 auto;
    }

    .pf-nav-close:hover {
        background: #eef2ff;
        color: #4338ca;
    }

    .pf-nav-sep {
        display: block;
    }
}

@media screen and (max-width: 640px) {
    .pf-info-grid,
    .pf-form-grid {
        grid-template-columns: 1fr;
    }
}
