/*!
 * AR4HO MaintenancePro — dashboard app
 * Smarter Maintenance. Faster Resolutions.
 * Uses CSS logical properties so the same stylesheet renders LTR and RTL.
 */

.ar4ho-mp {
	--mp-primary: #0E5FD8;
	--mp-primary-ink: #fff;
	--mp-navy: #0B1B33;
	--mp-navy-2: #12284A;
	--mp-accent: #F5A524;
	--mp-bg: #F3F5F9;
	--mp-surface: #FFFFFF;
	--mp-surface-2: #F8FAFC;
	--mp-line: #E3E8EF;
	--mp-line-2: #CFD7E3;
	--mp-ink: #0F172A;
	--mp-ink-2: #334155;
	--mp-muted: #64748B;
	--mp-ok: #10B981;
	--mp-warn: #F59E0B;
	--mp-bad: #E5484D;
	--mp-info: #0EA5E9;
	--mp-radius: 14px;
	--mp-radius-sm: 10px;
	--mp-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
	--mp-shadow-lg: 0 20px 50px rgba(11, 27, 51, .22);
	--mp-font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--mp-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	--mp-side: 248px;

	font-family: var(--mp-font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--mp-ink);
	-webkit-font-smoothing: antialiased;
}
.ar4ho-mp[dir="rtl"], .ar4ho-mp:lang(ar) { --mp-font: "IBM Plex Sans Arabic", "IBM Plex Sans", Tahoma, sans-serif; }
.ar4ho-mp *, .ar4ho-mp *::before, .ar4ho-mp *::after { box-sizing: border-box; }
:where(.ar4ho-mp) :where(button, input, select, textarea) { font: inherit; color: inherit; }
.ar4ho-mp svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ar4ho-mp [dir="rtl"] .mp-flip, .ar4ho-mp[dir="rtl"] .mp-flip { transform: scaleX(-1); }
:where(.ar4ho-mp) :where(a) { color: var(--mp-primary); }
:where(.ar4ho-mp) :where(h1, h2, h3, h4) { margin: 0; line-height: 1.25; color: var(--mp-ink); font-family: inherit; letter-spacing: -.01em; }
:where(.ar4ho-mp) :where(p) { margin: 0; }
.mp-muted { color: var(--mp-muted); }
.mp-mono { font-family: var(--mp-mono); font-size: .86em; letter-spacing: .01em; }
.mp-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.mp-app { background: var(--mp-bg); min-height: 100vh; position: relative; }
.mp-boot { display: flex; gap: 12px; align-items: center; justify-content: center; min-height: 60vh; color: var(--mp-muted); }
.mp-spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--mp-line-2); border-top-color: var(--mp-primary); animation: mp-spin .8s linear infinite; display: inline-block; }
@keyframes mp-spin { to { transform: rotate(360deg); } }

.mp-shell { display: grid; grid-template-columns: var(--mp-side) minmax(0, 1fr); min-height: 100vh; }
.mp-side {
	position: sticky; top: 0; height: 100vh; overflow-y: auto;
	background: var(--mp-navy); color: #C9D5E8; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
	background-image: radial-gradient(120% 60% at 0% 0%, rgba(14, 95, 216, .35), transparent 60%);
}
.admin-bar .mp-side { top: 32px; height: calc(100vh - 32px); }
.mp-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-size: 15px; letter-spacing: .01em; }
.mp-brand strong { font-weight: 700; }
.mp-brand__mark { width: 34px; height: 34px; border-radius: 10px; background: var(--mp-primary); display: grid; place-items: center; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.mp-brand__mark svg { width: 18px; height: 18px; stroke: #fff; }
.mp-brand small { display: block; font-size: 10.5px; color: #8EA3C2; font-weight: 400; margin-top: 1px; }
.mp-brand--dark { color: var(--mp-ink); padding: 0 0 18px; }
.mp-nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: #6F86A8; padding: 14px 12px 6px; }
.mp-nav-btn {
	display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; cursor: pointer;
	padding: 10px 12px; border-radius: 10px; color: #C9D5E8; text-align: start; font-size: 14.5px; font-weight: 500; text-decoration: none;
	transition: background .15s, color .15s;
}
.mp-nav-btn svg { font-size: 18px; opacity: .85; }
.mp-nav-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.mp-nav-btn.is-active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--mp-accent); }
[dir="rtl"] .mp-nav-btn.is-active { box-shadow: inset -3px 0 0 var(--mp-accent); }
.mp-nav-btn .mp-count { margin-inline-start: auto; background: var(--mp-bad); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.mp-side__cta { margin: 10px 0 6px; }
.mp-side__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 2px; }
.mp-side__user { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; color: #fff; font-size: 13.5px; }
.mp-side__user img { width: 34px; height: 34px; border-radius: 50%; }
.mp-side__user small { display: block; color: #8EA3C2; font-size: 11.5px; }

.mp-scrim { display: none; }
.mp-main { min-width: 0; display: flex; flex-direction: column; }
.mp-top {
	position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
	padding: 14px 28px; background: rgba(243, 245, 249, .86); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent;
}
.admin-bar .mp-top { top: 32px; }
.mp-top h1 { font-size: 20px; font-weight: 700; }
.mp-top__actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.mp-icon-btn {
	position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--mp-line); background: var(--mp-surface);
	display: grid; place-items: center; cursor: pointer; color: var(--mp-ink-2); font-size: 18px; text-decoration: none;
}
.mp-icon-btn:hover { border-color: var(--mp-line-2); color: var(--mp-ink); }
.mp-icon-btn .mp-dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--mp-bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--mp-surface); }
.mp-lang-btn { width: auto; padding: 0 12px; gap: 6px; display: inline-flex; font-size: 13.5px; font-weight: 600; }
.mp-view { padding: 8px 28px 40px; max-width: 1320px; width: 100%; }
.mp-menu-btn { display: none; }

/* ---------- Buttons & form controls ---------- */
.mp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--mp-line-2); background: var(--mp-surface);
	color: var(--mp-ink); border-radius: var(--mp-radius-sm); padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
	transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
}
.mp-btn:hover { border-color: var(--mp-muted); }
.mp-btn:active { transform: translateY(1px); }
.mp-btn:disabled { opacity: .55; cursor: not-allowed; }
.mp-btn--primary { background: var(--mp-primary); border-color: var(--mp-primary); color: var(--mp-primary-ink); box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 6px 16px -6px var(--mp-primary); }
.mp-btn--primary:hover { filter: brightness(1.06); border-color: var(--mp-primary); }
.mp-btn--accent { background: var(--mp-accent); border-color: var(--mp-accent); color: #1E1300; }
.mp-btn--danger { color: var(--mp-bad); border-color: rgba(229,72,77,.35); }
.mp-btn--ghost { border-color: transparent; background: transparent; }
.mp-btn--ghost:hover { background: rgba(15,23,42,.05); border-color: transparent; }
.mp-btn--block { width: 100%; }
.mp-btn--sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.mp-btn--lg { padding: 13px 22px; font-size: 15px; }
.mp-btn svg { font-size: 16px; }

.mp-field { display: flex; flex-direction: column; gap: 6px; }
.mp-field > span, .mp-label { font-size: 13px; font-weight: 600; color: var(--mp-ink-2); }
.mp-field > span em { font-style: normal; font-weight: 400; color: var(--mp-muted); }
.mp-input, .mp-select, .mp-textarea {
	width: 100%; border: 1px solid var(--mp-line-2); background: var(--mp-surface); border-radius: var(--mp-radius-sm);
	padding: 10px 12px; font-size: 14.5px; color: var(--mp-ink); outline: none; transition: border-color .15s, box-shadow .15s; min-height: 42px;
}
.mp-textarea { min-height: 110px; resize: vertical; }
.mp-input:focus, .mp-select:focus, .mp-textarea:focus { border-color: var(--mp-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mp-primary) 18%, transparent); }
.mp-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 16px; background-position: right 10px center; padding-inline-end: 34px; }
[dir="rtl"] .mp-select { background-position: left 10px center; }
.mp-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.mp-check input { width: 18px; height: 18px; accent-color: var(--mp-primary); }
.mp-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.mp-switch input { position: absolute; opacity: 0; }
.mp-switch i { width: 40px; height: 22px; border-radius: 11px; background: var(--mp-line-2); position: relative; transition: background .2s; flex: none; }
.mp-switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.mp-switch input:checked + i { background: var(--mp-primary); }
.mp-switch input:checked + i::after { transform: translateX(18px); }
[dir="rtl"] .mp-switch input:checked + i::after { transform: translateX(-18px); }
.mp-switch input:focus-visible + i { outline: 2px solid var(--mp-primary); outline-offset: 2px; }

/* ---------- Cards, grids ---------- */
.mp-card { background: var(--mp-surface); border: 1px solid var(--mp-line); border-radius: var(--mp-radius); box-shadow: var(--mp-shadow); }
.mp-card__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--mp-line); }
.mp-card__head h3 { font-size: 15px; font-weight: 700; }
.mp-card__head .mp-btn, .mp-card__head a { margin-inline-start: auto; }
.mp-card__body { padding: 18px 20px; }
.mp-grid { display: grid; gap: 18px; }
.mp-grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mp-grid--main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.mp-grid--form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mp-span-2 { grid-column: 1 / -1; }
.mp-stack { display: flex; flex-direction: column; gap: 18px; }
.mp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mp-spacer { flex: 1; }

.mp-hero { display: flex; align-items: flex-end; gap: 20px; padding: 6px 0 22px; flex-wrap: wrap; }
.mp-hero h2 { font-size: 26px; font-weight: 700; }
.mp-hero p { color: var(--mp-muted); margin-top: 4px; }
.mp-hero .mp-btn { margin-inline-start: auto; }

.mp-kpi { padding: 18px 20px; position: relative; overflow: hidden; cursor: pointer; border: 1px solid var(--mp-line); text-align: start; background: var(--mp-surface); border-radius: var(--mp-radius); box-shadow: var(--mp-shadow); transition: transform .12s, border-color .15s; }
.mp-kpi:hover { transform: translateY(-1px); border-color: var(--mp-line-2); }
.mp-kpi__icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; margin-bottom: 14px; }
.mp-kpi__val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.mp-kpi__label { color: var(--mp-muted); font-size: 13px; margin-top: 6px; font-weight: 500; }
.mp-kpi--blue .mp-kpi__icon { background: #E6EFFD; color: var(--mp-primary); }
.mp-kpi--amber .mp-kpi__icon { background: #FEF3DC; color: #B7791F; }
.mp-kpi--red .mp-kpi__icon { background: #FDE8E8; color: var(--mp-bad); }
.mp-kpi--green .mp-kpi__icon { background: #DFF6EE; color: #0F8A61; }
.mp-kpi--red.is-hot { border-color: rgba(229,72,77,.4); background: linear-gradient(180deg, #FFF6F6, #fff); }

.mp-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mp-cat-tile {
	display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--mp-line); background: var(--mp-surface-2);
	cursor: pointer; text-align: start; transition: border-color .15s, background .15s;
}
.mp-cat-tile:hover { border-color: var(--c, var(--mp-primary)); background: #fff; }
.mp-cat-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); flex: none; }
.mp-cat-tile b { display: block; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.mp-cat-tile > span:last-child > span { font-size: 12.5px; color: var(--mp-muted); }

/* ---------- Badges ---------- */
.mp-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.mp-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mp-badge--new { background: #E6EFFD; color: #0B4FB5; }
.mp-badge--assigned { background: #EEE9FE; color: #5B3CC4; }
.mp-badge--in_progress { background: #FEF3DC; color: #9A5B00; }
.mp-badge--on_hold { background: #EEF1F5; color: #475569; }
.mp-badge--completed { background: #DFF6EE; color: #0B7A55; }
.mp-badge--closed { background: #E2E8F0; color: #334155; }
.mp-badge--cancelled { background: #FDE8E8; color: #B42318; }
.mp-badge--open { background: #E6EFFD; color: #0B4FB5; }
.mp-prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.mp-prio i { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.mp-prio i b { width: 3px; border-radius: 1px; background: var(--mp-line-2); }
.mp-prio i b:nth-child(1) { height: 5px; } .mp-prio i b:nth-child(2) { height: 8px; } .mp-prio i b:nth-child(3) { height: 10px; } .mp-prio i b:nth-child(4) { height: 12px; }
.mp-prio--low { color: #64748B; } .mp-prio--low i b:nth-child(-n+1) { background: #64748B; }
.mp-prio--medium { color: #0B4FB5; } .mp-prio--medium i b:nth-child(-n+2) { background: #0E5FD8; }
.mp-prio--high { color: #B45309; } .mp-prio--high i b:nth-child(-n+3) { background: #F59E0B; }
.mp-prio--critical { color: #B42318; } .mp-prio--critical i b { background: #E5484D; }
.mp-overdue { color: var(--mp-bad); font-weight: 600; }
.mp-chip-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mp-ink-2); }
.mp-chip-cat svg { color: var(--c); font-size: 14px; }

/* ---------- Request list ---------- */
.mp-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; }
.mp-filters .mp-search { flex: 1 1 260px; position: relative; }
.mp-filters .mp-search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--mp-muted); }
.mp-filters .mp-search input { padding-inline-start: 38px; }
.mp-filters .mp-select { width: auto; min-width: 150px; flex: 0 1 auto; }
.mp-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 14px; }
.mp-tab { border: 1px solid var(--mp-line); background: var(--mp-surface); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--mp-ink-2); cursor: pointer; }
.mp-tab.is-active { background: var(--mp-navy); border-color: var(--mp-navy); color: #fff; }

.mp-list { list-style: none; margin: 0; padding: 0; }
.mp-item {
	display: grid; grid-template-columns: 42px minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 110px; gap: 16px; align-items: center;
	padding: 14px 20px; border-top: 1px solid var(--mp-line); cursor: pointer; transition: background .12s;
}
.mp-item:first-child { border-top: 0; }
.mp-item:hover { background: var(--mp-surface-2); }
.mp-item:focus-visible { outline: 2px solid var(--mp-primary); outline-offset: -2px; }
.mp-item__title { font-weight: 600; font-size: 14.5px; color: var(--mp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-item__meta { font-size: 12.5px; color: var(--mp-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.mp-item__cell { font-size: 13px; color: var(--mp-ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-item__cell small { display: block; color: var(--mp-muted); font-size: 11.5px; }
.mp-list-head { display: grid; grid-template-columns: 42px minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 110px; gap: 16px; padding: 10px 20px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--mp-muted); border-bottom: 1px solid var(--mp-line); background: var(--mp-surface-2); border-radius: var(--mp-radius) var(--mp-radius) 0 0; }
.mp-mini { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--mp-line); cursor: pointer; }
.mp-mini:first-child { border-top: 0; }
.mp-mini:hover { background: var(--mp-surface-2); }
.mp-mini__body { min-width: 0; flex: 1; }
.mp-mini__body b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-mini__body span { font-size: 12.5px; color: var(--mp-muted); }
.mp-empty { padding: 40px 20px; text-align: center; color: var(--mp-muted); }
.mp-empty svg { font-size: 34px; display: block; margin: 0 auto 10px; color: var(--mp-line-2); }
.mp-pager { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--mp-line); font-size: 13px; color: var(--mp-muted); }
.mp-pager .mp-spacer + .mp-btn { margin-inline-start: 0; }
.mp-skel { height: 64px; margin: 10px 20px; border-radius: 10px; background: linear-gradient(90deg, #EEF2F7 0, #F7F9FC 40%, #EEF2F7 80%); background-size: 200% 100%; animation: mp-shimmer 1.2s infinite; }
@keyframes mp-shimmer { to { background-position: -200% 0; } }

/* ---------- New request form ---------- */
.mp-form-wrap { max-width: 880px; }
.mp-step { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mp-step b { width: 26px; height: 26px; border-radius: 50%; background: var(--mp-navy); color: #fff; display: grid; place-items: center; font-size: 13px; }
.mp-step h3 { font-size: 16px; }
.mp-cat-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mp-cat-pick label { position: relative; cursor: pointer; }
.mp-cat-pick input { position: absolute; opacity: 0; }
.mp-cat-pick .mp-cat-card {
	display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px 16px; border-radius: 14px; border: 1.5px solid var(--mp-line); background: var(--mp-surface);
	transition: border-color .15s, box-shadow .15s, transform .1s; min-height: 118px;
}
.mp-cat-pick .mp-cat-card:hover { border-color: var(--mp-line-2); }
.mp-cat-pick input:checked + .mp-cat-card { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.mp-cat-pick input:focus-visible + .mp-cat-card { outline: 2px solid var(--mp-primary); outline-offset: 2px; }
.mp-cat-pick .mp-cat-card .mp-cat-ico { width: 44px; height: 44px; font-size: 22px; }
.mp-cat-pick .mp-cat-card strong { font-size: 14.5px; }
.mp-cat-pick input:checked + .mp-cat-card::after { content: ""; position: absolute; top: 12px; inset-inline-end: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--c) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat; }

.mp-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mp-seg label { cursor: pointer; position: relative; }
.mp-seg input { position: absolute; opacity: 0; }
.mp-seg label > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 6px; border-radius: 10px; border: 1.5px solid var(--mp-line); background: var(--mp-surface); font-weight: 600; font-size: 13.5px; text-align: center; }
.mp-seg input:checked + span { border-color: var(--mp-ink); background: var(--mp-navy); color: #fff; }
.mp-seg input:checked + span .mp-prio { color: #fff; }
.mp-seg input:focus-visible + span { outline: 2px solid var(--mp-primary); outline-offset: 2px; }
.mp-hint { font-size: 12.5px; color: var(--mp-muted); display: flex; align-items: center; gap: 6px; }

.mp-drop {
	border: 1.5px dashed var(--mp-line-2); border-radius: 14px; padding: 22px; text-align: center; color: var(--mp-muted); cursor: pointer; background: var(--mp-surface-2);
	transition: border-color .15s, background .15s; display: block;
}
.mp-drop:hover, .mp-drop.is-over { border-color: var(--mp-primary); background: #F1F6FF; color: var(--mp-ink-2); }
.mp-drop svg { font-size: 26px; display: block; margin: 0 auto 8px; color: var(--mp-primary); }
.mp-drop input { display: none; }
.mp-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 12px; }
.mp-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--mp-surface-2); border: 1px solid var(--mp-line); display: grid; place-items: center; color: var(--mp-muted); font-size: 11px; text-align: center; padding: 0; cursor: pointer; }
.mp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-thumb .mp-thumb__x { position: absolute; top: 4px; inset-inline-end: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(15,23,42,.7); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; font-size: 13px; }
.mp-thumb__file { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; word-break: break-all; }
.mp-thumb__file svg { font-size: 22px; }
.mp-success { text-align: center; padding: 48px 24px; }
.mp-success__ico { width: 72px; height: 72px; border-radius: 50%; background: #DFF6EE; color: #0B7A55; display: grid; place-items: center; font-size: 34px; margin: 0 auto 18px; }
.mp-success h2 { font-size: 24px; margin-bottom: 8px; }
.mp-success .mp-ref { font-family: var(--mp-mono); background: var(--mp-surface-2); border: 1px solid var(--mp-line); padding: 2px 8px; border-radius: 6px; }

/* ---------- Drawer (request detail) ---------- */
.mp-overlay { position: fixed; inset: 0; z-index: 100001; background: rgba(11, 27, 51, .42); display: flex; justify-content: flex-end; animation: mp-fade .18s ease; }
.mp-drawer {
	width: min(760px, 100%); height: 100%; background: var(--mp-bg); box-shadow: var(--mp-shadow-lg); display: flex; flex-direction: column; animation: mp-slide .22s cubic-bezier(.2,.8,.2,1);
}
[dir="rtl"] .mp-drawer { animation-name: mp-slide-rtl; }
@keyframes mp-fade { from { opacity: 0; } }
@keyframes mp-slide { from { transform: translateX(40px); opacity: .4; } }
@keyframes mp-slide-rtl { from { transform: translateX(-40px); opacity: .4; } }
.mp-drawer__head { padding: 18px 24px; background: var(--mp-surface); border-bottom: 1px solid var(--mp-line); display: flex; gap: 14px; align-items: flex-start; }
.mp-drawer__head h2 { font-size: 19px; font-weight: 700; margin-top: 4px; }
.mp-drawer__body { overflow-y: auto; padding: 20px 24px 40px; flex: 1; display: flex; flex-direction: column; gap: 16px; }
.mp-drawer__close { margin-inline-start: auto; }
.mp-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.mp-meta div { font-size: 13.5px; min-width: 0; }
.mp-meta dt, .mp-meta .k { font-size: 11.5px; color: var(--mp-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.mp-desc, .mp-tl__msg, .mp-tl__body p { unicode-bidi: plaintext; }
.mp-desc { white-space: pre-wrap; color: var(--mp-ink-2); font-size: 14.5px; }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-sla { height: 6px; border-radius: 3px; background: var(--mp-line); overflow: hidden; margin-top: 8px; }
.mp-sla i { display: block; height: 100%; background: var(--mp-ok); border-radius: 3px; }
.mp-sla.is-warn i { background: var(--mp-warn); } .mp-sla.is-bad i { background: var(--mp-bad); }

.mp-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.mp-timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; inset-inline-start: 15px; width: 2px; background: var(--mp-line); }
.mp-tl { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.mp-tl__dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--mp-surface); border: 2px solid var(--mp-line); color: var(--mp-muted); font-size: 14px; flex: none; z-index: 1; overflow: hidden; }
.mp-tl__dot img { width: 100%; height: 100%; object-fit: cover; }
.mp-tl__body { flex: 1; min-width: 0; padding-top: 4px; }
.mp-tl__body b { font-size: 13.5px; font-weight: 600; }
.mp-tl__body time { font-size: 12px; color: var(--mp-muted); margin-inline-start: 6px; }
.mp-tl__body p { margin-top: 2px; font-size: 13.5px; color: var(--mp-ink-2); }
.mp-tl__msg { margin-top: 6px; background: var(--mp-surface); border: 1px solid var(--mp-line); border-radius: 4px 12px 12px 12px; padding: 10px 14px; font-size: 14px; white-space: pre-wrap; color: var(--mp-ink); }
[dir="rtl"] .mp-tl__msg { border-radius: 12px 4px 12px 12px; }
.mp-tl.is-internal .mp-tl__msg { background: #FFF8E6; border-color: #F7DFA4; }
.mp-tag-int { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #9A5B00; background: #FEF3DC; padding: 1px 6px; border-radius: 4px; margin-inline-start: 6px; }
.mp-composer { display: flex; flex-direction: column; gap: 10px; }
.mp-composer .mp-row { justify-content: space-between; }
.mp-stars { display: inline-flex; gap: 4px; direction: ltr; }
.mp-stars button { border: 0; background: none; cursor: pointer; font-size: 28px; color: var(--mp-line-2); padding: 0; line-height: 1; }
.mp-stars button.is-on { color: var(--mp-accent); }
.mp-stars--static { font-size: 16px; color: var(--mp-accent); letter-spacing: 2px; }

/* ---------- Modal ---------- */
.mp-modal-wrap { position: fixed; inset: 0; z-index: 100005; background: rgba(11,27,51,.45); display: grid; place-items: center; padding: 16px; animation: mp-fade .15s; }
.mp-modal { background: var(--mp-surface); border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--mp-shadow-lg); }
.mp-modal__head { padding: 18px 22px; border-bottom: 1px solid var(--mp-line); display: flex; align-items: center; }
.mp-modal__head h3 { font-size: 17px; }
.mp-modal__head button { margin-inline-start: auto; }
.mp-modal__body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.mp-modal__foot { padding: 14px 22px; border-top: 1px solid var(--mp-line); display: flex; justify-content: flex-end; gap: 8px; background: var(--mp-surface-2); border-radius: 0 0 16px 16px; }
.mp-tech-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--mp-line); border-radius: 12px; cursor: pointer; }
.mp-tech-opt:has(input:checked) { border-color: var(--mp-primary); background: #F1F6FF; }
.mp-tech-opt img { width: 34px; height: 34px; border-radius: 50%; }
.mp-tech-opt div { flex: 1; min-width: 0; }
.mp-tech-opt small { color: var(--mp-muted); display: block; font-size: 12px; }
.mp-tech-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; }

/* ---------- Lightbox ---------- */
.mp-lightbox { position: fixed; inset: 0; z-index: 100010; background: rgba(5,10,20,.9); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.mp-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }

/* ---------- Toast ---------- */
.mp-toasts { position: fixed; z-index: 100020; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
[dir="rtl"] .mp-toasts { transform: translateX(50%); }
.mp-toast { background: var(--mp-navy); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--mp-shadow-lg); display: flex; gap: 10px; align-items: center; animation: mp-rise .2s ease; pointer-events: auto; }
.mp-toast--error { background: #9F1D22; }
.mp-toast svg { font-size: 17px; }
@keyframes mp-rise { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Charts ---------- */
.mp-chart { width: 100%; }
.mp-chart svg { width: 100%; height: auto; stroke: none; fill: initial; overflow: visible; }
.mp-chart text { font-family: var(--mp-font); font-size: 11px; fill: var(--mp-muted); }
.mp-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--mp-ink-2); flex-wrap: wrap; }
.mp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }
.mp-bars { display: flex; flex-direction: column; gap: 12px; }
.mp-bar { display: grid; grid-template-columns: 130px minmax(0, 1fr) 44px; gap: 12px; align-items: center; font-size: 13px; }
.mp-bar__track { height: 10px; background: var(--mp-surface-2); border-radius: 5px; overflow: hidden; border: 1px solid var(--mp-line); }
.mp-bar__fill { height: 100%; border-radius: 5px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.mp-bar b { text-align: end; font-variant-numeric: tabular-nums; }
.mp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mp-table th { text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--mp-muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--mp-line); background: var(--mp-surface-2); white-space: nowrap; }
.mp-table td { padding: 12px 14px; border-bottom: 1px solid var(--mp-line); vertical-align: middle; }
.mp-table tr:last-child td { border-bottom: 0; }
.mp-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.mp-person { display: flex; align-items: center; gap: 10px; }
.mp-person img { width: 30px; height: 30px; border-radius: 50%; }
.mp-scroll-x { overflow-x: auto; }
.mp-pill-meter { display: inline-flex; align-items: center; gap: 8px; }
.mp-pill-meter span { width: 60px; height: 6px; background: var(--mp-line); border-radius: 3px; overflow: hidden; display: inline-block; }
.mp-pill-meter span i { display: block; height: 100%; background: var(--mp-ok); }

/* ---------- Work orders / schedules ---------- */
.mp-wo { padding: 16px 20px; border-top: 1px solid var(--mp-line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.mp-wo:first-child { border-top: 0; }
.mp-wo__num { font-family: var(--mp-mono); font-size: 12.5px; color: var(--mp-muted); }
.mp-wo h4 { font-size: 15px; margin: 2px 0 4px; }
.mp-wo .mp-row { gap: 14px; font-size: 12.5px; color: var(--mp-muted); }
.mp-wo-panel { background: var(--mp-surface); border: 1px solid var(--mp-line); border-radius: var(--mp-radius); padding: 16px 18px; }

/* ---------- Notifications ---------- */
.mp-notif { display: flex; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--mp-line); cursor: pointer; }
.mp-notif:first-child { border-top: 0; }
.mp-notif:hover { background: var(--mp-surface-2); }
.mp-notif.is-unread { background: #F4F8FF; }
.mp-notif.is-unread .mp-notif__ico::after { content: ""; position: absolute; top: -1px; inset-inline-end: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--mp-primary); border: 2px solid #fff; }
.mp-notif__ico { position: relative; width: 38px; height: 38px; border-radius: 11px; background: var(--mp-surface-2); border: 1px solid var(--mp-line); display: grid; place-items: center; color: var(--mp-primary); font-size: 17px; flex: none; }
.mp-notif p { font-size: 14px; }
.mp-notif small { color: var(--mp-muted); font-size: 12px; }

/* ---------- Bottom nav (mobile) ---------- */
.mp-bottom { display: none; }

/* ---------- Login ---------- */
.mp-login { display: grid; place-items: center; padding: 40px 16px; min-height: 70vh; background: radial-gradient(80% 60% at 50% 0%, #E6EFFD, transparent 70%); }
.mp-login__card { width: min(420px, 100%); background: #fff; border: 1px solid var(--mp-line); border-radius: 18px; padding: 32px; box-shadow: var(--mp-shadow); }
.mp-login__card h2 { font-size: 20px; margin-bottom: 4px; }
.mp-login__card form p { margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.mp-login__card label { font-size: 13px; font-weight: 600; color: var(--mp-ink-2); }
.mp-login__card input[type=text], .mp-login__card input[type=password] { border: 1px solid var(--mp-line-2); border-radius: 10px; padding: 11px 12px; font-size: 15px; width: 100%; }
.mp-login__card .login-remember label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.mp-login__card input[type=submit] { width: 100%; border: 0; border-radius: 10px; background: var(--mp-primary); color: #fff; padding: 12px; font-weight: 600; font-size: 15px; cursor: pointer; margin-top: 6px; }
.mp-login__links { margin-top: 18px !important; font-size: 13px; color: var(--mp-muted); text-align: center; }
.mp-notice { padding: 16px 20px; border-radius: 12px; background: #FFF8E6; border: 1px solid #F7DFA4; color: #7A4A00; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
	.mp-grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mp-grid--main { grid-template-columns: minmax(0, 1fr); }
	.mp-item, .mp-list-head { grid-template-columns: 42px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 100px; }
	.mp-item > :nth-child(5), .mp-list-head > :nth-child(5) { display: none; }
}
@media (max-width: 900px) {
	.mp-shell { grid-template-columns: minmax(0, 1fr); }
	.mp-side { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 99980; width: 280px; height: 100%; transform: translateX(-105%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
	[dir="rtl"] .mp-side { transform: translateX(105%); }
	.mp-app.is-menu .mp-side { transform: none; box-shadow: var(--mp-shadow-lg); }
	.mp-app.is-menu .mp-scrim { display: block; position: fixed; inset: 0; z-index: 99970; background: rgba(11,27,51,.4); }
	.admin-bar .mp-side { top: 0; height: 100%; }
	.mp-menu-btn { display: grid; }
	.mp-top { padding: 12px 16px; }
	.mp-top h1 { font-size: 18px; }
	.mp-view { padding: 4px 16px 96px; }
	.mp-cats, .mp-cat-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mp-grid--2 { grid-template-columns: minmax(0, 1fr); }
	.mp-list-head { display: none; }
	.mp-item { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "ico main badge" "ico sub sub"; gap: 4px 12px; padding: 14px 16px; }
	.mp-item > :nth-child(1) { grid-area: ico; align-self: start; }
	.mp-item > :nth-child(2) { grid-area: main; }
	.mp-item > :nth-child(6) { grid-area: badge; justify-self: end; }
	.mp-item > :nth-child(3), .mp-item > :nth-child(4) { display: none; }
	.mp-item > :nth-child(5) { display: block; grid-area: sub; }
	.mp-item__title { white-space: normal; }
	.mp-bottom {
		display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 99960; inset-inline: 0; bottom: 0;
		background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--mp-line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
	}
	.mp-bottom button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--mp-muted); padding: 6px 2px; cursor: pointer; position: relative; }
	.mp-bottom button svg { font-size: 21px; }
	.mp-bottom button.is-active { color: var(--mp-primary); }
	.mp-bottom .mp-bottom__fab span { width: 48px; height: 48px; border-radius: 16px; background: var(--mp-primary); color: #fff; display: grid; place-items: center; margin-top: -22px; box-shadow: 0 8px 20px -6px var(--mp-primary); }
	.mp-bottom .mp-bottom__fab svg { font-size: 24px; }
	.mp-bottom .mp-dot { position: absolute; top: 2px; inset-inline-end: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--mp-bad); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
	.mp-drawer { width: 100%; }
	.mp-drawer__head, .mp-drawer__body { padding-inline: 16px; }
	.mp-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mp-hero h2 { font-size: 22px; }
	.mp-hero .mp-btn { display: none; }
	.mp-top__search, .mp-top .mp-hide-sm { display: none; }
	.mp-toasts { bottom: 90px; }
	.mp-bar { grid-template-columns: 96px minmax(0, 1fr) 36px; }
}
@media (max-width: 560px) {
	.mp-grid--form { grid-template-columns: minmax(0, 1fr); }
	.mp-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mp-kpi { padding: 14px 16px; }
	.mp-kpi__val { font-size: 24px; }
	.mp-kpi__icon { width: 32px; height: 32px; font-size: 16px; margin-bottom: 10px; }
	.mp-grid { gap: 12px; }
	.mp-filters .mp-select { flex: 1 1 calc(50% - 10px); min-width: 0; }
	.mp-wo { grid-template-columns: minmax(0, 1fr); }
	.mp-modal-wrap { place-items: end center; padding: 0; }
	.mp-modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
}
@media (prefers-reduced-motion: reduce) {
	.ar4ho-mp *, .ar4ho-mp *::before, .ar4ho-mp *::after { animation: none !important; transition: none !important; }
}
@media print {
	.mp-side, .mp-top, .mp-bottom { display: none !important; }
	.mp-shell { display: block; }
}
