/* =========================================================
   cmr-ui.css — مدیریت مشتریان (لیست + پرونده)
   همه کلاس‌ها با cmr- شروع می‌شوند. رنگ‌ها از ui.css (--ui-*)
   ========================================================= */
.cmr {
    --c-p: var(--ui-p, #5b5bd6);
    --c-p2: var(--ui-p2, #9b5de5);
    --c-text: var(--ui-text, #1f2340);
    --c-muted: var(--ui-muted, #7a7f9a);
    --c-border: var(--ui-border, #e6e8f2);
    --c-soft: var(--ui-soft, #eef0fb);
    --c-card: var(--ui-card, #fff);
    --c-green: var(--ui-green, #12b886);
    --c-red: var(--ui-red, #f0506e);
    --c-orange: var(--ui-orange, #ff922b);
    --c-r: var(--ui-radius, 18px);
    --c-sh: var(--ui-shadow, 0 6px 24px rgba(31, 35, 64, .08));
    --c-sh2: var(--ui-shadow-hover, 0 14px 34px rgba(31, 35, 64, .16));
    direction: rtl;
    color: var(--c-text);
    padding: 12px 14px 40px;
    max-width: 1500px;
    margin: 0 auto;
    animation: cmr-in .35s ease;
}

@keyframes cmr-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cmr * { box-sizing: border-box; }
.cmr-grow { flex: 1 1 auto; }
.cmr-min0 { min-width: 0; }
.cmr-muted { color: var(--c-muted); font-size: .85rem; }
.cmr-mt { margin-top: 16px; }
.cmr-mb { margin-bottom: 12px; }
.cmr-mono { font-family: Consolas, monospace; font-size: .85rem; color: var(--c-muted); }

/* ---------------- هدر ---------------- */
.cmr-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 22px 22px 18px;
    background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .22), transparent 40%),
                linear-gradient(135deg, #4338ca 0%, #6d28d9 45%, #c026d3 100%);
    box-shadow: 0 18px 40px rgba(76, 29, 149, .28);
    margin-bottom: 16px;
}
.cmr-hero::before, .cmr-hero::after {
    content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none;
}
.cmr-hero::before { width: 260px; height: 260px; left: -70px; top: -120px; }
.cmr-hero::after { width: 160px; height: 160px; left: 22%; bottom: -90px; }
.cmr-skel-hero { height: 180px; animation: cmr-pulse 1.2s infinite alternate; }

.cmr-crumb { position: relative; font-size: .8rem; margin-bottom: 8px; color: rgba(255, 255, 255, .75) !important; }
.cmr-crumb a, .cmr-crumb span { color: rgba(255, 255, 255, .85) !important; text-decoration: none; }
.cmr-crumb a:hover { color: #fff !important; text-decoration: underline; }

.cmr-hero-top { position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cmr-hero-ico {
    width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center;
    background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.cmr-title { margin: 0; padding: 0; font-size: 1.45rem; font-weight: 900; color: white !important; text-align: right; line-height: 1.5; }
.cmr-sub { color: rgba(255, 255, 255, .85) !important; font-size: .9rem; }
.cmr-sub span { color: rgba(255, 255, 255, .85) !important; }
.cmr-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cmr-htag {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .78rem;
    background: rgba(255, 255, 255, .16); color: white !important; text-decoration: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.cmr-htag.warn { background: rgba(251, 191, 36, .3); }
.cmr-hero-acts { display: flex; gap: 8px; flex-wrap: wrap; }

.cmr-kpis { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 18px; }
.cmr-kpi {
    display: flex; align-items: center; gap: 10px; text-align: right; border: 0; cursor: pointer;
    padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .13);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); transition: .2s; font-family: inherit;
}
.cmr-kpi:hover { background: rgba(255, 255, 255, .22); transform: translateY(-2px); }
.cmr-kpi.on { background: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.cmr-kpi.on .cmr-kpi-val { color: var(--c-text) !important; }
.cmr-kpi.on .cmr-kpi-lbl { color: var(--c-muted) !important; }
.cmr-kpi.hot .cmr-kpi-ico { animation: cmr-beat 1.6s infinite; }
.cmr-kpi-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.cmr-kpi-val { display: block; font-size: 1.35rem; font-weight: 900; color: white !important; line-height: 1.3; }
.cmr-kpi-lbl { display: block; font-size: .76rem; color: rgba(255, 255, 255, .82) !important; }

@keyframes cmr-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes cmr-pulse { from { opacity: .55; } to { opacity: 1; } }

.cmr-ring {
    --p: 0; width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    background: conic-gradient(#fde047 calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0);
}
.cmr-ring b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #6d28d9; color: white !important; font-size: .72rem; }
.cmr-kpi.on .cmr-ring b { background: #fff; color: var(--c-text) !important; }

/* ---------------- دکمه‌ها ---------------- */
.cmr-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 12px; border: 0;
    font-family: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; text-decoration: none !important;
    background: var(--c-soft); color: var(--c-p) !important; transition: .18s; white-space: nowrap;
}
.cmr-btn:hover { filter: brightness(.97); transform: translateY(-1px); }
.cmr-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.cmr-btn-pri { background: linear-gradient(135deg, var(--c-p), var(--c-p2)); color: white !important; box-shadow: 0 8px 18px rgba(91, 91, 214, .3); }
.cmr-btn-pri svg { fill: white; }
.cmr-btn-cta { background: #fde047; color: #3b2a8f !important; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); padding: 10px 18px; }
.cmr-btn-glass { background: rgba(255, 255, 255, .16); color: white !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.cmr-btn-sm { padding: 5px 11px; font-size: .8rem; border-radius: 10px; }
.cmr-btn.danger { background: #fff1f3; color: var(--c-red) !important; }

.cmr-ib {
    width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; flex-shrink: 0;
    background: transparent; color: var(--c-muted); cursor: pointer; transition: .15s; text-decoration: none;
}
.cmr-ib svg { fill: currentColor; }
.cmr-ib:hover { background: var(--c-soft); color: var(--c-p); }
.cmr-ib.danger:hover { background: #fff1f3; color: var(--c-red); }
.cmr-ib.on { color: var(--c-orange); }

.cmr-lnk {
    display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 10px; border: 0;
    background: var(--c-soft); color: var(--c-p) !important; font-size: .78rem; font-weight: 700; text-decoration: none !important;
    cursor: pointer; font-family: inherit;
}
.cmr-lnk svg { fill: currentColor; }
.cmr-lnk:hover { background: #e2e5fb; }
.cmr-lnk.danger { background: transparent; color: var(--c-muted) !important; margin-inline-start: auto; }
.cmr-lnk.danger:hover, .cmr-lnk.danger.on { background: #fff1f3; color: var(--c-red) !important; }

/* ---------------- نوار جستجو ---------------- */
.cmr-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cmr-search {
    flex: 1 1 320px; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 46px;
    background: var(--c-card); border-radius: 14px; box-shadow: var(--c-sh); border: 1px solid transparent; transition: .2s;
}
.cmr-search:focus-within { border-color: var(--c-p); box-shadow: 0 0 0 4px rgba(91, 91, 214, .12); }
.cmr-search > svg { width: 20px; height: 20px; flex-shrink: 0; }
.cmr-search input { flex: 1; border: 0; outline: 0; background: transparent; font-family: inherit; font-size: .92rem; color: var(--c-text); }
.cmr-x { border: 0; background: var(--c-soft); border-radius: 8px; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; }
.cmr-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cmr-chips button {
    border: 0; padding: 7px 14px; border-radius: 999px; background: var(--c-card); color: var(--c-muted); font-family: inherit;
    font-size: .82rem; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(31, 35, 64, .06); transition: .15s;
}
.cmr-chips button:hover { color: var(--c-p); }
.cmr-chips button.on { background: linear-gradient(135deg, var(--c-p), var(--c-p2)); color: white !important; }
.cmr-count { font-size: .82rem; color: var(--c-muted); font-weight: 700; }

/* ---------------- کارت‌های لیست ---------------- */
.cmr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; transition: opacity .2s; }
.cmr-dim { opacity: .55; }
.cmr-card {
    background: var(--c-card); border-radius: var(--c-r); box-shadow: var(--c-sh); padding: 16px; cursor: pointer;
    display: flex; flex-direction: column; gap: 10px; transition: .2s; border: 1px solid transparent; position: relative;
}
.cmr-card:hover { box-shadow: var(--c-sh2); transform: translateY(-3px); border-color: #ddd6fe; }
.cmr-card-top { display: flex; align-items: center; gap: 12px; }
.cmr-av {
    width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
    color: white !important; font-weight: 900; font-size: 1rem; box-shadow: 0 6px 14px rgba(91, 91, 214, .25);
}
.cmr-av-lg { width: 64px; height: 64px; border-radius: 20px; font-size: 1.6rem; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
.cmr-name { font-weight: 800; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmr-comp { font-size: .8rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmr-code { font-size: .7rem; font-weight: 800; color: var(--c-p); background: var(--c-soft); padding: 3px 8px; border-radius: 8px; direction: ltr; }
.cmr-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cmr-tag {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 8px; font-size: .74rem; font-weight: 700;
    background: #f3f4f8; color: #4b5068;
}
.cmr-tag svg { fill: currentColor; }
.cmr-tag.t-blue { background: #e0f2fe; color: #075985; }
.cmr-tag.t-purple { background: #ede9fe; color: #5b21b6; }
.cmr-tag.t-green { background: #dcfce7; color: #166534; direction: ltr; }
.cmr-alert { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px; font-size: .78rem; }
.cmr-alert svg { fill: currentColor; }
.cmr-alert.lv-ok { background: #f0fdf4; color: #166534; }
.cmr-alert.lv-warm { background: #fff7ed; color: #9a3412; }
.cmr-alert.lv-hot { background: #fff1f2; color: #be123c; }
.cmr-alert.lv-dead { background: #be123c; color: white !important; }
.cmr-alert.lv-dead span, .cmr-alert.lv-dead b { color: white !important; }
.cmr-alert.lv-dead svg { fill: white; }
.cmr-card-foot { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px dashed var(--c-border); padding-top: 10px; margin-top: auto; }

.cmr-skel { min-height: 160px; cursor: default; }
.cmr-skel i { display: block; height: 14px; border-radius: 8px; background: #eef0f6; animation: cmr-pulse 1s infinite alternate; }
.cmr-skel i:nth-child(1) { width: 60%; height: 20px; }
.cmr-skel i:nth-child(2) { width: 85%; }
.cmr-skel i:nth-child(3) { width: 40%; }

.cmr-empty { text-align: center; padding: 50px 20px; color: var(--c-muted); display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--c-card); border-radius: var(--c-r); box-shadow: var(--c-sh); }
.cmr-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; font-size: .85rem; color: var(--c-muted); }
.cmr-pager button { border: 0; background: var(--c-card); box-shadow: var(--c-sh); padding: 8px 18px; border-radius: 12px; font-family: inherit; font-weight: 700; color: var(--c-p); cursor: pointer; }
.cmr-pager button:disabled { opacity: .4; cursor: default; }

/* ---------------- تب‌ها ---------------- */
.cmr-tabs {
    display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin-bottom: 14px; background: var(--c-card);
    border-radius: 16px; box-shadow: var(--c-sh); position: sticky; top: 0; z-index: 5; scrollbar-width: none;
}
.cmr-tabs::-webkit-scrollbar { display: none; }
.cmr-tabs button {
    display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 9px 14px; border-radius: 12px;
    font-family: inherit; font-weight: 700; font-size: .86rem; color: var(--c-muted); cursor: pointer; white-space: nowrap; transition: .15s;
}
.cmr-tabs button svg { fill: currentColor; }
.cmr-tabs button i { font-style: normal; font-size: .7rem; background: var(--c-soft); color: var(--c-p); padding: 1px 7px; border-radius: 999px; }
.cmr-tabs button:hover { color: var(--c-p); background: var(--c-soft); }
.cmr-tabs button.on { background: linear-gradient(135deg, var(--c-p), var(--c-p2)); color: white !important; box-shadow: 0 6px 14px rgba(91, 91, 214, .3); }
.cmr-tabs button.on svg { fill: white; }
.cmr-tabs button.on i { background: rgba(255, 255, 255, .25); color: white !important; }
.cmr-tabs button.soon { opacity: .5; cursor: default; }
.cmr-tabs button.soon i { background: #fef3c7; color: #92400e; }

/* ---------------- باکس و فرم ---------------- */
.cmr-box { background: var(--c-card); border-radius: var(--c-r); box-shadow: var(--c-sh); padding: 18px; margin-bottom: 14px; }
.cmr-box-h { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: .98rem; margin-bottom: 14px; color: var(--c-text); }
.cmr-box-h svg { fill: var(--c-p); }
.cmr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.cmr-cols .cmr-box { margin: 0; }

.cmr-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; align-items: start; }
.cmr-form-2 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cmr-span2 { grid-column: span 2; }
.cmr-span3 { grid-column: span 3; }
.cmr-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cmr-f label { font-size: .78rem; font-weight: 700; color: var(--c-muted); }
.cmr-f label b { color: var(--c-red); }
.cmr-f input, .cmr-f select, .cmr-f textarea, .cmr-note-new textarea, .cmr-note-bar select {
    width: 100%; border: 1.5px solid var(--c-border); border-radius: 11px; padding: 9px 12px; font-family: inherit; font-size: .9rem;
    background: #fbfbfe; color: var(--c-text); outline: 0; transition: .15s;
}
.cmr-f input:focus, .cmr-f select:focus, .cmr-f textarea:focus, .cmr-note-new textarea:focus {
    border-color: var(--c-p); background: #fff; box-shadow: 0 0 0 4px rgba(91, 91, 214, .1);
}
.cmr-f input[dir=ltr] { text-align: left; }
.cmr-f.bad input { border-color: var(--c-red); }
.cmr-hint { font-size: .72rem; color: var(--c-green); }
.cmr-hint.warn { color: var(--c-orange); }
.cmr-hint.bad { color: var(--c-red); }
.cmr-check { display: flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; padding: 9px 12px; border-radius: 11px; background: var(--c-soft); cursor: pointer; align-self: end; }
.cmr-check input { width: 18px; height: 18px; accent-color: var(--c-p); }
.cmr-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.cmr-inline-form { background: #faf8ff; border: 1.5px dashed #c4b5fd; border-radius: 14px; padding: 14px; margin-bottom: 12px; animation: cmr-in .2s; }

.cmr-rows { display: flex; flex-direction: column; gap: 8px; }
.cmr-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fafbff; border: 1px solid var(--c-border); }

/* ---------------- خلاصه ---------------- */
.cmr-progress { height: 10px; border-radius: 99px; background: var(--c-soft); overflow: hidden; margin-bottom: 12px; }
.cmr-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c-green), #22d3ee); transition: width .6s; }
.cmr-ok-msg { color: var(--c-green); font-weight: 800; }
.cmr-miss { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cmr-miss li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #fafbff; cursor: pointer; font-size: .86rem; transition: .15s; }
.cmr-miss li svg { fill: var(--c-orange); }
.cmr-miss li span { margin-inline-start: auto; font-size: .74rem; color: var(--c-p); font-weight: 800; }
.cmr-miss li:hover { background: var(--c-soft); }
.cmr-timeline { display: flex; flex-direction: column; gap: 6px; }
.cmr-tl { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: #fafbff; font-size: .84rem; }
.cmr-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-green); flex-shrink: 0; }
.cmr-tl.lv-warm .cmr-dot { background: var(--c-orange); }
.cmr-tl.lv-hot .cmr-dot { background: var(--c-red); animation: cmr-beat 1.2s infinite; }
.cmr-tl.lv-dead { background: #fff1f2; }
.cmr-tl.lv-dead .cmr-dot { background: #881337; }
.cmr-date { font-family: inherit; color: var(--c-muted); font-size: .8rem; }
.cmr-left { white-space: nowrap; font-weight: 800; font-size: .76rem; padding: 2px 8px; border-radius: 8px; background: #fff; }
.cmr-tl.lv-hot .cmr-left, .cmr-tl.lv-dead .cmr-left { color: var(--c-red); }
.cmr-contact { display: flex; align-items: center; gap: 10px; }
.cmr-note-mini { padding: 10px 12px; border-radius: 12px; background: #fffbeb; margin-bottom: 8px; font-size: .86rem; white-space: pre-wrap; }
.cmr-note-mini small { display: block; color: var(--c-muted); margin-top: 4px; font-size: .72rem; }

/* ---------------- سایت‌ها ---------------- */
.cmr-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.cmr-site { background: var(--c-card); border-radius: var(--c-r); box-shadow: var(--c-sh); padding: 16px; display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--c-p); }
.cmr-site.off { opacity: .65; border-top-color: #cbd5e1; }
.cmr-site-h { display: flex; align-items: center; gap: 10px; }
.cmr-site-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, #0ea5e9, #6366f1); flex-shrink: 0; }
.cmr-site-dom { font-weight: 900; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.cmr-site-url { font-size: .76rem; color: var(--c-muted); text-decoration: none; display: block; text-align: right; }
.cmr-exp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cmr-expc { padding: 8px; border-radius: 12px; background: #f6f7fb; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.cmr-expc small { font-size: .68rem; color: var(--c-muted); }
.cmr-expc b { font-size: .8rem; }
.cmr-expc span { font-size: .66rem; font-weight: 800; }
.cmr-expc.lv-none b { color: #b4b8c9; font-weight: 600; }
.cmr-expc.lv-ok { background: #f0fdf4; } .cmr-expc.lv-ok span { color: #15803d; }
.cmr-expc.lv-warm { background: #fff7ed; } .cmr-expc.lv-warm span { color: #c2410c; }
.cmr-expc.lv-hot { background: #fff1f2; box-shadow: inset 0 0 0 1.5px #fda4af; } .cmr-expc.lv-hot span { color: #be123c; }
.cmr-expc.lv-dead { background: #be123c; } .cmr-expc.lv-dead * { color: white !important; }
.cmr-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.cmr-flags span { font-size: .74rem; font-weight: 700; padding: 4px 9px; border-radius: 8px; }
.cmr-flags span.y { background: #dcfce7; color: #166534; }
.cmr-flags span.n { background: #f3f4f8; color: #9ca3af; text-decoration: line-through; }
.cmr-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.cmr-kv div { display: flex; flex-direction: column; font-size: .84rem; }
.cmr-kv small { color: var(--c-muted); font-size: .7rem; }
.cmr-parked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .78rem; }
.cmr-parked span { background: var(--c-soft); padding: 2px 8px; border-radius: 7px; }
.cmr-creds { background: #fafbff; border: 1px solid var(--c-border); border-radius: 14px; padding: 10px 12px; }
.cmr-creds-h { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .84rem; margin-bottom: 8px; }
.cmr-creds-h svg { fill: var(--c-p); }
.cmr-cred { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--c-border); flex-wrap: wrap; }
.cmr-cred:first-of-type { border-top: 0; }
.cmr-cred-k { font-size: .76rem; font-weight: 800; color: var(--c-p); background: var(--c-soft); padding: 3px 8px; border-radius: 7px; }
.cmr-cred-v { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; }
.cmr-cred-v small { color: var(--c-muted); }
.cmr-secret { background: #fef9c3; padding: 1px 6px; border-radius: 6px; font-family: Consolas, monospace; }
.cmr-site-note { font-size: .82rem; color: #4b5068; background: #fffbeb; padding: 8px 10px; border-radius: 10px; white-space: pre-wrap; }

/* ---------------- مدارک ---------------- */
.cmr-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.cmr-doc { border: 1.5px dashed #d4d7e6; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; transition: .2s; }
.cmr-doc.has { border-style: solid; border-color: #bbf7d0; background: #fbfffc; }
.cmr-doc-h { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.cmr-doc-h svg { fill: #c4c8d8; }
.cmr-doc.has .cmr-doc-h > svg { fill: var(--c-green); }
.cmr-upload { position: relative; overflow: hidden; }
.cmr-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cmr-upload.busy { pointer-events: none; opacity: .7; }
.cmr-file { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; background: #fff; box-shadow: 0 1px 4px rgba(31, 35, 64, .06); }
.cmr-file img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: block; }
.cmr-file-ico { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; background: var(--c-soft); color: var(--c-p); font-size: .66rem; font-weight: 900; }
.cmr-file-n { display: block; font-size: .8rem; font-weight: 700; color: var(--c-text) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.cmr-file small { color: var(--c-muted); font-size: .7rem; }

/* ---------------- یادداشت ---------------- */
.cmr-note-new textarea { resize: vertical; min-height: 80px; }
.cmr-note-bar { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.cmr-note-bar select { width: auto; }
.cmr-notes { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cmr-note { padding: 12px 14px; border-radius: 14px; background: #fafbff; border: 1px solid var(--c-border); animation: cmr-in .25s; }
.cmr-note.pin { background: #fffbeb; border-color: #fde68a; }
.cmr-note-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cmr-note-top small { color: var(--c-muted); font-size: .74rem; }
.cmr-note-t { white-space: pre-wrap; font-size: .9rem; line-height: 1.9; }

/* ---------------- پنل کشویی و مودال ---------------- */
.cmr-ovl { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); backdrop-filter: blur(2px); z-index: 1300; animation: cmr-fade .2s; }
@keyframes cmr-fade { from { opacity: 0; } to { opacity: 1; } }
.cmr-drawer, .cmr-modal {
    position: fixed; z-index: 1301; background: #fff; display: flex; flex-direction: column; direction: rtl; color: var(--ui-text, #1f2340);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25); font-family: inherit;
}
.cmr-drawer { top: 0; bottom: 0; left: 0; width: min(760px, 100vw); animation: cmr-slide .25s ease; border-radius: 0 22px 22px 0; }
@keyframes cmr-slide { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.cmr-modal { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(620px, 94vw); max-height: 90vh; border-radius: 22px; animation: cmr-fade .2s; }
.cmr-drawer-h { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--ui-border, #e6e8f2); font-size: 1.02rem; }
.cmr-drawer-b { padding: 16px 20px; overflow-y: auto; flex: 1; }
.cmr-drawer-f { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--ui-border, #e6e8f2); background: #fafbff; border-radius: 0 0 22px 22px; }
.cmr-drawer .cmr-f, .cmr-modal .cmr-f { --c-border: #e6e8f2; --c-p: #5b5bd6; --c-muted: #7a7f9a; --c-red: #f0506e; --c-green: #12b886; --c-orange: #ff922b; }
.cmr-drawer .cmr-btn, .cmr-modal .cmr-btn { --c-soft: #eef0fb; --c-p: #5b5bd6; --c-p2: #9b5de5; --c-red: #f0506e; }
.cmr-drawer .cmr-ib, .cmr-modal .cmr-ib { --c-soft: #eef0fb; --c-p: #5b5bd6; --c-muted: #7a7f9a; }
.cmr-drawer .cmr-check, .cmr-modal .cmr-check { --c-soft: #eef0fb; --c-p: #5b5bd6; }
.cmr-drawer .cmr-muted, .cmr-modal .cmr-muted { color: #7a7f9a; font-size: .8rem; margin-top: 10px; }
.cmr-sec { font-weight: 900; font-size: .86rem; color: #5b5bd6; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.cmr-sec:first-child { margin-top: 0; }
.cmr-sec::after { content: ""; flex: 1; height: 1px; background: #e6e8f2; }

/* ---------------- موبایل ---------------- */
@media (max-width: 760px) {
    .cmr { padding: 8px 8px 30px; }
    .cmr-hero { padding: 16px; border-radius: 20px; }
    .cmr-title { font-size: 1.15rem; }
    .cmr-kpis { grid-template-columns: 1fr 1fr; }
    .cmr-kpi { padding: 10px; }
    .cmr-kpi-ico { width: 34px; height: 34px; }
    .cmr-kpi-val { font-size: 1.1rem; }
    .cmr-grid, .cmr-sites, .cmr-docs, .cmr-cols { grid-template-columns: 1fr; }
    .cmr-span2, .cmr-span3 { grid-column: auto; }
    .cmr-exp { grid-template-columns: 1fr 1fr; }
    .cmr-hero-acts { width: 100%; }
    .cmr-drawer { width: 100vw; border-radius: 0; }
}

/* =========================================================
   مرحله ۲: قرارداد و اقساط (ctr-)
   ========================================================= */
.ctr-hero { background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(135deg, #0f766e 0%, #4338ca 55%, #7c3aed 100%); box-shadow: 0 18px 40px rgba(15, 118, 110, .25); }
.ctr-sum { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--c-card); border-radius: var(--c-r); box-shadow: var(--c-sh); padding: 14px 16px; margin-bottom: 6px; }
.ctr-sum-i { display: flex; flex-direction: column; padding: 4px 14px; border-inline-start: 3px solid var(--c-soft); }
.ctr-sum-i small { font-size: .74rem; color: var(--c-muted); }
.ctr-sum-i b { font-size: 1.08rem; font-weight: 900; }
.ctr-sum-i.ok { border-color: #bbf7d0; } .ctr-sum-i.ok b { color: #15803d; }
.ctr-sum-i.bad { border-color: #fecdd3; } .ctr-sum-i.bad b { color: #be123c; }
.ctr-unit { font-size: .74rem; color: var(--c-muted); margin: 0 6px 12px; }

.ctr-card { background: var(--c-card); border-radius: var(--c-r); box-shadow: var(--c-sh); padding: 16px 18px; margin-bottom: 14px; border-inline-start: 5px solid var(--c-p); animation: cmr-in .3s; }
.ctr-card.st-2 { border-inline-start-color: var(--c-green); }
.ctr-card.st-3 { border-inline-start-color: var(--c-orange); }
.ctr-card.st-4 { border-inline-start-color: #cbd5e1; opacity: .7; }
.ctr-card.focus { box-shadow: 0 0 0 3px rgba(91, 91, 214, .35), var(--c-sh2); }
.ctr-h { display: flex; align-items: center; gap: 12px; }
.ctr-no { font-weight: 900; font-size: .95rem; color: white !important; background: linear-gradient(135deg, var(--ui-p, #5b5bd6), var(--ui-p2, #9b5de5)); padding: 8px 12px; border-radius: 12px; box-shadow: 0 6px 14px rgba(91, 91, 214, .3); }
.ctr-no.sm { font-size: .8rem; padding: 3px 9px; border-radius: 8px; display: inline-block; box-shadow: none; }
.ctr-title { font-weight: 900; font-size: 1.02rem; }
.ctr-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.ctr-st { font-size: .76rem; font-weight: 800; padding: 4px 11px; border-radius: 999px; background: #ede9fe; color: #5b21b6; white-space: nowrap; }
.ctr-st.st-2 { background: #dcfce7; color: #166534; }
.ctr-st.st-3 { background: #ffedd5; color: #9a3412; }
.ctr-st.st-4 { background: #f1f5f9; color: #64748b; }

.ctr-money { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0 8px; }
.ctr-money > div { background: #f8f9fd; border-radius: 12px; padding: 9px 12px; display: flex; flex-direction: column; }
.ctr-money small { font-size: .72rem; color: var(--c-muted); }
.ctr-money b { font-size: 1rem; font-weight: 900; }
.ctr-money em { font-style: normal; font-size: .7rem; color: var(--c-muted); }
.ctr-money .ok { background: #f0fdf4; } .ctr-money .ok b { color: #15803d; }
.ctr-money .bad { background: #fff1f2; } .ctr-money .bad b { color: #be123c; }
.ctr-bar { position: relative; height: 22px; border-radius: 99px; background: var(--c-soft); overflow: hidden; }
.ctr-bar i { position: absolute; inset-block: 0; right: 0; border-radius: 99px; background: linear-gradient(90deg, #22d3ee, var(--c-green)); transition: width .6s; }
.ctr-bar span { position: relative; display: block; text-align: center; font-size: .72rem; font-weight: 800; line-height: 22px; color: #1f2340; }
.ctr-prob { display: flex; gap: 6px; align-items: center; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: .8rem; }
.ctr-prob svg { fill: #f59e0b; flex-shrink: 0; }

.ctr-inst { margin-top: 12px; border: 1px solid var(--c-border); border-radius: 14px; overflow: hidden; }
.ctr-inst-h, .ctr-inst-r { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr 1.3fr 1.1fr 1.6fr 100px; gap: 8px; align-items: center; padding: 8px 12px; font-size: .82rem; }
.ctr-inst-h { background: #f8f9fd; font-size: .72rem; font-weight: 800; color: var(--c-muted); }
.ctr-inst-r { border-top: 1px solid var(--c-border); }
.ctr-inst-r small { display: block; font-size: .68rem; color: var(--c-orange); }
.ctr-inst-r.s-done { background: #fbfffc; }
.ctr-inst-r.s-late { background: #fff7f8; }
.ctr-pill { font-style: normal; font-size: .7rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: #64748b; white-space: nowrap; display: inline-block; }
.ctr-pill.s-done { background: #dcfce7; color: #166534; }
.ctr-pill.s-late { background: #be123c; color: white !important; }
.ctr-pill.s-part { background: #fef3c7; color: #92400e; }
.ctr-pill.s-soon { background: #ffedd5; color: #9a3412; }
.ctr-pill.a-1 { background: #dcfce7; color: #166534; }
.ctr-pill.a-2 { background: #fee2e2; color: #991b1b; }

.ctr-toggle { margin-top: 10px; border: 0; background: transparent; color: var(--c-p); font-family: inherit; font-weight: 800; font-size: .82rem; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.ctr-toggle svg { fill: currentColor; }
.ctr-recs { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ctr-rec { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: #f6fef9; border: 1px solid #dcfce7; font-size: .82rem; flex-wrap: wrap; }
.ctr-rec b { color: #15803d; }
.ctr-rec-d { font-weight: 700; }
.ctr-acc { border: 1px solid var(--c-border); border-radius: 9px; padding: 4px 8px; font-family: inherit; font-size: .76rem; background: #fff; }
.ctr-acc.a-1 { border-color: #86efac; color: #166534; }
.ctr-acc.a-2 { border-color: #fca5a5; color: #991b1b; }
.ctr-notes { margin-top: 10px; font-size: .82rem; color: #4b5068; display: flex; flex-direction: column; gap: 4px; }
.ctr-notes small { color: var(--c-muted); }
.ctr-acts { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--c-border); }

.cmr-money { display: flex; align-items: center; border: 1.5px solid #e6e8f2; border-radius: 11px; background: #fbfbfe; overflow: hidden; }
.cmr-money:focus-within { border-color: #5b5bd6; background: #fff; box-shadow: 0 0 0 4px rgba(91, 91, 214, .1); }
.cmr-money input { border: 0 !important; box-shadow: none !important; background: transparent !important; text-align: left; font-weight: 700; }
.cmr-money span { padding: 0 10px; font-size: .74rem; color: #7a7f9a; white-space: nowrap; }
.cmr-f.bad .cmr-money { border-color: #f0506e; }

.cmr-drawer.ctr-wide { width: min(980px, 100vw); }
.ctr-gen { background: #faf8ff; border: 1.5px dashed #c4b5fd; border-radius: 16px; padding: 14px; margin-bottom: 8px; }
.ctr-rows { display: flex; flex-direction: column; gap: 8px; }
.ctr-row { display: grid; grid-template-columns: 28px 1.2fr 1.4fr 1.2fr 1.4fr auto; gap: 10px; align-items: start; padding: 10px; border-radius: 14px; background: #fafbff; border: 1px solid #e6e8f2; }
.ctr-row-n { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #eef0fb; color: #5b5bd6; font-weight: 900; font-size: .8rem; margin-top: 22px; }
.ctr-row > .cmr-ib, .ctr-row > .ctr-pill { margin-top: 26px; }
.ctr-check { font-size: .84rem; padding: 7px 12px; border-radius: 10px; }
.ctr-check.ok { background: #dcfce7; color: #166534; }
.ctr-check.bad { background: #fee2e2; color: #991b1b; }
.ctr-alloc { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #eef0fb; color: #3730a3; font-size: .82rem; line-height: 1.9; }

/* جدول قراردادها */
.ctr-line { height: 40px; border: 0; border-radius: 12px; padding: 0 12px; font-family: inherit; background: var(--c-card); box-shadow: 0 2px 8px rgba(31, 35, 64, .06); color: var(--c-text); }
.ctr-table { background: var(--c-card); border-radius: var(--c-r); box-shadow: var(--c-sh); overflow: hidden; transition: opacity .2s; }
.ctr-tr { display: grid; grid-template-columns: 1.4fr 1.6fr 1.1fr 1.2fr 1.1fr 1.1fr 1.2fr 40px; gap: 10px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--c-border); text-decoration: none !important; color: var(--c-text) !important; transition: background .15s; }
.ctr-tr:hover { background: #f8f7ff; }
.ctr-tr > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .86rem; }
.ctr-tr small { font-size: .72rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctr-tr b.ok { color: #15803d; } .ctr-tr b.bad { color: #be123c; }
.ctr-th { border-top: 0; background: #f8f9fd; font-size: .74rem; font-weight: 800; color: var(--c-muted) !important; }
.ctr-th:hover { background: #f8f9fd; }
.ctr-mini { display: block; height: 5px; border-radius: 9px; background: var(--c-soft); overflow: hidden; }
.ctr-mini i { display: block; height: 100%; background: var(--c-green); margin-inline-start: auto; }
.ctr-warn svg { fill: #f59e0b; }

@media (max-width: 900px) {
    .ctr-money { grid-template-columns: 1fr 1fr; }
    .ctr-inst-h { display: none; }
    .ctr-inst-r { grid-template-columns: 1fr 1fr; }
    .ctr-row { grid-template-columns: 1fr 1fr; }
    .ctr-row-n { display: none; }
    .ctr-th { display: none; }
    .ctr-tr { grid-template-columns: 1fr 1fr; }
}
.ctr-inst-r .cmr-mono { text-align: right; }

/* =========================================================
   مرحله ۳: حساب‌ها و دفتر روزانه (fin-)
   ========================================================= */
.fin-hero { background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(135deg, #065f46 0%, #0f766e 45%, #1d4ed8 100%); box-shadow: 0 18px 40px rgba(6, 95, 70, .28); }
.fin-hero .cmr-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.fin-month { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 14px; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.fin-month b { min-width: 110px; text-align: center; font-size: 1rem; color: white !important; }
.fin-month .cmr-ib:hover { background: rgba(255, 255, 255, .18); }
.fin-locked { background: rgba(251, 191, 36, .35); }

.fin-lockbar { flex-wrap: wrap; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 14px; background: #ecfdf5; color: #065f46; font-size: .86rem; }
.fin-lockbar span { color: #065f46; }
.fin-lockbar svg { fill: #059669; }
.fin-lockbar.on { background: #fffbeb; }
.fin-lockbar.on span { color: #92400e; }
.fin-lockbar.on svg { fill: #d97706; }
.fin-logs { margin: -4px 0 12px; padding: 10px 14px; border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(31, 35, 64, .06); font-size: .82rem; line-height: 2; }
.fin-logs b { color: #1f2340; }

.fin-unlinked { margin-bottom: 12px; border-radius: 14px; background: #fff7ed; overflow: hidden; }
.fin-unlinked-h { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; background: transparent; cursor: pointer; font-family: inherit; text-align: right; }
.fin-unlinked-h b { color: #9a3412; font-size: .86rem; }
.fin-unlinked-h span { color: #c2410c; font-size: .8rem; font-weight: 700; }
.fin-unlinked-h svg { fill: #ea580c; }
.fin-ul { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid #fed7aa; font-size: .85rem; flex-wrap: wrap; }
.fin-ul b { color: #1f2340; }
.fin-ul select { height: 34px; border-radius: 10px; border: 1px solid #fdba74; padding: 0 8px; font-family: inherit; background: #fff; color: #1f2340; }

.fin-table { background: var(--c-card); border-radius: var(--c-r); box-shadow: var(--c-sh); overflow: hidden; transition: opacity .2s; }
.fin-tr { display: grid; grid-template-columns: 92px 128px minmax(0, 2.4fr) 1.1fr 1.1fr 92px 84px 96px; gap: 10px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--c-border); cursor: pointer; transition: background .15s; }
.fin-tr:hover { background: #f3fbf8; }
.fin-tr > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: .85rem; color: var(--c-text); }
.fin-tr b { color: var(--c-text); }
.fin-tr small { font-size: .72rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-th { border-top: 0; background: #f8f9fd; cursor: default; }
.fin-th:hover { background: #f8f9fd; }
.fin-th > span { font-size: .74rem; font-weight: 800; color: var(--c-muted); }
.fin-amt { font-size: .95rem; text-align: right; }
.fin-amt.in { color: #059669 !important; }
.fin-amt.out { color: #e11d48 !important; }
.fin-amt.tr { color: #2563eb !important; }

.fin-type { display: inline-block; width: fit-content; padding: 3px 9px; border-radius: 999px; font-style: normal; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.fin-type.t-1 { background: #dcfce7; color: #166534; }
.fin-type.t-2 { background: #d1fae5; color: #065f46; }
.fin-type.t-3 { background: #fee2e2; color: #991b1b; }
.fin-type.t-4 { background: #ffe4e6; color: #9f1239; }
.fin-type.t-5 { background: #fef3c7; color: #92400e; }
.fin-type.t-6 { background: #dbeafe; color: #1e40af; }

.fin-ctl, .fin-doc { display: inline-flex; align-items: center; width: fit-content; padding: 3px 9px; border-radius: 999px; font-style: normal; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.fin-ctl.c-1 { background: #dcfce7; color: #166534; }
.fin-ctl.c-2 { background: #fef3c7; color: #92400e; }
.fin-ctl.c-3 { background: #fce7f3; color: #9d174d; }
.fin-doc.d-1 { background: #ecfdf5; color: #047857; }
.fin-doc.d-2 { background: #fffbeb; color: #b45309; }
.fin-doc.d-3 { background: #fff1f2; color: #be123c; }
.fin-doc.has { background: #dcfce7; padding: 4px 8px; text-decoration: none; }
.fin-doc.has svg { fill: #15803d; }

.fin-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.fin-types button { border: 0; padding: 7px 13px; border-radius: 12px; font-family: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; background: #f1f3fa; color: #4b5170; transition: .15s; }
.fin-types button:hover { filter: brightness(.96); }
.fin-types button.on.t-1, .fin-types button.on.t-2 { background: #059669; color: white !important; }
.fin-types button.on.t-3, .fin-types button.on.t-4 { background: #e11d48; color: white !important; }
.fin-types button.on.t-5 { background: #d97706; color: white !important; }
.fin-types button.on.t-6 { background: #2563eb; color: white !important; }

.fin-pick { display: flex; flex-direction: column; justify-content: center; min-height: 40px; padding: 6px 12px; border-radius: 12px; background: #f1f5f9; font-size: .82rem; color: #64748b; }
.fin-pick b { color: #0f766e; font-size: .9rem; }
.fin-pick small { color: #64748b; font-size: .74rem; }
.fin-pick.bad { background: #fff1f2; color: #be123c; }

.fin-file { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; border-radius: 12px; border: 1px dashed #cbd5e1; font-size: .84rem; }
.fin-file a, .fin-file span { color: #0f766e; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.fin-file svg { fill: currentColor; }
.fin-file label.cmr-lnk { cursor: pointer; }

.fin-check { margin-top: 14px; padding: 10px 12px; border-radius: 12px; font-size: .84rem; display: flex; gap: 8px; flex-wrap: wrap; }
.fin-check b, .fin-check span { color: inherit; }
.fin-check.c-1 { background: #dcfce7; color: #166534; }
.fin-check.c-2 { background: #fef3c7; color: #92400e; }
.fin-check.c-3 { background: #fce7f3; color: #9d174d; }

/* کارت حساب‌ها */
.fin-accs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.fin-acc { position: relative; background: var(--c-card); border-radius: 20px; padding: 16px; box-shadow: var(--c-sh); transition: .2s; overflow: hidden; }
.fin-acc::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #059669, #2563eb); }
.fin-acc.k-2::before { background: linear-gradient(90deg, #f59e0b, #ea580c); }
.fin-acc.k-3::before { background: linear-gradient(90deg, #8b5cf6, #db2777); }
.fin-acc:hover { box-shadow: var(--c-sh2); transform: translateY(-2px); }
.fin-acc.off { opacity: .55; }
.fin-acc-h { display: flex; align-items: center; gap: 10px; }
.fin-acc-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #059669, #2563eb); flex-shrink: 0; }
.fin-acc.k-2 .fin-acc-ico { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.fin-acc.k-3 .fin-acc-ico { background: linear-gradient(135deg, #8b5cf6, #db2777); }
.fin-acc-code { display: block; font-size: 1.02rem; font-weight: 900; color: var(--c-text); }
.fin-acc-h small { display: block; font-size: .78rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-acc-h small span { color: var(--c-muted); font-family: Consolas, monospace; }
.fin-acc-bal { margin: 14px 0 10px; font-size: 1.6rem; font-weight: 900; color: var(--c-text); text-align: right; }
.fin-acc-m { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; border-radius: 14px; background: #f8fafc; }
.fin-acc-m span { display: flex; flex-direction: column; gap: 2px; }
.fin-acc-m small { font-size: .7rem; color: var(--c-muted); }
.fin-acc-m b { font-size: .84rem; color: var(--c-text); }
.fin-acc-m b.ok { color: #059669; }
.fin-acc-m b.bad { color: #e11d48; }
.fin-acc-f { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.fin-acc-note { margin-top: 8px; font-size: .76rem; color: var(--c-muted); }

.fin-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.fin-cat { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 2px; border-radius: 999px; background: #eef7f5; }
.fin-cat.off { opacity: .5; }
.fin-cat .cmr-ib { width: 26px; height: 26px; }
.fin-cat-n { border: 0; background: transparent; padding: 4px 10px; font-family: inherit; font-size: .82rem; color: #0f766e; font-weight: 700; cursor: pointer; }
.fin-cat input { border: 0; background: #fff; border-radius: 999px; padding: 5px 12px; font-family: inherit; font-size: .82rem; width: 150px; outline: none; color: #1f2340; }
.fin-cat.add { background: #f1f5f9; }

@media (max-width: 1000px) {
    .fin-th { display: none; }
    .fin-tr { grid-template-columns: 1fr 1fr; }
    .fin-tr > span:nth-child(3) { grid-column: span 2; order: -1; }
}

/* =====================================================================
   مرحله ۴: داشبورد مالی، گزارش ماهانه، کنترل حسابدار، پرداختی پرسنل (fin-)
   ===================================================================== */
.fin-hero-dash { background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(135deg, #064e3b 0%, #0f766e 40%, #0369a1 100%); }
.fin-hero-rep { background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(135deg, #1e3a8a 0%, #0f766e 55%, #059669 100%); }
.fin-hero-ctl { background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(135deg, #78350f 0%, #b45309 40%, #0f766e 100%); box-shadow: 0 18px 40px rgba(120, 53, 15, .25); }
.fin-hero-staff { background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(135deg, #4c1d95 0%, #0f766e 60%, #047857 100%); }
.fin-xl { background: rgba(255, 255, 255, .16) !important; color: white !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.fin-xl svg { fill: white !important; }
.fin-xl:hover { background: rgba(255, 255, 255, .26) !important; }
a.cmr-kpi { text-decoration: none; }

.fin-delta { display: block; width: fit-content; margin-top: 2px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .18); color: white !important; font-size: .68rem; }
.fin-dash-top { position: relative; display: grid; grid-template-columns: 270px 1fr; gap: 12px; margin-top: 18px; align-items: stretch; }
.fin-dash-top .cmr-kpis { margin-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fin-cash { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 16px 18px; border-radius: 18px; background: rgba(255, 255, 255, .95); box-shadow: 0 12px 30px rgba(0, 0, 0, .18); }
.fin-cash small { color: #0f766e; font-size: .8rem; font-weight: 700; }
.fin-cash b { color: #064e3b; font-size: 1.9rem; font-weight: 900; text-align: right; line-height: 1.3; }
.fin-cash span { color: #64748b; font-size: .76rem; }

.fin-notes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.fin-notes a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px; background: #fff7ed; color: #9a3412 !important; font-size: .84rem; font-weight: 700; text-decoration: none; }
.fin-notes a svg { fill: #ea580c; }
.fin-notes a:hover { background: #ffedd5; }

.fin-dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fin-span2 { grid-column: span 2; }
.fin-accs-card { grid-row: span 1; }
.fin-card { background: var(--c-card); border-radius: 20px; padding: 16px; box-shadow: var(--c-sh); min-width: 0; }
.fin-card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.fin-card-h b { color: var(--c-text); font-size: .98rem; }
.fin-legend { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--c-muted); }
.fin-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-inline-start: 6px; }
.fin-legend i.in, .fin-bars i.in { background: #0d9488; }
.fin-legend i.out, .fin-bars i.out { background: #f97316; }

.fin-chart { display: flex; gap: 8px; height: 230px; }
.fin-chart-y { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 22px; font-size: .68rem; color: var(--c-muted); white-space: nowrap; }
.fin-chart-b { flex: 1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; border-bottom: 1px solid var(--c-border);
    background: repeating-linear-gradient(to top, transparent 0, transparent calc(50% - 1px), #eef1f6 calc(50% - 1px), #eef1f6 50%); background-size: 100% calc(100% - 22px); background-repeat: no-repeat; }
.fin-col { position: relative; display: flex; flex-direction: column; align-items: stretch; text-decoration: none; border-radius: 10px; transition: background .15s; }
.fin-col:hover { background: #f1f5f9; }
.fin-col.now small { color: #0f766e; font-weight: 900; }
.fin-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 4px; }
.fin-bars i { width: 42%; max-width: 18px; min-height: 2px; border-radius: 4px 4px 0 0; transition: height .4s; }
.fin-col small { height: 22px; line-height: 22px; text-align: center; font-size: .68rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; }
.fin-tip { display: none; position: absolute; bottom: calc(100% - 30px); left: 50%; transform: translateX(-50%); z-index: 5; min-width: 150px; padding: 8px 10px; border-radius: 10px;
    background: #0f172a; color: white !important; font-size: .74rem; line-height: 1.7; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); pointer-events: none; }
.fin-tip b, .fin-tip span { display: block; color: white !important; }
.fin-tip span { display: inline; }
.fin-col:hover .fin-tip { display: block; }

.fin-ab { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 4px; border-bottom: 1px dashed var(--c-border); text-decoration: none; }
.fin-ab:last-child { border-bottom: 0; }
.fin-ab b { color: var(--c-text); font-size: .88rem; }
.fin-ab b.neg { color: #e11d48; }
.fin-ab small { display: block; font-size: .72rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-ab-bar { grid-column: span 2; height: 5px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.fin-ab-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0d9488, #0369a1); }
.fin-ab-bar.neg i { background: linear-gradient(90deg, #fb7185, #e11d48) !important; }
.fin-ab.k-2 .fin-ab-bar i { background: linear-gradient(90deg, #f59e0b, #ea580c); }
.fin-ab.k-3 .fin-ab-bar i { background: linear-gradient(90deg, #8b5cf6, #db2777); }

.fin-debt, .fin-due { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px dashed var(--c-border); text-decoration: none; }
.fin-debt:last-child, .fin-due:last-child { border-bottom: 0; }
.fin-debt > i { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-weight: 900; color: white !important; background: linear-gradient(135deg, #f97316, #e11d48); flex-shrink: 0; }
.fin-debt b, .fin-due b { color: var(--c-text); font-size: .86rem; }
.fin-debt small, .fin-due small { display: block; font-size: .72rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-debt-o { text-align: left; }
.fin-debt-o b { color: #e11d48; }
.fin-debt-o.ok small { color: #059669; }
.fin-due-d { width: 64px; flex-shrink: 0; padding: 4px; border-radius: 10px; background: #f0fdfa; text-align: center; }
.fin-due-d b { color: #0f766e; }
.fin-due-d.soon { background: #fff7ed; }
.fin-due-d.soon b { color: #c2410c; }
.fin-exp { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 6px 0; font-size: .84rem; color: var(--c-text); }
.fin-exp b { color: var(--c-text); }
.fin-ok { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; background: #ecfdf5; color: #047857; font-size: .84rem; }
.fin-ok svg { fill: #059669; }

/* گزارش ماهانه */
.fin-grid { background: var(--c-card); border-radius: var(--c-r); box-shadow: var(--c-sh); overflow-x: auto; }
.fin-grid table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 1000px; }
.fin-grid th { position: sticky; top: 0; background: #0f766e; color: white !important; font-weight: 800; padding: 10px 8px; white-space: nowrap; text-align: center; font-size: .76rem; }
.fin-grid th:first-child { border-radius: 0; text-align: right; }
.fin-grid td { padding: 9px 8px; border-top: 1px solid var(--c-border); text-align: center; color: var(--c-text); white-space: nowrap; }
.fin-grid td:first-child { text-align: right; }
.fin-grid td small { display: block; font-size: .7rem; color: var(--c-muted); }
.fin-grid tbody tr { cursor: pointer; transition: background .15s; }
.fin-grid tbody tr:hover { background: #f0fdfa; }
.fin-grid tbody tr:nth-child(even) { background: #fafbfd; }
.fin-grid tbody tr:nth-child(even):hover { background: #f0fdfa; }
.fin-grid tr.fut td { color: #b6bccb; }
.fin-grid tfoot td { background: #e6f4f1; font-weight: 900; color: #064e3b; border-top: 2px solid #0f766e; }
.fin-st { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; border-radius: 999px; font-style: normal; font-size: .72rem; font-weight: 800; }
.fin-st.lock { background: #dcfce7; color: #166534; }
.fin-st.lock svg { fill: #166534; }
.fin-st.ready { background: #e0f2fe; color: #075985; }
.fin-st.bad { background: #fef3c7; color: #92400e; }
.fin-st.none { color: #b6bccb; }
.fin-catbar { display: block; width: 120px; height: 4px; margin-top: 4px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.fin-catbar i { display: block; height: 100%; background: #f97316; border-radius: 999px; }
.cmr-chips.sm button { padding: 4px 10px; font-size: .76rem; }

/* کنترل حسابدار */
.fin-sec { background: var(--c-card); border-radius: 20px; box-shadow: var(--c-sh); padding: 14px 16px; margin-bottom: 14px; }
.fin-sec-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--c-border); }
.fin-sec-h b { color: var(--c-text); }
.fin-sec-h svg { fill: #0f766e; }
.fin-iss, .fin-bank { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 9px 6px; border-bottom: 1px dashed var(--c-border); text-decoration: none; font-size: .84rem; }
.fin-iss:last-child, .fin-bank:last-child { border-bottom: 0; }
.fin-iss:hover { background: #fafbfd; }
.fin-iss b, .fin-bank b { color: var(--c-text); }
.fin-iss small, .fin-bank small { display: block; font-size: .72rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-iss-d { width: 82px; flex-shrink: 0; color: var(--c-muted); font-size: .8rem; }
.fin-iss-why { color: #b45309; font-size: .76rem; max-width: 280px; }
.fin-probs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 55%; }
.fin-probs i { font-style: normal; padding: 3px 9px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: .72rem; font-weight: 700; }
.fin-bank.bad { background: #fff1f2; border-radius: 12px; }
.fin-bank-note { height: 32px; border-radius: 10px; border: 1px solid #fda4af; padding: 0 10px; font-family: inherit; min-width: 200px; color: #1f2340; }
.fin-okb { background: #dcfce7 !important; color: #166534 !important; }
.fin-okb svg { fill: #166534; }
.fin-mcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.fin-mc { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 16px; text-decoration: none; border: 1px solid #fde68a; background: #fffbeb; transition: .15s; }
.fin-mc:hover { transform: translateY(-2px); box-shadow: var(--c-sh); }
.fin-mc b { color: #78350f; }
.fin-mc small { color: #92400e; font-size: .74rem; }
.fin-mc i { font-style: normal; font-size: .74rem; font-weight: 800; color: #b45309; }
.fin-mc.ready { border-color: #99f6e4; background: #f0fdfa; }
.fin-mc.ready b { color: #115e59; }
.fin-mc.ready small { color: #0f766e; }
.fin-mc.ready i { color: #0f766e; }

/* چک‌لیست قفل ماه */
.fin-lc { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.fin-lc-i { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; font-size: .84rem; }
.fin-lc-i b { display: block; color: inherit; }
.fin-lc-i small { display: block; font-size: .74rem; color: inherit; opacity: .85; }
.fin-lc-i.ok { background: #ecfdf5; color: #065f46; }
.fin-lc-i.ok svg { fill: #059669; }
.fin-lc-i.bad { background: #fff1f2; color: #9f1239; }
.fin-lc-i.bad svg { fill: #e11d48; }
.fin-lc-i.warn { background: #fffbeb; color: #92400e; }
.fin-lc-i.warn svg { fill: #d97706; }

/* پرسنل در دفتر روزانه */
.fin-staff { display: flex; align-items: center; gap: 8px; }
.fin-staff select { flex: 1; }
.fin-staff.need select { border-color: #f59e0b !important; box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); }
small.fin-staff-tag { color: #6d28d9 !important; font-weight: 700; }

/* پرداختی پرسنل */
.fin-staffs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.fin-sc { display: flex; flex-direction: column; gap: 10px; text-align: right; border: 1px solid transparent; cursor: pointer; font-family: inherit; padding: 16px; border-radius: 20px; background: var(--c-card); box-shadow: var(--c-sh); transition: .2s; }
.fin-sc > * { width: 100%; }
.fin-sc:hover { transform: translateY(-3px); box-shadow: var(--c-sh2); border-color: #c4b5fd; }
.fin-sc.on { border-color: #7c3aed; }
.fin-sc.off { opacity: .6; }
.fin-sc-h { display: flex; align-items: center; gap: 10px; }
.fin-sc-h img, .fin-sc-h > i { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.fin-sc-h > i { display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 1.1rem; color: white !important; background: linear-gradient(135deg, #7c3aed, #0f766e); }
.fin-sc-h b { display: block; color: var(--c-text); font-size: .95rem; }
.fin-sc-h small { display: block; color: var(--c-muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-sc-amt { font-size: 1.35rem; font-weight: 900; color: var(--c-text); }
.fin-sc-amt small { font-size: .72rem; font-weight: 400; color: var(--c-muted); }
.fin-spark { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; align-items: end; height: 46px; padding: 0 2px; border-bottom: 1px solid var(--c-border); }
.fin-spark i { display: block; border-radius: 3px 3px 0 0; background: #e2e8f0; }
.fin-spark i.on { background: linear-gradient(180deg, #8b5cf6, #0d9488); }
.fin-sc-f { display: flex; justify-content: space-between; font-size: .78rem; color: var(--c-muted); }
.fin-sc-f b { color: var(--c-text); }
.fin-sc-f span { color: var(--c-muted); }
.fin-sum3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.fin-sum3 div { padding: 10px; border-radius: 14px; background: #f5f3ff; }
.fin-sum3 small { display: block; font-size: .72rem; color: #6d28d9; }
.fin-sum3 b { color: #1f2340; font-size: 1rem; }
.fin-sh-m { display: flex; justify-content: space-between; margin-top: 12px; padding: 6px 10px; border-radius: 10px; background: #f1f5f9; font-size: .82rem; }
.fin-sh-m b, .fin-sh-m span { color: #334155; font-weight: 800; }
.fin-sh-i { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px dashed var(--c-border); text-decoration: none; font-size: .84rem; }
.fin-sh-i:hover { background: #fafbfd; }
.fin-sh-i b { color: var(--c-text); }
.fin-sh-i small { display: block; font-size: .72rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1100px) {
    .fin-dash { grid-template-columns: 1fr 1fr; }
    .fin-span2 { grid-column: span 2; }
    .fin-dash-top .cmr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .fin-dash-top { grid-template-columns: 1fr; }
    .fin-dash-top .cmr-kpis { grid-template-columns: 1fr 1fr; }
    .fin-dash { grid-template-columns: 1fr; }
    .fin-span2 { grid-column: span 1; }
    .fin-chart { height: 200px; }
    .fin-chart-y { display: none; }
    .fin-probs { max-width: 100%; justify-content: flex-start; }
}

/* drawer و modal بیرون از .cmr هستند؛ متغیرهای رنگ را اینجا هم می‌دهیم */
.cmr-drawer, .cmr-modal { --c-p: var(--ui-p, #5b5bd6); --c-p2: var(--ui-p2, #9b5de5); --c-text: var(--ui-text, #1f2340); --c-muted: var(--ui-muted, #7a7f9a);
    --c-border: var(--ui-border, #e6e8f2); --c-soft: var(--ui-soft, #eef0fb); --c-card: var(--ui-card, #fff); --c-red: var(--ui-red, #f0506e); }

/* =====================================================================
   مرحله ۶: حقوق پرسنل (pay-)
   ===================================================================== */
.pay-hero { background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(135deg, #134e4a 0%, #0f766e 45%, #b45309 100%); box-shadow: 0 18px 40px rgba(19, 78, 74, .28); }
.pay-ok { color: #059669 !important; font-weight: 800; }
.pay-warn { color: #b45309 !important; }

.pay-build { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; border-radius: 16px; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: .86rem; }
.pay-build svg { fill: #b45309; }
.pay-build b { color: #78350f; }

/* ---- ویرایشگر فیش ---- */
.pay-ed { display: flex; flex-direction: column; gap: 8px; }
.pay-ed-h { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: #ecfdf5; color: #065f46; }
.pay-ed-h b { color: #065f46; }
.pay-ed-h.ded { background: #fff1f2; color: #9f1239; }
.pay-ed-h.ded b { color: #9f1239; }
.pay-ed-h select { border: 1px solid var(--c-border); border-radius: 10px; padding: 5px 8px; font-family: inherit; font-size: .8rem; background: white; }
.pay-ed-r { display: grid; grid-template-columns: minmax(140px, 1.3fr) minmax(150px, 1fr) minmax(150px, 1fr) 34px; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--c-border); background: #fafbff; }
.pay-ed-r .cmr-f { margin: 0; }
.pay-ed-r input, .pay-pr input, .pay-pr select { border: 1px solid var(--c-border); border-radius: 10px; padding: 7px 9px; font-family: inherit; font-size: .84rem; background: white; min-width: 0; }
.pay-ed-t { width: 100%; font-weight: 700; }
.pay-ed-q { display: flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--c-muted); }
.pay-ed-q input { width: 74px; direction: ltr; text-align: center; }
.pay-ed-q small { white-space: nowrap; color: var(--c-muted); }
.pay-ed-tot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pay-ed-tot span { flex: 1; min-width: 140px; padding: 10px 12px; border-radius: 14px; background: var(--c-soft); font-size: .8rem; color: var(--c-muted); display: flex; justify-content: space-between; align-items: center; }
.pay-ed-tot b { font-size: 1rem; color: var(--c-text); }
.pay-ed-tot .net { background: linear-gradient(135deg, #0f766e, #059669); color: white !important; }
.pay-ed-tot .net b { color: white !important; font-size: 1.1rem; }

/* ---- پرونده (کشو) ---- */
.pay-pr { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.3fr); gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--c-border); background: #fafbff; margin-top: 6px; }
.pay-pr .cmr-f { margin: 0; }
.pay-pr-t b { display: block; font-size: .86rem; }
.pay-pr-t small { display: block; font-size: .72rem; color: var(--c-muted); }
.pay-pr-m { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pay-pr-m input[type=number] { width: 80px; direction: ltr; text-align: center; }
.pay-pr-m small { font-size: .72rem; color: var(--c-muted); }
.pay-pr-m .cmr-f { flex: 1; min-width: 140px; }

/* ---- فهرست اقلام / قالب‌ها ---- */
.pay-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 10px; }
.pay-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: right; font-family: inherit; cursor: pointer; padding: 11px 13px; border-radius: 14px; border: 1px solid var(--c-border); background: #fafbff; transition: .15s; position: relative; }
.pay-item:hover { border-color: #5eead4; background: #f0fdfa; }
.pay-item.on { border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15, 118, 110, .18); background: #f0fdfa; }
.pay-item.off { opacity: .55; }
.pay-item b { font-size: .88rem; color: var(--c-text); }
.pay-item small { font-size: .72rem; color: var(--c-muted); }
.pay-item i { font-style: normal; }
.pay-dot { width: 22px; height: 6px; border-radius: 999px; background: var(--pc, #0f766e); }
.pay-tpl { display: grid; grid-template-columns: 230px minmax(280px, 1fr) minmax(320px, 1.1fr); gap: 14px; align-items: start; }
.pay-tpl-l { display: flex; flex-direction: column; gap: 8px; }
.pay-tpl-ed .cmr-f { margin-bottom: 10px; }
.pay-tpl-pv { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 70px; }
.pay-color { display: flex; gap: 6px; align-items: center; }
.pay-color input[type=color] { width: 44px; height: 36px; padding: 2px; border-radius: 10px; border: 1px solid var(--c-border); cursor: pointer; }
.pay-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; margin-top: 4px; }
@media (max-width: 1100px) { .pay-tpl { grid-template-columns: 1fr; } .pay-tpl-pv { position: static; } }

/* ---- پرداخت در کشو ---- */
.pay-paybox { margin-top: 14px; padding: 14px; border-radius: 16px; border: 1px dashed #99f6e4; background: #f8fffd; display: flex; flex-direction: column; gap: 10px; }

/* ---- فیش من ---- */
.pay-my { display: grid; grid-template-columns: 240px 1fr; gap: 14px; align-items: start; }
.pay-my-l { display: flex; flex-direction: column; gap: 8px; }
.pay-my-r { min-width: 0; }
.pay-print-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
@media (max-width: 800px) { .pay-my { grid-template-columns: 1fr; } .pay-ed-r, .pay-pr { grid-template-columns: 1fr; } }

/* =====================================================================
   کارت فیش (PaySlipCard)
   ===================================================================== */
.pay-card { --pc: #0f766e; background: white; border-radius: 18px; overflow: hidden; border: 1px solid #e5e7eb; box-shadow: var(--c-sh, 0 6px 24px rgba(31, 35, 64, .08)); color: #1f2340; font-size: .86rem; }
.pay-card-h { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--pc); color: white !important; }
.pay-card-h * { color: white !important; }
.pay-card-t { display: block; font-size: 1.15rem; font-weight: 900; }
.pay-card-h small { display: block; font-size: .76rem; opacity: .85; }
.pay-card-m { text-align: left; }
.pay-card-m b { display: block; font-size: 1rem; }
.pay-card-who { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; padding: 12px 18px; background: #f8fafc; border-bottom: 1px solid #e5e7eb; }
.pay-card-who small, .pay-foot small { display: block; font-size: .7rem; color: #64748b; }
.pay-card-who b { font-size: .88rem; }
.pay-cols { display: grid; grid-template-columns: 1fr 1fr; }
.pay-col { padding: 12px 18px; }
.pay-col + .pay-col { border-right: 1px solid #e5e7eb; }
.pay-col-h { font-weight: 900; color: var(--pc); margin-bottom: 6px; font-size: .9rem; }
.pay-col.ded .pay-col-h { color: #be123c; }
.pay-ln { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #e5e7eb; }
.pay-ln small { color: #64748b; font-size: .7rem; margin-inline-start: 4px; }
.pay-ln.sum { border-bottom: 0; border-top: 2px solid #e5e7eb; margin-top: 4px; font-weight: 900; }
.pay-tbl { width: 100%; border-collapse: collapse; }
.pay-tbl th { background: color-mix(in srgb, var(--pc) 12%, white); color: var(--pc); padding: 8px 12px; font-size: .78rem; text-align: center; }
.pay-tbl th:first-child, .pay-tbl td:first-child { text-align: right; }
.pay-tbl td { padding: 7px 12px; border-bottom: 1px solid #f1f5f9; text-align: center; }
.pay-tbl td small { color: #64748b; font-size: .7rem; }
.pay-tbl tr.sum td { font-weight: 900; border-top: 2px solid #e5e7eb; }
.pay-net { display: flex; justify-content: space-between; align-items: center; margin: 12px 18px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--pc) 10%, white); border: 1px solid color-mix(in srgb, var(--pc) 35%, white); }
.pay-net span { font-weight: 800; color: var(--pc); }
.pay-net b { font-size: 1.3rem; font-weight: 900; color: var(--pc); }
.pay-net b small { font-size: .72rem; font-weight: 400; }
.pay-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; padding: 0 18px 12px; }
.pay-foot > div { padding: 8px 10px; border-radius: 12px; background: #f8fafc; }
.pay-foot i { display: block; font-style: normal; font-size: .7rem; color: #64748b; margin-top: 2px; }
.pay-note { margin: 0 18px 12px; padding: 8px 12px; border-radius: 10px; background: #fffbeb; color: #78350f; font-size: .8rem; }
.pay-sign { display: flex; justify-content: space-around; padding: 26px 18px 30px; color: #64748b; font-size: .78rem; }
.pay-sign span { min-width: 140px; text-align: center; border-top: 1px dashed #94a3b8; padding-top: 6px; }
.pay-footer { padding: 10px 18px; background: #f8fafc; border-top: 1px solid #e5e7eb; color: #64748b; font-size: .74rem; text-align: center; white-space: pre-line; }
.pay-l2 .pay-col { display: none; }

/* ---- نسخه‌ی چاپی ---- */
.pay-print { max-width: 820px; margin: 0 auto; }
@media print {
    body * { visibility: hidden !important; }
    .pay-print, .pay-print * { visibility: visible !important; }
    .pay-print { position: absolute; top: 0; right: 0; left: 0; max-width: none; }
    .pay-card { box-shadow: none !important; border-color: #cbd5e1; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .pay-print-bar { display: none !important; }
}

/* =====================================================================
   مرحله ۷: سمت مشتری، رسیدها، هشدارها و پیامک (prt-)
   ===================================================================== */
.prt-hero { background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(135deg, #1e3a8a 0%, #0f766e 50%, #be123c 100%); box-shadow: 0 18px 40px rgba(30, 58, 138, .25); }
.prt-badge { font-style: normal; background: #f43f5e; color: white !important; border-radius: 999px; padding: 0 7px; font-size: .72rem; margin-inline-start: 4px; }
.prt-bad { color: #be123c !important; }

/* هشدارهای بالای صفحه‌ی مشتری */
.prt-alerts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.prt-al { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; font-size: .84rem; background: #fffbeb; color: #78350f; border: 1px solid #fde68a; }
.prt-al svg { fill: currentColor; }
.prt-al b { color: inherit; }
.prt-al.hot { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.prt-al.dead { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.prt-days { font-size: .76rem; white-space: nowrap; }
.prt-inst .ctr-inst-h, .prt-inst .ctr-inst-r { grid-template-columns: 1.3fr 1.1fr 1.3fr 1.1fr 1.5fr 90px; }

/* رسیدهای مشتری */
.prt-rc { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--c-border); }
.prt-rc:first-of-type { border-top: 0; }
.prt-rc b { display: block; }
.prt-rc small { display: block; font-size: .74rem; color: var(--c-muted); }
.prt-rc-f { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--c-soft); flex-shrink: 0; }
.prt-rc-f svg { fill: var(--c-p); }
.prt-st { font-style: normal; font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.prt-st.s0 { background: #fef3c7; color: #92400e; }
.prt-st.s1 { background: #dcfce7; color: #166534; }
.prt-st.s2 { background: #fee2e2; color: #991b1b; }
.prt-file { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--c-border); background: #fafbff; min-height: 46px; }
.prt-file small { color: var(--c-muted); }

/* بررسی رسید (حسابدار) */
.prt-rv { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.prt-rv-file { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.prt-rv-file img { max-width: 100%; max-height: 70vh; border-radius: 14px; border: 1px solid var(--c-border); box-shadow: var(--c-sh); }
.prt-rv-file iframe { width: 100%; height: 65vh; border: 1px solid var(--c-border); border-radius: 14px; }
.prt-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prt-facts > div { background: #f8f9fd; border-radius: 12px; padding: 8px 12px; }
.prt-facts small { display: block; font-size: .7rem; color: var(--c-muted); }
.prt-facts b { font-size: .88rem; }
@media (max-width: 900px) { .prt-rv { grid-template-columns: 1fr; } }

/* لیست هشدارها */
.prt-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prt-list { display: flex; flex-direction: column; gap: 8px; }
.prt-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--c-card); box-shadow: var(--c-sh); border-inline-start: 5px solid #f59e0b; }
.prt-row.hot { border-inline-start-color: #f97316; }
.prt-row.dead { border-inline-start-color: #e11d48; background: #fffafb; }
.prt-row b { display: block; font-size: .9rem; }
.prt-row small { display: block; font-size: .74rem; color: var(--c-muted); }
.prt-kind { font-size: .7rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: #e0f2fe; color: #075985; min-width: 92px; text-align: center; }
.prt-kind.k-late { background: #be123c; color: white !important; }
.prt-kind.k-inst { background: #fef3c7; color: #92400e; }
.prt-kind.k-ssl { background: #dcfce7; color: #166534; }
.prt-kind.k-enamad { background: #ede9fe; color: #5b21b6; }
.prt-kind.k-support { background: #ffedd5; color: #9a3412; }
.prt-date { text-align: center; min-width: 110px; }
.prt-date b { font-size: .86rem; }
.prt-row.dead .prt-date small { color: #be123c; }
.prt-sms { min-width: 130px; text-align: center; }
.prt-txt { white-space: pre-line !important; text-align: right !important; max-width: 420px; font-size: .76rem; }
@media (max-width: 800px) { .prt-row { flex-wrap: wrap; } .prt-date, .prt-sms { min-width: 0; text-align: right; } }

/* کارت داشبورد */
.prt-card { background: var(--c-card); border-radius: 18px; box-shadow: var(--c-sh); overflow: hidden; margin-bottom: 14px; }
.prt-card-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: linear-gradient(135deg, #1e3a8a, #0f766e); }
.prt-card-h a { font-size: .78rem; text-decoration: none; }
.prt-card-r { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--c-border); text-decoration: none !important; color: var(--c-text) !important; font-size: .82rem; }
.prt-card-r:hover { background: #f8fafc; }
.prt-card-r small { color: var(--c-muted); white-space: nowrap; font-size: .72rem; }
.prt-card-r.dead small { color: #be123c; font-weight: 800; }
.prt-card-r.pend { background: #fffbeb; color: #78350f !important; font-weight: 800; }
.prt-card-r.pend svg { fill: #b45309; }
.prt-card-more { padding: 6px 14px 10px; font-size: .74rem; }
.cmr.prt-card { padding: 0 !important; }
