:root {
    --bg: #111317;
    --surface: #1b1e23;
    --surface-2: #22262c;
    --input: #121418;
    --border: #2a2e35;
    --text: #f1f2f4;
    --muted: #8a909a;
    --gold: #eda21f;
    --gold-hover: #f6b43c;
    --gold-soft: #c9a24a;
    --danger: #e5534b;
    --ok: #3fb950;
    --gold-ink: #eda21f;
    --text-2: #c4c8cf;
    --faint: #5d636c;
    --pos: #7ee28a;
    --neg: #ff8f88;
    --info-text: #8ab8f0;
    --violet-text: #b9b0f5;
    --border-strong: #3a3f47;
    --hover: #2b3038;
    --active: #323843;
    --tint: rgba(255, 255, 255, .03);
    --shadow-c: rgba(0, 0, 0, .5);
    --radius: 10px;
    --font: "IBM Plex Sans Arabic", system-ui, sans-serif;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
}
a { color: var(--gold-ink); text-decoration: none; }
a:hover { color: var(--gold-hover); }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.3; }

/* ---------------- حقول ونماذج ---------------- */
.field { display: block; margin-bottom: 1rem; }
.field > span:first-child { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field .hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input:not([type]), input[type=file], input[type=date], input[type=datetime-local], input[type=number], input[type=search], input[type=time], input[type=month], select, textarea {
    width: 100%;
    background: var(--input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(237, 162, 31, .15);
}
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }

.check { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 0; }
.check input { accent-color: var(--gold); width: 17px; height: 17px; }

/* ---------------- أزرار ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid transparent; border-radius: 8px;
    padding: 9px 16px; font: inherit; font-weight: 600; font-size: 14px;
    cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--gold); color: #1a1406; }
.btn-primary:hover { background: var(--gold-hover); color: #1a1406; }
.btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(229, 83, 75, .4); color: var(--danger); }
.btn-danger:hover { background: rgba(229, 83, 75, .1); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; padding: 11px; }

/* ---------------- تنبيهات ---------------- */
.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 1rem; font-size: 14px; border: 1px solid; }
.alert-error { background: rgba(229, 83, 75, .1); border-color: rgba(229, 83, 75, .35); color: var(--neg); }
.alert-ok { background: rgba(63, 185, 80, .1); border-color: rgba(63, 185, 80, .35); color: var(--pos); }

/* ---------------- شاشة الدخول ---------------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
    width: 100%; max-width: 340px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--gold);
    border-radius: 12px;
    padding: 34px 20px 22px;
    box-shadow: 0 20px 50px var(--shadow-c);
}
.auth-logo { text-align: center; margin-bottom: 30px; min-height: 48px; }
.auth-logo img { max-height: 70px; max-width: 220px; object-fit: contain; }
.logo-text {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 38px; font-weight: 700; letter-spacing: 1px;
    background: linear-gradient(180deg, #e2c27a, #b88a2e);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-title { text-align: center; font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.auth-footer { text-align: center; color: var(--faint); font-size: 13px; margin: 28px 0 0; }

/* ---------------- الهيكل العام ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px; flex-shrink: 0;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.brand { padding: 20px 18px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.brand img { max-height: 56px; max-width: 180px; object-fit: contain; }
.brand .logo-text { font-size: 22px; }
.brand-name { font-weight: 700; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; color: var(--muted); padding: 14px 10px 6px; letter-spacing: .5px; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px;
    color: var(--text-2); font-size: 14px; margin-bottom: 2px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: rgba(237, 162, 31, .12); color: var(--gold-ink); }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav .soon { margin-inline-start: auto; font-size: 10px; background: var(--surface-2); color: var(--muted); padding: 1px 7px; border-radius: 10px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 60px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--bg);
    position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 17px; margin: 0; }
.user-box { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.user-box .role { font-size: 11px; color: var(--muted); display: block; line-height: 1.2; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(237, 162, 31, .15); color: var(--gold-ink);
    display: grid; place-items: center; font-weight: 700;
}
.menu-btn { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 6px; }
.content { padding: 24px; width: 100%; max-width: 2400px; }
@media (min-width: 1800px) { .content { padding: 28px 32px; } }

/* ---------------- مكونات ---------------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; margin: 0; }
.panel.empty { text-align: center; padding: 50px 20px; }
.panel.empty p { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 20px; color: var(--text); display: block; transition: border-color .15s, transform .15s;
}
a.card:hover { border-color: rgba(237, 162, 31, .5); color: var(--text); transform: translateY(-2px); }
.card .ic { width: 42px; height: 42px; border-radius: 10px; background: rgba(237, 162, 31, .12); color: var(--gold-ink); display: grid; place-items: center; margin-bottom: 14px; }
.card .ic svg { width: 22px; height: 22px; }
.card h3 { font-size: 15px; margin-bottom: 4px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; color: var(--muted); font-weight: 500; font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 20px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-gold { background: rgba(237, 162, 31, .12); color: var(--gold-ink); border-color: rgba(237, 162, 31, .3); }
.badge-ok { background: rgba(63, 185, 80, .1); color: var(--pos); border-color: rgba(63, 185, 80, .3); }
.badge-off { background: rgba(229, 83, 75, .1); color: var(--neg); border-color: rgba(229, 83, 75, .3); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.logo-preview {
    background: var(--input); border: 1px dashed var(--border); border-radius: 10px;
    min-height: 110px; display: grid; place-items: center; padding: 16px; margin-bottom: 10px;
}
.logo-preview img { max-height: 80px; max-width: 100%; }
.perm-box { background: var(--input); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; }

/* ---------------- الجوال ---------------- */
@media (max-width: 900px) {
    .sidebar { position: fixed; right: 0; top: 0; z-index: 20; transform: translateX(100%); transition: transform .2s; box-shadow: -10px 0 30px var(--shadow-c); }
    .sidebar.open { transform: none; }
    .menu-btn { display: block; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .user-box .name-wrap { display: none; }
}

/* ================================================================
   قسم المحاسبة والمالية
   ================================================================ */
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.gold { color: var(--gold-ink); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn svg { width: 16px; height: 16px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
    background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(229, 83, 75, .4); }
.icon-btn[disabled] { opacity: .3; cursor: not-allowed; }
.inline-form { display: inline; margin: 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
.field-check { display: flex; align-items: flex-end; padding-bottom: 1rem; }

/* فلترة متقدمة */
.filter-panel { display: none; }
.filter-panel.open { display: block; }
.filter-panel .grid-4 { align-items: end; }

/* قائمة منسدلة لزر الإضافة */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 30; min-width: 170px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px;
    box-shadow: 0 12px 30px var(--shadow-c); display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--text); font-size: 14px; }
.dropdown-menu a:hover { background: rgba(237, 162, 31, .12); color: var(--gold-ink); }

/* الجداول */
.table td.wrap { white-space: normal; min-width: 200px; }
.table tr.sub-row td { background: var(--input); padding: 0; }
.table tr.sub-row .table { margin: 0; }
.table tr.sub-row .table td, .table tr.sub-row .table th { padding: 8px 14px; font-size: 13px; }
.expand-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; transition: transform .15s; }
.expand-btn svg { width: 16px; height: 16px; }
.expand-btn.open { transform: rotate(-90deg); color: var(--gold-ink); }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--border); border-bottom: 0; }
.clickable { cursor: pointer; user-select: none; }
.clickable:hover { color: var(--text); }
.sort-asc::after { content: " ▲"; font-size: 9px; }
.sort-desc::after { content: " ▼"; font-size: 9px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-links a, .pager-links span {
    min-width: 34px; height: 34px; padding: 0 10px; display: inline-grid; place-items: center;
    border-radius: 8px; border: 1px solid var(--border); font-size: 13px; color: var(--text-2);
}
.pager-links a:hover { border-color: var(--gold); color: var(--gold-ink); }
.pager-links .current { background: var(--gold); color: #1a1406; border-color: var(--gold); font-weight: 700; }
.table-tools { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.table-tools input { max-width: 260px; }
.table-tools select { width: auto; }

/* بطاقات المجاميع */
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.total-card { border-radius: 12px; padding: 18px 20px; border: 1px solid var(--border); background: var(--surface); }
.total-card .t-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.total-card .t-value { font-size: 22px; font-weight: 700; }
.total-card.credit { border-color: rgba(63, 185, 80, .35); background: linear-gradient(180deg, rgba(63, 185, 80, .08), transparent); }
.total-card.credit .t-value { color: var(--pos); }
.total-card.debit { border-color: rgba(229, 83, 75, .35); background: linear-gradient(180deg, rgba(229, 83, 75, .08), transparent); }
.total-card.debit .t-value { color: var(--neg); }
.total-card.diff { border-color: rgba(237, 162, 31, .35); background: linear-gradient(180deg, rgba(237, 162, 31, .08), transparent); }
.total-card.diff .t-value { color: var(--gold-ink); }
.total-card .t-note { font-size: 13px; margin-top: 4px; }

/* شجرة الحسابات */
.tree { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.tree ul { list-style: none; margin: 0; padding-inline-start: 26px; border-inline-start: 1px dashed var(--border); margin-inline-start: 10px; }
.tree li > ul { display: none; }
.tree li.open > ul { display: block; }
.tree-row {
    display: grid; grid-template-columns: minmax(200px, 1fr) 120px 150px 190px; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 8px; cursor: default;
}
.tree-row:hover, .tree-row.selected { background: var(--surface-2); }
.tree-row.selected { outline: 1px solid rgba(237, 162, 31, .4); }
.tree-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tree-name .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-name .code { color: var(--gold-ink); font-size: 12px; }
.tree-toggle { width: 20px; height: 20px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; flex-shrink: 0; transition: transform .15s; }
.tree-toggle svg { width: 14px; height: 14px; }
li.open > .tree-row .tree-toggle { transform: rotate(-90deg); color: var(--gold-ink); }
.tree-toggle.leaf { visibility: hidden; }
.tree-kids { font-size: 12px; color: var(--info-text); white-space: nowrap; }
.tree-final { font-size: 12px; color: var(--gold-soft); text-align: start; white-space: nowrap; }
.tree-bal { text-align: end; font-weight: 600; }
.tree-more { opacity: 0; }
.tree-row:hover .tree-more { opacity: 1; }
.tree-head { font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 6px; }
.tree-head:hover { background: none; }

.ctx-menu {
    position: fixed; z-index: 50; min-width: 190px; display: none;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px;
    box-shadow: 0 14px 34px var(--shadow-c);
}
.ctx-menu.open { display: block; }
.ctx-menu .ctx-title { font-size: 12px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.ctx-menu a, .ctx-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 6px;
    background: none; border: 0; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: start;
}
.ctx-menu svg { width: 16px; height: 16px; color: var(--muted); }
.ctx-menu a:hover, .ctx-menu button:hover { background: rgba(237, 162, 31, .12); color: var(--gold-ink); }
.ctx-menu button.danger:hover { background: rgba(229, 83, 75, .1); color: var(--danger); }
.ctx-menu [disabled] { opacity: .35; pointer-events: none; }

/* سطور السند */
.lines-box { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-top: 8px; }
.lines-box .table th { background: var(--surface-2); }
.lines-box .table td { padding: 8px; }
.lines-box input, .lines-box select { padding: 8px 10px; }
.entry-input-row td { background: rgba(237, 162, 31, .04); }
.lines-box .w-amt { width: 120px; }
.lines-box .w-cur { width: 110px; }
.lines-box .w-rate { width: 100px; }
.lines-box .w-acc { min-width: 220px; }
.lines-box .w-act { width: 110px; }
.lines-sum { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid var(--border); }
.lines-sum > div { padding: 14px 18px; border-inline-start: 1px solid var(--border); }
.lines-sum > div:first-child { border-inline-start: 0; }
.lines-sum .t-label { font-size: 13px; color: var(--muted); }
.lines-sum .t-value { font-size: 18px; font-weight: 700; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* بطاقة سند القبض/الدفع */
.voucher-flow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: end; }
.voucher-flow .arrow { padding-bottom: 1.6rem; color: var(--gold-ink); font-size: 22px; }

/* القائمة المنسدلة مع بحث (Tom Select) بنفس ألوان النظام */
.ts-wrapper .ts-control, .ts-wrapper.single.input-active .ts-control, .ts-wrapper.single .ts-control {
    background: var(--input) !important; border: 1px solid var(--border); color: var(--text);
    border-radius: 8px; padding: 10px 12px; box-shadow: none; font: inherit; min-height: 44px;
}
.lines-box .ts-wrapper .ts-control { padding: 8px 10px; min-height: 38px; }
.ts-wrapper.focus .ts-control { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(237, 162, 31, .15); }
.ts-control input, .ts-control .item { color: var(--text) !important; font: inherit; }
.ts-control input::placeholder { color: var(--muted); }
.ts-dropdown { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; margin-top: 4px; box-shadow: 0 12px 30px var(--shadow-c); }
.ts-dropdown .option, .ts-dropdown .no-results, .ts-dropdown .optgroup-header { padding: 8px 12px; }
.ts-dropdown .optgroup-header { background: var(--surface); color: var(--gold-ink); font-size: 12px; }
.ts-dropdown .active { background: rgba(237, 162, 31, .15); color: var(--text); }
.ts-dropdown .option .sub { font-size: 12px; color: var(--muted); }
.ts-wrapper.single .ts-control::after { border-color: var(--muted) transparent transparent; }
.ts-wrapper.rtl.single .ts-control::after { left: 12px; right: auto; }

/* كشف الحساب والطباعة */
.statement-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.statement-head h2 { font-size: 18px; }
.print-only { display: none; }
@media print {
    body { background: #fff; color: #000; }
    .sidebar, .topbar, .no-print, .toolbar, .pager, .filter-panel { display: none !important; }
    .content { padding: 0; max-width: none; }
    .panel { border: 0; padding: 0; background: #fff; }
    .table th, .table td { border-color: #ccc; color: #000; }
    .print-only { display: block; }
    .pos, .neg, .gold { color: #000; }
}

@media (max-width: 900px) {
    .grid-3, .grid-4, .totals, .voucher-flow, .lines-sum { grid-template-columns: 1fr; }
    .voucher-flow .arrow { display: none; }
    .tree-row { grid-template-columns: 1fr auto; }
    .tree-row .tree-kids, .tree-row .tree-final { display: none; }
    .tree-more { opacity: 1; }
}

/* ================================================================
   صفحة الإحصائيات
   ================================================================ */
.chips { gap: 6px; }
.chip {
    padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500;
}
.chip:hover { border-color: var(--gold); color: var(--gold-ink); }
.chip.active, .active-chip { background: rgba(237, 162, 31, .12); border-color: rgba(237, 162, 31, .5); color: var(--gold-ink); }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.dash-grid .widget { margin: 0; min-width: 0; }
.dash-grid .w-wide { grid-column: span 2; }
.dash-grid .w-full { grid-column: 1 / -1; }
.dash-grid .w-tall { grid-row: span 2; }
.widget .panel-head { margin-bottom: 14px; }
.widget .panel-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.widget .panel-head h2 svg { width: 18px; height: 18px; color: var(--gold-ink); }

.box-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.box-item {
    display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center;
    padding: 12px; border-radius: 10px; background: var(--input); border: 1px solid var(--border); color: var(--text);
}
.box-item:hover { border-color: rgba(237, 162, 31, .45); color: var(--text); }
.box-ic { width: 38px; height: 38px; border-radius: 10px; background: rgba(237, 162, 31, .12); color: var(--gold-ink); display: grid; place-items: center; }
.box-ic svg { width: 19px; height: 19px; }
.box-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-val { text-align: end; font-weight: 700; display: flex; flex-direction: column; }
.box-total { display: flex; justify-content: space-between; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }

.profit-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.donut-box { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut { width: 100%; height: 100%; }
.donut circle { transition: stroke-width .15s; }
.donut circle:hover { stroke-width: 22; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center strong { font-size: 15px; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; font-size: 14px; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; }
.legend .legend-total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }

.stat-list { display: flex; flex-direction: column; gap: 14px; }
.stat { display: flex; gap: 12px; align-items: center; }
.stat-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex-shrink: 0; }
.stat-ic svg { width: 18px; height: 18px; }
.stat-ic.in { background: rgba(63, 185, 80, .1); color: var(--pos); }
.stat-ic.out { background: rgba(229, 83, 75, .1); color: var(--neg); }
.stat-v { font-size: 20px; font-weight: 700; margin: 0; }

.legend-inline { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }
.bars { width: 100%; height: auto; display: block; direction: ltr; }
.bars .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.bar-g:hover rect[fill="transparent"] { fill: var(--tint); }
.table-view { margin-top: 10px; }
.table-view summary { cursor: pointer; color: var(--muted); }
.table-view .table { margin-top: 8px; }

.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { border-bottom: 1px solid var(--border); }
.recent-list li:last-child { border-bottom: 0; }
.recent-list a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 0; color: var(--text); }
.recent-list a:hover { color: var(--gold-ink); }
.recent-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.recent-list .num { text-align: end; font-size: 14px; }

.widget-order { list-style: none; margin: 0; padding: 6px 10px; background: var(--input); border: 1px solid var(--border); border-radius: 8px; }
.widget-order li { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding: 2px 0; }
.widget-order li:last-child { border-bottom: 0; }
.order-btns { display: flex; gap: 2px; }
.ts-wrapper.multi .ts-control > .item { background: rgba(237, 162, 31, .15) !important; border: 1px solid rgba(237, 162, 31, .4); color: var(--text) !important; border-radius: 6px; padding: 2px 6px; }
.ts-wrapper.plugin-remove_button .item .remove { border-color: rgba(237, 162, 31, .3) !important; color: var(--gold-ink); }

@media (max-width: 1100px) {
    .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid .w-tall { grid-row: auto; }
}
@media (max-width: 700px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-grid .w-wide { grid-column: auto; }
}

/* شريط المسار */
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; margin: -4px 0 18px; color: var(--muted); }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--gold-ink); }
.breadcrumb .sep { color: var(--faint); }
.breadcrumb .current { color: var(--gold-ink); font-weight: 600; }
.panel-head h2 svg { width: 18px; height: 18px; vertical-align: -3px; }
@media print { .breadcrumb { display: none; } }

/* ================================================================
   كشف الحساب
   ================================================================ */
.nowrap { white-space: nowrap; }
.st-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.st-summary > div { background: var(--input); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.st-panel { padding: 0; overflow: hidden; }
.st-panel > .table-wrap, .st-panel > p, .st-panel > .pager { padding-inline: 18px; }
.st-panel > p { padding-bottom: 16px; }
.st-table th { background: var(--surface-2); text-align: center; vertical-align: middle; line-height: 1.3; padding: 12px 8px; }
.st-table th svg { width: 14px; height: 14px; vertical-align: -2px; }
.st-table th small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.st-table td { text-align: center; padding: 9px 8px; }
.st-table td.st-note { text-align: start; min-width: 220px; }
.st-table tbody tr { cursor: pointer; }
.st-table tbody tr:hover td { background: var(--tint); }
.st-table tbody tr.selected td { background: rgba(237, 162, 31, .07); }
.st-table td.st-orig, .st-table th.st-orig { background: var(--tint); }
.st-table input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }
.st-opening td { background: var(--input) !important; cursor: default; }
.arrow-up, .arrow-down { display: block; font-size: 13px; font-weight: 700; }
.arrow-up { color: var(--pos); }
.arrow-down { color: var(--neg); }

.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px;
    font-size: 13px; font-weight: 600; border: 1px solid transparent; min-width: 74px; justify-content: center;
}
.pill i { font-style: normal; width: 15px; height: 15px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; line-height: 1; }
.pill-d { background: rgba(63, 185, 80, .12); border-color: rgba(63, 185, 80, .35); color: var(--pos); }
.pill-d i { background: #3fb950; color: #0d1f10; }
.pill-c { background: rgba(229, 83, 75, .12); border-color: rgba(229, 83, 75, .35); color: var(--neg); }
.pill-c i { background: #e5534b; color: #2a0d0b; }
.pill-zero { background: transparent; border-color: var(--border); color: var(--faint); font-weight: 400; }
.pill-bal { background: rgba(63, 185, 80, .16); border-color: rgba(63, 185, 80, .5); color: var(--pos); min-width: 110px; font-size: 14px; }
.pill-bal-neg { background: rgba(229, 83, 75, .16); border-color: rgba(229, 83, 75, .5); color: var(--neg); min-width: 110px; font-size: 14px; }
.pill-bal-zero { border-color: var(--border); color: var(--muted); min-width: 110px; }

.cur-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 12px; background: rgba(237, 162, 31, .1); border: 1px solid rgba(237, 162, 31, .35); color: var(--gold-ink); white-space: nowrap; }
.cur-badge svg { width: 13px; height: 13px; }
.cur-badge.other { background: rgba(57, 135, 229, .1); border-color: rgba(57, 135, 229, .4); color: var(--info-text); }
.type-ic svg { width: 14px; height: 14px; vertical-align: -2px; margin-inline-end: 4px; color: var(--muted); }
.date-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border); background: var(--input); font-size: 12px; }

.sel-bar {
    position: fixed; bottom: 18px; left: 50%; transform: translate(-50%, 150%); z-index: 40;
    display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: center;
    background: var(--surface-2); border: 1px solid rgba(237, 162, 31, .45); border-radius: 14px;
    padding: 10px 18px; box-shadow: 0 16px 40px var(--shadow-c); font-size: 14px; transition: transform .2s;
}
.sel-bar.open { transform: translate(-50%, 0); }

.acc-summary { margin: 18px 0 0; border-top: 1px solid var(--border); }
.acc-summary-head { display: flex; align-items: center; gap: 8px; padding: 16px 18px; font-size: 16px; font-weight: 700; background: linear-gradient(90deg, rgba(237, 162, 31, .1), transparent); }
.acc-summary-head svg { width: 18px; height: 18px; color: var(--gold-ink); }
.acc-summary-table th { text-align: center; background: var(--surface-2); }
.acc-summary-table th:first-child, .acc-summary-table td:first-child { text-align: start; }
.acc-summary-table td { text-align: center; }
.acc-summary-table tr.is-acc-cur td { background: rgba(237, 162, 31, .05); }
.sum-h { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-weight: 700; margin-inline-end: 4px; }
.sum-h.d { background: rgba(63, 185, 80, .2); color: var(--pos); }
.sum-h.c { background: rgba(229, 83, 75, .2); color: var(--neg); }
.sum-h.b { background: rgba(237, 162, 31, .2); color: var(--gold-ink); }
.sum-h svg { width: 12px; height: 12px; }
.cur-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-inline-end: 8px; }

@media (max-width: 900px) { .st-summary { grid-template-columns: repeat(2, 1fr); } }
@media print {
    .pill, .cur-badge, .date-badge { border-color: #999 !important; background: none !important; color: #000 !important; }
    .pill i { display: none; }
    .acc-summary-head { background: none; }
}

/* عرض جميع الحسابات */
.accounts-table th { background: var(--surface-2); }
.accounts-table td { padding: 10px 12px; }
.acc-code { font-size: 11px; color: var(--muted); }
.status-btn {
    min-width: 92px; padding: 7px 14px; border-radius: 8px; border: 0; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 700; transition: filter .15s, transform .1s;
}
.status-btn:hover { filter: brightness(1.12); }
.status-btn:active { transform: scale(.97); }
.status-btn.on { background: #2ea043; color: #fff; }
.status-btn.off { background: #e8721c; color: #fff; }

/* ================================================================
   الآلة الحاسبة العائمة (F2)
   ================================================================ */
.calc-toggle kbd, .calc-title kbd {
    font: 600 10px/1 var(--font); padding: 3px 5px; border-radius: 4px;
    background: var(--input); border: 1px solid var(--border); color: var(--muted);
}
.calc {
    position: fixed; z-index: 60; width: 320px; display: none; direction: ltr;
    background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--gold);
    border-radius: 14px; box-shadow: 0 24px 60px var(--shadow-c); user-select: none; outline: none;
}
.calc.open { display: block; animation: calcIn .14s ease-out; }
.calc:focus-within, .calc:focus { border-color: rgba(237, 162, 31, .55); }
@keyframes calcIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.calc.dragging { opacity: .92; cursor: grabbing; }
.calc-bar { direction: rtl; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; cursor: grab; touch-action: none; }
.calc-title { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.calc-bar-btns { display: flex; gap: 4px; }
.calc-bar-btns button { width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.calc-bar-btns button:hover { background: var(--surface-2); color: var(--text); }
.calc-screen { margin: 0 12px; padding: 10px 14px; background: var(--input); border: 1px solid var(--border); border-radius: 10px; text-align: right; min-height: 86px; }
.calc-mem { font-size: 11px; color: var(--gold-ink); min-height: 14px; }
.calc-expr { font-size: 13px; color: var(--muted); min-height: 20px; word-break: break-all; font-variant-numeric: tabular-nums; }
.calc-out { font-size: 30px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; overflow-x: auto; white-space: nowrap; user-select: text; }
.calc-out.err { font-size: 16px; color: var(--neg); padding-top: 10px; }
.calc-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 12px; }
.ck {
    height: 44px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text); font: 600 17px var(--font); cursor: pointer; transition: background .1s, transform .06s;
}
.ck:hover { background: var(--hover); }
.ck:active, .ck.hit { transform: scale(.95); background: var(--active); }
.ck.fn { color: var(--text-2); font-size: 15px; }
.ck.sm { font-size: 12px; height: 34px; color: var(--muted); }
.ck.op { color: var(--gold-ink); font-size: 20px; }
.ck.danger { color: var(--neg); }
.ck.eq { background: var(--gold); color: #1a1406; border-color: var(--gold); font-size: 22px; }
.ck.eq:hover { background: var(--gold-hover); }
.ck.tall { grid-row: span 2; height: auto; }
.ck.wide3 { grid-column: span 3; }
.calc-foot { padding: 0 12px 12px; }
.calc-foot button {
    width: 100%; padding: 9px; border-radius: 9px; border: 1px dashed rgba(237, 162, 31, .5);
    background: rgba(237, 162, 31, .08); color: var(--gold-ink); font: 600 13px var(--font); cursor: pointer; direction: rtl;
}
.calc-foot button:hover:not(:disabled) { background: rgba(237, 162, 31, .16); }
.calc-foot button:disabled { opacity: .4; cursor: not-allowed; border-color: var(--border); color: var(--muted); background: none; }
.calc-hist { display: none; margin: 10px 12px 0; max-height: 210px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--input); direction: rtl; }
.calc.show-hist .calc-hist { display: block; }
.hist-row { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--muted); font: 13px var(--font); cursor: pointer; text-align: start; direction: ltr; }
.hist-row strong { color: var(--text); }
.hist-row:hover { background: rgba(237, 162, 31, .08); }
.hist-clear { width: 100%; padding: 7px; border: 0; background: none; color: var(--neg); font: 12px var(--font); cursor: pointer; }
.hist-empty { padding: 14px; text-align: center; font-size: 12px; color: var(--muted); }
input.calc-filled { border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(237, 162, 31, .3) !important; }
@media (max-width: 500px) { .calc { width: calc(100vw - 16px); } }
@media print { .calc { display: none !important; } }

/* ================================================================
   فواتير المستودع
   ================================================================ */
.inv-title { font-size: 18px !important; }
.inv-title.inv-purchase { color: var(--neg); }
.inv-title.inv-sale { color: var(--pos); }
.inv-title.inv-transfer { color: var(--gold-ink); }
.inv-lines-panel, .inv-summary-panel { padding: 0; overflow: hidden; }
.inv-summary-panel > p { padding: 0 18px 16px; }
.inv-lines th, .inv-summary th { background: var(--surface-2); white-space: nowrap; }
.inv-lines td { padding: 8px; vertical-align: top; }
.inv-lines input, .inv-lines select { padding: 8px 10px; min-width: 90px; }
.inv-lines .bc-input { min-width: 150px; font-weight: 600; letter-spacing: .5px; }
.inv-lines .mat-cell { min-width: 200px; }
.inv-lines .mat-info { display: block; padding-top: 8px; font-size: 13px; }
.inv-lines .mat-sel + .mat-info:empty { display: none; }
.inv-lines input[readonly] { opacity: .7; background: var(--surface-2); }
.inv-lines tfoot td { background: var(--surface); border-top: 1px solid var(--border); }
.inv-lines .row-no { padding-top: 16px; }
.inv-lines .bc-msg { margin-top: 4px; min-height: 0; }
.inv-lines tr.row-bad .bc-input { border-color: var(--danger); }
.pill-missing { display: inline-block; padding: 6px 12px; border-radius: 8px; background: rgba(229, 83, 75, .15); color: var(--neg); font-size: 12px; font-weight: 600; }
.from-wh { padding-top: 16px !important; color: var(--text-2); }
.inv-summary th { text-align: start; font-weight: 600; color: var(--text-2); font-size: 13px; }
.inv-summary tbody th { background: transparent; }
.inv-summary td { padding: 8px; }
.inv-summary input, .inv-summary select { padding: 8px 10px; }
.inv-summary .sum-out { background: var(--surface-2); font-weight: 700; text-align: left; direction: ltr; }
.inv-summary .paid-row td, .inv-summary .paid-row th { background: rgba(237, 162, 31, .04); }
.inv-summary #paid_amount { font-weight: 700; direction: ltr; text-align: left; }
.remain-box { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); }
.inv-totals { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 18px; }
.inv-accounts { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.inv-sum-table { width: auto; min-width: 280px; }
.inv-sum-table td { padding: 7px 12px; }
.inv-sum-table td:last-child { text-align: left; }
.inv-sum-table tr.grand td { font-size: 17px; font-weight: 700; color: var(--gold-ink); border-top: 2px solid var(--border); }

/* إحصائيات الأصول */
.asset-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.a-tile {
    display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto auto; column-gap: 10px; row-gap: 2px;
    padding: 14px; border-radius: 12px; background: var(--input); border: 1px solid var(--border); color: var(--text);
}
a.a-tile:hover { border-color: rgba(237, 162, 31, .45); color: var(--text); }
.a-tile .a-ic { grid-row: span 3; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.a-tile .a-ic svg { width: 18px; height: 18px; }
.a-ic.buy { background: rgba(57, 135, 229, .14); color: var(--info-text); }
.a-ic.sell { background: rgba(237, 162, 31, .14); color: var(--gold-ink); }
.a-label { font-size: 12px; color: var(--muted); }
.a-tile strong { font-size: 19px; }
.a-sub { font-size: 11px; color: var(--muted); }
.a-hero.gain { border-color: rgba(63, 185, 80, .4); background: linear-gradient(180deg, rgba(63, 185, 80, .08), var(--input)); }
.a-hero.gain .a-ic { background: rgba(63, 185, 80, .15); color: var(--pos); }
.a-hero.loss { border-color: rgba(229, 83, 75, .4); background: linear-gradient(180deg, rgba(229, 83, 75, .08), var(--input)); }
.a-hero.loss .a-ic { background: rgba(229, 83, 75, .15); color: var(--neg); }
.a-top { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.a-bar-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: 12px; align-items: center; padding: 5px 0; font-size: 13px; }
.a-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-bar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.a-bar { display: block; height: 100%; background: #c98500; border-radius: 0 5px 5px 0; }
.a-bar.loss { background: #e5534b; }
@media (max-width: 700px) { .asset-tiles { grid-template-columns: 1fr 1fr; } .a-bar-row { grid-template-columns: 1fr auto; } .a-bar-track { display: none; } }

/* ================================================================
   توسيط محتوى الجداول تحت عناوينها (في كل النظام)
   ================================================================ */
.table th, .table td { text-align: center; }
.table td.wrap, .table td.st-note, .table .start { text-align: start; }
.table .actions { justify-content: center !important; }
.table td .status-btn, .table td .badge, .table td .pill { margin-inline: auto; }
.table td > .inline-form { display: inline-block; }

/* ================================================================
   صفحة الإحصائيات: تخطيط مرن بلا فراغات
   كل صف يتمدد ليملأ العرض، وأقسام الصف الواحد بنفس الارتفاع
   ================================================================ */
.dash-grid { display: flex !important; flex-wrap: wrap; gap: 18px; align-items: stretch; }
.dash-grid > .widget { flex: 1 1 320px; min-width: 0; margin: 0; display: flex; flex-direction: column; }
.dash-grid > .w-wide { flex: 2 1 640px; }
.dash-grid > .w-full { flex: 1 1 100%; }
.dash-grid > .widget > .panel-head { flex-shrink: 0; }
.dash-grid .box-list { max-height: 330px; flex: 1; }
.dash-grid .stat-list { flex: 1; justify-content: space-around; }
.dash-grid .profit-wrap { flex: 1; }
.dash-grid .recent-list { flex: 1; }
.dash-grid .bars { margin-top: auto; }

/* الملخص السريع */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.kpi {
    display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 1px;
    align-items: center; padding: 16px 18px; border-radius: 14px; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); opacity: .7; }
a.kpi:hover { border-color: rgba(237, 162, 31, .5); color: var(--text); transform: translateY(-1px); }
.kpi-ic { grid-row: span 3; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(237, 162, 31, .12); color: var(--gold-ink); }
.kpi-ic svg { width: 21px; height: 21px; }
.kpi-label { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi strong { font-size: 21px; line-height: 1.3; }
.kpi-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-gain::before { background: #3fb950; }
.kpi-gain .kpi-ic { background: rgba(63, 185, 80, .13); color: var(--pos); }
.kpi-loss::before { background: #e5534b; }
.kpi-loss .kpi-ic { background: rgba(229, 83, 75, .13); color: var(--neg); }
.kpi-loss strong { color: var(--neg); }

@media (max-width: 700px) {
    .dash-grid > .widget, .dash-grid > .w-wide { flex-basis: 100%; }
    .kpi-strip { grid-template-columns: 1fr 1fr; }
    .kpi { grid-template-columns: 1fr; }
    .kpi-ic { display: none; }
}

/* سجل حركة القطعة */
.asset-history { padding: 14px 18px; border-inline-start: 3px solid var(--gold); }
.ah-title { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; color: var(--text-2); }
.ah-title svg { width: 16px; height: 16px; color: var(--gold-ink); }
.asset-history .table th { background: transparent; }

/* ربط الحسابات + الموردون والزبائن */
.link-row { display: grid; grid-template-columns: 1fr minmax(260px, 420px); gap: 18px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.link-row:first-of-type { border-top: 0; }
.link-info { display: flex; flex-direction: column; gap: 4px; }
.party-parent { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 18px; border-radius: 10px; background: rgba(237, 162, 31, .07); border: 1px dashed rgba(237, 162, 31, .4); font-size: 14px; }
.party-parent svg { width: 18px; height: 18px; color: var(--gold-ink); }
@media (max-width: 900px) { .link-row { grid-template-columns: 1fr; } }
.badge-ret { background: rgba(144, 133, 233, .14); color: var(--violet-text); border-color: rgba(144, 133, 233, .35); }

/* فواتير المرتجع */
.ret-scan { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: rgba(144, 133, 233, .06); }
.ret-scan svg { width: 20px; height: 20px; color: var(--violet-text); flex-shrink: 0; }
.ret-scan input { max-width: 340px; font-weight: 600; }
.inv-lines tr.ret-off td { opacity: .55; }
.inv-lines tr.ret-off input[data-f] { pointer-events: none; }
.inv-lines tr.ret-na td { opacity: .35; }
.inv-lines tr:not(.ret-off):not(.ret-na) { background: rgba(144, 133, 233, .05); }
.inv-lines .ret-chk, #retAll { width: 18px; height: 18px; accent-color: #9085e9; cursor: pointer; }
.inv-title.inv-sale_return, .inv-title.inv-purchase_return { color: var(--violet-text); }

/* اختيار الطرف + الإضافة السريعة */
.party-pick { display: flex; gap: 6px; align-items: center; }
.party-pick .ts-wrapper { flex: 1; min-width: 0; }
.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .6); display: none; place-items: center; padding: 16px; }
.modal-back.open { display: grid; }
.modal { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--gold); border-radius: 14px; padding: 20px; box-shadow: 0 24px 60px var(--shadow-c); }

/* ================================================================
   مجموعات القائمة الجانبية القابلة للطي
   مطوية: الاسم كبير كزر رئيسي — مفتوحة: الاسم عنوان صغير وتحته الروابط
   ================================================================ */
.nav-group { margin-top: 2px; }
.nav-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: none; border: 0; cursor: pointer; font: inherit; text-align: start;
    padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 15px; font-weight: 600;
    transition: font-size .15s, color .15s, padding .15s, background .15s;
}
.nav-toggle:hover { background: var(--surface-2); color: var(--text); }
.nav-toggle svg { width: 15px; height: 15px; color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.nav-group.has-active > .nav-toggle { color: var(--gold-ink); }
.nav-items { display: none; }
.nav-group.open > .nav-items { display: block; }
/* مفتوحة: الاسم يصبح عنواناً صغيراً */
.nav-group.open > .nav-toggle { font-size: 11px; font-weight: 500; color: var(--muted); padding: 14px 10px 6px; letter-spacing: .5px; }
.nav-group.open > .nav-toggle:hover { background: none; color: var(--text-2); }
.nav-group.open > .nav-toggle svg { transform: rotate(-90deg); width: 12px; height: 12px; }
.nav-group.open.has-active > .nav-toggle { color: var(--muted); }

/* نافذة «إضافة مادة» دفعة واحدة */
.bulk-modal { max-width: 620px; }
.bk-grid { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; align-items: center; background: var(--input); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.bk-l { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.bk-l svg { width: 15px; height: 15px; color: var(--gold-ink); }
.bk-grid input[type=number], .bk-grid input:not([type]) { background: var(--surface); }
#bkAvail { display: block; margin-top: 4px; }
.seg { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 80px; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--muted); border: 1px solid transparent; transition: all .12s; }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: rgba(237, 162, 31, .14); border-color: rgba(237, 162, 31, .6); color: var(--gold-ink); font-weight: 700; box-shadow: 0 0 0 3px rgba(237, 162, 31, .1); }
.seg input:focus-visible + span { outline: 2px solid var(--gold); }
.btn-ok { background: #2ea043; color: #fff; padding: 10px 26px; }
.btn-ok:hover { background: #3fb950; color: #fff; }
.btn-ok:disabled { opacity: .6; cursor: wait; }
@media (max-width: 600px) { .bk-grid { grid-template-columns: 1fr; } }

/* جرد آخر المدة */
.create-box { margin-top: 14px; padding: 14px; border: 1px dashed rgba(237, 162, 31, .45); border-radius: 12px; background: rgba(237, 162, 31, .05); display: flex; flex-direction: column; gap: 4px; }
.create-box strong { display: flex; align-items: center; gap: 6px; }
.create-box strong svg { width: 16px; height: 16px; color: var(--gold-ink); }
.create-box .btn { align-self: flex-start; }
.close-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.entry-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.entry-preview > div { background: var(--input); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
@media (max-width: 800px) { .entry-preview { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- التقارير الشهرية */
.report-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; background: linear-gradient(135deg, rgba(237,162,31,.14), transparent 60%), var(--surface); }
.report-hero h2 { margin: 0 0 6px; font-size: 19px; }
.report-hero p { margin: 0; line-height: 1.8; }
.report-hero-ic { flex: 0 0 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--gold, #EDA21F); color: #1B1E23; }
.report-hero-ic svg { width: 28px; height: 28px; }
.report-form { margin-bottom: 18px; }
.report-form .seg { max-width: 360px; }
.report-form .btn svg { width: 18px; height: 18px; }
.report-sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.report-sheet { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, var(--tint)); }
.report-sheet i { flex: 0 0 6px; border-radius: 6px; }
.report-sheet b { display: block; margin-bottom: 4px; }
.report-sheet span { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ---------------------------------------------------------------- مصفوفة الصلاحيات */
.perm-head { margin: 8px 0 12px; }
.perm-head h3 { margin: 0 0 4px; font-size: 16px; }
.perm-module { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-bottom: 12px; overflow: hidden; }
.perm-module.simple { padding: 6px 14px; }
.perm-module.simple svg, .pm-title svg { width: 18px; height: 18px; color: var(--gold-ink); vertical-align: -3px; }
.perm-module > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: linear-gradient(90deg, rgba(237,162,31,.10), transparent 70%); }
.perm-module > summary::-webkit-details-marker { display: none; }
.perm-module > summary::before { content: '◂'; color: var(--gold-ink); transition: transform .2s; }
.perm-module[open] > summary::before { transform: rotate(-90deg); }
.pm-title { font-weight: 700; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.pm-presets { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.perm-sections { padding: 4px 14px 14px; display: grid; gap: 12px; }
.perm-section { border: 1px solid var(--border); border-radius: 10px; overflow: auto; background: var(--surface); }
.perm-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.perm-table th, .perm-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.perm-table tbody tr:last-child td { border-bottom: 0; }
.perm-table tbody tr:hover td { background: rgba(237,162,31,.04); }
.perm-table thead th { background: var(--tint); font-size: 13px; font-weight: 600; color: var(--muted); }
.perm-table thead .check { justify-content: center; padding: 0; }
.perm-table th.ps-title { text-align: right; width: 42%; }
.perm-table th.ps-title .check { justify-content: flex-start; color: var(--gold-ink); font-size: 14px; font-weight: 700; }
.perm-table td.pr-title { text-align: right; }
.perm-table td.pr-title .hint { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.perm-cell { display: inline-flex; cursor: pointer; }
.perm-cell input { position: absolute; opacity: 0; pointer-events: none; }
.perm-cell span { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border); background: var(--input); display: grid; place-items: center; transition: all .15s; }
.perm-cell input:checked + span { background: var(--gold); border-color: var(--gold); }
.perm-cell input:checked + span::after { content: '✓'; color: #1B1E23; font-weight: 800; font-size: 14px; }
.perm-cell input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------------------------------------------------------------- تذكيرات السداد */
.rem-empty { text-align: center; padding: 26px 0; margin: 0; }
.rem-note { max-width: 320px; white-space: normal; }
.rem-dim td { opacity: .55; }
.table tr.rem-paid td { background: rgba(63, 185, 80, .04); }
.rem-late-panel { border-color: rgba(229, 83, 75, .45); background: linear-gradient(180deg, rgba(229, 83, 75, .08), transparent 120px), var(--surface); }
.rem-late-panel .panel-head h2 svg { color: var(--neg); }
.rem-progress { display: block; height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.rem-progress i { display: block; height: 100%; background: linear-gradient(90deg, #2ea043, #56d364); border-radius: 5px; }
.rem-unit { display: grid; place-items: center; padding: 0 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.rem-preview { margin: 4px 0 14px; padding: 10px 14px; border-radius: 10px; background: rgba(237, 162, 31, .08); border: 1px dashed rgba(237, 162, 31, .4); color: var(--gold-ink); font-size: 14px; }
.rem-preview:empty { display: none; }
.rem-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.rem-chip { cursor: pointer; }
.rem-chip input { position: absolute; opacity: 0; pointer-events: none; }
.rem-chip span { display: inline-block; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--input); font-size: 13px; transition: all .15s; }
.rem-chip input:checked + span { background: rgba(237, 162, 31, .15); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
.rem-chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.rem-status { display: flex; flex-direction: column; gap: 8px; }
.rem-st { font-size: 14px; }
.rem-st.ok { color: var(--pos); }
.rem-st.bad { color: var(--neg); }
.rem-linkbox { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--input); border: 1px solid var(--border); }
.rem-code { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--input); border: 1px solid var(--border); overflow: auto; margin: 6px 0 10px; }
.rem-code code { flex: 1; white-space: nowrap; font-size: 13px; color: var(--gold-ink); }
.rem-steps { margin: 0 0 10px; padding-inline-start: 22px; line-height: 2; }
.rem-cur-head, .rem-cur-row { display: grid; grid-template-columns: 100px 1fr 100px 70px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.rem-cur-row.add { grid-template-columns: 100px 1fr 100px 70px auto; }
.rem-legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.rem-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.rem-cal-panel { padding: 12px; }
.rem-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rem-cal-h { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.rem-cal-d { min-height: 104px; border: 1px solid var(--border); border-radius: 10px; background: var(--input); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rem-cal-d.out { background: transparent; border-style: dashed; opacity: .35; }
.rem-cal-d.past { opacity: .72; }
.rem-cal-d.today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: rgba(237, 162, 31, .06); }
.rem-cal-n { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; }
.rem-cal-d.today .rem-cal-n span { background: var(--gold); color: #1B1E23; border-radius: 6px; padding: 0 7px; }
.rem-cal-add { opacity: 0; color: var(--gold-ink); font-size: 16px; line-height: 1; text-decoration: none; padding: 0 4px; }
.rem-cal-d:hover .rem-cal-add { opacity: 1; }
.rem-cal-it { display: block; font-size: 11.5px; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; color: var(--text); border-inline-start: 3px solid; }
.rem-cal-it.bill, .rem-legend i.bill { background: rgba(237, 162, 31, .12); border-color: var(--gold); }
.rem-cal-it.late, .rem-legend i.late { background: rgba(229, 83, 75, .14); border-color: #e5534b; }
.rem-cal-it.paid, .rem-legend i.paid { background: rgba(63, 185, 80, .12); border-color: #2ea043; }
.rem-cal-it.event, .rem-legend i.event { background: rgba(88, 166, 255, .12); border-color: #58a6ff; }
.rem-legend i.bill { background: var(--gold); } .rem-legend i.late { background: #e5534b; } .rem-legend i.paid { background: #2ea043; } .rem-legend i.event { background: #58a6ff; }
@media (max-width: 760px) {
    .rem-cal { gap: 3px; }
    .rem-cal-d { min-height: 64px; padding: 4px; }
    .rem-cal-it { font-size: 0; padding: 0; height: 6px; border-inline-start: 0; }
    .rem-cur-head { display: none; }
    .rem-cur-row, .rem-cur-row.add { grid-template-columns: 1fr 1fr; }
}

/* ================================================================ الثيم الفاتح */
:root[data-theme="light"] {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f1f3f7;
    --input: #f8f9fc;
    --border: #e3e7ee;
    --border-strong: #c8cfda;
    --text: #1c2027;
    --text-2: #3e4652;
    --muted: #6b7482;
    --faint: #9aa3b0;
    --gold: #eba21c;
    --gold-hover: #d98f0b;
    --gold-ink: #a66700;
    --gold-soft: #c48a2c;
    --danger: #cf2a33;
    --ok: #1f883d;
    --pos: #17803a;
    --neg: #c8262f;
    --info-text: #0b63c9;
    --violet-text: #6950c8;
    --hover: #eef1f6;
    --active: #e2e7ef;
    --tint: rgba(17, 24, 39, .03);
    --shadow-c: rgba(17, 24, 39, .12);
    color-scheme: light;
}
:root[data-theme="light"] body { background: radial-gradient(1200px 500px at 100% -10%, rgba(235, 162, 28, .07), transparent 60%), var(--bg); background-attachment: fixed; }
:root[data-theme="light"] .panel,
:root[data-theme="light"] .card,
:root[data-theme="light"] .kpi,
:root[data-theme="light"] .total-card,
:root[data-theme="light"] .widget { box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 18px rgba(17, 24, 39, .045); }
:root[data-theme="light"] .sidebar { background: #ffffff; box-shadow: -1px 0 0 var(--border), -8px 0 24px rgba(17, 24, 39, .03); border-left-color: transparent; }
:root[data-theme="light"] .brand { background: linear-gradient(180deg, rgba(235, 162, 28, .07), transparent); }
:root[data-theme="light"] .nav a.active { background: linear-gradient(90deg, rgba(235, 162, 28, .06), rgba(235, 162, 28, .16)); color: var(--gold-ink); font-weight: 600; box-shadow: inset -3px 0 0 var(--gold); }
:root[data-theme="light"] .topbar { background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
:root[data-theme="light"] .btn-primary { color: #2a1c00; box-shadow: 0 2px 8px rgba(235, 162, 28, .28); }
:root[data-theme="light"] .btn-ghost { background: #fff; }
:root[data-theme="light"] .btn-ghost:hover { background: var(--hover); }
:root[data-theme="light"] .badge { color: var(--text-2); }
:root[data-theme="light"] .table thead th { background: var(--surface-2); color: var(--text-2); }
:root[data-theme="light"] .table tbody tr:hover td { background: #fafbfd; }
:root[data-theme="light"] .auth-page { background: radial-gradient(900px 500px at 85% 0%, rgba(235, 162, 28, .14), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(11, 99, 201, .06), transparent 60%), var(--bg); }
:root[data-theme="light"] .modal-back { background: rgba(28, 32, 39, .35); backdrop-filter: blur(2px); }
:root[data-theme="light"] .perm-module > summary { background: linear-gradient(90deg, rgba(235, 162, 28, .10), transparent 70%); }
:root[data-theme="light"] .perm-table thead th { background: var(--surface-2); }
:root[data-theme="light"] .rem-cal-d { background: #fff; }
:root[data-theme="light"] .rem-cal-d.out { background: transparent; }
:root[data-theme="light"] .logo-text { background: linear-gradient(180deg, #c99a3a, #8f6414); -webkit-background-clip: text; background-clip: text; }
:root[data-theme="light"] ::selection { background: rgba(235, 162, 28, .28); }
body, .panel, .sidebar, .topbar, .kpi, .table td, .btn, input, select, textarea { transition: background-color .25s ease, border-color .25s ease, color .2s ease; }

/* ================================================================ قائمة المستخدم */
.user-menu { position: relative; }
.user-trigger {
    display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 10px; border-radius: 12px;
    background: transparent; border: 1px solid transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: right;
}
.user-trigger:hover, .user-menu.open .user-trigger { background: var(--surface-2); border-color: var(--border); }
.user-trigger .chev { width: 14px; height: 14px; color: var(--muted); transition: transform .2s; }
.user-menu.open .user-trigger .chev { transform: rotate(180deg); }
.name-wrap { display: flex; flex-direction: column; line-height: 1.25; }
.name-wrap b { font-weight: 600; }
.user-dd {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; z-index: 40;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px;
    box-shadow: 0 18px 40px var(--shadow-c); display: none; transform-origin: top left;
}
.user-menu.open .user-dd { display: block; animation: ddIn .14s ease-out; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.user-dd-head { display: flex; gap: 10px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-dd-head .avatar { width: 40px; height: 40px; font-size: 16px; }
.user-dd-head small { display: block; color: var(--muted); font-size: 12px; }
.user-dd a, .user-dd button.dd-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none;
    color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: right;
}
.user-dd a:hover, .user-dd button.dd-item:hover { background: var(--hover); color: var(--text); }
.user-dd svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.user-dd .dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.user-dd .dd-danger, .user-dd .dd-danger svg { color: var(--neg); }
.user-dd .dd-theme .dd-switch { margin-inline-start: auto; width: 34px; height: 20px; border-radius: 20px; background: var(--active); position: relative; transition: background .2s; }
.user-dd .dd-theme .dd-switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: right .2s; }
:root[data-theme="light"] .user-dd .dd-theme .dd-switch { background: var(--gold); }
:root[data-theme="light"] .user-dd .dd-theme .dd-switch::after { right: 17px; }
.theme-ic-sun, :root[data-theme="light"] .theme-ic-moon { display: inline-block; }
.theme-ic-moon, :root[data-theme="light"] .theme-ic-sun { display: none; }
@media (max-width: 700px) { .user-trigger .name-wrap { display: none; } }

/* ================================================================ الملف الشخصي */
.profile-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; position: relative; overflow: hidden; }
.profile-hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 90px; background: linear-gradient(120deg, rgba(237, 162, 31, .22), rgba(237, 162, 31, .04) 60%, transparent); pointer-events: none; }
.profile-avatar { width: 84px; height: 84px; border-radius: 22px; display: grid; place-items: center; font-size: 34px; font-weight: 700; background: linear-gradient(135deg, var(--gold), #c47f06); color: #1a1406; box-shadow: 0 10px 26px rgba(237, 162, 31, .3); position: relative; }
.profile-hero h2 { margin: 0; font-size: 22px; position: relative; }
.profile-hero .ph-title { color: var(--gold-ink); font-weight: 600; position: relative; }
.profile-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 18px; }
.profile-meta div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.profile-meta span { display: block; font-size: 12px; color: var(--muted); }
.profile-meta b { font-weight: 600; }
.pp-module { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.pp-module > h3 { margin: 0; padding: 12px 16px; font-size: 15px; display: flex; align-items: center; gap: 8px; background: linear-gradient(90deg, rgba(237, 162, 31, .10), transparent 70%); }
.pp-module > h3 svg { width: 18px; height: 18px; color: var(--gold-ink); }
.pp-module > h3 .badge { margin-inline-start: auto; }
.pp-rows { padding: 6px 16px 12px; }
.pp-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.pp-row:last-child { border-bottom: 0; }
.pp-row .pp-sec { font-size: 12px; color: var(--muted); }
.pp-acts { display: flex; gap: 5px; flex-wrap: wrap; }
.pp-act { font-size: 12px; padding: 2px 10px; border-radius: 20px; border: 1px solid var(--border); color: var(--faint); }
.pp-act.on { background: rgba(63, 185, 80, .1); border-color: rgba(63, 185, 80, .35); color: var(--pos); }

/* ================================================================ تسجيلات السيستم */
.act-panel .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.act-panel .panel-head h2 svg { width: 18px; height: 18px; color: var(--gold-ink); }
.act-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.act-filters .chip { padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.act-list { list-style: none; margin: 0; padding: 0; }
.act-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 6px; border-bottom: 1px solid var(--border); position: relative; }
.act-item:last-child { border-bottom: 0; }
.act-item:hover { background: var(--tint); border-radius: 10px; }
.act-ic { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--muted); }
.act-ic svg { width: 17px; height: 17px; }
.act-ic.sm { width: 26px; height: 26px; border-radius: 7px; vertical-align: middle; }
.act-ic.sm svg { width: 14px; height: 14px; }
.act-ic.k-create { background: rgba(63, 185, 80, .13); color: var(--pos); }
.act-ic.k-update { background: rgba(237, 162, 31, .14); color: var(--gold-ink); }
.act-ic.k-delete { background: rgba(229, 83, 75, .13); color: var(--neg); }
.act-ic.k-info { background: rgba(57, 135, 229, .13); color: var(--info-text); }
.act-ic.k-auth { background: rgba(144, 133, 233, .14); color: var(--violet-text); }
.act-body { flex: 1; min-width: 0; }
.act-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.act-det { font-size: 13px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-meta { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.act-meta svg { width: 13px; height: 13px; }
.act-meta .dot { opacity: .5; }
.act-mod { font-size: 11px; padding: 1px 8px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.act-mod.m-accounting { color: var(--gold-ink); border-color: rgba(237, 162, 31, .35); background: rgba(237, 162, 31, .08); }
.act-mod.m-sales { color: var(--info-text); border-color: rgba(57, 135, 229, .35); background: rgba(57, 135, 229, .08); }
.act-mod.m-reminders { color: var(--violet-text); border-color: rgba(144, 133, 233, .35); background: rgba(144, 133, 233, .08); }
.act-mod.m-packages { color: var(--pos, #2fa36b); border-color: rgba(47, 163, 107, .35); background: rgba(47, 163, 107, .08); }
.act-mod.m-spm { color: var(--info-text); border-color: rgba(57, 135, 229, .35); background: rgba(57, 135, 229, .08); }
.act-mod.m-system { color: var(--text-2); background: var(--surface-2); }
.act-eye { align-self: center; flex-shrink: 0; }
.act-eye.disabled { opacity: .3; cursor: not-allowed; }
.act-eye:not(.disabled):hover { color: var(--gold-ink); border-color: var(--gold); }
.act-day { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.act-day .icon-btn svg { width: 16px; height: 16px; }
.act-day .act-next svg { transform: rotate(180deg); }
.act-day-input { display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--border); border-radius: 20px; background: var(--input); }
.act-day-input svg { width: 15px; height: 15px; color: var(--gold-ink); flex-shrink: 0; }
.act-day-input input { border: 0 !important; background: transparent !important; padding: 5px 0 !important; width: auto; font-size: 13px; box-shadow: none !important; }
.act-day-note { display: flex; align-items: center; gap: 6px; padding: 8px 12px; margin-bottom: 6px; border-radius: 10px; background: rgba(237, 162, 31, .08); border: 1px dashed rgba(237, 162, 31, .35); color: var(--text-2); }
.act-day-note svg { width: 15px; height: 15px; color: var(--gold-ink); }
@media (max-width: 900px) { .act-day { margin-inline-start: 0; } }
.act-mod.m-contracts { color: var(--pos); border-color: rgba(63, 185, 80, .35); background: rgba(63, 185, 80, .08); }

/* ================================================================
   زبائن الباقات
   ================================================================ */
.pk-seg { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--input); }
.pk-seg label { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; cursor: pointer; font-size: 14px; border-inline-end: 1px solid var(--border); }
.pk-seg label:last-child { border-inline-end: 0; }
.pk-seg label:has(input:checked) { background: rgba(237, 162, 31, .14); color: var(--gold-ink); font-weight: 600; }
.pk-prow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.pk-prow input { text-align: right; }
.pk-portal-box { border: 1px dashed var(--border); border-radius: 12px; padding: 14px 16px; margin: 6px 0 14px; background: var(--surface-2); }
.pk-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; align-items: end; padding: 14px 18px 4px; }
.pk-filter-acts { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 14px; }
.pk-chip { font-size: 12px; padding: 2px 9px; margin: 2px; display: inline-flex; gap: 4px; align-items: center; }
.pk-prof { padding: 18px; }
.pk-prof-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pk-av { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-weight: 700; background: linear-gradient(135deg, rgba(237, 162, 31, .25), rgba(237, 162, 31, .08)); color: var(--gold-ink); border: 1px solid rgba(237, 162, 31, .35); flex-shrink: 0; }
.pk-id { flex: 1; min-width: 0; }
.pk-id h2 { margin: 0 0 4px; font-size: 19px; }
.pk-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pk-kv > div { background: var(--input); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.pk-kv > div.wide { grid-column: 1 / -1; }
.pk-kv span { font-size: 12px; color: var(--muted); }
.pk-own { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px; }
.pk-own.sub { background: rgba(88, 166, 255, .12); color: #58a6ff; border: 1px solid rgba(88, 166, 255, .35); }
.pk-own.co { background: rgba(63, 185, 80, .1); color: var(--pos); border: 1px solid rgba(63, 185, 80, .35); }
.pk-orph { display: flex; flex-direction: column; gap: 10px; }
.pk-move { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pk-move select { width: auto; min-width: 220px; }
.pk-calc { font-size: 13px; color: var(--text-2); margin: -4px 0 10px; line-height: 1.9; }
.pk-total { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; margin-bottom: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.pk-total b { font-size: 18px; }
.pk-total.final { background: rgba(237, 162, 31, .1); border-color: rgba(237, 162, 31, .4); }
.pk-total.final b { color: var(--gold-ink); }
.pk-entry-note { padding: 10px 12px; border-radius: 10px; background: var(--input); border: 1px solid var(--border); margin-bottom: 14px; line-height: 1.9; }
.pk-entry-note svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--gold-ink); }
.pk-portal { min-height: 100vh; background: var(--bg); }
.pk-ptop { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.pk-ptop-in, .pk-pmain { max-width: 1100px; margin: 0 auto; padding: 12px 16px; }
.pk-ptop-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pk-brand { display: flex; align-items: center; gap: 10px; }
.pk-brand img { height: 34px; }
.pk-pmain { padding-top: 18px; padding-bottom: 40px; }
.pk-reqs { gap: 0 16px; }
@media (max-width: 900px) {
    .pk-filter { grid-template-columns: 1fr; }
    .pk-kv { grid-template-columns: 1fr; }
    .pk-prow { grid-template-columns: 1fr 110px auto; }
    .pk-prof-head { flex-wrap: wrap; }
}
@media print { .pk-filter, .pk-move { display: none !important; } }

/* ================================================================
   مركز الإشعارات (الجرس)
   ================================================================ */
.notif { position: relative; }
.notif-btn {
    position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); transition: border-color .15s, color .15s;
}
.notif-btn:hover, .notif.open .notif-btn { border-color: var(--gold); color: var(--gold-ink); }
.notif-btn svg { width: 19px; height: 19px; }
.notif-count {
    position: absolute; top: -6px; inset-inline-end: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
    background: var(--neg); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--surface);
}
.notif-dd {
    position: absolute; top: calc(100% + 8px); left: 0; width: 380px; max-width: calc(100vw - 24px); z-index: 41;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 40px var(--shadow-c);
    display: none; overflow: hidden; transform-origin: top left;
}
.notif.open .notif-dd { display: block; animation: ddIn .14s ease-out; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: min(460px, 70vh); overflow-y: auto; padding: 4px 6px 8px; }
.notif-group { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 10px 8px 4px; font-weight: 600; }
.notif-group svg { width: 14px; height: 14px; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 8px; border-radius: 10px; color: var(--text); position: relative; }
.notif-item:hover { background: var(--hover); color: var(--text); }
.notif-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--muted); }
.notif-ic svg { width: 16px; height: 16px; }
.notif-item.lv-danger .notif-ic { background: rgba(229, 83, 75, .12); color: var(--neg); }
.notif-item.lv-warn .notif-ic { background: rgba(237, 162, 31, .14); color: var(--gold-ink); }
.notif-item.lv-info .notif-ic { background: rgba(88, 166, 255, .12); color: #58a6ff; }
.notif-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; line-height: 1.45; }
.notif-txt b { font-weight: 600; }
.notif-txt small { color: var(--muted); font-size: 12px; }
.notif-item.is-new::after { content: ''; position: absolute; top: 14px; inset-inline-end: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.notif-item.is-new .notif-txt { padding-inline-end: 14px; }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 10px; color: var(--muted); font-size: 13px; }
.notif-empty svg { width: 26px; height: 26px; color: var(--pos); }
@media print { .notif { display: none !important; } }

/* خانات الأقسام القادمة في الصفحة الرئيسية */
.card-soon { position: relative; border-style: dashed; background: transparent; opacity: .75; cursor: default; }
.card-soon .ic { background: var(--surface-2); color: var(--muted); }
.card-soon .soon-badge { position: absolute; top: 14px; inset-inline-end: 14px; font-size: 11px; padding: 2px 9px; border-radius: 20px; background: rgba(237, 162, 31, .12); color: var(--gold-ink); border: 1px solid rgba(237, 162, 31, .3); }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cards-4 { grid-template-columns: 1fr; } }

/* ================================================================
   التوقيع الإلكتروني (أزرار وصفحة المتابعة)
   ================================================================ */
.es-btn { white-space: nowrap; }
.es-btn.es-signed { background: rgba(63, 185, 80, .14); color: var(--pos); border: 1px solid rgba(63, 185, 80, .45); }
.es-btn.es-signed:hover { background: rgba(63, 185, 80, .22); color: var(--pos); }
.es-btn.es-pending { background: rgba(237, 162, 31, .12); color: var(--gold-ink); border: 1px solid rgba(237, 162, 31, .4); }
.es-btn.es-rejected { background: rgba(229, 83, 75, .1); color: var(--neg); border: 1px solid rgba(229, 83, 75, .35); }
.es-btn svg { width: 15px; height: 15px; }
.es-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.es-kv > div { background: var(--input); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.es-kv span { font-size: 12px; color: var(--muted); }
.es-kv small { color: var(--muted); font-size: 12px; }
.es-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 6px; }
.es-tl-h { font-size: 14px; margin: 18px 0 8px; }
.es-tl { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--border); }
.es-tl li { position: relative; padding: 6px 16px 10px; }
.es-tl li::before { content: ''; position: absolute; inset-inline-start: -7px; top: 11px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); }
.es-tl li.t-signed::before { background: var(--pos); border-color: var(--pos); }
.es-tl li.t-rejected::before, .es-tl li.t-cancelled::before, .es-tl li.t-otp_fail::before { background: var(--neg); border-color: var(--neg); }
.es-tl li.t-viewed::before, .es-tl li.t-sent::before, .es-tl li.t-resent::before { background: var(--gold); border-color: var(--gold); }
.es-tl small { display: block; color: var(--muted); font-size: 12px; }
.es-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-2); margin: 4px 0 14px; cursor: pointer; }
.es-check input { margin-top: 4px; }
.es-check small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.es-steps { background: var(--input); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; line-height: 1.9; }
.es-steps ol { margin: 6px 0; padding-inline-start: 20px; }
@media (max-width: 900px) { .es-kv { grid-template-columns: 1fr; } }

/* رمز QR للعقد (صفحة عرض العقد) */
.qr-panel { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.qr-code { background: #fff; border-radius: 12px; padding: 8px; line-height: 0; border: 1px solid var(--border); }
.qr-off { width: 120px; height: 120px; display: grid; place-items: center; align-content: center; gap: 6px; color: #999; line-height: 1.2; font-size: 13px; }
.qr-off svg { width: 30px; height: 30px; }
.qr-info { flex: 1; min-width: 240px; }
.qr-info h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.qr-info h2 svg { width: 18px; height: 18px; color: var(--gold-ink); }
.qr-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; margin: 8px 0 10px; }
.qr-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.qr-log { margin-top: 10px; }
.qr-log ul { margin: 6px 0 0; padding-inline-start: 18px; }

/* ===================================================== بوابة موظفي المبيعات */
.sp-portal [hidden], .sp-checks[hidden] { display: none !important; }
.sp-me { display: flex; gap: 10px; align-items: center; padding: 6px 10px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.sp-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(237, 162, 31, .16); color: var(--gold-ink); font-weight: 700; flex-shrink: 0; }
.sp-sell { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.sp-sell .sp-scan { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sp-scan-in { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 2px solid var(--gold); border-radius: 12px; background: var(--input); }
.sp-scan-in svg { width: 24px; height: 24px; color: var(--gold-ink); flex-shrink: 0; }
.sp-scan-in input { border: 0; background: transparent; font-size: 20px; padding: 14px 0; outline: 0; box-shadow: none; }
.sp-msg { width: 100%; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.sp-msg.good { background: rgba(63, 185, 80, .12); color: var(--pos); }
.sp-msg.bad { background: rgba(229, 83, 75, .12); color: var(--neg); }
.sp-cart .sp-empty { text-align: center; padding: 24px 0; margin: 0; }
.sp-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) 150px 34px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.sp-item:first-child { border-top: 0; }
.sp-item .rn { color: var(--muted); font-size: 13px; text-align: center; }
.sp-it-name { display: flex; flex-direction: column; min-width: 0; }
.sp-it-name small { color: var(--muted); text-align: right; }
.sp-price { text-align: left; }
.sp-pin { text-align: left; border-color: var(--gold) !important; }
.sp-pay { position: sticky; top: 80px; }
.sp-total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 14px; margin-bottom: 12px; border-bottom: 1px dashed var(--border); }
.sp-total b { font-size: 26px; color: var(--gold-ink); }
.sp-paysel { flex-wrap: wrap; margin-bottom: 12px; }
.sp-errs { background: rgba(229, 83, 75, .1); color: var(--neg); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 10px; line-height: 1.7; }
.sp-cam { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); z-index: 100; display: grid; place-items: center; }
.sp-cam-in { position: relative; width: min(92vw, 520px); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.sp-cam video { width: 100%; border-radius: 12px; background: #000; }
.sp-cam-line { position: absolute; left: 8%; right: 8%; top: 40%; height: 2px; background: #e5534b; box-shadow: 0 0 8px #e5534b; }
.sp-ret { padding: 10px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 12px; line-height: 1.8; }
.sp-ret.good { background: rgba(63, 185, 80, .1); }
.sp-ret.bad { background: rgba(229, 83, 75, .1); color: var(--neg); }
.sp-receipt { max-width: 640px; }
.sp-r-head { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.sp-r-head img { max-height: 48px; max-width: 120px; object-fit: contain; }
.sp-r-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin-bottom: 14px; }
.sp-r-kv span { display: block; font-size: 12px; color: var(--muted); }
.sp-link-box { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.sp-checks { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.sp-checks label { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13.5px; background: var(--surface-2); }
.sp-checks label:has(input:checked) { border-color: var(--gold); background: rgba(237, 162, 31, .1); }
.sp-all { display: flex; gap: 6px; align-items: center; font-size: 14px; margin: 4px 0 8px; cursor: pointer; }
.sp-decide { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-decide input, .sp-decide select { width: auto; min-width: 140px; }
@media (max-width: 900px) {
    .sp-sell { grid-template-columns: 1fr; }
    .sp-pay { position: static; }
    .sp-item { grid-template-columns: 24px minmax(0, 1fr) 110px 30px; }
}
@media print {
    .sp-portal .sidebar, .sp-portal .topbar, .sp-noprint { display: none !important; }
    .sp-portal .content { padding: 0; }
    .sp-receipt { border: 0; box-shadow: none; max-width: none; }
}
.sp-link-box svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--gold-ink); }
.sp-receipt tfoot th { color: var(--text); font-size: 15px; font-weight: 700; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
/* تحذير انخفاض المخزون */
.low-alert svg { width: 16px; height: 16px; vertical-align: -3px; }
.low-panel { border-color: rgba(229, 83, 75, .45); }
.low-panel .panel-head h2 { color: var(--neg); }
.low-line { padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; }
.low-line:first-of-type { border-top: 0; }
.sp-low-n { background: rgba(229, 83, 75, .15) !important; color: var(--neg) !important; }
.sp-bell { position: relative; }
.sp-bell > summary { list-style: none; cursor: pointer; }
.sp-bell > summary::-webkit-details-marker { display: none; }
.sp-bell-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 40; width: min(320px, 86vw); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; box-shadow: 0 12px 30px var(--shadow-c); }
.sp-bell-menu a { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 8px; color: var(--text); margin-top: 6px; }
.sp-bell-menu a:hover { background: rgba(237, 162, 31, .1); }
.sp-bell-menu a svg { width: 18px; height: 18px; color: var(--neg); flex-shrink: 0; margin-top: 2px; }
.sp-bell-menu a span { display: flex; flex-direction: column; font-size: 13.5px; }
.sp-bell-menu small { color: var(--muted); }
.sp-portal .topbar .group { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.sp-bell { display: inline-block; }
/* سند القبض في البوابة */
.sp-cust { position: relative; }
.sp-cust-list { position: absolute; top: 100%; inset-inline: 0; z-index: 30; max-height: 280px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px var(--shadow-c); margin-top: 4px; padding: 4px; }
.sp-cust-list a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); font-size: 14px; }
.sp-cust-list a:hover { background: rgba(237, 162, 31, .12); }
.sp-cust-list small { color: var(--muted); }
.sp-col-box { border: 1px dashed var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.sp-col-row { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; font-size: 14px; }
.sp-col-row span { color: var(--muted); }
.sp-col-row b { font-size: 17px; }
.sp-col-rest { border-top: 1px solid var(--border); margin: 2px 0 10px; padding-top: 10px; }
.sp-col-rest b { font-size: 20px; }
.sp-sigs { display: flex; justify-content: space-between; gap: 20px; margin-top: 34px; font-size: 13px; color: var(--muted); }
.sp-sigs div { flex: 1; text-align: center; border-top: 1px dashed var(--border); padding-top: 6px; }
/* الأفرع */
.tenant-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: rgba(237, 162, 31, .12); color: var(--gold-ink); border: 1px solid rgba(237, 162, 31, .35); white-space: nowrap; }
.tenant-chip svg { width: 14px; height: 14px; }
.tenant-chip a { color: var(--text); text-decoration: underline; }
.act-mod.act-tenant { color: var(--text-2); background: var(--surface-2); }
/* لوحة السوبر أدمن */
.sd-tenants { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sd-tenant { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); }
.sd-tenant:hover { border-color: var(--gold); color: var(--text); }
.sd-tenant svg { width: 18px; height: 18px; color: var(--gold-ink); }
.sd-tenant .small { color: var(--gold-ink); }
.sd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .sd-grid { grid-template-columns: 1fr; } }
.sd-card { margin-bottom: 0; }
.sd-t { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0 6px; border-top: 1px solid var(--border); font-size: 14.5px; }
.sd-card .panel-head + .sd-t { border-top: 0; }
.sd-l { display: flex; justify-content: space-between; gap: 10px; padding: 3px 12px 3px 0; font-size: 13px; color: var(--text-2); }
.sd-soon { opacity: .75; border-style: dashed; }
.sd-soon .soon-badge { font-size: 11px; padding: 2px 9px; border-radius: 20px; background: rgba(237, 162, 31, .12); color: var(--gold-ink); border: 1px solid rgba(237, 162, 31, .3); }
.sr-group td { background: var(--surface-2); text-align: right !important; color: var(--gold-ink); }
.topbar > div:first-child { min-width: 0; flex-wrap: nowrap; }
.tenant-chip { flex-shrink: 0; }
@media (max-width: 700px) { .tenant-chip .tc-out { display: none; } }

/* خانة باركود مع زر الكاميرا */
.scan-in { display: flex; gap: 8px; align-items: stretch; }
.scan-in input { flex: 1; min-width: 0; }
.scan-in .scan-btn { white-space: nowrap; flex: none; }
.sp-cam-msg { color: #fff; font-size: 14px; text-align: center; }
.sp-cam[hidden] { display: none !important; }
.act-mod.m-tech { color: var(--warn-text, #b7791f); border-color: rgba(214, 158, 46, .35); background: rgba(214, 158, 46, .08); }

/* بوابة فنيي الأبراج */
.tw-whs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.tw-wh p { margin: 4px 0 0; color: var(--text-2); }
.tw-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.tw-arrow { font-size: 22px; color: var(--accent, #d69e2e); padding-bottom: 14px; }
@media (max-width: 560px) { .tw-route { grid-template-columns: 1fr; } .tw-arrow { display: none; } }
.tw-decide { display: flex; flex-direction: column; gap: 6px; min-width: 210px; }
.tw-decide form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tw-decide form input { flex: 1; min-width: 120px; }
.tw-decide details summary { list-style: none; display: inline-flex; cursor: pointer; }
.tw-decide details summary::-webkit-details-marker { display: none; }
.tw-decide details[open] summary { margin-bottom: 6px; }
.tw-decide textarea { width: 100%; }

/* زر الكاميرا بجانب خانة الباركود في شاشة البيع (حتى على الهاتف) */
.sp-sell .sp-scan { flex-wrap: nowrap; }
.sp-scan-in { min-width: 0; }
.sp-scan-in input { min-width: 0; width: 100%; }
#camBtn { flex: none; align-self: stretch; white-space: nowrap; }
@media (max-width: 560px) { .sp-scan-in input { font-size: 16px; } #camBtn { padding-inline: 12px; } }

/* مبيعات الإنترنت (مفرق) */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 18px; }
.kv-grid > div { display: flex; flex-direction: column; gap: 3px; }
.rt-days { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 8px; overflow-x: auto; }
.rt-day { flex: 1; min-width: 14px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.rt-bar { width: 100%; max-width: 26px; background: var(--gold); border-radius: 4px 4px 0 0; opacity: .85; }
.rt-day small { font-size: 10px; color: var(--muted); }
.act-mod.m-retail { color: var(--info-text); border-color: rgba(57, 135, 229, .35); background: rgba(57, 135, 229, .08); }

/* أزرار عقد المشترك في أقسام المبيعات */
.ct-subbtns { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ct-subbtns .btn { white-space: nowrap; }

/* روابط ظاهرة دائماً أسفل القسم (دون قائمة منسدلة) */
.nav-flat { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.ep-box { border-color: rgba(237, 162, 31, .35); }
.ep-logins { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }

/* بوابة الموظف */
.ep-switch { position: relative; }
.ep-switch > summary { list-style: none; cursor: pointer; }
.ep-switch > summary::-webkit-details-marker { display: none; }
.ep-switch-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 50; min-width: 230px; background: var(--surface, #fff); border: 1px solid var(--border, #ddd); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.ep-switch-menu a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: inherit; font-weight: 600; }
.ep-switch-menu a:hover { background: rgba(237, 162, 31, .12); }
.ep-switch-menu .small { padding: 2px 10px 6px; }
.ep-punch { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px; }
.ep-clock { font-size: 54px; font-weight: 700; line-height: 1; letter-spacing: 1px; }
.ep-punch-btn { font-size: 18px; padding: 14px 28px; min-width: 220px; justify-content: center; }
.ep-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.ep-qr svg { width: 260px; height: 260px; background: #fff; padding: 10px; border-radius: 12px; }
.ep-pay-net { font-size: 18px; font-weight: 700; }
@media print { .ep-qr-print-hide { display: none !important; } }
@media (max-width: 640px) {
    .ep-sw-long { display: none; }
    .sp-portal .topbar h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
    .ep-clock { font-size: 44px; }
}
.sp-portal .panel .kpi-label, .kpi-strip .kpi-label { white-space: normal; overflow: visible; text-overflow: clip; }
/* تقويم أيام العطل */
.ep-cal { max-width: 460px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.ep-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ep-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.ep-cal-wd { text-align: center; font-size: 11px; color: var(--muted, #888); padding-bottom: 2px; }
.ep-cal-day { border: 1px solid var(--border); border-radius: 8px; padding: 9px 0; text-align: center; cursor: pointer; font-weight: 600; background: transparent; color: inherit; font-family: inherit; }
.ep-cal-day.ep-c-work:hover { border-color: #eda21f; }
.ep-cal-day:disabled { cursor: not-allowed; }
.ep-c-off { background: rgba(255,255,255,.06) !important; color: var(--muted, #888) !important; }
.ep-c-hol { background: rgba(229, 72, 77, .18) !important; border-color: rgba(229, 72, 77, .6) !important; color: #ff8a8e !important; }
.ep-cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.ep-cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border); vertical-align: middle; }
.ep-cal-legend i.ep-c-work { background: transparent; }
.ep-cal-legend #epCalCount { margin-inline-start: auto; font-weight: 700; }
.alert-warn { background: rgba(237, 162, 31, .12); border: 1px solid rgba(237, 162, 31, .45); color: #f3c26b; }
.alert-warn a { color: inherit; font-weight: 700; text-decoration: underline; }
/* نافذة سند القبض/الدفع السريع */
.pv-modal { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pv-modal[hidden] { display: none; }
.pv-box { width: 100%; max-width: 620px; margin: 0; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.sp-cam-msg.ok { color: #6ee787; font-weight: 700; font-size: 16px; }
.sp-cam-msg.bad { color: #ff8a8e; font-weight: 700; font-size: 16px; }
.sp-cam-msg.warn { color: #f3c26b; font-weight: 700; font-size: 16px; }
.stk-msg { min-height: 24px; font-weight: 700; font-size: 16px; text-align: center; }
.stk-msg.ok { color: var(--pos); } .stk-msg.bad { color: var(--neg); } .stk-msg.warn { color: #f3c26b; }

/* ===== التقويم (مثل تقويم الهاتف) ===== */
.rem-cal-wrap { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .rem-cal-wrap { grid-template-columns: 1fr; } }
a.rem-cal-d { color: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s; }
a.rem-cal-d:hover { border-color: var(--gold); }
.rem-cal-d.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(237, 162, 31, .45); }
.rem-cal-h .sm { display: none; }
.rem-cal-count { font-style: normal; font-size: 10px; min-width: 18px; height: 18px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.rem-cal-it { --c: #58a6ff; background: color-mix(in srgb, var(--c) 16%, transparent); border-color: var(--c) !important; }
.rem-cal-it.done { text-decoration: line-through; opacity: .55; }
.rem-more { font-size: 11px; }
.rem-agenda { position: sticky; top: 80px; }
.rem-ag-it { --c: #58a6ff; display: flex; gap: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); border-inline-start: 4px solid var(--c); margin-bottom: 10px; background: var(--input); }
.rem-ag-time { min-width: 74px; color: var(--muted); font-weight: 700; padding-top: 2px; }
.rem-ag-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rem-ag-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rem-ag-head .icon-btn { margin-inline-start: auto; }
.rem-ag-title { font-weight: 700; color: var(--text); text-decoration: none; }
.rem-ag-it.done .rem-ag-title { text-decoration: line-through; color: var(--muted); }
.rem-ag-it.done { opacity: .75; }
.rem-ag-note { color: var(--muted); white-space: normal; }
.rem-ag-who { display: flex; flex-wrap: wrap; gap: 6px; }
.rem-who { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.rem-who.on { background: rgba(63, 185, 80, .14); border-color: rgba(63, 185, 80, .5); color: var(--pos); text-decoration: line-through; }
.rem-who:disabled { cursor: default; }
.rem-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.rem-file { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 12.5px; color: var(--text); text-decoration: none; background: var(--surface-2); }
.rem-file a { color: inherit; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.rem-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; }
.rem-chip-btn { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.rem-chip-btn.on { background: rgba(237, 162, 31, .15); border-color: var(--gold); color: var(--gold-ink); font-weight: 700; }
@media (max-width: 640px) {
    .rem-cal-h .lg { display: none; } .rem-cal-h .sm { display: inline; }
    .rem-cal-it { font-size: 0; padding: 0; height: 5px; border-inline-start: 0 !important; background: var(--c); border-radius: 3px; }
    .rem-cal-it.done { opacity: .35; }
    .rem-cal-count { display: none; }
    .rem-agenda { position: static; }
    .rem-ag-it { flex-direction: column; gap: 4px; }
}
.inv-import { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 14px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; }
.inv-import #xlsMsg { flex-basis: 100%; }
.inv-import #xlsMsg:empty { display: none; }
/* قارئ الباركود: قراءة منطقة الخط الأحمر فقط + تأكيد القراءة */
.sp-cam-view { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: #000; line-height: 0; }
.sp-cam-view video { width: 100%; display: block; border-radius: 0; }
.sp-cam-mask { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.sp-cam-win { position: relative; width: 84%; height: 22%; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 0 0 2000px rgba(0, 0, 0, .45); }
.sp-cam .sp-cam-line { position: absolute; left: 4%; right: 4%; top: 50%; height: 2px; margin-top: -1px; background: #e5534b; box-shadow: 0 0 8px #e5534b; }
.sp-cam.full .sp-cam-win { width: 70%; height: auto; aspect-ratio: 1; max-height: 80%; }
.sp-cam.full .sp-cam-line { display: none; }
.sp-cam-confirm { width: 100%; background: #1b1e23; border: 1px solid #2a2e35; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sp-cam-confirm[hidden] { display: none !important; }
.sp-cam-code { font-size: 22px; font-weight: 700; text-align: center; color: #fff; letter-spacing: 1px; word-break: break-all; background: #111317; border-radius: 8px; padding: 10px; }
.sp-cam-btns { display: flex; gap: 10px; }
.sp-cam-btns .btn { flex: 1; justify-content: center; padding: 12px; font-size: 16px; }
/* قارئ الباركود: الكاميرا بحجم محدود حتى يظهر الرقم والأزرار على شاشة الهاتف */
.sp-cam { align-items: start; overflow-y: auto; padding: 12px 0; }
.sp-cam-in { gap: 10px; max-height: none; }
.sp-cam-view { height: min(42vh, 68vw); max-height: 360px; }
.sp-cam-view video { height: 100%; object-fit: cover; }
.sp-cam-win { height: 34%; }
.sp-cam.full .sp-cam-win { width: auto; height: 78%; aspect-ratio: 1; }
@media (min-height: 800px) { .sp-cam { align-items: center; } }

/* بوابة فنيي الأبراج: أقسام القائمة والإشعارات غير المقروءة */
.tw-nav-sec { font-size: 11px; font-weight: 500; color: var(--muted); padding: 14px 10px 4px; letter-spacing: .5px; }
.nav a.tw-nav-sub { padding-inline-start: 22px; }
.tw-one { max-width: 640px; margin: 0 auto; }
.sp-bell-menu a.tw-new { background: var(--gold-soft, rgba(201,162,39,.12)); }
.sp-bell-menu a.tw-new b::after { content: ' •'; color: var(--gold); }
.table tr:target td { background: var(--gold-soft, rgba(201,162,39,.16)); }

/* صف المسار مع أزرار سريعة بجانبه (مثل رابط بوابة الموظفين) */
.crumb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -8px 0 16px; }
.crumb-row .breadcrumb { margin: 0; }
.crumb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-chip { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px 4px 3px 10px; }
.link-chip > svg { width: 15px; height: 15px; color: var(--gold-ink); flex-shrink: 0; }
.link-chip-l { font-size: 12px; color: var(--muted); white-space: nowrap; }
.link-chip input { background: transparent; border: 0; color: var(--text); font-size: 13px; width: 230px; padding: 4px 2px; outline: none; }
@media (max-width: 640px) { .crumb-actions, .link-chip { width: 100%; box-sizing: border-box; min-width: 0; } .link-chip input { flex: 1; width: auto; min-width: 0; } }
@media print { .crumb-actions { display: none; } }
.kpi.kpi-sel { border-color: rgba(237, 162, 31, .6); box-shadow: 0 0 0 3px rgba(237, 162, 31, .1); }
.sd-grid > .sd-wide { grid-column: 1 / -1; }
.sd-scroll { max-height: 420px; overflow-y: auto; }

/* ================================================================
   هيكل الفرع: الأقسام، لوحة الخطة، القائمة الثابتة، الإعدادات، الطلبات
   ================================================================ */
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cards-3 { grid-template-columns: 1fr; } }
.nav-sep { border-top: 1px solid var(--border); margin: 8px 0; }
.nav a .nav-badge { margin-inline-start: auto; background: #e5534b; color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; line-height: 20px; padding: 0 6px; border-radius: 10px; text-align: center; }
.nav a .nav-badge[hidden] { display: none; }
.nav-preq { margin-top: 10px; }
.preq-tabs .chip svg { width: 14px; height: 14px; vertical-align: -2px; }
.preq-n { background: #e5534b; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-inline-start: 4px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.set-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 600; transition: border-color .15s; }
.set-tile:hover { border-color: var(--gold); color: var(--gold-ink); }
/* لوحة جدول الخطة الشهرية (المكان 1) */
.plan-w { margin-bottom: 18px; }
.plan-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .plan-cols { grid-template-columns: 1fr; } }
.plan-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-height: 90px; }
.plan-over { border-color: rgba(229, 83, 75, .45); }
.plan-today { border-color: rgba(237, 162, 31, .45); }
.plan-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.plan-over .plan-h b { color: #e5534b; }
.plan-today .plan-h b { color: var(--gold-ink); }
.plan-it { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border); color: var(--text); }
.plan-it:first-of-type { border-top: 0; }
.plan-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--gold)); flex-shrink: 0; }
.plan-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan-t b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-t b svg { width: 13px; height: 13px; vertical-align: -2px; }
.plan-t small { color: var(--muted); font-size: 12px; }
.plan-it.is-done .plan-t b { text-decoration: line-through; color: var(--muted); }
.plan-it .inline-form .btn { padding: 3px 10px; }
.crumb-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.crumb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.crumb-tabs .chip { padding: 4px 12px; font-size: 12.5px; }
/* إنشاء المستخدم: الوظائف المتعددة، البوابات، أدوات الصلاحيات */
.job-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.job-g { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); }
.job-g small { display: block; margin-bottom: 6px; }
.ep-auto { display: flex; align-items: center; gap: 6px; color: var(--pos); }
.ep-auto svg { width: 16px; height: 16px; }
.perm-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 12px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 12px 12px 0; margin-bottom: 14px; }
.perm-sec-title { font-size: 13px; font-weight: 700; color: var(--gold-ink); margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
/* ملف الموظف، الإنجازات، تنبيهات البصمة، قسيمة الراتب */
.prof-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.prof-av { width: 58px; height: 58px; border-radius: 50%; background: rgba(237, 162, 31, .15); color: var(--gold-ink); display: grid; place-items: center; font-size: 24px; font-weight: 700; flex-shrink: 0; }
.prof-main { flex: 1; min-width: 220px; }
.prof-main h2 { margin: 0 0 2px; font-size: 19px; }
.prof-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--text-2); }
.prof-meta svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--muted); }
.prof-scroll { max-height: 460px; overflow-y: auto; }
.ach-list { display: flex; flex-direction: column; }
.ach-day { font-size: 12px; color: var(--muted); font-weight: 600; margin: 10px 0 4px; }
.ach-day:first-child { margin-top: 0; }
.ach-it { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.ach-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); flex-shrink: 0; }
.ach-ic svg { width: 16px; height: 16px; }
.ach-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ach-t b { font-size: 13.5px; font-weight: 600; }
.ach-t small { color: var(--muted); font-size: 12px; }
.alert-list { display: flex; flex-direction: column; gap: 6px; }
.al-it { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 13px; border-inline-start: 3px solid var(--muted); }
.al-it svg { width: 15px; height: 15px; flex-shrink: 0; }
.al-out { border-color: #eda21f; } .al-absent { border-color: #e5534b; } .al-late { border-color: #a371f7; }
.payslip { max-width: 720px; margin: 0 auto 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }
.ps-head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--gold); padding-bottom: 12px; margin-bottom: 14px; }
.ps-head img { height: 48px; }
.ps-who { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ps-who div { display: flex; flex-direction: column; }
.ps-net td { border-top: 2px solid var(--border); font-size: 16px; }
.ps-sign { display: flex; justify-content: space-between; margin-top: 30px; text-align: center; font-size: 13px; }
@media print { .no-print, .sidebar, .topbar, .breadcrumb, .crumb-row { display: none !important; } .payslip { border: 0; } }
.ep-batch { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ep-until summary { cursor: pointer; color: var(--muted); margin-top: 4px; }
/* التقويم الموحّد: الطبقات وشريط إنجاز الخطة */
.cal-layers { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; font-size: 13px; }
.cal-layer { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-2); }
.cal-layer input { accent-color: var(--c); }
.cal-layer i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.rem-cal-it.xl { background: color-mix(in srgb, var(--c) 14%, transparent); border-color: var(--c); }
.plan-prog { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13.5px; }
.plan-bar { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.plan-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3fb950, #2ea043); }

/* ===================== المهام وخدمة العملاء ===================== */
.badge-info { background: rgba(79, 139, 214, .12); color: #4f8bd6; border-color: rgba(79, 139, 214, .35); }
.cs-kind { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 2px 9px 2px 8px; border-radius: 20px; white-space: nowrap;
    color: var(--k); background: color-mix(in srgb, var(--k) 12%, transparent); border: 1px solid color-mix(in srgb, var(--k) 35%, transparent); }
.cs-kind svg { width: 14px; height: 14px; }
.cs-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cs-tabs .chip b { margin-inline-start: 4px; font-weight: 700; }
.chip.chip-alert:not(.active) { border-color: rgba(229, 83, 75, .45); color: var(--neg); }
.cs-filter { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cs-table tr.cs-late td:first-child { box-shadow: inset -3px 0 0 #e5534b; }
.cs-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.cs-kpick { cursor: pointer; }
.cs-kpick input { position: absolute; opacity: 0; pointer-events: none; }
.cs-kpick span { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; height: 100%; transition: border-color .15s, background .15s; }
.cs-kpick svg { width: 20px; height: 20px; color: var(--k); }
.cs-kpick small { color: var(--muted); font-size: 12px; }
.cs-kpick input:checked + span { border-color: var(--k); background: color-mix(in srgb, var(--k) 10%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--k) 15%, transparent); }
.cs-subpick { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--gold); border-radius: 10px; background: rgba(237, 162, 31, .06); }
.cs-subres { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 320px; overflow: auto; }
.cs-subres button { text-align: start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; }
.cs-subres button:hover { border-color: var(--gold); }
.cs-subres small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.cs-head { display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; }
.cs-head-main { flex: 1; min-width: 260px; }
.cs-head-t { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cs-no { font-size: 20px; font-weight: 800; color: var(--gold-ink); }
.cs-head h2 { font-size: 18px; margin: 8px 0 4px; }
.cs-details { margin: 4px 0 8px; color: var(--text-2); line-height: 1.7; }
.cs-head-side { min-width: 240px; display: flex; flex-direction: column; gap: 10px; }
.cs-who { display: flex; gap: 10px; align-items: flex-start; }
.cs-who > svg { width: 20px; height: 20px; color: var(--gold-ink); margin-top: 4px; }
.cs-who div { display: flex; flex-direction: column; }
.cs-assign { display: flex; gap: 6px; }
.cs-review { border-color: rgba(63, 185, 80, .45); }
.cs-review-f, .cs-actions form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cs-review-f input, .cs-actions input[name=note] { flex: 1; min-width: 220px; }
.cs-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cs-grid { grid-template-columns: 1fr; } }
.cs-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; }
.cs-kv > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-kv span { font-size: 12px; color: var(--muted); }
.cs-kv small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.cs-live, .cs-addr, .cs-linksub { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cs-linksub { flex-direction: column; align-items: stretch; }
.cs-addr svg { width: 16px; height: 16px; color: var(--gold-ink); }
.cs-sla { margin-bottom: 12px; }
.cs-sla-h { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.cs-bar { height: 7px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.cs-bar i { display: block; height: 100%; background: var(--gold); border-radius: 5px; }
.cs-bar.ok i { background: #3fb950; }
.cs-bar.late i { background: #e5534b; }
.cs-times { margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 10px; }
.cs-linkfee { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; flex-wrap: wrap; }
.cs-noteform { display: flex; gap: 8px; margin-bottom: 12px; }
.cs-noteform input { flex: 1; }
.cs-timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--border); }
.cs-timeline li { position: relative; padding: 0 16px 14px; }
.cs-timeline li::before { content: ''; position: absolute; inset-inline-start: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold); }
.cs-timeline li.ev-closed::before { border-color: #3fb950; background: #3fb950; }
.cs-timeline li.ev-returned::before, .cs-timeline li.ev-reopened::before { border-color: #e5534b; }
.cs-timeline li.ev-note::before { border-color: var(--muted); }
.cs-tl-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.cs-tl-n { margin-top: 4px; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; font-size: 13.5px; line-height: 1.6; }
.cs-kindbar { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.cs-kindbar a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); }
.cs-kindbar a:hover { border-color: var(--k); }
.cs-kindbar svg { width: 18px; height: 18px; color: var(--k); }
.cs-kindbar span { flex: 1; font-size: 13.5px; }
.cs-kindbar b { font-size: 18px; }
.cs-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: flex-start; }
.cs-col { flex: 0 0 260px; background: var(--surface-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.cs-col-un { border: 1px dashed rgba(237, 162, 31, .55); }
.cs-col-h { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.cs-col-h .small { flex-basis: 100%; }
.cs-card { display: flex; flex-direction: column; gap: 4px; padding: 9px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); border-inline-start: 3px solid var(--k); color: var(--text); }
.cs-card:hover { border-color: var(--gold); }
.cs-card.late { box-shadow: 0 0 0 1px rgba(229, 83, 75, .5); }
.cs-card.rev { opacity: .8; }
.cs-card-h, .cs-card-f { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.cs-card-c { font-weight: 600; font-size: 13.5px; display: flex; gap: 5px; align-items: center; }
.cs-card-c svg, .cs-card-f svg { width: 14px; height: 14px; color: var(--k); }
.cs-recent { list-style: none; margin: 0; padding: 0; }
.cs-recent li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); align-items: baseline; flex-wrap: wrap; }
.cs-recent li span:nth-child(2) { flex: 1; }
.cs-json { font-size: 11.5px; max-width: 420px; max-height: 260px; overflow: auto; background: var(--surface-2); padding: 8px; border-radius: 8px; text-align: left; }
.cs-subpanel-empty { color: var(--muted); font-size: 13px; margin: 0; }
.cs-inv { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.cs-inv-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.cs-inv-items { list-style: none; margin: 8px 0 0; padding: 0; }
.cs-inv-items li { display: flex; gap: 10px; align-items: center; padding: 4px 0; border-top: 1px dashed var(--border); font-size: 13px; }
.cs-inv-items li span:first-child { flex: 1; }
.cs-inv-items code { font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.cs-subpick[hidden], .cs-subsearch[hidden], .cs-form [hidden] { display: none !important; }

/* ===================== بوابة مهام الفنيين ===================== */
.tk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tk-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--k); color: var(--text); }
.tk-card:hover { border-color: var(--gold); }
.tk-card.late { box-shadow: 0 0 0 1px rgba(229, 83, 75, .55); }
.tk-card.ret { background: rgba(229, 83, 75, .05); }
.tk-card-h, .tk-card-f { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-card-c { font-size: 16px; }
.tk-card-f svg { width: 14px; height: 14px; vertical-align: -2px; }
.tk-head { border-inline-start: 4px solid var(--k); }
.tk-head-t { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-head h2 { font-size: 20px; margin: 8px 0 4px; }
.tk-desc { margin: 4px 0; line-height: 1.7; }
.tk-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; margin: 6px 0; }
.tk-meta svg { width: 14px; height: 14px; vertical-align: -2px; }
.tk-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tk-actions input[name=note] { width: 100%; margin-bottom: 10px; }
.tk-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-btns .btn-lg { flex: 1; min-width: 140px; justify-content: center; padding: 12px 14px; font-size: 15px; }
.tk-scan { margin-bottom: 12px; }
.tk-mode { margin-bottom: 8px; }
.tk-scan-row { display: flex; gap: 8px; }
.tk-scan-row input { flex: 1; font-size: 16px; }
.tk-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.tk-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.tk-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tk-upload input[name=note] { flex: 1; min-width: 160px; }
.tk-sign { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px dashed var(--border); border-radius: 12px; }
.tk-sign canvas { width: 100%; height: auto; background: #fff; border-radius: 8px; border: 1px solid var(--border); touch-action: none; cursor: crosshair; }
.tk-mat summary { display: flex; gap: 10px; align-items: center; cursor: pointer; list-style: none; }
.tk-mat summary b { flex: 1; }
.tk-bcs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tk-bcs code { font-size: 12.5px; background: var(--surface-2); padding: 3px 8px; border-radius: 6px; }
.cs-techs select { min-width: 150px; }
@media (max-width: 640px) { .tk-list { grid-template-columns: 1fr; } .tk-head h2 { font-size: 18px; } }
.tk-items { list-style: none; margin: 0; padding: 0; }
.tk-items li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tk-it-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-it-m code { font-size: 12px; color: var(--muted); }
.tk-it-p { min-width: 60px; text-align: end; }
.tk-total { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; font-size: 13px; color: var(--muted); }
.tk-total b { color: var(--text); font-size: 15px; }
.cs-inst .inst-h { font-size: 14.5px; margin: 16px 0 8px; display: flex; gap: 6px; align-items: center; color: var(--gold-ink); border-top: 1px dashed var(--border); padding-top: 12px; }
.cs-inst .inst-h svg { width: 16px; height: 16px; }
.inst-user { display: flex; gap: 6px; align-items: center; }
.inst-user input { flex: 1; }
.inst-realm { font-size: 12.5px; padding: 3px 8px; border-radius: 8px; background: rgba(79, 139, 214, .12); color: #4f8bd6; white-space: nowrap; }
.inst-phone { display: flex; gap: 6px; }
.inst-phone select { width: 110px; flex: none; }
.inst-phone input { flex: 1; }
.inst-svcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.inst-svcs label { cursor: pointer; }
.inst-svcs input { position: absolute; opacity: 0; pointer-events: none; }
.inst-svcs span { display: flex; flex-direction: column; gap: 3px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.inst-svcs small { color: var(--muted); font-size: 12px; }
.inst-svcs input:checked + span { border-color: var(--gold); background: rgba(237, 162, 31, .08); box-shadow: 0 0 0 3px rgba(237, 162, 31, .12); }
.tk-steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 14px; overflow-x: auto; }
.tk-steps li { flex: 1; min-width: 62px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; position: relative; }
.tk-steps li span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.tk-steps li span svg { width: 15px; height: 15px; }
.tk-steps li small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.tk-steps li.done span { background: #3fb950; border-color: #3fb950; color: #fff; }
.tk-steps li.cur span { background: var(--gold); border-color: var(--gold); color: #1a1205; box-shadow: 0 0 0 4px rgba(237, 162, 31, .2); }
.tk-steps li.cur small { color: var(--text); font-weight: 700; }
.cs-steps { margin-top: 14px; }
.tk-wz-nav { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.tk-wz-nav .btn-lg { width: 100%; justify-content: center; padding: 13px; font-size: 15.5px; }
.tk-wz-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.tk-fail summary { list-style: none; cursor: pointer; }
.tk-fail[open] form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 260px; }
.tk-creds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tk-creds > div { padding: 12px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.tk-creds span { font-size: 12px; color: var(--muted); }
.tk-creds b { font-size: 17px; word-break: break-all; }
.tk-copy { user-select: all; }
.tk-warn { display: flex; gap: 8px; align-items: center; border-color: rgba(237, 162, 31, .5); }
.tk-warn svg { color: var(--gold-ink); flex: none; }
.tk-cam { position: relative; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 10px; }
.tk-cam video { width: 100%; display: block; max-height: 60vh; object-fit: cover; }
.tk-snap { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); }
#tkPrev { width: 100%; border-radius: 12px; margin-bottom: 10px; }
.tk-shot .tk-btns label.btn { cursor: pointer; flex: 1; justify-content: center; }
.tk-contract { max-height: 55vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; background: #fff; }
.tk-due { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px; border-radius: 14px; background: rgba(63, 185, 80, .08); border: 1px solid rgba(63, 185, 80, .35); }
.tk-due b { font-size: 30px; color: var(--pos); }
.tk-due span, .tk-due small { color: var(--muted); font-size: 13px; }
.cs-shots { margin-top: 12px; }
.cs-shots .tk-photos { margin-top: 6px; }
@media (max-width: 640px) { .tk-creds { grid-template-columns: 1fr; } }
.cs-sub-ph { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.cs-sub-ph a { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.cs-sub-ph img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.cs-sub-ph small { font-size: 11.5px; color: var(--muted); }
@media (max-width: 640px) {
    .tk-steps { gap: 2px; overflow: visible; }
    .tk-steps li { min-width: 0; }
    .tk-steps li span { width: 24px; height: 24px; font-size: 12px; }
    .tk-steps li small { font-size: 9.5px; }
    .tk-steps li:not(.cur) small { display: none; }
    .tk-steps li.cur small { white-space: nowrap; }
}
.cs-shots-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cs-shots-row .tk-photos { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
.tk-postpone { margin-top: 10px; }
.tk-postpone summary { list-style: none; cursor: pointer; width: 100%; justify-content: center; }
.tk-postpone[open] form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.cs-pp { display: inline-flex; gap: 6px; align-items: center; }
.cs-pp input { width: auto; }
.cs-qassign { display: flex; gap: 6px; }
.cs-qassign select { width: auto; min-width: 130px; }
.chip-arch { margin-inline-start: auto; }
.cs-techtabs .chip svg, .cs-tabs .chip svg { width: 14px; height: 14px; vertical-align: -2px; }
.cs-techhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cs-techhead h2 { display: flex; gap: 8px; align-items: center; font-size: 18px; }

/* مسارات فحص الشبكة وإلغاء الاشتراك */
.cs-flow { border-inline-start: 4px solid var(--brand, #eda21f); }
.cs-flow-gold { background: color-mix(in srgb, #eda21f 7%, var(--panel, #fff)); }
.cs-flow-f { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.cs-flow-f .group { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-netres { padding: 10px 12px; border-radius: 10px; background: var(--bg, #f6f6f6); border: 1px solid var(--border); }
.cs-netres p { margin: 6px 0 0; line-height: 1.8; }

/* عارض الصور */
html.lb-on { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 9999; background: rgba(8, 9, 12, .97); backdrop-filter: blur(4px); display: flex; flex-direction: column; }
.lb[hidden] { display: none; }
.lb-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #fff; }
.lb-cap { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-cnt { font-size: 13px; opacity: .75; direction: ltr; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 12px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); user-select: none; }
.lb-nav { display: flex; justify-content: center; gap: 16px; padding: 14px; }
.lb-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; text-decoration: none; }
.lb-btn:hover { background: #eda21f; border-color: #eda21f; color: #111; }
.lb-nav .lb-btn { width: 56px; height: 56px; font-size: 32px; }
.cs-ids { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cs-ids .chip { font-size: 12px; cursor: default; }
.cs-ids .chip code { font-size: 11px; opacity: .7; }
.cs-ids-miss { color: var(--danger, #e5484d); border-color: currentColor; }

/* بحث المشتركين في شريط الصفحة (قسم المهام) */
.tb-search { position: relative; flex: 1; max-width: 460px; margin: 0 16px; }
.tb-search input { width: 100%; height: 38px; padding: 0 38px 0 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg, #15171c); color: inherit; font: inherit; font-size: 14px; }
.tb-search input:focus { outline: none; border-color: #eda21f; box-shadow: 0 0 0 3px rgba(237, 162, 31, .15); }
.tb-search .tb-s-ic { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); width: 17px; height: 17px; opacity: .55; pointer-events: none; }
.tb-search kbd { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); opacity: .6; }
.tb-search input:focus ~ kbd { display: none; }
.tb-s-dd { position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 60; max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .35); padding: 6px; }
.tb-s-it { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.tb-s-it.on, .tb-s-it:hover { background: rgba(237, 162, 31, .1); }
.tb-s-m { flex: 1; min-width: 0; }
.tb-s-m .small { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-s-new { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--border); white-space: nowrap; }
.tb-s-new:hover { background: #eda21f; color: #111; border-color: #eda21f; }
.tb-s-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
    .topbar:has(.tb-search) { height: auto; min-height: 60px; flex-wrap: wrap; row-gap: 0; padding-bottom: 10px; }
    .topbar:has(.tb-search) > div:first-child, .topbar:has(.tb-search) .user-box { height: 60px; }
    .tb-search { order: 3; flex: 0 0 100%; max-width: none; margin: 0; }
    .tb-search kbd { display: none; }
}

/* إحصائيات المتاجرة ← مستودعات الموظفين */
.stf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.stf-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg, transparent); }
.stf-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.stf-tot { margin-inline-start: auto; font-size: 13px; color: var(--muted); }
.stf-tot b { color: var(--text, inherit); font-size: 15px; }
.stf-card .small svg { width: 13px; height: 13px; vertical-align: -2px; }
.stf-items { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow: auto; }
.stf-items li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 8px; border-radius: 6px; background: rgba(127, 127, 127, .07); }
.stf-dh { display: flex; align-items: center; gap: 6px; font-size: 15px; margin: 18px 0 10px; }
.stf-dh svg { width: 16px; height: 16px; }
.sub-sec-h { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 22px 0 12px; }
.sub-sec-h svg { width: 18px; height: 18px; color: #eda21f; }

/* إعدادات المهام ← أنواع المهام وأسعارها حسب الخدمة */
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.tt-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.tt-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tt-h code { font-size: 11px; opacity: .6; }
.tt-t { width: 100%; border-collapse: collapse; }
.tt-t th { font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; padding: 2px 4px; }
.tt-t td { padding: 3px 4px; }
.tt-t input:not([type=checkbox]) { width: 100%; height: 34px; padding: 0 8px; font-size: 13px; }
.tt-t .tt-p { width: 80px; }
.tt-t .tt-c { text-align: center; width: 44px; }
.tt-t tr.muted input { opacity: .55; }
.tt-t tr.tt-new input::placeholder { color: #eda21f; opacity: .7; }

/* موظفو خدمة العملاء */
.css-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.css-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.css-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.css-open { margin-inline-start: auto; }
.css-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.css-r { display: flex; align-items: flex-start; gap: 8px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; font-size: 13px; }
.css-r:has(input:checked) { border-color: #eda21f; background: rgba(237, 162, 31, .08); }
.css-r input { margin-top: 2px; }
.css-r small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.css-perm { background: rgba(127, 127, 127, .05); }
@media (max-width: 560px) { .css-roles { grid-template-columns: 1fr; } }
/* أيام الغياب */
.abs-days { display: flex; flex-wrap: wrap; gap: 6px; }
.abs-d { display: inline-flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px 8px; border-radius: 9px; border: 1px solid rgba(229, 72, 77, .45); background: rgba(229, 72, 77, .08); }
.abs-d b { font-size: 14px; }
.abs-d small { font-size: 11px; color: var(--muted); }
/* بوابة الموظف ← مهامي المفتوحة */
.ep-open { display: flex; flex-direction: column; gap: 8px; }
.ep-open-it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-inline-start: 4px solid var(--c, #eda21f); border-radius: 10px; }
.ep-open-m { flex: 1; min-width: 0; }
.ep-open-n { margin-top: 4px; color: var(--muted); }
/* التقويم ← إنجازات كل موظف (مطوية) */
.rem-grp-h { display: flex; align-items: center; gap: 6px; margin: 14px 0 8px; }
.rem-grp-h svg { width: 14px; height: 14px; }
.rem-grp { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.rem-grp > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.rem-grp > summary::-webkit-details-marker { display: none; }
.rem-grp > summary::before { content: '‹'; font-size: 18px; line-height: 1; color: var(--muted); transition: transform .15s; }
.rem-grp[open] > summary::before { transform: rotate(-90deg); }
.rem-grp > summary:hover { background: rgba(127, 127, 127, .06); }
.rem-grp-n { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.rem-grp-n svg { width: 15px; height: 15px; color: #3fb950; }
.rem-grp-c { display: flex; gap: 4px; flex-wrap: wrap; }
.rem-grp > .rem-ag-it { margin: 0 10px 8px; }
/* الإشعارات: تحديث ومسح */
.notif-head { gap: 8px; }
.notif-head > b { margin-inline-end: auto; }
.notif-tools { display: flex; gap: 4px; }
.notif-tools .icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; }
.notif-tools .icon-btn:hover { color: var(--gold-ink); border-color: var(--gold); }
.notif-tools .icon-btn svg { width: 15px; height: 15px; }
.notif-tools #notifClear:hover { color: var(--neg); border-color: var(--neg); }
.notif-tools .spin svg { animation: nspin .7s linear infinite; }
@keyframes nspin { to { transform: rotate(-360deg); } }
/* إشعارات الجوال */
.push-btn svg { width: 16px; height: 16px; }
.push-btn.push-on { color: var(--pos, #3fb950); border-color: rgba(63, 185, 80, .5); }
.push-btn[disabled] { opacity: .6; cursor: default; }
@media (max-width: 760px) { .push-btn:not(.notif-push) .push-l { display: none; } }
.notif-foot { border-top: 1px solid var(--border); padding: 8px; }
.notif-push { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px; border-radius: 9px; border: 1px dashed var(--border); background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.notif-push:hover { color: var(--gold-ink); border-color: var(--gold); }
.notif-push.push-on { border-style: solid; }
.cs-raw { margin-top: 6px; }
.cs-raw summary { cursor: pointer; }
.cs-raw pre { max-height: 180px; overflow: auto; background: rgba(127, 127, 127, .08); padding: 8px; border-radius: 8px; font-size: 11px; white-space: pre-wrap; word-break: break-all; text-align: left; }

/* أجهزة التركيب: اختيار القطع في طلب التركيب، وصرفها في المستودع */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.mat-row { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; opacity: .75; }
.mat-row.on { opacity: 1; border-color: var(--gold); background: var(--gold-soft); }
.mat-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.mat-opts select { flex: 1; min-width: 120px; }
.inst-pick { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.inst-pick legend { padding: 0 6px; }
.inst-scan { width: 100%; max-width: 360px; margin-bottom: 8px; }
.inst-scan.neg { border-color: var(--danger, #c0392b); }
.inst-av { display: flex; flex-wrap: wrap; gap: 6px; }
.inst-av .chip { cursor: pointer; }
.inst-av .chip input:disabled + span { opacity: .5; }
.inst-req { margin: 10px 0; }
.mat-row.on, .mat-row.on b, .mat-row.on .small, .mat-row.on .muted, .mat-row.on .check { color: #111; }

/* خلية بسطرين في إحصائيات المفرق: نقدي / حوالات */
.rt-split { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.rt-split span { white-space: nowrap; }
.rt-split small { color: var(--muted); display: inline-block; min-width: 44px; }
/* فاتورة شراء خرجت بعض قطعها: القطعة المقفلة يُعدّل سعرها فقط */
.inv-lines tr.row-locked { background: rgba(237, 162, 31, .06); }
.inv-lines tr.row-locked .bc-input { opacity: .8; }
.inv-lines select.locked-sel { pointer-events: none; opacity: .75; }
/* ملف مشترك الجملة: فلترة الشهر وميغات الشهر بجانب البريد المغذي */
.pk-kv > div.pk-wide2 { grid-column: span 2; }
.pk-mfilter { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.pk-mfilter input[type="month"] { width: auto; padding: 6px 10px; }
.pk-mfilter + * { margin-inline-start: 0 !important; }
.pk-open-row td { background: var(--input); }
@media (max-width: 760px) { .pk-kv > div.pk-wide2 { grid-column: auto; } .pk-mfilter { margin-inline-start: 0; width: 100%; } }
/* تفصيل ميغات الشهر: المثبتة + فرق الغراف = كامل الباقة */
.pk-kv > div.pk-meg { gap: 8px; }
.pk-meg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pk-meg-total { font-size: 20px; color: var(--gold-ink); font-variant-numeric: tabular-nums; }
.pk-meg-total small { font-size: 12px; color: var(--muted); font-weight: 500; }
.pk-meg-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--border); }
.pk-meg-bar i { display: block; height: 100%; transition: width .3s; }
.pk-meg-bar i.p, .pk-meg .dot.p { background: #3b82f6; }
.pk-meg-bar i.g, .pk-meg .dot.g { background: #eda21f; }
.pk-meg .dot.u { background: #8b5cf6; }
.pk-meg-rows { display: grid; gap: 4px; }
.pk-meg-rows > div { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 8px; font-size: 13px; }
.pk-meg-rows .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pk-kv .pk-meg-rows span { font-size: 13px; color: var(--text); }
.pk-meg-rows b { font-variant-numeric: tabular-nums; }
.pk-meg-rows em { font-style: normal; font-size: 11px; color: var(--muted); min-width: 62px; text-align: left; }
.pk-meg-rows > div.u { padding-top: 4px; border-top: 1px dashed var(--border); opacity: .9; }
/* بوابة مشترك الجملة (تطبيق ويب): جرس الإشعارات وقائمتها */
.pk-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); background: var(--input); }
.pk-bell svg { width: 18px; height: 18px; }
.pk-bell.has { color: var(--gold-ink); border-color: rgba(237, 162, 31, .5); }
.pk-bell .num { position: absolute; top: -6px; inset-inline-start: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.pk-nlist { display: grid; gap: 8px; }
.pk-nitem { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--input); color: var(--text); text-decoration: none; }
.pk-nitem p { margin: 0 0 4px; line-height: 1.7; }
.pk-nitem .pk-ndot { flex: 0 0 9px; height: 9px; margin-top: 8px; border-radius: 50%; background: transparent; }
.pk-nitem.unread { border-color: rgba(237, 162, 31, .55); }
.pk-nitem.unread p { font-weight: 600; }
.pk-nitem.unread .pk-ndot { background: var(--gold-ink); box-shadow: 0 0 0 4px rgba(237, 162, 31, .15); }
.pk-nitem.open { border-color: var(--gold-ink); }
.pk-quick { margin-top: 4px; }
.pk-qa { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); }
.pk-qa svg { width: 22px; height: 22px; color: var(--gold-ink); }
.pk-ios-tip { position: fixed; inset-inline: 12px; bottom: 12px; z-index: 50; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--gold-ink); box-shadow: 0 8px 30px rgba(0,0,0,.35); display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.pk-ios-tip[hidden] { display: none; }
/* ملف المشترك (الإدارة): زر الجرس ونافذة الإشعارات */
.pk-ntf { position: relative; }
.pk-ntf > summary { list-style: none; cursor: pointer; }
.pk-ntf > summary::-webkit-details-marker { display: none; }
.pk-ntf .pk-bell .num { background: var(--gold-ink); color: #111; }
.pk-ntf-box { position: absolute; top: calc(100% + 8px); inset-inline-start: 0; width: min(440px, 92vw); z-index: 40; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.pk-ntf-box textarea { width: 100%; min-height: 90px; }
.pk-ntf-box .pk-ntf-act { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 12px; }
.pk-ntf-log { max-height: 320px; overflow: auto; display: grid; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
.pk-ntf-log > div { padding: 8px 10px; border-radius: 10px; background: var(--input); border: 1px solid var(--border); }
.pk-ntf-log p { margin: 0 0 4px; font-size: 13px; line-height: 1.6; white-space: pre-line; }
.pk-ntf-log .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.pk-ntf-steps { display: inline-flex; gap: 4px; align-items: center; }
.pk-ntf-steps i { width: 7px; height: 7px; border-radius: 50%; background: var(--border); display: inline-block; }
.pk-ntf-steps i.on { background: var(--gold-ink); }
.pk-ntf-steps i.ok { background: #3fb950; }
@media (max-width: 760px) { .pk-ntf-box { position: fixed; inset-inline: 10px; top: 70px; width: auto; } }
.pk-ntf.end .pk-ntf-box { inset-inline-start: auto; inset-inline-end: 0; }
/* تثبيت البوابات كتطبيق */
.app-install[hidden] { display: none !important; }
.auth-card .app-install { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; padding: 10px; border-radius: 10px; border: 1px dashed var(--gold-ink); color: var(--gold-ink); text-decoration: none; font-weight: 600; }
.auth-card .app-install svg { width: 18px; height: 18px; }
.app-ios-tip { position: fixed; inset-inline: 12px; bottom: 12px; z-index: 80; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--gold-ink); box-shadow: 0 8px 30px rgba(0,0,0,.35); display: flex; gap: 10px; align-items: center; justify-content: space-between; }
html.is-app .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
.pk-nitem .pk-nt, .pk-ntf-log .pk-ntf-t { display: block; font-size: 15px; margin-bottom: 2px; }
.pk-ntf-log .pk-ntf-t { font-size: 13.5px; }
.pk-ntf-prev { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--input); border: 1px dashed var(--border); }
/* الميدان المباشر: الخريطة، تتبّع الفني، الرسائل الصوتية */
.cs-map { height: 320px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--input); z-index: 0; }
.cs-map-info { margin: -4px 0 8px; }
.cs-pin { display: grid; place-items: center; }
.cs-pin span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 700; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.cs-pin.cust span { background: #e5484d; }
.cs-pin.tech span { background: #3b82f6; }
.cs-pin.tech.live span { animation: csPulse 1.6s infinite; }
@keyframes csPulse { 0% { box-shadow: 0 0 0 0 rgba(59,130,246,.6); } 70% { box-shadow: 0 0 0 14px rgba(59,130,246,0); } 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); } }
.cs-live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #3fb950; animation: csBlink 1.2s infinite; vertical-align: middle; }
@keyframes csBlink { 50% { opacity: .25; } }
.cs-track-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(63,185,80,.45); background: rgba(63,185,80,.08); color: var(--text); text-decoration: none; }
.cs-track-bar > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.cs-voice .cs-v-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; padding: 2px; }
.cs-v { max-width: 88%; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--input); }
.cs-v.me { align-self: flex-start; background: rgba(237,162,31,.08); border-color: rgba(237,162,31,.35); }
.cs-v.them { align-self: flex-end; }
.cs-v audio { width: 260px; max-width: 100%; height: 36px; margin-top: 4px; }
.cs-v-h { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cs-v-h b { color: var(--text); }
.cs-v-st { font-size: 11px; }
.cs-v-st.ok { color: var(--ok); }
.cs-v-new { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--gold-ink); color: #111; font-weight: 700; }
.cs-v-rec { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.cs-v-btn.rec { background: #e5484d; border-color: #e5484d; color: #fff; animation: csBlink 1.2s infinite; }
.cs-v-time { color: #e5484d; font-weight: 700; }
.cs-v-empty { margin: 0; text-align: center; padding: 10px 0; }
@media (max-width: 760px) { .cs-map { height: 230px; } }
.cs-voice [hidden] { display: none !important; }
/* ===== محادثة الفني وخدمة العملاء (مثل واتساب) ===== */
.wa-chat { --wa-bg: #0b141a; --wa-me: #005c4b; --wa-them: #202c33; --wa-ink: #e9edef; --wa-sub: #8696a0; --wa-bar: #1f2c33; --wa-in: #2a3942; --wa-acc: #00a884; --wa-read: #53bdeb;
    padding: 0; overflow: hidden; border-radius: 16px; }
:root[data-theme="light"] .wa-chat { --wa-bg: #efeae2; --wa-me: #d9fdd3; --wa-them: #ffffff; --wa-ink: #111b21; --wa-sub: #667781; --wa-bar: #f0f2f5; --wa-in: #ffffff; --wa-read: #34b7f1; }
.wa-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--wa-bar); color: var(--wa-ink); }
.wa-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--wa-acc); color: #fff; font-weight: 700; font-size: 17px; flex: 0 0 40px; }
.wa-peer { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.wa-peer b { font-size: 15px; } .wa-peer span { font-size: 12px; color: var(--wa-sub); }
.wa-unread { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--wa-acc); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.wa-calls { display: flex; gap: 6px; flex-wrap: wrap; } .wa-calls .group { display: flex; gap: 6px; }
.wa-body { height: 380px; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; background-color: var(--wa-bg);
    background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px); background-size: 18px 18px; }
:root[data-theme="light"] .wa-body { background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); }
.wa-day { align-self: center; margin: 8px 0 6px; } .wa-day span { display: inline-block; padding: 4px 12px; border-radius: 8px; background: var(--wa-them); color: var(--wa-sub); font-size: 12px; box-shadow: 0 1px .5px rgba(0,0,0,.13); }
.wa-msg { position: relative; max-width: 78%; padding: 6px 9px 18px; border-radius: 9px; color: var(--wa-ink); box-shadow: 0 1px .5px rgba(0,0,0,.18); font-size: 14.5px; line-height: 1.55; word-wrap: break-word; }
.wa-msg.me { align-self: flex-end; background: var(--wa-me); border-start-end-radius: 2px; }
.wa-msg.them { align-self: flex-start; background: var(--wa-them); border-start-start-radius: 2px; }
.wa-msg.me + .wa-msg.me, .wa-msg.them + .wa-msg.them { margin-top: -1px; }
.wa-who { display: block; font-size: 12.5px; color: var(--wa-acc); margin-bottom: 2px; }
.wa-text { white-space: pre-wrap; min-width: 60px; }
.wa-meta { position: absolute; bottom: 3px; inset-inline-end: 8px; display: flex; gap: 3px; align-items: center; font-size: 11px; color: var(--wa-sub); }
.wa-tick { font-style: normal; letter-spacing: -3px; padding-inline-end: 3px; } .wa-tick.read { color: var(--wa-read); }
.wa-audio { display: flex; align-items: center; gap: 6px; } .wa-audio > svg { width: 18px; height: 18px; color: var(--wa-acc); flex: 0 0 18px; }
.wa-audio audio { width: 230px; max-width: 58vw; height: 34px; } .wa-dur { font-size: 11px; color: var(--wa-sub); }
.wa-empty { margin: auto; text-align: center; color: var(--wa-sub); font-size: 13px; } .wa-empty svg { width: 34px; height: 34px; opacity: .5; } .wa-empty p { margin: 6px 0 0; }
.wa-bar { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px; background: var(--wa-bar); margin: 0; }
.wa-in { flex: 1; min-height: 42px; max-height: 120px; resize: none; padding: 10px 14px; border-radius: 22px; border: none; background: var(--wa-in); color: var(--wa-ink); font: inherit; line-height: 1.4; outline: none; }
.wa-mic, .wa-send { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--wa-acc); color: #fff; display: grid; place-items: center; cursor: pointer; }
.wa-mic svg, .wa-send svg { width: 20px; height: 20px; } .wa-send svg { transform: scaleX(-1); }
.wa-mic[hidden], .wa-send[hidden], .wa-rec[hidden], .wa-in[hidden] { display: none !important; }
.wa-rec { flex: 1; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 22px; background: var(--wa-in); color: var(--wa-ink); }
.wa-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e5484d; animation: csBlink 1s infinite; }
.wa-rec .cs-v-time { color: var(--wa-ink); font-weight: 600; flex: 1; }
.wa-x { border: none; background: transparent; color: #e5484d; font-size: 18px; cursor: pointer; padding: 4px 8px; }
.wa-msgline { padding: 0 14px 6px; background: var(--wa-bar); min-height: 0; } .wa-msgline:empty { display: none; }
@media (max-width: 760px) { .wa-body { height: 58vh; } .wa-msg { max-width: 88%; } .wa-head { flex-wrap: wrap; } }

/* ===== سجل التذكرة: مرتب بالأيام ===== */
.tl { display: flex; flex-direction: column; }
.tl-day { position: sticky; top: 0; z-index: 1; align-self: flex-start; margin: 10px 0 6px; padding: 3px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text-2); }
.tl-row { display: flex; gap: 10px; position: relative; padding-bottom: 12px; }
.tl-row::before { content: ''; position: absolute; top: 30px; bottom: 0; inset-inline-start: 14px; width: 2px; background: var(--border); }
.tl-row:last-child::before { display: none; }
.tl-ic { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); position: relative; z-index: 1; }
.tl-ic svg { width: 15px; height: 15px; }
.tl-row.c-gold .tl-ic { color: var(--gold-ink); border-color: rgba(237,162,31,.45); background: rgba(237,162,31,.1); }
.tl-row.c-blue .tl-ic { color: #60a5fa; border-color: rgba(96,165,250,.45); background: rgba(96,165,250,.1); }
.tl-row.c-green .tl-ic { color: #3fb950; border-color: rgba(63,185,80,.45); background: rgba(63,185,80,.12); }
.tl-row.c-red .tl-ic { color: #ef6b66; border-color: rgba(229,83,75,.45); background: rgba(229,83,75,.1); }
.tl-row.c-violet .tl-ic { color: #a78bfa; border-color: rgba(167,139,250,.45); background: rgba(167,139,250,.1); }
.tl-row.c-gray .tl-ic { color: var(--muted); }
.tl-b { flex: 1; min-width: 0; padding-top: 4px; }
.tl-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tl-h b { font-size: 14px; }
.tl-chg { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; } .tl-chg i { font-style: normal; color: var(--muted); }
.tl-st { padding: 1px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.tl-st.to { color: var(--text); border-color: var(--border-strong); font-weight: 600; }
.tl-m { margin-inline-start: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tl-n { margin-top: 6px; padding: 7px 11px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; line-height: 1.65; color: var(--text-2); }
/* ===== دردشة الموظفين (فقاعة أسفل الصفحة) ===== */
.lgc { position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 70; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.lgc-fab { position: relative; width: 58px; height: 58px; border-radius: 50%; border: none; background: #00a884; color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: transform .15s; }
.lgc-fab:hover { transform: scale(1.06); }
.lgc.open .lgc-fab { transform: scale(.92); }
.lgc-badge { position: absolute; top: -4px; inset-inline-start: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.lgc-badge[hidden] { display: none; }
.lgc-box { width: 380px; height: min(620px, calc(100vh - 110px)); display: flex; flex-direction: column; margin: 0; border: 1px solid var(--border); box-shadow: 0 18px 50px rgba(0,0,0,.45); background: var(--wa-bg); }
.lgc-box[hidden] { display: none; }
.lgc-head { flex: 0 0 auto; }
.lgc-logo { width: 40px; height: 40px; border-radius: 50%; background: #00a884; color: #fff; display: grid; place-items: center; flex: 0 0 40px; }
.lgc-logo svg { width: 22px; height: 22px; }
.lgc-x, .lgc-back { border: none; background: transparent; color: var(--wa-sub); font-size: 18px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.lgc-x:hover, .lgc-back:hover { background: rgba(127,127,127,.15); color: var(--wa-ink); }
.lgc-back { font-size: 20px; }
.lgc-tabs { display: flex; background: var(--wa-bar); border-bottom: 1px solid rgba(127,127,127,.15); }
.lgc-tabs button { flex: 1; padding: 10px; border: none; background: transparent; color: var(--wa-sub); font: inherit; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; }
.lgc-tabs button.on { color: #00a884; border-bottom-color: #00a884; }
.lgc-search { padding: 8px 10px; background: var(--wa-bar); }
.lgc-search input { width: 100%; padding: 8px 14px; border-radius: 10px; border: none; background: var(--wa-in); color: var(--wa-ink); font: inherit; }
.lgc-list { flex: 1; overflow-y: auto; background: var(--wa-them); display: flex; flex-direction: column; }
.lgc-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: none; border-bottom: 1px solid rgba(127,127,127,.12); background: transparent; color: var(--wa-ink); text-align: start; font: inherit; cursor: pointer; width: 100%; }
.lgc-item:hover { background: rgba(127,127,127,.1); }
.lgc-it { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lgc-it b { font-size: 14.5px; font-weight: 600; }
.lgc-last { font-size: 13px; color: var(--wa-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lgc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.lgc-time { font-size: 11px; color: var(--wa-sub); } .lgc-time.new { color: #00a884; font-weight: 700; }
.lgc-body { flex: 1; height: auto; }
.lgc-box .wa-bar { flex: 0 0 auto; }
.lgc-att { flex: 0 0 40px; width: 40px; height: 44px; border: none; background: transparent; color: var(--wa-sub); display: grid; place-items: center; cursor: pointer; }
.lgc-att[hidden] { display: none; }
.lgc-att:hover { color: var(--wa-ink); }
.wa-msg.img { padding: 4px 4px 20px; }
.lgc-img img { display: block; max-width: 240px; max-height: 280px; border-radius: 7px; object-fit: cover; }
.wa-text a { color: #53bdeb; }
@media (max-width: 760px) {
    .lgc { bottom: 12px; inset-inline-end: 12px; }
    .lgc.open { inset: 0; padding: 0; }
    .lgc.open .lgc-fab { display: none; }
    .lgc-box { width: 100vw; height: 100dvh; border-radius: 0; border: none; }
    .lgc-img img { max-width: 70vw; }
}
@media print { .lgc { display: none !important; } }
/* ===== ألوان المحادثات حسب ثيم النظام (رمادي + أصفر) ===== */
.wa-chat { --wa-bg: var(--bg); --wa-them: var(--surface-2); --wa-me: #3a2f14; --wa-ink: var(--text); --wa-sub: var(--muted); --wa-bar: var(--surface); --wa-in: var(--input); --wa-acc: var(--gold); --wa-read: var(--gold-hover); }
:root[data-theme="light"] .wa-chat { --wa-bg: var(--bg); --wa-them: var(--surface); --wa-me: #fbecc8; --wa-ink: var(--text); --wa-sub: var(--muted); --wa-bar: var(--surface-2); --wa-in: var(--surface); --wa-acc: var(--gold); --wa-read: #b7791f; }
.wa-body { background-image: radial-gradient(rgba(237,162,31,.06) 1px, transparent 1px); }
:root[data-theme="light"] .wa-body { background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); }
.wa-msg.me { border: 1px solid rgba(237,162,31,.35); }
.wa-msg.them { border: 1px solid var(--border); }
.wa-av, .lgc-logo, .wa-mic, .wa-send, .lgc-fab { background: var(--gold); color: #15171c; }
.wa-unread { background: var(--gold); color: #15171c; }
.lgc-fab:hover { background: var(--gold-hover); }
.lgc-tabs button.on { color: var(--gold-ink); border-bottom-color: var(--gold); }
.lgc-time.new { color: var(--gold-ink); }
.wa-who, .wa-audio > svg { color: var(--gold-ink); }
.wa-text a { color: var(--gold-ink); }
.lgc-box, .wa-chat { border-color: var(--border); }
.lgc-head, .wa-head { border-bottom: 1px solid var(--border); }
.wa-bar { border-top: 1px solid var(--border); }
.wa-in:focus, .lgc-search input:focus { box-shadow: 0 0 0 1px rgba(237,162,31,.5); }
.cs-map .leaflet-control-attribution { background: rgba(21,23,28,.75); color: #aab; font-size: 10px; }
.cs-map .leaflet-control-attribution a { color: var(--gold-ink); }
:root[data-theme="light"] .cs-map .leaflet-control-attribution { background: rgba(255,255,255,.8); color: #555; }
.cs-map .leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--border); }
.cs-map .leaflet-control-layers { background: var(--surface); color: var(--text); border: 1px solid var(--border) !important; border-radius: 10px; }
.cs-map .leaflet-control-layers-expanded { padding: 6px 10px; }
.cs-map .leaflet-control-layers label { display: flex; gap: 6px; align-items: center; margin: 2px 0; }
.prof-head { position: relative; }
.prof-ntf { position: relative; order: 20; z-index: 5; }
.prof-ntf .pk-ntf-box { inset-inline-start: auto; inset-inline-end: 0; }
/* إدارة الأفرع: هوية كل فرع تحت سطره */
.tn-brand > td, .tn-brand:target > td, .tn-brand:hover > td { background: var(--surface-2) !important; padding: 14px 16px !important; }
.tn-brand[hidden] { display: none; }
.tn-brand-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.tn-brand-h .btn { margin-inline-start: auto; }
.tn-brand .logo-preview { max-width: 320px; }
.tn-acts { display: flex; align-items: stretch; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; }
.tn-acts .btn { height: 36px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1; white-space: nowrap; box-sizing: border-box; }
.tn-acts .btn svg { width: 15px; height: 15px; }
@media (max-width: 900px) { .tn-acts { flex-wrap: wrap; } }
/* أوقات مراحل التذكرة */
.cs-stg { display: grid; gap: 10px; }
.cs-stg-r { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.cs-stg-r.live { border-color: rgba(63,185,80,.45); }
.cs-stg-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 5px; }
.cs-stg-bar { height: 6px; border-radius: 99px; background: var(--input); overflow: hidden; margin-bottom: 4px; }
.cs-stg-bar i { display: block; height: 100%; border-radius: 99px; background: var(--muted); }
.cs-stg-r.c-gold .cs-stg-bar i { background: var(--gold); } .cs-stg-r.c-blue .cs-stg-bar i { background: #60a5fa; }
.cs-stg-r.c-violet .cs-stg-bar i { background: #a78bfa; } .cs-stg-r.c-green .cs-stg-bar i { background: #3fb950; } .cs-stg-r.c-red .cs-stg-bar i { background: #ef6b66; }
.cs-stg-t { display: flex; justify-content: space-between; margin: 12px 0 14px; padding: 10px 12px; border-radius: 10px; background: rgba(237,162,31,.08); border: 1px solid rgba(237,162,31,.35); font-weight: 600; }
.cs-tbadge.c-gold { color: var(--gold-ink); border-color: rgba(237,162,31,.45); } .cs-tbadge.c-blue { color: #60a5fa; border-color: rgba(96,165,250,.45); }
.cs-tbadge.c-violet { color: #a78bfa; border-color: rgba(167,139,250,.45); } .cs-tbadge.c-green { color: #3fb950; border-color: rgba(63,185,80,.45); }
.cs-tbadge.c-red { color: #ef6b66; border-color: rgba(229,83,75,.45); }
.cs-kinds-l { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }

/* ---------------------------------------------------------------- الشبكات والأبراج */
.net-map { height: 520px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--input); z-index: 0; }
.net-map.sm { height: 320px; }
.net-map.lk-draw { height: 460px; }
.net-map.net-full { position: fixed !important; inset: 0; width: 100vw !important; height: 100vh !important; height: 100dvh !important; z-index: 9990; border-radius: 0; border: 0; margin: 0; }
html.net-full-on, html.net-full-on body { overflow: hidden; }
.net-full-btn { display: grid !important; place-items: center; width: 34px; height: 34px; background: #fff; color: #222 !important; font-size: 18px; line-height: 1; text-decoration: none; cursor: pointer; }
.net-full-x { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1000; padding: 8px 18px; border-radius: 999px; border: 0; background: #15171c; color: #fff; font: inherit; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.45); cursor: pointer; }
.net-full-x:hover { background: #c0392b; }
.net-map.drawing, .net-map.drawing .leaflet-interactive { cursor: crosshair !important; }
.lk-vx { background: #fff; border: 3px solid #e08a1e; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.35); cursor: move; }
.net-map .leaflet-control-attribution { background: rgba(21,23,28,.75); color: #aab; font-size: 10px; }
.net-map .leaflet-control-attribution a { color: var(--gold-ink); }
.net-pin { display: grid; place-items: center; }
.net-pin span { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.45); background: #555; white-space: nowrap; }
.net-pin.tower span { background: #c0392b; font-size: 13px; }
.net-pin.tower.off span { background: #7a7f88; }
.net-pin.box span { background: #4f8bd6; border-radius: 6px; }
.net-pin.box.full span { background: #e5534b; border-color: #e5534b; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #e5534b; }
.net-pin.grp span { border-radius: 8px 8px 8px 0; font-size: 13px; min-width: 28px; height: 28px; }
.net-lbl span { position: absolute; transform: translateX(-50%); white-space: nowrap; padding: 2px 7px; border-radius: 6px; background: rgba(21,23,28,.85); color: #fff; font-size: 11px; font-weight: 700; pointer-events: none; }
.net-pin.src span { background: #15171c; border-color: #eda21f; font-size: 13px; min-width: 30px; height: 30px; }
.net-pin.fdh span { border-radius: 6px; font-size: 11px; min-width: 30px; height: 24px; }
.net-fat span { display: block; width: 14px; height: 18px; border-radius: 3px; background: #6c3483; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5); position: relative; }
.net-fat span i { position: absolute; left: 2px; right: 2px; top: 3px; height: 2px; background: rgba(255,255,255,.75); box-shadow: 0 4px 0 rgba(255,255,255,.75), 0 8px 0 rgba(255,255,255,.75); }
.net-fat.full span { outline: 3px solid #e5534b; }
.net-splice span { display: block; width: 12px; height: 12px; transform: rotate(45deg); background: #15171c; border: 3px solid #a35fd6; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.net-show-all { display: block !important; padding: 7px 12px; background: #15171c; color: #fff !important; font-weight: 700; text-decoration: none; border-radius: 8px; }
.net-out { animation: netPulse 1.2s ease-in-out infinite; }
.net-out-line { animation: netPulse 1.2s ease-in-out infinite; }
@keyframes netPulse { 0%, 100% { opacity: .25; } 50% { opacity: .9; } }
.fb-tree .fb-n { margin: 4px 0 4px 0; padding-inline-start: 18px; border-inline-start: 2px solid var(--border); }
.fb-tree > .fb-n { padding-inline-start: 0; border: 0; margin-bottom: 12px; }
.st-rc { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid rgba(255,255,255,.18); background: transparent; color: transparent; font-weight: 900; font-size: 13px; transition: .15s; cursor: default; user-select: none; }
html[data-theme="light"] .st-rc { border-color: rgba(0,0,0,.18); }
.st-rc.on { background: #2fb37a; border-color: #2fb37a; color: #fff; box-shadow: 0 2px 6px rgba(47,179,122,.35); }
.st-rc.wait { opacity: .5; }
.st-rc-h { color: #2fb37a; text-align: center; }
.net-pin.poi span { font-size: 13px; background: #2f6fd6; }
.net-pin.box span { min-width: 22px; height: 22px; font-size: 10px; }
.net-pin.me span { background: #eda21f; color: #111; font-size: 14px; }
.net-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.net-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-inline-end: 5px; }
.net-legend i.sq { border-radius: 3px; }
.net-legend i.ln { width: 18px; height: 0; border-top: 2px dashed #4f8bd6; border-radius: 0; vertical-align: 3px; }
.net-alerts { display: grid; gap: 8px; }
.net-alerts .alert { margin: 0; }
.net-ports { display: flex; flex-wrap: wrap; gap: 8px; }
.net-port { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-width: 150px; background: var(--input); }
.net-port.used { border-color: rgba(79,139,214,.5); }
.net-port b.num { display: inline-block; min-width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 6px; background: #4f8bd6; color: #fff; font-size: 12px; margin-inline-end: 6px; }
.net-port.free b.num { background: var(--border); color: var(--muted); }
.net-cov { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--border); background: var(--input); }
.net-cov .z { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.net-cov .z i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.cs-pmx th, .cs-pmx td { text-align: center; }
.cs-pmx td input { width: 80px; text-align: center; }
.cs-quote td { padding: 6px 8px; }
.cs-quote .cs-quote-t td { border-top: 2px solid var(--border); font-size: 15px; }

/* ---------------------------------------------------------------- معالج إنشاء الطلب */
.wz { max-width: 980px; }
.wz-top { position: sticky; top: 0; z-index: 5; padding: 12px 16px; }
.wz-prog { height: 6px; background: var(--input); border-radius: 6px; overflow: hidden; }
.wz-prog span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.wz-meta { display: flex; gap: 10px; align-items: baseline; margin-top: 8px; flex-wrap: wrap; }
.wz-meta b { font-size: 16px; }
.wz-step { display: none; }
.wz-step.on { display: block; animation: wzIn .2s ease; }
@keyframes wzIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wz-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.wz-card input { position: absolute; opacity: 0; pointer-events: none; }
.wz-card span { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--input); cursor: pointer; text-align: center; }
.wz-card span svg { width: 30px; height: 30px; }
.wz-card input:checked + span { border-color: var(--gold); background: rgba(237,162,31,.12); box-shadow: 0 0 0 1px var(--gold) inset; }
.wz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-others { display: flex; flex-direction: column; gap: 6px; }
.wz-oth { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 10px; }
.wz-oth b { min-width: 120px; }
.wz-chips .chip { cursor: pointer; padding: 8px 12px; }
.wz-chips .chip:has(input:checked) { border-color: var(--gold); background: rgba(237,162,31,.14); color: var(--text); }
.wz-chips .chip.dis { opacity: .5; cursor: not-allowed; }
.wz-chips .chip b.num { margin-inline-start: 4px; color: var(--gold-ink); }
.wz-nav { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.wz-nav .wz-err { flex: 1; text-align: center; }
.wz-nav #wzBack svg { transform: scaleX(-1); }
.wz-look { display: grid; gap: 8px; margin-top: 10px; }
.wz-hit { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--input); }
.wz-hit .btn { margin-inline-start: 6px; }
.wz-hit.draft { border-color: rgba(237,162,31,.6); }
.wz-hit.open { border-color: rgba(229,83,75,.55); }
.wz-hit.sub { border-color: rgba(79,139,214,.55); }
.wz-hit.new { border-color: rgba(47,158,107,.5); }
.wz-say { font-size: 14px; line-height: 1.7; }
.wz-checks { border: 1px dashed var(--border); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.wz-checks ol { margin: 6px 0; padding-inline-start: 20px; }
.wz-net { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wz-net span { border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.wz-more { margin: 8px 0 12px; }
.wz-more summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.wz-sum th { width: 160px; color: var(--muted); font-weight: 600; text-align: right; }
.wz-sum .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.wz-quote { margin-top: 10px; }
.cs-share { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cs-share input { flex: 1; min-width: 220px; }
.wz-nav { padding-inline-end: 78px; }
.tb-fixed { display: inline-flex; align-items: center; gap: 6px; height: 40px; }
.tb-fixed.active { border-color: var(--gold); color: var(--gold-ink); }
@media (max-width: 640px) { .tb-fixed span { display: none; } }

/* زر تثبيت الحزمة السريع في قائمة المشتركين + تلميح الشرح */
.pk-inst-btn { position: relative; color: var(--gold); border-color: rgba(237, 162, 31, .45); }
.pk-inst-btn:hover { background: rgba(237, 162, 31, .12); }
.pk-tip { position: fixed; z-index: 90; width: 270px; text-align: right; font-size: 12px; line-height: 1.7; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-top: 2px solid var(--gold); border-radius: 8px; padding: 8px 10px; box-shadow: 0 10px 30px var(--shadow-c); pointer-events: none; }
#instModal .modal { max-height: calc(100vh - 32px); overflow: auto; }

/* قائمة منسدلة مع بحث (البديل الخفيف) */
.ss { position: relative; width: 100%; }
.ss-btn { width: 100%; text-align: right; background-color: var(--input); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 10px 30px; font: inherit; cursor: pointer; min-height: 42px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss::after { content: '▾'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 13px; }
.ss.open .ss-btn, .ss-btn:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(237, 162, 31, .15); }
.ss-pan { position: absolute; z-index: 60; inset-inline: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 40px var(--shadow-c); padding: 8px; }
.ss-q { width: 100%; margin-bottom: 6px; }
.ss-list { max-height: 300px; overflow: auto; }
.ss-opt { padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.ss-opt:hover, .ss-opt.act { background: rgba(237, 162, 31, .14); }
.ss-opt.sel { color: var(--gold); font-weight: 600; }
.ss-none { padding: 8px 10px; color: var(--muted); font-size: 13px; }

/* شبكة الفايبر: شارات ألوان الشعيرات، منافذ PON، خطوات التتبّع */
.fb-fib { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.fb-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(0,0,0,.35); vertical-align: middle; }
.fb-dot.sq { border-radius: 2px; }
.fb-ftab td { vertical-align: middle; }
.fb-ftab tr.fb-st-reserved td { background: rgba(224, 160, 32, .08); }
.fb-ftab tr.fb-st-bad td { background: rgba(229, 83, 75, .10); }
.fb-ssel { padding: 4px 8px; min-height: 0; font-size: 12px; width: auto; }
.fb-pons { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.fb-pon { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; font-size: 12px; }
.fb-pon span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-pon i { font-style: normal; color: var(--muted); }
.fb-pon.on { border-color: rgba(46, 158, 68, .6); background: rgba(46, 158, 68, .07); }
.fb-pon.on i { color: var(--gold); font-weight: 600; }
.fb-steps { margin: 0; padding-inline-start: 20px; line-height: 2.1; }
.fb-ont input { width: 120px; padding: 2px 6px; min-height: 0; font-size: 11px; }
.fb-spf { display: grid; grid-template-columns: 140px 90px minmax(0, 260px) auto; gap: 8px; align-items: end; justify-content: start; }
.fb-spf .btn { align-self: end; margin-bottom: 4px; }
@media (max-width: 640px) { .fb-spf { grid-template-columns: 1fr 1fr; } }
.wz-chips .chip.wz-none { border-style: dashed; color: var(--muted); }
.wz-chips .chip.wz-none:has(input:checked) { color: var(--text); border-color: var(--muted); background: rgba(255,255,255,.04); }
/* حالة الحساب: ✓ أخضر نشط / ✕ أحمر موقوف */
.st-dot { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 15px; font-weight: 700; cursor: pointer; border: 1px solid; line-height: 1; padding: 0; }
.st-dot.on { color: #2fbf71; border-color: rgba(47, 191, 113, .55); background: rgba(47, 191, 113, .12); }
.st-dot.off { color: #e5534b; border-color: rgba(229, 83, 75, .55); background: rgba(229, 83, 75, .12); }
.st-dot:hover:not([disabled]) { filter: brightness(1.25); }
.st-dot[disabled] { cursor: default; opacity: .8; }
