/* eqtesad-melk.css — پورتال اقتصاد ملک */

.em-wrap { padding: 0 4px 24px; }

.em-hero .red-hero-sub { max-width: 520px; }

.em-kpi--role .em-role-chip {
    font-size: 0.85rem;
    line-height: 1.3;
}

.em-toolbar { flex-wrap: wrap; gap: 8px; align-items: center; }

.em-card { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.em-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,.15); }

.em-card-badge {
    display: inline-block;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.em-lead {
    margin-top: 10px;
    font-size: .82rem;
    color: #475569;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}
.em-lead--empty { color: #94a3b8; font-style: italic; }

.em-case-badge {
    margin-top: 8px;
    display: inline-block;
    background: #fef3c7;
    color: #b45309;
    font-size: .78rem;
    padding: 2px 8px;
    border-radius: 99px;
}

.em-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 16px;
    color: #64748b;
}

.em-cases-panel {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.em-cases-panel > div:first-child,
.em-cases-head {
    background: #fff;
    border-radius: 16px;
    width: min(640px, 100%);
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0,0,0,.2);
}
.em-cases-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.em-cases-head h3 { margin: 0; font-size: 1rem; }
.em-cases-list { overflow-y: auto; padding: 12px; }

/* ── لیست پرونده — کارت فلش ── */
.em-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    padding: 4px 0 24px;
}
.em-case-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: right;
    width: 100%;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.em-case-card:hover {
    border-color: #a5b4fc;
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}
.em-case-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.em-case-card .em-case-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    line-height: 1.45;
    margin-bottom: 6px;
}
.em-case-card .em-case-loc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.5;
    flex: 1;
}
.em-case-card-cta {
    margin-top: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #4338ca;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.em-case-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 4px 12px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
}
.em-case-row:hover { background: #f8fafc; border-color: #c7d2fe; }
.em-case-key { font-size: .75rem; color: #6366f1; font-weight: 600; grid-column: 1 / -1; }
.em-case-title { font-weight: 600; }
.em-case-loc { font-size: .8rem; color: #64748b; grid-column: 1 / 3; }

.em-status {
    display: inline-block;
    color: #fff;
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 99px;
    flex-shrink: 0;
}

/* ── مودال پرونده ── */
body.em-case-open { overflow: hidden; }

.em-case-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: em-fade-in 0.2s ease;
}
@keyframes em-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.em-case-modal {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    animation: em-slide-up 0.25s ease;
}
@keyframes em-slide-up {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.em-case-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
    flex-shrink: 0;
}
.em-case-modal-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    color: #312e81;
    line-height: 1.4;
}
.em-case-modal-close {
    border: none;
    background: #fff;
    color: #64748b;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.em-case-modal-close:hover { background: #f1f5f9; color: #1e293b; }

.em-case-modal-body {
    padding: 20px 22px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.em-case-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
}
.em-case-section--actions {
    background: #eef2ff;
    border-color: #c7d2fe;
    display: flex;
    justify-content: flex-start;
}
.em-case-section-title {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #312e81;
    font-weight: 700;
}
.em-empty-inline {
    color: #94a3b8;
    font-size: 0.88rem;
    font-style: italic;
    list-style: none;
}

.em-detail { max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto; }
.em-detail h2 { margin: 0 0 12px; }
.em-detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; font-size: .85rem; align-items: center; }
.em-detail-loc { color: #475569; margin: 0; font-size: 0.88rem; }
.em-participants { padding-right: 20px; margin: 8px 0 0; }

/* ── همکاری پرونده: تب‌ها، کارت عضو، تایم‌لاین ── */
.em-case-collab { display: flex; flex-direction: column; gap: 14px; }
.em-case-creator {
    font-size: 0.82rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
}
.em-case-creator-login,
.em-detail-login,
.em-note-login,
.em-activity-login,
.em-user-pick-login {
    color: #6366f1;
    font-size: 0.78rem;
    font-weight: 600;
}
.em-case-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}
.em-case-tab {
    border: none;
    background: transparent;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
    transition: color .15s, border-color .15s, background .15s;
}
.em-case-tab:hover { color: #4338ca; background: #f8fafc; }
.em-case-tab--active {
    color: #312e81;
    border-bottom-color: #6366f1;
    background: #eef2ff;
}
.em-case-tab-panel { padding-top: 4px; }
.em-member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.em-member-card {
    display: flex;
    gap: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.em-member-card:hover {
    border-color: #a5b4fc;
    box-shadow: 0 4px 16px rgba(99, 102, 241, .12);
    transform: translateY(-1px);
}
.em-member-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}
.em-member-avatar--agent { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.em-member-avatar--legal { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.em-member-avatar--municipality { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.em-member-avatar--registry { background: linear-gradient(135deg, #10b981, #059669); }
.em-member-avatar--appraisal { background: linear-gradient(135deg, #f59e0b, #d97706); }
.em-member-avatar--contractor { background: linear-gradient(135deg, #f97316, #ea580c); }
.em-member-avatar--finance { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.em-member-avatar--other { background: linear-gradient(135deg, #94a3b8, #64748b); }
.em-member-body { flex: 1; min-width: 0; }
.em-member-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}
.em-member-name { font-weight: 700; font-size: 0.92rem; color: #1e293b; }
.em-member-login { font-size: 0.76rem; color: #6366f1; margin-top: 2px; }
.em-member-role {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.em-member-role--agent { background: #eef2ff; color: #4338ca; }
.em-member-role--legal { background: #f5f3ff; color: #6d28d9; }
.em-member-role--municipality { background: #e0f2fe; color: #0369a1; }
.em-member-role--registry { background: #d1fae5; color: #047857; }
.em-member-role--appraisal { background: #fef3c7; color: #b45309; }
.em-member-role--contractor { background: #ffedd5; color: #c2410c; }
.em-member-role--finance { background: #ccfbf1; color: #0f766e; }
.em-member-role--other { background: #f1f5f9; color: #475569; }
.em-member-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 8px;
}
.em-member-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    color: #94a3b8;
}
.em-member-stat { font-weight: 600; color: #6366f1; }
.em-add-part-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}
.em-add-part {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}
.em-activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding-left: 4px;
}
.em-activity-item {
    display: flex;
    gap: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
}
.em-activity-item--join { border-right: 3px solid #6366f1; }
.em-activity-item--action { border-right: 3px solid #f59e0b; }
.em-activity-item--legal { border-right: 3px solid #8b5cf6; }
.em-activity-item--municipality { border-right: 3px solid #0ea5e9; }
.em-activity-item--registry { border-right: 3px solid #10b981; }
.em-activity-icon { font-size: 1.2rem; flex-shrink: 0; }
.em-activity-head {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.88rem;
}
.em-activity-role,
.em-activity-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
}
.em-activity-text { margin: 0; font-size: 0.88rem; line-height: 1.55; color: #334155; }
.em-activity-time { display: block; margin-top: 6px; font-size: 0.74rem; color: #94a3b8; }
.em-notes--full { max-height: 320px; }
.em-note-time { margin-right: auto; font-size: 0.72rem; color: #94a3b8; }

.em-notes { margin-bottom: 12px; max-height: 240px; overflow-y: auto; }
.em-note {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}
.em-note-head { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.em-note-author { font-size: .78rem; color: #6366f1; font-weight: 600; }
.em-note p { margin: 4px 0 0; font-size: .9rem; line-height: 1.55; }
.em-note-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}
.em-note-form textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.em-note-form select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    font-family: inherit;
}
.em-note-form button { justify-self: start; }

/* پورتال عمومی */
.em-portal-wrap { min-height: 100vh; }
.em-portal-hero {
    text-align: center;
    padding: 64px 24px 48px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    color: #fff;
}
.em-portal-hero h1 { font-size: 2.2rem; margin: 0 0 12px; }
.em-portal-hero p { opacity: .9; max-width: 560px; margin: 0 auto 28px; line-height: 1.7; }
.em-portal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.em-portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.em-portal-btn--primary { background: #fff; color: #312e81; }
.em-portal-btn--ghost { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.em-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    max-width: 960px;
    margin: -32px auto 48px;
    padding: 0 24px;
}
.em-portal-btn--ghost { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); text-decoration: none; }
.em-portal-btn--ghost:hover { background: rgba(255,255,255,.25); color: #fff; }

.em-portal-auth {
    max-width: 420px;
    margin: -16px auto 32px;
    padding: 0 24px;
}
.em-portal-auth-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
}
.em-portal-auth-card h3 { margin: 0 0 16px; font-size: 1rem; }

.em-main-tabs {
    display: flex;
    gap: 8px;
    margin: 12px 4px 16px;
    flex-wrap: wrap;
}
.em-main-tab {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: .9rem;
}
.em-main-tab--active {
    background: #312e81;
    color: #fff;
    border-color: #312e81;
}

.em-cases-full { padding: 0 4px 24px; }

.em-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.em-mini-btn {
    font-size: .75rem;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    cursor: pointer;
    font-family: inherit;
}
.em-mini-btn:hover { background: #e0e7ff; }

.em-detail-edit { margin: 0; display: grid; gap: 10px; }
.em-detail-edit label { font-size: .8rem; color: #64748b; font-weight: 600; }
.em-detail-edit select, .em-detail-edit textarea, .em-detail-edit .red-inp {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    box-sizing: border-box;
}

.em-add-part { margin: 12px 0; display: grid; gap: 8px; }
.em-user-results, .em-org-row [data-ref="orgUserPick"] {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 160px;
    overflow-y: auto;
}
.em-user-pick {
    text-align: right;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    font-family: inherit;
}
.em-user-pick:hover { background: #eef2ff; border-color: #a5b4fc; }

.em-link-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: .78rem;
    font-family: inherit;
    padding: 0 4px;
}

.em-org-form, .em-org-list { padding: 0 4px 20px; }
.em-org-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    align-items: start;
    margin-bottom: 20px;
}
.em-org-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.em-org-table th, .em-org-table td {
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: right;
}
.em-org-table th { background: #f8fafc; }

.melk-body { margin: 0; background: #f1f5f9; min-height: 100vh; }

.melk-app { min-height: 100vh; display: flex; flex-direction: column; }
.melk-app--landing { background: linear-gradient(160deg, #1e1b4b 0%, #312e81 45%, #1e1b4b 100%); color: #e2e8f0; }
.melk-app--workspace { background: #f3f4f6; }

/* ── کارت‌های نقش (مشابه service.php) ── */
.melk-hero { padding: 48px 24px 28px !important; }
.melk-hero h1 { font-size: 1.75rem !important; }
.melk-hero-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto 20px;
}
.melk-role-card {
    flex: 1 1 140px;
    max-width: 180px;
    padding: 20px 12px;
    background: rgba(49, 46, 129, .55);
    border: 1px solid rgba(199, 210, 254, .25);
    border-radius: 16px;
    cursor: pointer;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    font-family: inherit;
    color: inherit;
    text-align: center;
}
.melk-role-card:hover {
    transform: translateY(-4px);
    border-color: #a5b4fc;
    box-shadow: 0 8px 24px rgba(99, 102, 241, .25);
}
.melk-role-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.melk-role-card strong { display: block; font-size: .92rem; color: #f8fafc; margin-bottom: 4px; }
.melk-role-card small { color: #a5b4fc; font-size: .72rem; line-height: 1.4; display: block; }
.melk-hero-hint { color: #c7d2fe !important; font-size: .88rem !important; margin: 16px auto 0 !important; opacity: .9; }

.melk-role-card--lead:hover   { border-color: #818cf8; }
.melk-role-card--mgr:hover    { border-color: #34d399; }
.melk-role-card--coord:hover  { border-color: #38bdf8; }
.melk-role-card--spec:hover   { border-color: #f472b6; }
.melk-role-card--agent:hover  { border-color: #fbbf24; }
.melk-role-card--legal:hover  { border-color: #c084fc; }
.melk-role-card--mun:hover    { border-color: #60a5fa; }
.melk-role-card--reg:hover    { border-color: #f87171; }
.melk-role-card--appr:hover   { border-color: #2dd4bf; }
.melk-role-card--contr:hover  { border-color: #fb923c; }
.melk-role-card--fin:hover    { border-color: #facc15; }

/* ── کارت مدیر سیستم ── */
.melk-admin-entry {
    max-width: 540px;
    margin: 0 auto 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.melk-admin-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(16,185,129,.18) 0%, rgba(5,150,105,.28) 100%);
    border: 2px solid rgba(52,211,153,.5);
    border-radius: 18px;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    transition: transform .15s, border-color .2s, box-shadow .2s;
    text-align: right;
    direction: rtl;
    position: relative;
}
.melk-admin-card:hover {
    transform: translateY(-3px);
    border-color: #34d399;
    box-shadow: 0 8px 30px rgba(16,185,129,.35);
}
.melk-admin-card__icon {
    font-size: 2.2rem;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: rgba(16,185,129,.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.melk-admin-card__text {
    flex: 1;
    text-align: right;
}
.melk-admin-card__text strong {
    display: block;
    font-size: 1.05rem;
    color: #ecfdf5;
    font-weight: 800;
    margin-bottom: 3px;
}
.melk-admin-card__text small {
    color: #6ee7b7;
    font-size: .78rem;
}
.melk-admin-card__arrow {
    font-size: .82rem;
    color: #34d399;
    font-weight: 700;
    white-space: nowrap;
    padding: 6px 14px;
    background: rgba(16,185,129,.15);
    border-radius: 20px;
    border: 1px solid rgba(52,211,153,.3);
}
.melk-admin-card::before {
    content: '👑';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 1rem;
    background: #1e293b;
    border-radius: 20px;
    padding: 2px 8px;
    border: 1px solid rgba(52,211,153,.4);
}
.melk-admin-hint {
    font-size: .76rem;
    color: #94a3b8;
    text-align: center;
    direction: ltr;
    letter-spacing: .02em;
}
.melk-admin-hint code {
    background: rgba(255,255,255,.08);
    padding: 1px 6px;
    border-radius: 4px;
    color: #6ee7b7;
    font-size: .78rem;
}

/* ── دکمه و پنل ورود آزمایشی ── */
.melk-demo-toggle {
    padding: 6px 14px;
    border: 1.5px solid rgba(251,191,36,.5);
    border-radius: 20px;
    background: rgba(251,191,36,.12);
    color: #fbbf24;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    white-space: nowrap;
}
.melk-demo-toggle:hover,
.melk-demo-toggle--active {
    background: rgba(251,191,36,.22);
    border-color: #fbbf24;
    color: #fef3c7;
}

/* ── پنل ورود آزمایشی ── */
.melk-demo-panel {
    position: fixed;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: min(96vw, 1040px);
}
.melk-demo-panel__inner {
    background: #0f172a;
    border: 2px solid rgba(251,191,36,.4);
    border-top: none;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.7);
    overflow: hidden;
}
.melk-demo-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    background: linear-gradient(135deg, rgba(251,191,36,.15), rgba(251,191,36,.05));
    border-bottom: 1px solid rgba(251,191,36,.25);
    font-size: .9rem;
    font-weight: 800;
    color: #fbbf24;
    gap: 10px;
}
.melk-demo-panel__head-icon { font-size: 1.2rem; }
.melk-demo-panel__head-title { flex: 1; }
.melk-demo-close {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}
.melk-demo-close:hover { color: #f87171; background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.3); }

.melk-demo-panel__note {
    padding: 10px 22px;
    font-size: .78rem;
    color: #64748b;
    background: rgba(0,0,0,.3);
    border-bottom: 1px solid rgba(255,255,255,.05);
    direction: rtl;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.melk-demo-panel__note code {
    background: rgba(251,191,36,.15);
    color: #fbbf24;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .05em;
}

/* گرید کارت‌های کاربران — همان شکل melk-hero-cards */
.melk-demo-list {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    padding: 18px 22px 22px;
    direction: rtl;
    max-height: min(70vh, 520px);
    overflow-y: auto;
}

.melk-demo-row {
    flex: 1 1 140px;
    max-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px 14px;
    background: rgba(49, 46, 129, .55);
    border: 1px solid rgba(199, 210, 254, .25);
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    text-align: center;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    position: relative;
}
.melk-demo-row:hover {
    transform: translateY(-4px);
    border-color: #a5b4fc;
    box-shadow: 0 8px 24px rgba(99, 102, 241, .25);
    z-index: 1;
}
.melk-demo-row:hover .melk-demo-row__badge {
    background: rgba(52,211,153,.25);
    color: #6ee7b7;
    border-color: rgba(52,211,153,.4);
}
.melk-demo-row--loading {
    opacity: .6;
    pointer-events: none;
}

.melk-demo-row__icon {
    font-size: 2rem;
    line-height: 1;
    display: block;
    margin-bottom: 2px;
}
.melk-demo-row__name {
    font-size: .82rem;
    font-weight: 800;
    color: #e2e8f0;
    white-space: nowrap;
}
.melk-demo-row__user {
    font-size: .7rem;
    color: #475569;
    font-family: monospace;
    background: rgba(255,255,255,.05);
    padding: 2px 7px;
    border-radius: 5px;
    direction: ltr;
}
.melk-demo-row__badge {
    font-size: .68rem;
    font-weight: 700;
    color: #34d399;
    padding: 3px 10px;
    background: rgba(52,211,153,.1);
    border-radius: 20px;
    border: 1px solid rgba(52,211,153,.2);
    transition: all .15s;
    margin-top: 2px;
}

.melk-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    max-width: 900px;
    margin: 0 auto 48px;
    padding: 0 20px;
}
.melk-feat {
    background: rgba(49, 46, 129, .45);
    border: 1px solid rgba(199, 210, 254, .2);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}
.melk-feat h3 { margin: 0 0 4px; font-size: .88rem; color: #c7d2fe; }
.melk-feat p { margin: 0; font-size: .75rem; color: #a5b4fc; }
.melk-feat--coord { border-color: rgba(56, 189, 248, .35); }
.melk-feat--coord h3 { color: #7dd3fc; }
.melk-feat--link {
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    width: 100%;
    transition: transform .15s, border-color .15s;
}
.melk-feat--link:hover {
    transform: translateY(-3px);
    border-color: #a5b4fc;
}
.melk-feat--link h3, .melk-feat--link p { pointer-events: none; }

.melk-login-role {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    font-size: .9rem;
    color: #312e81;
}
.melk-login-role span { font-size: 1.4rem; }

/* ── پنل‌های توسعه (ساخت، آگهی، خدمات) ── */
.em-ext-panel { padding: 12px 16px 24px; }
.em-ext-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.em-ext-title { margin: 0; font-size: 1.05rem; flex: 1 1 200px; color: #0f172a; }
.em-ext-form { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px 18px; margin-bottom: 16px; box-shadow: 0 10px 30px rgba(2,6,23,.05); }
.em-ext-form h3 { margin: 0 0 12px; font-size: 1rem; color: #0f172a; }
.em-ext-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.em-ext-grid2 label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: #334155; }
.em-ext-grid2 label input, .em-ext-grid2 label select, .em-ext-form textarea, .em-ext-form .red-inp, .em-ext-form .red-sel {
    border-radius: 10px;
    border-color: #cbd5e1;
    background: #f8fafc;
}
.em-ext-grid2 label input:focus, .em-ext-grid2 label select:focus, .em-ext-form textarea:focus, .em-ext-form .red-inp:focus, .em-ext-form .red-sel:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
    background: #fff;
}
.em-ext-actions { display: flex; gap: 8px; margin-top: 12px; }
.em-ext-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.em-ext-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px 14px 12px; box-shadow: 0 10px 26px rgba(2,6,23,.05); transition: transform .14s, box-shadow .14s, border-color .14s; }
.em-ext-card:hover { transform: translateY(-2px); border-color: #c7d2fe; box-shadow: 0 14px 34px rgba(2,6,23,.08); }
.em-ext-card-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.em-ext-card-meta { font-size: .8rem; color: #64748b; margin-bottom: 8px; }
.em-ext-desc { font-size: .85rem; color: #334155; margin: 0; line-height: 1.7; }
.em-ext-detail { background: #f8fafc; border: 1px solid #c7d2fe; border-radius: 12px; padding: 16px; margin-top: 16px; }
.em-ext-detail-head { display: flex; justify-content: space-between; align-items: center; }
.em-badge { font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: #eef2ff; color: #4338ca; }
.em-badge--vis { background: #fef3c7; color: #92400e; }
.em-badge--active { background: #d1fae5; color: #065f46; }
.em-badge--draft { background: #f1f5f9; color: #64748b; }
.em-vis-fieldset { border: 1px solid #c7d2fe; border-radius: 10px; padding: 12px; margin: 12px 0; }
.em-vis-roles { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.em-vis-roles label { font-size: .85rem; display: flex; align-items: center; gap: 4px; }
.em-vis-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.em-vis-chip { background: #eef2ff; padding: 4px 10px; border-radius: 99px; font-size: .8rem; cursor: pointer; }
.em-member-chip { display: inline-block; background: #f1f5f9; padding: 6px 12px; border-radius: 8px; margin: 4px; font-size: .85rem; }
.em-svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.em-svc-card { padding: 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; cursor: pointer; text-align: center; font-family: inherit; }
.em-svc-card:hover { border-color: #6366f1; }
.em-svc-icon { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.em-svc-hint { color: #64748b; font-size: .88rem; }
.em-svc-wizard { background: #fff; border-radius: 12px; padding: 16px; border: 1px solid #e2e8f0; margin-bottom: 16px; }
.em-svc-track { background: #f8fafc; border-radius: 12px; padding: 16px; }
.em-svc-ok { color: #059669; padding: 10px; background: #ecfdf5; border-radius: 8px; }
.em-svc-err { color: #dc2626; padding: 10px; background: #fef2f2; border-radius: 8px; }

/* ── قرارداد ─────────────────────────────────── */
.em-contract-overlay {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(0,0,0,.55); display: flex;
    align-items: flex-start; justify-content: center;
    padding: 24px 16px; overflow-y: auto;
}
.em-contract-modal {
    background: #fff; border-radius: 16px;
    width: 100%; max-width: 960px;
    box-shadow: 0 16px 64px rgba(0,0,0,.3);
    display: flex; flex-direction: column;
}
.em-contract-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid #e2e8f0;
    gap: 8px;
}
.em-contract-modal-head h3 { margin: 0; font-size: 1rem; }
.em-contract-wizard { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; background: #f8fafc; }
.em-contract-form-bar { border-bottom: 1px solid #e2e8f0; }
.em-contract-body { padding: 24px; overflow-y: auto; max-height: calc(100vh - 260px); }
.melk-contract-body { direction: rtl; }

/* ── کارت پروژه ─────────────────────────────── */
.em-proj-card { transition: box-shadow .15s; }
.em-proj-card:hover { box-shadow: 0 4px 16px rgba(99,102,241,.15); }
.em-part-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.em-member-chip { display: flex; align-items: center; gap: 8px; background: #f1f5f9;
    padding: 6px 10px; border-radius: 8px; font-size: .83rem; }
.em-member-chip strong { color: #1e293b; }
.em-member-chip span { color: #64748b; }
.em-chip-rm { background: none; border: none; cursor: pointer; color: #94a3b8; font-size: .75rem; padding: 0 2px; }
.em-chip-rm:hover { color: #ef4444; }
.em-add-part { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.em-btn-contract { background: #f0fdf4; color: #065f46; border-color: #bbf7d0; }
.em-btn-contract:hover { background: #dcfce7; }
.em-constr-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }

.melk-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: #1e1b4b;
    color: #fff;
    flex-wrap: wrap;
}
.melk-header--app { position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.melk-brand {
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    text-decoration: none;
}
.melk-header__nav {
    display: flex;
    gap: 14px;
    margin-right: auto;
}
.melk-header__nav a, .melk-header__link {
    color: #c7d2fe;
    text-decoration: none;
    font-size: .88rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.melk-header__nav a:hover { color: #fff; }
.melk-header__user { font-size: .85rem; color: #e2e8f0; }
.melk-header__btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: #6366f1;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.melk-header__btn--ghost { background: transparent; border: 1px solid rgba(255,255,255,.35); }
.melk-main { flex: 1; overflow: auto; }
.melk-login-hint { font-size: .85rem; color: #64748b; margin: 0 0 16px; }
.em-standalone { padding-bottom: 32px; }

.em-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    padding: 12px 24px; border-radius: 10px; font-weight: 600; z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,.2); display: none;
}
.em-toast--ok { background: #059669; color: #fff; }
.em-toast--err { background: #dc2626; color: #fff; }
.em-note-type { font-size: .75rem; color: #6366f1; margin-right: 8px; }
.em-note--action { border-right: 3px solid #f59e0b; }
.em-note--legal { border-right: 3px solid #8b5cf6; }
.em-detail-assign { font-size: .88rem; color: #475569; margin: 6px 0 0; }

/* ── مرکز کد نوسازی ── */
.em-case-reno, .em-detail-reno {
    font-size: 0.78rem;
    color: #4338ca;
    font-family: ui-monospace, monospace;
    margin: 4px 0;
}
.em-reno-link {
    border: none;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
}
.em-reno-link:hover { background: #c7d2fe; }
.em-reno-panel { padding: 8px 4px 32px; max-width: 1200px; margin: 0 auto; }
.em-reno-hub-search { margin-bottom: 20px; }
.em-reno-hub-label { display: block; font-weight: 700; color: #312e81; margin-bottom: 8px; }
.em-reno-hub-search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.em-reno-code-inp { flex: 1; min-width: 220px; font-family: ui-monospace, monospace; text-align: center; }
.em-reno-hint { font-size: 0.82rem; color: #64748b; margin: 10px 0 0; }
.em-reno-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.em-reno-suggest-item {
    border: 1px solid #c7d2fe;
    background: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    cursor: pointer;
}
.em-reno-suggest-item:hover { background: #eef2ff; }
.em-reno-result { margin-top: 16px; }
.em-reno-hub-head {
    background: linear-gradient(135deg, #312e81, #4338ca);
    color: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
}
.em-reno-hub-code { font-size: 1.35rem; font-weight: 800; font-family: ui-monospace, monospace; }
.em-reno-hub-sub { opacity: 0.9; font-size: 0.88rem; margin-top: 4px; }
.em-reno-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
}
.em-reno-section-title { margin: 0 0 12px; font-size: 0.95rem; color: #312e81; }
.em-reno-gis-code { font-size: 1.1rem; font-weight: 700; font-family: ui-monospace, monospace; color: #4338ca; }
.em-reno-gis-loc, .em-reno-gis-addr { font-size: 0.88rem; color: #475569; margin-top: 6px; }
.em-reno-gis-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 0.8rem; color: #64748b; }
.em-reno-gis-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.em-reno-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.em-reno-case-card {
    text-align: right;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.em-reno-case-card:hover { border-color: #a5b4fc; box-shadow: 0 4px 14px rgba(99,102,241,.12); }
.em-reno-case-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.em-reno-case-title { font-weight: 600; font-size: 0.9rem; }
.em-reno-case-meta { font-size: 0.78rem; color: #64748b; margin-top: 8px; display: flex; gap: 12px; }
.em-reno-comm-item {
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.88rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.em-reno-comm-date { color: #94a3b8; font-size: 0.78rem; }

/* ── چیدمان هاب: پانل GIS (چپ) + پرونده‌ها (راست) ── */
.em-reno-hub-layout {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 16px;
    align-items: start;
}
.em-reno-gis-sidebar {
    position: sticky;
    top: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .06);
}
.em-reno-gis-sidebar--empty { padding: 20px; min-height: 120px; }
.em-reno-gis-panel.gis-detail-panel--embedded { border: none; border-radius: 0; max-height: none; }
.em-reno-gis-panel .gis-panel-body { max-height: 52vh; overflow-y: auto; }
.em-reno-gis-actions-bar { flex-wrap: wrap; }
.em-reno-hub-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.em-reno-units-list { display: flex; flex-direction: column; gap: 6px; }
.em-reno-unit-item {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 8px 10px; background: #f8fafc; border-radius: 8px; font-size: 12px;
}
.em-reno-unit-item code { font-weight: 700; color: #4338ca; }

@media (max-width: 900px) {
    .em-reno-hub-layout { grid-template-columns: 1fr; }
    .em-reno-gis-sidebar { position: static; }
    .em-reno-gis-panel .gis-panel-body { max-height: none; }
}

@media (max-width: 640px) {
    .em-case-overlay { padding: 0; align-items: flex-end; }
    .em-case-modal { max-height: 92vh; border-radius: 18px 18px 0 0; }
    .em-case-grid { grid-template-columns: 1fr; }
}
.em-mini-btn--map { background: #312e81; color: #fff; }

.em-portal-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    text-align: center;
}
.em-portal-card-icon { font-size: 2rem; margin-bottom: 12px; }
.em-portal-card h3 { margin: 0 0 8px; font-size: 1rem; }
.em-portal-card p { margin: 0; font-size: .85rem; color: #64748b; line-height: 1.6; }

/* ── بنگاه شهرستان و متخصصان ── */
.em-sub-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.em-sub-tab {
    padding: 6px 14px; border: 1px solid #e2e8f0; border-radius: 8px;
    background: #f8fafc; font-size: .85rem; cursor: pointer; color: #475569;
}
.em-sub-tab--active { background: #1e1b4b; color: #fff; border-color: #1e1b4b; }
.em-ext-toolbar--sub { margin-top: 8px; padding-top: 0; }
.em-ext-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.em-ext-note { font-size: .8rem; color: #7c3aed; background: #f5f3ff; padding: 8px; border-radius: 8px; margin-top: 8px; }
.em-ext-contact { font-size: .82rem; color: #334155; margin-top: 6px; }
.em-ext-desc { font-size: .85rem; color: #475569; margin: 0; line-height: 1.6; }
.em-spec-status-box { margin-top: 12px; }
.em-spec-status {
    padding: 12px 14px; border-radius: 10px; font-size: .88rem;
    background: #f8fafc; border: 1px solid #e2e8f0;
}
.em-spec-status--pending_approval { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.em-spec-status--approved { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.em-spec-status--rejected { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.em-status-sel { max-width: 180px; font-size: .82rem; }
.melk-role-card--county { --melk-accent: #0d9488; }
.melk-role-card--arch { --melk-accent: #7c3aed; }
.melk-role-card--struct { --melk-accent: #2563eb; }
.melk-role-card--mep { --melk-accent: #ea580c; }
.melk-role-card--pend { --melk-accent: #d97706; }

/* ── بخش‌های لندینگ بنگاه شهرستان و متخصصان ── */
.melk-landing-section {
    max-width: 1100px; margin: 0 auto 28px; padding: 24px 20px;
    border-radius: 16px; border: 1px solid #e2e8f0;
}
.melk-landing-section--org { background: transparent; border: none; padding-top: 0; }
.melk-landing-section--county {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
    border-color: #99f6e4;
}
.melk-landing-section--specialists {
    background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
    border-color: #ddd6fe;
}
.melk-landing-section__head { text-align: center; margin-bottom: 16px; }
.melk-landing-section__head h2 { margin: 0 0 6px; font-size: 1.15rem; color: #0f172a; }
.melk-landing-section__head p { margin: 0; font-size: .88rem; color: #64748b; }
.melk-landing-section__cards { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.melk-landing-section__cards--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; max-width: 720px; margin: 0 auto; }
.melk-section-link {
    display: block; margin: 16px auto 0; background: none; border: none;
    color: #4338ca; font-size: .88rem; cursor: pointer; font-family: inherit;
}
.melk-section-link:hover { text-decoration: underline; }

.melk-demo-row--admin {
    border-color: rgba(251, 191, 36, .45);
    background: rgba(251, 191, 36, .1);
}
.melk-demo-row--admin:hover {
    border-color: #fbbf24;
    box-shadow: 0 8px 24px rgba(251, 191, 36, .2);
}

/* ── بنر معرفی پنل‌های توسعه ── */
.em-ext-intro {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 18px 20px; margin-bottom: 16px;
}
.em-ext-intro--listings { border-color: #bfdbfe; background: linear-gradient(135deg, #eff6ff, #fff); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.em-form-section { margin: 14px 0; padding-top: 4px; border-top: 1px dashed #e2e8f0; }
.em-form-section:first-of-type { border-top: none; padding-top: 0; }
.em-form-section h4 { margin: 0 0 10px; font-size: .9rem; color: #334155; }
.em-vis-hint { font-size: .8rem; color: #64748b; margin: 6px 0 10px; }
.em-vis-block { margin-top: 10px; }
.em-vis-pick-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.em-vis-chip--btn { border: 1px dashed #a5b4fc; background: #fff; cursor: pointer; font-family: inherit; }
.em-vis-chip--btn:hover { background: #eef2ff; }
.em-user-add-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.em-user-add-row .red-inp { flex: 1 1 160px; }
.em-user-results { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.em-user-pick { text-align: right; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; cursor: pointer; font-family: inherit; }
.em-user-pick:hover { border-color: #6366f1; background: #eef2ff; }
.em-ext-card--listing { border-right: 3px solid #3b82f6; }
.em-listing-form .em-audience-fieldset { background: #f8fafc; }
.em-listing-wizard { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px; margin-bottom: 16px; box-shadow: 0 10px 30px rgba(2,6,23,.05); }
.em-wizard-steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.em-wiz-step { font-size: .8rem; padding: 6px 14px; border-radius: 99px; background: #f1f5f9; color: #64748b; }
.em-wiz-step--active { background: #4f46e5; color: #fff; font-weight: 600; }
.em-wiz-step--done { background: #d1fae5; color: #065f46; }
.em-form-bank-hint { font-size: .85rem; color: #64748b; margin: 0 0 14px; }
.em-form-bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.em-form-bank-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 16px; border: 2px solid #e2e8f0; border-radius: 14px; background: #fff;
    cursor: pointer; text-align: right; font-family: inherit; transition: border-color .15s, box-shadow .15s, transform .12s;
}
.em-form-bank-card:hover { border-color: #6366f1; box-shadow: 0 8px 24px rgba(99,102,241,.12); transform: translateY(-2px); }
.em-form-bank-icon { font-size: 1.8rem; margin-bottom: 4px; }
.em-form-bank-card strong { font-size: .95rem; color: #0f172a; }
.em-form-bank-sub { font-size: .72rem; color: #64748b; }
.em-form-bank-std { font-size: .68rem; color: #6366f1; background: #eef2ff; padding: 2px 8px; border-radius: 99px; }
.em-form-bank-meta { font-size: .7rem; color: #94a3b8; margin-top: 4px; }
.em-selected-form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px; background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; }
.em-selected-form-badge { font-size: 2rem; }
.em-dyn-field { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: #334155; }
.em-dyn-field--full { grid-column: 1 / -1; }
.em-dyn-lbl { font-size: .82rem; color: #334155; margin-bottom: 4px; display: block; }
.em-dyn-grid .red-inp, .em-dyn-grid .red-sel { border-radius: 10px; border-color: #cbd5e1; background: #f8fafc; }
.em-badge--form { background: #e0e7ff; color: #3730a3; }
.em-badge--warn { background: #fef3c7; color: #92400e; }
.em-form-attach-preview { margin: 10px 0 8px; padding: 10px; background: #f8fafc; border-radius: 10px; border: 1px dashed #c7d2fe; }
.em-form-attach-row { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; padding: 3px 0; border-bottom: 1px solid #f1f5f9; }
.em-form-attach-row:last-child { border-bottom: none; }
.em-form-attach-row span { color: #64748b; }
.em-form-attach-row strong { color: #1e293b; text-align: left; }
.em-form-attach-row--full { padding: 8px 0; }
.em-ext-card-actions { margin-top: 8px; }
.red-btn--sm { font-size: .78rem; padding: 5px 12px; }
.em-listing-modal { position: fixed; inset: 0; z-index: 1100; background: rgba(15,23,42,.5); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.em-listing-modal__box { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.em-listing-modal__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; }
.em-listing-modal__head h3 { margin: 0; font-size: 1rem; }
.em-listing-modal__close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #64748b; }
.em-listing-modal__body { padding: 16px 18px 20px; }
.em-form-attach-std { font-size: .75rem; color: #6366f1; margin: 0 0 12px; }
.em-form-attach-sheet { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; }
.em-spec-wizard { margin-bottom: 12px; }
.em-spec-review h4 { margin: 0 0 10px; font-size: .95rem; }
.em-ext-card--specialist .em-ext-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.em-form-attach-meta { font-size: .75rem; color: #94a3b8; margin: 12px 0 0; }
.em-listing-extras { font-size: .75rem; color: #64748b; margin-top: 6px; }
.em-ext-intro--county { border-color: #99f6e4; background: linear-gradient(135deg, #f0fdfa, #fff); }
.em-ext-intro--specialists { border-color: #ddd6fe; background: linear-gradient(135deg, #faf5ff, #fff); }
.em-ext-intro__text h2 { margin: 0 0 6px; font-size: 1.1rem; }
.em-ext-intro__text p { margin: 0 0 12px; font-size: .85rem; color: #64748b; }
.em-ext-intro__flow {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    margin-bottom: 12px; font-size: .8rem;
}
.em-flow-step {
    background: #f1f5f9; padding: 4px 10px; border-radius: 99px; color: #334155;
}
.em-flow-arrow { color: #94a3b8; }
.em-ext-kpis { display: flex; gap: 12px; flex-wrap: wrap; }
.em-kpi {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 8px 14px; text-align: center; min-width: 80px;
}
.em-kpi strong { display: block; font-size: 1.2rem; color: #1e293b; }
.em-kpi span { font-size: .72rem; color: #64748b; }
.em-kpi--warn strong { color: #d97706; }
.em-kpi--urgent strong { color: #dc2626; }
.em-kpi--ok strong { color: #059669; }
.em-verified-badge {
    font-size: .7rem; padding: 2px 8px; border-radius: 99px;
    background: #d1fae5; color: #065f46; font-weight: 600;
}
.em-ext-card--county { border-right: 3px solid #14b8a6; }
.em-ext-card--specialist { border-right: 3px solid #8b5cf6; }
.em-ext-card--tender { border-right: 3px solid #0ea5e9; }
.em-ext-card--bid { border-right: 3px solid #22c55e; }
.em-tender-bid-form { flex-direction: column; align-items: stretch; gap: 8px; }
.em-tender-bid-form .red-inp { width: 100%; margin-bottom: 0; }
.em-bid-amount, .em-bid-days { max-width: 220px; }
.em-ext-card--tender .em-ext-card-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.em-ext-card--tender code { background: #f1f5f9; padding: 3px 8px; border-radius: 8px; }

@media (max-width: 720px) {
    .em-ext-panel { padding: 10px 10px 22px; }
    .em-ext-list { grid-template-columns: 1fr; }
    .em-ext-form { padding: 14px; }
}
.em-status {
    font-size: .72rem; padding: 2px 8px; border-radius: 99px; color: #fff;
}

/* ── سرمایه‌گذار ── */
.em-ext-intro--investor { background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%); border-color: #fcd34d; }
.em-investor-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.em-investor-tab {
    border: 1px solid #e2e8f0; background: #fff; border-radius: 999px; padding: 8px 14px;
    font-size: .85rem; cursor: pointer; color: #334155;
}
.em-investor-tab--active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.em-investor-expert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.em-investor-expert-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; text-align: center;
    display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.em-investor-expert-icon { font-size: 1.8rem; }
.em-investor-form { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.em-form-row { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.em-form-row--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.em-check-group { display: flex; flex-wrap: wrap; gap: 10px; }
.em-check-group--scroll { max-height: 160px; overflow-y: auto; padding: 8px; border: 1px solid #e2e8f0; border-radius: 10px; }
.em-check-label { font-size: .85rem; display: inline-flex; align-items: center; gap: 6px; }
.em-ext-card--new { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.12); }
.em-badge--new { background: #6366f1; color: #fff; }
.em-badge--ok { background: #22c55e; color: #fff; }
.em-badge--pending { background: #f59e0b; color: #fff; }
.em-investor-response { margin-top: 10px; padding: 10px; background: #f0fdf4; border-radius: 10px; font-size: .85rem; }
.em-investor-response pre { white-space: pre-wrap; margin: 6px 0 0; font-family: inherit; }
.em-kpi-chip { display: inline-block; background: #eef2ff; color: #3730a3; padding: 4px 10px; border-radius: 999px; font-size: .8rem; margin-left: 6px; }
.melk-feat--investor { border-color: #fcd34d; background: linear-gradient(180deg, #fffbeb, #fff); }
.melk-role-card--investor { border-color: #fbbf24; }
.melk-role-card--advisory { border-color: #6366f1; }
.melk-feat--advisory { border-color: #a5b4fc; background: linear-gradient(180deg, #eef2ff, #fff); }
.em-ext-intro--advisory { background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%); border-color: #a5b4fc; }
.em-advisory-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.em-advisory-tab {
    border: 1px solid #e2e8f0; background: #fff; border-radius: 999px; padding: 8px 14px;
    font-size: .85rem; cursor: pointer; color: #334155;
}
.em-advisory-tab--active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.em-advisory-disclaimer {
    font-size: .78rem; color: #64748b; background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
.em-advisory-ai-badge {
    font-size: .82rem; padding: 6px 12px; border-radius: 999px; background: #f1f5f9; color: #475569;
}
.em-advisory-ai-badge--on { background: #dcfce7; color: #166534; }
.em-advisory-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.em-advisory-prompt {
    font-size: .78rem; padding: 6px 10px; border-radius: 999px; border: 1px solid #c7d2fe;
    background: #eef2ff; color: #3730a3; cursor: pointer;
}
.em-advisory-chat {
    min-height: 220px; max-height: 420px; overflow-y: auto; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; margin-bottom: 10px;
}
.em-advisory-msg { margin-bottom: 10px; display: flex; flex-direction: column; }
.em-advisory-msg--user { align-items: flex-start; }
.em-advisory-msg--assistant { align-items: flex-end; }
.em-advisory-msg__bubble {
    max-width: 92%; padding: 10px 12px; border-radius: 12px; font-size: .88rem; line-height: 1.55;
}
.em-advisory-msg--user .em-advisory-msg__bubble { background: #fff; border: 1px solid #e2e8f0; }
.em-advisory-msg--assistant .em-advisory-msg__bubble { background: #eef2ff; border: 1px solid #c7d2fe; }
.em-advisory-engine { font-size: .7rem; color: #94a3b8; margin-top: 2px; }
.em-advisory-input-row { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.em-advisory-input-row textarea { flex: 1; resize: vertical; min-height: 44px; }
.em-advisory-kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.em-advisory-kb-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; cursor: pointer;
    transition: box-shadow .15s;
}
.em-advisory-kb-card:hover { box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.em-advisory-kb-icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.em-advisory-kb-card p { font-size: .82rem; color: #64748b; margin: 6px 0 0; }
.em-advisory-detail { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; margin-top: 12px; }
.em-advisory-detail ul { margin: 8px 0; padding-right: 20px; font-size: .88rem; }
.em-advisory-welcome { font-size: .88rem; color: #475569; line-height: 1.6; }
.em-advisory-topic { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.em-advisory-related { font-size: .82rem; margin-bottom: 10px; }
.red-btn--sm { padding: 4px 10px; font-size: .78rem; }
.em-ext-card__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.em-ext-card__meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: #64748b; }
.em-ext-card__sub { font-size: .82rem; color: #475569; margin: 8px 0 0; }
