/* ═══════════════════════════════════════════════════════════════════════════
   نظام تصميم MTA - الواجهة الموحَّدة الجديدة (2026-10-24)
   الهوية: حزمة MTA_Redesign_Complete_Pack (كحلي/تركواز/سماوي) + بنية صرح (مجموعات،
   بحث عام، تبويبات بعدّادات، نوافذ، اختصارات). كل القواعد تحت ‎.mta‎ - صفر أثر على app.css.
   ذوق المالك: بلا دوائر زينة ولا تدرّجات - مربعات بزوايا ناعمة، كحلي سادة، لمسات تركواز.
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face { font-family: "MtaCairo"; font-weight: 400; font-display: swap; src: url("fonts/cairo-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "MtaCairo"; font-weight: 500; font-display: swap; src: url("fonts/cairo-arabic-500.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "MtaCairo"; font-weight: 600; font-display: swap; src: url("fonts/cairo-arabic-600.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "MtaCairo"; font-weight: 700; font-display: swap; src: url("fonts/cairo-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "MtaCairo"; font-weight: 800; font-display: swap; src: url("fonts/cairo-arabic-800.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "MtaCairo"; font-weight: 400; font-display: swap; src: url("fonts/cairo-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "MtaCairo"; font-weight: 600; font-display: swap; src: url("fonts/cairo-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "MtaCairo"; font-weight: 700; font-display: swap; src: url("fonts/cairo-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "MtaCairo"; font-weight: 800; font-display: swap; src: url("fonts/cairo-latin-800.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }

/* ── التوكنز ── */
.mta {
    --navy: #0B2A4A;
    --navy-2: #0F3459;
    --navy-3: #164573;
    --teal: #00C2B8;
    --teal-ink: #008F88;
    --teal-tint: #E0F7F5;
    --sky: #4FC6FF;
    --blue: #1E88E5;
    --blue-tint: #E3F0FC;
    --canvas: #EAF2F8;
    --surface: #FFFFFF;
    --surface-2: #F8FAFC;
    --surface-3: #F1F5F9;
    --ink: #2D3A4B;
    --ink-strong: #0B2A4A;
    --muted: #6B7A8F;
    --faint: #94A3B8;
    --line: #E2E8F0;
    --line-2: #EEF2F6;
    --warn: #FFB84D;
    --warn-ink: #B26B00;
    --warn-tint: #FFF4E0;
    --danger: #E5484D;
    --danger-ink: #C2353A;
    --danger-tint: #FDECEC;
    --ok: #16A34A;
    --ok-tint: #E7F6EC;
    --private: #16A34A;   /* خاص - ثابت من قرار المالك */
    --company: #2563EB;   /* شركات */
    --focus: #F59E0B;     /* التركيز البرتقالي - ذوق المالك من الوندوز */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --shadow: 0 1px 2px rgba(11, 42, 74, .05), 0 6px 20px rgba(11, 42, 74, .06);
    --shadow-lg: 0 20px 60px rgba(11, 42, 74, .22);
    --side-w: 268px;

    font-family: "MtaCairo", "Cairo", "IBM Plex Sans Arabic", Tahoma, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: normal;
    color: var(--ink);
    background: var(--canvas);
    direction: rtl;   /* الاتجاه الفعلي من dir على .mta (عربي/إنجليزي) */
    text-align: start;
}
.mta[data-theme="dark"] {
    --canvas: #061A2C;
    --surface: #0B2440;
    --surface-2: #0E2A49;
    --surface-3: #123256;
    --ink: #D6E2EF;
    --ink-strong: #FFFFFF;
    --muted: #8FA3BB;
    --faint: #64798F;
    --line: #183A5E;
    --line-2: #13314F;
    --teal-tint: rgba(0, 194, 184, .14);
    --blue-tint: rgba(30, 136, 229, .16);
    --warn-tint: rgba(255, 184, 77, .14);
    --danger-tint: rgba(229, 72, 77, .15);
    --ok-tint: rgba(22, 163, 74, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
}
.mta *, .mta *::before, .mta *::after { box-sizing: border-box; letter-spacing: normal; }
.mta a { color: inherit; text-decoration: none; }
.mta a:hover { color: inherit; }
.mta button { font-family: inherit; }
.mta .num, .mta .tab-num { font-variant-numeric: tabular-nums; }
.mta .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ── الهيكل ── */
.mta-shell { display: flex; min-height: 100vh; }
.mta-side {
    width: var(--side-w); flex-shrink: 0; background: var(--navy); color: #BFD0E3;
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 20;
}
.mta[data-theme="dark"] .mta-side { background: #04131F; border-inline-start: 1px solid var(--line-2); }
.mta-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; }
.mta-brand img { width: 40px; height: 40px; border-radius: 11px; }
.mta-brand .t { color: #fff; font-weight: 800; font-size: 1.25rem; line-height: 1.2; }
.mta-brand .s { color: #7F97B3; font-size: .74rem; line-height: 1.35; }

/* القائمة بتمتد 28px برا حافة الشريط فوق جسم الصفحة، عشان الرابط النشط "يطلع" من الشريط زي صرح بدون ما يتقص.
   الحاوية نفسها ما بتاخدش نقرات (pointer-events) - الصفوف بس. اتجاهها LTR عشان شريط التمرير يبقى على الحافة
   الخارجية (يمين)، والصفوف ترجع RTL. يسار/يمين فعليين عن قصد: جسم الصفحة على الشمال في العربي. */
.mta-nav {
    flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
    direction: ltr; margin-left: -28px; padding: 4px 12px 16px 40px; pointer-events: none;
    scrollbar-width: thin; scrollbar-color: #24496F transparent;
    contain: paint; overscroll-behavior: contain;
}
.mta-nav > * { direction: rtl; pointer-events: auto; }
.mta-nav-sec { font-size: .7rem; color: #6A84A3; padding: 16px 12px 6px; font-weight: 600; }
.mta-nav-link, .mta-nav-head {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
    color: #BFD0E3; font-weight: 600; font-size: .92rem; border: 0; background: transparent; cursor: pointer; text-align: start;
    transition: background .15s, color .15s;
}
.mta-nav-link:hover, .mta-nav-head:hover { background: rgba(255, 255, 255, .06); color: #fff; }
/* الصفحة الحالية: بطاقة طالعة 28px برا الشريط فوق جسم الصفحة (فكرة صرح) - لون سادة بلا تدرّج (ذوق المالك). */
.mta-nav-link { position: relative; transition: background .15s, color .15s, margin .18s ease, padding .18s ease, box-shadow .18s ease; }
.mta-nav-link.active {
    background: var(--teal); color: #032B33; font-weight: 800; z-index: 1;
    margin-left: -28px; padding-left: 40px; border-radius: 14px;
    box-shadow: 0 14px 30px -8px rgba(3, 20, 35, .55), 0 4px 10px rgba(3, 20, 35, .25);
}
.mta-nav-link.active .mta-ic { color: #032B33; }
.mta-nav-link.active .mta-nav-tag { background: rgba(3, 43, 51, .14); color: #032B33; }
.mta-nav-link .t, .mta-nav-head .t { flex: 1; }
.mta-nav-head .chev { transition: transform .15s; opacity: .55; }
.mta-nav-grp.open > .mta-nav-head .chev { transform: rotate(-90deg); }
.mta-nav-grp.has-active > .mta-nav-head { color: #fff; }
.mta-nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px; margin-inline-start: 21px; padding-inline-start: 10px; border-inline-start: 1px solid rgba(255, 255, 255, .09); }
.mta-nav-sub .mta-nav-link { padding: 7px 10px; font-size: .86rem; font-weight: 500; }
.mta-nav-sub .mta-nav-link.active { background: var(--teal); color: #032B33; font-weight: 800; padding-left: 40px; width: calc(100% + 28px); margin-left: -28px; }
.mta-nav-tag { font-size: .66rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, .1); color: #BFD0E3; }
.mta-nav-tag.live { background: rgba(0, 194, 184, .2); color: #5FE6DE; }
.mta-side-foot { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; align-items: center; gap: 10px; font-size: .78rem; color: #7F97B3; }
.mta-side-foot .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--teal); }

.mta-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mta-top {
    position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 14px; padding: 12px 28px;
    background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.mta-top .clinic { display: flex; flex-direction: column; line-height: 1.3; }
.mta-top .clinic b { color: var(--ink-strong); font-size: .95rem; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.mta-top .clinic small { white-space: nowrap; }
.mta-top .clinic small { color: var(--muted); font-size: .74rem; }
.mta-searchbtn {
    flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px;
    border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--faint);
    cursor: text; font-size: .88rem; text-align: start;
}
.mta-searchbtn:hover { border-color: var(--teal); }
.mta-searchbtn .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mta-searchbtn { min-width: 0; width: 340px; flex-shrink: 1; }   /* كان min-width ثابت 340 = الشريط العلوي أعرض من الشاشة تحت ~1100 بكسل */
.mta-top .sp { flex: 1; }
.mta-iconbtn {
    position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.mta-iconbtn:hover { border-color: var(--teal); color: var(--teal-ink); }
.mta-iconbtn .pip { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 6px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; }
.mta-user { display: flex; align-items: center; gap: 10px; padding-inline-start: 6px; }
.mta-user .who { display: flex; flex-direction: column; line-height: 1.3; }
.mta-user .who b { font-size: .88rem; color: var(--ink-strong); }
.mta-user .who small { font-size: .72rem; color: var(--muted); }

.mta-content { flex: 1; padding: 24px 28px 90px; display: flex; flex-direction: column; gap: 20px; }

/* شريط الاختصارات السفلي (فكرة صرح) */
.mta-keys {
    position: fixed; bottom: 0; inset-inline-start: var(--side-w); inset-inline-end: 0; z-index: 14;
    display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 8px 28px;
    background: var(--surface); border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted);
}
.mta-keys span { display: inline-flex; align-items: center; gap: 6px; }
.mta-kbd {
    display: inline-grid; place-items: center; min-width: 26px; height: 21px; padding: 0 6px; border-radius: 6px;
    background: var(--surface-3); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--ink-strong);
    font-size: .7rem; font-weight: 700; direction: ltr; font-family: "MtaCairo", Tahoma, sans-serif;
}

/* ── رأس الصفحة ── */
.mta-ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.mta-ph .ic-box { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--teal-tint); color: var(--teal-ink); }
.mta-ph .tx { flex: 1; min-width: 240px; }
.mta-ph .crumb { font-size: .76rem; color: var(--muted); }
.mta-ph h1 { margin: 0; font-size: 1.55rem; font-weight: 800; color: var(--ink-strong); line-height: 1.35; }
.mta-ph p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.mta-ph .acts { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── البطاقات ── */
.mta-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.mta-card.flush { padding: 0; overflow: hidden; }
.mta-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mta-card-h h3 { margin: 0; font-size: 1.02rem; font-weight: 800; color: var(--ink-strong); flex: 1; line-height: 1.4; }
.mta-card-h .meta { font-size: .76rem; color: var(--muted); }
.mta-link { color: var(--blue); font-size: .8rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.mta-link:hover { color: var(--teal-ink); }

.mta-grid { display: grid; gap: 18px; }
.mta-grid.kpis { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.mta-grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.mta-grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
.mta-grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
@media (max-width: 1200px) { .mta-grid.main-side { grid-template-columns: 1fr; } }

/* ── الترحيب ── */
.mta-hero {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    background: var(--navy); color: #fff; border-radius: 20px; padding: 26px 28px;
}
.mta-hero::after { /* شريط تركواز رفيع - مش دايرة */
    content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 6px; background: var(--teal);
}
.mta-hero .tx { flex: 1; min-width: 260px; }
.mta-hero .eyebrow { font-size: .74rem; color: var(--teal); font-weight: 700; }
.mta-hero h2 { margin: 4px 0 4px; font-size: 1.7rem; font-weight: 800; line-height: 1.3; color: #fff; }
.mta-hero p { margin: 0; color: #A9BED6; font-size: .9rem; }
.mta-hero .chips { display: flex; gap: 12px; flex-wrap: wrap; }
.mta-hero .chip { min-width: 128px; padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.mta-hero .chip b { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.2; color: #fff; }
.mta-hero .chip small { color: #A9BED6; font-size: .76rem; }
.mta-hero .chip.teal b { color: var(--teal); }

/* ── مؤشر رقمي ── */
.mta-kpi { display: flex; flex-direction: column; gap: 6px; }
.mta-kpi .top { display: flex; align-items: center; gap: 10px; }
.mta-kpi .lbl { flex: 1; font-size: .84rem; color: var(--muted); font-weight: 600; }
.mta-kpi .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--teal-tint); color: var(--teal-ink); }
.mta-kpi .ico.blue { background: var(--blue-tint); color: var(--blue); }
.mta-kpi .ico.warn { background: var(--warn-tint); color: var(--warn-ink); }
.mta-kpi .ico.danger { background: var(--danger-tint); color: var(--danger-ink); }
.mta-kpi .val { font-size: 1.85rem; font-weight: 800; color: var(--ink-strong); line-height: 1.25; font-variant-numeric: tabular-nums; }
.mta-kpi .val .u { font-size: .8rem; color: var(--muted); font-weight: 600; margin-inline-start: 4px; }
.mta-kpi .sub { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.mta-delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 6px; font-weight: 700; font-size: .74rem; direction: ltr; }
.mta-delta.up { background: var(--ok-tint); color: var(--ok); }
.mta-delta.down { background: var(--danger-tint); color: var(--danger-ink); }
.mta-split { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--surface-3); margin-top: 4px; }
.mta-split .p { background: var(--private); }
.mta-split .c { background: var(--company); }
.mta-legend { display: flex; gap: 14px; font-size: .75rem; color: var(--muted); flex-wrap: wrap; }
.mta-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.mta-legend .pv { background: var(--private); }
.mta-legend .co { background: var(--company); }
.mta-legend b { color: var(--ink-strong); font-variant-numeric: tabular-nums; }

/* ── الأقسام (بلاطات الوحدات) ── */
.mta-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.mta-tile {
    display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; background: var(--surface);
    border: 1px solid var(--line); transition: border-color .15s, transform .15s, box-shadow .15s; cursor: pointer; min-height: 132px;
}
.mta-tile:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.mta-tile .mta-tile-row { display: flex; align-items: center; gap: 10px; }
.mta-tile .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: var(--teal); }
.mta-tile .nm { flex: 1; font-weight: 800; color: var(--ink-strong); font-size: .98rem; line-height: 1.35; }
.mta-tile .ds { font-size: .78rem; color: var(--muted); line-height: 1.5; flex: 1; }
.mta-tile .live { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--teal-ink); }
.mta-tile .live.warn { color: var(--warn-ink); }
.mta-tile.soon { opacity: .62; }
.mta-tile.soon:hover { transform: none; }

/* ── أزرار ── */
.mta-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink-strong); font-weight: 700; font-size: .88rem; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.mta-btn:hover { border-color: var(--teal); }
.mta-btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.mta-btn.primary:hover { background: var(--navy-3); }
.mta[data-theme="dark"] .mta-btn.primary { background: var(--teal); color: #032B33; border-color: var(--teal); }
.mta-btn.accent { background: var(--teal); color: #032B33; border-color: var(--teal); }
.mta-btn.danger { color: var(--danger-ink); }
.mta-btn.sm { height: 32px; padding: 0 11px; font-size: .8rem; border-radius: 9px; }
.mta-btn .mta-kbd { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .2); color: inherit; }
.mta-btn:not(.primary):not(.accent) .mta-kbd { background: var(--surface-3); }

/* ── شارات ── */
.mta-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 7px; font-size: .74rem; font-weight: 700; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.mta-badge.ok { background: var(--ok-tint); color: var(--ok); }
.mta-badge.warn { background: var(--warn-tint); color: var(--warn-ink); }
.mta-badge.danger { background: var(--danger-tint); color: var(--danger-ink); }
.mta-badge.info { background: var(--blue-tint); color: var(--blue); }
.mta-badge.teal { background: var(--teal-tint); color: var(--teal-ink); }
.mta-badge.navy { background: var(--navy); color: #fff; }

/* ── مربع أيقونة بلون الحالة ── */
.mta-ibox { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; background: var(--teal-tint); color: var(--teal-ink); }
.mta-ibox.blue { background: var(--blue-tint); color: var(--blue); }
.mta-ibox.warn { background: var(--warn-tint); color: var(--warn-ink); }
.mta-ibox.danger { background: var(--danger-tint); color: var(--danger-ink); }
.mta-ibox.navy { background: var(--navy); color: var(--teal); }

/* ── مربع حرف بدل الأفاتار الدائري ── */
.mta-av { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; background: var(--teal-tint); color: var(--teal-ink); font-weight: 800; font-size: .95rem; }
.mta-av.navy { background: var(--navy); color: var(--teal); }
.mta-av.sm { width: 32px; height: 32px; border-radius: 9px; font-size: .82rem; }

/* ── قوائم صغيرة داخل البطاقات ── */
.mta-list { display: flex; flex-direction: column; }
.mta-list .it { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.mta-list .it:last-child { border-bottom: 0; }
.mta-list .it .tx { flex: 1; min-width: 0; line-height: 1.4; }
.mta-list .it .tx b { display: block; color: var(--ink-strong); font-size: .9rem; }
.mta-list .it .tx small { color: var(--muted); font-size: .76rem; }
.mta-list .it .end { text-align: end; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mta-list .it .end b { display: block; color: var(--ink-strong); font-size: .9rem; }

/* ── أشرطة أفقية (بدل الحلقات) ── */
.mta-bars { display: flex; flex-direction: column; gap: 13px; }
.mta-bars .b { display: grid; grid-template-columns: 130px 1fr 74px; align-items: center; gap: 12px; font-size: .84rem; }
.mta-bars .b .n { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mta-bars .b .tr { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; display: flex; }
.mta-bars .b .tr i { display: block; height: 100%; background: var(--teal); }
.mta-bars .b .tr i.c { background: var(--company); }
.mta-bars .b .tr i.p { background: var(--private); }
.mta-bars .b .v { text-align: end; font-weight: 800; color: var(--ink-strong); font-variant-numeric: tabular-nums; font-size: .82rem; }

/* ── المخطط ── */
.mta-chart-box { display: flex; flex-direction: column; gap: 6px; }
.mta-chart { width: 100%; height: 220px; display: block; }
.mta-chart .gl { stroke: var(--line); stroke-width: 1; }
.mta-chart-x { display: flex; justify-content: space-between; font-size: .72rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.mta-spark { width: 100%; height: 34px; display: block; }

/* ── التبويبات بعدّادات ── */
.mta-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mta-tab {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; background: transparent; cursor: pointer;
    color: var(--muted); font-weight: 700; font-size: .88rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.mta-tab:hover { color: var(--ink-strong); }
.mta-tab.on { color: var(--ink-strong); border-bottom-color: var(--teal); }
.mta-tab .c { min-width: 24px; padding: 0 7px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: .72rem; text-align: center; font-variant-numeric: tabular-nums; }
.mta-tab.on .c { background: var(--teal); color: #032B33; }

/* ── شريط الأدوات فوق الجدول ── */
.mta-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; }
.mta-toolbar .grow { flex: 1; }
.mta-input {
    height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-strong); font-family: inherit; font-size: .9rem; outline: none; min-width: 0;
    transition: border-color .12s, box-shadow .12s, background .12s;
}
/* لون تعبئة الحقل النشط = نفس برتقالي الوندوز وصرح (#FFE0C0) - الموظفين متعودين عليه */
.mta-input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); background: #FFE0C0; color: #1F2937; }
.mta[data-theme="dark"] .mta-input:focus { background: rgba(245, 158, 11, .16); color: var(--ink-strong); }
.mta-search { position: relative; display: flex; align-items: center; min-width: 280px; }
.mta-search .mta-ic { position: absolute; inset-inline-start: 11px; color: var(--faint); pointer-events: none; }
.mta-search .mta-input { width: 100%; padding-inline-start: 36px; padding-inline-end: 44px; }
.mta-search .mta-kbd { position: absolute; inset-inline-end: 9px; }
.mta-chipf { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .8rem; font-weight: 600; cursor: pointer; }
.mta-chipf.on { border-color: var(--teal); background: var(--teal-tint); color: var(--teal-ink); }

/* ── الجدول ── */
.mta-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.mta-table th { text-align: start; font-size: .76rem; color: var(--muted); font-weight: 700; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.mta-table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--ink); }
.mta-table tbody tr { cursor: pointer; transition: background .1s; }
.mta-table tbody tr:hover { background: var(--surface-2); }
.mta-table tbody tr.sel { background: var(--teal-tint); box-shadow: inset -3px 0 0 var(--teal); }
.mta-table .money { text-align: end; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-strong); white-space: nowrap; }
.mta-table .money small { color: var(--muted); font-weight: 600; }
.mta-table .code { color: var(--muted); font-variant-numeric: tabular-nums; }
.mta-table .who { display: flex; align-items: center; gap: 10px; }
.mta-table .who b { display: block; color: var(--ink-strong); line-height: 1.35; }
.mta-table .who small { color: var(--muted); font-size: .76rem; }
.mta-table-wrap { overflow-x: auto; }
.mta-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line-2); }

/* ── النافذة ── */
.mta-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(4, 19, 31, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.mta-modal { width: min(880px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: 88vh; }
.mta-modal-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.mta-modal-h h2 { margin: 0; flex: 1; font-size: 1.15rem; font-weight: 800; color: var(--ink-strong); line-height: 1.4; }
.mta-modal-b { padding: 16px 22px; overflow-y: auto; }
.mta-modal-f { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
.mta-modal-f .grow { flex: 1; font-size: .78rem; color: var(--muted); }

/* ── النماذج ── */
.mta-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.mta-form .full { grid-column: 1 / -1; }
.mta-field { display: flex; flex-direction: column; gap: 5px; }
.mta-field label { font-size: .8rem; font-weight: 700; color: var(--ink-strong); }
.mta-field label .req { color: var(--danger); }
.mta-field .hint { font-size: .74rem; color: var(--muted); }
.mta-field .mta-input, .mta-field select.mta-input, .mta-field textarea.mta-input { width: 100%; }
.mta-field textarea.mta-input { height: auto; min-height: 74px; padding: 10px 12px; resize: vertical; }
.mta-checks { display: flex; gap: 8px; flex-wrap: wrap; }
.mta-check { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--ink); }
.mta-check.on { border-color: var(--teal); background: var(--teal-tint); color: var(--teal-ink); }
.mta-check .box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--faint); display: grid; place-items: center; }
.mta-check.on .box { border-color: var(--teal); background: var(--teal); color: #032B33; }
.mta-note { padding: 11px 14px; border-radius: 11px; background: var(--blue-tint); color: var(--ink); font-size: .84rem; line-height: 1.6; }
.mta-note.warn { background: var(--warn-tint); }

/* جدول النسب داخل النافذة */
.mta-mini { width: 100%; border-collapse: collapse; font-size: .84rem; }
.mta-mini th { text-align: start; font-size: .74rem; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line); }
.mta-mini td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); }
.mta-mini .mta-input { height: 34px; width: 110px; }

/* ── البحث العام (Ctrl+K) ── */
.mta-cmd { width: min(640px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.mta-cmd-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.mta-cmd-in input { flex: 1; border: 0; outline: none; background: transparent; font-family: inherit; font-size: 1.05rem; color: var(--ink-strong); }
.mta-cmd-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.mta-cmd-sec { font-size: .72rem; color: var(--muted); font-weight: 700; padding: 10px 10px 4px; }
.mta-cmd-it { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.mta-cmd-it.on, .mta-cmd-it:hover { background: var(--teal-tint); color: var(--teal-ink); }
.mta-cmd-it .t { flex: 1; font-weight: 600; }
.mta-cmd-it small { color: var(--muted); font-size: .76rem; }

/* ── فارغ / قريبًا ── */
.mta-empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.mta-empty .ic-box { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--faint); }
.mta-empty h3 { color: var(--ink-strong); font-size: 1.1rem; margin: 0 0 6px; }

.mta-ic { display: inline-block; flex-shrink: 0; vertical-align: middle; }

/* ── الرسائل المنبثقة ── */
.mta-toasts { position: fixed; bottom: 56px; inset-inline-end: 24px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.mta-toast {
    display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 16px; border-radius: 12px;
    background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; font-size: .88rem; cursor: pointer;
    animation: mta-in .18s ease-out; border-inline-start: 4px solid var(--teal);
}
.mta-toast.warn { border-inline-start-color: var(--warn); }
.mta-toast.error { border-inline-start-color: var(--danger); }
.mta-toast.info { border-inline-start-color: var(--sky); }
@keyframes mta-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── الجوال ── */
@media (max-width: 960px) {
    .mta-side { display: none; }
    .mta-keys { display: none; }
    .mta-content { padding: 16px 16px 40px; }
    .mta-top { padding: 10px 16px; }
    .mta-top .clinic, .mta-user .who { display: none; }
    .mta-form { grid-template-columns: 1fr; }
    .mta-bars .b { grid-template-columns: 96px 1fr 64px; }
    .mta-grid.two { grid-template-columns: 1fr; }
}


/* ═══ الإنجليزي (dir=ltr) - 2026-10-24 ═══
   القواعد الفعلية يمين/يسار القليلة فوق (طلعة الرابط النشط من الشريط، خط الصف المختار) معكوسة هنا. */
.mta[dir="ltr"] { direction: ltr; }
.mta[dir="ltr"] .mta-flip { transform: scaleX(-1); }
.mta[dir="ltr"] .mta-nav { direction: rtl; margin-left: 0; margin-right: -28px; padding: 4px 40px 16px 12px; }
.mta[dir="ltr"] .mta-nav > * { direction: ltr; }
.mta[dir="ltr"] .mta-nav-link.active { margin-left: 0; padding-left: 12px; margin-right: -28px; padding-right: 40px; }
.mta[dir="ltr"] .mta-nav-sub .mta-nav-link.active { padding-left: 10px; padding-right: 40px; margin-left: 0; margin-right: -28px; }
.mta[dir="ltr"] .mta-table tbody tr.sel { box-shadow: inset 3px 0 0 var(--teal); }
.mta-lang { font-weight: 800; font-size: .82rem; text-decoration: none; }
/* FocusOnNavigate بيركّز العنوان بعد التنقل - بلا إطار ظاهر */
.mta h1:focus, .mta h1:focus-visible { outline: none; }


/* حقول الأرقام نص بأرقام لاتينية دايمًا (type=number بيعرض أرقام هندية لو لغة المتصفح عربي) */
.mta input[inputmode="decimal"], .mta input[inputmode="numeric"] { font-variant-numeric: tabular-nums; text-align: end; }



/* ═══ معاينة الطباعة MtaPdfPreview (2026-10-24 - نفس فكرة صرح) ═══
   الإطار فوق نص "جارٍ التجهيز" فيغطيه أول ما يتحمّل. data-kind بيتضبط من mta.js بعد التحميل: pdf أو html. */
.mta-pdf { position: fixed; inset: 3vh 3vw; z-index: 81; background: var(--surface); border-radius: 14px; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; }
.mta-pdf-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.mta-pdf-h h2 { margin: 0; flex: 1; font-size: 1.02rem; font-weight: 800; color: var(--ink-strong); min-width: 160px; }
.mta-pdf-b { position: relative; flex: 1; background: #525659; }
.mta-pdf-b iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mta-pdf-wait { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; }
.mta-pdf-f { padding: 8px 14px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }
.mta-pdf:not([data-kind="html"]) .only-html { display: none; }
.mta-pdf:not([data-kind="pdf"]) .only-pdf { display: none; }


/* ═══ جدول البيانات الموحّد MtaGrid (2026-10-25) - فلترة لكل عمود، ترتيب، تجميع، اختيار الأعمدة ═══ */
.mta-grid-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line-2); }
.mta-grid-groups { flex: 1; min-width: 260px; min-height: 40px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 10px;
                   border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: .8rem; }
.mta-grid-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 700; font-size: .78rem; }
.mta[data-theme="dark"] .mta-grid-chip { background: var(--teal); color: #032B33; }
.mta-grid-chip button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; display: grid; opacity: .8; }
.mta-grid-add { height: 30px; width: auto; font-size: .78rem; border-style: dashed; color: var(--muted); }
.mta-grid-colsbox { position: relative; }
.mta-grid-cols { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; max-height: 380px; overflow: auto;
                 display: flex; flex-direction: column; gap: 4px; padding: 10px; background: var(--surface); border: 1px solid var(--line);
                 border-radius: 12px; box-shadow: var(--shadow-lg); }
.mta-grid-cols .mta-check { height: 34px; }
.mta-dgrid th[draggable="true"] { cursor: pointer; user-select: none; }
.mta-dgrid th[draggable="true"]:hover { color: var(--ink-strong); }
.mta-dgrid th.num, .mta-dgrid td.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mta-dgrid td.num { font-weight: 700; color: var(--ink-strong); }
.mta-dgrid .mta-grid-filters th { padding: 6px 8px; background: var(--surface); }
.mta-dgrid .mta-grid-filters .mta-input { height: 30px; width: 100%; min-width: 0; padding: 0 8px; font-size: .8rem; }
.mta-dgrid .who b, .mta-dgrid td > div b, .mta-dgrid td .code, .mta-dgrid td .mta-badge { white-space: nowrap; }   /* الأسماء والأرقام القصيرة في سطر واحد - الجدول يتمرر بالعرض بدل ما الصف يطول */
.mta-dgrid .mta-grid-filters .mta-input.on { border-color: var(--teal); background: var(--teal-tint); }
.mta-dgrid tr.mta-grid-g td { background: var(--surface-3); color: var(--ink-strong); font-size: .84rem; padding-top: 8px; padding-bottom: 8px; }
.mta-dgrid tr.mta-grid-g.lv1 td, .mta-dgrid tr.mta-grid-g.lv2 td { background: var(--surface-2); }
.mta-dgrid tfoot td { font-weight: 800; color: var(--ink-strong); background: var(--surface-2); border-top: 2px solid var(--line); padding: 10px 14px; }


/* ═══ الشجرة + لوحة التفاصيل (2026-10-25، المالك: «بطريقة شجرية جميلة زي شجرة الحسابات») ═══
   عامة لأي بيانات هرمية: الخدمات (قسم ← تصنيف ← بند)، والحسابات والأقسام لاحقًا. */
.mta-tree-wrap { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); min-height: 620px; border-top: 1px solid var(--line-2); }
.mta-tree-side { border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; background: var(--surface-2); }
.mta-tree-tools { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line-2); }
.mta-tree-tools .row2 { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mta-tree { flex: 1; overflow-y: auto; max-height: 72vh; padding: 6px 6px 16px; }
.mta-tn { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 3px 8px; border-radius: 8px; cursor: pointer; user-select: none;
          color: var(--ink); font-size: .86rem; border: 1px solid transparent; }
.mta-tn:hover { background: var(--surface); border-color: var(--line); }
.mta-tn.on { background: var(--teal-tint); border-color: var(--teal); color: var(--ink-strong); }
.mta-tn .tg { width: 22px; height: 22px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; flex-shrink: 0; }
.mta-tn .tg.none { visibility: hidden; }
.mta-tn .ic { color: var(--teal-ink); display: grid; flex-shrink: 0; }
.mta-tn .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mta-tn .ct { font-size: .72rem; color: var(--muted); background: var(--surface-3); border-radius: 6px; padding: 0 7px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.mta-tn .pr { font-size: .8rem; font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; flex-shrink: 0; }
.mta-tn .add { display: none; border: 1px solid var(--line); background: var(--surface); color: var(--teal-ink); border-radius: 6px; height: 24px; padding: 0 7px; font-size: .74rem; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.mta-tn:hover .add, .mta-tn.on .add { display: inline-flex; align-items: center; gap: 3px; }
.mta-tn.lv0 { font-weight: 800; color: var(--ink-strong); }
.mta-tn.lv1 { padding-inline-start: 22px; font-weight: 700; }
.mta-tn.lv2 { padding-inline-start: 50px; }
.mta-tn.off .nm { color: var(--faint); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--faint) 60%, transparent); }
.mta-tn .dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; background: var(--line); }
.mta-tn .warn { color: var(--warn-ink); display: grid; flex-shrink: 0; }
.mta-ttable tbody tr { cursor: pointer; }
.mta-ttable td { vertical-align: middle; }
.mta-ttable .tn { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mta-ttable .tn .mta-badge, .mta-ttable td .mta-badge { white-space: nowrap; }
.mta-ttable .tn .tg { width: 22px; height: 22px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; flex-shrink: 0; }
.mta-ttable .tn .tg.none { visibility: hidden; }
.mta-ttable .tn .ic { color: var(--teal-ink); display: grid; flex-shrink: 0; }
/* زر «+» محجوز مكانه دايمًا (visibility مش display): لو ظهر وقت المرور بيوسّع العمود فالجدول يتحرك من تحت الفأرة ويختفي ويرجع = رجفة (ملاحظة المالك) */
.mta-ttable .tn .add { display: inline-flex; align-items: center; gap: 3px; visibility: hidden; border: 1px solid var(--line); background: var(--surface); color: var(--teal-ink); border-radius: 6px; height: 24px; padding: 0 7px; font-size: .74rem; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.mta-ttable tr:hover .tn .add, .mta-ttable tr.sel .tn .add { visibility: visible; }
.mta-ttable tr.lv0 td { background: var(--surface-2); font-weight: 700; color: var(--ink-strong); }
.mta-ttable tr.lv1 .tn { padding-inline-start: 26px; }
.mta-ttable tr.lv2 .tn { padding-inline-start: 52px; }
.mta-ttable tr.lv1 td { font-weight: 600; }
.mta-ttable .tn .dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; background: var(--line); margin-inline-end: 4px; }
.mta-ttable tr.off .tn { color: var(--faint); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--faint) 60%, transparent); }
.mta-ttable td.num, .mta-ttable th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mta-tree-guide { border-inline-start: 1px dashed var(--line); margin-inline-start: 18px; }
.mta-tree-panel { padding: 18px 22px; min-width: 0; }
.mta-tp-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.mta-tp-h h2 { margin: 0; font-size: 1.2rem; font-weight: 800; color: var(--ink-strong); flex: 1; min-width: 200px; line-height: 1.4; }
.mta-tp-sec { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: var(--surface); }
.mta-tp-sec > h3 { margin: 0 0 12px; font-size: .92rem; font-weight: 800; color: var(--ink-strong); display: flex; align-items: center; gap: 8px; }
.mta-tp-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.mta-tp-amounts { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1.3fr) minmax(0, .8fr); gap: 8px 12px; align-items: center; }
.mta-tp-amounts .h { font-size: .74rem; color: var(--muted); font-weight: 700; }
.mta-tp-amounts .l { font-weight: 700; color: var(--ink-strong); font-size: .88rem; }
.mta-tp-save { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; padding: 12px 0; background: var(--surface); border-top: 1px solid var(--line-2); }
.mta-tp-save .grow { flex: 1; font-size: .8rem; color: var(--warn-ink); font-weight: 700; }
@media (max-width: 1100px) { .mta-tree-wrap { grid-template-columns: 1fr; } .mta-tree-side { border-inline-end: 0; border-bottom: 1px solid var(--line); } .mta-tp-grid3 { grid-template-columns: 1fr; } }

/* ═══ الإعدادات العامة /hub/settings (2026-10-26): قائمة المجالات جانبًا + سطور (عنوان، أثر، اسم الوندوز) والتحكم في الطرف ═══ */
.mta-set { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 60vh; }
.mta-set-side { border-inline-end: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.mta-set-side button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px; border: 0; border-radius: 9px; background: none; color: var(--ink); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; text-align: start; }
.mta-set-side button:hover { background: var(--surface-3); }
.mta-set-side button.on { background: var(--teal-tint); color: var(--teal-ink); font-weight: 800; }
.mta-set-side button .t { flex: 1; min-width: 0; }
.mta-set-side .sep { height: 1px; background: var(--line); margin: 8px 4px; }
.mta-set-main { min-width: 0; padding: 6px 20px 0; }
.mta-set-main > h2 { margin: 12px 0 4px; font-size: 1.1rem; font-weight: 800; color: var(--ink-strong); display: flex; align-items: center; gap: 9px; }
.mta-set-main > .sub { color: var(--muted); font-size: .84rem; margin-bottom: 8px; }
.mta-setrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); gap: 10px 22px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.mta-setrow:last-child { border-bottom: 0; }
.mta-setrow.dirty { background: var(--warn-tint); margin-inline: -12px; padding-inline: 16px; border-radius: 10px; }
.mta-setrow .ti { font-weight: 800; color: var(--ink-strong); font-size: .93rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mta-setrow .ef { color: var(--ink); font-size: .84rem; line-height: 1.65; margin-top: 3px; }
.mta-setrow .mt { color: var(--muted); font-size: .76rem; margin-top: 4px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.mta-setrow .mt .nt { color: var(--warn-ink); }
.mta-setrow .ctl { display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 0; }
.mta-setrow .ctl .mta-input, .mta-setrow .ctl select { width: 100%; }
.mta-setrow .ctl .hist { flex-shrink: 0; width: 32px; height: 32px; }
.mta-setrow.off .ti, .mta-setrow.off .ef { opacity: .6; }
.mta-sw { position: relative; width: 46px; height: 26px; flex-shrink: 0; border: 0; border-radius: 7px; background: var(--line); cursor: pointer; transition: background .15s; padding: 0; }
.mta-sw > span { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 5px; background: #fff; box-shadow: 0 1px 3px rgba(11, 42, 74, .25); transition: inset-inline-start .15s; }
.mta-sw.on { background: var(--teal); }
.mta-sw.on > span { inset-inline-start: 23px; }
.mta-sw:disabled { cursor: not-allowed; opacity: .55; }
.mta-sw:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mta-swl { font-size: .8rem; font-weight: 700; color: var(--muted); min-width: 48px; text-align: center; }
.mta-swl.on { color: var(--teal-ink); }
.mta-refbtn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: .86rem; cursor: pointer; text-align: start; }
.mta-refbtn:hover:not(:disabled) { border-color: var(--teal); }
.mta-refbtn:disabled { cursor: not-allowed; background: var(--surface-3); }
.mta-refbtn .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mta-refbtn .n { color: var(--faint); font-size: .76rem; font-variant-numeric: tabular-nums; }
.mta-reflist { max-height: 56vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.mta-reflist .g { position: sticky; top: 0; background: var(--surface-3); padding: 6px 12px; font-size: .76rem; font-weight: 800; color: var(--muted); }
.mta-reflist button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .86rem; cursor: pointer; text-align: start; }
.mta-reflist button:hover { background: var(--teal-tint); }
.mta-reflist button.on { background: var(--teal-tint); color: var(--teal-ink); font-weight: 800; }
.mta-reflist button .t { flex: 1; }
.mta-reflist button .n { color: var(--faint); font-size: .76rem; font-variant-numeric: tabular-nums; }
.mta-set-save { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 10px; align-items: center; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--line); }
.mta-set-save .grow { flex: 1; font-size: .84rem; font-weight: 700; color: var(--warn-ink); }
.mta-set-hist td { vertical-align: top; }
.mta-set-hist .ov { color: var(--muted); text-decoration: line-through; }
@media (max-width: 1100px) {
    .mta-set { grid-template-columns: 1fr; }
    .mta-set-side { flex-direction: row; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); }
    .mta-set-side button { width: auto; white-space: nowrap; }
    .mta-set-side .sep { display: none; }
    .mta-setrow { grid-template-columns: 1fr; }
    .mta-setrow .ctl { justify-content: flex-start; }
}
