/* ============================================================================
   ProjectManagement — app.css
   زمانی دیزاینی ZanGym (پانێڵی تاریک، سەوزی براند، ئاڵتوونی، لیستی لاتەنیشتی 248px)
   + ڕووکاری ڕووناک + ڕەنگی دۆخەکان:
       ماوە = سەوز  ·  حجزکراو = ئاڵتوونی  ·  فرۆشراو = شین  ·  دواکەوتوو / هەڵوەشێنراو = سوور
   ڕووکار لە <html data-theme="dark|light"> دیاری دەکرێت (کۆکی _light_dark).
   ============================================================================ */

:root,
:root[data-theme="dark"] {
    --bg: #0E1726;
    --panel: #16213A;
    --panel2: #1B2A47;
    --line: #26385C;
    --line-soft: rgba(38, 56, 92, .5);
    --brand: #1D9E75;
    --brand-hover: #22B585;
    --brand-dim: #12684E;
    --brand-soft: rgba(29, 158, 117, .12);
    --brand-line: rgba(29, 158, 117, .3);
    --gold: #E0A040;
    --gold-soft: rgba(224, 160, 64, .14);
    --gold-line: rgba(224, 160, 64, .3);
    --red: #E24B4A;
    --red-soft: rgba(226, 75, 74, .14);
    --red-line: rgba(226, 75, 74, .35);
    --blue: #378ADD;
    --blue-soft: rgba(55, 138, 221, .14);
    --blue-line: rgba(55, 138, 221, .3);
    --text: #E8ECF4;
    --muted: #9AA8C0;
    --dim: #63728E;
    --topbar: rgba(22, 33, 58, .6);
    --overlay: rgba(5, 10, 20, .62);
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, .65);
    --violet: #9B87E8;
    --street: #0A1220;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #F3F5F9;
    --panel: #FFFFFF;
    --panel2: #F1F4F9;
    --line: #DCE3EE;
    --line-soft: rgba(220, 227, 238, .9);
    --brand: #168B66;
    --brand-hover: #1D9E75;
    --brand-dim: #12684E;
    --brand-soft: rgba(29, 158, 117, .10);
    --brand-line: rgba(22, 139, 102, .35);
    --gold: #B7791F;
    --gold-soft: rgba(224, 160, 64, .16);
    --gold-line: rgba(183, 121, 31, .35);
    --red: #D03F3E;
    --red-soft: rgba(226, 75, 74, .10);
    --red-line: rgba(208, 63, 62, .35);
    --blue: #2B73C2;
    --blue-soft: rgba(55, 138, 221, .12);
    --blue-line: rgba(43, 115, 194, .3);
    --text: #16213A;
    --muted: #55627A;
    --dim: #8290A8;
    --topbar: rgba(255, 255, 255, .78);
    --overlay: rgba(14, 23, 38, .45);
    --shadow: 0 24px 60px -24px rgba(22, 33, 58, .35);
    --violet: #7B61D1;
    --street: #DDE3EC;
    color-scheme: light;
}

:root {
    --radius: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --sidebar-w: 248px;
    --font: 'Vazirmatn', 'Noto Sans Arabic', Tahoma, sans-serif;
}


/* ---------- بنەڕەت ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ژمارە، بڕی پارە و بەروار: لاتینی و چەپ-بۆ-ڕاست بەشێوەی جیاکراوە */
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; display: inline-block; }
td.num, th.num { display: table-cell; direction: inherit; unicode-bidi: normal; }
.ltr { direction: ltr; unicode-bidi: isolate; }

svg.ico { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico { width: 19px; height: 19px; flex-shrink: 0; color: var(--dim); transition: .16s; }
.ico.sm { width: 16px; height: 16px; }
.ico.xs { width: 14px; height: 14px; }
.ico.lg { width: 22px; height: 22px; }


/* ============================================================================
   لیستی لاتەنیشت
   ============================================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
    background: var(--panel);
    border-inline-start: 1px solid var(--line);
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 20px; }

/*  نیشانەی Turkish Village (باڵە زێڕینەکان — PNG ی ڕوون، لەسەر هەردوو ڕووکار)  */
.brand-logo { width: 54px; height: auto; flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.2px; line-height: 1.35; }
.brand-sub { font-size: 11px; color: var(--dim); margin-top: 1px; }

.nav-label { font-size: 10.5px; color: var(--dim); padding: 14px 10px 6px; letter-spacing: .5px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    transition: .16s;
    font-size: 13.5px;
    border: 1px solid transparent;
}

.nav-item:hover { background: var(--panel2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--text); border-color: var(--brand-line); }
.nav-item.active .ico { color: var(--brand); }

.nav-item .badge {
    margin-inline-start: auto;
    font-size: 10px;
    background: var(--red);
    color: #fff;
    border-radius: 20px;
    padding: 1px 7px;
    font-weight: 500;
}

.sidebar-foot { margin-top: auto; padding: 16px 10px 2px; font-size: 11px; color: var(--dim); }

.sidebar-backdrop { display: none; }


/* ============================================================================
   بەشی سەرەکی و شریتی سەرەوە
   ============================================================================ */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 26px;
    border-bottom: 1px solid var(--line);
    background: var(--topbar);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.search {
    flex: 1;
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 13px;
    color: var(--muted);
    transition: .16s;
}

.search:focus-within { border-color: var(--brand-dim); }
.search input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; }
.search input::placeholder { color: var(--dim); }

.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    display: grid;
    place-items: center;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    transition: .16s;
}

.icon-btn:hover { color: var(--text); border-color: var(--brand-dim); }
.icon-btn .ico { color: inherit; width: 18px; height: 18px; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }

.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }

.menu-toggle { display: none; }

.user-menu { position: relative; }

.menu-pop {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 230px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    z-index: 60;
}

.menu-pop.open { display: block; animation: fade .18s ease; }
.menu-pop .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-pop .who b { display: block; font-size: 13.5px; }
.menu-pop .who span { font-size: 11.5px; color: var(--dim); }

.menu-pop a,
.menu-pop button {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    text-align: start;
}

.menu-pop a:hover,
.menu-pop button:hover { background: var(--panel2); color: var(--text); }
.menu-pop .ico { color: inherit; width: 17px; height: 17px; }

.content { padding: 24px 26px 40px; flex: 1; animation: fade .3s ease; }

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

.footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 26px 18px;
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--dim);
}

.footer a { color: var(--muted); }
.footer a:hover { color: var(--brand); }


/* ============================================================================
   سەرپەڕە و دوگمە
   ============================================================================ */
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 23px; font-weight: 700; letter-spacing: -.3px; line-height: 1.4; }
.page-desc { color: var(--muted); font-size: 13px; margin-top: 3px; }
.head-actions { margin-inline-start: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: .16s;
    white-space: nowrap;
    line-height: 1.5;
}

.btn:hover { background: var(--brand-hover); transform: translateY(-1px); }
.btn .ico { color: inherit; width: 16px; height: 16px; }

.btn.ghost { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand-dim); background: var(--panel2); }

.btn.gold { background: var(--gold); color: #1B1406; }
.btn.gold:hover { filter: brightness(1.08); }

.btn.danger { background: transparent; color: var(--red); border-color: var(--red-line); }
.btn.danger:hover { background: var(--red-soft); }

.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }
.btn.block { width: 100%; }

.btn[disabled],
.btn.is-busy { opacity: .55; pointer-events: none; transform: none; }

.btn.is-busy::after {
    content: "";
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }


/* ============================================================================
   کارتی ئامار
   ============================================================================ */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.mt { margin-top: 16px; }

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    transition: .18s;
}

.stat:hover { border-color: var(--brand-dim); transform: translateY(-2px); }

.stat-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px; }
.stat-ico .ico { color: inherit; }
.stat-ico.brand { background: var(--brand-soft); color: var(--brand); }
.stat-ico.gold { background: var(--gold-soft); color: var(--gold); }
.stat-ico.blue { background: var(--blue-soft); color: var(--blue); }
.stat-ico.red { background: var(--red-soft); color: var(--red); }
.stat-ico.muted { background: var(--panel2); color: var(--muted); }

.stat-val { font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.3; }
.stat-val small { font-size: 13px; color: var(--muted); font-weight: 400; margin-inline-start: 4px; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.stat-trend {
    position: absolute;
    top: 18px;
    inset-inline-end: 18px;
    font-size: 11.5px;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
    color: var(--muted);
}

.stat-bar { height: 6px; background: var(--panel2); border-radius: 6px; overflow: hidden; margin-top: 12px; }
.stat-bar i { display: block; height: 100%; border-radius: 6px; background: var(--brand); }
.stat-bar i.gold { background: var(--gold); }
.stat-bar i.blue { background: var(--blue); }
.stat-bar i.muted { background: var(--dim); }

/* هێڵی پارچەپارچە (کارتی «کۆی یەکەکان» لە داشبۆرد: ماوە / حجزکراو / گرێبەستکراو) */
.stat-bar.seg { display: flex; }
.stat-bar.seg i { border-radius: 0; }

.up { color: var(--brand); }
.down { color: var(--red); }


/* ============================================================================
   پانێڵ و خشتە
   ============================================================================ */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-title { font-weight: 700; font-size: 14.5px; }
.panel-sub { font-size: 12px; color: var(--dim); }
.panel-head .tools { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-body { padding: 6px 0; }
.panel-body.pad { padding: 18px; }
.panel-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
    text-align: start;
    padding: 11px 18px;
    color: var(--dim);
    font-weight: 500;
    font-size: 11.5px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

td { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: .13s; }
tbody tr:hover { background: var(--panel2); }
tbody tr.click { cursor: pointer; }
tbody tr.is-off td { color: var(--dim); }
tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: none; }

.u-cell { display: flex; align-items: center; gap: 10px; }

.u-face {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}

.u-name { font-weight: 500; }
.u-sub { font-size: 11px; color: var(--dim); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok, .chip.st-available { background: var(--brand-soft); color: var(--brand); }
.chip.warn, .chip.st-reserved { background: var(--gold-soft); color: var(--gold); }
.chip.info, .chip.st-sold { background: var(--blue-soft); color: var(--blue); }
.chip.no, .chip.st-late { background: var(--red-soft); color: var(--red); }
.chip.muted { background: var(--panel2); color: var(--muted); }
.chip.vip { background: linear-gradient(135deg, var(--gold-soft), rgba(224, 160, 64, .05)); color: var(--gold); border: 1px solid var(--gold-line); }

.row-acts { display: flex; gap: 6px; justify-content: flex-end; }

.row-act {
    color: var(--dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 7px;
    display: inline-grid;
    place-items: center;
    background: none;
    border: none;
    transition: .13s;
}

.row-act:hover { color: var(--text); background: var(--panel2); }
.row-act.danger:hover { color: var(--red); background: var(--red-soft); }
.row-act.ok:hover { color: var(--brand); background: var(--brand-soft); }
.row-act .ico { color: inherit; width: 16px; height: 16px; }

.section-title { font-size: 15px; font-weight: 700; margin: 26px 0 14px; display: flex; align-items: center; gap: 9px; }
.section-title .ico { color: var(--brand); }

.mini-note { font-size: 12px; color: var(--dim); margin-top: 5px; display: flex; align-items: center; gap: 6px; }

.empty { padding: 34px 18px; text-align: center; color: var(--dim); font-size: 13px; }
.empty .ico { width: 30px; height: 30px; margin: 0 auto 10px; display: block; color: var(--dim); }

.table-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 5px 11px;
    min-width: 200px;
}

.table-search input { background: none; border: none; outline: none; font-size: 12.5px; width: 100%; color: var(--text); }
.table-search input::placeholder { color: var(--dim); }


/* ============================================================================
   فۆرم
   ============================================================================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.g3c { grid-template-columns: repeat(3, 1fr); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.field > span .req { color: var(--red); margin-inline-start: 2px; }

.field input,
.field select,
.field textarea,
.input {
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 13px;
    color: var(--text);
    outline: none;
    transition: .15s;
    width: 100%;
    font-size: 13.5px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.field input:disabled,
.field input[readonly] { opacity: .75; }

.field textarea { min-height: 70px; resize: vertical; }
.field input[type="date"],
.field input[type="tel"],
.field input[type="number"],
.field input.ltr { direction: ltr; text-align: end; }

.field-hint { font-size: 11.5px; color: var(--dim); }
.field-hint.ok { color: var(--brand); }
.field-hint.warn { color: var(--gold); }

/*  وشەی نهێنی + دوگمەی چاو (data-reveal). دوگمەکە لای ڕاستە و input ـەکە LTR ـە، بۆیە padding-right  */
.field > span.pass-field { position: relative; display: block; font-size: inherit; color: inherit; }
.field .pass-field input { padding-right: 44px; }
.pass-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--dim);
    cursor: pointer;
    transition: .15s;
}
.pass-toggle:hover { color: var(--text); background: var(--panel); }
.pass-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pass-toggle .ico { width: 18px; height: 18px; color: inherit; }
.pass-toggle .ico-hide,
.pass-toggle[aria-pressed="true"] .ico-show { display: none; }
.pass-toggle[aria-pressed="true"] .ico-hide { display: block; }

/*  کۆدی پشتڕاستکردنەوە: خانە + وێنە + دوگمەی نوێکردنەوە لە یەک ڕیزدا  */
.field > span.captcha-row { display: flex; align-items: center; gap: 8px; font-size: inherit; color: inherit; }
.captcha-row input { flex: 1 1 auto; min-width: 0; text-align: center; letter-spacing: 3px; }
.captcha-row input::placeholder { letter-spacing: 0; font-size: 12px; }
.captcha-img { flex: none; width: 140px; height: 44px; border-radius: 9px; border: 1px solid var(--line); background: #F4F7FB; }
.captcha-row .icon-btn { flex: none; }

/*  وشەی نهێنیی کاتی (لیستی بەکارهێنەران)  */
.reset-question { margin: 0 0 14px; font-weight: 600; line-height: 1.8; }
.temp-pass {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 14px 0;
    padding: 10px 12px;
    background: var(--panel2);
    border: 1px dashed var(--gold-line);
    border-radius: 10px;
}
.temp-pass code { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 21px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold); user-select: all; overflow-wrap: anywhere; }

/*  «لەبیرم بێت»  */
.remember { display: flex; flex-direction: column; gap: 4px; }
.remember .field-hint { line-height: 1.7; }
.words { font-size: 12px; color: var(--gold); min-height: 18px; }

.form-section { font-size: 13px; font-weight: 700; margin: 4px 0 2px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.form-section .ico { color: var(--brand); width: 16px; height: 16px; }

.readonly-box { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 13px; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }


/* ============================================================================
   مۆداڵ
   ============================================================================ */
.modal {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: grid;
    place-items: center;
    padding: 16px;
    z-index: 80;
}

.modal[hidden] { display: none; }

.dlg {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    width: min(560px, 100%);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    animation: pop .18s ease-out;
}

.dlg.wide { width: min(820px, 100%); }
.dlg.sm { width: min(420px, 100%); }

@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

.dlg-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.dlg-title { font-weight: 700; font-size: 15px; }
.dlg-head .icon-btn { margin-inline-start: auto; }
.dlg form { display: flex; flex-direction: column; min-height: 0; }
.dlg-body { padding: 18px; overflow-y: auto; }
.dlg-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }

body.modal-open { overflow: hidden; }


/* ============================================================================
   تێبینی و ئاگادارکردنەوە
   ============================================================================ */
.note {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    font-size: 13px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--text);
}

.note .ico { color: var(--brand); margin-top: 1px; }
.note.gold { background: var(--gold-soft); border-color: var(--gold-line); }
.note.gold .ico { color: var(--gold); }
.note.warn { background: var(--red-soft); border-color: var(--red-line); }
.note.warn .ico { color: var(--red); }

.toasts {
    position: fixed;
    bottom: 20px;
    inset-inline-end: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
    max-width: calc(100vw - 40px);
}

.toast {
    width: 340px;
    max-width: 100%;
    background: var(--panel);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--brand);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    box-shadow: var(--shadow);
    animation: slideIn .35s ease;
    font-size: 13px;
}

.toast .ico { color: var(--brand); margin-top: 1px; }
.toast.error { border-inline-start-color: var(--red); }
.toast.error .ico { color: var(--red); }
.toast.warning { border-inline-start-color: var(--gold); }
.toast.warning .ico { color: var(--gold); }
.toast.info { border-inline-start-color: var(--blue); }
.toast.info .ico { color: var(--blue); }
.toast.hide { opacity: 0; transform: translateY(6px); transition: .3s; }

@keyframes slideIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }


/* ============================================================================
   داشبۆرد — شریتی دارایی
   ============================================================================ */
.money {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.money > div { padding: 16px 18px; border-inline-start: 1px solid var(--line); }
.money > div:first-child { border-inline-start: 0; }
.money span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.money b { font-size: 19px; font-weight: 700; }
.money small { color: var(--dim); font-size: 11.5px; margin-inline-start: 4px; }
.money .neg b { color: var(--red); }
.money .pos b { color: var(--brand); }


/* ============================================================================
   پەڕەی چوونەژوورەوە
   ============================================================================ */
.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(circle at 85% 10%, var(--brand-soft), transparent 40%),
        radial-gradient(circle at 10% 90%, var(--gold-soft), transparent 42%),
        var(--bg);
}

.auth-card {
    width: min(410px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px 26px 24px;
    box-shadow: var(--shadow);
    animation: fade .35s ease;
}

.auth-logo { display: flex; flex-direction: column; align-items: center; margin: -8px 0 16px; }
.auth-logo img { width: 200px; max-width: 70%; height: auto; }
.auth-logo .brand-sub { margin-top: 4px; }
.auth-title { font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.auth-desc { color: var(--muted); font-size: 13px; margin: 4px 0 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .btn { margin-top: 6px; padding: 11px 16px; font-size: 14px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 11.5px; color: var(--dim); }
.auth-tools { position: fixed; top: 16px; inset-inline-end: 16px; }


/* ============================================================================
   مۆبایل و تابلێت
   ============================================================================ */
@media (max-width: 1200px) {
    .money { grid-template-columns: repeat(3, 1fr); }
    .money > div:nth-child(4) { border-inline-start: 0; }
    .money > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}

@media (max-width: 1000px) {
    .app { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        inset-inline-start: calc(-1 * var(--sidebar-w) - 12px);
        width: var(--sidebar-w);
        z-index: 50;
        transition: inset-inline-start .25s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .5);
    }

    .sidebar.open { inset-inline-start: 0; }

    .sidebar-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 45; }
    body.sidebar-open .sidebar-backdrop { display: block; }

    .menu-toggle { display: grid; }
    .g4 { grid-template-columns: repeat(2, 1fr); }
    .g3, .g2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .topbar { padding: 12px 14px; gap: 10px; }
    .content { padding: 18px 14px 32px; }
    .footer { padding: 14px; }
    .page-title { font-size: 20px; }
    .head-actions { margin-inline-start: 0; width: 100%; }
    .head-actions .btn { flex: 1; }
    .g4 { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat { padding: 14px; }
    .stat-val { font-size: 22px; }
    .money { grid-template-columns: 1fr 1fr; }
    .money > div { border-inline-start: 0; border-top: 1px solid var(--line); }
    .money > div:nth-child(-n+2) { border-top: 0; }
    .money > div:nth-child(even) { border-inline-start: 1px solid var(--line); }
    .form-grid, .form-grid.g3c { grid-template-columns: 1fr; }
    th, td { padding: 10px 12px; }
    .toasts { inset-inline: 12px; bottom: 12px; }
    .toast { width: 100%; }
    .table-search { min-width: 0; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ============================================================================
   چاپ (بنەڕەت؛ پسوولە و گرێبەست پەڕەی چاپی تایبەتیان هەیە)
   ============================================================================ */
@media print {
    .sidebar, .topbar, .footer, .head-actions, .toasts, .row-acts, .no-print { display: none !important; }
    .app { display: block; }
    body { background: #fff; color: #111; }
    .panel, .stat { border-color: #ccc; }
}


/* ============================================================================
   قۆناغی 2 — شێوازی پارەدان، جۆری ڤێلا، یەکەکان، پەڕەی یەکە، نەخشە
   ============================================================================ */

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- فلتەر (چیپی دۆخ + گەڕان) ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.fchip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--muted);
    font-size: 12.5px;
    cursor: pointer;
    transition: .15s;
}

.fchip:hover { color: var(--text); border-color: var(--brand-dim); }
.fchip b { font-weight: 700; color: var(--text); font-size: 11.5px; background: var(--panel2); padding: 1px 8px; border-radius: 999px; }
.fchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.fchip.st-available i { background: var(--brand); }
.fchip.st-reserved i { background: var(--gold); }
.fchip.st-sold i { background: var(--blue); }
.fchip.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--text); }
.fchip.st-reserved.on { background: var(--gold-soft); border-color: var(--gold-line); }
.fchip.st-sold.on { background: var(--blue-soft); border-color: var(--blue-line); }

.filter-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-inline-start: auto; }
.filter-form.start { margin-inline-start: 0; }
.filter-form select.input { width: auto; min-width: 150px; padding: 7px 12px; font-size: 12.5px; }
.filter-form .table-search { min-width: 250px; }

.villa-no { font-weight: 700; font-size: 14px; color: var(--text); }
.villa-no:hover { color: var(--brand); }

.check-row { display: flex; gap: 24px; flex-wrap: wrap; padding: 4px 0; }


/* ---------- شێوازی پارەدان ---------- */
.plan-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: .18s;
}

.plan-card:hover { border-color: var(--brand-dim); }
.plan-card.is-off,
.type-card.is-off { opacity: .6; }

.plan-head { display: flex; align-items: flex-start; gap: 12px; }
.plan-head .stat-ico { margin: 0; }
.plan-title { flex: 1; min-width: 0; }
.plan-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-sub { font-size: 12px; color: var(--dim); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }

.plan-total { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan-total span { color: var(--muted); font-size: 12px; }
.plan-total b { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.plan-total small { color: var(--dim); font-size: 12px; }

.plan-bar { display: flex; gap: 2px; height: 8px; border-radius: 6px; overflow: hidden; background: var(--panel2); }
.plan-bar i { display: block; height: 100%; }

.plan-stages { display: grid; gap: 8px; }
.plan-stage { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.plan-stage i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.plan-stage span { color: var(--muted); flex: 1; }
.plan-stage b { font-weight: 500; }

.plan-bar .s1, .plan-stage .s1 { background: var(--brand); }
.plan-bar .s2, .plan-stage .s2 { background: var(--gold); }
.plan-bar .s3, .plan-stage .s3 { background: var(--blue); }
.plan-bar .s4, .plan-stage .s4 { background: var(--violet); }
.plan-bar .s5, .plan-stage .s5 { background: var(--dim); }

.plan-foot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); }
.plan-foot .ico { color: var(--gold); }

.calc-box { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; display: grid; gap: 8px; transition: .15s; }
.calc-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.calc-row span { color: var(--muted); }
.calc-state { font-size: 12.5px; font-weight: 500; }
.calc-state:empty { display: none; }
.calc-box.ok { border-color: var(--brand-line); background: var(--brand-soft); }
.calc-box.ok .calc-state { color: var(--brand); }
.calc-box.bad { border-color: var(--red-line); background: var(--red-soft); }
.calc-box.bad .calc-state { color: var(--red); }


/* ---------- جۆری ڤێلا ---------- */
.type-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: .18s;
}

.type-card:hover { border-color: var(--brand-dim); transform: translateY(-2px); }

.type-cover { position: relative; aspect-ratio: 16 / 10; background: var(--panel2); display: grid; place-items: center; border-bottom: 1px solid var(--line); overflow: hidden; }
.type-cover img { width: 100%; height: 100%; object-fit: cover; }
.type-cover .drawing { width: 72%; }
.type-cover-note { position: absolute; bottom: 8px; inset-inline-start: 10px; font-size: 11px; color: var(--dim); background: var(--panel); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); }

.type-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.type-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }

.type-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-thumb { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--dim); min-width: 0; }
.type-thumb img,
.type-thumb-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); }
.type-thumb-empty { display: grid; place-items: center; }

.img-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.img-input { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.img-input-label { font-size: 12px; color: var(--muted); }
.img-preview { aspect-ratio: 4 / 3; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel2); display: grid; place-items: center; overflow: hidden; font-size: 11.5px; color: var(--dim); }
.img-preview img { width: 100%; height: 100%; object-fit: contain; }
.img-input input[type="file"] { font-size: 12px; padding: 7px 9px; }


/* ---------- وێنەی نموونەیی (UnitDrawingClass) ---------- */
.drawing svg { width: 100%; height: auto; display: block; font-family: var(--font); }
.drawing .d-ground { fill: var(--brand); opacity: .35; }
.drawing .d-wall { fill: var(--panel); stroke: var(--text); stroke-width: 1.5; }
.drawing .d-line { stroke: var(--text); stroke-width: 1; }
.drawing .d-roof { fill: var(--gold); }
.drawing .d-win { fill: var(--blue-soft); stroke: var(--text); stroke-width: .8; }
.drawing .d-door { fill: var(--brand-dim); }
.drawing .d-outer { fill: var(--panel); stroke: var(--text); stroke-width: 2; }
.drawing .d-room { fill: none; stroke: var(--text); stroke-width: .8; }
.drawing .d-label { font-size: 10px; fill: var(--muted); }


/* ---------- پەڕەی یەکە ---------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.crumb:hover { color: var(--brand); }
.crumb .ico { color: inherit; }

.title-chip { vertical-align: middle; margin-inline-start: 6px; font-size: 12px; font-weight: 500; letter-spacing: 0; }

.unit-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-title .ico { color: var(--brand); }
.card-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.card-text { color: var(--muted); font-size: 13px; line-height: 1.8; }
.card-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; }

.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.specs div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.specs span { font-size: 11.5px; color: var(--dim); }
.specs b { font-size: 14px; font-weight: 700; align-self: flex-start; }

.owner-name { font-size: 18px; font-weight: 700; line-height: 1.5; }
.owner-name.ready { color: var(--brand); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.fin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fin-head b { font-size: 21px; font-weight: 700; }
.fin-head span { color: var(--muted); font-size: 12.5px; }
.card .stat-bar { margin-top: 0; }

.fin { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fin > div { background: var(--panel2); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fin span { font-size: 11.5px; color: var(--dim); }
.fin b { font-size: 14px; align-self: flex-start; }
.fin .late { background: var(--red-soft); }
.fin .late b { color: var(--red); }

.empty.compact { padding: 12px 0; text-align: start; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 24px 0 16px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: .15s; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--brand); font-weight: 500; }
.tabs em { font-style: normal; font-size: 11px; background: var(--panel2); color: var(--muted); padding: 1px 7px; border-radius: 999px; }

.drawings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.drawings figure { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.drawings img { width: 100%; aspect-ratio: 24 / 17; object-fit: contain; border-radius: 8px; background: var(--panel2); display: block; }
.drawings figcaption { font-size: 12.5px; color: var(--muted); text-align: center; }
.tab-body > .mini-note { margin-top: 12px; }


/* ---------- نەخشەی پڕۆژە ---------- */
.map-hero { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: start; }

.sitemap { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.sitemap svg { width: 100%; height: auto; display: block; font-family: var(--font); }

.sitemap .boundary { fill: var(--panel2); stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 6 5; }
.sitemap .street { fill: var(--street); }
.sitemap .street-line { stroke: var(--dim); stroke-width: 1.5; stroke-dasharray: 10 8; opacity: .6; }
.sitemap .street-label { fill: var(--dim); font-size: 11px; }
.sitemap .compass { opacity: .75; }
.sitemap .compass circle { fill: none; stroke: var(--muted); }
.sitemap .compass path { fill: var(--gold); }

.sitemap .plot { cursor: pointer; outline: none; transition: opacity .2s; }
.sitemap .plot .lot { stroke-width: 1.5; transition: stroke-width .15s; }
.sitemap .plot .house { fill-opacity: .35; }
.sitemap .plot .tree { fill: var(--brand); opacity: .4; }
.sitemap .plot .no { font-size: 17px; font-weight: 700; fill: var(--text); }
.sitemap .plot .ar { font-size: 10px; fill: var(--muted); }
.sitemap .plot:hover .lot,
.sitemap .plot:focus-visible .lot { stroke-width: 3.5; }

.sitemap .plot.st-available .lot { fill: var(--brand-soft); stroke: var(--brand); }
.sitemap .plot.st-available .house { fill: var(--brand); }
.sitemap .plot.st-reserved .lot { fill: var(--gold-soft); stroke: var(--gold); }
.sitemap .plot.st-reserved .house { fill: var(--gold); }
.sitemap .plot.st-sold .lot { fill: var(--blue-soft); stroke: var(--blue); }
.sitemap .plot.st-sold .house { fill: var(--blue); }

/* SVG ی بارکراو: شێوەکان بەپێی MapShapeID ڕەنگ دەکرێن */
.sitemap .plot-shape { cursor: pointer; outline: none; stroke-width: 2; transition: opacity .2s, stroke-width .15s; }
.sitemap .plot-shape.st-available { fill: var(--brand); fill-opacity: .45; stroke: var(--brand); }
.sitemap .plot-shape.st-reserved { fill: var(--gold); fill-opacity: .5; stroke: var(--gold); }
.sitemap .plot-shape.st-sold { fill: var(--blue); fill-opacity: .5; stroke: var(--blue); }
.sitemap .plot-shape:hover,
.sitemap .plot-shape:focus-visible { stroke-width: 4; }

.sitemap .plot.dim,
.sitemap .plot-shape.dim { opacity: .15; }

/* نەخشەی ڕاستەقینە (tools/Convert-SitePlanDxf.ps1): یەکەی SVG مەترە، بۆیە هێڵەکان بە پیکسڵ دەپێورێن.
   پارچەی بێ یەکە خۆڵەمێشییە؛ کاتێک یەکەیەکی پێ دەبەسترێت ڕەنگی دۆخەکەی وەردەگرێت. */
.sitemap .site-plan path { vector-effect: non-scaling-stroke; }
.sitemap .sp-site { fill: var(--street); stroke: var(--line); stroke-width: 1.5; }
.sitemap .sp-open { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.sitemap .sp-plot { fill: var(--panel2); stroke: var(--dim); stroke-width: .6; }
.sitemap .site-plan .plot-shape { stroke-width: 1; fill-opacity: .8; }
.sitemap .site-plan .plot-shape:hover,
.sitemap .site-plan .plot-shape:focus-visible { stroke: var(--text); stroke-width: 2.5; }
.sitemap .sp-labels { fill: var(--muted); pointer-events: none; }
.sitemap .sp-nums { fill: var(--text); opacity: .6; pointer-events: none; }

.map-tip {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 12.5px;
    box-shadow: var(--shadow);
    min-width: 170px;
    max-width: 260px;
}

.map-tip b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.map-tip span:not(.chip) { display: block; color: var(--muted); line-height: 1.7; }
.map-tip .chip { margin-top: 4px; }

.legend { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.legend-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.lg { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 9px 11px; border-radius: 10px; background: var(--panel2); }
.lg i { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.lg span { flex: 1; color: var(--muted); }
.lg b { font-size: 15px; }
.lg.st-available i { background: var(--brand); }
.lg.st-reserved i { background: var(--gold); }
.lg.st-sold i { background: var(--blue); }
.legend .hint { font-size: 12px; color: var(--dim); line-height: 1.8; display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.legend .hint .ico { margin-top: 4px; }


/* ---------- ڕێکخستن: نەخشەی SVG ---------- */
.sitemap-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sitemap-file { font-size: 12px; color: var(--muted); }
.sitemap-file:hover { color: var(--brand); }
.sitemap-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.sitemap-form .field { flex: 1; min-width: 240px; }
.sitemap-remove { margin-top: 14px; }


/* ---------- مۆبایل و تابلێت (قۆناغی 2) ---------- */
@media (max-width: 1200px) {
    .unit-top { grid-template-columns: 1fr 1fr; }
    .unit-top > .card:last-child { grid-column: 1 / -1; }
    .map-hero { grid-template-columns: 1fr; }
    .legend { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .legend-title { width: 100%; }
    .lg { flex: 1; min-width: 140px; }
    .legend .hint { width: 100%; }
}

@media (max-width: 1000px) {
    .hide-md { display: none !important; }
    .drawings { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .hide-sm { display: none !important; }
    .toolbar { align-items: stretch; }
    .filter-form { margin-inline-start: 0; width: 100%; }
    .filter-form select.input { flex: 1; min-width: 0; }
    .filter-form .table-search { flex: 1 1 100%; min-width: 0; order: -1; }
    .unit-top { grid-template-columns: 1fr; }
    .specs { grid-template-columns: 1fr 1fr; }
    .drawings, .img-inputs { grid-template-columns: 1fr; }
    .plan-total b { font-size: 21px; }
    .sitemap { padding: 8px; }
    .lg { min-width: 0; flex: 1 1 40%; }
}


/* ============================================================================
   قۆناغی 3 — حجز، گرێبەست، پسوولە، گەڕانی کەس
   ============================================================================ */

.nowrap { white-space: nowrap; }
.dim { color: var(--dim); }
.dlg.xwide { width: min(1120px, 100%); }

/* ---------- بەشەکانی فۆرم (کەس، حجز، پارە) ---------- */
.person-box,
.form-box {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 16px 16px;
    margin: 0 0 16px;
    min-width: 0;
}

.person-box legend,
.form-box legend {
    padding: 0 8px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
}

.person-box legend .ico,
.form-box legend .ico { color: var(--brand); }

.person-box.is-readonly { background: var(--panel2); }
.form-box:last-child { margin-bottom: 0; }

/* ---------- گەڕانی کەسی تۆمارکراو ---------- */
.person-search { margin-bottom: 12px; }
.person-search .table-search { min-width: 0; padding: 7px 11px; }

.ps-results {
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel2);
    max-height: 230px;
    overflow-y: auto;
}

.ps-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text);
    cursor: pointer;
    text-align: start;
    font-size: 13px;
}

.ps-item:last-child { border-bottom: 0; }
.ps-item:hover,
.ps-item:focus-visible { background: var(--brand-soft); outline: none; }
.ps-item span { color: var(--muted); font-size: 12px; }
.ps-empty { padding: 10px 12px; font-size: 12.5px; color: var(--dim); }

.ps-picked {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 7px 8px 7px 12px;
    border-radius: 10px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    font-size: 12.5px;
}

.ps-picked[hidden] { display: none; }
.ps-picked .ico { color: var(--brand); }
.ps-picked .btn { margin-inline-start: auto; }

/* ---------- تابەکانی پەڕەی یەکە ---------- */
.tab-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tab-toolbar p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.8; flex: 1; min-width: 220px; }
.tab-note { margin-bottom: 12px; }

.row-acts.wrap { flex-wrap: wrap; }
.row-note { font-size: 11.5px; color: var(--dim); margin-top: 3px; line-height: 1.7; }

tbody tr.is-cancelled td { color: var(--muted); }
tbody tr.is-cancelled .u-name { text-decoration: line-through; text-decoration-color: var(--red-line); }
tbody tr.is-late td { background: var(--red-soft); }
td.out { color: var(--red); }
tfoot tr.net td { color: var(--brand); border-top: 0; padding-top: 4px; }

/* ---------- زنجیرەی گرێبەستەکان ---------- */
.chain { list-style: none; margin: 0; padding: 18px 18px 4px; }
.chain li { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.chain li::before { content: ""; position: absolute; top: 36px; bottom: 2px; inset-inline-start: 15px; width: 2px; background: var(--line); }
.chain li:last-child::before { display: none; }

.chain-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--panel2);
    border: 2px solid var(--line);
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.chain li.cur .chain-dot { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chain-body { min-width: 0; }
.chain-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.chain-arrow { color: var(--gold); font-weight: 700; }
.chain-meta { font-size: 12px; color: var(--dim); margin-top: 3px; }
.chain-snap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chain-snap span { font-size: 12px; background: var(--panel2); border-radius: 8px; padding: 3px 10px; color: var(--muted); }
.chain-snap .late { background: var(--red-soft); color: var(--red); }

/* ---------- مۆداڵی گرێبەست ---------- */
.steps-note { margin-bottom: 16px; }
.steps-list { margin: 6px 0 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.steps-list li { line-height: 1.8; }

/* ---------- مۆداڵی پسوولەکان ---------- */
.receipts-body { background: var(--panel2); }
.doc-stack { display: grid; gap: 16px; }
.doc-stack.two { grid-template-columns: 1fr 1fr; }
.doc-stack .doc-paper + .doc-paper { margin-top: 0; }

@media (max-width: 1000px) {
    .doc-stack.two { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .person-box, .form-box { padding: 10px 12px 14px; }
    .chain { padding: 14px 12px 2px; }
}

/* ژمارە لە خانەی dl: ڕاست-بە-چەپ وەک دەقەکانی تر (ژمارەکان خۆیان LTR دەبن) */
.kv dd.num { direction: inherit; unicode-bidi: normal; }

@media (max-width: 1280px) {
    .hide-lg { display: none !important; }
}

/* ============================================================================
   قۆناغی 4 — قستەکان و خاوەندارێتی
   ============================================================================ */

/* ---------- هەڵبژێری خولی فرۆشتن ---------- */
.cycles { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 20px 0 -8px; }
.cycles > span { color: var(--muted); font-size: 12.5px; }

.cyc {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--line);
    transition: .15s;
}

.cyc:hover { color: var(--text); border-color: var(--brand-dim); }
.cyc.on { color: var(--text); background: var(--brand-soft); border-color: var(--brand-line); font-weight: 500; }
.cyc .chip { padding: 1px 8px; font-size: 11px; }

/* ---------- قستەکان ---------- */
.rc-links { display: flex; gap: 4px; flex-wrap: wrap; }
.rc-link { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); background: var(--panel2); border-radius: 7px; padding: 1px 7px; }
a.rc-link:hover { color: var(--brand); }
.rc-link .ico { width: 12px; height: 12px; }

.empty > div { line-height: 1.9; }
.empty .empty-act { margin-top: 12px; }

.pay-info { margin-bottom: 16px; }

/* ---------- زنجیرەی گرێبەست: چاپ و کۆتایی خولی هەڵوەشێنراو ---------- */
.chain-body { flex: 1; }
.chain-acts { flex-shrink: 0; align-self: flex-start; }
.chain li.end .chain-dot { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.chain li.end .chain-who b { color: var(--red); }

/* ---------- ڕاگەیاندنی گرووپی ---------- */
.bulk-bar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--panel2);
}

.bulk-bar .field { width: 190px; }
.bulk-count { font-size: 12.5px; color: var(--muted); padding-bottom: 9px; }
.bulk-count b { color: var(--text); font-size: 15px; margin-inline-end: 3px; }
.bulk-bar .btn { margin-inline-start: auto; }

th.chk-col, td.chk-col { width: 36px; padding-inline-end: 0; }
.chk-col input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }
.chk-col input:disabled { cursor: not-allowed; opacity: .35; }

tbody tr.bulk-row { cursor: pointer; }
tbody tr.is-picked td { background: var(--brand-soft); }
tbody tr.is-muted td { color: var(--muted); }

@media (max-width: 640px) {
    .cycles { margin-top: 16px; }
    .bulk-bar { padding: 12px; }
    .bulk-bar .field { width: auto; flex: 1 1 100%; }
    .bulk-count { padding-bottom: 0; }
    .bulk-bar .btn { margin-inline-start: 0; flex: 1; }
    .chain li { flex-wrap: wrap; }
    .chain-acts { margin-inline-start: 46px; }
}

/* ============================================================================
   قۆناغی 5 — خەرجی، سەردانکەران، داشبۆرد
   ============================================================================ */

/* ---------- فلتەری ماوە ---------- */
.range-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.range-field .input { width: auto; padding: 6px 10px; font-size: 12.5px; direction: ltr; }
.fchip.is-off { opacity: .65; }

tbody tr.is-cancelled .amt { text-decoration: line-through; text-decoration-color: var(--red-line); }
tbody tr.is-off td { color: var(--muted); }

/* ---------- سەردانکەران: ژمارە بەپێی سەرچاوە ---------- */
.src-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.src-bar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.src-bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.src-bar-head b { font-size: 18px; color: var(--text); }
.src-bar .stat-bar { margin-top: 8px; }
.src-bar-sub { font-size: 11.5px; color: var(--dim); margin-top: 6px; }
.res-link { font-weight: 600; margin-inline-end: 6px; }
a.res-link:hover { color: var(--brand); }

/* ---------- داشبۆرد ---------- */
.dash-panels { align-items: start; }

/* چالاکیی ئەم مانگە — سێ ژمارە بە هەمان شێوەی .money */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); }
.kpis > div { padding: 16px 18px; border-inline-start: 1px solid var(--line); }
.kpis > div:first-child { border-inline-start: 0; }
.kpis span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.kpis b { font-size: 24px; font-weight: 700; }
.kpis small { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }

/* ڕێژەی گۆڕان: سەردانکەر ← حجز ← گرێبەست */
.funnel { padding: 14px 18px 16px; display: grid; gap: 14px; }
.funnel .stat-bar { margin-top: 8px; }

/* هێڵی بچووکی ناو خشتە و خاڵی ڕەنگی دۆخ لە سەری ستوون */
.stat-bar.mini { margin-top: 0; min-width: 90px; }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; background: var(--dim); }
.st-dot.st-available { background: var(--brand); }
.st-dot.st-reserved { background: var(--gold); }
.st-dot.st-sold { background: var(--blue); }

.panel-note { padding: 6px 18px 12px; margin-top: 0; }

@media (max-width: 640px) {
    .kpis > div { padding: 12px; }
    .kpis b { font-size: 20px; }
}
.late-amt { color: var(--red); font-weight: 700; }
.show-sm { display: none; }

@media (max-width: 640px) {
    .range-field { flex: 1 1 45%; }
    .range-field .input { flex: 1; min-width: 0; }
    .show-sm { display: block; }
}

@media print {
    .src-bars { break-inside: avoid; }
}

/* ============================================================================
   قۆناغی 6 — ڕاپۆرتەکان
   ============================================================================ */
.rep { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }

.rep-nav { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.rep-nav a { padding: 9px 12px; border-radius: 9px; font-size: 13px; color: var(--muted); transition: .15s; }
.rep-nav a:hover { color: var(--text); background: var(--panel2); }
.rep-nav a.on { color: var(--text); background: var(--brand-soft); font-weight: 600; }
.rep-nav hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

.rep-main { min-width: 0; }
.rep-filter { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.rep-filter .filter-form { margin-inline-start: auto; }
.rep-filter .fchip { padding: 5px 12px; font-size: 12px; }
.rep-filter .filter-form.rep-unit { margin-inline-start: 0; }
.rep-unit .input { min-width: 300px; padding: 7px 12px; font-size: 12.5px; }

.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.rep-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.rep-card span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.rep-card b { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.rep-card.pos b { color: var(--brand); }
.rep-card.neg b { color: var(--red); }

.rep-sec { font-size: 14px; font-weight: 700; margin: 20px 0 10px; }
.rep-cards + .rep-sec { margin-top: 4px; }
.rep-table td.late { color: var(--red); font-weight: 600; }
tbody tr.opening td { background: var(--panel2); font-weight: 600; }

@media (max-width: 1200px) {
    .rep { grid-template-columns: 1fr; }
    .rep-nav { flex-direction: row; overflow-x: auto; padding: 6px; }
    .rep-nav a { white-space: nowrap; }
    .rep-nav hr { display: none; }
}

@media (max-width: 640px) {
    .rep-filter { padding: 12px; }
    .rep-filter .filter-form { margin-inline-start: 0; width: 100%; }
    .rep-unit .input { min-width: 0; width: 100%; }
    .rep-unit .range-field { flex: 1 1 100%; }
    .rep-cards { grid-template-columns: 1fr 1fr; }
}

/* ---------- تۆماری چالاکییەکان (قۆناغی 7) ---------- */
.aud-toolbar .filter-form { margin-inline-start: 0; }
.aud-toolbar .filter-form select.input { min-width: 140px; max-width: 220px; }
.aud-pager { justify-content: center; gap: 14px; }
.aud-note { margin: 14px 0; }
.aud-diff td { vertical-align: top; }
.aud-diff td:not(.aud-field) { overflow-wrap: anywhere; }
.aud-diff td.aud-field { color: var(--muted); white-space: nowrap; width: 1%; }
.aud-diff tr.changed td { background: var(--gold-soft); }
.aud-diff tr.changed td.aud-field { color: var(--gold); font-weight: 600; }

@media (max-width: 640px) {
    .aud-toolbar .filter-form select.input { flex: 1 1 45%; min-width: 0; max-width: none; }
    .aud-diff td.aud-field { white-space: normal; min-width: 104px; }
}
