/* MEANSFUL partner app: the client portal's look (portal.css, loaded first), plus partner parts and right-to-left. */

/* Arabic: a matching typeface and slightly roomier lines. */
:root[lang="ar"] body { font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif; line-height: 1.65; }
:root[lang="ar"] h1, :root[lang="ar"] h2, :root[lang="ar"] h3 { letter-spacing: 0; line-height: 1.35; }

/* The logo is a drawing with Latin text: it never mirrors. */
.space-logo { direction: ltr; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-tag { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; padding: 2px 9px; }
:root[lang="ar"] .brand-tag { letter-spacing: 0; text-transform: none; }
.lang-toggle { min-width: 64px; font-weight: 700; }
:root[lang="ar"] .lang-toggle { font-family: "IBM Plex Sans", "Segoe UI", sans-serif; }
:root[lang="en"] .lang-toggle { font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }

/* Numbers, phone numbers, sizes and references read left-to-right inside Arabic text. */
.ltr, .ref, .num { direction: ltr; unicode-bidi: isolate; }
input[type="tel"], input[type="email"], input[inputmode="numeric"], input[inputmode="decimal"] { direction: ltr; }
:root[dir="rtl"] input[type="tel"], :root[dir="rtl"] input[type="email"],
:root[dir="rtl"] input[inputmode="numeric"], :root[dir="rtl"] input[inputmode="decimal"] { text-align: right; }

/* Portal rules written for left-to-right, mirrored. */
:root[dir="rtl"] .facts strong, :root[dir="rtl"] .option .price { text-align: left; }
:root[dir="rtl"] .toast { border-left: 1px solid var(--line); border-right: 4px solid var(--accent); }
:root[dir="rtl"] .toast.bad { border-right-color: var(--danger); }
:root[dir="rtl"] .check input { margin-top: 6px; }

/* status */
.status-banner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.badge.info { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.badge.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.badge.syncing { color: var(--warn); border-style: dashed; }

/* tabs inside a page */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs .chip .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-inline-start: 6px;
  padding: 0 6px; border-radius: 999px; font-size: 12px; background: var(--accent-soft); color: var(--accent); }
.tabs .chip.active .count { background: color-mix(in srgb, var(--accent-ink) 18%, transparent); color: inherit; }

/* job cards */
.job-list { display: grid; gap: 14px; }
.job { display: grid; gap: 14px; }
.job-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; justify-content: space-between; }
.job-head h3 { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.job-price { font-size: 20px; font-weight: 700; }
.spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.spec div { padding: 9px 12px; border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); margin: 0 -1px -1px 0; }
.spec dt { font-size: 12.5px; color: var(--muted); }
.spec dd { margin: 2px 0 0; font-weight: 600; }
.instructions { white-space: pre-wrap; padding: 10px 12px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); }
.file-links { display: flex; flex-wrap: wrap; gap: 8px; }
.file-links a { display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.file-links a:hover { border-color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
button.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
button.danger:hover { background: var(--danger-soft); }
.inline-form { display: grid; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--inset); }

/* machines */
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.machine { display: grid; gap: 10px; align-content: start; }
.machine.paused { opacity: .72; }
.machine-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; }
.switch-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.class-options { display: grid; gap: 8px; }
.class-options .option { grid-template-columns: auto 1fr; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.request-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--inset); font-size: 14.5px; }

/* payments */
.money-tiles { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.money-tiles .panel { padding: 16px 18px; }
.money-tiles strong { display: block; font-size: 24px; margin-top: 4px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.list th, table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: start; }
table.list th { color: var(--muted); font-weight: 500; font-size: 13px; }
table.list td.num, table.list th.num { text-align: end; }

/* profile */
.nda { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--inset); display: grid; gap: 10px; }
.nda p { font-size: 14px; color: var(--muted); }
.contacts { display: grid; gap: 8px; }

@media (max-width: 860px) {
  .money-tiles { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .brand-tag { display: none; }
}
@media (max-width: 420px) {
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* the tiles above already show agreed and paid: keep the job, its status and what is due */
  table.list th:nth-child(3), table.list td:nth-child(3), table.list th:nth-child(4), table.list td:nth-child(4) { display: none; }
  .ref { white-space: nowrap; }
}

@keyframes flash-target { from { box-shadow: 0 0 0 3px var(--accent); } to { box-shadow: 0 0 0 3px transparent; } }
.flash { animation: flash-target 2.2s ease-out; }
:root[lang="ar"] .notify-level { letter-spacing: 0; text-transform: none; }

/* designs: only designers see the tab */
body:not(.is-designer) .designer-only { display: none !important; }
.types { border: 0; padding: 0; margin: 0; }
.type-options { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.design details { margin-top: 6px; }
.design summary { cursor: pointer; color: var(--muted, #8aa); }
.design-history { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
