/* ==========================================================================
   Net Soft - سیستەمی گرێبەست و پارەدان
   ڕووکاری سەرەکی (پشتگیری RTL و LTR)
   ========================================================================== */

:root {
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #ccfbf1;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #2563eb;
    --info-light: #dbeafe;
    --sidebar: #0f172a;
    --sidebar-2: #1e293b;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", "Noto Naskh Arabic", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    color: #e2e8f0;
    padding: 18px 14px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 18px;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    margin-bottom: 14px;
}
.brand .logo {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    display: grid; place-items: center;
    font-size: 14px; font-weight: 800; color: #042f2e;
}
.brand small { display: block; font-weight: 400; font-size: 11px; opacity: .65; }

.nav-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .5;
    margin: 16px 10px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: #cbd5e1;
    margin-bottom: 3px;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-link .icon { width: 20px; text-align: center; opacity: .9; }
.nav-link .count {
    margin-inline-start: auto;
    background: rgba(255, 255, 255, .14);
    border-radius: 20px;
    padding: 0 8px;
    font-size: 12px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.topbar .spacer { flex: 1; }

.lang-switch { display: flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 10px; }
.lang-switch a {
    padding: 4px 10px; border-radius: 8px; font-size: 12px; color: var(--muted);
}
.lang-switch a.active { background: var(--primary); color: #fff; font-weight: 600; }
.lang-switch a:hover { text-decoration: none; }

.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.user-chip .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary-dark);
    display: grid; place-items: center; font-weight: 700;
}
.user-chip .role { display: block; font-size: 11px; color: var(--muted); }

.content { padding: 22px; flex: 1; }

/* ---------------------------------------------------------------- Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    /* ⚠️ هیچ `overflow: hidden` ـێک نییە: لیستەکانی هەڵبژاردن (وەک
       «کردارەکانی تر») دەردەچنە دەرەوەی کارتەکە و دەبڕدرێن.
       کۆڵەکانی خڕ بە border-radius ی منداڵەکان پارێزراون. */
}
.card > :first-child { border-start-start-radius: var(--radius); border-start-end-radius: var(--radius); }
.card > :last-child { border-end-start-radius: var(--radius); border-end-end-radius: var(--radius); }
.card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: #f8fafc; }

/* ---------------------------------------------------------------- Grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) {
    .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .layout { flex-direction: column; }
    /* شریتی سەرەوە: زمان + بەکارهێنەر + دەرچوون لە ڕیزی دووەم (بێ سکڕۆڵی ئاسۆیی) */
    .topbar { flex-wrap: wrap; row-gap: 8px; padding: 10px 16px; }
    .topbar .spacer { flex-basis: 100%; height: 0; }
    .sidebar { width: 100%; height: auto; position: static; }
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- Stats */
.stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 22px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.usd { border-inline-start: 4px solid var(--success); }
.stat.iqd { border-inline-start: 4px solid var(--info); }
.stat.warn { border-inline-start: 4px solid var(--warning); }
.stat.danger { border-inline-start: 4px solid var(--danger); }

/* ---------------------------------------------------------------- Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { background: #f8fafc; font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }
.table th.num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* خانەکانی ژمارە و پارە: لە ناوەڕاست ✓ (بۆ خوێندنەوەی ئاسانتر) */
.table td.num, .table td.money { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* هەر بڕێک لە ڕیزێکی جیاوازدا ✓ (لەژێر یەک ✓) */
.table td.money .paid-value { display: block; }
.table td.money .due-strong { display: block; }
.table .muted { color: var(--muted); font-size: 12.5px; }
.table-empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- خشتەی فراوان
   ⚠️ خشتەکانی زۆر ستوون (وەک لیستی گرێبەستەکان: ١٢ ستوون) نابێت ببڕدرێن.
   `.table-wrap` سکڕۆڵی ئاسۆیی دەدات، و ستوونی یەکەم/دوا jێگیر دەبێت بۆ
   ئەوەی ناوی گرێبەست و دوگمەکان هەمیشە ببینرێن. */
.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.table-wrap > .table { min-width: var(--table-min, 1180px); }

/* سکڕۆڵبارێکی تەنک و ڕوون */
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 999px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.table-sticky th:first-child,
.table-sticky td:first-child {
    position: sticky;
    inset-inline-start: 0;
    z-index: 3;
    background: var(--card);
}
.table-sticky thead th:first-child { background: #f8fafc; z-index: 4; }

.table-sticky th:last-child,
.table-sticky td:last-child {
    position: sticky;
    inset-inline-end: 0;
    z-index: 3;
    background: var(--card);
}
.table-sticky thead th:last-child { background: #f8fafc; z-index: 4; }

/* هێڵی جیاکەرەوە بۆ ستوونە جێگیرەکان (کاتێک سکڕۆڵ دەکرێت) */
.table-sticky td:first-child { box-shadow: 1px 0 0 var(--border); }
.table-sticky td:last-child { box-shadow: -1px 0 0 var(--border); }

/* لە شاشەی بچووکدا: کەمکردنەوەی هەنگاوەکان */
@media (max-width: 1100px) {
    .table-wrap > .table { --table-min: 1020px; }
    .table th, .table td { padding: 9px 10px; }
}

/* ---------------------------------------------------------------- Badges */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #e2e8f0;
    color: #334155;
    white-space: nowrap;
}
.badge.success { background: var(--success-light); color: #065f46; }
.badge.warning { background: var(--warning-light); color: #92400e; }
.badge.danger { background: var(--danger-light); color: #991b1b; }
.badge.info { background: var(--info-light); color: #1e40af; }
.badge.muted { background: #e2e8f0; color: #475569; }
.badge.usd { background: var(--success-light); color: #065f46; }
.badge.iqd { background: var(--info-light); color: #1e40af; }

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-link { border: none; background: none; color: var(--primary); padding: 4px 6px; }
.btn-link.danger { color: var(--danger); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------- Forms */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .form-grid, .form-grid.two { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 5px; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: #334155; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .error { font-size: 12px; color: var(--danger); }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=tel], input[type=search], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .13);
}
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--danger); }
textarea { min-height: 76px; resize: vertical; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.checkbox input { width: 17px; height: 17px; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .field { min-width: 150px; flex: 1; }

/* ---------------------------------------------------------------- Page head */
.page-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.page-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.page-head .spacer { flex: 1; }

/* ---------------------------------------------------------------- Contract form */
.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 18px;
    align-items: start;
}
/* فۆرمی بێ پوختە: هەموو پانی لاپەڕەکە بۆ فۆرمەکە */
.form-layout.no-side { grid-template-columns: minmax(0, 1fr); }
.form-col { min-width: 0; }
.side-col { position: sticky; top: 78px; }
@media (max-width: 1024px) {
    .form-layout { grid-template-columns: 1fr; }
    .side-col { position: static; }
}

.form-card { margin: 0; }
.form-block { padding: 20px 22px; border-bottom: 1px solid var(--border); }
.form-block:last-of-type { border-bottom: none; }
.form-block-head { margin-bottom: 14px; }
.form-block-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.form-block-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }

.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row .col-2 { grid-column: span 2; }
.form-row .col-3 { grid-column: 1 / -1; }
@media (max-width: 900px) {
    .form-row, .form-row.two { grid-template-columns: 1fr; }
    .form-row .col-2, .form-row .col-3 { grid-column: auto; }
}

.req { color: var(--danger); font-weight: 700; }

/* هەڵبژاردنی جۆری گرێبەست */
.type-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .type-tiles { grid-template-columns: 1fr; } }
.type-tile {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.type-tile:hover { border-color: #cbd5e1; }
.type-tile input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); flex: 0 0 auto; }
.type-tile strong { display: block; font-size: 13.5px; }
.type-tile .hint { display: block; margin-top: 2px; font-size: 12px; line-height: 1.5; }
.type-tile:has(input:checked) {
    border-color: var(--primary);
    background: #f0fdfa;
    box-shadow: inset 0 0 0 1px var(--primary);
}

/* چێکبۆکسی ڕیز */
.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 13.5px;
    cursor: pointer;
}
.check-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }

/* پوختەی لای ڕاست */
.summary-card { margin: 0; }
.summary-card .card-body { padding: 16px 18px; }
.summary-list { display: flex; flex-direction: column; gap: 9px; }
.summary-list + .summary-list { margin-top: 4px; }
.summary-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.summary-row > span { color: var(--muted); }
.summary-row strong { font-variant-numeric: tabular-nums; font-weight: 700; }
.summary-row.total {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
.summary-row.total > span { color: var(--text); font-weight: 600; }
.summary-row.total strong { color: var(--danger); font-size: 16px; }
.summary-note {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--muted);
}

/* دوگمەکانی فۆرم */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
}
.form-actions .btn { min-width: 110px; justify-content: center; }

/* خانەی پارەی دراو و ماوە لە لیستی گرێبەستەکان */
.paid-value { font-weight: 700; }
.paid-label { font-size: 10.5px; font-weight: 600; color: var(--muted); margin-inline-start: 3px; }
.due-strong { margin-top: 3px; font-size: 13.5px; font-weight: 800; color: #991b1b; white-space: nowrap; }
.paid-done { margin-top: 3px; font-size: 11px; font-weight: 700; color: #047857; }
/* زنجیرەی نوێکردنەوە لە لیستی گرێبەستەکان */
.renew-link { display: flex; gap: 4px; align-items: center; margin-top: 3px; font-size: 11px; white-space: nowrap; }
.renew-link a { color: var(--primary); font-weight: 700; text-decoration: underline; }
.renew-arrow { font-size: 11px; }
/* لیستی بەروارەکانی کۆتایی سێرڤەر لە لیستی گرێبەستەکان */
.service-ends { font-size: 11.5px; line-height: 1.5; }
.service-end { display: flex; gap: 6px; justify-content: space-between; align-items: center; white-space: nowrap; }
.service-end-name { color: var(--muted); font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.service-end bdi { font-variant-numeric: tabular-nums; font-weight: 700; }
.service-end.expired bdi { color: #b91c1c; }
.service-end.soon bdi { color: #b45309; }
.service-end.ok bdi { color: #047857; }
/* پوختەی پارەدان (تابی پارەدان) */
.payment-summary-block { background: linear-gradient(180deg,#f8fbff,#fff); }
.pay-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.pay-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
.pay-item .pay-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pay-item .pay-value { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-item .pay-currency { font-size: 11px; color: var(--muted); }
.pay-item.total { background: #f0f9f7; border-color: #bfe3da; }
.pay-item.total .pay-value { color: var(--primary); }
.pay-item.due { background: #fff7ed; border-color: #fed7aa; }
.pay-item.due .pay-value { color: #b45309; }
.pay-state { margin-top: 10px; font-size: 12.5px; font-weight: 700; }
.pay-state.ok { color: #047857; }
.pay-state.warn { color: #b45309; }
.pay-state.over { color: #b91c1c; }

@media (max-width: 900px) {
    .pay-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* نیشانەی هەنگاو لە ناونیشانی بەشەکان (تابی پارەدان) */
.block-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    margin-inline-end: 6px;
}

/* خشتەی وادەکانی پارەدان: هەمان شێوازی خشتەی ڕیزەکان */
.schedule-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.schedule-table th, .schedule-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: center;
}
.schedule-table thead th {
    background: #f8fafc;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
}
.schedule-table tfoot th { background: #f8fafc; font-size: 12.5px; font-weight: 700; }
.schedule-table td input, .schedule-table td select {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 8px;
    font-size: 13px;
    border-radius: 8px;
    box-sizing: border-box;
    text-align: center;
}
.schedule-table td input[type="date"] { height: 34px; padding: 0 4px; font-size: 12.5px; }
.schedule-table td.num { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.schedule-table .col-actions { text-align: center; }
.schedule-table [data-remove-schedule] { width: 30px; height: 30px; padding: 0; line-height: 1; }
/* ---------------------------------------------------------------- ڕیزەکانی گرێبەست */
.lines-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
/* خشتەی ڕیزەکان: هەموو ستوونەکان بێ سکڕۆڵ دەردەکەون (ڕێککەوتوو + بچووک) */
.lines-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
.lines-table th, .lines-table td {
    padding: 7px 6px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: start;
    overflow: hidden;
}
.lines-table thead th {
    background: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    white-space: normal;
    line-height: 1.35;
    /* سەرستوونەکان لە ناوەڕاست — بۆ ئەوەی لەگەڵ خانەکان یەک ڕیز بن */
    text-align: center;
}
.lines-table thead th.th-start { text-align: start; }
.lines-table tfoot th { text-align: center; }
.lines-table tbody tr:hover { background: #fbfdfe; }
.lines-table tbody tr:last-child td { border-bottom: none; }
.lines-table tfoot th {
    background: #f8fafc;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 700;
}
/* هەموو خانەکان یەک بەرزی و یەک ئاراستە — بۆ ئەوەی ڕیزەکە ڕێک بێت */
.lines-table td input, .lines-table td select {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 8px;
    font-size: 13px;
    border-radius: 8px;
    box-sizing: border-box;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.lines-table td select { text-align: start; padding-inline-start: 8px; }
/* خانەی بەروار: هەمان بەرزی، فۆنتی بچووکتر */
.lines-table td input[type="date"] {
    height: 34px;
    padding: 0 4px;
    font-size: 12.5px;
}
.lines-table td.num {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
.lines-table .col-server select { width: 100%; }

/* خانەی ناچالاک (تائمینات/RQTY لە فرۆشتن دا): وەک دەق دیارە، نەک خانەی بەتاڵ */
.lines-table td input:disabled {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    cursor: default;
    box-shadow: none;
    text-align: center;
}
.lines-table .col-actions { text-align: center; }
.lines-table [data-remove-line] { width: 30px; height: 30px; padding: 0; line-height: 1; }
.lines-table tfoot th.foot-label { font-size: 12px; text-align: start; }
.lines-table tfoot th.foot-hint {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    text-align: center;
}
/* ڕیزەکان بە جیاکاری بۆ خوێندنەوەی ئاسان */
.lines-table tbody tr:nth-child(even) { background: #fcfdfe; }

/* باجی گرێبەستی تێکەڵ */
.badge.mixed { background: #ede9fe; color: #5b21b6; }

/* ---------------------------------------------------------------- وادەکانی پارەدان (داشبۆرد) */
.due-list { display: flex; flex-direction: column; }
.due-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
}
.due-row:last-child { border-bottom: none; }
.due-row.danger { background: #fff5f5; }
.due-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.due-contract { font-size: 14px; }
.due-customer { color: var(--muted); font-size: 13px; }
.due-phone {
    font-size: 12.5px;
    color: var(--primary);
    background: #eef7f5;
    padding: 2px 8px;
    border-radius: 999px;
}
.due-meta { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.due-date { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.due-amount { font-weight: 700; font-size: 14px; }

/* خشتەی وادەکان لە فۆرم و لاپەڕەی گرێبەست */
.schedule-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.schedule-table th, .schedule-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: start;
    vertical-align: middle;
}
.schedule-table thead th { background: #f8fafc; font-size: 12px; color: var(--muted); font-weight: 600; }
.schedule-table tfoot th { background: #f8fafc; border-top: 1px solid var(--border); font-size: 13px; }
.schedule-table td.num, .schedule-table th.num { text-align: end; font-variant-numeric: tabular-nums; }
.schedule-table td input, .schedule-table td select { padding: 7px 9px; font-size: 13.5px; border-radius: 8px; }
.schedule-table .col-actions { text-align: center; }
.schedule-note { margin-top: 8px; font-size: 13px; }
.schedule-note.ok { color: #0f766e; }
.schedule-note.warn { color: #b45309; }
.schedule-note.over { color: var(--danger); font-weight: 600; }
.table th .schedule-note { white-space: normal; display: inline-block; min-width: 220px; line-height: 1.6; }
.table tr.row-overdue { background: #fff5f5; }
.table tr.row-overdue td { border-color: #fecaca; }

/* لیستی سێرڤەرەکانی گرێبەست (لیستی گرێبەستەکان) */
/* دابەشکردنی پارەی دراو لە لیستی گرێبەستەکان */
.paid-split { display: flex; gap: 8px; justify-content: flex-end; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.paid-split span { white-space: nowrap; }
.paid-split .split-device { color: #0f766e; }
.paid-split .split-service { color: #1d4ed8; }
.th-legend { font-size: 10.5px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.money.deposit { color: #b45309; font-weight: 700; }
/* صندوقەکان (داهات / تائمینات) */
.fund-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fund-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.fund-item.revenue { background: var(--success-light); border-color: #a7f3d0; }
.fund-item.deposit { background: #fffbeb; border-color: #fcd34d; }
.fund-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fund-item strong { font-size: 16px; }
.fund-total { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 13.5px; }
/* گرێبەستە پەیوەندیدارەکان (نوێکردنەوە) */
.related-list { display: flex; flex-direction: column; gap: 8px; }
.related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    text-decoration: none;
    color: inherit;
}
.related-item:hover { background: #f1f5f9; }
.related-icon { font-size: 18px; }
.related-item .muted { display: block; }

/* پوختەی گرێبەستی کۆن لە فۆرمی نوێکردنەوە */
.renew-summary { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 10px; }
.renew-item { display: flex; flex-direction: column; gap: 2px; }
.renew-item .muted { font-size: 12.5px; }
.renew-item strong { font-size: 14.5px; }
.server-line {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 13px;
}
.server-line + /* دابەشکردنی پارەی دراو لە لیستی گرێبەستەکان */
.paid-split { display: flex; gap: 8px; justify-content: flex-end; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.paid-split span { white-space: nowrap; }
.paid-split .split-device { color: #0f766e; }
.paid-split .split-service { color: #1d4ed8; }
.th-legend { font-size: 10.5px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.money.deposit { color: #b45309; font-weight: 700; }
/* صندوقەکان (داهات / تائمینات) */
.fund-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fund-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.fund-item.revenue { background: var(--success-light); border-color: #a7f3d0; }
.fund-item.deposit { background: #fffbeb; border-color: #fcd34d; }
.fund-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fund-item strong { font-size: 16px; }
.fund-total { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 13.5px; }
/* گرێبەستە پەیوەندیدارەکان (نوێکردنەوە) */
.related-list { display: flex; flex-direction: column; gap: 8px; }
.related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    text-decoration: none;
    color: inherit;
}
.related-item:hover { background: #f1f5f9; }
.related-icon { font-size: 18px; }
.related-item .muted { display: block; }

/* پوختەی گرێبەستی کۆن لە فۆرمی نوێکردنەوە */
.renew-summary { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 10px; }
.renew-item { display: flex; flex-direction: column; gap: 2px; }
.renew-item .muted { font-size: 12.5px; }
.renew-item strong { font-size: 14.5px; }
.server-line { margin-top: 3px; }
.server-line .server-name { font-weight: 600; }
.server-line .badge { font-size: 11.5px; padding: 1px 8px; }

/* ⚠️ خانەی سێرڤەر: هەموو بەشەکانی («٥ ئامێر» + ناو + «٥ ئامێر لای کڕیار»)
   دەبێت لە **یەک ڕیز**دا بن — نەک بشکێن و بچنە خوارەوە. */
.table td.cell-server,
.table th.cell-server {
    white-space: nowrap;
}
.table td.cell-server .muted.small { white-space: nowrap; }
/* سندوقی هەژمارکردنی زیندوو (خزمەتگوزاری سێرڤەر) */
.calc-box {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.calc-box .calc-label { font-size: 12.5px; color: var(--muted); }
.calc-box strong { font-size: 16px; color: #0f766e; font-variant-numeric: tabular-nums; }
.calc-box .badge { font-size: 12px; }



/* ---------------------------------------------------------------- Alerts */
.alert { padding: 11px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: var(--success-light); color: #065f46; border-color: #6ee7b7; }
.alert-error { background: var(--danger-light); color: #991b1b; border-color: #fca5a5; }
.alert-info { background: var(--info-light); color: #1e40af; border-color: #93c5fd; }
.alert ul { margin: 6px 0 0; padding-inline-start: 20px; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.alert-danger { background: var(--danger-light); color: #991b1b; border-color: #fca5a5; }
.alert-title { font-weight: 700; margin-bottom: 4px; }
.alert-list { display: flex; flex-direction: column; gap: 4px; }
.alert-list li { font-size: 13.5px; }
.alert-list .money { font-weight: 700; }
.alert-more { font-size: 12.5px; margin-top: 6px; }

/* ---------------------------------------------------------------- Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { position: relative; padding-inline-start: 26px; padding-bottom: 18px; border-inline-start: 2px solid var(--border); margin-inline-start: 8px; }
.timeline > li:last-child { border-inline-start-color: transparent; padding-bottom: 0; }
.timeline > li::before {
    content: "";
    position: absolute;
    inset-inline-start: -7px;
    top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px #fff;
}
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .who { font-weight: 700; }
.timeline .changes { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.timeline .changes table { width: 100%; border-collapse: collapse; font-size: 13px; }
.timeline .changes th, .timeline .changes td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: start; }
.timeline .changes tr:last-child td { border-bottom: none; }
.timeline .changes th { background: #f8fafc; font-weight: 600; color: var(--muted); font-size: 12px; }
.old-value { color: var(--danger); text-decoration: line-through; opacity: .8; }
.new-value { color: var(--success); font-weight: 600; }

/* ---------------------------------------------------------------- Progress */
.progress { display: flex; height: 9px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #14b8a6, #059669); }
.progress.warn > span { background: linear-gradient(90deg, #fbbf24, #d97706); }

.kv { display: grid; grid-template-columns: 165px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.money.usd { color: var(--success); }
.money.iqd { color: var(--info); }
.money.due { color: var(--danger); }
.money.zero { color: var(--muted); font-weight: 500; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a, .tabs button {
    padding: 9px 14px;
    border-radius: 10px 10px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    border: 1px solid transparent;
    border-bottom: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}
.tabs a.active, .tabs button.active { color: var(--primary-dark); background: #fff; border-color: var(--border); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* کردارەکانی تر (لیستی هەڵبژاردن) */
.more-actions { position: relative; display: inline-block; }
.more-actions > summary { list-style: none; cursor: pointer; }
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions-menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 6px);
    z-index: 40;
    min-width: 210px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
}
.more-actions-menu form { margin: 0; }
/* تابەکانی لاپەڕەی گرێبەست */
.page-tabs {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 10px 0;
    margin-bottom: 14px;
    gap: 4px;
}
.page-tabs button { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; }
.page-tabs button .step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 11.5px;
    font-weight: 800;
}
.page-tabs button.active .step { background: var(--primary); color: #fff; }
.page-tabs button.has-error { color: var(--danger); }
.page-tabs button.has-error .step { background: var(--danger); color: #fff; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-head .actions .btn { white-space: nowrap; }
/* تابەکانی فۆرم (گرێبەست) */
.form-tabs {
    padding: 12px 18px 0;
    margin-bottom: 0;
    background: #f8fafc;
    border-radius: 14px 14px 0 0;
    gap: 4px;
}
.form-tabs button { display: inline-flex; align-items: center; gap: 7px; }
.form-tabs button .step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 11.5px;
    font-weight: 800;
}
.form-tabs button.active .step { background: var(--primary); color: #fff; }
.form-tabs button.has-error { color: var(--danger); }
.form-tabs button.has-error .step { background: var(--danger); color: #fff; }
.form-tab-panels > .tab-panel > .form-block:first-child { border-top: none; }
.form-tab-panels > .tab-panel > .form-block:last-child { border-bottom: none; }

.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding-top: 10px; }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.bar-chart .bar .fill { width: 100%; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #2dd4bf, #0f766e); min-height: 3px; }
.bar-chart .bar .fill.iqd { background: linear-gradient(180deg, #93c5fd, #2563eb); }
.bar-chart .bar .cap { font-size: 11px; color: var(--muted); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: radial-gradient(1200px 600px at 50% -10%, #ccfbf1, #f1f5f9); }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { border: none; color: var(--text); justify-content: center; margin-bottom: 4px; }
.login-card .brand .logo { color: #042f2e; }

.pagination { display: flex; gap: 5px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.pagination li a, .pagination li span {
    display: inline-block; padding: 6px 11px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 13px; color: var(--text); background: #fff;
}
.pagination li.active span { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pagination li.disabled span { opacity: .45; }
.pagination li a:hover { background: #f8fafc; text-decoration: none; }

.text-muted { color: var(--muted); }
.text-end { text-align: end; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-end { justify-content: flex-end; }
.nowrap { white-space: nowrap; }
.small { font-size: 12.5px; }

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .content { padding: 0; }
    .card { box-shadow: none; }
}

/* ---------------------------------------------------------------- ئامێرەکان */
.table tr.row-muted td { color: var(--muted); background: #fafbfc; }
.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 14px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: #f8fafc;
}
.bulk-bar > strong { flex-basis: 100%; }
.bulk-bar .field { min-width: 140px; flex: 1; }
.add-devices {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.add-devices h4 { margin: 0 0 12px; font-size: 14px; }
.import-sample {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-size: 12.5px;
    overflow-x: auto;
    text-align: left;
}

/* ==========================================================================
   تاب ٢: وادەکانی پارەدان + زیادکردنی ئامێر (کۆد / IMEI)
   ========================================================================== */

/* ---------------------------------------------------------------- زیادکردنی ئامێر */
.add-devices-note {
    margin: 12px 0 0;
    padding: 9px 13px;
    border-radius: 10px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    font-size: 12.5px;
    color: #0f766e;
}
.add-devices-note strong { font-variant-numeric: tabular-nums; }
.add-devices-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

/* ---------------------------------------------------------------- خشتەی جێگیر */
.lines-wrap.static { border: none; border-radius: 0; }
.lines-wrap.static .table { background: #fff; }

/* دۆخی بەتاڵ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 26px 18px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #fbfdfe;
    text-align: center;
}
.empty-state .empty-icon { font-size: 24px; opacity: .75; }
.empty-state .empty-title { margin: 0; font-size: 14px; font-weight: 600; }
.empty-state .empty-hint { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- وادەکانی پارەدان */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 760px) { .mini-stats { grid-template-columns: 1fr; } }

.mini-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}
.mini-stat .mini-label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.mini-stat strong { font-size: 15px; font-variant-numeric: tabular-nums; }
/* گرێبەستی چەند دراو: هەر دراوێک دێڕێکی جیا (دۆلار و دینار کۆ ناکرێنەوە) */
.mini-stat .mini-value { display: block; line-height: 1.45; }
.mini-stat.ok { background: #f0fdf4; border-color: #bbf7d0; }
.mini-stat.due { background: #fff7ed; border-color: #fed7aa; }

.schedule-split-note {
    margin: 10px 0 0;
    font-size: 12.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* خشتەی وادەکان: بەروار و بڕ ڕێک و خوێندنەوەی ئاسان */
.table-schedule td:first-child { min-width: 120px; }
.table-schedule .date-value { font-variant-numeric: tabular-nums; }
.table-schedule .alloc-line {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: baseline;
    white-space: nowrap;
}
.table-schedule tfoot th { background: #f8fafc; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* ==========================================================================
   گۆڕینەوەی دراو (FX): پارەدانی بیانی بۆ گرێبەستێکی دراوێکی تر
   ========================================================================== */

/* هاوتای پارەدان لە خشتەی پارەدانەکان */
.fx-settled {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 700;
    color: #0f766e;
    white-space: nowrap;
}
.fx-settled .muted { font-weight: 600; }

/* سندوقی گۆڕینەوە لە فۆرمی پارەدان */
.fx-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 14px;
    border: 1px solid #99f6e4;
    border-radius: 10px;
    background: linear-gradient(180deg, #f0fdfa, #fff);
}
.fx-box[hidden] { display: none; }
.fx-box .fx-icon { font-size: 18px; }
.fx-box .fx-text { font-size: 13px; color: #0f766e; }
.fx-box .fx-text strong {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    margin-inline-start: 4px;
}
.fx-box .fx-text .muted { font-weight: 600; margin-inline-start: 4px; }

/* خانەی دوگمە لە فۆرم (وەک: دۆزینەوەی نرخی ئاڵوگۆڕ) */
.field.field-action { justify-content: flex-start; }
.field.field-action .btn { align-self: flex-start; white-space: nowrap; }
.field.field-action[hidden] { display: none; }

/* هاوتای پێشەکی بە دراوی گرێبەست (فۆرمی گرێبەست) */
.advance-fx {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #99f6e4;
    border-radius: 10px;
    background: linear-gradient(180deg, #f0fdfa, #fff);
}
.advance-fx[hidden] { display: none; }
.advance-fx .adv-eq-field { flex: 1 1 260px; min-width: 220px; }
.advance-fx .adv-calc {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-bottom: 4px;
    font-size: 12.5px;
    color: #0f766e;
    font-variant-numeric: tabular-nums;
}
.advance-fx .adv-calc-rate strong { font-size: 15px; }
.advance-fx .adv-calc-formula { font-weight: 600; }
.field[data-advance-rate-field][hidden] { display: none; }

/* کۆی کاش لە صندوقدا — بەرزترین بڕ لە کارتی صندوق */
.fund-cash {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 12px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: linear-gradient(180deg, #ecfdf5, #ffffff);
    border: 1px solid #a7f3d0;
}
.fund-cash-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #047857;
}
.fund-cash-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* جوڵەکانی کاش لە لیستی پارەدانەکان */
.cash-move {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.cash-move.in { color: #047857; }
.cash-move.out { color: #b45309; }
.cash-move .money { font-weight: 700; }

/* ↩ باقی: 100$ وەرگیرا، 30,000 د.ع باقی دراوەتەوە */
.pay-change {
    grid-column: 1 / -1;
    padding: 10px 12px;
    border: 1px dashed #fcd34d;
    border-radius: 10px;
    background: #fffbeb;
}
.pay-change > .hint { display: block; margin-top: 4px; }
.pay-change-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.pay-change[hidden],
.pay-change-fields[hidden],
.field[data-fx-equivalent-field][hidden] { display: none; }
.pay-change-preview {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #fde68a;
    font-size: 13px;
    line-height: 1.8;
    font-variant-numeric: tabular-nums;
}
.pay-change-preview .in { color: #047857; font-weight: 700; }
.pay-change-preview .out { color: #b45309; font-weight: 700; }
.pay-change-line {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 700;
    color: #b45309;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .pay-change-fields { grid-template-columns: 1fr; }
}

/* ==========================================================================
   لیستی گرێبەستەکان — خشتەی پرۆفیشناڵ (.ct-*)
   ⚠️ خانەکان دەوڵەمەندن (ژمارە + دۆخ + ڕێژە) بۆ ئەوەی هەموو ستوونەکان بێ
   سکڕۆڵی ئاسۆیی دەربکەون. کاتێک کارتەکە تەسک دەبێت (≤ 1040px) هەر
   گرێبەستێک دەبێتە کارتێکی بچووک (container query).
   ========================================================================== */
.ct-card { container: ctlist / inline-size; }

/* ---- سەرەوەی کارت */
.ct-head {
    display: flex;
    align-items: center;
    gap: 12px 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fbfdfd, #fff);
}
.ct-head-title { display: flex; align-items: center; gap: 12px; }
.ct-head-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ccfbf1, #e0f2fe);
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .14);
}
.ct-head h2 { margin: 0; font-size: 16.5px; font-weight: 800; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
.ct-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-head .spacer { flex: 1; }
.ct-count {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.ct-new { box-shadow: 0 6px 16px -8px rgba(15, 118, 110, .7); }

/* فلتەری خێرای دۆخ */
.ct-segments {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #f1f5f9;
}
.ct-segments a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.ct-segments a:hover { color: var(--text); text-decoration: none; }
.ct-segments a.active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 1px var(--border);
}

/* خاڵی ڕەنگی دۆخ */
.ct-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; flex: 0 0 auto; }
.ct-dot.is-active { background: #10b981; }
.ct-dot.is-expiring { background: #f59e0b; }
.ct-dot.is-expired { background: #ef4444; }
.ct-dot.is-renewed { background: #8b5cf6; }

/* ---- خشتە */
.ct-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ct-wrap::-webkit-scrollbar { height: 10px; }
.ct-wrap::-webkit-scrollbar-track { background: #f1f5f9; }
.ct-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

.ct-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.ct-table thead th {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-align: start;
    white-space: nowrap;
    vertical-align: bottom;
}
.ct-table thead th.ct-num { text-align: center; }
.ct-th-hint { display: block; margin-top: 1px; font-size: 10.5px; font-weight: 500; color: #94a3b8; }

.ct-table tbody td {
    padding: 14px;
    border-bottom: 1px solid #edf1f5;
    background: #fff;
    vertical-align: middle;
    transition: background .15s;
}
.ct-table tbody tr:last-child td { border-bottom: none; }
.ct-table tbody tr[data-href] { cursor: pointer; }
.ct-table tbody tr:hover td { background: #f7fbfa; }
.ct-table td.ct-num { text-align: center; font-variant-numeric: tabular-nums; }

.ct-nil { color: #cbd5e1; font-weight: 700; }
.ct-sub { margin-top: 3px; font-size: 11.5px; line-height: 1.5; color: var(--muted); white-space: nowrap; }
.ct-sub strong { color: #334155; font-weight: 700; }
.ct-warn { color: #b45309; font-weight: 700; }

/* ---- ستوونی گرێبەست + هێڵی ڕەنگی دۆخ */
.ct-table td.ct-c-contract { position: relative; padding-inline-start: 20px; white-space: nowrap; }
.ct-accent {
    position: absolute;
    inset-block: 12px;
    inset-inline-start: 0;
    width: 4px;
    border-start-end-radius: 4px;
    border-end-end-radius: 4px;
    background: #cbd5e1;
}
.ct-row.is-active .ct-accent { background: #10b981; }
.ct-row.is-expiring .ct-accent { background: #f59e0b; }
.ct-row.is-expired .ct-accent { background: #ef4444; }
.ct-row.is-renewed .ct-accent { background: #a78bfa; }

.ct-no { font-size: 14.5px; font-weight: 800; color: var(--primary-dark); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.ct-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ct-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 20px;
    padding: 0 7px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.ct-tag.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ct-tag.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.ct-tag.mixed { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.ct-tag.usd { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.ct-tag.iqd { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.ct-tag.ext { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; }
.ct-renew { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; margin-top: 5px; font-size: 11px; color: var(--muted); white-space: normal; }
.ct-renew a { font-weight: 700; }

/* ---- کڕیار */
.ct-person { display: flex; align-items: center; gap: 10px; }
.ct-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
    background: #ccfbf1;
    color: #115e59;
}
.ct-avatar.t1 { background: #dbeafe; color: #1e40af; }
.ct-avatar.t2 { background: #ede9fe; color: #5b21b6; }
.ct-avatar.t3 { background: #fef3c7; color: #92400e; }
.ct-avatar.t4 { background: #ffe4e6; color: #9f1239; }
.ct-avatar.t5 { background: #e2e8f0; color: #334155; }
.ct-person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.ct-name { font-weight: 700; color: var(--text); }
a.ct-name:hover { color: var(--primary); }
.ct-phone { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-phone:hover { color: var(--primary); text-decoration: none; }

/* ---- سێرڤەر و ئامێر */
.ct-servers { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.ct-server {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    padding-inline-start: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 12.5px;
    white-space: nowrap;
}
.ct-server > svg { color: #94a3b8; flex: 0 0 auto; }
.ct-server-name { font-weight: 700; color: #1e293b; }
.ct-server-qty {
    padding: 0 7px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    font-variant-numeric: tabular-nums;
}
.ct-devices { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; }
.ct-with-customer { display: inline-flex; align-items: center; gap: 4px; color: #6d28d9; font-weight: 600; }

/* ---- ماوەی خزمەتگوزاری */
.ct-period { min-width: 150px; max-width: 220px; }
.ct-dates { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; color: #475569; }
.ct-dates .ct-end { font-weight: 800; color: var(--text); }
.ct-arrow { color: #94a3b8; flex: 0 0 auto; }
[dir="rtl"] .ct-arrow { transform: scaleX(-1); }
.ct-period.is-ok .ct-end { color: #047857; }
.ct-period.is-soon .ct-end { color: #b45309; }
.ct-period.is-expired .ct-end { color: #b91c1c; }
.ct-days { display: inline-block; margin-top: 2px; font-size: 11.5px; font-weight: 700; }
.ct-period.is-ok .ct-days { color: #047857; }
.ct-period.is-soon .ct-days { color: #b45309; }
.ct-period.is-expired .ct-days { color: #b91c1c; }
/* گرێبەستی چەند سێرڤەر: هەر سێرڤەرێک بلۆکی خۆی (ناو + ڕۆژی ماوە، بەروار، هێڵ) */
.ct-period + .ct-period { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.ct-period-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 1px; }
.ct-period-head .ct-days { margin-top: 0; font-size: 11px; white-space: nowrap; }
.ct-period-server { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #1e293b; white-space: nowrap; }
.ct-period-server i { width: 7px; height: 7px; border-radius: 50%; background: #10b981; flex: 0 0 auto; }
.ct-period.is-soon .ct-period-server i { background: #f59e0b; }
.ct-period.is-expired .ct-period-server i { background: #ef4444; }
.ct-period-head + .ct-dates { font-size: 12px; }
.ct-period-head ~ .ct-meter { margin-bottom: 0; }

/* هێڵی ڕێژە (ماوە / پارەدان / تائمینات) */
.ct-meter {
    display: flex;
    height: 5px;
    margin: 6px 0 4px;
    border-radius: 999px;
    background: #edf1f5;
    overflow: hidden;
}
.ct-meter > span {
    display: block;
    width: var(--p, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2dd4bf, #0d9488);
}
.ct-period.is-soon .ct-meter > span { background: linear-gradient(90deg, #fcd34d, #f59e0b); }
.ct-period.is-expired .ct-meter > span { background: linear-gradient(90deg, #fca5a5, #ef4444); }
.ct-meter.is-pay > span { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.ct-meter.is-deposit > span { background: linear-gradient(90deg, #fcd34d, #d97706); }
.ct-meter.is-full > span { background: linear-gradient(90deg, #34d399, #059669); }
.ct-num .ct-meter { width: 100%; max-width: 130px; margin-inline: auto; }

/* ---- بڕەکان */
.ct-amount { font-size: 15px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ct-amount.usd { color: #047857; }
.ct-amount.iqd { color: #1d4ed8; }
.ct-pct {
    display: inline-block;
    margin-inline-start: 4px;
    padding: 0 5px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #475569;
    font-size: 10.5px;
    font-weight: 700;
}
.ct-due { font-size: 15px; font-weight: 800; color: #b91c1c; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ct-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.ct-flag.success { background: #ecfdf5; color: #047857; box-shadow: inset 0 0 0 1px #a7f3d0; }
.ct-flag.danger { background: #fef2f2; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.ct-flag.info { background: #eff6ff; color: #1d4ed8; box-shadow: inset 0 0 0 1px #bfdbfe; }
.ct-deposit { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 800; color: #b45309; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ct-refund { color: #0369a1; font-weight: 600; }
/* تائمینات لە نوێکردنەوەدا گوازراوەتەوە (دووبارە وەرنەگیراوە) */
.ct-deposit.is-moved { color: #94a3b8; }
.ct-carry { color: #6d28d9; font-weight: 600; }
.ct-carry a { color: inherit; font-weight: 800; }

/* ---- دۆخ */
.ct-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    background: #f1f5f9;
    color: #475569;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}
.ct-status.is-active { background: #ecfdf5; color: #047857; box-shadow: inset 0 0 0 1px #a7f3d0; }
.ct-status.is-expiring { background: #fffbeb; color: #b45309; box-shadow: inset 0 0 0 1px #fde68a; }
.ct-status.is-expired { background: #fef2f2; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.ct-status.is-renewed { background: #f5f3ff; color: #6d28d9; box-shadow: inset 0 0 0 1px #ddd6fe; }
.ct-status.is-active .ct-dot { box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.ct-status.is-expiring .ct-dot { box-shadow: 0 0 0 3px rgba(245, 158, 11, .22); }
.ct-status.is-expired .ct-dot { box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }

/* ---- کردارەکان */
.ct-table .ct-c-actions { width: 1%; white-space: nowrap; }
.ct-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ct-icon-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: #475569;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.ct-icon-btn:hover {
    background: #f0fdfa;
    border-color: #99f6e4;
    color: var(--primary);
    text-decoration: none;
    box-shadow: 0 2px 6px -2px rgba(15, 118, 110, .35);
}

/* ---- دۆخی بەتاڵ */
.ct-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 44px 20px; text-align: center; }
.ct-empty-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 6px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    color: #94a3b8;
}
.ct-empty-title { margin: 0; font-size: 15px; font-weight: 700; }
.ct-empty-hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }

/* ---- پانی مامناوەند (لاپتۆپ): خانەکان چڕتر دەبن بۆ ئەوەی سکڕۆڵ نەبێت */
@container ctlist (max-width: 1200px) {
    .ct-table thead th, .ct-table tbody td { padding-inline: 8px; }
    /* دوگمەکانی بینین/دەستکاری لەسەر یەک — ستوونی کۆتایی تەسک دەبێت و سکڕۆڵی ئاسۆیی نابێت */
    .ct-table td.ct-c-actions .ct-actions { flex-direction: column; align-items: center; }
    .ct-table td.ct-c-contract { padding-inline-start: 16px; }
    .ct-period { min-width: 0; }
    .ct-dates { flex-wrap: wrap; row-gap: 0; }
    .ct-server > svg { display: none; }
    .ct-num .ct-meter { max-width: 110px; }
}

/* ---- کارتی تەسک: هەر گرێبەستێک دەبێتە کارتێک */
@container ctlist (max-width: 1040px) {
    .ct-table, .ct-table tbody { display: block; }
    .ct-table thead { display: none; }
    .ct-table tbody tr {
        position: relative;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 14px 18px;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        transition: background .15s;
    }
    .ct-table tbody tr:last-child { border-bottom: none; }
    .ct-table tbody tr:hover { background: #f7fbfa; }
    .ct-table tbody td,
    .ct-table tbody tr:hover td { display: block; padding: 0; border: none; background: transparent; }
    .ct-table td.ct-num { text-align: start; }
    .ct-num .ct-meter { margin-inline: 0; }
    .ct-table tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-size: 11px;
        font-weight: 700;
        color: #94a3b8;
    }
    .ct-table td.ct-c-contract {
        position: static;
        grid-column: 1 / -1;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 10px;
        padding-inline-end: 90px;
    }
    .ct-table td.ct-c-contract .ct-tags { margin-top: 0; }
    .ct-table td.ct-c-contract .ct-renew { flex-basis: 100%; margin-top: 0; }
    .ct-accent { inset-block: 14px; }
    .ct-table td.ct-c-actions { position: absolute; top: 12px; inset-inline-end: 16px; width: auto; }
}

/* مۆبایل: کڕیار/سێرڤەر/ماوە پانی تەواو، بڕەکان دوو بە دوو */
@container ctlist (max-width: 520px) {
    .ct-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; padding: 14px 16px; }
    .ct-table td.ct-c-account,
    .ct-table td.ct-c-servers,
    .ct-table td.ct-c-period { grid-column: 1 / -1; }
    .ct-period { max-width: none; }
}






/* ==========================================================================
   فۆرمی گرێبەست (دروستکردن / دەستکاری / نوێکردنەوە) — .cf-*
   هەنگاوەکان + بەشەکان بە ئایکۆن + ڕیزەکان وەک کارت + شریتی جێگیری خوارەوە
   (کۆی گرێبەست و دوگمەکانی پاشەکەوت هەمیشە دیارن).
   ========================================================================== */

/* ---- سەرپەڕەی لاپەڕە */
.cf-page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.cf-page-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cf-page-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0f766e, #0ea5e9);
    color: #fff;
    box-shadow: 0 12px 24px -12px rgba(15, 118, 110, .75);
}
.cf-crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cf-crumbs a { color: var(--muted); }
.cf-crumbs a:hover { color: var(--primary); text-decoration: none; }
.cf-crumbs svg { color: #cbd5e1; }
[dir="rtl"] .cf-crumbs svg { transform: scaleX(-1); }
.cf-page-head h2 { margin: 2px 0 0; font-size: 21px; font-weight: 800; line-height: 1.3; }
.cf-page-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.cf-page-head .spacer { flex: 1; }

/* ---- کارت */
.cf .cf-card { --radius: 16px; }

/* ---- هەنگاوەکان */
.tabs.form-tabs.cf-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    background: #fbfdfd;
    border-bottom: 1px solid var(--border);
}
.tabs.form-tabs.cf-steps button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 16px 22px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    text-align: start;
    transition: background .15s, color .15s;
}
.tabs.form-tabs.cf-steps button + button { box-shadow: inset 1px 0 0 var(--border); }
[dir="rtl"] .tabs.form-tabs.cf-steps button + button { box-shadow: inset -1px 0 0 var(--border); }
.tabs.form-tabs.cf-steps button::after {
    content: "";
    position: absolute;
    inset-inline: 14px;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
    transition: background .2s;
}
.tabs.form-tabs.cf-steps button:hover { background: #f4f8f8; color: var(--text); }
.tabs.form-tabs.cf-steps button.active { background: #fff; color: var(--text); }
.tabs.form-tabs.cf-steps button.active::after { background: var(--primary); }
.tabs.form-tabs.cf-steps .step {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
    transition: background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.tabs.form-tabs.cf-steps button.active .step {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 5px rgba(15, 118, 110, .14);
}
/* هەنگاوی تەواوبوو: ✓ لە شوێنی ژمارە */
.tabs.form-tabs.cf-steps button.is-done .step {
    border-color: #34d399;
    background: #ecfdf5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 16px no-repeat;
    color: transparent;
}
.tabs.form-tabs.cf-steps button.has-error { color: var(--danger); }
.tabs.form-tabs.cf-steps button.has-error .step { border-color: var(--danger); background: var(--danger); color: #fff; box-shadow: none; }
.cf-step-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.cf-step-text strong { font-size: 14px; font-weight: 800; color: inherit; }
.cf-step-text small { font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- بەشەکان */
.cf .form-block.cf-section { padding: 24px 26px; }
.cf-section-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.cf-section-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #e2e8f0;
    color: #334155;
}
.cf-section-icon.is-teal { background: #ccfbf1; color: #0f766e; }
.cf-section-icon.is-blue { background: #dbeafe; color: #1d4ed8; }
.cf-section-icon.is-green { background: #dcfce7; color: #15803d; }
.cf-section-icon.is-amber { background: #fef3c7; color: #b45309; }
.cf-section-icon.is-violet { background: #ede9fe; color: #6d28d9; }
.cf-section-icon.is-rose { background: #ffe4e6; color: #be123c; }
.cf-section-title { min-width: 0; }
.cf-section-title h3 { margin: 0; font-size: 15.5px; font-weight: 800; color: var(--text); }
.cf-section-title p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }

/* ---- خانەکان */
.cf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; }
.cf-span-2 { grid-column: span 2; }
.cf .field label { font-size: 12.5px; font-weight: 700; color: #334155; }
.cf input[type=text], .cf input[type=number], .cf input[type=date], .cf select, .cf textarea {
    min-height: 42px;
    border-color: #dbe2ea;
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.cf input:hover:not(:focus):not(:disabled), .cf select:hover:not(:focus) { border-color: #c4ced9; }
.cf textarea { min-height: 112px; line-height: 1.7; }

.cf-input-icon { position: relative; }
.cf-input-icon > svg {
    position: absolute;
    top: 50%;
    inset-inline-start: 12px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.cf-input-icon > select, .cf-input-icon > input { padding-inline-start: 38px; }
.cf-input-icon > svg { z-index: 2; }
.cf-input-icon > .ss .ss-input { padding-inline-start: 38px; }

/* لیستی گەڕانکراو (select[data-searchable]) — بۆ 1000+ کڕیار */
.ss { position: relative; width: 100%; }
.ss-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}
.ss .ss-input { width: 100%; padding-inline-end: 32px; cursor: text; }
.ss::after {
    content: '';
    position: absolute;
    top: 50%;
    inset-inline-end: 13px;
    width: 7px;
    height: 7px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
    transition: transform .15s;
}
.ss.is-open::after { transform: translateY(-20%) rotate(225deg); }
.ss-list {
    position: absolute;
    z-index: 60;
    top: calc(100% + 4px);
    inset-inline: 0;
    max-height: 300px;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
}
.ss-list[hidden] { display: none; }
.ss-option {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13.5px;
    line-height: 1.5;
    cursor: pointer;
}
.ss-option small { flex-shrink: 0; color: var(--muted); font-size: 12px; direction: ltr; }
.ss-option.is-active { background: #f0fdfa; color: var(--primary); }
.ss-option.is-selected { font-weight: 700; }
.ss-empty, .ss-more { padding: 8px 10px; color: var(--muted); font-size: 12.5px; }
.ss-more { border-top: 1px dashed var(--border); margin-top: 4px; }

/* ژمارەی گرێبەست: پێشگر + ژمارە (هەمیشە چەپ بۆ ڕاست: NS-1004) */
.cf-no-group {
    direction: ltr;
    display: flex;
    align-items: stretch;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.cf-no-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .13); }
.cf-no-group.is-invalid { border-color: var(--danger); }
.cf .cf-no-group input { min-height: 40px; border: 0; border-radius: 0; box-shadow: none; }
.cf .cf-no-group .cf-no-prefix {
    width: 96px;
    flex: 0 0 96px;
    background: #f8fafc;
    text-align: center;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .05em;
    color: var(--primary-dark);
}
.cf-no-sep { display: grid; place-items: center; padding: 0 2px; background: #f8fafc; color: #94a3b8; font-weight: 800; }
.cf .cf-no-group .cf-no-number { flex: 1; min-width: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* سویچی چالاک */
.cf .field label.cf-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}
.cf-switch input[type=checkbox] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cf-switch-track {
    position: relative;
    width: 40px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background .2s;
}
.cf-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .3);
    transition: inset-inline-start .2s;
}
.cf-switch input:checked + .cf-switch-track { background: var(--primary); }
.cf-switch input:checked + .cf-switch-track::after { inset-inline-start: 21px; }
.cf-switch input:focus-visible + .cf-switch-track { box-shadow: 0 0 0 3px rgba(15, 118, 110, .25); }
.cf-switch-text { min-width: 0; line-height: 1.4; }

/* ڕێنمایی */
.cf-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 11px 14px;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    background: #f0f9ff;
    color: #075985;
    font-size: 12.5px;
    line-height: 1.7;
}
.cf-callout svg { flex: 0 0 auto; margin-top: 2px; }
.cf-note { display: flex; align-items: flex-start; gap: 8px; margin: -6px 0 14px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.cf-note svg { flex: 0 0 auto; margin-top: 3px; color: #94a3b8; }

/* ---- ڕیزەکانی گرێبەست (کارت) */
.cf-lines { display: flex; flex-direction: column; gap: 12px; counter-reset: cfline; }
.cf-line {
    position: relative;
    counter-increment: cfline;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
/* هێڵی ڕەنگی جۆر: شین = فرۆشتن، زەرد = ئەمانەت */
.cf-line::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
    background: #3b82f6;
    z-index: 1;
}
.cf-line:has([data-line-type] option[value="amanat"]:checked)::before { background: #f59e0b; }
.cf-line:focus-within { border-color: #99f6e4; box-shadow: 0 10px 24px -16px rgba(15, 118, 110, .55); }
/* لیستی پێشنیار (ناوی خزمەتگوزاری) دەبێت لە دەرەوەی کارتەکە دەربکەوێت — تەنها کاتێک کراوەیە */
.cf-line:has(.ss-list:not([hidden])) { overflow: visible; z-index: 5; }

.cf-line-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 14px;
    padding-inline-start: 18px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.cf-line-no {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    font-weight: 800;
    color: #475569;
    white-space: nowrap;
}
.cf-line-no::after { content: " " counter(cfline); }
.cf .cf-line .cf-line-type {
    width: auto;
    min-height: 34px;
    padding: 0 14px;
    border-color: #bfdbfe;
    border-radius: 999px;
    background-color: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.cf .cf-line:has([data-line-type] option[value="amanat"]:checked) .cf-line-type {
    border-color: #fde68a;
    background-color: #fffbeb;
    color: #92400e;
}
.cf-line-server { position: relative; display: block; flex: 0 1 230px; min-width: 160px; }
.cf-line-server > svg { position: absolute; top: 50%; inset-inline-start: 11px; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.cf .cf-line-server select { min-height: 34px; padding-inline-start: 32px; font-size: 13px; }
.cf-line-spacer { flex: 1; }
.cf-line-sums { display: flex; gap: 6px; }
.cf-line-sum {
    display: flex;
    flex-direction: column;
    min-width: 96px;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    line-height: 1.3;
}
.cf-line-sum small { font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cf-line-sum strong { font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cf-line-sum.is-device strong { color: #1d4ed8; }
.cf-line-sum.is-service strong { color: #0f766e; }
/* ئەمانەت: بڕی ئامێر هەمیشە ٠ ـە، بۆیە شاراوەیە */
.cf-line:has([data-line-type] option[value="amanat"]:checked) .cf-line-sum.is-device { display: none; }
.cf-line-remove {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.cf-line-remove:hover { border-color: #fecaca; background: #fef2f2; color: #dc2626; }

/* سێ بەشەکە: ئامێر | سێرڤەر | ئەمانەت — لە شاشەی تەسکدا خۆکار دەچنە ژێر یەک */
.cf-line-body { display: flex; flex-wrap: wrap; gap: 1px; background: var(--border); }
.cf-line-group { flex: 1 1 230px; min-width: 0; padding: 12px 16px 14px; background: #fff; }
.cf-line-group.is-service { flex: 2 1 400px; }
.cf-line-group.is-amanat { background: #fffdf6; }
.cf-line:not(:has([data-line-type] option[value="amanat"]:checked)) .cf-line-group.is-amanat { display: none; }
.cf-line-group-title { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; font-size: 11.5px; font-weight: 800; color: #64748b; }
.cf-line-group.is-device .cf-line-group-title svg { color: #2563eb; }
.cf-line-group.is-service .cf-line-group-title svg { color: #0d9488; }
.cf-line-group.is-amanat .cf-line-group-title svg { color: #d97706; }
.cf-line-fields { display: grid; gap: 10px; }
.cf-line-fields.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cf-line-fields.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* سێرڤەر: نرخ + خۆڕایی + دەستپێک + کۆتایی */
.cf-line-group.is-service { container: lineservice / inline-size; }
.cf-line-fields.cols-service { grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1.15fr) minmax(0, 1.15fr); }
.cf-free-service label { color: #15803d; }
.cf .cf-free-service input { border-color: #bbf7d0; }
.cf-free-service-note { font-size: 10.5px; font-weight: 700; color: #15803d; white-space: nowrap; }
.cf-free-service-note:empty { display: none; }
@container lineservice (max-width: 470px) {
    .cf-line-fields.cols-service { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.cf-mini { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cf-mini label { font-size: 11.5px; font-weight: 600; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf .cf-mini input { min-height: 38px; padding: 0 10px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cf .cf-mini input[type=date] { padding: 0 8px; font-size: 13px; }
.cf .cf-mini input:disabled { background: #f8fafc; color: #94a3b8; }
@media (max-width: 560px) {
    .cf-line-fields.cols-3 { grid-template-columns: 1fr; }
    .cf-line-sums { width: 100%; }
    .cf-line-sum { flex: 1; }
}

/* خزمەتگوزارییە زیادەکانی ڕیز: بەستن، Temperature، Fuel level … */
.cf-line-extras { padding: 12px 16px 14px; border-top: 1px solid var(--border); background: #fcfbff; }
.cf-line-extras-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 8px; }
.cf-line-extras-head .cf-line-group-title { margin-bottom: 0; }
.cf-line-extras-head .cf-line-group-title svg { color: #7c3aed; }
.cf-line-extras-hint { font-size: 11.5px; color: var(--muted); }
.cf-line-extras-sum { margin-inline-start: auto; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-line-extras-sum strong { color: #6d28d9; font-weight: 800; }
.cf-line-extras-sum em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }
.cf-line-extras.is-empty { background: #fff; }
.cf-line-extras.is-empty .cf-line-extras-sum,
.cf-line-extras.is-empty .cf-extras-list { display: none; }

.cf-extras-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.cf-line-extras { container: lineextras / inline-size; }
.cf-extra {
    display: grid;
    grid-template-columns: minmax(140px, 2fr) 64px minmax(110px, 1fr) minmax(130px, 1.2fr) auto minmax(84px, auto) 30px;
    grid-template-areas: "name qty price billing free total remove";
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #ede9fe;
    border-radius: 10px;
    background: #fff;
}
.cf .cf-extra input, .cf .cf-extra select { min-height: 34px; padding: 0 9px; font-size: 13px; }
.cf .cf-extra .cf-money input { padding-inline-end: 36px; }
.cf .cf-extra .cf-extra-billing { padding: 0 8px; font-weight: 700; color: #475569; }
.cf .cf-extra.is-monthly .cf-extra-billing { border-color: #c4b5fd; background-color: #f5f3ff; color: #6d28d9; }
.cf-extra-free { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 12.5px; font-weight: 700; color: #64748b; white-space: nowrap; cursor: pointer; }
.cf-extra-free input { width: 16px; height: 16px; min-height: 0; accent-color: #16a34a; }
.cf-extra-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-extra-total strong { font-size: 13.5px; font-weight: 800; color: #334155; }
.cf-extra-total small { font-size: 10.5px; color: var(--muted); }
.cf-extra-total small:empty { display: none; }
.cf-extra.is-free { background: #f7fef9; border-color: #bbf7d0; }
.cf-extra.is-free .cf-extra-price input { color: #94a3b8; text-decoration: line-through; }
.cf-extra.is-free .cf-extra-total strong { color: #16a34a; }
.cf-extra-remove {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}
.cf-extra-remove:hover { border-color: #fecaca; background: #fef2f2; color: #dc2626; }
.cf-extras-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1.5px dashed #c4b5fd;
    border-radius: 9px;
    background: #fff;
    color: #6d28d9;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}
.cf-extras-add:hover { border-color: #7c3aed; background: #f5f3ff; }

.cf-extra-name { grid-area: name; min-width: 0; position: relative; }
.cf-extra-name .ss-list { min-width: 220px; }
.cf-extra-qty { grid-area: qty; }
.cf-extra-price { grid-area: price; min-width: 0; }
.cf-extra-billing { grid-area: billing; min-width: 0; }
.cf-extra-free { grid-area: free; }
.cf-extra-total { grid-area: total; }
.cf-extra-remove { grid-area: remove; }

/* ڕیزی تەسک: ناو + کۆ لە سەرەوە، خانەکانی تر لە خوارەوە */
@container lineextras (max-width: 760px) {
    .cf-extra {
        grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.3fr) auto 30px;
        grid-template-areas:
            "name name name total remove"
            "qty price billing free free";
        row-gap: 6px;
    }
}

@container lineextras (max-width: 440px) {
    .cf-extra {
        grid-template-columns: 64px minmax(0, 1fr) 30px;
        grid-template-areas:
            "name name remove"
            "qty price price"
            "billing billing free"
            "total total total";
    }
    .cf-extra-free { justify-self: end; }
    .cf-extra-total { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 8px; }
}

/* تابی ١ و ٢: کۆی خزمەتگوزارییە زیادەکان */
.cf-ledger-grid .is-extras { background: #f5f3ff; }
.cf-ledger-grid .is-extras strong { color: #6d28d9; }
.cf-pay-table:not(.has-extras) .is-extras { display: none; }
.cf-pay-table td.is-extras { color: #6d28d9; }

/* زیادکردنی ڕیز / وادە */
.cf-add-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 11px 16px;
    border: 1.5px dashed #c4ced9;
    border-radius: 12px;
    background: #fbfdfd;
    color: var(--primary);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.cf-add-line:hover { border-color: var(--primary); background: #f0fdfa; }
.cf-add-line.is-inline { display: inline-flex; width: auto; margin-top: 0; padding: 8px 16px; }
.cf-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; }

/* کۆی ڕیزەکان */
.cf-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.cf-total { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: #f8fafc; }
.cf-total > span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cf-total strong { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cf-total strong small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cf-total.is-deposit { border-color: #fde68a; background: #fffbeb; }
.cf-total.is-deposit strong { color: #b45309; }
.cf .hint { font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.cf-foot-hint { margin: 10px 0 0; }

/* ---- تابی پارەدان */
.cf .cf-pay { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.cf .cf-pay .pay-item {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 5px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
}
.cf .cf-pay .pay-item .pay-label { flex-basis: 100%; }
.cf .cf-pay .pay-item.total { border-color: transparent; background: linear-gradient(135deg, #0f766e, #0d9488); box-shadow: 0 10px 22px -14px rgba(15, 118, 110, .9); }
.cf .cf-pay .pay-item.total .pay-label, .cf .cf-pay .pay-item.total .pay-currency { color: rgba(255, 255, 255, .82); }
.cf .cf-pay .pay-item.total .pay-value { color: #fff; font-size: 20px; }
.cf .pay-state { margin: 12px 0 0; }
.cf-subblock { margin-top: 18px; padding: 14px 16px; border: 1px solid #fde68a; border-radius: 12px; background: #fffbeb; }
.cf-subblock-title { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; font-weight: 800; color: #92400e; }

.cf .cf-table-wrap { border-radius: 12px; }
.cf .cf-schedule-table thead th { padding: 10px 12px; font-size: 12px; font-weight: 700; text-align: start; }
.cf .cf-schedule-table td { padding: 8px 10px; }
.cf .cf-schedule-table td input { min-height: 38px; height: auto; text-align: start; }
.cf .cf-schedule-table tfoot th { padding: 10px 12px; text-align: start; }
.cf [data-remove-schedule] {
    width: 34px;
    height: 34px;
    border-color: transparent;
    background: transparent;
    color: #94a3b8;
}
.cf [data-remove-schedule]:hover { border-color: #fecaca; background: #fef2f2; color: #dc2626; }

/* ---- شریتی خوارەوە (جێگیر): ژمارە + جۆر + کۆکان + دوگمەکان */
.cf .form-actions.cf-bar {
    position: sticky;
    bottom: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    box-shadow: 0 -12px 24px -20px rgba(15, 23, 42, .45);
}
.cf-bar [hidden] { display: none !important; }
.cf-bar-info { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; min-width: 0; }
.cf-bar-id { display: flex; align-items: center; gap: 8px; }
.cf-bar-no {
    padding: 3px 10px;
    border: 1px solid #99f6e4;
    border-radius: 8px;
    background: #f0fdfa;
    color: var(--primary-dark);
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
}
.cf-bar-stats { display: flex; flex-wrap: wrap; gap: 6px 0; }
.cf-bar-stat { display: flex; flex-direction: column; padding-inline: 14px; border-inline-start: 1px solid var(--border); line-height: 1.3; }
.cf-bar-stat small { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cf-bar-stat strong { font-size: 15px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-bar-stat.is-total strong { color: var(--primary); }
.cf-bar-stat.is-deposit strong { color: #b45309; }
.cf-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.cf .cf-bar-actions .btn { min-width: 0; }
.cf-btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.cf-btn-ghost:hover { background: #f1f5f9; color: var(--text); }
.cf .cf-bar-actions .cf-save { padding-inline: 20px; box-shadow: 0 8px 18px -10px rgba(15, 118, 110, .85); }
[dir="ltr"] .cf-dir-icon { transform: scaleX(-1); }

/* ---- شاشەی تەسک */
@media (max-width: 900px) {
    .cf-grid { grid-template-columns: 1fr; }
    .cf-span-2 { grid-column: auto; }
    .tabs.form-tabs.cf-steps button { padding: 12px 10px; gap: 8px; }
    .cf-step-text small { display: none; }
    .cf .form-block.cf-section { padding: 18px 16px; }
}
@media (max-width: 560px) {
    .tabs.form-tabs.cf-steps button { flex-direction: column; text-align: center; }
    .cf-step-text strong { font-size: 12px; }
    .cf-bar-stat:not(.is-total) { display: none; }
    .cf-bar-actions { width: 100%; }
    .cf .cf-bar-actions .cf-save { flex: 1; justify-content: center; }
}

/* ==========================================================================
   گرێبەستی چەند دراو — هەر ڕیزێک دۆلار یان دینار، قەرزی جیا بۆ هەر دراوێک
   ========================================================================== */

/* هێمای دراو: سەوز = دۆلار، شین = دینار */
.cf-cur-chip {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 22px;
    padding: 0 6px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
    background: #f1f5f9;
    color: #334155;
}
.cf-cur-chip.is-usd { background: #dcfce7; color: #047857; }
.cf-cur-chip.is-iqd { background: #dbeafe; color: #1d4ed8; }

/* دراوی ڕیز (لە سەرەوەی کارتی ڕیز) */
.cf .cf-line .cf-line-currency {
    width: auto;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border-color: #a7f3d0;
    background-color: #ecfdf5;
    color: #047857;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.cf .cf-line[data-currency="IQD"] .cf-line-currency { border-color: #bfdbfe; background-color: #eff6ff; color: #1d4ed8; }

/* خانەی پارە + هێمای دراو */
.cf-money { position: relative; }
.cf .cf-money input { padding-inline-end: 42px; }
.cf-money-unit {
    position: absolute;
    top: 50%;
    inset-inline-end: 10px;
    transform: translateY(-50%);
    font-size: 11.5px;
    font-weight: 800;
    color: #94a3b8;
    pointer-events: none;
}
.cf-line[data-currency="USD"] .cf-money-unit { color: #059669; }
.cf-line[data-currency="IQD"] .cf-money-unit { color: #2563eb; }
.cf-line-sum em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }

/* کۆی هەر دراوێک (تابی ١) */
.cf-ledgers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.cf-ledger[hidden] { display: none; }
.cf-ledger {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    border-top: 3px solid #cbd5e1;
}
.cf-ledger.is-usd { border-top-color: #10b981; }
.cf-ledger.is-iqd { border-top-color: #3b82f6; }
.cf-ledger-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cf-ledger-head strong { font-size: 13.5px; }
.cf-ledger-head small { margin-inline-start: auto; font-size: 11px; color: var(--muted); font-weight: 600; }
.cf-ledger-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.cf-ledger-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: #f8fafc; }
.cf-ledger-grid > div[hidden] { display: none; }
.cf-ledger-grid small { font-size: 11px; font-weight: 600; color: var(--muted); }
.cf-ledger-grid strong { font-size: 14.5px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-ledger-grid .is-total { background: #f0fdfa; }
.cf-ledger-grid .is-total strong { color: var(--primary); }
.cf-ledger-grid .is-deposit { background: #fffbeb; }
.cf-ledger-grid .is-deposit strong { color: #b45309; }

/* خشتەی پارەدان بەپێی دراو (تابی ٢) */
.cf-pay-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.cf-pay-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cf-pay-table th, .cf-pay-table td { padding: 11px 14px; border-bottom: 1px solid #edf1f5; white-space: nowrap; text-align: start; }
.cf-pay-table thead th { background: #f8fafc; font-size: 12px; font-weight: 700; color: #64748b; }
.cf-pay-table tbody tr:last-child th, .cf-pay-table tbody tr:last-child td { border-bottom: none; }
.cf-pay-table tbody tr[hidden] { display: none; }
.cf-pay-table tbody th { font-weight: 700; }
.cf-pay-table tbody th .cf-cur-chip { margin-inline-end: 6px; }
.cf-pay-table .num { text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.cf-pay-table td.is-total { color: var(--primary); font-weight: 800; background: #f7fdfc; }
.cf-pay-table td.is-due { color: #b45309; }

/* داشکان (تابی ٢): هەر دراوێک ڕیزێک — جۆر (بڕ / ٪) + بڕ + ئەنجام */
.cf-ledger-grid .is-discount { background: #fff1f2; }
.cf-ledger-grid .is-discount strong { color: #be123c; }
.cf-pay-table td.is-discount { color: #be123c; }

.cf-discount-optional { font-size: 12px; font-weight: 600; color: var(--muted); }
.cf-discounts { display: grid; gap: 10px; }
.cf-discount[hidden] { display: none; }
.cf-discount {
    display: grid;
    grid-template-columns: minmax(120px, auto) auto minmax(140px, 200px) 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-inline-start: 3px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
}
.cf-discount.is-usd { border-inline-start-color: #10b981; }
.cf-discount.is-iqd { border-inline-start-color: #3b82f6; }
.cf-discount.is-over { border-color: #fecdd3; background: #fff7f8; }
.cf-discount-cur { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }

/* جۆری داشکان: دوو دوگمەی پێکەوە (segmented) */
.cf-discount-type {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}
.cf-discount-type label { position: relative; margin: 0; cursor: pointer; }
.cf-discount-type input { position: absolute; opacity: 0; pointer-events: none; }
.cf-discount-type span {
    display: block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
}
.cf-discount-type input:checked + span { background: #fff; color: #be123c; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.cf-discount-type input:focus-visible + span { outline: 2px solid #fda4af; outline-offset: 1px; }

.cf-discount-value .cf-money-unit { color: #be123c; }
.cf-discount-result {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.cf-discount-result span { color: #94a3b8; text-decoration: line-through; }
.cf-discount-result b { color: #be123c; }
.cf-discount-result strong { color: var(--primary); font-size: 14.5px; font-weight: 800; }
.cf-discount-result em { font-style: normal; font-size: 12px; color: var(--muted); }
.cf-discount-error { grid-column: 1 / -1; }

@media (max-width: 760px) {
    .cf-discount { grid-template-columns: 1fr auto; }
    .cf-discount-value, .cf-discount-result { grid-column: 1 / -1; }
    .cf-discount-result { justify-content: flex-start; }
}

/* بڕی وادە + دراوەکەی لە یەک خانەدا */
.cf-amount-cur { display: flex; gap: 6px; }
.cf-amount-cur input { flex: 1; min-width: 0; }
.cf .cf-amount-cur select { width: 68px; flex: 0 0 68px; padding: 0 6px; font-weight: 800; text-align: center; }

/* لیستی گرێبەستەکان: هەر دراوێک بە جیا لە هەمان خانەدا */
.ct-ledger-cell + .ct-ledger-cell { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.ct-c-due .ct-due + .ct-due { margin-top: 4px; }

.money.discount { color: #be123c; }
.strike { text-decoration: line-through; color: #94a3b8; }

.ct-discount { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ct-discount s { color: #94a3b8; font-weight: 600; }
.ct-discount span { color: #be123c; }

/* لاپەڕەی گرێبەست: هەر دراوێک بلۆکی خۆی */
.sc-ledger + .sc-ledger { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.sc-ledger-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; }


/* ==========================================================================
   داشبۆرد (.db-*) — بەخێرهاتن، ژمارەکان، صندوقی هەر دراوێک، وادەکان، چارت
   ⚠️ چارت: یەک دراو لە یەک کاتدا (دۆلار و دینار پێوەری جیاوازیان هەیە).
   ========================================================================== */
.db { display: flex; flex-direction: column; gap: 18px; container: dashboard / inline-size; }

/* ---- بەخێرهاتن */
.db-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding: 22px 26px;
    border-radius: 18px;
    background: radial-gradient(120% 160% at 100% 0%, #134e4a 0%, #0f766e 48%, #0e7490 100%);
    color: #f0fdfa;
    box-shadow: 0 14px 32px -20px rgba(15, 118, 110, .9);
}
.db-hero::before,
.db-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    pointer-events: none;
}
.db-hero::before { width: 280px; height: 280px; inset-inline-end: -90px; top: -120px; }
.db-hero::after { width: 160px; height: 160px; inset-inline-end: 140px; bottom: -110px; }
.db-hero-text { position: relative; z-index: 1; min-width: 0; }
.db-hero-text h1 { margin: 6px 0 2px; font-size: 22px; font-weight: 800; line-height: 1.35; color: #fff; }
.db-hero-text p { margin: 0; font-size: 13.5px; color: rgba(240, 253, 250, .82); }
.db-hero-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .13);
    font-size: 12px;
    font-weight: 700;
    color: #ccfbf1;
}
.db-hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.db-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 11px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    transition: background .15s, transform .15s;
}
.db-action:hover { background: rgba(255, 255, 255, .2); text-decoration: none; transform: translateY(-1px); }
.db-action.is-primary { border-color: #fff; background: #fff; color: var(--primary-dark); box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .45); }
.db-action.is-primary:hover { background: #f0fdfa; }

/* ---- کارتی ژمارەکان */
.db-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 14px; }
.db-kpi {
    --kpi: #0f766e;
    --kpi-soft: #ccfbf1;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "icon label" "icon value" "sub sub";
    column-gap: 12px;
    padding: 16px 18px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.db-kpi::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--kpi); }
a.db-kpi:hover { text-decoration: none; border-color: #cbd5e1; box-shadow: 0 12px 26px -18px rgba(15, 23, 42, .45); transform: translateY(-1px); }
a.db-kpi:focus-visible { outline: 2px solid var(--kpi); outline-offset: 2px; }
.db-kpi-icon {
    grid-area: icon;
    align-self: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--kpi-soft);
    color: var(--kpi);
}
.db-kpi-label { grid-area: label; align-self: end; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.db-kpi-value { grid-area: value; font-size: 27px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.db-kpi-sub { grid-area: sub; margin-top: 11px; padding-top: 9px; border-top: 1px solid #f1f5f9; font-size: 12px; color: var(--muted); }
.db-kpi.is-green { --kpi: #059669; --kpi-soft: #d1fae5; }
.db-kpi.is-amber { --kpi: #d97706; --kpi-soft: #fef3c7; }
.db-kpi.is-red { --kpi: #dc2626; --kpi-soft: #fee2e2; }
.db-kpi.is-violet { --kpi: #7c3aed; --kpi-soft: #ede9fe; }

/* ---- پێویستی بە سەرنجە */
.db-attention { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 14px; }
.db-alert { padding: 14px 16px; border: 1px solid; border-radius: 16px; }
.db-alert.is-danger { background: #fff5f5; border-color: #fecaca; }
.db-alert.is-warning { background: #fffbeb; border-color: #fde68a; }
.db-alert-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; font-size: 14px; line-height: 1.5; }
.db-alert.is-danger .db-alert-head strong { color: #991b1b; }
.db-alert.is-warning .db-alert-head strong { color: #92400e; }
.db-alert-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.db-alert-list li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 8px 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .8);
    font-size: 13px;
}
.db-alert-who { color: var(--muted); }
.db-alert-amount { margin-inline-start: auto; font-weight: 800; white-space: nowrap; }
.db-alert-more { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
a.db-alert-more { color: var(--primary); }

/* ---- نیشانەی بچووک */
.db-pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: #f1f5f9; color: #475569; }
.db-pill.is-amber { background: #fef3c7; color: #92400e; }
.db-pill.is-red { background: #fee2e2; color: #991b1b; }
.db-pill.is-green { background: #d1fae5; color: #065f46; }
.db-pill.is-teal { background: #ccfbf1; color: #115e59; }
a.db-pill:hover { text-decoration: none; filter: brightness(.96); }

/* ---- بەش (صندوقەکان) */
.db-section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; }
.db-section-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.db-section-head h2 svg { color: var(--primary); }
.db-section-head p { margin: 0; font-size: 12.5px; color: var(--muted); }

.db-money-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 14px; }
.db-money {
    --cur: #94a3b8;
    --cur-ink: #334155;
    --cur-soft: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--cur);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.db-money.is-usd { --cur: #10b981; --cur-ink: #047857; --cur-soft: #ecfdf5; }
.db-money.is-iqd { --cur: #3b82f6; --cur-ink: #1d4ed8; --cur-soft: #eff6ff; }
.db-money-head { display: flex; align-items: center; gap: 8px; }
.db-money-head strong { font-size: 15px; }
.db-money-count { margin-inline-start: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.db-cash { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 13px; background: var(--cur-soft); }
.db-cash-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.db-cash-value { font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; color: var(--cur-ink); font-variant-numeric: tabular-nums; }
.db-cash-split { font-size: 12px; color: var(--muted); }
.db-money-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.db-money-stats > div { padding: 10px 12px; border: 1px solid #edf1f5; border-radius: 12px; }
.db-money-stats dt { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.db-money-stats dd { margin: 2px 0 0; font-size: 16px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-money-stats dd small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.db-money-stats dd small.db-change-out { color: #b45309; }
.db-money-stats dd.is-paid { color: #047857; }
.db-money-stats dd.is-due { color: #b91c1c; }
.db-money-stats dd.is-zero { color: #94a3b8; }
.db-meter { display: flex; align-items: center; gap: 10px; }
.db-meter-track { flex: 1; height: 8px; overflow: hidden; border-radius: 999px; background: #eef2f6; }
.db-meter-track span { display: block; width: var(--p); height: 100%; border-radius: 999px; background: var(--cur); }
.db-meter-text { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.db-money-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; padding-top: 10px; border-top: 1px solid #f1f5f9; font-size: 12.5px; color: var(--muted); }
.db-money-foot strong { color: var(--text); }

/* ---- تەختەکان */
.db-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.db-grid-2.is-wide-first { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.db-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.db-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.db-panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 14px 16px; border-bottom: 1px solid #edf1f5; }
.db-panel-head h3 { margin: 0; font-size: 14.5px; font-weight: 800; line-height: 1.4; }
.db-panel-head .spacer { flex: 1; }
.db-panel-title { display: flex; flex-direction: column; min-width: 0; }
.db-panel-title p { margin: 0; font-size: 11.5px; color: var(--muted); }
.db-panel-icon { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; font-size: 15px; background: #f1f5f9; }
.db-panel-icon.is-amber { background: #fef3c7; }
.db-panel-icon.is-red { background: #fee2e2; }
.db-panel-icon.is-teal { background: #ccfbf1; }
.db-panel-icon.is-blue { background: #dbeafe; }
.db-panel-icon.is-violet { background: #ede9fe; }
.db-count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.db-count.is-amber { background: #fef3c7; color: #92400e; }
.db-count.is-red { background: #fee2e2; color: #991b1b; }
.db-panel-totals { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.db-link { font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* ---- ڕیزەکانی لیست */
.db-list { margin: 0; padding: 4px 0; list-style: none; }
.db-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #f1f5f9; transition: background .12s; }
.db-row:last-child { border-bottom: none; }
.db-row:hover { background: #fafcfd; }
.db-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.db-no { font-size: 13.5px; font-weight: 800; }
.db-row-sub { overflow: hidden; font-size: 12px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.db-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: end; }
.db-row-amount { font-size: 13.5px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-row-due { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.db-phone { color: var(--muted); }
.db-phone:hover { color: var(--primary); }
.db-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ccfbf1, #dbeafe);
    color: var(--primary-dark);
    font-weight: 800;
}
.db-date, .db-days {
    width: 54px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 2px;
    border: 1px solid #edf1f5;
    border-radius: 11px;
    background: #f8fafc;
    line-height: 1.15;
}
.db-date strong, .db-days strong { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.db-date small, .db-days small { max-width: 50px; font-size: 9.5px; font-weight: 700; line-height: 1.15; color: var(--muted); text-align: center; }
.db-date.is-late, .db-days.is-hot { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.db-date.is-today { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.db-rank { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; background: #f1f5f9; color: #475569; font-size: 13px; font-weight: 800; }
.db-list > li:first-child .db-rank { background: #fee2e2; color: #b91c1c; }
.db-empty { padding: 26px 16px; color: var(--muted); font-size: 13px; text-align: center; list-style: none; }
.db-empty.is-good { color: #047857; }

/* ---- ڕووداوەکان */
.db-feed { margin: 0; padding: 8px 16px 10px; list-style: none; }
.db-feed li { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.db-feed li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 5px; top: 24px; bottom: -8px; width: 2px; background: #eef2f6; }
.db-feed-dot { width: 12px; height: 12px; flex: 0 0 auto; margin-top: 6px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 3px #fff, 0 0 0 4px #e2e8f0; }
.db-feed-dot.is-success { background: #10b981; }
.db-feed-dot.is-info { background: #3b82f6; }
.db-feed-dot.is-warning { background: #f59e0b; }
.db-feed-dot.is-danger { background: #ef4444; }
.db-feed-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.db-feed-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* ---- چارتی پارەدانی مانگانە (یەک زنجیرە، یەک تەوەر) */
.db-toggle { margin-inline-start: auto; display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.db-toggle button { padding: 5px 12px; border: 0; border-radius: 8px; background: transparent; color: #64748b; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.db-toggle button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.db-toggle button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.db-chart-panel { --bar: #10b981; --bar-hover: #047857; padding: 14px 18px 16px; }
.db-chart-panel[hidden] { display: none; }
.db-chart-panel.is-iqd { --bar: #3b82f6; --bar-hover: #1d4ed8; }
.db-chart-summary { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 18px; }
.db-chart-summary span { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.db-chart-summary strong { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.db-plot { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 200px auto; column-gap: 10px; padding-top: 26px; }
.db-yaxis { position: relative; grid-row: 1; grid-column: 1; min-width: 34px; }
.db-yaxis span { position: absolute; inset-inline-end: 0; bottom: var(--y); transform: translateY(50%); font-size: 10.5px; color: #94a3b8; white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-bars {
    position: relative;
    grid-row: 1;
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    align-items: end;
    border-bottom: 1px solid #cbd5e1;
    background-image: linear-gradient(to top, #eef2f6 1px, transparent 1px);
    background-size: 100% calc(100% / var(--rows));
    background-position: bottom;
    box-shadow: inset 0 1px 0 #eef2f6;
}
.db-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.db-bar { width: min(24px, 58%); height: var(--h); border-radius: 4px 4px 0 0; background: var(--bar); transition: background .15s; }
.db-col:hover .db-bar, .db-col:focus-visible .db-bar { background: var(--bar-hover); }
.db-bar-label { position: absolute; bottom: calc(var(--h) + 4px); font-size: 11px; font-weight: 800; color: #334155; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* هاوکاری: کرتە/هێنانی ماوس → بڕی تەواو */
.db-col::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(var(--h) + 22px);
    z-index: 3;
    padding: 5px 10px;
    border-radius: 8px;
    background: #0f172a;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity .12s, transform .12s;
}
.db-col:hover::after, .db-col:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.db-col:first-child::after { left: auto; inset-inline-start: 0; transform: translateY(4px); }
.db-col:last-child::after { left: auto; inset-inline-end: 0; transform: translateY(4px); }
.db-col:first-child:hover::after, .db-col:first-child:focus-visible::after,
.db-col:last-child:hover::after, .db-col:last-child:focus-visible::after { transform: none; }
.db-xaxis { grid-row: 2; grid-column: 2; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); margin-top: 7px; }
.db-xaxis span { padding: 0 2px; font-size: 11px; line-height: 1.25; color: #64748b; text-align: center; overflow-wrap: anywhere; }
.db-xaxis span.is-current { color: var(--text); font-weight: 800; }

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- خشتەی ئەمانەت */
.db-table-wrap { overflow-x: auto; }
.db-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.db-table th { padding: 9px 14px; border-bottom: 1px solid #edf1f5; background: #f8fafc; color: #64748b; font-size: 11.5px; font-weight: 700; text-align: start; white-space: nowrap; }
.db-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.db-table tbody tr:last-child td { border-bottom: none; }
.db-table .num { text-align: center; font-variant-numeric: tabular-nums; }
.db-table td.is-due { color: #b91c1c; font-weight: 700; }
.db-table td.is-zero { color: #94a3b8; }
.db-table td.is-strong { font-weight: 800; }

/* ---- قەبارەی کارت (container query) */
@container dashboard (max-width: 1180px) {
    .db-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .db-grid-3 > :last-child { grid-column: 1 / -1; }
    /* ڕووداوەکان بە هەموو پانییەکە: دوو ستوون بۆ ئەوەی شوێنی بەتاڵ نەمێنێت */
    .db-grid-3 > :last-child .db-feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
    .db-grid-3 > :last-child .db-feed li::after { display: none; }
}
@container dashboard (max-width: 880px) {
    .db-grid-2, .db-grid-2.is-wide-first, .db-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .db-grid-3 > :last-child { grid-column: auto; }
    .db-grid-3 > :last-child .db-feed { display: block; }
    .db-grid-3 > :last-child .db-feed li:not(:last-child)::after { display: block; }
}
@container dashboard (max-width: 560px) {
    .db-hero { padding: 18px; }
    .db-hero-text h1 { font-size: 19px; }
    .db-hero-actions { width: 100%; }
    .db-action { flex: 1; justify-content: center; }
    /* کارتی ژمارەکان: دوو ستوون لە مۆبایل */
    .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .db-kpi { grid-template-areas: "icon value" "label label" "sub sub"; padding: 13px 13px 11px; column-gap: 10px; }
    .db-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .db-kpi-icon { width: 38px; height: 38px; border-radius: 11px; }
    .db-kpi-label { margin-top: 6px; }
    .db-kpi-value { align-self: center; font-size: 23px; }
    .db-kpi-sub { margin-top: 8px; padding-top: 7px; font-size: 11.5px; }
    .db-cash-value { font-size: 24px; }
    .db-money-stats dd { font-size: 14.5px; }
    .db-row { padding: 10px 12px; gap: 10px; }
    .db-plot { grid-template-rows: 170px auto; }
}

/* پەڕەی نوێکردنەوە: قەرزی کۆن خۆکار دەگوازرێتەوە */
.renew-carry-note { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: #0f766e; }

/* گواستنەوەی قەرز (نوێکردنەوە): پارەدان نییە — ڕەنگی مۆر و هێڵی لار */
.ct-meter > span.is-moved,
.progress > span.is-moved { border-radius: 0; background: repeating-linear-gradient(45deg, #a78bfa 0 4px, #c4b5fd 4px 8px); }
.ct-sub.ct-moved, .ct-sub.ct-moved strong { color: #6d28d9; }
.ct-sub.ct-carried, .ct-sub.ct-carried strong { color: #b45309; }
/* دێڕی گواستنەوە دەتوانێت بشکێت — ستوونەکە پان نابێت و خشتەکە سکڕۆڵی ئاسۆیی نابێت */
.ct-sub.ct-moved, .ct-sub.ct-carried { white-space: normal; }
.ct-sub.ct-moved strong, .ct-sub.ct-carried strong { white-space: nowrap; }
.ct-c-due .ct-flag.moved { flex-wrap: wrap; justify-content: center; white-space: normal; text-align: center; }
.ct-flag.moved { background: #f5f3ff; color: #6d28d9; box-shadow: inset 0 0 0 1px #ddd6fe; }
a.ct-flag.moved:hover { text-decoration: none; background: #ede9fe; }
.money.moved { color: #6d28d9; }
.badge.moved { background: #ede9fe; color: #6d28d9; }

/* ==========================================================================
   GPSWOX — هاوکاتکردن (پێشنیار / بەستنەوەی کڕیار / ڕاپۆرت)
   ========================================================================== */
.gps-head { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.gps-head .badge { margin-inline-start: 6px; }
.text-warning { color: #b45309; }
.gps-table tr.is-muted td { opacity: .62; }
.gps-table input[type=date] { min-height: 32px; padding: 0 6px; font-size: 12.5px; }
.gps-table select.gps-contract-select { min-width: 170px; min-height: 32px; font-size: 12.5px; }
.gps-suggest { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gps-suggest form { display: inline; }
.gps-link-form { display: flex; align-items: center; gap: 6px; min-width: 260px; }
.gps-link-form .ss { flex: 1; }
/* فۆرمی گرێبەست: ئامێرەکانی کڕیار لە GPSWOX */
.gps-picker-bar { flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.gps-picker .table td:first-child input { width: 18px; height: 18px; cursor: pointer; }
.gps-attach-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px dashed var(--border); background: #f8fafc; }
.gps-attach-form .field { margin: 0; }
.gps-state { white-space: nowrap; }
.gps-head .spacer { flex: 1; }
.nav-link .nav-badge { margin-inline-start: auto; font-size: 11px; padding: 1px 7px; }

/* دۆخی پەیوەندی ئامێری GPSWOX (وەک پانێڵ: شین = کار ناکات) */
.gps-conn { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.gps-dot { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.gps-conn.is-live { color: #15803d; }
.gps-conn.is-live .gps-dot { background: #16a34a; }
.gps-conn.is-recent { color: #b45309; }
.gps-conn.is-recent .gps-dot { background: #f59e0b; }
.gps-conn.is-stale { color: #1d4ed8; }
.gps-conn.is-stale .gps-dot { background: #2563eb; }
.gps-conn.is-never { color: #64748b; }
.gps-conn.is-never .gps-dot { background: #2563eb; box-shadow: 0 0 0 2px #dbeafe; }
