/* ==========================================================
   MKFEY — Staff portal theme
   Same palette / type as the public website (mkfey-website/Assets/css/site.css)
   and the app kit (theme/Mkfey-App-Screens.html). Uses logical properties so
   one stylesheet serves RTL (Arabic, default) and LTR (English).
   ========================================================== */
:root {
  --bg: #FBF7F8; --panel: #FFFFFF; --panel-2: #F7F2F4;
  --ink: #241016; --ink-2: #7A6670; --line: #E6DCE0;
  --primary: #19597A; --primary-dark: #144762; --primary-soft: #E8EEF2;
  --maroon: #8D1733; --maroon-soft: rgba(141, 23, 51, .08);
  --ember: #D9522A; --ok: #2C7A50; --danger: #C0392B; --warn: #B7791F; --whatsapp: #25D366;
  --shadow: 0 1px 2px rgba(36,16,22,.06), 0 12px 28px -18px rgba(36,16,22,.28);
  --radius: 16px; --side-w: 272px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Cairo", system-ui, sans-serif; font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-family: "Cairo", sans-serif; }
.mi { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; line-height: 1; vertical-align: middle; font-size: 22px; letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga"; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: embed; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.hidden { display: none !important; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: linear-gradient(190deg, var(--primary-dark), var(--primary) 70%, #1d6a91);
  color: #fff; padding: 22px 16px 16px;
}
.side .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
.side .brand img { height: 40px; width: auto; }
.side .brand small { display: block; font-size: 12px; opacity: .75; line-height: 1.3; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav h6 { margin: 18px 12px 6px; font-size: 12px; letter-spacing: .08em; opacity: .6; font-weight: 700; text-transform: uppercase; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; border-radius: 12px;
  color: rgba(255,255,255,.86); font-weight: 600; font-size: 15.5px; position: relative; transition: background .15s;
}
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.on { background: rgba(255,255,255,.17); color: #fff; }
.nav a.on::before { content: ""; position: absolute; inset-inline-start: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: #fff; }
.nav a .badge { margin-inline-start: auto; background: var(--ember); color: #fff; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.side .foot { margin-top: 14px; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.16); font-size: 12.5px; opacity: .8; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.side .foot img { height: 24px; width: auto; opacity: .9; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px 28px;
  background: rgba(251,247,248,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 21px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.menu-btn { display: none; }   /* only shown below 900px, where the sidebar is off-canvas; two classes so .icon-btn below can't re-show it */
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--maroon); color: var(--maroon); }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.chip-btn:hover { color: var(--maroon); border-color: var(--maroon); }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--maroon); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.user-menu .who { line-height: 1.2; text-align: start; }
.user-menu .who b { display: block; font-size: 14px; }
.user-menu .who span { font-size: 12px; color: var(--ink-2); }
.user-menu .drop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.user-menu .drop a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.user-menu .drop a:hover { background: var(--panel-2); }
.user-menu .drop a.danger { color: var(--danger); }

.page { padding: 26px 28px 60px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { font-size: 24px; font-weight: 800; }
.page-head p { margin: 2px 0 0; color: var(--ink-2); }
.crumbs { font-size: 13.5px; color: var(--ink-2); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a:hover { color: var(--maroon); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; border: 1.5px solid; animation: pop .2s ease-out; }
.alert.ok { background: #EAF5EF; border-color: #B7DEC7; color: #1F5C3B; }
.alert.err { background: #FCEDEB; border-color: #F2C3BD; color: #922B21; }
.alert.info { background: var(--primary-soft); border-color: #C6D6E0; color: var(--primary-dark); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px;
  border-radius: 12px; border: 2px solid transparent; font: 700 15px/1 "Cairo", sans-serif; cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s; text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .icon-btn:focus-visible, .chip-btn:focus-visible { outline: 3px solid rgba(141,23,51,.35); outline-offset: 2px; }
.btn .mi { font-size: 20px; }
.btn-primary { background: var(--maroon); color: #fff; box-shadow: 0 10px 20px -12px rgba(141,23,51,.7); }
.btn-primary:hover { background: #7a1229; }
.btn-blue { background: var(--primary); color: #fff; }
.btn-outline { background: var(--panel); color: var(--primary); border-color: var(--primary); }
.btn-ghost { background: var(--primary-soft); color: var(--primary); }
.btn-ghost-danger { background: #FCEDEB; color: var(--danger); }   /* same shape as .btn-ghost, for a delete next to an edit */
.btn-danger { background: var(--panel); color: var(--danger); border-color: #E7B7B1; }
.btn-danger:hover { background: #FCEDEB; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .aspNetDisabled.btn { opacity: .5; cursor: not-allowed; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card h3 { font-size: 17px; font-weight: 800; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head h3 .mi { color: var(--maroon); font-size: 22px; }
/* collapsible card (<section class="card" data-collapse="id">, wired up by admin.js): only the head shows while collapsed */
.card[data-collapse] > .card-head { cursor: pointer; user-select: none; }
.card[data-collapse] > .card-head:focus-visible { outline: 2px solid var(--maroon); outline-offset: -2px; border-radius: var(--radius); }
.card[data-collapse] > .card-head h3 { margin-inline-end: auto; }
.card-head .collapse-ic { color: var(--ink-2); font-size: 24px; transition: transform .2s; }
.card.is-collapsed > .card-head { border-bottom: 0; }
.card.is-collapsed > .card-head .collapse-ic { transform: rotate(-90deg); }
[dir="rtl"] .card.is-collapsed > .card-head .collapse-ic { transform: rotate(90deg); }
.card.is-collapsed > :not(.card-head) { display: none; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.kpi .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.kpi .ic .mi { font-size: 28px; }
.kpi .ic.c1 { background: var(--maroon-soft); color: var(--maroon); }
.kpi .ic.c2 { background: #FBE9E2; color: var(--ember); }
.kpi .ic.c3 { background: var(--primary-soft); color: var(--primary); }
.kpi .ic.c4 { background: #E6F2EB; color: var(--ok); }
.kpi b { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; }
.kpi span { color: var(--ink-2); font-size: 14px; font-weight: 600; }
a.kpi:hover { border-color: var(--maroon); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filters .search { position: relative; flex: 1 1 260px; min-width: 200px; }
.filters .search .mi { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.filters .search input { padding-inline-start: 44px; }
.filters select { width: auto; min-width: 160px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field[hidden] { display: none; }
.field > label, .lbl { font-weight: 700; font-size: 14.5px; }
.field.req > label::after, .field.req > .lbl::after { content: " *"; color: var(--danger); }
.field .help { font-size: 13px; color: var(--ink-2); }
.help-link { color: var(--maroon); font-weight: 700; white-space: nowrap; }
.help-link:hover { text-decoration: underline; }
.help-link .mi { font-size: 15px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=tel], select, textarea, .input {
  width: 100%; min-height: 46px; padding: 9px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  font: 500 15.5px/1.5 "Cairo", sans-serif; transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--maroon); box-shadow: 0 0 0 4px rgba(141,23,51,.12); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--maroon); vertical-align: middle; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; min-height: 40px; }
.check label { cursor: pointer; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.err-text { color: var(--danger); font-size: 13.5px; font-weight: 600; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-inline-end: 50px; }
.pass-wrap button { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--ink-2); width: 38px; height: 38px; border-radius: 10px; }
.pass-wrap button:hover { color: var(--maroon); }
/* sign-in CAPTCHA: code field + image box (refresh button next to the field) */
.captcha { display: flex; gap: 10px; align-items: stretch; }
.captcha input { flex: 1; min-width: 0; letter-spacing: .18em; font-weight: 700; text-transform: uppercase; }
.captcha input::placeholder { letter-spacing: 0; font-weight: 500; text-transform: none; }
.captcha-box { flex: none; display: flex; align-items: center; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #F4F1F5; }
.captcha-box img { display: block; width: 150px; height: 48px; }
.captcha-box button { align-self: stretch; width: 42px; border: 0; border-inline-end: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; }
.captcha-box button:hover, .captcha-box button:focus-visible { color: var(--maroon); }
.captcha-box button.spin .mi { animation: captcha-spin .6s linear infinite; }
@keyframes captcha-spin { to { transform: rotate(360deg); } }
@media (max-width: 380px) { .captcha { flex-direction: column; } .captcha-box { align-self: flex-start; } }
/* Settings → SMS: one group of settings per provider (admin.js shows the chosen one) */
.sms-fields { border: 1.5px solid var(--line); border-radius: 14px; padding: 6px 18px 4px; margin: 4px 0 16px; }
.sms-fields legend { font-weight: 800; padding: 0 8px; color: var(--maroon); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: start; font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FCF9FA; }
.tbl td.num, .tbl th.num { text-align: end; }
.tbl .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { text-align: center; padding: 44px 20px; color: var(--ink-2); }
.empty .mi { font-size: 48px; color: var(--line); display: block; margin-bottom: 8px; }
.tbl a.link { color: var(--primary); font-weight: 700; }
.tbl a.link:hover { color: var(--maroon); text-decoration: underline; }

.pager { display: flex; gap: 6px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager a, .pager .cur { min-width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1.5px solid var(--line); font-weight: 700; padding: 0 6px; }
.pager a:hover { border-color: var(--maroon); color: var(--maroon); }
.pager .cur { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.pager .total { margin-inline-start: auto; color: var(--ink-2); font-size: 13.5px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.yellow { background: #FDF3D8; color: #8A6212; }
.pill.blue { background: #E0EDF5; color: #17506F; }
.pill.green { background: #E2F2E9; color: #1F6A43; }
.pill.red { background: #FBE4E1; color: #A1301F; }
.pill.grey { background: #ECE7EA; color: #5D4E56; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 700; margin: 2px; }
.tag.maroon { background: var(--maroon-soft); color: var(--maroon); }
/* users: may the customer edit their details in the app (closed maroon lock = no, the default; open green lock = yes)
   and how the account was created (blue phone = auto, by their own sign-in; orange person+ = manual, by an admin) */
.edit-lock, .created-via { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.edit-lock .mi, .created-via .mi { font-size: 21px; }
.edit-lock.locked { color: var(--maroon); }
.edit-lock.open { color: var(--ok); }
.created-via.auto { color: var(--primary); }
.created-via.manual { color: var(--ember); }

/* ---------- key/value + timeline ---------- */
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 0; }
.kv dt, .kv dd { margin: 0; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.kv dt { color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.kv dd { font-weight: 600; word-break: break-word; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv-sm { grid-template-columns: 120px minmax(0, 1fr); max-width: 420px; margin-top: 6px; }   /* compact list, e.g. audit log details */
.kv-sm dt, .kv-sm dd { padding: 4px 0; font-size: 13px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 30px 20px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 7px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--maroon); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--maroon); }
.timeline b { display: block; }
.timeline .note { margin-top: 4px; background: var(--panel-2); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.thread .msg { padding: 12px 16px; border-radius: 14px; margin-bottom: 10px; background: var(--panel-2); max-width: 92%; }
.thread .msg.staff { background: var(--primary-soft); margin-inline-start: auto; }
.thread .msg.internal { background: #FDF3D8; border: 1px dashed #E3C57A; }
.thread .msg .meta { font-size: 12.5px; color: var(--ink-2); margin-bottom: 3px; font-weight: 600; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs a, .thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; font-size: 12px; color: var(--ink-2); }
.bars .bar i { display: block; width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--primary), #3b83a8); min-height: 3px; }
.bars .bar b { color: var(--ink); font-size: 12.5px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.hbar .track { height: 12px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--maroon), var(--ember)); border-radius: 99px; }

/* ---------- permission matrix ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: start; position: sticky; inset-inline-start: 0; background: #fff; z-index: 1; font-weight: 700; }
.matrix th:first-child { background: var(--panel-2); }
.matrix .cell { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; min-width: 150px; }
.matrix .cell label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; border-radius: 8px; background: var(--panel-2); cursor: pointer; font-weight: 600; }
.matrix .cell label:has(input:checked) { background: var(--primary-soft); color: var(--primary-dark); }
.matrix .cell input { width: 15px; height: 15px; }
.matrix .full { color: var(--ok); font-weight: 800; }

/* ---------- toggle ---------- */
.switch { position: relative; display: inline-block; width: 52px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #D7CCD1; border-radius: 30px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; inset-inline-start: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { inset-inline-start: 25px; }

/* ---------- repeater blocks (offer edit) ---------- */
.rep { border: 1.5px dashed var(--line); border-radius: 14px; padding: 14px; padding-inline-end: 60px; margin-bottom: 12px; background: #FDFBFC; position: relative; }   /* end padding keeps fields clear of the .rm button */
.rep .rm { position: absolute; inset-inline-end: 8px; top: 8px; }
.rep-add { margin-top: 4px; }
.dropzone { border: 2px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center; color: var(--ink-2); background: #FDFBFC; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(560px 380px at 90% 0%, rgba(217,82,42,.35), transparent 60%), radial-gradient(520px 420px at 0% 100%, rgba(141,23,51,.55), transparent 60%), linear-gradient(160deg, var(--primary-dark), var(--primary));
}
.auth-brand img.logo { height: 64px; width: auto; }
.auth-brand h1 { font-size: 38px; font-weight: 800; margin: 26px 0 10px; }
.auth-brand p { font-size: 18px; opacity: .88; max-width: 34ch; }
.auth-brand ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-brand li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.auth-brand li .mi { background: rgba(255,255,255,.14); border-radius: 12px; padding: 8px; }
.auth-brand .partners { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; opacity: .95; font-size: 12.5px; letter-spacing: .06em; }
.auth-brand .partners img { height: 30px; width: auto; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; position: relative; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h2 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.auth-card > p { color: var(--ink-2); margin: 0 0 24px; }
.auth-lang { position: absolute; top: 20px; inset-inline-end: 24px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 18px; flex-wrap: wrap; }
.auth-row a { color: var(--maroon); font-weight: 700; }
.auth-row a:hover { text-decoration: underline; }
.auth-foot { text-align: center; margin-top: 22px; color: var(--ink-2); font-size: 13.5px; }
.auth-card .btn { min-height: 54px; font-size: 17px; }
.strength { height: 6px; background: var(--panel-2); border-radius: 6px; overflow: hidden; margin-top: 4px; }
.strength i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }

.scrim { display: none; }

/* ---------- request statuses: "internal" marker + the status flags on Services > Request statuses ---------- */
.tag-internal { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 6px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; line-height: 1.6; color: #8A5A00; background: #FDF3D8; border: 1px dashed #E3C57A; vertical-align: middle; white-space: nowrap; }
.tag-internal .mi { font-size: 14px; }
.status-flags { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 22px; margin-top: 4px; }
.status-flags .check { align-items: flex-start; }
.status-flags .check input { margin-top: 12px; }
.status-flags .check > span { display: flex; flex-direction: column; line-height: 1.45; padding-top: 8px; }
.status-flags .help { font-weight: 400; font-size: 13px; color: var(--ink-2); }

/* ---------- idle sign-out warning (Assets/js/session.js; motion is switched off by the reduced-motion rule below) ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.idle { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(36,16,22,.5); backdrop-filter: blur(3px); animation: idle-fade .18s ease-out; }
.idle[hidden] { display: none; }
.idle-card { width: min(420px, 100%); background: var(--panel); border-radius: 20px; box-shadow: 0 24px 60px -20px rgba(36,16,22,.55); padding: 28px 24px 22px; text-align: center; animation: idle-pop .22s ease-out; }
.idle-ring { position: relative; width: 88px; height: 88px; margin: 0 auto 14px; }
.idle-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.idle-ring circle { fill: none; stroke-width: 6; }
.idle-ring .track { stroke: var(--maroon-soft); }
.idle-ring .bar { stroke: var(--maroon); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.idle-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 21px; color: var(--maroon); direction: ltr; font-variant-numeric: tabular-nums; }
.idle-card h2 { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.idle-card p { margin: 0 0 20px; color: var(--ink-2); }
.idle-card p b { color: var(--ink); font-variant-numeric: tabular-nums; }
.idle-actions { display: flex; flex-direction: column; gap: 10px; }
@keyframes idle-fade { from { opacity: 0; } }
@keyframes idle-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 60; inset-block: 0; inset-inline-start: 0; width: min(88vw, 320px); transition: transform .22s ease; }
  [dir=rtl] .side { transform: translateX(105%); }
  [dir=ltr] .side { transform: translateX(-105%); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(20,10,14,.5); }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 10px 14px; }
  .page { padding: 18px 14px 48px; }
  .grid-2, .form-row, .form-row.three { grid-template-columns: minmax(0, 1fr); }
  .user-menu .who { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .kv { grid-template-columns: 120px minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .topbar h1 { font-size: 18px; }
  .hbar { grid-template-columns: 100px 1fr 34px; }
}
/* ---------- confirmation dialog for [data-confirm] (Assets/js/admin.js) ---------- */
.mk-confirm { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 16px; background: rgba(36,16,22,.5); backdrop-filter: blur(3px); animation: idle-fade .18s ease-out; }
.mk-confirm[hidden] { display: none; }
.mk-confirm-card { width: min(440px, 100%); background: var(--panel); border-radius: 20px; box-shadow: 0 24px 60px -20px rgba(36,16,22,.55); padding: 28px 24px 22px; text-align: center; animation: idle-pop .22s ease-out; }
.mk-confirm-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--maroon-soft); color: var(--maroon); }
.mk-confirm-icon .mi { font-size: 32px; }
.mk-confirm.warn .mk-confirm-icon { background: #FFF4E0; color: #B26A00; }
.mk-confirm-card h2 { font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.mk-confirm-card p { margin: 0 0 22px; color: var(--ink-2); line-height: 1.8; }
.mk-confirm-actions { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 480px) { .mk-confirm-actions { flex-direction: row; } .mk-confirm-actions .btn { flex: 1; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .side, .topbar, .actions, .filters, .pager, .btn { display: none !important; } .app { display: block; } .page { padding: 0; } }

/* Settings → card benefits: a type list and, for discount / financing / up to, a percentage */
.benefits .benefit-cell { display: flex; align-items: center; gap: 6px; min-width: 190px; }
.benefits .benefit-cell select { flex: 1; min-width: 0; }
.benefits .benefit-pct { display: inline-flex; align-items: center; gap: 4px; }
.benefits .benefit-pct[hidden] { display: none; }
.benefits .benefit-pct input { width: 72px; }

/* Services → service items: price box, icon preview, «Other» switch, price per card tier */
.price-input { display: flex; align-items: center; gap: 8px; }
.price-input input { flex: 1; min-width: 0; }
.price-input span { font-weight: 700; color: var(--ink-2); }
.icon-select { display: flex; align-items: center; gap: 10px; }
.icon-select .mi { font-size: 30px; color: var(--maroon); width: 34px; text-align: center; }
.icon-select select { flex: 1; min-width: 0; }
.other-switch { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.other-switch > .mi { font-size: 28px; color: var(--maroon); }
.other-switch > div { flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.tier-prices { display: flex; flex-direction: column; gap: 2px; font-size: 13px; white-space: nowrap; }
.tier-prices s { color: var(--ink-2); }
