/* ============================================================================
 * odpo — DESIGN TOKENS AND GLOBAL ELEMENT STYLES
 *
 * Deliberately styles ELEMENTS (button, input, table, h1…) rather than adding classes to
 * every page. The portal has fourteen screens built from bare HTML with inline styles, so
 * a class-based system would have meant editing every one: a large diff, a real chance of
 * breaking a screen, and any page added later starting unstyled again. Styling the
 * elements improves all fourteen at once and the NEXT page inherits it for free. Inline
 * styles already in the markup still win where a page needs something specific.
 *
 * --brand-primary / --brand-secondary are NOT set here. MainLayout emits them per request
 * from the company's own branding, falling back to the odpo palette, so a client that has
 * uploaded its colours keeps them. Everything below reads the token with the odpo value as
 * the fallback, never a hard-coded literal.
 *
 * EVERY DIRECTIONAL RULE USES LOGICAL PROPERTIES (inline-start/end, not left/right). The
 * portal runs in ten languages across both directions, and a physical `left` is a bug that
 * only appears in half of them — which no amount of testing in Arabic will reveal.
 * ========================================================================== */

:root {
  /* The odpo palette, read off the logo itself: a near-black navy running through deep
     purple into a strong blue. */
  --odpo-ink: #1D1B3A;
  --odpo-ink-soft: #3A3663;
  --odpo-violet: #2E2A7A;

  /* Champagne — the one warm note in the system, and the reason the portal reads as
     considered rather than merely tidy. Used SPARINGLY and only on dark ground: the active
     nav marker, the rule under a page title, a focused field's glow. It is deliberately NOT
     tied to --brand-primary: a client sets its own brand colour, and an accent that shifted
     with it would sometimes land on a hue that fights the surface it sits on. On the dark
     sidebar this tone is safe against any brand colour a client can choose. */
  --accent: #C9A227;
  --accent-soft: #E7C86A;

  --text: #17172a;
  --text-muted: #5c5c6e;
  --text-faint: #8a8a99;

  --surface: #ffffff;
  --surface-sunken: #f4f4f8;
  --surface-raised: #ffffff;
  --canvas: #eff0f6;

  --border: #e5e5ee;
  --border-strong: #c8c8d6;

  --ok: #1e7a5a;
  --ok-bg: #eef8f3;
  --warn: #8a6320;
  --warn-bg: #fdf6e9;
  --danger: #b3261e;
  --danger-bg: #fdeceb;

  --radius-lg: 16px;
  --radius: 11px;
  --radius-sm: 7px;

  /* Three levels, each a pair: a tight contact shadow plus a wide soft one. A single
     large blur reads as haze; the pair is what reads as a real surface above another. */
  --shadow-sm: 0 1px 2px rgba(23, 23, 42, .05), 0 2px 6px rgba(23, 23, 42, .04);
  --shadow: 0 1px 2px rgba(23, 23, 42, .06), 0 8px 24px -6px rgba(23, 23, 42, .10);
  --shadow-lg: 0 2px 4px rgba(23, 23, 42, .06), 0 24px 48px -12px rgba(23, 23, 42, .18);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --ease: cubic-bezier(.4, 0, .2, 1);

  /* Fine grain laid over the portal's two brand-coloured surfaces (the sign-in brand panel
     and the home banner), so a large dark field reads as a surface rather than a flat
     digital fill. A static image — the noise is rasterised once — not a live filter. */
  --odpo-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

html { -webkit-text-size-adjust: 100%; }

body {
  color: var(--text);
  /* A flat fill reads cheap at full-screen size. This is a very low-contrast wash — a cool
     tint settling toward the bottom — that gives the white cards something to sit on
     without ever becoming a "designed background" competing with the data. */
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(46, 42, 122, .05), transparent 60%),
    linear-gradient(180deg, #f7f7fb 0%, var(--canvas) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Numbers are the substance of this product — rents, areas, cheque amounts, occupancy.
   Proportional digits make a column of figures ragged and genuinely harder to compare;
   tabular figures line the columns up. This one declaration does more for how the portal
   reads than any colour in this file. */
table, .odpo-num, input[type="number"], td, th {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---- Typography -------------------------------------------------------------
 * A real scale with weight contrast. The previous headings differed from body text by a
 * few pixels, which is what makes a page read as an undifferentiated wall. */
h1 {
  font-size: clamp(1.55rem, 1.2rem + 1.1vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.3;
  margin: 0 0 var(--space-4);
  color: var(--text);
}

/* A short champagne rule under the page title. Small, and it is most of what separates
   "a web form" from "a product someone paid for". */
h1::after {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  margin-top: var(--space-3);
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}

/* Theme pass — the icon badge PageHeading.razor sets before an <h1>'s own text. Inline
   rather than a flex wrapper around the whole heading, so h1::after above still renders as
   an ordinary block below the (icon + text) line with no change to that rule at all.
   vertical-align nudges it up against the cap-height of a heading this size, which
   text-bottom/middle both got visibly wrong. */
.odpo-page-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-inline-end: 10px;
  vertical-align: -8px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 10%, transparent);
  color: var(--brand-primary, var(--odpo-ink));
}

.odpo-page-heading-icon svg { width: 19px; height: 19px; }

h2 {
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -.005em;
  margin: var(--space-6) 0 var(--space-3);
  color: var(--text);
}

h3 { font-size: .96rem; font-weight: 650; margin: 0 0 var(--space-2); color: var(--text); }

/* ---- Controls ---------------------------------------------------------------
 * Browser-default buttons and inputs were used throughout. On Windows Chrome those render
 * as small grey chrome that gives no signal about which action is primary, and no signal
 * at all about focus. */
button {
  font: inherit;
  font-weight: 550;
  padding: 9px 18px;
  min-height: 40px;                 /* a real touch target on a phone */
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .16s var(--ease), border-color .16s var(--ease),
              box-shadow .16s var(--ease), transform .06s var(--ease);
}

/* The SECONDARY hover, and it must not reach the primary button.
 *
 * It used to be plain `button:hover:not(:disabled)`, which is MORE SPECIFIC (0,2,1) than
 * `button[type="submit"]` (0,1,1). The submit button's own hover rule below did not declare
 * a background, so on hover this rule's near-white won over the primary gradient while the
 * text stayed white — the sign-in button turned into an empty white box with an invisible
 * label. Reported from a real screen; nothing in a build or a test could see it.
 *
 * Excluding submit here is the structural fix rather than the symptomatic one: any property
 * added to this rule later would otherwise spring the same trap again. */
button:hover:not(:disabled):not([type="submit"]) {
  background: var(--surface-sunken);
  border-color: var(--odpo-ink-soft);
  box-shadow: var(--shadow);
}

/* A pressed button that does not move does not feel pressed. */
button:active:not(:disabled) { transform: translateY(1px); box-shadow: var(--shadow-sm); }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* A form's submit button IS its primary action, so it can be styled as one without any
   page having to say so. */
button[type="submit"] {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 88%, white),
      var(--brand-primary, var(--odpo-ink)));
  border-color: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 80%, black);
  color: #fff;
  font-weight: 650;
  letter-spacing: .005em;
  box-shadow: 0 1px 2px rgba(23, 23, 42, .18),
              0 6px 18px -6px color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 55%, transparent);
}

/* Declares its OWN background rather than leaning on the base rule, so no other hover rule
   can win it by specificity. Belt and braces with the exclusion above, deliberately: this
   is the button every single user presses, and it went invisible once already. */
button[type="submit"]:hover:not(:disabled) {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 76%, white),
      color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 94%, white));
  border-color: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 80%, black);
  color: #fff;
  box-shadow: 0 2px 4px rgba(23, 23, 42, .20),
              0 10px 26px -8px color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 62%, transparent);
}

input, select, textarea {
  font: inherit;
  padding: 9px 12px;
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}

textarea { min-height: 84px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

/* Task 10.42 — a bare native checkbox (the permissions matrix, every settings toggle) used
   to render at whatever tiny size and flat grey the browser defaults to, which is what made
   a page of them look like a form nobody finished styling rather than a real product
   control. `accent-color` is enough on its own for the checked fill to pick up the brand
   colour; the explicit size is what makes it a comfortable click/tap target in a dense
   table. Excluded from the generic `input` rule above (which sizes a TEXT field) because a
   checkbox has no meaningful min-height/padding/border of its own. */
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--brand-primary, var(--odpo-ink));
  cursor: pointer;
}

/* A focused field gets a soft halo in the brand colour, not just a border swap — it is
   findable from across the screen, which is the whole point on a long form. */
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-secondary, var(--odpo-violet));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 14%, transparent);
  outline: none;
}

/* ONE visible focus ring, everywhere. There was none at all, which makes the portal
   unusable by keyboard and fails the most basic accessibility check. */
:is(button, input, select, textarea, a, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-secondary, var(--odpo-violet));
  outline-offset: 2px;
}

/* Except the page heading FocusOnNavigate (App.razor) focuses on every navigation: Blazor
   gives it tabindex="-1" and focuses it so a screen reader starts reading there. Nobody
   tabbed to it, so it gets no ring — which is what app.css's `h1:focus { outline: none }`
   meant, but the [tabindex] rule above out-ranks it. Invisible while the sign-in heading
   was visually hidden; a ring around "تسجيل الدخول" on arrival once it was not. */
h1[tabindex="-1"]:focus-visible { outline: none; }

label {
  font-size: .855rem;
  font-weight: 550;
  color: var(--text-muted);
  display: inline-block;
  margin-bottom: var(--space-1);
}

a { color: var(--brand-secondary, var(--odpo-violet)); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--odpo-ink); }

/* ---- Tables -----------------------------------------------------------------
 * Every list screen uses a bare table. Zebra striping and real cell padding are the
 * difference between scanning a rent roll and counting rows with a finger. */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead tr {
  background: linear-gradient(180deg, #fbfbfd, var(--surface-sunken));
}

th {
  font-size: .79rem;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--text-muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: start;              /* logical: flips with the language */
  white-space: nowrap;
}

td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-sunken) 50%, transparent); }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 6%, transparent); }

/* A wide table must scroll inside itself rather than pushing the page sideways. */
.odpo-table-scroll { overflow-x: auto; border-radius: var(--radius); }

/* ---- The app frame --------------------------------------------------------- */
/* Task 10.44 — capped at 1160px but never actually CENTRED: with no margin at all a
   block element sits flush against its own start side (the right edge in Arabic), so on
   anything wider than the cap the whole page — every screen, not just the new hub — read
   as pushed to one side with a dead gap down the other. Harmless before the sidebar's
   250px permanently ate the equivalent gap on ITS side; gone now (task 10.44), the
   asymmetry became visible on every screen at once. */
.content {
  padding-top: var(--space-6);
  padding-bottom: var(--space-7);
  max-width: 1160px;
  margin-inline: auto;
}

/* Task 10.44 — the sidebar (a full-height brand-coloured panel with a scrollable link
   list) is gone entirely, on every screen size, replaced by a slim top bar plus the home
   hub grid (Pages/Home.razor) as the portal's actual navigation surface — see TopBar.razor.
   Every `.sidebar`/`.nav-scrollable .nav-link*` rule that used to live here is removed
   rather than left unreferenced: the same "a rule nothing selects is a landmine" discipline
   task 10.42 already applied to NavMenu.razor.css's own dead rules. */
/* Task 10.45 — a real bug the product owner caught live: with no `flex-wrap`, every item
   here (brand logos, the home link, the language picker, the identity chip, sign-out) fought
   over one fixed-height row on a phone/iPad-portrait width. Flex's default `flex-shrink: 1`
   does not wrap overflow to a new line, it SQUEEZES every item's padding and text instead —
   so the row did not just look cramped, it made the row itself wider than the viewport,
   which put the whole PAGE into horizontal scroll (the hub grid was never broken; it was
   scrolled half off-screen by its own top bar). `flex-wrap: wrap` is the structural fix:
   items that do not fit their row drop to a new one instead of being crushed. */
.odpo-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding: 10px var(--space-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
}

@media (max-width: 640px) {
  .odpo-topbar { padding: 8px var(--space-3); gap: 8px 10px; }
}

.odpo-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
}

/* On a narrow screen the spacer pushing everything else to the far end is exactly what
   forces one cramped row; letting the OTHER items wrap onto their own row instead (while
   the brand keeps its own) reads far calmer than a single squeezed line. `flex-basis: 100%`
   is what forces the wrap point to fall right after the brand rather than mid-group. */
@media (max-width: 640px) {
  .odpo-topbar-spacer { flex-basis: 100%; height: 0; }
}

.odpo-topbar-spacer { flex: 1; }

.odpo-topbar-home {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.odpo-topbar-home:hover { background: var(--surface-sunken); color: var(--text); }

.odpo-topbar-home.active {
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 10%, transparent);
  color: var(--brand-primary, var(--odpo-ink));
}

/* The signed-out "Sign in" link, on the sign-in screen itself (see TopBar.razor). */
.odpo-topbar-signin.active { display: none; }

.odpo-topbar-signout {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: none;
  box-shadow: none;
}

.odpo-topbar-signout:hover:not(:disabled) {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger-bg);
}

/* The language picker used to sit on the dark sidebar; the bar is light now, so its
   dropdown goes back to ordinary field colours instead of the white-on-dark treatment
   further down this file (still used nowhere else, so left as-is there rather than
   duplicated). */
.odpo-topbar .odpo-language-picker select {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  min-height: 36px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
}

.odpo-topbar .odpo-language-picker select:hover { border-color: var(--brand-secondary, var(--odpo-violet)); }

/* ---- Home (Pages/Home.razor) --------------------------------------------------------
 * The landing screen and, since task 10.44, the portal's navigation surface. Three parts in
 * one column that share ONE width — the welcome banner, the occupancy panel (staff only)
 * and the hub. They used to sit in two widths (the KPIs at .content's, the card grid in a
 * narrower centred wrap), so their edges never lined up.
 *
 * .odpo-home is also a size container: the hub picks its column count from the width it
 * actually has, not from the viewport, so it stays right however .content is padded. */
.odpo-home {
  container-type: inline-size;
  display: grid;
  /* minmax(0, …), not the implicit auto column: a grid item's default min-width is its
     content's, so the per-building table's natural width forced the whole column (banner
     included) past a phone's viewport — seen at 390px — when the table is meant to scroll
     inside its own .odpo-table-scroll instead. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

/* Shared entrance for the portal's two landing screens (sign-in and home): each block
   arrives once, in reading order. The global prefers-reduced-motion rule at the end of this
   file collapses it to an instant. */
@keyframes odpo-rise {
  from { opacity: 0; transform: translateY(10px); }
}

/* -- The welcome banner (Shared/HomeWelcomeBanner.razor) --------------------------------
 * The one brand-coloured surface on the page, from the same family as the sign-in brand
 * panel: two soft glows over the company's own primary colour, plus grain. Built from
 * --brand-primary/--brand-secondary rather than odpo's literals, so a company that set
 * its own colours sees them here. White text relies on the same assumption the primary
 * button already makes — that a brand's primary colour is a dark one. */
.odpo-home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 136px;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(60% 160% at 100% 0%,
      color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 90%, transparent), transparent 60%),
    radial-gradient(55% 140% at 0% 100%,
      color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 60%, transparent), transparent 62%),
    linear-gradient(160deg,
      color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 94%, white) 0%,
      var(--brand-primary, var(--odpo-ink)) 45%,
      color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 84%, black) 100%);
  box-shadow: 0 1px 2px rgba(29, 27, 58, .08),
              0 16px 32px -22px color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 45%, transparent);
  animation: odpo-rise .5s cubic-bezier(.16, 1, .3, 1) both;
}

/* odpo's mark, faint, on the banner's otherwise empty end — the same watermark the sign-in
   brand panel carries, and the same platform mark the top bar always shows beside a
   company's own logo. Same square-box / -4.2% offset technique as .odpo-signin-brand::before
   (the mark is the first ~26% of the one high-resolution logo file). */
.odpo-home-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block-start: 50%;
  inset-inline-end: -28px;
  width: 230px;
  aspect-ratio: 1;
  translate: 0 -50%;
  background: url("../brand/odpo-logo-white.png") no-repeat -4.2% 50% / auto 100%;
  opacity: .07;
  pointer-events: none;
}

.odpo-home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--odpo-grain);
  opacity: .09;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* A rounded square rather than a circle: it reads as the same family as the hub's icon
   tiles below it, instead of a stock avatar bubble. */
.odpo-home-avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  font-size: 1.2rem;
  font-weight: 700;
}

.odpo-home-identity { min-width: 0; }

/* The page's h1, deliberately small: the greeting under it is the visual headline, but
   "Dashboard" is what the page IS — the heading a screen reader lands on (FocusOnNavigate
   targets h1) and the one the tab title repeats. */
.odpo-home-title {
  margin: 0 0 2px;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  color: rgba(255, 255, 255, .72);
}

.odpo-home-title::after { display: none; }

.odpo-home-greeting {
  margin: 0;
  font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem);
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.odpo-home-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.odpo-home-hero .odpo-pill {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}

/* While the identity fetch is in flight: the banner keeps its full height and shape, with
   translucent bars where the greeting and pills will land, so nothing below it moves. */
.odpo-home-skeleton {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, .10) 25%, rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, .10) 75%);
  background-size: 200% 100%;
  animation: odpo-skeleton 1.3s ease-in-out infinite;
}

.odpo-home-skeleton + .odpo-home-skeleton { margin-top: 12px; }
.odpo-home-skeleton-line { inline-size: min(260px, 70%); height: 20px; margin-top: 4px; }
.odpo-home-skeleton-short { inline-size: 140px; height: 12px; }

/* -- Panels (the occupancy report) --------------------------------------------------- */
.odpo-home-panel {
  padding: var(--space-5) var(--space-6);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: odpo-rise .5s .06s cubic-bezier(.16, 1, .3, 1) both;
}

.odpo-home-panel-title { margin: 0 0 var(--space-4); font-size: 1rem; }

.odpo-home-panel-message { margin: 0; color: var(--text-muted); }

.odpo-occupancy-skeleton-figure { inline-size: 132px; height: 48px; border-radius: 10px; }
.odpo-occupancy-skeleton-bar { height: 14px; border-radius: 7px; }
.odpo-home-panel-message.is-error { color: var(--danger); }

/* The headline figure beside its breakdown: one hero number (the rate), then the bar that
   shows what it is made of, with the counts in the legend under it. */
.odpo-occupancy-summary {
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4) var(--space-7);
}

/* Proportional figures, not tabular: a lone display-size number set in tabular digits reads
   loose (every digit gets the width of a 0). Tabular stays for the table's columns. */
.odpo-occupancy-figure {
  font-size: clamp(2.6rem, 2rem + 1.6vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: proportional-nums;
  color: var(--text);
}

.odpo-occupancy-caption {
  margin-top: var(--space-2);
  font-size: .85rem;
  color: var(--text-muted);
}

/* Part-to-whole: rented, under maintenance and vacant as one bar, each segment its share of
   ALL units (a unit in any other state leaves its share empty rather than being guessed
   into one of these). One hue in three lightness steps — the rented share is the point, the
   rest is context — separated by a 2px surface gap rather than drawn outlines, so touching
   segments read apart without adding lines. The two lighter steps sit under 3:1 against the
   panel, which is why every segment's count is printed in the legend beneath it and the
   table below repeats the figures per building: colour is never the only carrier. */
.odpo-stackbar {
  display: flex;
  gap: 2px;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
}

.odpo-stackbar-seg { height: 100%; min-inline-size: 0; }

.odpo-occ-rented { background: var(--brand-primary, var(--odpo-ink)); }
.odpo-occ-maintenance { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 45%, white); }
.odpo-occ-vacant { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 14%, white); }

.odpo-stackbar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: .85rem;
  color: var(--text-muted);
}

.odpo-stackbar-legend li { display: inline-flex; align-items: center; gap: var(--space-2); }

.odpo-stackbar-legend strong {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.odpo-swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; }

/* The per-building table sits flat inside the panel — the panel is already the card, so a
   second border, radius and shadow around the table would be a card inside a card. */
.odpo-occupancy-table { margin-top: var(--space-5); }

.odpo-home-panel table {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.odpo-home-panel thead tr { background: none; }
.odpo-home-panel th { padding-inline: 0 var(--space-4); }
.odpo-home-panel td { padding-inline: 0 var(--space-4); }
.odpo-home-panel tbody tr:nth-child(even) { background: none; }

/* A meter per building: the same brand hue on a lighter step of itself, so the track still
   reads as part of the one scale. The percentage beside it stays the exact figure. */
.odpo-meter-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-inline-size: 150px;
}

.odpo-meter {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 12%, white);
}

.odpo-meter > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--brand-primary, var(--odpo-ink));
}

.odpo-meter-value { min-inline-size: 3.5em; text-align: end; }

/* -- The hub ------------------------------------------------------------------------------
 * ONE grid for every section. Each section spans only as many columns as it has cards (up to
 * the full row), so short sections share a row instead of each claiming a whole one — the
 * manager's lone "Maintenance" and "Reports" cards used to leave most of two rows empty.
 * Sections are subgrids, so every card on the page lands on the same column tracks and the
 * rows line up across sections. The span comes from counting the section's own cards with
 * :has(), so the markup never has to repeat each card's permission check just to count. */
.odpo-hub {
  --hub-cols: 2;
  display: grid;
  grid-template-columns: repeat(var(--hub-cols), minmax(0, 1fr));
  gap: var(--space-6) var(--space-4);
  align-items: start;
  animation: odpo-rise .5s .12s cubic-bezier(.16, 1, .3, 1) both;
}

@container (min-width: 540px) { .odpo-hub { --hub-cols: 3; } }
@container (min-width: 760px) { .odpo-hub { --hub-cols: 4; } }
@container (min-width: 1000px) { .odpo-hub { --hub-cols: 6; } }

.odpo-hub-section {
  --cards: 1;
  --span: min(var(--cards), var(--hub-cols));
  grid-column: span var(--span);
  display: grid;
  /* The plain repeat() is the fallback for a browser without subgrid: the section still
     lays its own cards out in the right number of columns, just not on the shared tracks. */
  grid-template-columns: repeat(var(--span), minmax(0, 1fr));
  grid-template-columns: subgrid;
  row-gap: var(--space-4);
  align-content: start;
  min-width: 0;
}

.odpo-hub-section:has(> .odpo-hub-card:nth-of-type(2)) { --cards: 2; }
.odpo-hub-section:has(> .odpo-hub-card:nth-of-type(3)) { --cards: 3; }
.odpo-hub-section:has(> .odpo-hub-card:nth-of-type(4)) { --cards: 4; }
.odpo-hub-section:has(> .odpo-hub-card:nth-of-type(5)) { --cards: 5; }
.odpo-hub-section:has(> .odpo-hub-card:nth-of-type(6)) { --cards: 6; }

/* The title's hairline spans exactly its own section's columns, so where two sections share
   a row the break in the line is what shows where one group ends and the next begins. */
.odpo-hub-section-title {
  grid-column: 1 / -1;
  margin: 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
  font-weight: 650;
  color: var(--text);
}

/* An app tile: the icon leads, the name under it, one line of what it is for. Tiles in a row
   stretch to the tallest, so a two-line description never leaves a ragged row. */
.odpo-hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  min-height: 136px;
  padding: var(--space-4);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.odpo-hub-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 24%, var(--border));
  color: inherit;
}

.odpo-hub-card:active { transform: translateY(0) scale(.985); box-shadow: var(--shadow-sm); }

.odpo-hub-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-1);
  border-radius: 13px;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 9%, transparent);
  color: var(--brand-primary, var(--odpo-ink));
  transition: background .18s var(--ease), color .18s var(--ease);
}

/* The icon fills with the brand colour on hover and keyboard focus alike — the same answer
   to "this is the one you are on" whichever way you got there. */
.odpo-hub-card:is(:hover, :focus-visible) .odpo-hub-card-icon {
  background: var(--brand-primary, var(--odpo-ink));
  color: #fff;
}

.odpo-hub-card-title {
  font-size: .92rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
}

.odpo-hub-card-sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* A forward chevron in the top corner, shown on hover/focus: it says "this opens a screen"
   exactly when the pointer or focus is asking. Mirrored in RTL, where forward is leftward. */
.odpo-hub-card-go {
  position: absolute;
  inset-block-start: var(--space-4);
  inset-inline-end: var(--space-4);
  display: flex;
  color: var(--text-faint);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}

.odpo-hub-card-go svg { width: 16px; height: 16px; }

[dir="rtl"] .odpo-hub-card-go { transform: scaleX(-1) translateX(-4px); }

.odpo-hub-card:is(:hover, :focus-visible) .odpo-hub-card-go { opacity: 1; transform: none; }
[dir="rtl"] .odpo-hub-card:is(:hover, :focus-visible) .odpo-hub-card-go { transform: scaleX(-1); }

@media (max-width: 720px) {
  .odpo-home { gap: var(--space-5); }
  .odpo-home-hero { min-height: 0; gap: var(--space-4); padding: var(--space-5); }
  .odpo-home-avatar { width: 52px; height: 52px; border-radius: 16px; font-size: 1.05rem; }
  .odpo-home-panel { padding: var(--space-4); }
  .odpo-occupancy-summary { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  /* On a phone the per-building bar would push the exact percentage past the table's edge
     (seen at 390px: "100%" scrolled out of view). The figure is what matters there, and the
     summary bar right above already shows the proportion, so the row keeps the number only
     and the headers may wrap. */
  .odpo-meter { display: none; }
  .odpo-meter-cell { min-inline-size: 0; }
  .odpo-meter-value { min-inline-size: 0; text-align: start; }
  .odpo-home-panel th { white-space: normal; }
  .odpo-hub { row-gap: var(--space-5); column-gap: var(--space-3); }
  .odpo-hub-section { row-gap: var(--space-3); }
  .odpo-hub-card { min-height: 124px; padding: var(--space-3); }
  .odpo-hub-card-go { display: none; }
}

/* ---- Shared pieces --------------------------------------------------------- */
.odpo-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow);
}

/* The sign-in screen: a centred card with the logo above it, instead of bare fields on a
   white page. */
.odpo-auth {
  max-width: 424px;
  margin: 7vh auto var(--space-7);
  position: relative;
}

/* A soft brand-tinted bloom behind the sign-in card. It is the first screen anyone sees,
   and it is the one place in the portal where a little atmosphere costs nothing: there is
   no data here to compete with. */
/* The bloom is kept INSIDE the container's own width. A first attempt used
   `inset-inline: -18%` to spread it wider, which pushed the document 51px past the viewport
   and put a horizontal scrollbar on the sign-in screen — invisible in the markup, since a
   pseudo-element has no box for a layout check to find. The softness now comes from
   farthest-side and the blur rather than from spilling outside. */
.odpo-auth::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: -14%;
  height: 340px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(farthest-side at 50% 40%,
    color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 18%, transparent), transparent);
  filter: blur(10px);
}

.odpo-auth .odpo-card {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  /* A hairline of light along the top edge — the detail that makes a card look lit rather
     than pasted on. */
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .9), transparent 12%);
}

.odpo-auth-logo {
  display: block;
  max-width: 200px;
  height: auto;
  margin: 0 auto var(--space-5);
}

/* ---- Sign-in screen (Login.razor) ------------------------------------------------
 * Its own classes rather than .odpo-auth above: ChangePassword and ForgotPassword still use
 * the centred-card layout, and a change made for this screen must not reshape those.
 *
 * Two panels in one shell: odpo's identity on an ink panel (the white logo, the portal's
 * name, the mark as a large watermark), the form on white. The shell is asymmetric on
 * purpose — the form panel is the wider one, and the form inside it keeps a readable
 * measure rather than stretching to fill it. Below 880px it becomes one column and the
 * brand panel a short band above the form. */
.odpo-signin {
  max-width: 1040px;
  margin-inline: auto;
}

.odpo-signin-shell {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  min-height: min(620px, calc(100dvh - 190px));
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* Tinted with the ink rather than neutral black, so the shadow reads as the same light
     as the panel casting it. */
  box-shadow: 0 2px 4px rgba(29, 27, 58, .06), 0 32px 64px -24px rgba(29, 27, 58, .30);
  /* The page arriving, once — the only motion on this screen that is not a response to the
     person's own input. odpo-rise is shared with the home screen (defined there). */
  animation: odpo-rise .5s cubic-bezier(.16, 1, .3, 1) both;
}

.odpo-signin-brand {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-7);
  overflow: hidden;
  color: #fff;
  /* The logo's own gradient — navy, through violet, into blue — spread as two soft glows
     over the ink rather than one even 45° fade. Literal colours on purpose, like the
     palette in :root: this panel is odpo's identity, not the company's branding. */
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(52, 72, 196, .50), transparent 60%),
    radial-gradient(90% 70% at 0% 100%, rgba(104, 44, 150, .42), transparent 62%),
    linear-gradient(165deg, #25225a 0%, var(--odpo-ink) 55%, #131129 100%);
}

/* The mark, huge and nearly transparent, just touching the seam with the form panel —
   vertically centred on the inner edge, so it fills the panel's quiet middle without
   running behind the logo above or the name below. Drawn from the full white logo (the
   mark is its first ~26%) because it is the one high-resolution asset; the square box plus
   a -4.2% background offset shows only the mark, centred, with the wordmark falling outside
   the box. A physical background offset is fine here: a logo is never mirrored, and the
   box itself sits on the inline-end edge in both directions. */
.odpo-signin-brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block-start: 50%;
  inset-inline-end: -14%;
  width: 80%;
  aspect-ratio: 1;
  translate: 0 -52%;
  background: url("../brand/odpo-logo-white.png") no-repeat -4.2% 50% / auto 100%;
  opacity: .065;
  pointer-events: none;
}

/* Grain over the gradients (see --odpo-grain in :root). */
.odpo-signin-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--odpo-grain);
  opacity: .09;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.odpo-signin-brand-logo {
  display: block;
  width: 128px;
  height: auto;
}

.odpo-signin-brand-title {
  margin: 0;
  font-size: clamp(1.45rem, 1rem + 1.1vw, 1.95rem);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
  color: #fff;
}

/* The same champagne rule the portal puts under every page title, here above the name. */
.odpo-signin-brand-title::before {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  margin-bottom: var(--space-4);
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}

.odpo-signin-panel {
  display: flex;
  align-items: center;
  padding: var(--space-7) clamp(var(--space-5), 4.5vw, 64px);
}

.odpo-signin-form {
  width: 100%;
  max-width: 384px;
  margin-inline: auto;
}

.odpo-signin-heading {
  font-size: clamp(1.5rem, 1.2rem + .8vw, 1.85rem);
  margin-bottom: var(--space-6);
}

/* Taller fields than the portal's 40px default: this is the one form every user fills in,
   often on a phone, and it has room to be generous. Only the START padding is set so the
   password field keeps the end padding its eye toggle needs. */
.odpo-signin input:not([type="checkbox"]) {
  min-height: 48px;
  padding-block: 10px;
  padding-inline-start: 14px;
}

.odpo-signin input:not([type="checkbox"]):hover:not(:focus) {
  border-color: color-mix(in srgb, var(--text) 32%, var(--border-strong));
}

.odpo-signin .odpo-field { margin-bottom: var(--space-5); }

.odpo-signin-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin: calc(-1 * var(--space-2)) 0 var(--space-5);
}

/* The whole label is the hit target, checkbox and text together, with no dead gap. */
.odpo-signin-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  margin: 0;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.odpo-signin-forgot {
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}

.odpo-signin-forgot:hover { text-decoration: underline; }

/* "Sign in with membership number instead" / "…with phone number" under the identifier
   field: a quiet text link, not a second button competing with the submit. */
.odpo-signin-switch,
.odpo-signin-switch:hover:not(:disabled):not([type="submit"]),
.odpo-signin-switch:active:not(:disabled) {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 0;
  min-height: 0;
  border: none;
  background: none;
  box-shadow: none;
  transform: none;
  color: var(--brand-secondary, var(--odpo-violet));
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
}
.odpo-signin-switch:hover:not(:disabled):not([type="submit"]) { text-decoration: underline; }
.odpo-signin-switch:focus-visible {
  outline: 2px solid var(--brand-secondary, var(--odpo-violet));
  outline-offset: 2px;
  border-radius: 2px;
}

.odpo-signin-recaptcha { margin-bottom: var(--space-5); }

/* Outcome messages. Each carries its tone as a tinted fill plus a bar on the start edge, so
   it is not signalled by colour alone to someone who cannot tell the three apart. */
.odpo-signin-notice {
  margin: 0 0 var(--space-4);
  padding: 10px 14px;
  border-inline-start: 3px solid currentColor;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  line-height: 1.5;
}

.odpo-signin-notice-ok { background: var(--ok-bg); color: var(--ok); }
.odpo-signin-notice-warn { background: var(--warn-bg); color: var(--warn); }
.odpo-signin-notice-danger { background: var(--danger-bg); color: var(--danger); }

.odpo-signin-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
}

/* Disabled only while the request is in flight, so it keeps most of its weight (the global
   disabled rule halves it) and shows progress rather than "unavailable". */
.odpo-signin-submit:disabled { opacity: .85; cursor: progress; }

.odpo-signin-spinner {
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: odpo-signin-spin .7s linear infinite;
}

@keyframes odpo-signin-spin { to { transform: rotate(360deg); } }

/* The legal notice: small, but muted-grey rather than faint-grey, so it still clears AA
   contrast — the old #888 on the page canvas did not. */
.odpo-signin-consent {
  margin: var(--space-5) 0 0;
  font-size: .75rem;
  line-height: 1.65;
  color: var(--text-muted);
  text-wrap: pretty;
}

@media (max-width: 880px) {
  .odpo-signin { max-width: 480px; }
  .odpo-signin-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .odpo-signin-brand { gap: var(--space-4); padding: var(--space-5); }
  .odpo-signin-brand::before { width: 46%; inset-inline-end: -12%; translate: 0 -50%; }
  .odpo-signin-brand-logo { width: 92px; }
  .odpo-signin-brand-title { font-size: 1.1rem; }
  .odpo-signin-brand-title::before { margin-bottom: var(--space-3); }
  .odpo-signin-panel { padding: var(--space-6) var(--space-5); }
  .odpo-signin-heading { margin-bottom: var(--space-5); }
}

@media (max-width: 400px) {
  .odpo-signin-panel { padding-inline: var(--space-4); }
}

/* ---- Company sign-up -------------------------------------------------------------------
 * On the sign-in screen: the way to «تسجيل شركة جديدة», under the form and above the legal
 * notice. A hairline, one quiet question, and an outline button, so it is plainly a second
 * path and never competes with «تسجيل الدخول». */
.odpo-signin-signup {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  font-size: .875rem;
  color: var(--text-muted);
  text-align: center;
}

.odpo-signin-signup-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .06s var(--ease);
}

.odpo-signin-signup-link svg { width: 18px; height: 18px; color: var(--brand-secondary, var(--odpo-violet)); }
.odpo-signin-signup-link:hover {
  border-color: var(--brand-secondary, var(--odpo-violet));
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 5%, var(--surface));
}
.odpo-signin-signup-link:active { transform: translateY(1px); }
.odpo-signin-signup-link:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }

/* The sign-up screen itself (RegisterCompany.razor): the sign-in shell, wider, with the form
   panel carrying three labelled groups in a two-column grid. */
.rg { max-width: 1160px; }
.rg .odpo-signin-shell { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
.rg-brand { justify-content: flex-start; }
.rg-brand-copy { display: grid; gap: var(--space-4); margin-top: auto; margin-bottom: auto; }
.rg-steps-label { margin: var(--space-3) 0 0; font-size: .82rem; font-weight: 650; color: rgba(255, 255, 255, .72); }
.rg-steps { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; counter-reset: rg-step; }
.rg-steps li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-3);
  font-size: .92rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .92);
  counter-increment: rg-step;
}
.rg-steps li::before {
  content: counter(rg-step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent-soft);
}

.rg-panel { align-items: flex-start; }
.rg-form { width: 100%; max-width: 620px; margin-inline: auto; }
.rg-form .odpo-signin-heading { margin-bottom: var(--space-2); }
.rg-intro { margin: 0 0 var(--space-5); color: var(--text-muted); line-height: 1.7; }

.rg-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-4);
  margin: 0 0 var(--space-5);
  padding: 0 0 var(--space-2);
  border: 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.rg-group legend {
  grid-column: 1 / -1;
  margin-bottom: var(--space-3);
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.rg-group-hint { grid-column: 1 / -1; margin: calc(-1 * var(--space-2)) 0 var(--space-4); font-size: .84rem; color: var(--text-muted); line-height: 1.6; }
.rg-group .odpo-field { margin-bottom: var(--space-4); min-width: 0; }
.rg-wide { grid-column: 1 / -1; }
.rg-group textarea { width: 100%; }
.rg-hint { display: block; margin-top: 6px; font-size: .78rem; color: var(--text-muted); }

.rg-error {
  margin: 6px 0 0;
  font-size: .8rem;
  font-weight: 600;
  color: var(--danger);
}
.rg input[aria-invalid="true"] { border-color: var(--danger); }

.rg-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: var(--space-2) 0 0;
  font-size: .88rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text);
  cursor: pointer;
}
.rg-confirm input { flex: none; margin-top: 4px; }
.rg-confirm + .rg-error { margin-bottom: var(--space-2); }
.rg form > .odpo-signin-submit { margin-top: var(--space-5); }
.rg .odpo-signin-notice + .odpo-signin-submit { margin-top: 0; }

.rg-signin { margin: var(--space-4) 0 0; font-size: .9rem; color: var(--text-muted); text-align: center; }
.rg-signin a { margin-inline-start: 6px; font-weight: 650; }

/* After sending: the reference and the next step. */
.rg-done { display: grid; justify-items: start; gap: var(--space-3); width: 100%; max-width: 460px; margin: auto; }
.rg-done .odpo-signin-heading { margin: 0; }
.rg-done-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
}
.rg-done-icon svg { width: 26px; height: 26px; }
.rg-done-ref {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font-size: .88rem;
  color: var(--text-muted);
}
.rg-done-ref bdi { font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; color: var(--text); font-variant-numeric: tabular-nums; }
.rg-done-body { margin: 0; line-height: 1.75; color: var(--text); }
.rg-done-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-2);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 88%, white),
      var(--brand-primary, var(--odpo-ink)));
  border: 1px solid color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 80%, black);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
}
.rg-done-back:hover { color: #fff; text-decoration: none; filter: brightness(1.08); }

@media (max-width: 880px) {
  .rg { max-width: 640px; }
  .rg .odpo-signin-shell { grid-template-columns: minmax(0, 1fr); }
  .rg-brand-copy { margin: 0; }
}

@media (max-width: 560px) {
  .rg-group { grid-template-columns: minmax(0, 1fr); }
}

/* A labelled form field. Pages used `<div style="margin-bottom:12px">` around each one,
   which fixes the rhythm in the markup and freezes it there: every later improvement to
   spacing has to be made in fourteen files, and an inline style beats this file anyway. */
.odpo-field { margin-bottom: var(--space-4); }
.odpo-field > label { display: block; margin-bottom: 6px; }
.odpo-field > input,
.odpo-field > select,
.odpo-field > textarea,
.odpo-field > .odpo-password-field { width: 100%; }

/* Shared/PasswordField.razor — every password field's click-to-reveal eye. The toggle sits
   INSIDE the input's own box (absolute, not a separate element beside it) so the field keeps
   the exact width every surrounding layout already assumed for a plain `<input>`; only the
   text reserves room for it via padding-inline-end. */
.odpo-password-field { position: relative; display: block; width: 100%; }
.odpo-password-field input {
  width: 100%;
  /* Room for the toggle button without its icon overlapping typed text. */
  padding-inline-end: 40px;
}

/* Edge/IE's own built-in reveal button (`::-ms-reveal`) renders in this exact corner and,
   unlike the toggle above, shows the password only while the mouse button is HELD DOWN,
   reverting the instant it's released — a real bug report ("the eye goes back up on
   release"), not a misunderstanding: the user was clicking Edge's native control sitting on
   top of ours, not the one this file styles. Suppressing it (and its `::-ms-clear` sibling,
   which otherwise draws its own "clear field" X in the same corner) leaves exactly one
   control here, on every input this class touches — no reason to scope it to password
   fields only. */
.odpo-password-field input::-ms-reveal,
.odpo-password-field input::-ms-clear {
  display: none;
}

.odpo-password-toggle {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  box-shadow: none;
  color: var(--text-faint);
  cursor: pointer;
}

/* An input whose direction differs from the page's (an LTR key or URL on an Arabic screen)
   reserves its toggle room on ITS end side, so the toggle follows the input, not the page:
   otherwise the eye sits over the first characters typed. */
.odpo-password-field input[dir="ltr"] + .odpo-password-toggle { inset-inline-end: auto; left: auto; right: 4px; }
.odpo-password-field input[dir="rtl"] + .odpo-password-toggle { inset-inline-end: auto; right: auto; left: 4px; }

.odpo-password-toggle:hover:not(:disabled) {
  color: var(--text-muted);
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

/* THE actual bug behind "the eye jumps out of place while pressed, snaps back on release":
   the global `button:active:not(:disabled)` rule (further down this file) sets
   `transform: translateY(1px)` for its own press-down feel, and a `transform` declaration
   REPLACES the whole property rather than stacking — so for the ~1/4 second the mouse is
   down, this button's `translateY(-50%)` centering was being wiped out entirely, popping it
   up out of the middle of the field, until :active cleared and centering came back. This
   selector is more specific than that global one specifically so it wins instead, combining
   both transforms into the one value the property can actually hold. */
.odpo-password-toggle:active:not(:disabled) {
  transform: translateY(calc(-50% + 1px));
  box-shadow: none;
}

/* Shared/CountryPicker.razor — a searchable dropdown.
   The TRIGGER is dressed exactly like every other field (same height, border, radius,
   focus halo) so a form of inputs and dropdowns reads as one set, with a chevron saying
   "this opens a list". The PANEL floats over what follows (absolute), so opening it never
   shoves the rest of the form down, and scrolls internally so ~250 countries never make the
   page long. Logical properties throughout: the chevron and codes sit at the END in both
   directions. */
.odpo-select { position: relative; display: block; width: 100%; }

.odpo-select-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  text-align: start;
  box-shadow: none;
  cursor: pointer;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.odpo-select-trigger:hover:not(:disabled):not([type="submit"]) {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 45%, var(--border-strong));
}
.odpo-select-trigger:active:not(:disabled) { transform: none; box-shadow: none; }
.odpo-select.is-open .odpo-select-trigger,
.odpo-select-trigger:focus-visible {
  border-color: var(--brand-secondary, var(--odpo-violet));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 14%, transparent);
  outline: none;
}

.odpo-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.odpo-select-value.is-placeholder { color: var(--text-faint); }

.odpo-select-chevron {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform .18s var(--ease);
}
.odpo-select.is-open .odpo-select-chevron { transform: rotate(180deg); }

.odpo-select-panel {
  position: absolute;
  z-index: 30;
  inset-inline: 0;
  top: calc(100% + 6px);
  min-width: 260px;
  background: var(--surface-raised, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: odpo-select-in .14s var(--ease);
}
@keyframes odpo-select-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.odpo-select-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
}
.odpo-select-search svg { flex: none; width: 17px; height: 17px; }
.odpo-select-search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.odpo-select-search input:focus { box-shadow: none; outline: none; }

.odpo-select-list {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;   /* reaching the end of the list must not scroll the page */
  margin: 0;
  padding: 4px;
  list-style: none;
}

.odpo-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding-block: 6px;
  padding-inline: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .9rem;
  color: var(--text);
}
.odpo-select-option.is-active {
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 9%, var(--surface));
}
.odpo-select-option[aria-selected="true"] {
  font-weight: 600;
  color: var(--brand-secondary, var(--odpo-violet));
}
.odpo-select-option.is-none,
.odpo-select-option.is-none[aria-selected="true"] { color: var(--text-muted); }

.odpo-select-check { flex: none; width: 16px; height: 16px; color: var(--brand-secondary, var(--odpo-violet)); }
.odpo-select-option-name { flex: 1; min-width: 0; }
.odpo-select-code {
  flex: none;
  color: var(--text-faint);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .05em;
}

.odpo-select-empty { padding: 14px 10px; color: var(--text-muted); font-size: .9rem; text-align: center; }
/* LanguageSelect: "the portal's languages" / "all languages" headings inside the list. */
.odpo-select-group {
  padding: 10px 10px 4px; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  color: var(--text-muted); text-transform: uppercase;
}
.odpo-select-group:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--border); }
/* The gap sits on the name (the screen's direction), not on the language's own name,
   whose direction may be the opposite one. */
.odpo-select-value .odpo-select-name { margin-inline-end: 8px; }

@media (prefers-reduced-motion: reduce) {
  .odpo-select-panel { animation: none; }
  .odpo-select-chevron { transition: none; }
}

/* Shared/PhoneInput.razor — the dial-code dropdown and the number side by side, always
   left-to-right (code first, as a number is dialled). The dropdown keeps the field height and
   border of every other control; its list opens wider than the narrow trigger, anchored to
   the trigger's left edge so it covers the number box rather than spilling off the form. */
.odpo-phone { display: flex; align-items: stretch; gap: 6px; width: 100%; }
.odpo-phone-country { flex: none; width: 118px; }
.odpo-phone > input { flex: 1; min-width: 0; width: auto; }
.odpo-phone .odpo-select-trigger { padding-inline: 10px 8px; gap: 4px; }
.odpo-select-dial { font-variant-numeric: tabular-nums; }
.odpo-select-dial .odpo-select-code { margin-inline-start: 4px; }
.odpo-phone .odpo-select-panel {
  inset-inline: auto;
  left: 0;
  right: auto;
  width: min(320px, calc(100vw - 32px));
}
.odpo-phone .odpo-select-code { letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* The tenant search row above it: kind, query, button. It wraps — on a phone the three did
   not fit in one row and pushed the whole page sideways. */
.odpo-tenant-search { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: stretch; }
.odpo-tenant-search > select { flex: 0 1 auto; max-width: 100%; }
.odpo-tenant-search > input { flex: 1 1 180px; min-width: 0; }

/* The "register a new tenant" form on the contracts screen (Pages/Contracts.razor).
   Three labelled sections instead of ten loose inputs, a two-column grid that pairs the
   fields that belong together (QID beside its expiry, passport beside its), collapsing to
   one column on a phone. */
.odpo-register {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.odpo-register-head { margin-bottom: var(--space-4); }
.odpo-register-head h3 { font-size: 1rem; margin: 0 0 2px; }
.odpo-register-head p { margin: 0; font-size: .86rem; color: var(--text-muted); text-wrap: pretty; }

.odpo-register-section {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  min-width: 0;          /* a fieldset otherwise refuses to shrink below its content */
}

/* A floated legend is rendered INSIDE its fieldset instead of cut into the top border
   (seen in the browser: the default notch reads as a rendering glitch on a filled box).
   Bootstrap already floats it, but LEFT — wrong in Arabic — so it floats to the inline start
   here, and the next element clears it. Sized as a section label, not a page heading. */
.odpo-register-section > legend {
  float: inline-start;
  width: 100%;
  margin: 0 0 var(--space-3);
  padding: 0;
  font-size: .8rem;
  font-weight: 650;
  letter-spacing: .02em;
  color: var(--text-muted);
}

.odpo-register-section > legend + * { clear: both; }

.odpo-register-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
}
.odpo-register-grid > .odpo-field { margin-bottom: 0; }
.odpo-register-grid > .odpo-span-2 { grid-column: 1 / -1; }
.odpo-register .odpo-field > label { font-weight: 550; margin-bottom: 4px; }
.odpo-register .odpo-field > input { width: 100%; }

.odpo-register-hint { margin: 0 0 var(--space-3); font-size: .8rem; color: var(--text-muted); text-wrap: pretty; }

.odpo-register input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 12%, transparent);
}

.odpo-register-error {
  margin: 0 0 var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: .86rem;
}

.odpo-register-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

@media (max-width: 560px) {
  .odpo-register-grid { grid-template-columns: minmax(0, 1fr); }
  .odpo-register-section { padding: var(--space-3); }
  .odpo-register-actions > button { flex: 1 1 100%; }
}

/* Hidden from sight, still in the accessibility tree and still focusable — for the native
   file input behind a styled "Choose file" label, and for column headers with no visible
   text. `display:none` would remove the control for keyboard and screen-reader users. */
.odpo-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* The add-tenant form's document uploads — one row per document type the platform admin
   has made active: its name and required/optional pill, the upload state, and the action. */
.odpo-doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }

.odpo-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .16s var(--ease);
}
.odpo-doc-row.is-missing { border-color: var(--danger); }

.odpo-doc-info { min-width: 0; flex: 1; }
.odpo-doc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 550; font-size: .9rem; }

.odpo-doc-status { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: .8rem; color: var(--text-muted); min-width: 0; }
.odpo-doc-status.is-done { color: var(--ok); }
.odpo-doc-status.is-done svg { flex: none; width: 15px; height: 15px; }
.odpo-doc-status.is-error { color: var(--danger); }
.odpo-doc-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.odpo-doc-size { flex: none; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.odpo-doc-actions { display: flex; align-items: center; gap: 6px; flex: none; }

/* The visible face of the hidden file input: styled as the secondary button, and it takes
   the focus ring when the input inside the row is focused, so keyboard users see where
   they are. */
.odpo-file-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .86rem;
  font-weight: 550;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .16s var(--ease), border-color .16s var(--ease);
  margin: 0;
}
.odpo-file-button:hover { background: var(--surface-sunken); }
.odpo-file-button.is-disabled { opacity: .5; pointer-events: none; }
.odpo-doc-actions:has(input[type="file"]:focus-visible) .odpo-file-button {
  outline: 2px solid var(--brand-secondary, var(--odpo-violet));
  outline-offset: 2px;
}

.odpo-doc-remove {
  min-height: 36px;
  padding: 6px 10px;
  border-color: transparent;
  background: none;
  box-shadow: none;
  color: var(--text-muted);
  font-size: .84rem;
}
.odpo-doc-remove:hover:not(:disabled):not([type="submit"]) { color: var(--danger); background: var(--danger-bg); }

@media (max-width: 560px) {
  .odpo-doc-row { flex-direction: column; align-items: stretch; }
  .odpo-doc-actions { justify-content: flex-start; }
}

/* The contract's tenant details: each document with its download action. */
/* A tenant's documents in the contract's tenant panel: a card each, with a preview. */
.odpo-docs { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.odpo-docs h4 { margin: 0 0 var(--space-2); font-size: .92rem; }
.odpo-doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.odpo-doc-card {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "preview text" "preview actions"; gap: 4px var(--space-3);
  align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.odpo-doc-preview {
  grid-area: preview; display: grid; place-items: center; width: 64px; height: 64px; min-height: 0; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-sunken); box-shadow: none;
}
.odpo-doc-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.odpo-doc-preview:active { transform: none; }
.odpo-doc-kind { font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--brand-primary, var(--odpo-ink)); }
.odpo-doc-card-text { grid-area: text; display: grid; gap: 1px; min-width: 0; }
.odpo-doc-card-text b { font-size: .88rem; }
.odpo-doc-card-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--text-muted); }
.odpo-doc-card-meta { font-size: .74rem; color: var(--text-faint); }
.odpo-doc-card-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 6px; }
.odpo-doc-download { min-height: 30px; padding: 2px 12px; font-size: .8rem; box-shadow: none; }

/* The document viewer: the file in place, larger than the panel, over the page. */
.odpo-viewer-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(23, 23, 42, .55); }
.odpo-viewer {
  position: fixed; z-index: 1001; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(960px, calc(100vw - 32px)); height: min(88vh, 900px);
  border-radius: var(--radius-lg); background: var(--surface-raised, var(--surface)); box-shadow: var(--shadow-lg); overflow: hidden; text-align: start;
}
.odpo-viewer:focus { outline: none; }
.odpo-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 12px var(--space-4); border-bottom: 1px solid var(--border); }
.odpo-viewer-title { display: grid; min-width: 0; }
.odpo-viewer-title h3 { margin: 0; font-size: 1rem; }
.odpo-viewer-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--text-muted); }
.odpo-viewer-body { display: grid; place-items: center; min-height: 0; background: var(--surface-sunken); }
.odpo-viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.odpo-viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.odpo-viewer-note { margin: 0; padding: var(--space-5); color: var(--text-muted); text-align: center; }
.odpo-viewer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding: 10px var(--space-4); border-top: 1px solid var(--border); }
.odpo-viewer-nav { display: flex; align-items: center; gap: var(--space-2); }
.odpo-viewer-hint { flex: 1 1 200px; font-size: .78rem; }
@media (max-width: 640px) {
  .odpo-viewer { inset: 0; transform: none; width: 100vw; height: 100dvh; border-radius: 0; }
  .odpo-doc-cards { grid-template-columns: minmax(0, 1fr); }
}

/* settings/tenant-documents */
.odpo-doctypes-intro { color: var(--text-muted); max-width: 68ch; font-size: .88rem; text-wrap: pretty; }
.odpo-doctypes-form { max-width: 680px; margin: var(--space-4) 0; }
.odpo-doctypes-form h2 { margin-top: 0; }
.odpo-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; }
.odpo-check input { margin-top: 3px; flex: none; }
.odpo-doctypes-empty { max-width: 680px; color: var(--text-muted); }
.odpo-doctypes-table { width: 100%; max-width: 960px; }
.odpo-doctypes-table tr.is-inactive .odpo-doctypes-name { color: var(--text-muted); }
.odpo-doctypes-name { font-weight: 550; }

/* Company storage (Shared/CompanyStorageEditor.razor and the two storage pages). The three
   providers are real radio inputs dressed as selectable cards — a choice between three
   different kinds of setup reads better as three described options than as a bare dropdown,
   and keyboard/screen-reader behaviour stays a native radio group's. */
.odpo-storage-card { max-width: 760px; margin-bottom: var(--space-4); }
.odpo-storage-card h2 { margin-top: 0; }

/* Four choices: a 2 × 2 grid, so none is left alone on a row of its own. */
.odpo-storage-providers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
  min-width: 0;
}

.odpo-storage-provider {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.odpo-storage-provider:hover { border-color: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 45%, var(--border-strong)); }
.odpo-storage-provider.is-selected {
  border-color: var(--brand-secondary, var(--odpo-violet));
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 6%, var(--surface));
  box-shadow: 0 0 0 1px var(--brand-secondary, var(--odpo-violet));
}
.odpo-storage-provider input { margin-top: 3px; flex: none; }
.odpo-storage-provider-text { display: grid; gap: 2px; min-width: 0; }
.odpo-storage-provider-name { font-weight: 600; font-size: .9rem; }
.odpo-storage-provider-hint { font-size: .78rem; color: var(--text-muted); line-height: 1.45; }
fieldset:disabled .odpo-storage-provider { cursor: default; opacity: .75; }
/* Set by odpo, not the company's to choose: shown so the screen tells the truth, never pickable. */
.odpo-storage-provider.is-locked { cursor: default; border-style: dashed; }
.odpo-storage-provider.is-locked .odpo-storage-provider-hint { color: var(--warn); }

.odpo-storage-note {
  margin: 0 0 var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: .84rem;
  text-wrap: pretty;
}

/* The R2 address is one unbroken token — let it wrap instead of widening the page on a phone. */
.odpo-storage-endpoint bdi { overflow-wrap: anywhere; }

.odpo-storage-test-ok {
  margin: 0 0 var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--ok-bg);
  color: var(--ok);
  font-size: .86rem;
}

.odpo-storage-grants { display: grid; gap: var(--space-2); margin: var(--space-3) 0; }
.odpo-storage-grants .odpo-check > span { display: grid; gap: 1px; }
.odpo-storage-grants .odpo-subtle { margin-top: 0; }
.odpo-storage-access-cell { font-size: .85rem; color: var(--text-muted); }
.odpo-storage-manage { font-weight: 600; }

@media (max-width: 720px) {
  .odpo-storage-providers { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================================
   One company's storage, the platform admin's screen (redesign 2026-10-20), prefix sa-.
   It used to have two save buttons, one per card, and an edit in one card was lost by
   pressing the other. Now the brand band says how things stand; the two parts only collect
   edits; and one review panel (beside them on a wide screen, under them on a narrow one)
   says in sentences what will change, with the one save. Reuses .odpo-storage-provider for
   the provider cards (shared with the manager's screen) and .ux-toast.
   ========================================================================================== */
.sa-back { margin: 0 0 var(--space-2); }
.sa-lede { max-width: 62ch; margin: 0 0 var(--space-5); color: var(--text-muted); text-wrap: pretty; }

.sa-skeleton { display: grid; gap: var(--space-4); max-width: 1140px; }
.sa-skeleton .sa-skel-title { width: min(340px, 70%); height: 34px; border-radius: var(--radius-sm); }
.sa-skeleton .sa-skel-band { height: 112px; border-radius: var(--radius-lg); }
.sa-skeleton .sa-skel-part { height: 320px; max-width: 760px; border-radius: var(--radius-lg); }

/* How things stand: the brand ink, two facts side by side. */
.sa-now {
  position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1140px; margin: 0 0 var(--space-6); overflow: hidden; border-radius: var(--radius-lg); color: #fff;
  background:
    radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 55%, var(--odpo-violet)) 0%, transparent 62%),
    var(--brand-primary, var(--odpo-ink));
  box-shadow: 0 1px 2px rgba(23, 23, 42, .12), 0 14px 32px -14px color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 70%, transparent);
}
.sa-now::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--odpo-grain); opacity: .07; pointer-events: none; }
.sa-now-item { display: grid; align-content: start; gap: 4px; margin: 0; padding: var(--space-5); min-width: 0; }
.sa-now-item + .sa-now-item { border-inline-start: 1px solid rgba(255, 255, 255, .14); }
.sa-now dt { font-size: .84rem; font-weight: 550; color: rgba(255, 255, 255, .74); }
.sa-now dd { margin: 0; }
.sa-now-value { font-size: clamp(1.25rem, 1.9vw, 1.6rem); font-weight: 750; line-height: 1.2; letter-spacing: -.005em; overflow-wrap: anywhere; }
.sa-now-sub { font-size: .84rem; color: var(--accent-soft); }

/* The parts on one side, the review on the other. */
.sa-layout {
  display: grid; grid-template-columns: minmax(0, 760px) minmax(280px, 1fr); gap: var(--space-5);
  align-items: start; max-width: 1140px;
}
.sa-parts { display: grid; gap: var(--space-5); min-width: 0; }

.sa-part {
  min-width: 0; padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.sa-part-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: 4px; }
.sa-part-head h2 { margin: 0; font-size: 1.12rem; }
.sa-part-icon {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 9%, var(--surface));
  color: var(--brand-secondary, var(--odpo-violet));
}
.sa-part-icon svg { width: 18px; height: 18px; }
.sa-part-hint { max-width: 62ch; margin: 0 0 var(--space-4); font-size: .86rem; color: var(--text-muted); text-wrap: pretty; }

/* "Not saved yet": the part has edits waiting in the review. */
.sa-pending {
  margin-inline-start: auto; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 650;
  background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
}

/* Test connection: plainly not a save. */
.sa-test { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.sa-test-button { display: inline-flex; align-items: center; gap: 8px; }
.sa-test-button svg { width: 17px; height: 17px; }
.sa-test-hint { flex: 1 1 220px; margin: 0; font-size: .8rem; color: var(--text-muted); }

/* The manager's grant: three ticks, View / Add / Edit (View locked on while Add or Edit is). */
.sa-levels { display: grid; gap: 6px; margin: 0 0 var(--space-5); padding: 0; border: 0; min-width: 0; }
.sa-level {
  display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.sa-level:hover { border-color: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 45%, var(--border-strong)); }
.sa-level.is-selected {
  border-color: var(--brand-secondary, var(--odpo-violet));
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 6%, var(--surface));
  box-shadow: 0 0 0 1px var(--brand-secondary, var(--odpo-violet));
}
.sa-level input { margin-top: 3px; flex: none; }
.sa-level:has(input:focus-visible) { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.sa-level-text { display: grid; gap: 1px; min-width: 0; }
.sa-level-name { font-weight: 650; font-size: .92rem; }
.sa-level-hint { font-size: .8rem; color: var(--text-muted); line-height: 1.45; }
.sa-level:has(input:disabled) { cursor: default; }
.sa-grants-implied { margin: 2px 0 0; font-size: .8rem; color: var(--text-muted); }

.sa-choose { margin: 0; padding: var(--space-4) 0 0; border: 0; border-top: 1px solid var(--border); min-width: 0; }
.sa-choose legend { float: left; width: 100%; padding: 0; margin: 0 0 2px; font-weight: 650; font-size: .95rem; }
.sa-choose legend + * { clear: both; }
.sa-choose .sa-part-hint { margin-bottom: var(--space-3); }
.sa-choose.is-idle .sa-choose-list { opacity: .7; }
.sa-chip { min-height: 38px; box-sizing: border-box; }
.sa-chip:has(input:focus-visible) { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.sa-inline-error { margin: var(--space-2) 0 0; font-size: .84rem; font-weight: 550; color: var(--danger); }

/* The review: what will change, then the one save. */
.sa-review {
  position: sticky; top: 84px; display: grid; gap: var(--space-3); padding: var(--space-5);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-sunken);
  transition: background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.sa-review.has-changes { border-style: solid; border-color: var(--border); background: var(--surface); box-shadow: var(--shadow); }
.sa-review h2 { margin: 0; font-size: 1.02rem; }
.sa-review-empty { margin: 0; font-size: .86rem; color: var(--text-muted); text-wrap: pretty; }
.sa-review .odpo-register-error { margin: 0; }
.sa-changes { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.sa-change {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}
.sa-change.is-weighty { background: var(--warn-bg); }
.sa-change-icon {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px;
  background: var(--surface); color: var(--brand-secondary, var(--odpo-violet));
}
.sa-change.is-weighty .sa-change-icon { color: var(--warn); }
.sa-change-icon svg { width: 15px; height: 15px; }
.sa-change-text { display: grid; gap: 2px; min-width: 0; font-size: .84rem; line-height: 1.5; color: var(--text-muted); overflow-wrap: anywhere; }
.sa-change-text b { font-size: .9rem; font-weight: 650; color: var(--text); }
.sa-review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sa-save { min-height: 44px; padding-inline: 20px; }

@media (max-width: 1080px) {
  .sa-layout { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
  .sa-review { position: static; }
}
@media (max-width: 640px) {
  .sa-now { grid-template-columns: minmax(0, 1fr); }
  .sa-now-item + .sa-now-item { border-inline-start: 0; border-top: 1px solid rgba(255, 255, 255, .14); }
  .sa-now-item { padding: var(--space-4); }
  .sa-part, .sa-review { padding: var(--space-4); }
  .sa-pending { margin-inline-start: 0; }
  .sa-review-actions > button { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sa-level, .sa-review { transition: none; }
}

/* A show/hide bar for a long block the reader rarely needs open — the contract's current
   text while it is being amended (ContractDocument.razor). Full width and card-shaped so it
   reads as "the text is here, folded", not as one more action button. */
.odpo-disclosure {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 800px;
  margin-bottom: var(--space-3);
  padding: 12px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  box-shadow: none;
  color: var(--text-muted);
  font-weight: 600;
  text-align: start;
}
.odpo-disclosure:hover:not(:disabled):not([type="submit"]) { background: var(--surface); color: var(--text); }
.odpo-disclosure:active:not(:disabled) { transform: none; box-shadow: none; }
.odpo-disclosure-chevron { flex: none; width: 18px; height: 18px; transition: transform .18s var(--ease); }
.odpo-disclosure[aria-expanded="true"] .odpo-disclosure-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .odpo-disclosure-chevron { transition: none; } }

/* ---- Shared page pieces (first used by the contracts screen) ------------------------ */

/* A page title with its primary action at the far end — the action belongs to the page,
   so it sits on the title row, not somewhere down in the content. */
.odpo-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.odpo-page-head > button { margin-top: 4px; }

/* A primary action that is NOT a form submit (global styling keys on type="submit"). The
   :not([type="submit"]) hover selectors outrank the global button:hover rule, whose
   background shorthand would otherwise drop the gradient and leave white text on a pale fill. */
.odpo-btn-primary,
.odpo-btn-primary:hover:not(:disabled),
.odpo-btn-primary:hover:not(:disabled):not([type="submit"]) {
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 88%, white),
      var(--brand-primary, var(--odpo-ink)));
  border-color: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 80%, black);
  color: #fff;
  font-weight: 650;
}
.odpo-btn-primary:hover:not(:disabled),
.odpo-btn-primary:hover:not(:disabled):not([type="submit"]) {
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 76%, white),
      color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 94%, white));
}

/* Secondary-of-secondary: "clear filters" and the like. */
.odpo-btn-quiet { border-color: transparent; background: none; box-shadow: none; color: var(--text-muted); }
.odpo-btn-quiet:hover:not(:disabled):not([type="submit"]) { background: var(--surface-sunken); color: var(--text); }

/* Irreversible row actions: visibly different from the everyday ones beside them without
   shouting in every row — the full red is saved for the confirmation dialog itself. */
.odpo-btn-danger-quiet { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border-strong)); }
.odpo-btn-danger-quiet:hover:not(:disabled):not([type="submit"]) {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 60%, var(--border-strong));
  color: var(--danger);
}

.odpo-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border-color: transparent;
  background: none;
  box-shadow: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
}
.odpo-icon-button:hover:not(:disabled):not([type="submit"]) { background: var(--surface-sunken); color: var(--text); }

/* The login screen's self-hosted image CAPTCHA (see AuthController.GetCaptcha): one tile
   holding the challenge image and its refresh button, with the answer field beside it at
   the same height, so the three read as a single control. The row wraps (the field drops
   below the tile) on a phone too narrow for both. `gap`-spaced rather than margin-spaced so
   it stays correct in both directions with no logical-property juggling. */
.odpo-captcha {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.odpo-captcha-visual {
  flex: none;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  /* The PNG's own background is --surface-sunken; this matches it so an image that has not
     loaded yet (or a challenge the server could not issue) reads as a pending box rather
     than a torn hole in the form. */
  background: var(--surface-sunken);
}

/* The image arrives as a data URL at its natural 160x60. Scaled to the field height with its
   OWN aspect ratio (width: auto against the 160x60 attributes) — never stretched, since a
   distorted-text challenge that is also squashed is the one thing this control cannot
   afford. The attributes also reserve the box before the first challenge arrives. */
.odpo-captcha-image {
  display: block;
  height: 46px;          /* + the tile's 1px borders = the 48px sign-in field beside it */
  width: auto;
}

.odpo-captcha-refresh {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-inline-start: 1px solid var(--border);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--text-muted);
}

/* :not([type="submit"]) only to out-rank the global secondary-button hover (0,3,1), which
   would otherwise paint its border and shadow onto this flush, borderless segment. */
.odpo-captcha-refresh:hover:not(:disabled):not([type="submit"]) {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-color: var(--border);
  box-shadow: none;
  color: var(--text);
}

/* The tile clips its overflow (for the rounded corners), which would also clip the global
   focus ring drawn 2px OUTSIDE this button — so here the ring is drawn inside it instead. */
.odpo-captcha-refresh:focus-visible { outline-offset: -4px; }

.odpo-captcha-refresh svg { transition: transform .35s var(--ease); }
.odpo-captcha-refresh:active:not(:disabled) svg { transform: rotate(-120deg); }

.odpo-captcha-input {
  flex: 1 1 150px;
  min-width: 0;
  /* The answer is a short code: spaced and weighted so each character is easy to check
     against the image. The placeholder is a sentence, so it keeps normal spacing. */
  letter-spacing: .14em;
  font-weight: 600;
}

.odpo-captcha-input::placeholder { letter-spacing: normal; font-weight: 400; }

/* Page-level outcome messages, dismissible — replaces bare red/green paragraphs. */
.odpo-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  max-width: 960px;
  margin: 0 0 var(--space-4);
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.odpo-alert-danger { background: var(--danger-bg); color: var(--danger); }
.odpo-alert-ok { background: var(--ok-bg); color: var(--ok); }
.odpo-alert-warn { background: var(--warn-bg); color: var(--warn); }

/* A settings screen's one-paragraph explanation under its title. */
.odpo-page-intro {
  max-width: 68ch;
  margin: 0 0 var(--space-5);
  font-size: .88rem;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* A single-setting card (settings/login-captcha): the heading and its saved-state pill on
   one line, the control, any consequence note, then the save action. */
.odpo-settings-card { max-width: 620px; }

.odpo-settings-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}

.odpo-settings-card-head h2 { margin: 0; }

/* Scoped to the card so it out-ranks .odpo-subtle's own margin, defined later in this file. */
.odpo-settings-card .odpo-settings-note { margin: var(--space-4) 0 0; }

.odpo-settings-actions { margin-top: var(--space-5); }

/* settings/uploads: the MB field with its unit, quick values, and where the limit applies. */
.upl-input { display: inline-flex; align-items: stretch; direction: ltr; }
.upl-input input { width: 120px; border-start-end-radius: 0; border-end-end-radius: 0; }
.upl-unit {
  display: inline-flex; align-items: center; padding: 0 var(--space-3);
  border: 1px solid var(--border-strong); border-inline-start: 0;
  border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm);
  background: var(--surface-muted, #f4f5f7); color: var(--text-muted, #5b6472); font-weight: 600;
}
.upl-presets { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.upl-preset {
  min-height: 36px; padding: 0 var(--space-3); border-radius: 999px;
  border: 1px solid var(--border-strong); background: transparent; color: inherit;
  font-weight: 600; direction: ltr;
}
.upl-preset:hover { border-color: var(--brand-primary, #1B3A5C); }
.upl-preset.is-active { background: var(--brand-primary, #1B3A5C); border-color: var(--brand-primary, #1B3A5C); color: #fff; }
.upl-scope { margin: 0; padding-inline-start: var(--space-5); line-height: 1.9; }


/* settings/database-backups: the "new backup" card, then the history table. */
.odpo-backup-card { max-width: 720px; }
.odpo-backup-facts { display: grid; gap: var(--space-3); margin: 0; }
.odpo-backup-facts div { display: grid; gap: 2px; }
.odpo-backup-facts dt { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.odpo-backup-facts dd { margin: 0; font-size: .9rem; text-wrap: pretty; }
/* The two formats side by side, each card with its own button pinned to the bottom. */
.odpo-backup-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: var(--space-4) 0 0; }
.odpo-backup-option {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.odpo-backup-option h3 { margin: 0; font-size: .95rem; }
.odpo-backup-option p { margin: 0; font-size: .82rem; color: var(--text-muted); line-height: 1.55; text-wrap: pretty; }
.odpo-backup-option button { margin-top: auto; align-self: flex-start; }
.odpo-backup-option.is-unavailable { border-style: dashed; }
.odpo-backup-option-why { color: var(--warn) !important; }
.odpo-backup-history { margin-top: var(--space-6); max-width: 960px; }
.odpo-backup-history h2 { margin: 0 0 var(--space-3); }
/* Left-to-right text in an Arabic cell: aligned with the cell, not to its own left start. */
[dir="rtl"] .odpo-backup-when, [dir="rtl"] .odpo-backup-file { text-align: right; }
.odpo-backup-when { display: block; font-variant-numeric: tabular-nums; font-weight: 600; }
.odpo-backup-file { display: block; font-size: .76rem; color: var(--text-muted); overflow-wrap: anywhere; }
.odpo-backup-table td { vertical-align: top; }
.odpo-backup-table td:nth-child(2) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.odpo-backup-error { display: block; margin-top: 4px; font-size: .76rem; color: var(--danger); max-width: 36ch; overflow-wrap: anywhere; }
.odpo-backup-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }

/* On a phone each backup becomes a small card: date and file on top, size · status · by on
   one line, the buttons under them — five table columns do not fit 390px. */
@media (max-width: 720px) {
  .odpo-backup-options { grid-template-columns: minmax(0, 1fr); }
  .odpo-backup-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .odpo-backup-table, .odpo-backup-table tbody, .odpo-backup-table tr { display: block; width: 100%; }
  .odpo-backup-table tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  .odpo-backup-table tr:last-child { border-bottom: 0; }
  .odpo-backup-table td { display: inline-block; padding: 0; border: 0; margin-inline-end: var(--space-3); vertical-align: middle; }
  .odpo-backup-table td:first-child { display: block; margin: 0 0 var(--space-2); }
  .odpo-backup-table td:last-child { display: block; margin: var(--space-3) 0 0; }
  .odpo-backup-actions { justify-content: flex-start; }
  .odpo-backup-error { max-width: none; }
}

/* A company's own SMS/WhatsApp gateways (Shared/CompanyGatewayEditor.razor, the manager's
   settings/company-gateways, the platform admin's per-company screen, and the company list on
   settings/notification-gateways). Cards reuse .odpo-storage-card — the same "one company's
   provider settings" card the storage screens use. */
.odpo-gateway-back { margin: 0 0 var(--space-2); }

.odpo-gateway-fields {
  min-width: 0;
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
}

.odpo-gateway-fields .odpo-field > input,
.odpo-gateway-fields .odpo-field > .odpo-password-field { max-width: 520px; }

.odpo-gateway-enable { margin-bottom: var(--space-4); }
.odpo-gateway-hint { margin: 6px 0 0; }

.odpo-gateway-companies { margin-top: var(--space-7); }
.odpo-gateway-companies h2 { margin-top: 0; }
.odpo-alert-close {
  flex: none;
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  opacity: .7;
}
.odpo-alert-close:hover:not(:disabled):not([type="submit"]) { background: none; opacity: 1; }

/* A panel asking for something before work can continue (the post-termination rating). */
.odpo-callout { max-width: 760px; margin: 0 0 var(--space-4); }
.odpo-callout h2 { margin-top: 0; }
.odpo-callout-warn { border-inline-start: 4px solid var(--warn); }

.odpo-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 12%, var(--surface));
  color: var(--brand-secondary, var(--odpo-violet));
  font-weight: 700;
}

.odpo-input-suffix { display: flex; align-items: stretch; }
.odpo-input-suffix > input { flex: 1; min-width: 0; border-start-end-radius: 0; border-end-end-radius: 0; }
.odpo-input-suffix > span {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-inline-start: 0;
  border-start-end-radius: var(--radius-sm);
  border-end-end-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: .85rem;
}

.odpo-skeleton {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--border) 50%, var(--surface-sunken) 75%);
  background-size: 200% 100%;
  animation: odpo-skeleton 1.3s ease-in-out infinite;
}
@keyframes odpo-skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* The shared empty state, inline in a page rather than centred on an empty screen. */
.odpo-empty-inline { margin: var(--space-4) 0; max-width: 960px; box-shadow: none; }

/* ---- Contracts screen ----------------------------------------------------------------- */

.odpo-create-contract { max-width: 960px; margin: 0 0 var(--space-5); }
.odpo-create-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.odpo-create-head h2 { margin: 0; }
.odpo-create-step { margin-top: var(--space-4); }

/* Where staff are in the two-step flow: done, current, still to come. */
.odpo-steps { display: flex; gap: var(--space-5); margin: var(--space-4) 0 0; padding: 0; list-style: none; font-size: .88rem; color: var(--text-faint); }
.odpo-steps li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.odpo-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  font-size: .78rem;
}
.odpo-steps li.is-current { color: var(--text); }
.odpo-steps li.is-current .odpo-step-num { background: var(--brand-primary, var(--odpo-ink)); border-color: var(--brand-primary, var(--odpo-ink)); color: #fff; }
.odpo-steps li.is-done { color: var(--ok); }

.odpo-candidate,
.odpo-selected-tenant {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}
.odpo-candidate-info { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: .86rem; }
.odpo-candidate-name { font-weight: 650; font-size: .95rem; }

.odpo-list-head { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-5); }
.odpo-list-head h2 { margin: 0; }
.odpo-count-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.odpo-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  max-width: 960px;
  margin: var(--space-3) 0;
}
.odpo-filter-bar .odpo-field { margin-bottom: 0; }
.odpo-filter-grow { flex: 1 1 240px; }
.odpo-search-input { position: relative; }
.odpo-search-input svg {
  position: absolute;
  inset-inline-start: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-faint);
  pointer-events: none;
}
.odpo-search-input input { width: 100%; padding-inline-start: 36px; }

.odpo-term { white-space: nowrap; font-size: .86rem; }
.odpo-cell-sub { margin-top: 3px; font-size: .78rem; }
.odpo-row-actions.odpo-row-actions-nowrap { flex-wrap: nowrap; }

/* "⋯" — the trigger for a row's less frequent actions. */
.odpo-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
}
.odpo-menu-trigger svg { width: 18px; height: 18px; fill: currentColor; }

/* The menu itself: a native popover in the top layer, placed by the toggle listener in index.html. The UA
   centres popovers (inset:0; margin:auto) — undone here so the script's top/left hold. */
.odpo-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  min-width: 200px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised, var(--surface));
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.odpo-menu > button,
.odpo-menu > a {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: none;
  box-shadow: none;
  color: var(--text);
  font-weight: 500;
  font-size: .9rem;
  text-align: start;
  text-decoration: none;
}
.odpo-menu > button:hover:not(:disabled):not([type="submit"]),
.odpo-menu > a:hover,
.odpo-menu > button:focus-visible,
.odpo-menu > a:focus-visible { background: var(--surface-sunken); outline: none; }
.odpo-menu > button:active:not(:disabled) { transform: none; }
.odpo-menu > .is-danger { color: var(--danger); }
.odpo-menu > .is-danger:hover:not(:disabled):not([type="submit"]) { background: var(--danger-bg); }
.odpo-menu > hr { margin: 4px 0; border: 0; border-top: 1px solid var(--border); }
.odpo-menu:popover-open:not([data-placed]) { visibility: hidden; }

/* Unit and tenant open their detail panels — link-styled buttons in the brand ink, with
   enough contrast to read (the gold accent does not, at text size, on white). */
.odpo-cell-link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--brand-secondary, var(--odpo-violet));
  font-weight: 600;
  text-align: start;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}
.odpo-cell-link:hover:not(:disabled):not([type="submit"]) { background: none; text-decoration-color: currentColor; }
.odpo-cell-link[aria-expanded="true"] { text-decoration-color: currentColor; }

.odpo-row-panel > td { padding: 0; }
.odpo-row-panel-inner { padding: var(--space-4) var(--space-5); }
.odpo-row-panel-inner h3 { margin: 0 0 var(--space-3); }
.odpo-row-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.odpo-row-panel-head h3 { margin: 0; }

.odpo-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.odpo-edit-grid .odpo-field { margin-bottom: 0; }
.odpo-edit-grid .odpo-field > select,
.odpo-edit-grid .odpo-field > input { width: 100%; }
.odpo-edit-wide { grid-column: 1 / -1; }

.odpo-detail-list {
  display: grid;
  grid-template-columns: max-content 1fr max-content 1fr;
  gap: 8px var(--space-5);
  margin: var(--space-3) 0 0;
  font-size: .88rem;
}
.odpo-detail-list dt { color: var(--text-muted); margin: 0; font-weight: 500; }
.odpo-detail-list dd { margin: 0; }

.odpo-pager { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); font-size: .88rem; }

@media (max-width: 860px) {
  .odpo-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .odpo-detail-list { grid-template-columns: max-content 1fr; }
}
@media (max-width: 560px) {
  .odpo-edit-grid { grid-template-columns: minmax(0, 1fr); }
  .odpo-candidate, .odpo-selected-tenant { flex-wrap: wrap; }
  .odpo-steps { gap: var(--space-3); }
}
@media (prefers-reduced-motion: reduce) { .odpo-skeleton { animation: none; } }

/* A button that owns its row — the submit on a single-purpose form. */
.odpo-btn-block { width: 100%; min-height: 46px; font-size: 1rem; }

/* A picker whose options are long sentences (a contract reads "سكني · 7٬500 ر.ق · ساري").
   Roomy where there is room, and free to shrink where there is not — which an inline
   `min-width` could not do, because no stylesheet rule can override one. */
.odpo-select-wide { min-width: min(420px, 100%); max-width: 100%; }

/* Task 10.43 — a two-panel screen (settings/roles: the permissions matrix beside the
   department list) used a fixed `grid-template-columns: 1.1fr 0.9fr` written inline on the
   page itself. Fixed columns with no breakpoint is exactly the "whole page scrolls
   sideways" failure this file's own phone section (further down) already fixes for
   TABLES — this was the same bug one level up, on the page layout itself, invisible at
   desktop width where it was built and reviewed. A shared class instead of another inline
   style, so the next two-panel screen inherits the fix instead of repeating the mistake. */
.odpo-two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 860px) {
  .odpo-two-col { grid-template-columns: 1fr; }
}

/* KPI cards — taken from the dashboard mockup in the proposal, which opened with four
   figures across the top and was the single biggest thing the built portal was missing:
   the screen led with a table, so the numbers a manager actually opens the portal for had
   to be worked out by reading rows.
   Auto-fit rather than a fixed column count, so three cards or five both look deliberate
   and the row collapses to one column on a phone with no media query. */
.odpo-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.odpo-kpi {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
}

.odpo-kpi-label { font-size: .82rem; font-weight: 550; color: var(--text-muted); }

.odpo-kpi-value {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.odpo-kpi-note { font-size: .8rem; color: var(--text-faint); }

/* A row of actions under a table — export, print. Kept off the table itself so the table
   stays a table. */
.odpo-actions { margin: var(--space-3) 0 var(--space-6); }

/* A row of inputs that make one form. Wraps, so a narrow screen stacks it instead of
   pushing the page sideways — the failure four screens already had. */
.odpo-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-5);
}

/* Buttons inside a table cell. Without the wrap a row of four actions widens the column
   until the table no longer fits. */
.odpo-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.odpo-row-actions button { padding: 5px 10px; min-height: 32px; font-size: .84rem; }

/* A two-option segmented toggle (found/missing, yes/no) built on real radio inputs — not a
   custom widget, so keyboard and screen-reader behaviour stay exactly what a native radio
   group already gives for free. Used first by the move-out inventory check (Contracts.razor),
   where a bare radio + text label read as an unfinished form rather than a real control. */
.odpo-toggle-group { display: flex; gap: 6px; flex-wrap: wrap; }

.odpo-toggle-option {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;                         /* a <label>: the global label margin made every group 4px taller than its chips */
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 550;
  color: var(--text);
  cursor: pointer;
  background: var(--surface);
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}

.odpo-toggle-option:hover { background: var(--surface-sunken); }

.odpo-toggle-option:has(input:checked) {
  border-color: var(--brand-secondary, var(--odpo-violet));
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 10%, transparent);
  color: var(--brand-secondary, var(--odpo-violet));
  font-weight: 650;
}

.odpo-toggle-option input[type="radio"] { margin: 0; width: 15px; height: 15px; }

/* A secondary line under a value — who a unit is held for, why it was withdrawn. */
.odpo-subtle { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }

.odpo-field-label {
  display: block;
  font-size: .855rem;
  font-weight: 550;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

/* ---- Confirm dialog (Shared/ConfirmDialog.razor) -----------------------------
 * A real centred popup for confirming a destructive action, replacing the inline
 * "sure? [yes][no]" text that used to sit next to the triggering button on Units/
 * Contracts/Maintenance. `position: fixed; inset: 0` over the backdrop is what makes this a
 * popup rather than another row in the page flow — it covers the viewport regardless of
 * where the triggering button sits or how far the page has scrolled. */
.odpo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 1000;
}

.odpo-modal {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  max-width: 420px;
  width: 100%;
  /* Explicit rather than left to inherit: this dialog renders wherever the triggering
     button happens to sit in the page, and a table's action cell (Units.razor: the project
     and building delete buttons) set a physical `text-align:left` on itself for its OWN
     button row — which cascaded into this dialog's title and message too, since it mounts
     as a plain child of that cell rather than escaping to a portal. Pinning it to `start`
     here means the dialog's own text alignment can never again depend on where it is
     dropped in the DOM. */
  text-align: start;
}

.odpo-modal h3 { margin: 0 0 var(--space-2); }

/* Same "renders wherever it's dropped" problem as text-align above, for white-space: an
   action cell that sets `white-space:nowrap` on itself so its OWN buttons stay on one line
   (RoleSettings.razor's reset-to-default cell) inherits down into this paragraph too, since
   the dialog mounts as a plain child rather than escaping to a portal — the message then
   refuses to wrap at all and overflows straight past the dialog's own edge instead of
   staying inside it. Pinning `normal` here means the message always wraps to the dialog's
   own width regardless of what white-space its ancestor happens to set. */
.odpo-modal p { margin: 0 0 var(--space-4); color: var(--text-muted); white-space: normal; }

/* `flex-end` rather than a physical `right` — it follows the flex container's own inline
   direction, so this needs no separate rule for RTL. */
.odpo-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.odpo-btn-danger {
  background: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 80%, black);
  color: #fff;
}

.odpo-btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 88%, black);
  border-color: color-mix(in srgb, var(--danger) 80%, black);
  color: #fff;
}

/* ---- Session timeout dialog (Shared/SessionTimeoutDialog.razor) --------------------
 * The "are you still there?" countdown before an idle sign-out. Above everything else that
 * floats (row menus, other dialogs): when it is up, it is the only thing that matters.
 * The ring is the countdown at a glance — readable from across a desk by someone walking
 * back to it — and turns to the warning colour for the last ten seconds. */
.odpo-session-backdrop { z-index: 1100; backdrop-filter: blur(2px); }

.odpo-session-modal {
  max-width: 400px;
  text-align: center;
  animation: odpo-session-in .2s var(--ease);
}
.odpo-session-modal h3 { font-size: 1.15rem; }
.odpo-session-modal p { text-align: center; }
.odpo-session-modal .odpo-modal-actions { justify-content: center; flex-wrap: wrap; }
.odpo-session-modal .odpo-modal-actions button { min-width: 9.5rem; }

.odpo-session-ring {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-3);
  --ring: var(--brand-primary, var(--odpo-ink));
}
.odpo-session-ring.is-urgent { --ring: var(--danger); }
.odpo-session-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.odpo-session-ring circle { fill: none; stroke-width: 5; }
.odpo-session-ring-track { stroke: var(--surface-sunken); }
.odpo-session-ring-value {
  stroke: var(--ring);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke .3s var(--ease);
}
.odpo-session-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ring);
}

@keyframes odpo-session-in {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .odpo-session-modal { animation: none; }
  .odpo-session-ring-value { transition: none; }
}

/* ---- Language tabs (message composer) --------------------------------------
 * The compose screen used to render a title+body pair for EVERY enabled language, stacked —
 * a 5740px page, and worse, a page that implies all ten must be filled. In practice a
 * member writes the one or two languages they actually speak and everyone else reads the
 * English fallback by design.
 *
 * One tab per language carrying its own state, and a single editor below. Wraps rather than
 * scrolls: ten tabs across a 720px column is three tidy rows, whereas a horizontal scroller
 * hides languages behind a gesture nobody knows is available. */
.odpo-langtabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.odpo-langtab {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 550;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.odpo-langtab:hover:not(:disabled) {
  border-color: var(--brand-secondary, var(--odpo-violet));
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
}

/* Written: the tick is the whole point — "which languages have I actually done" is the
   question the author asks on every glance. */
.odpo-langtab.is-written {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--border-strong));
  color: var(--ok);
  background: var(--ok-bg);
}

.odpo-langtab.is-active {
  border-color: var(--brand-primary, var(--odpo-ink));
  background: var(--brand-primary, var(--odpo-ink));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.odpo-langtab.is-active:hover:not(:disabled) {
  background: var(--brand-primary, var(--odpo-ink));
  color: #fff;
}

.odpo-langtab-mark { display: inline-flex; color: var(--ok); }
.odpo-langtab-mark svg { width: 13px; height: 13px; }
.odpo-langtab-required { color: var(--danger); font-weight: 700; }
.odpo-langtab.is-active .odpo-langtab-required { color: var(--accent-soft); }

.odpo-lang-editor { margin: var(--space-3) 0 var(--space-5); }
.odpo-lang-editor h3 { margin-bottom: var(--space-4); }

/* A section heading with its own action on the far side — "إضافة شركة جديدة" beside the
   button that reveals its form. Keeps a rare action discoverable without letting its form
   occupy the screen permanently. */
.odpo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin: var(--space-6) 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.odpo-section-head h2 { margin: 0; }

/* Reports hub — a row of tabs replacing what used to be six sections stacked on one long
   scrolling page ("سلس في الوصول"). Deliberately plain buttons, not a full router: each
   report already lazy-loads on first click, so a tab is a view-state toggle, not a route. */
.odpo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: var(--space-4) 0 0;
}

.odpo-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
  min-height: auto;
}

.odpo-tab:hover { color: var(--text); background: var(--surface-sunken); }

.odpo-tab-active {
  color: var(--brand-primary, var(--odpo-blue));
  border-bottom-color: var(--brand-primary, var(--odpo-blue));
}

.odpo-tab-panel { margin-top: 0; border-top-right-radius: 0; }

/* The private-notes notice. Deliberately NOT styled as a warning: nothing is wrong, and a
   yellow caution beside a text box makes people avoid the box. It reads as a statement of
   fact about who can see what — which is exactly what it is. */
.odpo-private-note {
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 6%, var(--surface));
  border-inline-start: 3px solid var(--brand-secondary, var(--odpo-violet));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  font-size: .85rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: var(--space-4);
}

.odpo-private-note b { color: var(--brand-secondary, var(--odpo-violet)); }

/* An inline caution that is not an error: the message is still being written.
   Theme pass: flex row for an icon beside the text — every caller now leads with
   <HubIcon Name="warning" /> instead of a literal ⚠ typed straight into the markup, which
   rendered in whatever glyph shape the reader's own OS/font shipped rather than this
   portal's own icon line weight. */
.odpo-warn-inline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  border-inline-start: 3px solid var(--warn);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 12px;
  font-size: .85rem;
  margin: var(--space-2) 0;
}

.odpo-warn-inline svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; }

/* A small reusable size override for an icon dropped inline into running text (a table
   cell's inline warning) rather than one of this file's own icon-badge slots. */
.odpo-icon-sm svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 1px; }

/* Status pills. The list screens print states as bare words ("Active", "مفتوح"), which
   makes the reader read every cell; a coloured pill is scannable at a glance. */
.odpo-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .775rem;
  font-weight: 650;
  line-height: 1;
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
  /* The inset ring gives the pill an edge without a second colour — flat fills at this
     size read as a highlighter smudge. */
  box-shadow: inset 0 0 0 1px rgba(23, 23, 42, .07);
}

.odpo-pill svg { width: 12px; height: 12px; }

.odpo-pill-ok { background: var(--ok-bg); color: var(--ok); }
.odpo-pill-warn { background: var(--warn-bg); color: var(--warn); }
.odpo-pill-muted { background: var(--surface-sunken); color: var(--text-muted); }
.odpo-pill-danger { background: var(--danger-bg); color: var(--danger); }

/* A cell that opens a detail panel: it has to READ as an affordance without reading as a
   row of buttons. A real <button> (not a styled span) so the keyboard and a screen reader
   get the same affordance the mouse does — the contracts table's unit and tenant cells are
   the only way into those details. */
.odpo-link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent, #2b5ec9);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.odpo-link-button:hover { text-decoration-thickness: 2px; }

/* The language picker sits on the dark sidebar, where a default select is nearly
   invisible. The options themselves must go back to light, or the dropdown is white text
   on white on Windows. */
.odpo-language-picker select {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .26);
  color: #fff;
  min-height: 36px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: background .16s var(--ease), border-color .16s var(--ease);
}

.odpo-language-picker select:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .40);
}

.odpo-language-picker select:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .16);
}

.odpo-language-picker select option { background: var(--surface); color: var(--text); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Phone ------------------------------------------------------------------
 * Four screens scrolled the whole PAGE sideways on a 390px phone — /units by 89px,
 * /checks by 54px, /settings/reset-password by 170px, /maintenance by 10px — because a
 * rent roll has more columns than a phone has width. Sideways page scroll is the most
 * common way a desktop-designed portal fails in the hand, and it is invisible at desktop
 * width, which is where it always gets reviewed.
 *
 * The table scrolls INSIDE ITSELF instead. `display: block` is what makes a table a
 * scroll container at all; without it the table forces its own min-content width onto
 * every ancestor and the page moves instead. Done here rather than by wrapping fourteen
 * tables in fourteen files, so the next screen inherits the fix. */
@media (max-width: 720px) {
  .content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* A fixed inline width narrower than the phone is still too wide once it sits beside
     another one. Nothing may exceed the screen. */
  .content input,
  .content select,
  .content textarea { max-width: 100%; }

  .content { padding-inline: var(--space-3); }
  h1 { font-size: 1.4rem; }
}

/* A <pre> holding real prose (a contract's actual generated text), not code. Bootstrap's
   reboot.css sets `code, kbd, pre, samp { direction: ltr; unicode-bidi: bidi-override }` —
   entirely reasonable for a snippet of code embedded in an RTL page, and exactly wrong
   here: bidi-override FORCES literal left-to-right character placement regardless of
   script, which does not just misalign Arabic prose but visually MIRRORS it letter by
   letter — "عقد إيجار وحدة" رُئيت "ةدحو راجيإ دقع" on a real screen. unicode-bidi:plaintext
   is the fix, not a hardcoded direction: it restores the normal Unicode Bidi Algorithm,
   which reads each paragraph's own first strong character to choose its direction — so an
   Arabic clause renders RTL and an English one LTR automatically, correct for a template a
   company might one day write bilingually, with no per-language branching in the markup. */
.odpo-document-text {
  unicode-bidi: plaintext;
  direction: rtl;
}

/* The English half of a bilingual contract — and the English editor beside it — is a
   left-to-right island inside an RTL page. dir="ltr" on the element is what says "not this
   one", but an ATTRIBUTE loses to the class rule above (the UA's [dir] rule is weaker than
   any author selector), so the English text rendered right-aligned with its punctuation
   flipped: ":This agreement is made between". Seen on the real screen, not in the markup. */
.odpo-document-text[dir="ltr"] { direction: ltr; }

/* Contract bodies are rich text now (headings, emphasis, clause lists — see
   Domain/Documents/ContractHtml for the allow-list). These rules style THE ELEMENTS the
   editor and the document view produce, scoped to the document surface, because the page's
   own h2/h3 are screen furniture — a contract's "المادة الثالثة" must not be sized like the
   page title above it. */
.odpo-document-text h2 {
  font-size: 1.15rem;
  margin: 1.4em 0 .5em;
  padding: 0;
  border: none;
}

.odpo-document-text h3 {
  font-size: 1rem;
  margin: 1.2em 0 .4em;
}

.odpo-document-text p { margin: 0 0 .85em; }

.odpo-document-text ul,
.odpo-document-text ol {
  margin: 0 0 .85em;
  padding-inline-start: 1.6em;
}

.odpo-document-text li { margin-bottom: .35em; }

/* The editor itself: a toolbar over a contenteditable surface. It deliberately looks like
   the document it is editing — same element styles, same line height — so the wording is
   read in the shape it will actually be signed in rather than as a wall of textarea text. */
.odpo-rte {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.odpo-rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}

.odpo-rte-toolbar button {
  min-width: 34px;
  min-height: 34px;
  padding: 2px 8px;
  font-size: 13px;
  line-height: 1;
}

.odpo-rte-separator {
  width: 1px;
  align-self: stretch;
  margin: 2px 4px;
  background: var(--border);
}

.odpo-rte-surface {
  padding: var(--space-3);
  line-height: 1.9;
  overflow-y: auto;
  max-height: 60vh;
}

/* The focus ring belongs on the surface, not on the bordered wrapper: the wrapper is not
   what receives keyboard focus, and a contenteditable with no visible focus state is
   indistinguishable from a read-only panel. */
.odpo-rte-surface:focus {
  outline: 2px solid var(--brand-primary, #2E2A7A);
  outline-offset: -2px;
}

.odpo-rte-surface:empty::before {
  content: attr(data-placeholder);
  color: var(--text-faint);
}

.odpo-rte-disabled { opacity: .6; }

/* Theme pass — MainLayout's first-paint placeholder (shown for the fraction of a second
   before locale files arrive), moved out of an inline `style=` attribute for the same
   reason as the footer below it. */
.odpo-boot-placeholder {
  padding: 15vh var(--space-4) var(--space-4);
  text-align: center;
  color: var(--text-faint);
  font-size: 1.4rem;
}

/* Theme pass — MainLayout's PDPL footer, moved out of an inline `style=` attribute so it
   reads from the same token set as everything else instead of its own literal hex greys. */
.odpo-footer {
  font-size: .78rem;
  color: var(--text-faint);
  padding: var(--space-4) var(--space-4);
  border-top: 1px solid var(--border);
  margin-top: var(--space-6);
  text-align: center;
}

/* Theme pass — App.razor's 403/"not found" branches used to be a single bare
   `<p role="alert">`, the one place left in the portal with no card, no icon, nothing but
   text on the page background. A dead end should not look unfinished; it should look like a
   deliberate stop, the same as an empty list already does elsewhere via .odpo-subtle. */
.odpo-empty-state {
  max-width: 480px;
  margin: 10vh auto 0;
  text-align: center;
  padding: var(--space-6) var(--space-5);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.odpo-empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-4);
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 10%, transparent);
  color: var(--brand-primary, var(--odpo-ink));
}

.odpo-empty-state-icon svg { width: 26px; height: 26px; }
.odpo-empty-state p { margin: 0; color: var(--text-muted); }

/* Theme pass — the WASM boot spinner and the runtime-error banner (`wwwroot/css/app.css`)
   still carried the unstyled Blazor-template defaults (grey ring, hard blue, a yellow bar
   with black text): the very first thing a cold load paints, and the one screen a real
   runtime error puts in front of a user — both left outside the token system entirely. Kept
   in this file rather than app.css itself so every colour here still reads from the same
   palette as the rest of the portal, and updates if that palette ever does. */
.loading-progress circle:last-child { stroke: var(--brand-primary, var(--odpo-ink)) !important; }
.loading-progress-text { color: var(--text) !important; }

#blazor-error-ui {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-top: 3px solid var(--danger) !important;
  box-shadow: var(--shadow-lg) !important;
  font-size: .88rem !important;
}

#blazor-error-ui .dismiss {
  color: var(--text-muted) !important;
  font-weight: 650 !important;
}

/* ---- Print — ContractDocument.razor -----------------------------------------
 * A generic rule, not scoped to one page: hiding the top bar (and anything explicitly
 * marked .odpo-no-print — buttons, forms, the sign-off tools) is exactly right for ANY
 * screen someone prints, not only the contract document. .odpo-print-page is the one
 * contract-specific piece — a page-like block with real margins, so a printed lease reads
 * as a document instead of a web page with buttons removed.
 *
 * DELIBERATELY NOT a Latin serif stack (Georgia/Times New Roman/etc). A contract's body is
 * almost entirely Arabic, and none of those faces carry a single Arabic glyph — the first
 * draft of this rule set exactly that, which silently threw away app.css's own carefully
 * built Noto stack (self-hosted, per-script unicode-range, "no tofu") for the one screen
 * that is mostly Arabic text, leaving every Arabic character to fall through to whatever
 * font the printing OS happens to default to. Printing must render in the SAME typeface
 * the screen already committed to, not a different one nobody chose for this one page. */
@media print {
  .odpo-topbar, .odpo-no-print { display: none !important; }
  .content { max-width: none; padding: 0; margin: 0; }

  .odpo-print-page {
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 13pt;
    line-height: 2;
    color: #000;
  }
}

/* Someone who has asked their operating system to reduce motion has usually asked for a
   reason. Transitions here are decoration; none of them carry meaning. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Bank reconciliation (Pages/BankReconciliation.razor) ---------------------------------
 * A three-step job (the statement, what it will do, approving) laid out as one: the steps say
 * where you are; the statement is a drop zone beside a paste box, its columns numbered chips
 * instead of paragraphs; the review leads with the money per outcome, then the numbers the
 * company does not have, then the table, whose approve bar stays in reach at the bottom of the
 * screen however long the statement is. On a phone every row becomes a card. Portal tokens only. */
.rec-steps {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  max-width: 1100px; margin: 0 0 var(--space-5); padding: 0; list-style: none;
}
.rec-step {
  display: inline-flex; align-items: center; gap: 8px;
  padding-block: 5px; padding-inline: 5px 14px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted); font-size: .84rem; font-weight: 600;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.rec-step-mark {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border-strong);
  font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rec-step-mark svg { width: 14px; height: 14px; stroke-width: 2.4; }
.rec-step.is-current { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 9%, var(--surface)); color: var(--text); }
.rec-step.is-current .rec-step-mark { background: var(--brand-primary, var(--odpo-ink)); border-color: transparent; color: #fff; }
.rec-step.is-done { background: var(--ok-bg); color: var(--ok); }
.rec-step.is-done .rec-step-mark { background: var(--ok); border-color: transparent; color: #fff; }

/* The statement: a file dropped or picked, or text pasted — side by side, "أو" between. */
.rec-source { max-width: 1100px; margin-bottom: var(--space-4); padding: var(--space-5); }
.rec-source-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--space-2) var(--space-4); margin-bottom: var(--space-4);
}
.rec-source-head h2 { margin: 0; font-size: 1.05rem; }
.rec-sample { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; }
.rec-sample svg { width: 16px; height: 16px; }
.rec-source-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr);
  gap: var(--space-4); align-items: stretch;
}

.rec-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 210px; padding: var(--space-5); text-align: center; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-sunken); color: var(--text-muted);
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
/* The real file input, transparent over the whole zone: a drop, a click and the keyboard all reach it. */
.rec-drop input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0;
  padding: 0; border: 0; opacity: 0; cursor: pointer;
}
.rec-drop input[type="file"]:disabled { cursor: progress; }
.rec-drop:hover, .rec-drop.is-dragging {
  border-color: var(--brand-secondary, var(--odpo-violet));
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 6%, var(--surface));
}
.rec-drop.is-dragging { border-style: solid; }
.rec-drop:focus-within { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.rec-drop.has-file { border-style: solid; border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); background: var(--ok-bg); }
.rec-drop-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin-bottom: 6px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-sm); color: var(--brand-primary, var(--odpo-ink));
  transition: transform .2s var(--ease);
}
.rec-drop:hover .rec-drop-icon, .rec-drop.is-dragging .rec-drop-icon { transform: translateY(-2px); }
.rec-drop.has-file .rec-drop-icon { color: var(--ok); }
.rec-drop-title { font-size: 1rem; font-weight: 650; color: var(--text); overflow-wrap: anywhere; }
.rec-drop-hint { font-size: .8rem; }

.rec-or {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  color: var(--text-faint); font-size: .78rem; font-weight: 650;
}
.rec-or::before, .rec-or::after { content: ""; flex: 1; width: 1px; background: var(--border); }

.rec-paste { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.rec-paste label { font-size: .88rem; font-weight: 600; }
.rec-paste textarea {
  flex: 1; width: 100%; min-height: 150px; resize: vertical;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .84rem;
}
.rec-paste button { align-self: flex-start; }

.rec-format {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border);
}
.rec-format-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.rec-columns { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: rec-col; }
.rec-columns li {
  counter-increment: rec-col; display: inline-flex; align-items: center; gap: 6px;
  padding-block: 3px; padding-inline: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: .8rem; font-weight: 600;
}
.rec-columns li::before {
  content: counter(rec-col); display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--surface-sunken);
  font-size: .7rem; font-weight: 700; color: var(--text-muted);
}
.rec-columns li.is-optional { border-style: dashed; color: var(--text-muted); font-weight: 550; }
.rec-optional { font-size: .68rem; font-weight: 600; color: var(--text-faint); }
.rec-format p { flex-basis: 100%; max-width: 92ch; margin: 0; font-size: .8rem; color: var(--text-muted); text-wrap: pretty; }

.rec-alert { max-width: 1100px; }

/* The sections below the statement. */
.rec-section { max-width: 1100px; margin-top: var(--space-6); }
.rec-section-head { margin-bottom: var(--space-3); }
.rec-section-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.15rem; }
.rec-section-head p { max-width: 90ch; margin: 4px 0 0; font-size: .85rem; color: var(--text-muted); text-wrap: pretty; }
.rec-count {
  display: inline-block; min-width: 1.7em; padding: 0 6px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted);
  font-size: .74rem; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums;
}

/* The review's money, by outcome. */
.rec-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.rec-stat {
  display: grid; gap: 2px; padding: var(--space-3) var(--space-4); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.rec-stat-label { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 650; }
.rec-stat-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rec-stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.rec-stat-note { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rec-stat.is-ok .rec-stat-label { color: var(--ok); }
.rec-stat.is-danger .rec-stat-label { color: var(--danger); }
.rec-stat.is-warn .rec-stat-label { color: var(--warn); }
.rec-stat.is-muted .rec-stat-label { color: var(--text-muted); }
.rec-stat.is-ok.is-done { background: var(--ok-bg); border-color: transparent; box-shadow: none; }
.rec-stat.is-danger.is-done { background: var(--danger-bg); border-color: transparent; box-shadow: none; }
.rec-stat.is-empty .rec-stat-value { color: var(--text-faint); }

/* Numbers the company does not have: listed once, with what to do about them. */
.rec-missing {
  display: flex; gap: var(--space-3); margin-bottom: var(--space-4); padding: var(--space-4);
  border-radius: var(--radius); background: var(--warn-bg);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, var(--border));
}
.rec-missing-icon { flex: none; color: var(--warn); }
.rec-missing-body { min-width: 0; flex: 1; }
.rec-missing b { display: flex; align-items: center; gap: 8px; color: var(--warn); font-size: .95rem; }
.rec-missing p { margin: 2px 0 var(--space-3); font-size: .84rem; color: var(--text-muted); }
.rec-missing ul {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px var(--space-3);
  margin: 0; padding: 0; list-style: none;
}
.rec-missing li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 6px 12px;
  border-radius: var(--radius-sm); background: var(--surface); font-size: .86rem;
}
.rec-ref { font-size: .76rem; color: var(--text-faint); }

/* The tables. */
.rec-table tbody tr:nth-child(even) { background: none; }
.rec-table td { vertical-align: top; }
.rec-cell { min-width: 0; }
.rec-cheque { display: block; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rec-unit { display: block; font-weight: 600; white-space: nowrap; }
.rec-sub { display: block; margin-top: 1px; font-size: .78rem; color: var(--text-muted); }
.rec-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.rec-num { font-weight: 600; }
th.rec-num { font-weight: 650; }
.rec-currency { font-size: .78rem; font-weight: 500; color: var(--text-muted); }
.rec-mismatch { display: block; margin-top: 2px; font-size: .76rem; font-weight: 600; color: var(--warn); white-space: normal; }

.rec-outcome {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted); font-size: .8rem; font-weight: 650;
}
.rec-outcome::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rec-outcome.is-go { background: var(--ok-bg); color: var(--ok); }
.rec-outcome.is-return { background: var(--danger-bg); color: var(--danger); }
.rec-outcome.is-done { background: var(--ok); color: #fff; }
.rec-outcome.is-returned { background: var(--danger); color: #fff; }
.rec-outcome.is-review { background: var(--warn-bg); color: var(--warn); }

.rec-table tbody tr.is-review { background: color-mix(in srgb, var(--warn) 4%, transparent); }
.rec-table tbody tr.is-settled .rec-cheque { color: var(--text-muted); }
.rec-table tbody tr.is-picked,
.rec-table tbody tr.is-picked:hover {
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 7%, var(--surface));
}
.bankrec-pick { width: 1%; padding-inline-end: 4px; }
.bankrec-pick input { display: block; margin: 2px 0 0; }
.bankrec-reason { width: 100%; min-width: 180px; }

/* Approving: stays at the bottom of the screen while the table scrolls under it. */
.rec-apply {
  position: sticky; bottom: var(--space-3); z-index: 4;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4);
  margin-top: var(--space-3); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.rec-apply-text { display: grid; gap: 1px; font-size: .82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rec-apply-text b { font-size: .95rem; color: var(--text); }
.rec-apply-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rec-apply-actions button { white-space: nowrap; }

/* Lines without a number. */
.rec-manual-table select { width: 100%; min-width: 240px; }
.rec-note { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; font-size: .78rem; color: var(--text-muted); }
.rec-note.is-danger { color: var(--danger); }
.rec-note svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.rec-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.rec-actions button { min-height: 34px; padding: 5px 12px; font-size: .84rem; white-space: nowrap; }
.rec-return { display: grid; gap: 6px; min-width: 230px; }
.rec-return input { width: 100%; }

.rec-loading { max-width: 1100px; color: var(--text-muted); }
.rec-empty { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); box-shadow: none; }
.rec-empty b { display: block; }
.rec-empty p { margin: 2px 0 0; font-size: .88rem; color: var(--text-muted); }
.rec-empty-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 13px;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 8%, transparent); color: var(--brand-primary, var(--odpo-ink));
}

@media (prefers-reduced-motion: reduce) {
  .rec-drop-icon, .rec-step { transition: none; }
  .rec-drop:hover .rec-drop-icon, .rec-drop.is-dragging .rec-drop-icon { transform: none; }
}

@media (max-width: 860px) {
  .rec-source-grid { grid-template-columns: minmax(0, 1fr); }
  .rec-or { flex-direction: row; }
  .rec-or::before, .rec-or::after { width: auto; height: 1px; }
  .rec-drop { min-height: 150px; }
}

/* On a phone each row becomes a card: label beside value, the tick at the card's corner. */
@media (max-width: 720px) {
  .rec-source { padding: var(--space-4); }
  .rec-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rec-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rec-table, .rec-table tbody, .rec-table tr { display: block; width: 100%; }
  .rec-table tbody tr { position: relative; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  .rec-table tbody tr:last-child { border-bottom: 0; }
  .rec-table td { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); align-items: start; gap: 8px; padding: 5px 0; border: 0; }
  .rec-table td::before { content: attr(data-label); font-size: .78rem; font-weight: 600; color: var(--text-muted); }
  .rec-table td.is-empty { display: none; }
  .rec-table td.bankrec-pick { position: absolute; top: var(--space-3); inset-inline-end: var(--space-4); display: block; width: auto; padding: 0; }
  .rec-table td.bankrec-pick input { width: 22px; height: 22px; margin: 0; }
  .bankrec-number-table td:nth-child(2) { padding-inline-end: 36px; }   /* clear of the tick */
  .rec-table td.bankrec-pick::before, .rec-table td.rec-actions-cell::before { content: none; }
  .rec-table td.rec-actions-cell { display: block; padding-top: var(--space-2); }
  .rec-actions { justify-content: flex-start; }
  .rec-manual-table select { min-width: 0; }
  .rec-return { min-width: 0; }
  .rec-cheque, .rec-unit, .rec-num { white-space: normal; }
  .rec-apply { bottom: var(--space-2); padding: var(--space-3); }
  .rec-apply-actions { width: 100%; }
  .rec-apply-actions button { flex: 1; padding-inline: 10px; }
}

/* ---- Cheques (Pages/Checks.razor) -------------------------------------------------------
 * Built around the one question the screen is opened for — which of this contract's cheques
 * needs doing now: the contract as a file with its money at a glance, the lifecycle as a
 * filter, colour for status, one primary action per row (the next step), and the return
 * reason asked for right under its own cheque. Only the portal's tokens; no new palette. */
.chq-loading { max-width: 1100px; color: var(--text-muted); }

.chq-empty {
  display: flex; align-items: center; gap: var(--space-4);
  max-width: 1100px; padding: var(--space-5);
}
.chq-empty b { display: block; font-size: 1rem; }
.chq-empty p { margin: 2px 0 0; color: var(--text-muted); font-size: .9rem; }
.chq-empty-compact { padding: var(--space-4) var(--space-5); box-shadow: none; }
.chq-empty-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 14px;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 8%, transparent);
  color: var(--brand-primary, var(--odpo-ink));
}

/* The picker: which contracts, then which one. */
.chq-picker {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end;
  gap: var(--space-4) var(--space-5); max-width: 1100px; margin-bottom: var(--space-4);
}
.chq-picker-filter, .chq-status-filter { border: 0; padding: 0; margin: 0; min-width: 0; }
.chq-picker-filter legend {
  padding: 0; margin-bottom: 6px; font-size: .82rem; font-weight: 600; color: var(--text-muted);
}
.chq-picker-contract { margin: 0; }
.chq-count {
  display: inline-block; min-width: 1.7em; padding: 0 6px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted);
  font-size: .74rem; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums;
}
.odpo-toggle-option:has(input:checked) .chq-count {
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 16%, transparent); color: inherit;
}
.odpo-toggle-option.is-empty { opacity: .55; }

/* The contract as a file: who and what on one side, its cheques' money on the other. */
.chq-contract {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: var(--space-5) var(--space-6); max-width: 1100px; margin-bottom: var(--space-4); padding: var(--space-5);
}
.chq-eyebrow { font-size: .74rem; font-weight: 650; color: var(--text-muted); }
.chq-contract-id h2 { margin: 0 0 2px; font-size: 1.85rem; line-height: 1.2; letter-spacing: -.01em; }
.chq-contract-tenant { margin: 0 0 var(--space-3); font-size: 1rem; font-weight: 600; }
.chq-muted { margin-inline-start: 6px; font-size: .84rem; font-weight: 500; color: var(--text-muted); }
.chq-contract-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: .84rem; color: var(--text-muted); }
.chq-rent b { color: var(--text); font-size: .95rem; }
.chq-period { font-variant-numeric: tabular-nums; }

.chq-contract-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start;
  gap: var(--space-4); padding-inline-start: var(--space-6); border-inline-start: 1px solid var(--border);
}
.chq-stat { display: grid; gap: 2px; min-width: 0; }
.chq-stat-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.chq-stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.chq-stat-value small { font-size: .74rem; font-weight: 600; color: var(--text-muted); }
.chq-stat-value.is-danger { color: var(--danger); }
.chq-stat-note { font-size: .78rem; color: var(--text-faint); }
.chq-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-3); }
.chq-progress-track {
  flex: 1; height: 8px; overflow: hidden; border-radius: 4px;
  background: color-mix(in srgb, var(--ok) 14%, var(--surface-sunken));
}
.chq-progress-track span { display: block; height: 100%; border-radius: 4px; background: var(--ok); transition: width .4s var(--ease); }
.chq-progress-value { font-size: .8rem; font-weight: 650; color: var(--ok); white-space: nowrap; }
.chq-next { grid-column: 1 / -1; margin: 0; font-size: .82rem; color: var(--text-muted); }
.chq-next b { color: var(--text); }
.chq-next.is-overdue { color: var(--danger); }
.chq-next.is-overdue b { color: var(--danger); }

/* Adding a cheque: labelled fields on one line, the button at its end. */
.chq-add { max-width: 1100px; margin-bottom: var(--space-5); padding: var(--space-4) var(--space-5); }
.chq-add h2 { margin: 0 0 var(--space-3); font-size: 1rem; }
.chq-add-form {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 1fr) auto;
  gap: var(--space-3); align-items: end;
}
.chq-add-form .odpo-field { margin: 0; }
.chq-add-form input { width: 100%; }
.chq-add-form button { min-height: 44px; white-space: nowrap; }
.chq-add-hint { margin: var(--space-2) 0 0; font-size: .78rem; color: var(--text-faint); }
.chq-inactive { max-width: 1100px; }

/* The list. */
.chq-list { max-width: 1100px; }
.chq-list-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3); margin: var(--space-2) 0 var(--space-3);
}
.chq-list-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.chq-status-filter .odpo-toggle-option { padding: 4px 11px; font-size: .8rem; }

.chq-table tbody tr:nth-child(even) { background: none; }
.chq-table tbody tr.is-overdue { background: color-mix(in srgb, var(--danger) 4%, transparent); }
.chq-table tbody tr.is-settled .chq-number,
.chq-table tbody tr.is-settled .chq-date { color: var(--text-muted); }
.chq-number { display: block; font-weight: 650; }
.chq-bank { display: block; font-size: .8rem; color: var(--text-muted); }
.chq-date { display: block; }
.chq-due { display: block; margin-top: 1px; font-size: .76rem; color: var(--text-faint); }
.chq-due.is-soon { color: var(--warn); font-weight: 600; }
.chq-due.is-overdue { color: var(--danger); font-weight: 650; }
.chq-amount { white-space: nowrap; font-weight: 600; }
th.chq-amount { font-weight: inherit; }
.chq-currency { font-size: .78rem; font-weight: 500; color: var(--text-muted); }

.chq-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted); font-size: .8rem; font-weight: 650; white-space: nowrap;
}
.chq-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chq-status.is-held {
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 10%, transparent);
  color: var(--brand-secondary, var(--odpo-violet));
}
.chq-status.is-bank { background: var(--warn-bg); color: var(--warn); }
.chq-status.is-done { background: var(--ok-bg); color: var(--ok); }
.chq-status.is-returned { background: var(--danger-bg); color: var(--danger); }
.chq-flag { margin-inline-start: 6px; }
.chq-reason { display: block; margin-top: 4px; font-size: .78rem; color: var(--danger); }

.chq-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.chq-actions button { min-height: 34px; padding: 5px 12px; font-size: .84rem; }
.chq-done { font-size: .8rem; color: var(--text-faint); }

/* The return reason, asked for under its own cheque. */
.chq-table tbody tr.chq-return-row,
.chq-table tbody tr.chq-return-row:hover { background: color-mix(in srgb, var(--danger) 4%, var(--surface)); }
.chq-return-row > td { padding-top: 0; }
.chq-return { display: grid; gap: 8px; max-width: 720px; padding: var(--space-2) 0 var(--space-2); }
.chq-return label { font-weight: 650; }
.chq-return-note { margin: 0; font-size: .8rem; color: var(--text-muted); }
.chq-return-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.chq-chip {
  min-height: 30px; padding: 3px 12px; border-radius: 999px; box-shadow: none;
  background: var(--surface); border: 1px solid var(--border-strong); font-size: .8rem; font-weight: 550;
}
.chq-chip.is-selected { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.chq-return input { width: 100%; max-width: 420px; }
.chq-return-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

@media (max-width: 900px) {
  .chq-picker, .chq-contract { grid-template-columns: minmax(0, 1fr); }
  .chq-contract-stats {
    padding-inline-start: 0; border-inline-start: 0;
    padding-top: var(--space-4); border-top: 1px solid var(--border);
  }
  .chq-add-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chq-add-form button { grid-column: 1 / -1; }
}

/* On a phone each cheque becomes a card: label beside value, the actions under them. */
@media (max-width: 720px) {
  .chq-contract-stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .chq-add-form { grid-template-columns: minmax(0, 1fr); }
  .chq-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .chq-table, .chq-table tbody, .chq-table tr { display: block; width: 100%; }
  .chq-table tbody tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  .chq-table tbody tr:last-child { border-bottom: 0; }
  .chq-table td { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); align-items: start; gap: 8px; padding: 5px 0; border: 0; }
  .chq-cell { min-width: 0; }
  .chq-table td::before { content: attr(data-label); font-size: .78rem; font-weight: 600; color: var(--text-muted); }
  .chq-table td.chq-actions-cell { display: block; padding-top: var(--space-2); }
  .chq-table td.chq-actions-cell::before { content: none; }
  .chq-actions { justify-content: flex-start; }
  .chq-return-row > td { display: block; }
  .chq-return-row > td::before { content: none; }
}

/* ---- Units (Pages/Units.razor) ----------------------------------------------------------------
 * One desk for the whole portfolio. A "places" navigator on the start side (projects with their
 * buildings and villas, then the standalone places), the chosen place on the other: what it is,
 * one add button that already knows the place, and its units as calm rows that open a side sheet
 * (details, specs, assets). Adding a unit, a project or a building happens in that same sheet.
 * One accent (the brand ink); status keeps its semantic colours. Motion only says something
 * happened: the sheet arriving, a new row glowing once, the toast. Portal tokens only. */
.ux-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-5); max-width: 1240px; }
.ux-head-text { min-width: 0; }
.ux-head .odpo-page-intro { margin-bottom: var(--space-5); }
.ux-primary { min-height: 44px; margin-bottom: var(--space-5); padding: 10px 20px; }
.ux-alert { max-width: 1240px; }

/* The pulse: occupancy at a glance */
.ux-pulse {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3) var(--space-6);
  max-width: 1240px; margin-bottom: var(--space-5); padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.ux-pulse-figure { display: grid; gap: 2px; }
.ux-pulse .odpo-occupancy-figure { font-size: 2.1rem; line-height: 1; }
.ux-pulse-bar { display: grid; gap: 8px; min-width: 0; }
.ux-pulse-bar .odpo-stackbar-legend { margin: 0; }
.ux-pulse-structure { margin: 0; white-space: nowrap; }

/* The workspace */
.ux-workspace { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--space-5); align-items: start; max-width: 1240px; }

/* Places */
.ux-places {
  position: sticky; top: var(--space-4); padding: var(--space-3);
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.ux-places-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 4px 6px var(--space-2); }
.ux-places-head h2 { margin: 0; font-size: .95rem; }
.ux-places-add { min-height: 30px; padding: 3px 10px; font-size: .8rem; }
.ux-places-toggle { display: none; }
.ux-place-list { display: grid; gap: 2px; max-height: calc(100dvh - 160px); margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.ux-place-label { padding: var(--space-3) 10px 4px; font-size: .72rem; font-weight: 700; color: var(--text-faint); }
.ux-place {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px;
  width: 100%; min-height: 42px; padding: 7px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; box-shadow: none; color: var(--text); font-weight: 500; text-align: start;
  transition: background-color .15s var(--ease);
}
.ux-place:hover:not(.is-active) { background: var(--surface-sunken); }
.ux-place:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 1px; }
.ux-place.is-active { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 8%, var(--surface)); box-shadow: inset -3px 0 0 var(--brand-primary, var(--odpo-ink)); font-weight: 650; }
[dir="ltr"] .ux-place.is-active { box-shadow: inset 3px 0 0 var(--brand-primary, var(--odpo-ink)); }
.ux-depth-1 { padding-inline-start: 26px; }
.ux-place-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-sunken); color: var(--text-muted); }
.ux-place.is-active .ux-place-icon { background: var(--brand-primary, var(--odpo-ink)); color: #fff; }
.ux-place-icon svg { width: 15px; height: 15px; }
.ux-place-name { overflow: hidden; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.ux-place-count { color: var(--text-faint); font-size: .76rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.ux-place-occ { grid-column: 2 / -1; height: 3px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; }
.ux-place-occ span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }

/* The chosen place */
.ux-main { min-width: 0; }
.ux-place-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.ux-place-head-text { display: grid; gap: 6px; min-width: 0; }
.ux-place-head h2 { margin: 0; font-size: 1.35rem; line-height: 1.3; }
.ux-place-meta { margin: 0; font-size: .85rem; color: var(--text-muted); }
.ux-place-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ux-place-actions button { min-height: 38px; padding: 6px 14px; font-size: .86rem; }
.ux-add-here { font-weight: 650; }

.ux-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.ux-toolbar .odpo-field { margin: 0; }
.ux-search { flex: 1 1 220px; max-width: 320px; }
.ux-search input { width: 100%; }
.ux-filter { min-width: 0; margin: 0; padding: 0; border: 0; }
.ux-filter .odpo-toggle-option { padding: 6px 12px; font-size: .84rem; }
.ux-listing select { min-height: 40px; }
.ux-result { margin: 0 0 var(--space-3); font-size: .82rem; color: var(--text-muted); }
.ux-link { min-height: 0; padding: 0; margin-inline-start: 6px; border: 0; background: none; box-shadow: none; color: var(--brand-primary, var(--odpo-ink)); font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Groups and unit rows */
.ux-group { margin-bottom: var(--space-5); }
/* Title and meta wrap among themselves; the add button stays pinned at the end of the line. */
.ux-group-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); padding-inline: 4px; }
.ux-group-head-text { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 2px var(--space-3); min-width: 0; }
.ux-group-title {
  display: inline-flex; align-items: center; gap: 8px; min-height: 0; padding: 2px 0; border: 0; background: none; box-shadow: none;
  color: var(--text); font-size: .98rem; font-weight: 700;
}
.ux-group-title:hover .ux-group-name { text-decoration: underline; text-underline-offset: 4px; }
.ux-group-meta { font-size: .8rem; color: var(--text-faint); }
.ux-group-add { flex: none; margin-inline-start: auto; min-height: 34px; padding: 4px 12px; font-size: .82rem; font-weight: 650; white-space: nowrap; }
.ux-group-empty {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px var(--space-3);
  width: 100%; min-height: 56px; padding: 10px var(--space-4); border: 1.5px dashed var(--border-strong, var(--border)); border-radius: var(--radius-lg);
  background: none; box-shadow: none; color: var(--text-muted); font-size: .86rem; font-weight: 400; text-align: start;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.ux-group-empty:hover { background: var(--surface-sunken); border-color: var(--brand-primary, var(--odpo-ink)); }
.ux-group-empty:active { transform: none; }
.ux-group-empty-cta { font-weight: 650; color: var(--brand-primary, var(--odpo-ink)); }
.ux-group-empty-cta::before { content: "+ "; }
.ux-units {
  display: grid; margin: 0; padding: 0; list-style: none; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.ux-units > li + li { border-top: 1px solid var(--border); }
.ux-unit {
  display: grid; grid-template-columns: auto minmax(120px, .9fr) minmax(0, 1.4fr) auto auto; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 64px; padding: 10px var(--space-4); border: 0; border-radius: 0;
  background: none; box-shadow: none; color: var(--text); font-weight: 400; text-align: start;
  transition: background-color .15s var(--ease);
}
.ux-unit:hover { background: var(--surface-sunken); }
.ux-unit:active { transform: none; }
.ux-unit:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: -2px; }
.ux-unit-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 7%, var(--surface)); color: var(--brand-primary, var(--odpo-ink)); }
.ux-unit-icon svg { width: 17px; height: 17px; }
/* A unit with photos shows its cover instead of the kind icon. */
.ux-unit-thumb { overflow: hidden; width: 44px; height: 44px; padding: 0; background: var(--surface-sunken); }
.ux-unit-thumb img, .ux-sheet-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ux-unit-id { display: grid; gap: 1px; min-width: 0; }
.ux-unit-code { font-size: .98rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ux-unit-sub { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ux-unit-specs { overflow: hidden; font-size: .78rem; line-height: 1.5; color: var(--text-muted); text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ux-unit-states { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.ux-unit-go { display: grid; place-items: center; color: var(--text-faint); }
.ux-unit-go svg { width: 16px; height: 16px; transform: scaleX(-1); }
[dir="ltr"] .ux-unit-go svg { transform: none; }
.ux-unit:hover .ux-unit-go { color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
  .ux-unit.is-new { animation: ux-new 2.4s var(--ease) 1; }
  @keyframes ux-new { 0%, 35% { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); } 100% { background: transparent; } }
}

/* Empty, welcome, loading */
.ux-empty {
  display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-7) var(--space-5); text-align: center;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px dashed var(--border-strong);
}
.ux-empty-compact { padding: var(--space-5); }
.ux-empty-icon, .ux-welcome-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: var(--space-2); border-radius: 14px; background: var(--surface-sunken); color: var(--text-muted); }
.ux-empty b { font-size: 1rem; }
.ux-empty p { max-width: 44ch; margin: 0 0 var(--space-2); font-size: .86rem; color: var(--text-muted); }
.ux-welcome {
  display: grid; justify-items: start; gap: var(--space-3); max-width: 760px; padding: var(--space-6);
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.ux-welcome h2 { margin: 0; font-size: 1.4rem; }
.ux-welcome p { margin: 0; color: var(--text-muted); }
.ux-shapes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); width: 100%; margin: 0; padding: 0; list-style: none; }
.ux-shapes li { display: flex; align-items: center; gap: 10px; padding: 10px var(--space-3); border-radius: var(--radius); background: var(--surface-sunken); font-size: .88rem; }
.ux-shapes svg { width: 18px; height: 18px; color: var(--brand-primary, var(--odpo-ink)); }
.ux-shapes li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ux-welcome-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.ux-skeleton { display: grid; gap: var(--space-4); max-width: 1240px; }
.ux-skeleton span { display: block; border-radius: var(--radius-lg); background: var(--surface-sunken); }
.ux-skeleton-pulse { height: 96px; }
.ux-skeleton-body { display: grid; grid-template-columns: 280px 1fr; gap: var(--space-5); }
.ux-skeleton-nav { height: 360px; }
.ux-skeleton-list { height: 420px; }
@media (prefers-reduced-motion: no-preference) {
  .ux-skeleton span { animation: ux-pulse 1.4s ease-in-out infinite; }
  @keyframes ux-pulse { 50% { opacity: .55; } }
}

/* The side sheet */
.ux-sheet-backdrop { position: fixed; inset: 0; z-index: 899; background: rgba(23, 23, 42, .32); }
.ux-sheet {
  --ux-from: -28px;
  position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 900; display: flex; flex-direction: column;
  width: min(580px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); outline: none;
}
[dir="ltr"] .ux-sheet { --ux-from: 28px; }
@media (prefers-reduced-motion: no-preference) {
  .ux-sheet { animation: ux-sheet-in .22s var(--ease); }
  .ux-sheet-backdrop { animation: ux-fade .22s var(--ease); }
  @keyframes ux-sheet-in { from { opacity: 0; transform: translateX(var(--ux-from)); } to { opacity: 1; transform: none; } }
  @keyframes ux-fade { from { opacity: 0; } }
}
.ux-sheet-head { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-5) var(--space-5) var(--space-4); border-bottom: 1px solid var(--border); }
.ux-sheet-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-primary, var(--odpo-ink)); color: #fff; }
.ux-sheet-icon svg { width: 20px; height: 20px; }
.ux-sheet-thumb { overflow: hidden; background: var(--surface-sunken); }

/* A map location field (Shared/LocationField.razor) and "on the map" links. */
.loc-field { display: grid; gap: 6px; margin: var(--space-3) 0; }
.loc-label { font-size: .86rem; font-weight: 600; color: var(--text); }
.loc-input { display: flex; flex-wrap: wrap; gap: 6px; }
.loc-input .loc-text { flex: 1 1 220px; min-width: 0; }
.loc-input button { min-height: 40px; padding: 6px 12px; font-size: .84rem; white-space: nowrap; }
.loc-here { display: inline-flex; align-items: center; gap: 6px; }
.loc-here svg { width: 16px; height: 16px; }
.loc-set {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3); padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken);
}
.loc-pin { display: grid; place-items: center; color: var(--brand-primary, var(--odpo-ink)); }
.loc-pin svg { width: 18px; height: 18px; }
.loc-coords { font-variant-numeric: tabular-nums; font-size: .88rem; font-weight: 600; }
.loc-actions { display: flex; flex-wrap: wrap; gap: 4px var(--space-3); margin-inline-start: auto; font-size: .82rem; }
.loc-actions .ux-link { margin: 0; }
.loc-map { width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); }
.loc-hint { margin: 0; font-size: .8rem; color: var(--text-muted); }
.loc-hint .ux-link { font-size: inherit; }
.loc-error { margin: 0; font-size: .82rem; color: var(--danger, #b42318); }
.ux-map-link { display: inline-flex; align-items: center; gap: 4px; width: fit-content; font-size: .82rem; font-weight: 600; color: var(--brand-primary, var(--odpo-ink)); text-underline-offset: 3px; }
.ux-map-link svg { width: 15px; height: 15px; }

/* A unit's photos: the one being looked at, the strip, adding more. */
.ux-photo-stage { margin: 0 0 var(--space-3); overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-sunken); }
.ux-photo-stage img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-sunken); }
.ux-photo-stage figcaption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px var(--space-3);
  padding: 8px var(--space-3); background: var(--surface); font-size: .84rem; color: var(--text-muted);
}
.ux-photo-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ux-photo-tools button { min-height: 34px; padding: 4px 12px; font-size: .82rem; }
.ux-photo-remove { color: var(--danger, #b42318); }
.ux-photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.ux-photo-thumb {
  position: relative; display: block; width: 100%; min-height: 0; padding: 0; overflow: hidden; aspect-ratio: 1;
  border: 2px solid transparent; border-radius: var(--radius); background: var(--surface-sunken); box-shadow: none;
  transition: border-color .15s var(--ease), opacity .15s var(--ease);
}
.ux-photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ux-photo-thumb:not(.is-active) { opacity: .78; }
.ux-photo-thumb:hover { opacity: 1; }
.ux-photo-thumb.is-active { border-color: var(--brand-primary, var(--odpo-ink)); opacity: 1; }
.ux-photo-thumb:active { transform: none; }
.ux-photo-badge {
  position: absolute; inset-inline-start: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px;
  background: var(--brand-primary, var(--odpo-ink)); color: #fff; font-size: .68rem; font-weight: 650;
}
.ux-photo-empty { display: grid; justify-items: center; gap: 4px; padding: var(--space-5) var(--space-4); margin-bottom: var(--space-3); text-align: center; border: 1.5px dashed var(--border-strong, var(--border)); border-radius: var(--radius-lg); }
.ux-photo-empty p { max-width: 40ch; margin: 0; font-size: .86rem; color: var(--text-muted); }
.ux-photo-add-row { display: grid; gap: 6px; justify-items: start; }
.ux-photo-add-row .un-muted, .un-step .ux-photo-add + .ux-photo-files + .un-muted { margin: 0; font-size: .8rem; }
.ux-photo-add {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; cursor: pointer;
  border: 1px solid var(--border-strong, var(--border)); border-radius: var(--radius); background: var(--surface);
  color: var(--brand-primary, var(--odpo-ink)); font-size: .88rem; font-weight: 650;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.ux-photo-add:hover { background: var(--surface-sunken); border-color: var(--brand-primary, var(--odpo-ink)); }
/* While uploading the field stays (its files are being read) but cannot be used again. */
.ux-photo-add.is-busy { opacity: .55; cursor: progress; pointer-events: none; }
.ux-photo-add:focus-within { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.ux-photo-add svg { width: 18px; height: 18px; }
.ux-photo-progress { margin: 0; font-size: .86rem; font-weight: 650; color: var(--text); }
.ux-photo-files { display: grid; gap: 4px; margin: var(--space-2) 0 6px; padding: 0; list-style: none; }
.ux-photo-files li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 6px 10px; border-radius: var(--radius); background: var(--surface-sunken); font-size: .84rem; }
.ux-photo-files li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .ux-photo-thumb, .ux-photo-add { transition: none; } }
.ux-sheet-title { display: grid; gap: 4px; flex: 1 1 auto; min-width: 0; }
.ux-sheet-title h2 { margin: 0; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.ux-sheet-title p { margin: 0; font-size: .84rem; color: var(--text-muted); }
.ux-sheet-states { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ux-sheet-close {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; min-height: 36px; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface-sunken); box-shadow: none; color: var(--text-muted); font-size: 1.3rem; line-height: 1;
}
.ux-sheet-close:hover:not(:disabled) { background: var(--border); color: var(--text); }
.ux-tabs { display: flex; gap: 4px; padding: var(--space-2) var(--space-5) 0; border-bottom: 1px solid var(--border); }
.ux-tab {
  min-height: 40px; margin-bottom: -1px; padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; box-shadow: none; color: var(--text-muted); font-size: .88rem; font-weight: 600;
}
.ux-tab:hover:not(.is-active) { color: var(--text); }
.ux-tab.is-active { border-bottom-color: var(--brand-primary, var(--odpo-ink)); color: var(--text); }
.ux-sheet-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 0; }
.ux-sheet-body { display: grid; align-content: start; gap: var(--space-5); flex: 1 1 auto; min-height: 0; padding: var(--space-5); overflow-y: auto; }
.ux-sheet-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border); background: var(--surface);
}
.ux-sheet-foot button { min-height: 42px; }
.ux-sheet-foot.un-add-foot { justify-content: space-between; }
.ux-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }
.ux-fields .odpo-field { margin: 0; }
.ux-fields input, .ux-fields select { width: 100%; }
.ux-note { margin: 0; font-size: .8rem; line-height: 1.6; color: var(--text-faint); }
.ux-sheet-section { display: grid; gap: var(--space-2); }
.ux-sheet-section h3 { margin: 0; font-size: .95rem; }
.ux-inherited { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: var(--space-3); border-radius: var(--radius); background: var(--surface-sunken); font-size: .82rem; color: var(--text-muted); }
.ux-danger {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--border));
}
.ux-danger b { font-size: .9rem; }
.ux-danger p { margin: 2px 0 0; font-size: .78rem; color: var(--text-muted); }

/* Toast */
.ux-toast {
  position: fixed; inset-block-end: var(--space-5); inset-inline: 0; z-index: 950; display: flex; align-items: center; gap: var(--space-3);
  width: fit-content; max-width: min(560px, calc(100vw - 32px)); margin-inline: auto; padding: 12px 12px 12px 18px; padding-inline: 18px 12px;
  border-radius: 14px; background: var(--odpo-ink); color: #fff; box-shadow: var(--shadow-lg); font-size: .9rem;
}
.ux-toast-close { display: grid; place-items: center; width: 28px; height: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); box-shadow: none; color: #fff; }
.ux-toast-close:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
@media (prefers-reduced-motion: no-preference) {
  .ux-toast { animation: ux-toast-in .25s var(--ease); }
  @keyframes ux-toast-in { from { opacity: 0; transform: translateY(8px); } }
}

/* Shared blocks still used inside the sheet: counts, status, the add-unit steps, choices, assets, facilities */
.un-structure { margin: var(--space-3) 0 0; font-size: .82rem; color: var(--text-faint); }
.un-count {
  display: inline-block; min-width: 1.7em; padding: 0 6px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted);
  font-size: .74rem; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums;
}
.un-add-form { display: grid; gap: var(--space-5); }
.un-step { display: grid; gap: var(--space-3); min-width: 0; margin: 0; padding: 0; border: 0; }
.un-step legend { display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-3); padding: 0; font-size: .95rem; font-weight: 650; }
.un-step-num {
  display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-sunken); color: var(--text-muted); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.un-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.un-choice {
  display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3); cursor: pointer;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.un-choice:hover { border-color: var(--border-strong); background: var(--surface-sunken); }
.un-choice:focus-within { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.un-choice.is-active {
  border-color: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 55%, var(--border));
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 5%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 40%, transparent);
}
.un-choice-icon {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-sunken); color: var(--text-muted);
}
.un-choice.is-active .un-choice-icon { background: var(--brand-primary, var(--odpo-ink)); color: #fff; }
.un-choice-icon svg { width: 17px; height: 17px; }
.un-choice-text { display: grid; gap: 2px; min-width: 0; }
.un-choice-title { font-size: .9rem; font-weight: 650; }
.un-choice-desc { font-size: .78rem; line-height: 1.55; color: var(--text-muted); }
.un-choices-compact .un-choice { padding: 10px var(--space-3); }
/* The place the add sheet was opened from: already chosen, said in words, changeable. */
.un-place-fixed {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3); margin-bottom: var(--space-3);
  padding: 10px var(--space-3); border-radius: var(--radius); background: var(--surface-sunken); font-size: .9rem;
}
.un-place-fixed-icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--surface); color: var(--brand-primary, var(--odpo-ink)); }
.un-place-fixed-icon svg { width: 16px; height: 16px; }
.un-place-fixed-text { flex: 1 1 auto; min-width: 0; font-weight: 650; }
.un-place-fixed .ux-link { margin: 0; font-size: .84rem; }
/* Three side by side: the unit kinds (icon above the text) and a store's three places. */
.un-choices-kinds, .un-choices-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.un-choices-kinds .un-choice { flex-direction: column; gap: var(--space-2); }
.un-choices-kinds.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.un-step-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); align-items: end; }
.un-step .odpo-field { margin: 0; }
.un-step input, .un-step select { width: 100%; }
.un-step-empty {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
  padding: var(--space-3); border-radius: var(--radius); border: 1px dashed var(--border-strong); background: var(--surface-sunken);
}
.un-step-empty p { margin: 0; font-size: .85rem; color: var(--text-muted); }
.un-step-empty button { min-height: 34px; padding: 5px 12px; font-size: .84rem; }
.un-optional { font-weight: 400; color: var(--text-faint); }
.un-add-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding-top: var(--space-4); border-top: 1px solid var(--border);
}
.un-add-summary { margin: 0; font-size: .88rem; color: var(--text-muted); }
.un-add-summary b { color: var(--text); font-weight: 650; }
.un-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted); font-size: .8rem; font-weight: 650; white-space: nowrap;
}
.un-status::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.un-status.is-rented { background: var(--ok-bg); color: var(--ok); }
.un-status.is-maintenance { background: var(--warn-bg); color: var(--warn); }
.un-muted-inline { font-size: .8rem; color: var(--text-faint); }
.un-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.un-actions button { min-height: 32px; padding: 4px 10px; font-size: .84rem; white-space: nowrap; }
.un-asset-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.un-asset {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-sunken);
}
.un-asset-id { display: grid; gap: 1px; min-width: 0; }
.un-asset-meta { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.un-asset-maintenance { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.un-asset-maintenance input { min-width: min(260px, 100%); }
.un-asset-maintenance button { min-height: 34px; padding: 5px 12px; font-size: .84rem; }
.un-assign label { display: block; margin-bottom: 6px; font-size: .84rem; font-weight: 600; }
.un-assign-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.un-assign-row select { flex: 1 1 260px; max-width: 420px; }

/* units → a unit's الأصول tab: furniture and equipment added straight into the unit. */
.ua-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); }
.ua-intro { margin: 0; font-size: .86rem; color: var(--text-muted); }
.ua-add {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 16px;
  border-color: var(--border-strong, var(--border)); color: var(--brand-primary, var(--odpo-ink)); font-size: .88rem; font-weight: 650;
}
.ua-add span { font-size: 1.1rem; line-height: 1; }
.ua-form {
  display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 22%, var(--border));
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 3%, var(--surface));
}
.ua-form h3 { margin: 0; font-size: .95rem; }
.ua-form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ua-empty {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4);
  border: 1.5px dashed var(--border-strong, var(--border)); border-radius: var(--radius-lg); color: var(--text-muted); font-size: .88rem;
}
.ua-empty p { margin: 0; }
.ua-empty-icon {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--surface-sunken); color: var(--brand-primary, var(--odpo-ink));
}
.ua-empty-icon svg { width: 20px; height: 20px; }
.ua-list-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .9rem; }
.ua-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted); font-size: .75rem; font-weight: 650; font-variant-numeric: tabular-nums;
}
.ua-storage { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.ua-storage summary { display: flex; align-items: center; gap: 8px; min-height: 38px; cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--text-muted); }
.ua-storage[open] summary { margin-bottom: var(--space-2); }
.ua-storage summary:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; border-radius: var(--radius-sm); }
@media (max-width: 720px) { .ua-add { width: 100%; justify-content: center; } }
/* An asset's cover beside its name (a button: it opens the photos), and the photos under the row. */
.ua-thumb {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; min-height: 0; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-faint); box-shadow: none;
}
.ua-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ua-thumb svg { width: 20px; height: 20px; }
.ua-thumb:hover:not(:disabled):not([type="submit"]) { border-color: var(--brand-primary, var(--odpo-ink)); box-shadow: none; }
.un-asset .un-asset-id { flex: 1 1 160px; }
.un-asset.is-open { background: var(--surface); border: 1px solid var(--border); }
.ap { flex: 1 1 100%; display: grid; gap: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.ap .odpo-alert { margin: 0; }
.ap-empty { margin: 0; font-size: .86rem; color: var(--text-muted); }
.ap-stage { margin: 0; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-sunken); }
.ap-stage img { display: block; width: 100%; max-height: 320px; object-fit: contain; background: var(--surface-sunken); }
.ap-stage figcaption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px var(--space-3);
  padding: 8px var(--space-3); background: var(--surface); font-size: .84rem; color: var(--text-muted);
}
.ap-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-tools button { min-height: 34px; padding: 4px 12px; font-size: .82rem; }
.ap-remove { color: var(--danger, #b42318); }
.ap-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ap-thumb {
  display: block; width: 100%; min-height: 0; padding: 0; overflow: hidden; aspect-ratio: 1;
  border: 2px solid transparent; border-radius: var(--radius-sm); background: var(--surface-sunken); box-shadow: none;
}
.ap-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ap-thumb:not(.is-active) { opacity: .78; }
.ap-thumb.is-active { border-color: var(--brand-primary, var(--odpo-ink)); opacity: 1; }
.ap-done { margin: 0; font-size: .86rem; font-weight: 600; color: var(--ok); }
/* An asset tag with its barcode button, and the barcode dialog (Shared/AssetBarcodeDialog.razor). */
.bc-tag { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.bc-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; min-height: 0; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: none; box-shadow: none; color: var(--text-muted);
}
.bc-btn:hover:not(:disabled):not([type="submit"]) { border-color: var(--border); background: var(--surface-sunken); color: var(--brand-primary, var(--odpo-ink)); box-shadow: none; }
.bc-btn svg { width: 18px; height: 18px; }
.bc-modal { width: min(420px, calc(100vw - 32px)); }
.bc-label { display: grid; justify-items: center; gap: 6px; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: #000; }
.bc-bars { width: 100%; height: 96px; }
.bc-code { font: 700 1.25rem ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; }
.bc-name { font-size: .88rem; }
.bc-hint { margin: var(--space-2) 0 0; font-size: .82rem; color: var(--text-muted); }
.ua-tag-row { display: flex; align-items: center; gap: 6px; }
.ua-tag-row input { flex: 1 1 auto; min-width: 0; }
.ua-tag-row .bc-btn { flex: none; width: 40px; height: 40px; border-color: var(--border-strong, var(--border)); }
/* /assets: the add form asks where the asset goes (a unit or the storehouse); the list says where each is. */
.as-add { display: grid; gap: var(--space-4); max-width: 960px; }
.as-add .un-step { margin: 0; }
.as-add .un-step legend { margin-bottom: var(--space-2); font-weight: 650; }
.as-add .odpo-alert { margin: 0; }
.as-unit-field { margin: var(--space-3) 0 0; max-width: 420px; }
.as-unit-field select { width: 100%; }
.as-place { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.as-place svg { width: 13px; height: 13px; }
@media (max-width: 720px) { .as-add .un-choices { grid-template-columns: minmax(0, 1fr); } }
/* /assets: one unit's assets (the unit filter), and the unit pill that leads there. */
.as-unit-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.as-unit-summary-icon {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 9%, var(--surface)); color: var(--brand-primary, var(--odpo-ink));
}
.as-unit-summary-icon svg { width: 18px; height: 18px; }
.as-unit-summary-text { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; }
.as-unit-summary-text span { font-size: .84rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.as-place-link { min-height: 0; border: 0; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; box-shadow: none; }
.as-place-link:hover:not(:disabled):not([type="submit"]) { text-decoration: underline; box-shadow: none; background: var(--ok-bg); }
/* An asset's purchase receipts (Shared/AssetReceipts.razor), under its row like its photos. */
.ar { flex: 1 1 100%; display: grid; gap: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.ar .odpo-alert { margin: 0; }
.ar-empty { margin: 0; font-size: .86rem; color: var(--text-muted); }
.ar-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ar-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.ar-file { display: flex; align-items: center; gap: var(--space-3); min-width: 0; color: var(--text); text-decoration: none; }
.ar-file:hover .ar-name bdi { text-decoration: underline; }
.ar-file:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; border-radius: var(--radius-sm); }
.ar-thumb {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--brand-primary, var(--odpo-ink));
}
.ar-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ar-thumb-doc { align-content: center; gap: 0; }
.ar-thumb-doc svg { width: 18px; height: 18px; }
.ar-thumb-doc b { font-size: .62rem; letter-spacing: .04em; }
.ar-name { display: grid; gap: 1px; min-width: 0; font-size: .88rem; font-weight: 600; }
.ar-name bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-meta { font-size: .76rem; font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ar-remove { flex: none; min-height: 34px; padding: 4px 12px; font-size: .82rem; color: var(--danger, #b42318); }
.as-photos-row .ar { position: sticky; inset-inline-start: 0; width: min(640px, calc(100vw - 72px)); border-top: 0; padding-top: 0; }
/* /assets: each asset's cover in the first column, its photos in a row under it. */
.as-thumb-cell { width: 64px; }
.as-thumb-cell .ua-thumb { width: 44px; height: 44px; }
.as-row-open > td { background: var(--surface-sunken); }
.as-photos-row > td { padding: var(--space-3) var(--space-4) var(--space-4); background: var(--surface-sunken); }
/* The table scrolls sideways on a phone; the panel stays in view, as wide as the screen allows. */
.as-photos-row .ap {
  position: sticky; inset-inline-start: 0; width: min(640px, calc(100vw - 72px));
  border-top: 0; padding-top: 0;
}
.un-muted { margin: 0; font-size: .85rem; color: var(--text-muted); }
.un-facilities { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.un-facility {
  padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 7%, var(--surface)); color: var(--text-muted);
}

@media (max-width: 1100px) {
  .ux-pulse { grid-template-columns: auto minmax(0, 1fr); }
  .ux-pulse-structure { grid-column: 1 / -1; white-space: normal; }
}
@media (max-width: 900px) {
  .ux-workspace, .ux-skeleton-body { grid-template-columns: minmax(0, 1fr); }
  .ux-places { position: static; }
  .ux-places-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin-bottom: var(--space-2);
    padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); box-shadow: none;
    color: var(--text); font-weight: 650;
  }
  .ux-places-toggle-hint { font-size: .8rem; font-weight: 500; color: var(--text-muted); }
  .ux-place-list.is-collapsed { display: none; }
  .ux-place-list { max-height: none; }
  .ux-unit { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 6px; }
  .ux-unit-specs { grid-column: 2 / -1; grid-row: 2; }
  .ux-unit-go { display: none; }
}
@media (max-width: 640px) {
  .ux-head { align-items: stretch; }
  .ux-primary { width: 100%; }
  .ux-pulse { grid-template-columns: minmax(0, 1fr); padding: var(--space-4); }
  .ux-unit { grid-template-columns: auto minmax(0, 1fr); padding: 12px var(--space-3); }
  .ux-unit-states { grid-column: 2; justify-content: flex-start; }
  .ux-unit-specs { grid-row: auto; }
  .ux-sheet { width: 100vw; }
  .ux-sheet-head, .ux-sheet-body, .ux-sheet-foot { padding-inline: var(--space-4); }
  .ux-tabs { padding-inline: var(--space-4); overflow-x: auto; }
  .un-choices, .ux-shapes { grid-template-columns: minmax(0, 1fr); }
  .un-choices-kinds .un-choice { flex-direction: row; }
  .un-choices-kinds.is-two { grid-template-columns: minmax(0, 1fr); }
  .ux-welcome { padding: var(--space-5); }
}
@media (prefers-reduced-motion: reduce) {
  .ux-place, .ux-unit, .un-choice { transition: none; }
}

/* contracts → new contract: where the rent came from (the unit's asking price in marketing). */
.ct-rent-hint, .ct-choice-hint { margin: 6px 0 0; font-size: .8rem; line-height: 1.5; color: var(--text-muted); }
.ct-rent-hint .ux-link { font-weight: 600; }
/* contracts → new contract / edit: نوع الإيجار and what the rent includes, as chips. */
.ct-choice { min-width: 0; margin: 0; padding: 0; border: 0; }
.ct-choice legend { margin-bottom: 6px; padding: 0; font-size: .855rem; font-weight: 550; color: var(--text-muted); }
.ct-choice .odpo-toggle-option { min-height: 38px; box-sizing: border-box; }
.odpo-toggle-option input[type="checkbox"] { margin: 0; width: 15px; height: 15px; }
.odpo-edit-grid > .ct-choice-half { grid-column: span 2; }
@media (max-width: 560px) {
  .odpo-edit-grid > .ct-choice-half { grid-column: 1 / -1; }
}
.ct-sub { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ct-meter {
  display: block; inline-size: 100%; max-inline-size: 190px; height: 4px; margin-top: 5px;
  border-radius: 2px; overflow: hidden; background: color-mix(in srgb, var(--ok) 14%, var(--surface-sunken));
}
.ct-meter > span { display: block; height: 100%; border-radius: 2px; background: var(--ok); }
.ct-meter.is-soon { background: color-mix(in srgb, var(--warn) 16%, var(--surface-sunken)); }
.ct-meter.is-soon > span { background: var(--warn); }
.ct-meter.is-over { background: color-mix(in srgb, var(--danger) 14%, var(--surface-sunken)); }
.ct-meter.is-over > span { background: var(--danger); }
.ct-flag { margin-top: 5px; }
td.ct-rent { font-weight: 600; }

.ct-doc-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-sm);
  font-size: .84rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.ct-doc-link:hover { background: var(--surface-sunken); }
.ct-doc-link svg { width: 16px; height: 16px; }

/* The move-out inventory. */
.ct-inventory { max-width: 760px; margin: var(--space-4) 0; padding: var(--space-5); }
.ct-inventory-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4);
}
.ct-inventory-head h3 { margin: 0; font-size: 1.05rem; }
.ct-inventory-head p { margin: 4px 0 0; font-size: .85rem; color: var(--text-muted); }
.ct-inventory .odpo-alert { margin-bottom: var(--space-3); }
.ct-inv-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ct-inv-item { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); }
.ct-inv-item.is-missing { background: var(--danger-bg); }
.ct-inv-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); }
.ct-inv-id { display: grid; gap: 2px; min-width: 0; }
.ct-inv-meta { font-size: .78rem; color: var(--text-muted); }
.ct-inv-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-3); margin-top: var(--space-3); }
.ct-inv-fields .odpo-field { margin: 0; }
.ct-inv-fields input, .ct-inv-fields select { width: 100%; }
.ct-inv-note:only-child { grid-column: 1 / -1; }
.ct-inv-done { margin: var(--space-2) 0 0; font-size: .82rem; color: var(--ok); }
.ct-inv-maintenance { margin-top: var(--space-2); min-height: 34px; padding: 5px 12px; font-size: .84rem; }
.ct-inv-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
/* The handover asked for on the way to ending a contract: the same warm edge as the rating callout. */
.ct-inventory.is-required { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.ct-inventory-head .ct-inventory-intro { margin-top: var(--space-2); color: var(--text); font-size: .88rem; max-width: 60ch; }
.ct-handover-note { margin: var(--space-3) 0 0; }
/* Handover photos: of an asset needing maintenance / damaged (inside its row), and of the unit. */
.ct-ho-unit { margin-top: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); }
.ct-ho-unit h4 { margin: 0 0 var(--space-2); font-size: .95rem; }
.ct-ho-photos { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.ct-ho-unit .ct-ho-photos { margin-top: 0; }
.ct-ho-photos-label { font-size: .855rem; font-weight: 550; color: var(--text-muted); }
.ct-ho-thumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ct-ho-thumbs li { position: relative; }
.ct-ho-thumbs img { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.ct-ho-remove {
  position: absolute; inset-block-start: -8px; inset-inline-end: -8px; width: 26px; height: 26px; padding: 0;
  border-radius: 999px; border: 1px solid var(--border-strong, var(--border)); background: var(--surface);
  color: var(--text); font-size: 1rem; line-height: 1; cursor: pointer;
}
.ct-ho-remove::after { content: ""; position: absolute; inset: -6px; }   /* a 38px touch target around the small badge */
.ct-ho-remove:hover { color: var(--danger); border-color: var(--danger); }
.ct-ho-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ct-ho-add-row .ux-photo-add { background: var(--surface); }
.ct-ho-photos.is-missing .ux-photo-add { border-color: var(--danger); }
.ct-ho-missing { margin: 0; font-size: .82rem; font-weight: 600; color: var(--danger); }
.ct-handover-note textarea { width: 100%; resize: vertical; }
/* contracts list: the handover record («محضر الاستلام»), read only, under its row. Live or ended. The
   row panel is already the sunken surface, so the unit block and the asset cards sit on the raised one. */
.ct-ho-record { max-width: 820px; }
.ct-ho-stamp { margin: var(--space-2) 0 var(--space-4); font-size: .9rem; }
.ct-ho-record .ct-ho-unit { margin-top: 0; background: var(--surface); border: 1px solid var(--border); }
.ct-ho-record .ct-inv-item { background: var(--surface); border: 1px solid var(--border); }
.ct-ho-record .ct-inv-item.is-missing { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); }
.ct-ho-none { margin: 0; font-size: .85rem; }
.ct-ho-note { display: grid; gap: 2px; margin: var(--space-3) 0 0; }
.ct-ho-note dt { font-size: .855rem; font-weight: 550; color: var(--text-muted); }
.ct-ho-note dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.ct-ho-assets { margin-top: var(--space-4); }
.ct-ho-assets-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.ct-ho-assets-head h4 { margin: 0; font-size: .95rem; }
.ct-ho-state { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ct-ho-record .ct-ho-thumbs a { display: block; border-radius: var(--radius-sm); }
.ct-ho-record .ct-ho-thumbs img { width: 88px; height: 88px; transition: opacity .15s; }
.ct-ho-record .ct-ho-thumbs a:hover img { opacity: .85; }
@media (prefers-reduced-motion: reduce) { .ct-ho-record .ct-ho-thumbs img { transition: none; } }

/* ==========================================================================================
   Contracts screen (redesign 2026-10-19), prefix cx-. The page leads with the rent the live
   contracts bring in and the views that need attention; one calm row per contract opens its
   side sheet (the shared .ux-sheet), where everything about it lives.
   ========================================================================================== */
.cx-head { margin-bottom: var(--space-5); }

/* The overview: the rent roll on the brand ink, then the five views as tiles that filter. */
.cx-overview {
  display: grid; grid-template-columns: minmax(230px, 1.1fr) minmax(0, 3.2fr); gap: var(--space-3);
  max-width: 1160px; margin: 0 0 var(--space-6);
}
.cx-roll {
  position: relative; isolation: isolate; display: grid; align-content: center; gap: 8px; min-height: 108px;
  padding: var(--space-5); overflow: hidden; border-radius: var(--radius-lg); color: #fff;
  background:
    radial-gradient(130% 150% at 100% 0%, color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 55%, var(--odpo-violet)) 0%, transparent 62%),
    var(--brand-primary, var(--odpo-ink));
  box-shadow: 0 1px 2px rgba(23, 23, 42, .12), 0 14px 32px -14px color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 70%, transparent);
}
.cx-roll::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--odpo-grain); opacity: .07; pointer-events: none; }
.cx-roll-label { font-size: .84rem; font-weight: 550; color: rgba(255, 255, 255, .74); }
.cx-roll-value { font-size: clamp(1.65rem, 2.4vw, 2.15rem); font-weight: 750; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.cx-roll-value small { font-size: .88rem; font-weight: 600; color: var(--accent-soft); letter-spacing: 0; }
.cx-roll-skeleton { display: block; width: 62%; height: 32px; opacity: .25; }

.cx-views { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.cx-views .cx-view {
  display: grid; align-content: space-between; justify-items: start; gap: var(--space-2); min-height: 108px;
  padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: none; color: var(--text); font-weight: 400; text-align: start;
  transition: border-color .16s var(--ease), background-color .16s var(--ease), box-shadow .16s var(--ease);
}
.cx-views .cx-view:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
.cx-views .cx-view:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.cx-view-count { font-size: 1.65rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.cx-view-label { font-size: .84rem; font-weight: 600; line-height: 1.35; color: var(--text-muted); }
.cx-views .cx-view.is-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 22%, var(--border)); }
.cx-views .cx-view.is-warn .cx-view-count { color: var(--warn); }
.cx-views .cx-view.is-danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 22%, var(--border)); }
.cx-views .cx-view.is-danger .cx-view-count { color: var(--danger); }
.cx-views .cx-view.is-active,
.cx-views .cx-view.is-active:hover:not(:disabled) { border-color: var(--brand-primary, var(--odpo-ink)); box-shadow: inset 0 0 0 1px var(--brand-primary, var(--odpo-ink)); }
.cx-views .cx-view.is-active .cx-view-label { color: var(--text); }

/* The list: its heading, the search, the column labels, the rows. */
.cx-list { max-width: 1160px; }
.cx-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }
.cx-list-head h2 { margin: 0; font-size: 1.15rem; }
.cx-search { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-2); flex: 1 1 420px; justify-content: flex-end; margin-inline-start: auto; }
.cx-search .odpo-search-input { flex: 1 1 240px; max-width: 380px; min-width: 0; }
.cx-search input { min-height: 42px; }
.cx-search button { min-height: 42px; white-space: nowrap; }
.cx-search-hint { flex-basis: 100%; margin: 0; font-size: .78rem; color: var(--text-faint); text-align: end; }

.cx-cols, .cx-rows .cx-row {
  display: grid; align-items: center; gap: var(--space-4);
  grid-template-columns: minmax(110px, .9fr) minmax(140px, 1.15fr) minmax(190px, 1.35fr) minmax(96px, .7fr) minmax(130px, 1fr) 18px;
}
.cx-cols { padding: 0 var(--space-5) var(--space-2); font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.cx-cols .cx-num { text-align: end; }
.cx-rows {
  display: grid; margin: 0; padding: 0; list-style: none; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm);
}
.cx-rows > li + li { border-top: 1px solid var(--border); }
.cx-rows .cx-row {
  width: 100%; min-height: 76px; padding: 14px var(--space-5); border: 0; border-radius: 0;
  background: none; box-shadow: none; color: var(--text); font-weight: 400; text-align: start;
  transition: background-color .15s var(--ease);
}
.cx-rows .cx-row:hover:not(:disabled) { background: var(--surface-sunken); border-color: transparent; box-shadow: none; }
.cx-rows .cx-row:active:not(:disabled) { transform: none; box-shadow: none; }
.cx-rows .cx-row:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: -3px; }
.cx-rows .cx-row.is-open { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 5%, var(--surface)); box-shadow: inset 3px 0 0 var(--brand-primary, var(--odpo-ink)); }
[dir="rtl"] .cx-rows .cx-row.is-open { box-shadow: inset -3px 0 0 var(--brand-primary, var(--odpo-ink)); }
.cx-cell { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.cx-code { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cx-name { max-width: 100%; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cx-sub { font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cx-dates { font-size: .86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-term .ct-meter { margin-top: 2px; }
.cx-term .ct-flag { margin-top: 2px; }
.cx-rent { justify-items: end; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-rent small, .cx-fact-big small { font-size: .78rem; font-weight: 500; color: var(--text-muted); }
.cx-state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cx-mark { display: inline-flex; align-items: center; gap: 4px; font-size: .76rem; font-weight: 600; color: var(--ok); white-space: nowrap; }
.cx-mark svg { width: 13px; height: 13px; }
.cx-mark.is-warn { color: var(--warn); }
.cx-go { display: grid; place-items: center; color: var(--text-faint); transition: transform .15s var(--ease), color .15s var(--ease); }
.cx-go svg { width: 16px; height: 16px; }
[dir="rtl"] .cx-go svg { transform: scaleX(-1); }
.cx-rows .cx-row:hover .cx-go { color: var(--text); transform: translateX(2px); }
[dir="rtl"] .cx-rows .cx-row:hover .cx-go { transform: translateX(-2px); }

/* An ended contract is history: the same row, read quieter, so the live ones stand out. */
.cx-rows .cx-row.is-ended .cx-code,
.cx-rows .cx-row.is-ended .cx-name,
.cx-rows .cx-row.is-ended .cx-dates,
.cx-rows .cx-row.is-ended .cx-rent { color: var(--text-muted); font-weight: 550; }

.cx-rows .cx-row.is-skeleton { cursor: default; }
.cx-rows .cx-row.is-skeleton .odpo-skeleton { display: block; height: 12px; }
.cx-empty { max-width: 1160px; }
.cx-empty button { margin-top: var(--space-4); }
.cx-empty .odpo-subtle { margin-top: var(--space-2); }
.cx-page-flow { max-width: 760px; margin: 0 0 var(--space-5); padding: var(--space-5); }

/* The contract's sheet. */
.ux-sheet.cx-sheet { width: min(620px, 100vw); }
.ux-sheet.cx-sheet.is-wide { width: min(780px, 100vw); }
.cx-sheet .ux-sheet-body { gap: var(--space-5); grid-auto-rows: max-content; }
.cx-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--border); gap: 1px;
}
.cx-fact { display: grid; align-content: start; gap: 4px; padding: var(--space-3) var(--space-4); background: var(--surface); }
.cx-fact dt { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.cx-fact dd { margin: 0; font-size: .92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cx-fact .cx-fact-big { font-size: 1.35rem; font-weight: 750; line-height: 1.2; }
.cx-fact .cx-fact-meter { display: grid; gap: 4px; font-weight: 400; }
.cx-fact .cx-fact-meter .ct-meter { max-inline-size: none; margin: 0; }
.cx-fact-note { font-size: .76rem; color: var(--text-muted); }

.cx-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cx-actions .cx-action {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: .88rem; font-weight: 600; text-decoration: none; box-shadow: none;
}
.cx-actions a.cx-action { color: var(--brand-primary, var(--odpo-ink)); }
.cx-actions .cx-action:hover { background: var(--surface-sunken); border-color: var(--odpo-ink-soft); }
.cx-actions .cx-action svg { width: 16px; height: 16px; }
.cx-tabs { padding-inline: 0; }
.cx-tabpanel { padding-top: var(--space-4); }
.cx-tabpanel .odpo-detail-list { margin: 0; }
.cx-tabpanel .odpo-docs { margin-top: var(--space-4); }
.cx-ho-title { margin: 0 0 var(--space-1); font-size: 1rem; }
.cx-ho-empty {
  display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-5) var(--space-4); text-align: center;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
}
.cx-ho-empty p { max-width: 42ch; margin: 0; font-size: .88rem; color: var(--text-muted); }
.cx-ho-empty-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-sunken); color: var(--text-muted); }
.cx-ho-empty-icon svg { width: 18px; height: 18px; }
.cx-danger { display: grid; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.cx-danger .ux-danger { border-color: var(--border); }
.cx-danger .cx-delete { color: var(--danger); }
.cx-danger .cx-delete:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); border-color: transparent; box-shadow: none; }
.cx-edit .ux-sheet-body > h3 { margin: 0; font-size: 1rem; }
.cx-edit .odpo-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-money { white-space: nowrap; }

/* The tenant's rating of the company when a contract ends: five stars in the accent gold, the
   overview's average, the tenant's prompt above their list, and the section in the sheet. */
.cx-roll-rating {
  display: grid; gap: 4px; margin-top: var(--space-2); padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, .16);
}
.cx-roll-rating-value { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.cx-roll-rating-value svg { align-self: center; width: 18px; height: 18px; color: var(--accent); fill: currentColor; }
.cx-roll-rating-value b { font-size: 1.2rem; font-weight: 750; }
.cx-roll-rating-value small { font-size: .8rem; font-weight: 550; color: rgba(255, 255, 255, .74); }
.cx-roll-rating-none { font-size: .84rem; color: rgba(255, 255, 255, .86); }

.cx-mark.cx-mark-star { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cx-mark.cx-mark-star svg { color: var(--accent); fill: currentColor; }

.cx-rate-prompt {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3) var(--space-4);
  max-width: 1160px; margin: 0 0 var(--space-5); padding: var(--space-4) var(--space-5);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border)); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: var(--shadow-sm);
}
.cx-rate-prompt-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface); color: var(--accent); }
.cx-rate-prompt-icon svg { width: 22px; height: 22px; fill: currentColor; }
.cx-rate-prompt-text h2 { margin: 0 0 2px; font-size: 1.02rem; }
.cx-rate-prompt-text p { margin: 0; font-size: .88rem; color: var(--text-muted); }
.cx-rate-prompt .odpo-btn-primary { min-height: 42px; white-space: nowrap; }

.cx-rating { display: grid; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.cx-rating h3 { margin: 0; font-size: 1rem; }
.cx-rating.is-form { gap: var(--space-3); border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.cx-rating-note, .cx-rating-none { margin: 0; font-size: .86rem; color: var(--text-muted); }
.cx-rating-result { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3); margin: 0; }
.cx-rating-comment {
  margin: 0; padding: var(--space-2) var(--space-3); border-inline-start: 3px solid var(--accent);
  background: var(--surface-sunken); border-radius: var(--radius-sm); font-size: .9rem; white-space: pre-line;
}
.cx-stars { display: inline-flex; gap: 2px; }
.cx-star { display: inline-grid; color: var(--border-strong); }
.cx-star svg { width: 18px; height: 18px; }
.cx-star.is-on { color: var(--accent); }
.cx-star.is-on svg { fill: currentColor; }

.cx-stars-input { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 0; border: 0; min-width: 0; }
.cx-star-opt {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin: 0;
  border-radius: var(--radius-sm); color: var(--border-strong); cursor: pointer;
  transition: color .12s var(--ease), transform .12s var(--ease);
}
.cx-star-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.cx-star-opt svg { width: 30px; height: 30px; pointer-events: none; }
.cx-star-opt.is-on { color: var(--accent); }
.cx-star-opt.is-on svg { fill: currentColor; }
/* Hovering previews the count: the hovered star and those before it light up, the rest go quiet. */
.cx-stars-input:hover .cx-star-opt { color: var(--accent); }
.cx-stars-input:hover .cx-star-opt svg { fill: currentColor; }
.cx-stars-input .cx-star-opt:hover ~ .cx-star-opt { color: var(--border-strong); }
.cx-stars-input .cx-star-opt:hover ~ .cx-star-opt svg { fill: none; }
.cx-star-opt:hover { transform: scale(1.08); }
.cx-star-opt:has(input:focus-visible) { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 1px; }
.cx-stars-word { margin-inline-start: var(--space-2); font-size: .92rem; font-weight: 650; }
.cx-rating textarea { width: 100%; }
.cx-rating-actions { display: flex; gap: var(--space-2); }
@media (prefers-reduced-motion: reduce) { .cx-star-opt { transition: none; } .cx-star-opt:hover { transform: none; } }
@media (max-width: 640px) {
  .cx-rate-prompt { grid-template-columns: auto minmax(0, 1fr); }
  .cx-rate-prompt .odpo-btn-primary { grid-column: 1 / -1; width: 100%; }
}

/* A flow inside the sheet (the handover, the rating) is the sheet's body, not a card in it. */
.ux-sheet .cx-flow.ct-inventory { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none; }
.ux-sheet .cx-flow .odpo-register-grid { grid-template-columns: minmax(0, 1fr); }
.ux-sheet .odpo-create-contract { max-width: none; }

@media (prefers-reduced-motion: reduce) {
  .cx-views .cx-view, .cx-rows .cx-row, .cx-go { transition: none; }
}

/* Laptop: the views wrap under the rent roll. */
@media (max-width: 1100px) {
  .cx-overview { grid-template-columns: minmax(0, 1fr); }
  .cx-roll { min-height: 0; }
}

/* Tablet and phone: each contract a compact card, the views a row of chips that scrolls. */
@media (max-width: 760px) {
  .cx-views { display: flex; gap: var(--space-2); margin-inline: calc(-1 * var(--space-4)); padding: 2px var(--space-4) 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .cx-views::-webkit-scrollbar { display: none; }
  .cx-views .cx-view { flex: 0 0 auto; min-height: 0; min-width: 116px; padding: 10px 14px; scroll-snap-align: start; }
  .cx-view-count { font-size: 1.3rem; }
  .cx-search { flex-basis: 100%; justify-content: flex-start; }
  .cx-search .odpo-search-input { max-width: none; }
  .cx-search-hint { text-align: start; }
  .cx-cols { display: none; }
  .cx-rows .cx-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "unit state" "tenant tenant" "term rent";
    gap: 8px var(--space-3); min-height: 0; padding: 14px var(--space-4);
  }
  .cx-unit { grid-area: unit; }
  .cx-state { grid-area: state; justify-content: flex-end; align-self: start; }
  .cx-tenant { grid-area: tenant; grid-template-columns: auto auto; justify-content: start; align-items: baseline; gap: 8px; }
  .cx-term { grid-area: term; }
  .cx-rent { grid-area: rent; align-self: end; }
  .cx-go { display: none; }
  .cx-rows .cx-row.is-skeleton { grid-template-areas: none; grid-template-columns: 1fr; }
  .cx-facts { grid-template-columns: minmax(0, 1fr); }
}
/* contracts list: an active contract whose unit was already received (handover done ahead of the end). */
.ct-handed-over { white-space: nowrap; }
.ct-muted { color: var(--text-muted); }

.odpo-create-contract { max-width: 1160px; }

/* On a phone an asset's handover fields stack. */
@media (max-width: 720px) {
  .ct-inv-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Reports → unit rent history: the period choice as an inline pair, the one-line answer for
   "on this date", and rent changes coloured AND signed (+/−) so colour is never the only cue. */
.odpo-history-period { border: none; padding: 0; margin: 0; min-width: 0; }
.odpo-history-period legend { font-size: .85rem; font-weight: 600; color: var(--text-muted); padding: 0; margin-bottom: 6px; }
.odpo-history-period label { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 16px; font-weight: 400; color: var(--text); min-height: 40px; }
.odpo-history-answer {
  margin: var(--space-4) 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 7%, var(--surface));
  font-weight: 600;
}
.odpo-change-up { color: var(--ok, #157347); font-weight: 600; }
.odpo-change-down { color: var(--danger, #b42318); font-weight: 600; }

/* A 1–10 score picked from a row of numbered chips (the tenant rating form, and the platform
   rule that sets from which score a note is optional). Radios underneath, so arrow keys move
   along the scale and a screen reader announces "3 of 10". Always left-to-right, low to high. */
.odpo-score-scale { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; justify-content: flex-end; }
[dir="ltr"] .odpo-score-scale { justify-content: flex-start; }
.odpo-score-option { position: relative; margin: 0; }
.odpo-score-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.odpo-score-option span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.odpo-score-option:hover span { background: var(--surface-sunken); }
.odpo-score-option input:checked + span {
  border-color: var(--brand-secondary, var(--odpo-violet));
  background: var(--brand-secondary, var(--odpo-violet));
  color: #fff;
}
.odpo-score-option input:focus-visible + span {
  outline: 2px solid var(--brand-secondary, var(--odpo-violet));
  outline-offset: 2px;
}
.odpo-alert-info { background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 8%, var(--surface)); color: var(--text); }

/* Several settings cards on one page (tenant rating settings): a gap between them, so each
   reads as its own switch rather than one long panel. */
.odpo-settings-card + .odpo-settings-card { margin-top: var(--space-4); }
/* settings/otp: one settings card per action that sends a one-time code. */
.otp-list { display: grid; gap: var(--space-4); }
.otp-list .odpo-settings-card + .odpo-settings-card { margin-top: 0; }
.otp-about { max-width: 62ch; margin: 0 0 var(--space-4); text-wrap: pretty; }
.otp-footnote { max-width: 620px; margin-top: var(--space-5); font-size: .86rem; text-wrap: pretty; }

/* ==========================================================================
   Pages/TenantRatingSettingsPage.razor — tenant rating settings.
   Two groups whose nested settings visibly hang off their master switch (a connector line on
   the start edge), a live "what happens now" panel beside them, and a sticky save bar that
   counts unsaved changes. Built only from the theme's tokens; logical properties throughout.
   ========================================================================== */
.trs-intro { margin-bottom: var(--space-5); text-wrap: pretty; }
.trs-alert { max-width: 1080px; }

.trs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: var(--space-5);
  align-items: start;
  max-width: 1080px;
}
.trs-main { display: grid; gap: var(--space-5); min-width: 0; }

.trs-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5) var(--space-5) var(--space-4);
}
.trs-group-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.trs-group-head h2 { margin: 0; font-size: 1.02rem; font-weight: 700; letter-spacing: -.005em; }
.trs-group-step {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 8px;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 8%, transparent);
  color: var(--brand-primary, var(--odpo-ink));
  font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* A setting: what it is and what it does now on the start side, its control on the end side. */
.trs-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-4) 0;
}
.trs-row + .trs-row { border-top: 1px solid var(--border); }
.trs-row-master { padding-top: var(--space-3); }
.trs-row-stack { grid-template-columns: minmax(0, 1fr); }
.trs-row:has(.trs-segmented) { grid-template-columns: minmax(0, 1fr) auto; }
.trs-row-text { min-width: 0; }
.trs-row-title {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0; font-size: .95rem; font-weight: 600; color: var(--text); cursor: default;
}
label.trs-row-title { cursor: pointer; }
.trs-row-desc {
  margin: 4px 0 0; max-width: 62ch;
  font-size: .84rem; line-height: 1.65; color: var(--text-muted); text-wrap: pretty;
}

/* "مُعدَّل" — this row differs from what is saved. A flag, not a pill. */
.trs-changed {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 600; color: var(--warn);
}
.trs-changed::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.trs-state { font-size: .8rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.trs-state.is-on { color: var(--ok); }

/* ---- switch (a checkbox with role="switch") ---- */
.trs-switch { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.trs-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.trs-switch-track {
  position: relative; width: 46px; height: 26px; border-radius: 999px;
  background: var(--border-strong);
  transition: background .2s var(--ease);
}
.trs-switch-thumb {
  position: absolute; top: 3px; inset-inline-start: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 23, 42, .25), 0 2px 6px rgba(23, 23, 42, .12);
  transition: transform .22s cubic-bezier(.3, 1.4, .5, 1);
}
.trs-switch input:checked + .trs-switch-track { background: var(--brand-secondary, var(--odpo-violet)); }
.trs-switch input:checked + .trs-switch-track .trs-switch-thumb { transform: translateX(20px); }
[dir="rtl"] .trs-switch input:checked + .trs-switch-track .trs-switch-thumb { transform: translateX(-20px); }
.trs-switch input:focus-visible + .trs-switch-track {
  outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 3px;
}
.trs-switch:active .trs-switch-thumb { width: 23px; }
.trs-switch input:disabled + .trs-switch-track { opacity: .55; }

/* ---- the nested settings hang off their master switch ---- */
.trs-nested {
  position: relative;
  margin: 0 0 var(--space-1);
  padding: 0 0 0;
  padding-inline-start: var(--space-5);
  border: 0;
  min-width: 0;
  transition: opacity .2s var(--ease);
}
.trs-nested::before {
  content: ""; position: absolute; top: 4px; bottom: 18px; inset-inline-start: 8px;
  width: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 22%, var(--border));
}
.trs-nested > .trs-row:first-of-type { border-top: 1px solid var(--border); }
.trs-nested.is-off { opacity: .48; }
.trs-nested.is-off::before { background: var(--border); }
.trs-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- segmented control: optional / mandatory ---- */
.trs-segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 10px;
}
.trs-segment { position: relative; margin: 0; }
.trs-segment input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.trs-segment span {
  display: block; padding: 7px 14px; border-radius: 7px;
  font-size: .82rem; font-weight: 600; color: var(--text-muted); white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.trs-segment:hover span { color: var(--text); }
.trs-segment input:checked + span {
  background: var(--surface); color: var(--brand-secondary, var(--odpo-violet));
  box-shadow: 0 1px 2px rgba(23, 23, 42, .08), 0 2px 8px -2px rgba(23, 23, 42, .10);
}
.trs-segment input:focus-visible + span { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 1px; }
fieldset:disabled .trs-segment input { cursor: not-allowed; }

/* ---- the 1–10 band: which scores need a note ---- */
.trs-band {
  display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px;
  direction: ltr; margin-top: var(--space-3);
}
.trs-band-cell { position: relative; margin: 0; }
.trs-band-cell input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.trs-band-cell span {
  display: grid; place-items: center; height: 44px; border-radius: 8px;
  font-weight: 650; font-variant-numeric: tabular-nums; font-size: .92rem;
  transition: background .18s var(--ease), color .18s var(--ease), transform .12s var(--ease);
}
.trs-band-cell.is-required span { background: color-mix(in srgb, var(--warn) 13%, var(--surface)); color: var(--warn); }
.trs-band-cell.is-optional span { background: color-mix(in srgb, var(--ok) 9%, var(--surface)); color: var(--ok); }
.trs-band-cell.is-threshold span {
  background: var(--brand-secondary, var(--odpo-violet)); color: #fff;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 70%, transparent);
}
.trs-band-cell:hover span { transform: translateY(-1px); }
.trs-band-cell:active span { transform: translateY(0) scale(.97); }
.trs-band-cell input:focus-visible + span { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
fieldset:disabled .trs-band-cell span { transform: none; }
.trs-band-legend { display: flex; gap: var(--space-4); margin-top: var(--space-2); font-size: .76rem; color: var(--text-muted); }
.trs-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.trs-legend-item::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.trs-legend-item.is-required::before { background: color-mix(in srgb, var(--warn) 35%, var(--surface)); }
.trs-legend-item.is-optional::before { background: color-mix(in srgb, var(--ok) 30%, var(--surface)); }

/* ---- what happens now ---- */
.trs-impact {
  position: sticky; top: var(--space-5);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 9%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 14%, var(--border));
  box-shadow: var(--shadow-sm);
}
.trs-impact-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-4); }
.trs-impact-head h2 { margin: 0; font-size: .98rem; font-weight: 700; }
.trs-impact-badge { font-size: .7rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.trs-impact-badge.is-preview { color: var(--warn); }
.trs-impact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.trs-impact-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.trs-impact-list b { display: block; font-size: .84rem; font-weight: 650; }
.trs-impact-list p { margin: 3px 0 0; font-size: .82rem; line-height: 1.65; color: var(--text-muted); text-wrap: pretty; }
.trs-impact-icon {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 7%, transparent);
  color: var(--brand-primary, var(--odpo-ink));
}
.trs-impact-icon svg { width: 17px; height: 17px; }

/* ---- sticky save bar ---- */
.trs-savebar {
  position: sticky; bottom: var(--space-3); z-index: 4;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4);
  max-width: 1080px; margin-top: var(--space-5); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
/* Only sticks while there is something to save; at rest it sits after the settings and covers nothing. */
.trs-savebar:not(.is-dirty) { position: static; }
.trs-savebar.is-dirty {
  border-color: color-mix(in srgb, var(--warn) 40%, var(--border));
  box-shadow: var(--shadow-lg);
}
.trs-savebar-text { display: grid; gap: 1px; margin: 0; font-size: .8rem; color: var(--text-muted); }
.trs-savebar-text b { font-size: .92rem; color: var(--text); }
.trs-savebar.is-dirty .trs-savebar-text b { color: var(--warn); }
.trs-savebar-actions { display: flex; gap: var(--space-2); }
.trs-undo { background: transparent; box-shadow: none; }

/* ---- loading ---- */
.trs-skeleton {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface-sunken) 25%, color-mix(in srgb, var(--surface-sunken) 40%, var(--surface)) 50%, var(--surface-sunken) 75%);
  background-size: 200% 100%;
  animation: trs-shimmer 1.3s linear infinite;
}
.trs-skeleton-aside { height: 300px; }
@keyframes trs-shimmer { to { background-position: -200% 0; } }

/* ---- narrow screens: one column, the impact panel after the settings ---- */
@media (max-width: 900px) {
  .trs-layout { grid-template-columns: minmax(0, 1fr); }
  .trs-impact { position: static; }
}
@media (max-width: 560px) {
  .trs-group { padding: var(--space-4); }
  .trs-row { grid-template-columns: minmax(0, 1fr) auto; }
  .trs-row .trs-state { display: none; }
  .trs-row:has(.trs-segmented) { grid-template-columns: minmax(0, 1fr); }
  .trs-row.trs-row-stack { grid-template-columns: minmax(0, 1fr); }
  .trs-segmented { width: 100%; }
  .trs-segment { flex: 1; }
  .trs-segment span { text-align: center; padding-inline: 8px; }
  .trs-nested { padding-inline-start: var(--space-4); }
  .trs-band { gap: 3px; }
  .trs-band-cell span { height: 38px; font-size: .84rem; }
}
@media (prefers-reduced-motion: reduce) {
  .trs-switch-track, .trs-switch-thumb, .trs-segment span, .trs-band-cell span, .trs-nested, .trs-savebar { transition: none; }
  .trs-skeleton { animation: none; }
}

/* ==========================================================================
   Pages/Reports.razor — the reports hub.
   Wide screens: a grouped list of reports beside the report itself. Phones: one scrollable
   strip of reports (no wrapping into rows). Every report opens with a header — its name, the
   question it answers, and its export, at the top. Filters sit on a quiet band; KPIs, then
   the table. Only the theme's tokens; logical properties throughout.
   ========================================================================== */
.rpt-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  margin-top: var(--space-4);
}

/* ---- the report list ---- */
.rpt-nav {
  position: sticky; top: var(--space-5);
  display: grid; gap: var(--space-4);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.rpt-nav-group [role="tablist"] { display: grid; gap: 2px; }
.rpt-nav-title {
  margin: 0 0 6px; padding-inline: 10px;
  font-size: .72rem; font-weight: 650; letter-spacing: .02em; color: var(--text-faint);
}
.rpt-nav .rpt-tab {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  border: 0; border-radius: 9px;
  background: transparent; box-shadow: none;
  font-size: .86rem; font-weight: 550; color: var(--text-muted); text-align: start;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.rpt-nav .rpt-tab:hover:not(:disabled):not([type="submit"]) { background: var(--surface-sunken); color: var(--text); }
.rpt-nav .rpt-tab:active:not(:disabled) { transform: none; }
.rpt-tab-icon {
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--surface-sunken); color: var(--text-muted);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.rpt-tab-icon svg { width: 15px; height: 15px; }
.rpt-tab-label { min-width: 0; line-height: 1.35; }
.rpt-nav .rpt-tab.odpo-tab-active {
  background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 8%, var(--surface));
  color: var(--brand-secondary, var(--odpo-violet));
  font-weight: 650;
  border: 0;
}
.rpt-nav .rpt-tab.odpo-tab-active .rpt-tab-icon { background: var(--brand-secondary, var(--odpo-violet)); color: #fff; }
.rpt-nav .rpt-tab:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 1px; }

/* ---- the report ---- */
.rpt-panel { min-width: 0; margin: 0; border-radius: var(--radius-lg); padding: var(--space-5); }
.rpt-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-bottom: var(--space-4); margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.rpt-head-text { min-width: 0; flex: 1 1 320px; }
.rpt-head h2 { margin: 0; font-size: 1.22rem; font-weight: 700; letter-spacing: -.01em; }
.rpt-head p { margin: 6px 0 0; max-width: 68ch; font-size: .86rem; line-height: 1.7; color: var(--text-muted); text-wrap: pretty; }

.rpt-export { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rpt-export-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 10px; min-height: 38px;
  font-size: .84rem; font-weight: 600; white-space: nowrap;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); box-shadow: none;
}
.rpt-export-btn:hover:not(:disabled):not([type="submit"]) {
  background: var(--surface-sunken);
  border-color: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 40%, var(--border-strong));
}
.rpt-file-badge {
  display: grid; place-items: center; height: 20px; padding: 0 5px; border-radius: 4px;
  font-size: .62rem; font-weight: 800; letter-spacing: .04em; color: #fff; direction: ltr;
}
.rpt-file-badge.is-excel { background: #1e7a5a; }
.rpt-file-badge.is-pdf { background: #b3261e; }

/* filters: one quiet band, not loose fields */
.rpt-panel .odpo-form-row {
  align-items: flex-end;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--surface-sunken);
  border-radius: var(--radius);
}
.rpt-panel .odpo-form-row .odpo-field label { font-size: .76rem; }
.rpt-panel .odpo-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.rpt-panel .odpo-kpi { box-shadow: none; }
.rpt-panel table { font-variant-numeric: tabular-nums; }

/* ---- phones and narrow windows ---- */
@media (max-width: 1000px) {
  .rpt-shell { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .rpt-nav {
    position: static;
    display: flex; gap: var(--space-2);
    padding: 0; background: none; border: 0; box-shadow: none;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin-inline: calc(var(--space-4) * -1); padding-inline: var(--space-4);
  }
  .rpt-nav::-webkit-scrollbar { display: none; }
  .rpt-nav-group, .rpt-nav-group [role="tablist"] { display: contents; }
  .rpt-nav-title { display: none; }
  .rpt-nav .rpt-tab {
    width: auto; flex: none; scroll-snap-align: start;
    padding: 7px 12px 7px 8px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    white-space: nowrap;
  }
  .rpt-nav .rpt-tab.odpo-tab-active {
    background: var(--brand-secondary, var(--odpo-violet)); color: #fff;
    border: 1px solid var(--brand-secondary, var(--odpo-violet));
  }
  .rpt-nav .rpt-tab.odpo-tab-active .rpt-tab-icon { background: rgba(255, 255, 255, .18); }
  .rpt-tab-icon { width: 24px; height: 24px; border-radius: 999px; }
}
@media (max-width: 700px) {
  .rpt-panel { padding: var(--space-4); }
  .rpt-head h2 { font-size: 1.08rem; }
  .rpt-export { width: 100%; }
  .rpt-export-btn { flex: 1; justify-content: center; }
  .rpt-panel .odpo-form-row { padding: var(--space-3); }
  .rpt-panel .odpo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .rpt-panel .odpo-kpi { padding: var(--space-3); }
  .rpt-panel .odpo-kpi-value { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .rpt-nav .rpt-tab, .rpt-tab-icon { transition: none; }
}

/* Report tables: a scroll container (keyboard-focusable) so a wide report scrolls sideways
   inside its card instead of being cut off; codes, dates and amounts never break mid-value. */
.rpt-table-wrap { overflow-x: auto; overscroll-behavior-x: contain; border-radius: var(--radius); }
.rpt-table-wrap:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.rpt-table-wrap table { min-width: 100%; }
/* Desktop: the first column (unit code, building, tenant) never breaks mid-value; the rest wraps
   so the table fits its card. Phones: every cell stays on one line and the table scrolls. */
.rpt-panel td:first-child, .rpt-panel th:first-child { white-space: nowrap; }
@media (max-width: 700px) {
  .rpt-panel th, .rpt-panel td { white-space: nowrap; }
}

/* The reports hub is the one screen whose tables need width: on a wide display it may use up to
   1400px instead of the 1160px every other page keeps. */
.content:has(.rpt-shell) { max-width: 1400px; }
.rpt-shell { grid-template-columns: 224px minmax(0, 1fr); }
@media (max-width: 1000px) { .rpt-shell { grid-template-columns: minmax(0, 1fr); } }

/* message-tenant: writing language, the recipients' languages, and the translate actions. */
.msg-lang-summary { margin: 0; }
.msg-lang-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.msg-lang-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px;
  border: 1px solid var(--border-strong); border-radius: 999px; font-size: .9rem; background: var(--surface, #fff);
}
[dir=rtl] .msg-lang-chip { padding: 4px 12px 4px 6px; }
.msg-lang-chip.is-muted { color: var(--text-muted); border-style: dashed; }
.msg-lang-count {
  min-width: 22px; padding: 0 6px; border-radius: 999px; text-align: center; font-size: .78rem; font-weight: 700;
  background: color-mix(in srgb, var(--brand-primary, #1B3A5C) 10%, transparent); color: var(--brand-primary, #1B3A5C);
}
.msg-lang-tag { font-size: .72rem; font-weight: 700; color: var(--text-muted); }
.msg-lang-editor-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.msg-lang-editor-head h3 { margin: 0; }
.msg-translate {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--space-3);
  border: 1px solid var(--brand-primary, #1B3A5C); border-radius: 999px; background: transparent;
  color: var(--brand-primary, #1B3A5C); font-weight: 600;
}
.msg-translate svg { width: 16px; height: 16px; }
.msg-translate:hover { background: color-mix(in srgb, var(--brand-primary, #1B3A5C) 8%, transparent); }

/* settings/companies: a labelled on/off switch (a real checkbox, styled). */
.cmp-switch { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--space-2); font-size: .85rem; cursor: pointer; }
.cmp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cmp-switch-track {
  position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px;
  background: var(--border-strong); transition: background-color .15s;
}
.cmp-switch-track::after {
  content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: inset-inline-start .15s;
}
.cmp-switch input:checked + .cmp-switch-track { background: var(--ok, #1a7f4b); }
.cmp-switch input:checked + .cmp-switch-track::after { inset-inline-start: 16px; }
.cmp-switch input:focus-visible + .cmp-switch-track { outline: 2px solid var(--brand-primary, #1B3A5C); outline-offset: 2px; }
.cmp-switch input:disabled + .cmp-switch-track { opacity: .6; }

/* ==========================================================================
   message-tenant — the composer: three numbered steps (who, the message, how) beside a
   sticky "before sending" panel that lists who gets it, each language's state and what is
   still missing, and holds the send actions. Theme tokens only; logical properties (RTL).
   ========================================================================== */
.mtc-intro { max-width: 70ch; text-wrap: pretty; }
.mtc-alert { max-width: 1120px; }
.mtc-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 320px);
  gap: var(--space-5); align-items: start; max-width: 1120px;
}
.mtc-main { display: grid; gap: var(--space-4); min-width: 0; }

.mtc-step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: var(--space-5);
  transition: opacity .2s var(--ease);
}
.mtc-step.is-locked { background: transparent; box-shadow: none; border-style: dashed; padding-block: var(--space-4); }
.mtc-step.is-locked .mtc-step-num { background: var(--surface-sunken); color: var(--text-faint); }
.mtc-step.is-locked h2 { color: var(--text-muted); }
.mtc-step-head { display: flex; gap: var(--space-3); align-items: flex-start; }
.mtc-step:not(.is-locked) .mtc-step-head { margin-bottom: var(--space-4); }
.mtc-step-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -.005em; }
.mtc-step-head p { margin: 3px 0 0; font-size: .85rem; color: var(--text-muted); text-wrap: pretty; }
.mtc-step-num {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 9%, transparent);
  color: var(--brand-primary, var(--odpo-ink)); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* ---- recipient modes: three described choices ---- */
.mtc-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
.mtc-mode {
  display: flex; gap: var(--space-3); align-items: flex-start; text-align: start;
  padding: var(--space-3); border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); box-shadow: none; font-weight: 400;
  transition: border-color .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease);
}
.mtc-mode:hover { border-color: var(--border-strong); background: var(--surface-sunken); }
.mtc-mode:active { transform: translateY(1px); }
.mtc-mode:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.mtc-mode.is-active {
  border-color: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 55%, var(--border));
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 5%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 40%, transparent);
}
.mtc-mode-icon {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-sunken); color: var(--text-muted);
}
.mtc-mode.is-active .mtc-mode-icon { background: var(--brand-primary, var(--odpo-ink)); color: #fff; }
.mtc-mode-icon svg { width: 17px; height: 17px; }
.mtc-mode-text { display: grid; gap: 2px; min-width: 0; }
.mtc-mode-title { font-size: .9rem; font-weight: 650; }
.mtc-mode-desc { font-size: .78rem; line-height: 1.55; color: var(--text-muted); }

/* ---- one tenant ---- */
.mtc-search label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 600; }
.mtc-search-row { display: flex; gap: var(--space-2); }
.mtc-search-row input { flex: 1; min-width: 0; }
.mtc-field-error { margin: var(--space-2) 0 0; font-size: .84rem; color: var(--danger); }
.mtc-person {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  margin-top: var(--space-3); padding: var(--space-3); border-radius: var(--radius);
  background: var(--surface-sunken); border: 1px solid var(--border);
}
.mtc-person.is-chosen { margin-top: 0; background: color-mix(in srgb, var(--ok) 6%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 25%, var(--border)); }
.mtc-avatar {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: var(--brand-primary, var(--odpo-ink)); color: #fff; font-weight: 700;
}
.mtc-person-text { display: grid; gap: 1px; flex: 1; min-width: 0; font-size: .82rem; color: var(--text-muted); }
.mtc-person-text b { font-size: .95rem; color: var(--text); }
.mtc-person-label { font-size: .72rem; font-weight: 600; text-transform: none; }
.mtc-link-button {
  background: transparent; box-shadow: none; border: 0; padding: 6px 8px; min-height: 0;
  color: var(--brand-secondary, var(--odpo-violet)); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.mtc-link-button:hover { background: transparent; color: var(--brand-primary, var(--odpo-ink)); }
.mtc-link-button:disabled { color: var(--text-faint); text-decoration: none; }

/* ---- a chosen group ---- */
.mtc-filters { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr) auto; gap: var(--space-3); align-items: end; }
.mtc-filters .odpo-field { margin: 0; min-width: 0; }
.mtc-filters select, .mtc-filters input { width: 100%; }
.mtc-results-meta { margin: var(--space-4) 0 var(--space-2); font-size: .85rem; color: var(--text-muted); }
.mtc-results-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.mtc-empty { margin: var(--space-3) 0 0; padding: var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); color: var(--text-muted); text-align: center; }
.mtc-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.mtc-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.mtc-table th { padding: 10px 12px; text-align: start; font-size: .76rem; font-weight: 600; color: var(--text-muted); background: var(--surface-sunken); }
.mtc-table td { padding: 10px 12px; border-top: 1px solid var(--border); }
.mtc-table th:first-child, .mtc-table td:first-child { width: 40px; }
.mtc-table tr.is-picked td { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 4%, transparent); }
.mtc-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand-primary, var(--odpo-ink)); }
.mtc-num { font-variant-numeric: tabular-nums; }
.mtc-pager { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-top: var(--space-3); font-variant-numeric: tabular-nums; }
.mtc-pager button { min-width: 36px; }

/* ---- everyone ---- */
.mtc-all {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4);
  border-radius: var(--radius); background: var(--surface-sunken);
}
.mtc-all-count { font-size: 2rem; font-weight: 750; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--brand-primary, var(--odpo-ink)); }
.mtc-all p { margin: 0; font-size: .88rem; color: var(--text-muted); text-wrap: pretty; }

/* ---- the message ---- */
.mtc-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.mtc-pair .odpo-field { margin-bottom: var(--space-3); min-width: 0; }
.mtc-pair select { width: 100%; }
/* Normal or urgent: the channel cards as radios; urgent turns red when chosen. */
.mtc-priority { margin: 0 0 var(--space-4); padding: 0; border: 0; min-width: 0; }
.mtc-priority legend { padding: 0; margin-bottom: 6px; font-size: .85rem; font-weight: 600; }
.mtc-channel.is-urgent:has(input:checked) { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); background: color-mix(in srgb, var(--danger) 5%, var(--surface)); }
.mtc-channel.is-urgent:has(input:checked) .mtc-channel-icon { background: var(--danger-bg); color: var(--danger); }
.mtc-channel.is-urgent input { accent-color: var(--danger); }
.mtc-audience { padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); }
.mtc-audience > p { margin: 0; }
.mtc-audience > p + p, .mtc-audience .msg-lang-chips + p { margin-top: var(--space-2); }
.mtc-editor-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.mtc-editor-bar .odpo-langtabs { margin: 0; }
.mtc-progress { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-3) 0 0; font-size: .82rem; color: var(--text-muted); }
.mtc-progress-bar { position: relative; flex: none; width: 90px; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.mtc-progress-bar span { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: var(--ok); transition: inline-size .3s var(--ease); }
.mtc-note { margin: var(--space-2) 0 0; }
.mtc-editor-card { margin-top: var(--space-3); padding: var(--space-4); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: none; }
.mtc-editor-card .msg-lang-editor-head { margin-bottom: var(--space-3); }
.mtc-translate-hint { margin: calc(var(--space-2) * -1) 0 var(--space-3); }
/* A tab filled by machine translation and not edited since: read it before sending. */
.mtc-machine-note {
  display: flex; align-items: flex-start; gap: 6px; margin: calc(var(--space-2) * -1) 0 var(--space-3);
  font-size: .8rem; color: var(--warn);
}
.mtc-machine-note svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.msg-translate:disabled { opacity: .6; cursor: progress; }
.mtc-editor-card .odpo-field:last-child { margin-bottom: 0; }
.mtc-editor-card textarea { resize: vertical; min-height: 150px; line-height: 1.7; }
.mtc-count { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2); margin-top: 6px; font-size: .76rem; color: var(--text-faint); }
.mtc-count .mtc-num { margin-inline-start: auto; }

/* ---- channels: toggle cards ---- */
.mtc-channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.mtc-channel {
  position: relative; display: flex; align-items: center; gap: var(--space-3); margin: 0;
  padding: var(--space-3); border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.mtc-channel:hover { border-color: var(--border-strong); }
.mtc-channel input { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; width: 18px; height: 18px; margin: 0; accent-color: var(--brand-primary, var(--odpo-ink)); }
.mtc-channel:has(input:checked) { border-color: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 45%, var(--border)); background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 4%, var(--surface)); }
.mtc-channel:has(input:focus-visible) { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.mtc-channel.is-locked { cursor: default; background: var(--surface-sunken); }
.mtc-channel-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-sunken); color: var(--text-muted); }
.mtc-channel:has(input:checked) .mtc-channel-icon { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 10%, transparent); color: var(--brand-primary, var(--odpo-ink)); }
.mtc-channel-icon svg { width: 17px; height: 17px; }
.mtc-channel-text { display: grid; gap: 1px; padding-inline-end: 24px; }
.mtc-channel-text b { font-size: .88rem; font-weight: 650; }
.mtc-channel-text span { font-size: .76rem; color: var(--text-muted); }

/* ---- before sending ---- */
.mtc-summary {
  position: sticky; top: var(--space-5); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4);
  min-width: 0; padding: var(--space-5); border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 9%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 14%, var(--border));
  box-shadow: var(--shadow-sm);
}
.mtc-summary h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.mtc-facts { display: grid; gap: var(--space-3); margin: 0; }
.mtc-facts div { display: grid; gap: 2px; }
.mtc-facts dt { font-size: .74rem; font-weight: 600; color: var(--text-muted); }
.mtc-facts dd { margin: 0; font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.mtc-summary-sub { margin: 0 0 calc(var(--space-2) * -1); font-size: .74rem; font-weight: 600; color: var(--text-muted); }
.mtc-langs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mtc-langs li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); font-size: .86rem; }
.mtc-langs-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px dashed var(--border-strong); color: #fff; }
.mtc-langs li.is-done .mtc-langs-mark { border: 0; background: var(--ok); }
.mtc-langs-mark svg { width: 12px; height: 12px; }
.mtc-langs-state { font-size: .74rem; color: var(--text-muted); }
.mtc-langs li:not(.is-done) .mtc-langs-state { color: var(--warn); }
.mtc-todo { padding: var(--space-3); border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: .84rem; }
.mtc-todo p { margin: 0 0 4px; font-weight: 650; }
.mtc-todo ul { margin: 0; padding-inline-start: 18px; line-height: 1.8; }
.mtc-ready { display: flex; align-items: center; gap: 8px; margin: 0; padding: var(--space-3); border-radius: var(--radius); background: var(--ok-bg); color: var(--ok); font-weight: 650; font-size: .88rem; }
.mtc-ready svg { width: 16px; height: 16px; }
.mtc-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.mtc-send { width: 100%; min-height: 44px; font-size: .95rem; }
.mtc-schedule label { display: block; margin-bottom: 6px; font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.mtc-schedule-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* A date-time field has a wide natural size: it must shrink, or it pushes the panel out. */
.mtc-schedule-row input { flex: 1 1 160px; min-width: 0; width: 100%; }
.mtc-actions .mtc-link-button { justify-self: start; padding-inline: 0; }
.mtc-hint { margin: calc(var(--space-2) * -1) 0 0; font-size: .74rem; color: var(--text-faint); }
.mtc-monitor { font-size: .84rem; font-weight: 600; }

@media (max-width: 960px) {
  .mtc-layout { grid-template-columns: minmax(0, 1fr); }
  .mtc-summary { position: static; }
}
@media (max-width: 640px) {
  .mtc-step { padding: var(--space-4); }
  .mtc-modes, .mtc-channels, .mtc-pair { grid-template-columns: minmax(0, 1fr); }
  .mtc-filters { grid-template-columns: minmax(0, 1fr); }
  .mtc-all { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .mtc-mode, .mtc-channel, .mtc-step, .mtc-progress-bar span { transition: none; }
}

/* ---- Property features: the inputs (Shared/FeatureInputs.razor) -------------------------------
 * Counts and lists are labelled fields in a grid; yes/no features are toggle chips — a real
 * checkbox inside each label, so the whole chip is the hit target and the keyboard works. */
.pf-inputs { display: grid; gap: var(--space-3); }
.pf-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); align-items: end; }
.pf-fields .odpo-field { margin: 0; }
.pf-fields input, .pf-fields select { width: 100%; }
.pf-flags { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pf-flag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .85rem;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.pf-flag input { margin: 0; accent-color: var(--brand-primary, var(--odpo-ink)); }
.pf-flag span { white-space: nowrap; }
/* Beats the host forms' own input rules (.un-step input: width 100%; the sheet forms' inputs). */
.pf-inputs .pf-flag input { flex: none; width: auto; min-width: 0; }
.pf-flag:hover { border-color: var(--border-strong); background: var(--surface-sunken); }
.pf-flag:focus-within { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.pf-flag.is-on {
  border-color: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 55%, var(--border));
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 6%, var(--surface)); font-weight: 600;
}

/* ---- Property features catalogue (Pages/PropertyFeatureSettings.razor, platform admin) ---------
 * Two scope tabs; a calm list (type tile, name, one meta line, option chips) whose only row tools
 * are reorder and "تعديل"; an inline editor that explains delete-vs-stop before it is asked; the
 * stopped entries in their own muted group; and, beside the list, a live preview of the exact form
 * companies get. One accent: the brand ink. Types are told apart by their glyph, not by colour.
 * Portal tokens only; motion is limited to state feedback and the editor opening. */
.pfx-alert { max-width: 1180px; }

/* Scope tabs */
.pfx-scopes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2);
  max-width: 1180px; margin-bottom: var(--space-5); padding: 6px;
  border-radius: var(--radius-lg); background: var(--surface-sunken); border: 1px solid var(--border);
}
.pfx-scope {
  display: flex; align-items: center; gap: var(--space-3); min-height: 64px; padding: 10px var(--space-4);
  border: 1px solid transparent; border-radius: var(--radius); background: transparent; box-shadow: none;
  color: var(--text-muted); font-weight: 400; text-align: start;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.pfx-scope:hover:not(.is-active) { background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--text); }
.pfx-scope.is-active { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); color: var(--text); }
.pfx-scope:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.pfx-scope-icon {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface); color: var(--text-muted); transition: background-color .2s var(--ease), color .2s var(--ease);
}
.pfx-scope.is-active .pfx-scope-icon { background: var(--brand-primary, var(--odpo-ink)); color: #fff; }
.pfx-scope-icon svg { width: 18px; height: 18px; }
.pfx-scope-text { display: grid; gap: 1px; min-width: 0; }
.pfx-scope-title { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 650; }
.pfx-scope-hint { font-size: .78rem; color: var(--text-faint); }
.pfx-scope-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px;
  background: var(--surface-sunken); color: var(--text-muted); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pfx-scope.is-active .pfx-scope-count { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 10%, var(--surface)); color: var(--text); }

/* Workspace: the list, and the preview beside it */
.pfx-workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: var(--space-5); align-items: start; max-width: 1180px; }
.pfx-catalogue { min-width: 0; padding: var(--space-3) var(--space-5) var(--space-5); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }

/* Rows */
.pfx-list { margin: 0; padding: 0; list-style: none; }
.pfx-row { border-bottom: 1px solid var(--border); }
.pfx-list > .pfx-row:last-child { border-bottom: 0; }
.pfx-row-main { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) 0; }
.pfx-type {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 7%, var(--surface)); color: var(--brand-primary, var(--odpo-ink));
}
.pfx-type svg { width: 17px; height: 17px; }
.pfx-row-text { display: grid; gap: 3px; flex: 1 1 auto; min-width: 0; padding-top: 1px; }
.pfx-row-name { font-size: .98rem; font-weight: 650; line-height: 1.35; }
.pfx-row-meta { font-size: .78rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.pfx-row-meta .pfx-used { color: var(--text-muted); font-weight: 600; }
.pfx-row-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.pfx-tool { min-height: 34px; padding: 5px 12px; font-size: .84rem; }
.pfx-order { display: inline-flex; gap: 2px; margin-inline-end: 4px; }
.pfx-icon-btn {
  display: grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: none; box-shadow: none; color: var(--text-faint);
}
.pfx-icon-btn:hover:not(:disabled) { background: var(--surface-sunken); color: var(--text); }
.pfx-icon-btn:disabled { opacity: .3; }
.pfx-icon-btn svg { width: 16px; height: 16px; }
.pfx-up svg { transform: rotate(-90deg); }
.pfx-down svg { transform: rotate(90deg); }

/* Option chips (read view) */
.pfx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.pfx-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text); font-size: .78rem; font-weight: 500;
}
.pfx-chip.is-stopped { color: var(--text-faint); text-decoration: line-through; }
.pfx-chip-count { color: var(--text-faint); font-size: .7rem; font-variant-numeric: tabular-nums; }
.pfx-chips-edit { margin-bottom: 8px; }
.pfx-chip-remove {
  display: grid; place-items: center; width: 18px; height: 18px; min-height: 18px; padding: 0; margin-inline-start: 2px;
  border: 0; border-radius: 50%; background: none; box-shadow: none; color: var(--text-faint); font-size: .9rem; line-height: 1;
}
.pfx-chip-remove:hover:not(:disabled) { background: var(--border); color: var(--text); }

/* The editor, opened under its own row */
.pfx-row.is-open { border-bottom-color: transparent; }
.pfx-row.is-open .pfx-row-main { padding-bottom: var(--space-3); }
.pfx-editor {
  display: grid; gap: var(--space-4); margin: 0 0 var(--space-4); padding: var(--space-4);
  border-radius: var(--radius); background: var(--surface-sunken); border: 1px solid var(--border);
}
@media (prefers-reduced-motion: no-preference) {
  .pfx-editor, .pfx-add { animation: pfx-open .18s var(--ease); }
  @keyframes pfx-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
.pfx-editor-block { display: grid; gap: 8px; }
.pfx-editor-block + .pfx-editor-block { padding-top: var(--space-4); border-top: 1px solid var(--border); }
.pfx-editor-label { font-size: .82rem; font-weight: 650; color: var(--text-muted); }
.pfx-editor-note { margin: 0; font-size: .78rem; color: var(--text-faint); }
.pfx-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pfx-inline input { flex: 1 1 220px; min-width: 0; max-width: 360px; }
.pfx-inline button { min-height: 38px; padding: 6px 14px; font-size: .86rem; white-space: nowrap; }
.pfx-options { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pfx-option {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3);
  min-height: 44px; padding-block: 4px; padding-inline: 12px 6px; border-radius: var(--radius-sm); background: var(--surface);
}
.pfx-option:has(.pfx-inline) { grid-template-columns: minmax(0, 1fr); padding: 6px; }
.pfx-option-label { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 550; }
.pfx-option.is-stopped .pfx-option-label { color: var(--text-faint); }
.pfx-option-usage { font-size: .76rem; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pfx-option-tools { display: inline-flex; gap: 2px; }
.pfx-option-tools button { min-height: 32px; padding: 4px 10px; font-size: .8rem; }
.pfx-tag { padding: 1px 7px; border-radius: 5px; background: var(--surface-sunken); color: var(--text-muted); font-size: .7rem; font-weight: 650; }
.pfx-option-add { padding-top: 4px; }
.pfx-editor-status p { max-width: 62ch; margin: 0; font-size: .86rem; line-height: 1.65; color: var(--text-muted); text-wrap: pretty; }

/* Adding */
.pfx-add-trigger {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin-top: var(--space-3);
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: none; box-shadow: none;
  color: var(--text-muted); font-size: .9rem; font-weight: 600;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.pfx-add-trigger:hover:not(:disabled) { border-color: var(--brand-primary, var(--odpo-ink)); background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 4%, var(--surface)); color: var(--text); }
.pfx-add-trigger span { font-size: 1.1rem; line-height: 1; }
.pfx-add {
  display: grid; gap: var(--space-4); margin-top: var(--space-3); padding: var(--space-5);
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface);
  box-shadow: var(--shadow);
}
.pfx-add h3 { margin: 0; font-size: 1rem; }
.pfx-add .odpo-field { margin: 0; }
.pfx-add .odpo-field > input { width: 100%; max-width: 420px; }
.pfx-types-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.pfx-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.pfx-types-field legend { margin-bottom: var(--space-2); padding: 0; font-size: .85rem; font-weight: 600; }
.pfx-type-card {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3); cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  transition: border-color .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.pfx-type-card:hover { border-color: var(--border-strong); background: var(--surface-sunken); }
.pfx-type-card:focus-within { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.pfx-type-card.is-active {
  border-color: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 55%, var(--border));
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 5%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 40%, transparent);
}
.pfx-type-card.is-active .pfx-type { background: var(--brand-primary, var(--odpo-ink)); color: #fff; }
.pfx-type-card-text { display: grid; gap: 2px; min-width: 0; }
.pfx-type-card-title { font-size: .9rem; font-weight: 650; }
.pfx-type-card-desc { font-size: .76rem; line-height: 1.5; color: var(--text-muted); }
.pfx-add-actions { padding-top: var(--space-3); border-top: 1px solid var(--border); }
.pfx-muted { font-size: .78rem; font-weight: 400; color: var(--text-faint); }

/* Stopped */
.pfx-stopped { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.pfx-stopped h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .9rem; color: var(--text-muted); }
.pfx-stopped > p { margin: 4px 0 0; font-size: .8rem; color: var(--text-faint); }
.pfx-list-stopped .pfx-row-main { padding: var(--space-3) 0; }
.pfx-row.is-stopped .pfx-type { background: var(--surface-sunken); color: var(--text-faint); }
.pfx-row.is-stopped .pfx-row-name { color: var(--text-muted); }

/* Empty, loading */
.pfx-empty { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-7) var(--space-5); text-align: center; }
.pfx-empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: var(--space-2); border-radius: 14px; background: var(--surface-sunken); color: var(--text-muted); }
.pfx-empty b { font-size: 1rem; }
.pfx-empty p { max-width: 42ch; margin: 0 0 var(--space-3); font-size: .86rem; color: var(--text-muted); }
.pfx-skeleton { display: grid; gap: var(--space-3); max-width: 1180px; }
.pfx-skeleton span { display: block; border-radius: var(--radius); background: var(--surface-sunken); }
.pfx-skeleton-tabs { height: 78px; margin-bottom: var(--space-3); }
.pfx-skeleton-row { height: 58px; max-width: 700px; }
@media (prefers-reduced-motion: no-preference) {
  .pfx-skeleton span { animation: pfx-pulse 1.4s ease-in-out infinite; }
  @keyframes pfx-pulse { 50% { opacity: .55; } }
}

/* The live preview */
.pfx-preview { position: sticky; top: var(--space-5); min-width: 0; }
.pfx-preview-card {
  display: grid; gap: var(--space-3); padding: var(--space-5);
  border-radius: var(--radius-lg); background: var(--surface-sunken); border: 1px solid var(--border);
}
.pfx-preview-card h2 { margin: 0; font-size: 1rem; }
.pfx-preview-hint { margin: -4px 0 0; font-size: .8rem; line-height: 1.6; color: var(--text-muted); }
.pfx-preview-empty { margin: 0; font-size: .84rem; color: var(--text-faint); }
.pfx-preview-form { padding: var(--space-4); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.pfx-preview-form .pf-fields { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.pfx-preview-form .pf-fields input, .pfx-preview-form .pf-fields select { width: 100%; }
.pfx-preview-result { display: grid; gap: 6px; padding: var(--space-3) var(--space-4); border-radius: var(--radius); border: 1px dashed var(--border-strong); }
.pfx-preview-result > span:first-child { font-size: .72rem; font-weight: 650; color: var(--text-faint); }
.pfx-preview-result i { font-size: .8rem; font-style: normal; color: var(--text-faint); }
.pfx-preview-line { font-size: .84rem; font-weight: 500; line-height: 1.6; color: var(--text-muted); }

@media (max-width: 980px) {
  .pfx-workspace { grid-template-columns: minmax(0, 1fr); }
  .pfx-preview { position: static; }
}
@media (max-width: 720px) {
  .pfx-scopes { grid-template-columns: minmax(0, 1fr); }
  .pfx-scope { min-height: 56px; }
  .pfx-catalogue { padding: var(--space-2) var(--space-4) var(--space-4); }
  .pfx-row-main { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .pfx-row-tools { grid-column: 1 / -1; justify-content: flex-end; }
  .pfx-types { grid-template-columns: minmax(0, 1fr); }
  .pfx-option { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px 12px; }
  .pfx-add { padding: var(--space-4); }
}
@media (prefers-reduced-motion: reduce) {
  .pfx-scope, .pfx-scope-icon, .pfx-add-trigger, .pfx-type-card { transition: none; }
}
@media (prefers-reduced-motion: reduce) { .pf-flag { transition: none; } }


/* ==========================================================================
   settings/languages: the platform's machine-translation account (Gemini) — one card
   under the interface languages. Theme tokens only; logical properties (RTL).
   ========================================================================== */
.tr-card { max-width: 860px; margin-top: var(--space-6); }
.tr-head { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-3); }
.tr-head h2 { margin: 0; font-size: 1.1rem; }
.tr-icon {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 9%, var(--surface));
  color: var(--brand-primary, var(--odpo-ink));
}
.tr-icon svg { width: 20px; height: 20px; }
.tr-intro { margin: 4px 0 0; color: var(--text-muted); font-size: .86rem; max-width: 640px; }
.tr-switch { margin-top: 0; }
.tr-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.tr-fields .odpo-field { margin-bottom: 0; }
.tr-fields input { width: 100%; }
.tr-saved { margin-inline-start: 6px; }
.tr-free { margin: var(--space-4) 0 0; font-size: .84rem; }
.tr-card .odpo-alert[role] { margin: var(--space-3) 0 0; }
.tr-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
@media (max-width: 720px) {
  .tr-fields { grid-template-columns: minmax(0, 1fr); }
  .tr-actions button { flex: 1 1 auto; }
}


/* ==========================================================================
   my-assets: a tenant's or owner's view of the furniture and appliances in their unit,
   one card per unit, one tile per asset with its photo. Theme tokens; logical properties.
   ========================================================================== */
.ma-intro { max-width: 640px; }
.ma-empty {
  display: flex; align-items: center; gap: var(--space-3); max-width: 640px; padding: var(--space-5);
  border: 1.5px dashed var(--border-strong, var(--border)); border-radius: var(--radius-lg); color: var(--text-muted);
}
.ma-empty p { margin: 0; }
.ma-empty-icon, .ma-unit-icon {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 9%, var(--surface)); color: var(--brand-primary, var(--odpo-ink));
}
.ma-empty-icon svg, .ma-unit-icon svg { width: 20px; height: 20px; }
.ma-unit { max-width: 1040px; margin-top: var(--space-5); padding: var(--space-4) var(--space-5) var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-raised, var(--surface)); box-shadow: var(--shadow); }
.ma-unit-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ma-unit-title { flex: 1 1 200px; min-width: 0; }
.ma-unit-title h2 { margin: 0; font-size: 1.15rem; }
.ma-unit-title p { margin: 2px 0 0; font-size: .86rem; color: var(--text-muted); }
.ma-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ma-none, .ma-count { margin: var(--space-3) 0 0; }
.ma-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-3); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.ma-card { display: grid; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ma-photo {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; min-height: 0; padding: 0; overflow: hidden;
  border: 0; border-radius: 0; background: var(--surface-sunken); color: var(--text-faint); box-shadow: none;
}
.ma-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ma-photo.is-empty svg { width: 28px; height: 28px; }
button.ma-photo:hover:not(:disabled):not([type="submit"]) { box-shadow: none; background: var(--surface-sunken); }
button.ma-photo:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: -2px; }
.ma-photo-count {
  position: absolute; inset-inline-end: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: .74rem; font-weight: 650;
}
.ma-photo-count svg { width: 13px; height: 13px; }
.ma-card-text { display: grid; gap: 2px; padding: var(--space-3); font-size: .84rem; color: var(--text-muted); }
.ma-card-text b { font-size: .95rem; color: var(--text); }
.ma-tag { font-variant-numeric: tabular-nums; }
.ma-viewer { width: min(720px, calc(100vw - 32px)); }
.ma-viewer-img { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--radius); background: var(--surface-sunken); }
.ma-viewer-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; margin: var(--space-3) 0 0; padding: 0; list-style: none; }
@media (max-width: 720px) { .ma-unit { padding: var(--space-4); } .ma-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===================================================================================
   Requests (Requests.razor, prefix rq-): what a unit's tenant, owner and company ask each
   other for. Two boxes as tabs (received / sent), one calm row per request opening the
   shared side sheet (.ux-sheet), where the recipient answers with files and a note.
   =================================================================================== */
.rq-head { margin-bottom: var(--space-2); }
.rq-intro { max-width: 68ch; margin: 0 0 var(--space-5); color: var(--text-muted); font-size: .92rem; }
.rq-board { max-width: 1160px; }

.rq-tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
.rq-tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: none;
  color: var(--text-muted); font-size: .92rem; font-weight: 600;
}
.rq-tab svg { width: 17px; height: 17px; }
.rq-tab:hover:not(:disabled):not(.is-active) { background: var(--surface-sunken); color: var(--text); }
/* Out-specifies the global button:hover (which would paint it near-white under white text). */
.rq-tab.is-active, .rq-tab.is-active:hover:not(:disabled) { border-color: var(--brand-primary, var(--odpo-ink)); background: var(--brand-primary, var(--odpo-ink)); box-shadow: none; color: #fff; }
.rq-tab-count {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted); font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rq-tab.is-active .rq-tab-count { background: rgba(255, 255, 255, .16); color: #fff; }
.rq-tab-count.is-warn { background: var(--warn-bg); color: var(--warn); }
.rq-tab.is-active .rq-tab-count.is-warn { background: var(--accent); color: var(--odpo-ink); }

.rq-rows {
  display: grid; margin: 0; padding: 0; list-style: none; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm);
}
.rq-rows > li + li { border-top: 1px solid var(--border); }
.rq-rows .rq-row {
  display: grid; align-items: center; gap: var(--space-4); width: 100%; min-height: 72px; padding: 14px var(--space-5);
  grid-template-columns: 40px minmax(160px, 1.5fr) minmax(140px, 1.1fr) 96px minmax(120px, .9fr) 18px;
  border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); font-weight: 400; text-align: start;
  transition: background-color .15s var(--ease);
}
.rq-rows .rq-row:hover:not(:disabled) { background: var(--surface-sunken); border-color: transparent; box-shadow: none; }
.rq-rows .rq-row:active:not(:disabled) { transform: none; box-shadow: none; }
.rq-rows .rq-row:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: -3px; }
.rq-rows .rq-row.is-open { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 5%, var(--surface)); box-shadow: inset 3px 0 0 var(--brand-primary, var(--odpo-ink)); }
[dir="rtl"] .rq-rows .rq-row.is-open { box-shadow: inset -3px 0 0 var(--brand-primary, var(--odpo-ink)); }
.rq-rows .rq-row:hover .cx-go { color: var(--text); }
.rq-row-icon {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 8%, var(--surface)); color: var(--brand-primary, var(--odpo-ink));
}
.rq-row-icon svg { width: 18px; height: 18px; }
.rq-row-main, .rq-row-party { display: grid; gap: 3px; min-width: 0; }
.rq-row-title { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.rq-row-sub, .rq-row-party-label { font-size: .8rem; color: var(--text-muted); }
.rq-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-code { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.rq-row-party-name { overflow: hidden; font-size: .9rem; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.rq-row-date { font-size: .84rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
[dir="rtl"] .rq-row-date { text-align: end; }
.rq-row-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rq-row-files { display: inline-flex; align-items: center; gap: 3px; font-size: .76rem; font-weight: 650; color: var(--ok); }
.rq-row-files svg { width: 13px; height: 13px; }
.rq-rows .rq-row.is-closed .rq-row-title { color: var(--text-muted); font-weight: 600; }
.rq-rows .rq-row.is-closed .rq-row-icon { background: var(--surface-sunken); color: var(--text-faint); }
.rq-rows .rq-row.is-skeleton { grid-template-columns: 1fr 1fr; cursor: default; }
.rq-rows .rq-row.is-skeleton .odpo-skeleton { display: block; height: 12px; }
.rq-empty { max-width: 1160px; }
.rq-empty button { margin-top: var(--space-4); }
.rq-empty .odpo-subtle { max-width: 52ch; margin: var(--space-2) auto 0; }

/* The sheet. */
.ux-sheet.rq-sheet { width: min(600px, 100vw); }
.rq-sheet .ux-sheet-body { grid-auto-rows: max-content; }
.rq-facts .rq-fact-who { font-size: .82rem; font-weight: 500; color: var(--text-muted); overflow-wrap: anywhere; }
.rq-facts .rq-fact-date { font-weight: 550; }
.rq-note, .rq-answer, .rq-respond { display: grid; gap: var(--space-2); }
.rq-note h3, .rq-answer h3, .rq-respond h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .95rem; }
.rq-note p { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); font-size: .9rem; line-height: 1.7; white-space: pre-line; }
.rq-answer { padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.rq-answer h3 svg { width: 17px; height: 17px; }
.rq-answer.is-done { border-color: color-mix(in srgb, var(--ok) 30%, var(--border)); background: var(--ok-bg); }
.rq-answer.is-done h3 { color: var(--ok); }
.rq-answer.is-declined { border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); background: var(--danger-bg); }
.rq-answer.is-declined h3 { color: var(--danger); }
.rq-stamp { margin: 0; font-size: .82rem; color: var(--text-muted); }
.rq-answer-text { margin: 0; font-size: .92rem; line-height: 1.7; white-space: pre-line; }
.rq-answer .ar-item { background: var(--surface); }
.rq-closed-note { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); font-size: .88rem; color: var(--text-muted); }
.rq-respond { gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.rq-respond-hint { margin: 0; }
.rq-respond textarea { width: 100%; resize: vertical; }
.rq-respond-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rq-respond-actions button { min-height: 44px; }
.rq-respond-actions svg, .rq-sheet .ux-sheet-foot svg { width: 16px; height: 16px; }
.rq-inline-error { margin: 0; font-size: .86rem; font-weight: 600; color: var(--danger); }
.rq-cancel .odpo-subtle { margin: 0; font-size: .84rem; }
.rq-cancel .cx-delete { justify-self: start; color: var(--danger); }
.rq-cancel .cx-delete:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); border-color: transparent; box-shadow: none; }

/* The new-request form. */
.rq-new .un-step legend { margin-bottom: var(--space-2); }
.rq-type-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.rq-new select { width: 100%; }
.rq-new textarea { width: 100%; resize: vertical; }
.rq-to .odpo-toggle-option { min-height: 44px; padding-inline: 14px; }
.rq-to-sub { font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.rq-summary { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); color: var(--text); }
.rq-new fieldset:disabled { opacity: .6; }

@media (max-width: 760px) {
  .rq-rows .rq-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas: "icon main state" "icon party date";
    gap: 6px var(--space-3); padding: 14px var(--space-4);
  }
  .rq-row-icon { grid-area: icon; align-self: start; }
  .rq-row-main { grid-area: main; }
  .rq-row-state { grid-area: state; justify-content: flex-end; }
  .rq-row-party { grid-area: party; display: flex; gap: 6px; align-items: baseline; }
  .rq-row-date { grid-area: date; text-align: end; }
  .rq-rows .rq-row .cx-go { display: none; }
  .rq-tabs { gap: 6px; }
  .rq-tab { flex: 1 1 0; justify-content: center; padding: 8px 10px; }
  .rq-type-choices { grid-template-columns: 1fr; }
}

/* ===================================================================================
   Request types (RequestTypeSettings.razor, prefix rqt-): the platform admin's catalogue.
   One row per type: its names, who asks and who it goes to as chips, how much it is used.
   =================================================================================== */
.rqt-intro { max-width: 72ch; margin: 0 0 var(--space-5); color: var(--text-muted); font-size: .92rem; }
.rqt-form { display: grid; gap: var(--space-4); max-width: 1080px; margin-bottom: var(--space-5); padding: var(--space-5); }
.rqt-form h2 { margin: 0; font-size: 1.1rem; }
.rqt-names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
.rqt-names input { width: 100%; }
.rqt-sides { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: start; gap: var(--space-3); }
.rqt-side { display: grid; gap: var(--space-2); min-width: 0; margin: 0; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.rqt-side legend { padding: 0 6px; font-size: .9rem; font-weight: 650; }
.rqt-side .odpo-register-hint { margin: 0; }
.rqt-parties { display: flex; flex-wrap: wrap; gap: 6px; }
.rqt-party { min-height: 42px; padding-inline: 14px; }
.rqt-party input[type="checkbox"] { margin: 0; width: 15px; height: 15px; }
.rqt-arrow { display: grid; place-items: center; align-self: center; color: var(--text-faint); }
.rqt-arrow svg { width: 20px; height: 20px; }
[dir="rtl"] .rqt-arrow svg { transform: scaleX(-1); }
.rqt-sentence {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: var(--space-3) var(--space-4);
  border-radius: var(--radius); background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 6%, var(--surface));
  font-weight: 600;
}
.rqt-sentence svg { flex: none; width: 17px; height: 17px; color: var(--brand-primary, var(--odpo-ink)); }
.rqt-problem { margin: 0; font-size: .88rem; font-weight: 600; color: var(--danger); }
.rqt-order { max-width: 220px; }
.rqt-form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.rqt-rows {
  display: grid; max-width: 1080px; margin: 0 0 var(--space-5); padding: 0; list-style: none; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm);
}
.rqt-row {
  display: grid; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5);
  grid-template-columns: minmax(160px, 1.1fr) minmax(220px, 1.6fr) minmax(120px, .8fr) auto;
}
.rqt-row + .rqt-row { border-top: 1px solid var(--border); }
.rqt-row.is-stopped .rqt-name-main { color: var(--text-muted); }
.rqt-name { display: grid; gap: 2px; min-width: 0; }
.rqt-name-main { font-weight: 650; }
.rqt-name-other { font-size: .8rem; color: var(--text-muted); }
.rqt-route { display: grid; gap: 6px; margin: 0; }
.rqt-route > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rqt-route dt { min-width: 64px; font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.rqt-route dd { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.rqt-chip {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-sunken); font-size: .8rem; font-weight: 600;
}
.rqt-use { display: grid; gap: 4px; justify-items: start; font-size: .82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rqt-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.rqt-actions button { min-height: 40px; }
.rqt-group-title { margin: var(--space-5) 0 var(--space-3); font-size: .95rem; color: var(--text-muted); }

@media (max-width: 860px) {
  .rqt-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rqt-route, .rqt-use { grid-column: 1 / -1; }
  .rqt-actions { grid-row: 1; grid-column: 2; }
}
@media (max-width: 640px) {
  .rqt-names { grid-template-columns: 1fr; }
  .rqt-sides { grid-template-columns: 1fr; }
  .rqt-arrow { transform: rotate(90deg); }
  [dir="rtl"] .rqt-arrow { transform: rotate(-90deg); }
  .rqt-row { padding: var(--space-4); }
}

/* ===================================================================================
   Company requests (CompanyRequestSettings.razor, prefix crq-): the company manager turns each
   platform request type on for the company and picks the departments that send and receive it.
   One card per type; a switch on its end; every change saves at once.
   =================================================================================== */
.crq-intro { max-width: 72ch; margin: 0 0 var(--space-4); color: var(--text-muted); font-size: .92rem; line-height: 1.75; }
.crq-summary { margin: 0 0 var(--space-3); font-size: .86rem; font-weight: 650; color: var(--text-muted); }
.crq-rows { display: grid; gap: var(--space-3); max-width: 1080px; margin: 0 0 var(--space-6); padding: 0; list-style: none; }
.crq-row {
  display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.crq-row.is-on { border-color: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 35%, var(--border)); }
.crq-row.is-stopped { background: var(--surface-sunken); box-shadow: none; }
.crq-head { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.4fr) auto; align-items: center; gap: var(--space-4); }
.crq-name { display: grid; gap: 2px; min-width: 0; }
.crq-name-main { font-weight: 700; }
.crq-name-other { font-size: .8rem; color: var(--text-muted); }
.crq-row.is-stopped .crq-name-main { color: var(--text-muted); }
.rqt-chip.is-company { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 10%, var(--surface)); color: var(--brand-primary, var(--odpo-ink)); }
.crq-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* The switch: a real checkbox (role=switch) drawn as a track and thumb; the words say the state. */
.crq-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: .86rem; font-weight: 650; white-space: nowrap; }
.crq-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.crq-switch input:disabled { cursor: not-allowed; }
.crq-switch-track {
  position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong);
  transition: background-color .18s var(--ease);
}
.crq-switch-thumb {
  position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(23, 23, 42, .25); transition: inset-inline-start .18s var(--ease);
}
.crq-switch input:checked + .crq-switch-track { background: var(--ok); }
.crq-switch input:checked + .crq-switch-track .crq-switch-thumb { inset-inline-start: 21px; }
.crq-switch input:focus-visible + .crq-switch-track { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.crq-switch input:disabled + .crq-switch-track { opacity: .5; }
.crq-switch-text { color: var(--text-muted); }
.crq-row.is-on .crq-switch-text { color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .crq-switch-track, .crq-switch-thumb { transition: none; } }

.crq-departments { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); }
.crq-side { display: grid; gap: var(--space-2); min-width: 0; margin: 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); }
.crq-side legend { padding: 0 6px; font-size: .86rem; font-weight: 650; }
.crq-side:disabled { opacity: .6; }
.crq-side-now { margin: 0; font-size: .8rem; font-weight: 600; color: var(--brand-primary, var(--odpo-ink)); }
.crq-hint { margin: 0; font-size: .8rem; color: var(--text-muted); }

@media (max-width: 860px) {
  .crq-head { grid-template-columns: minmax(0, 1fr) auto; }
  .crq-route { grid-column: 1 / -1; grid-row: 2; }
  .crq-switch { grid-column: 2; grid-row: 1; }
}
@media (max-width: 480px) {
  .crq-row { padding: var(--space-4); }
}

/* ===================================================================================
   Unit owners (redesign 2026-10-21), prefix po-. Every unit adds up to 100%: the owners'
   shares in shades of the brand ink, the company's (whatever no owner holds) in the accent.
   One calm row per unit (or per owner) opens its side sheet (the shared .ux-sheet): the split
   now, the change waiting for the owners' codes, changing it, the chain. Also used by the
   owner's own screens: «الموافقات والتوقيعات» (ap-), «ممثّلوني» (mr-), the representative
   form (rf-), the «أتصفّح باسم» switch (af-), and the contract's signers (cx-signing, cd-).
   =================================================================================== */
.po-head { margin-bottom: var(--space-5); }
.po-intro { max-width: 68ch; margin: 0; color: var(--text-muted); line-height: 1.7; text-wrap: pretty; }

/* ---- overview ---- */
.po-overview {
  display: grid; grid-template-columns: minmax(240px, 1.1fr) minmax(0, 2.8fr); gap: var(--space-3);
  max-width: 1160px; margin: 0 0 var(--space-5);
}
.po-hero {
  position: relative; isolation: isolate; display: grid; align-content: center; gap: 6px; min-height: 108px;
  padding: var(--space-5); overflow: hidden; border-radius: var(--radius-lg); color: #fff;
  background:
    radial-gradient(130% 150% at 100% 0%, color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 55%, var(--odpo-violet)) 0%, transparent 62%),
    var(--brand-primary, var(--odpo-ink));
  box-shadow: 0 1px 2px rgba(23, 23, 42, .12), 0 14px 32px -14px color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 70%, transparent);
}
.po-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--odpo-grain); opacity: .07; pointer-events: none; }
.po-hero-label { font-size: .84rem; font-weight: 550; color: rgba(255, 255, 255, .74); }
.po-hero-value { font-size: clamp(1.65rem, 2.4vw, 2.15rem); font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.po-hero-value small { font-size: .9rem; font-weight: 600; color: var(--accent-soft); }
.po-hero-sub { font-size: .8rem; color: rgba(255, 255, 255, .7); }
.po-hero-skeleton { display: block; width: 60%; height: 32px; opacity: .25; }

.po-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.po-tiles .po-tile {
  display: grid; align-content: space-between; justify-items: start; gap: var(--space-2); min-height: 108px;
  padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: none; color: var(--text); font-weight: 400; text-align: start;
  transition: border-color .16s var(--ease), background-color .16s var(--ease), box-shadow .16s var(--ease);
}
.po-tiles .po-tile:hover:not(:disabled) { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.po-tiles .po-tile:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.po-tile-count { font-size: 1.65rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.po-tile-label { font-size: .84rem; font-weight: 600; line-height: 1.35; color: var(--text-muted); }
.po-tiles .po-tile.is-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 22%, var(--border)); }
.po-tiles .po-tile.is-warn .po-tile-count { color: var(--warn); }
.po-tiles .po-tile.is-active { border-color: var(--brand-primary, var(--odpo-ink)); box-shadow: inset 0 0 0 1px var(--brand-primary, var(--odpo-ink)); }
.po-tiles .po-tile.is-active .po-tile-label { color: var(--text); }

/* ---- toolbar ---- */
.po-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); max-width: 1160px; margin-bottom: var(--space-3); }
.po-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-sunken); }
.po-switch button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px;
  background: none; box-shadow: none; color: var(--text-muted); font-weight: 600;
}
.po-switch button:hover:not(.is-on) { color: var(--text); background: none; }
.po-switch button.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.po-switch-count { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--border); font-size: .74rem; font-variant-numeric: tabular-nums; }
.po-search input { width: min(320px, 100%); min-height: 40px; }
.po-result { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); max-width: 1160px; margin: 0 0 var(--space-2); font-size: .84rem; color: var(--text-muted); }

/* plain text buttons */
.po-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 2px; border: 0; background: none; box-shadow: none;
  color: var(--brand-secondary, var(--odpo-violet)); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.po-link:hover:not(:disabled) { background: none; color: var(--text); }
.po-link.is-danger { color: var(--danger); }
.po-icon-btn { display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 10px; background: none; box-shadow: none; color: var(--text-muted); }
.po-icon-btn:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); }
.po-icon-btn svg { width: 17px; height: 17px; }

/* ---- rows ---- */
.po-rows {
  display: grid; max-width: 1160px; margin: 0; padding: 0; list-style: none; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm);
}
.po-rows > li + li { border-top: 1px solid var(--border); }
.po-rows .po-row {
  display: grid; align-items: center; gap: var(--space-4); width: 100%; min-height: 72px; padding: 14px var(--space-5);
  border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); font-weight: 400; text-align: start;
  transition: background-color .15s var(--ease);
}
.po-rows .po-unit { grid-template-columns: minmax(130px, 1fr) minmax(200px, 2fr) minmax(0, auto) 18px; }
.po-rows .po-owner { grid-template-columns: 40px minmax(160px, 1.6fr) minmax(0, 1fr) 18px; }
.po-rows .po-row:hover:not(:disabled) { background: var(--surface-sunken); box-shadow: none; }
.po-rows .po-row:active:not(:disabled) { transform: none; }
.po-rows .po-row:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: -3px; }
.po-rows .po-row.is-open { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 5%, var(--surface)); box-shadow: inset 3px 0 0 var(--brand-primary, var(--odpo-ink)); }
[dir="rtl"] .po-rows .po-row.is-open { box-shadow: inset -3px 0 0 var(--brand-primary, var(--odpo-ink)); }
.po-rows .po-row:hover .cx-go { color: var(--text); }
.po-rows .po-row.is-skeleton { display: grid; gap: 8px; cursor: default; }
.po-rows .po-row.is-skeleton .odpo-skeleton { display: block; height: 12px; }
.po-unit-id, .po-owner-id { display: grid; gap: 3px; min-width: 0; }
.po-code { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.po-place { overflow: hidden; font-size: .8rem; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.po-unit-split { display: grid; gap: 6px; min-width: 0; }
.po-split-text { overflow: hidden; font-size: .8rem; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.po-flags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.po-owner-facts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; font-size: .84rem; color: var(--text-muted); }
.po-avatar {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 10%, var(--surface)); color: var(--brand-primary, var(--odpo-ink));
  font-weight: 700;
}
.po-avatar.is-large { width: 44px; height: 44px; font-size: 1.1rem; }

.po-empty { display: grid; justify-items: center; gap: var(--space-2); max-width: 1160px; padding: var(--space-7) var(--space-5); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); text-align: center; color: var(--text-muted); }
.po-empty svg { width: 30px; height: 30px; color: var(--text-faint); }
.po-empty p { margin: 0; }
.po-empty-hint { max-width: 52ch; font-size: .84rem; }
.po-empty-compact { margin: 0; padding: var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); font-size: .86rem; color: var(--text-muted); }

/* ---- the split bar ---- */
.po-bar { display: flex; gap: 2px; width: 100%; height: 10px; overflow: hidden; border-radius: 999px; background: var(--surface-sunken); }
.po-bar.is-large { height: 16px; border-radius: 8px; }
.po-seg { flex: 0 0 var(--w); min-width: 3px; transition: flex-basis .25s var(--ease); }
.po-seg-0 { background: var(--brand-primary, var(--odpo-ink)); }
.po-seg-1 { background: var(--odpo-violet); }
.po-seg-2 { background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 55%, var(--surface)); }
.po-seg-3 { background: color-mix(in srgb, var(--odpo-violet) 35%, var(--surface)); }
.po-seg-company {
  background: repeating-linear-gradient(135deg, var(--accent) 0 6px, color-mix(in srgb, var(--accent) 78%, var(--surface)) 6px 12px);
}
.po-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; }

/* ---- the unit sheet ---- */
.ux-sheet.po-sheet { width: min(640px, 100vw); }
.po-sheet .ux-sheet-body { gap: var(--space-5); grid-auto-rows: max-content; }
.po-holders { display: grid; gap: 2px; margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.po-holders li { display: flex; align-items: center; gap: var(--space-3); min-height: 40px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.po-holders li:last-child { border-bottom: 0; }
.po-holder-name { flex: 1 1 auto; min-width: 0; }
.po-holder-pct { font-variant-numeric: tabular-nums; }
.po-holders li.is-company .po-holder-name { font-weight: 600; }

.po-request {
  padding: var(--space-4) var(--space-5); border: 1px solid color-mix(in srgb, var(--warn) 28%, var(--border));
  border-radius: var(--radius-lg); background: var(--warn-bg);
}
.po-request h3 { color: var(--warn); }
.po-request-lead { margin: 0; font-size: .86rem; line-height: 1.6; }
.po-statement {
  margin: var(--space-2) 0; padding: var(--space-2) var(--space-3); border-inline-start: 3px solid var(--accent);
  border-radius: 4px; background: var(--surface); font-size: .86rem; line-height: 1.6;
}
.po-approvals { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.po-approvals > li { display: grid; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius); background: var(--surface); }
.po-approvals > li.is-done { background: var(--ok-bg); }
.po-approval-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; }
.po-change { font-size: .9rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.po-done { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--ok); font-weight: 600; font-size: .86rem; }
.po-done svg { width: 16px; height: 16px; }
.po-warn { margin: 0; font-size: .82rem; color: var(--warn); font-weight: 600; }
.po-code-form { display: grid; gap: 6px; }
.po-code-form label { font-size: .84rem; font-weight: 600; }
.po-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.po-code-input {
  width: 12.5ch; min-height: 44px; padding: 0 10px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.2rem; font-weight: 650; letter-spacing: .28em; text-align: center; font-variant-numeric: tabular-nums;
}
.po-row-error { margin: 0; font-size: .82rem; font-weight: 600; color: var(--danger); }
.po-company-change { margin: var(--space-2) 0 0; font-size: .88rem; }
.po-request-actions { display: flex; justify-content: flex-end; }
.po-change-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.po-change-cta p { margin: 2px 0 0; font-size: .82rem; color: var(--text-muted); max-width: 46ch; }

.po-timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.po-timeline > li { position: relative; display: grid; gap: 4px; padding: 0 0 var(--space-4); padding-inline-start: 22px; }
.po-timeline > li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.po-timeline > li::after { content: ""; position: absolute; inset-inline-start: 8px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.po-timeline > li:last-child::after { display: none; }
.po-timeline > li.is-current::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.po-era-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .86rem; }
.po-era-split { margin: 0; font-size: .88rem; font-variant-numeric: tabular-nums; }
.po-era-statement { margin: 0; font-size: .82rem; color: var(--text-muted); line-height: 1.6; }
/* How each owner approved the request behind a roster: with a code, or without one while codes were off. */
.po-era-approvals { display: grid; gap: 4px; margin-top: 2px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-sunken); }
.po-era-approvals-title { font-size: .76rem; font-weight: 600; color: var(--text-muted); }
.po-era-approvals ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.po-era-approvals li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .82rem; line-height: 1.5; }
.po-era-approvals .po-change { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.po-done .po-nocode, .po-era-approvals .odpo-pill { font-size: .72rem; font-weight: 600; }
.po-nocode-note { color: var(--warn); font-weight: 600; }
.ap-nocode { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 0; }

/* ---- changing the split ---- */
.po-edit-intro { margin: 0; font-size: .86rem; line-height: 1.7; color: var(--text-muted); }
.po-draft { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.po-draft > li {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 6px var(--space-3);
  padding: 10px var(--space-4); border-bottom: 1px solid var(--border);
}
.po-draft > li:last-child { border-bottom: 0; }
.po-draft > li.is-company { background: var(--surface-sunken); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.po-draft > li.is-removed .po-draft-name b { text-decoration: line-through; color: var(--text-muted); }
.po-draft > li.is-over { background: var(--danger-bg); }
.po-draft-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.po-pct { display: inline-flex; align-items: center; gap: 4px; }
.po-pct input { width: 92px; min-height: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.po-pct input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.po-prev, .po-removed-note { grid-column: 2 / 3; font-size: .76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.po-removed-note { color: var(--danger); font-weight: 600; }
.po-draft > li .po-row-error { grid-column: 2 / -1; }
.po-draft > li > .po-dot { grid-row: 1; grid-column: 1; }
.po-draft > li > .po-draft-name { grid-row: 1; grid-column: 2; }
.po-draft > li > .po-pct, .po-draft > li > .po-holder-pct { grid-row: 1; grid-column: 3; }
.po-draft > li > .po-icon-btn, .po-draft > li > .po-link { grid-row: 1; grid-column: 4; }
.po-add { display: grid; gap: var(--space-2); margin: 0; padding: var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.po-add legend, .rf legend { padding: 0 6px; font-size: .95rem; font-weight: 650; line-height: 1.4; }
.po-review { display: grid; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 5%, var(--surface)); }
.po-review h3 { margin: 0; font-size: .95rem; }
.po-review ul { display: grid; gap: 4px; margin: 0; padding-inline-start: 1.1rem; font-size: .88rem; font-variant-numeric: tabular-nums; }
.po-review p { margin: 0; font-size: .82rem; color: var(--text-muted); }
.po-foot-why { font-size: .8rem; color: var(--text-muted); }

/* ---- the owner sheet: representatives ---- */
.po-rep-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.po-rep { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.po-rep.is-paused, .po-rep.is-ended { background: var(--surface-sunken); }
.po-rep.is-pendingownerapproval { border-color: color-mix(in srgb, var(--warn) 30%, var(--border)); background: var(--warn-bg); }
.po-rep-head { display: flex; align-items: center; gap: var(--space-3); }
.po-rep-id { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.po-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.po-chips li { padding: 3px 10px; border-radius: 999px; background: var(--surface-sunken); font-size: .76rem; font-weight: 600; color: var(--text-muted); }
.po-rep.is-pendingownerapproval .po-chips li { background: var(--surface); }
.po-activity { display: grid; gap: 4px; margin: 0; padding-inline-start: 1.1rem; font-size: .8rem; color: var(--text-muted); }
.po-add-row {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: none; box-shadow: none; color: var(--text-muted); font-weight: 600;
}
.po-add-row:hover:not(:disabled) { border-color: var(--brand-primary, var(--odpo-ink)); background: none; color: var(--text); }
.po-add-row svg { width: 18px; height: 18px; }
.po-rep-form { display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.po-rep-form h4 { margin: 0; font-size: 1rem; }
.po-form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.po-form-actions button { min-height: 42px; }

/* ---- the representative form ---- */
.rf { display: grid; gap: var(--space-4); }
.rf-person { display: grid; gap: var(--space-2); }
.rf-perms, .rf-scope { display: block; margin: 0; padding: 0; border: 0; min-width: 0; }
.rf-perms legend, .rf-scope legend { margin-bottom: var(--space-2); padding: 0; }
.rf-perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-2); }
.rf-scope .rf-units { margin-top: var(--space-2); }
.rf-perm {
  display: flex; align-items: flex-start; gap: 10px; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.rf-perm:hover { border-color: var(--border-strong); }
.rf-perm.is-on { border-color: var(--brand-primary, var(--odpo-ink)); background: color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 5%, var(--surface)); }
.rf-perm input { margin-top: 3px; }
.rf-perm span { display: grid; gap: 2px; }
.rf-perm small { font-size: .76rem; line-height: 1.5; color: var(--text-muted); }
.rf-perm:has(input:focus-visible) { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.rf-scope-choice { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.rf-scope-choice label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.rf-units { display: grid; gap: 2px; max-height: 260px; margin: 0; padding: var(--space-2); overflow-y: auto; list-style: none; border: 1px solid var(--border); border-radius: var(--radius); }
.rf-units label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 38px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.rf-units label:hover { background: var(--surface-sunken); }
.rf-ends input { width: min(220px, 100%); }

/* ---- «أتصفّح باسم» ---- */
.af {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); max-width: 1160px; margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.af-label { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 650; color: var(--text-muted); }
.af-label svg { width: 17px; height: 17px; }
.af-options { display: flex; flex-wrap: wrap; gap: 6px; }
.af-options button { min-height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: none; color: var(--text); font-weight: 600; }
.af-options button:hover:not(.is-on) { border-color: var(--border-strong); background: var(--surface); }
.af-options button.is-on { border-color: var(--brand-primary, var(--odpo-ink)); background: var(--brand-primary, var(--odpo-ink)); color: #fff; }
.af-note { flex-basis: 100%; margin: 0; font-size: .8rem; color: var(--text-muted); }

/* ---- «الموافقات والتوقيعات» ---- */
.ap-head { margin-bottom: var(--space-4); }
.ap-intro { max-width: 68ch; margin: 0; color: var(--text-muted); line-height: 1.7; }
.ap-summary { margin: 0 0 var(--space-4); font-weight: 650; }
.ap-section { max-width: 820px; margin-bottom: var(--space-6); }
.ap-section > h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--space-3); font-size: 1.05rem; }
.ap-section > h2 svg { width: 19px; height: 19px; color: var(--text-muted); }
.ap-list { display: grid; gap: var(--space-3); max-width: 820px; }
.ap-card { display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.ap-card.is-waiting { border-color: color-mix(in srgb, var(--warn) 30%, var(--border)); box-shadow: inset 3px 0 0 var(--accent), var(--shadow-sm); }
[dir="rtl"] .ap-card.is-waiting { box-shadow: inset -3px 0 0 var(--accent), var(--shadow-sm); }
.ap-card.is-closed { background: var(--surface-sunken); box-shadow: none; }
.ap-card.is-skeleton .odpo-skeleton { display: block; height: 12px; }
.ap-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.ap-card-head h3 { margin: 0; font-size: 1rem; }
.ap-card-head p { margin: 4px 0 0; font-size: .82rem; color: var(--text-muted); }
.ap-for { margin: 0; font-size: .82rem; font-weight: 650; color: var(--brand-secondary, var(--odpo-violet)); }
.ap-change { display: grid; gap: 2px; }
.ap-share { display: flex; justify-content: space-between; gap: var(--space-3); padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.ap-share b { font-variant-numeric: tabular-nums; }
.ap-share.is-company, .ap-share.is-other { font-size: .84rem; color: var(--text-muted); }
.ap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ap-actions .odpo-btn-primary { min-height: 42px; }
.ap-btn-link { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: var(--radius); text-decoration: none; }
.ap-code {
  display: grid; justify-items: center; gap: 4px; padding: var(--space-4); border-radius: var(--radius-lg); text-align: center;
  background: var(--brand-primary, var(--odpo-ink)); color: #fff;
}
.ap-code-label { font-size: .8rem; color: rgba(255, 255, 255, .72); }
.ap-code-value { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: clamp(1.9rem, 6vw, 2.5rem); font-weight: 700; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.ap-code-timer { font-size: .84rem; color: var(--accent-soft); font-variant-numeric: tabular-nums; }
.ap-code p { margin: 4px 0 0; font-size: .8rem; color: rgba(255, 255, 255, .8); }
.ap-code-value.is-hidden { opacity: .55; letter-spacing: .1em; }
.ap-code .ap-code-sms { margin: 0; font-size: .74rem; color: rgba(255, 255, 255, .62); }
.ap-code-entry .po-code-row { gap: var(--space-2) var(--space-3); }
.ap-reject { display: grid; gap: var(--space-2); }
.ap-reject textarea { width: 100%; }
/* «موافقة» while the platform has switched codes off: one confirmation, no code (OtpSwitches). */
.ap-confirm { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-sunken); }
.ap-confirm p { margin: 0; font-weight: 600; }
.po-record p { margin: 0; }
.ap-done { margin: 0; font-size: .86rem; color: var(--text-muted); }
.ap-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-2) var(--space-4); margin: 0; }
.ap-facts dt { font-size: .76rem; color: var(--text-muted); }
.ap-facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ap-empty { display: grid; justify-items: center; gap: var(--space-2); max-width: 820px; padding: var(--space-7) var(--space-5); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); text-align: center; color: var(--text-muted); }
.ap-empty svg { width: 30px; height: 30px; color: var(--ok); }
.ap-empty h2 { margin: 0; font-size: 1.05rem; color: var(--text); }
.ap-empty p { margin: 0; max-width: 52ch; }
.ap-empty.is-compact { padding: var(--space-5); }

/* ---- «ممثّلوني» ---- */
.mr-head { margin-bottom: var(--space-4); }
.mr-intro { max-width: 68ch; margin: 0; color: var(--text-muted); line-height: 1.7; }
.mr-section { max-width: 820px; margin-bottom: var(--space-6); }
.mr-section > h2 { margin: 0 0 var(--space-3); font-size: 1.05rem; }
.mr-form { display: grid; gap: var(--space-4); max-width: 820px; margin-bottom: var(--space-6); padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.mr-form h2 { margin: 0; font-size: 1.05rem; }
.mr-actions { display: flex; flex-wrap: wrap; gap: 4px var(--space-3); }

/* ---- the contract's signers (Contracts.razor sheet) and owners' signatures (ContractDocument.razor) ---- */
.cx-signing { display: grid; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.cx-signing-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.cx-signing-head h3 { margin: 0; font-size: .95rem; }
.cx-signers { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.cx-signers li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 4px var(--space-3); padding: 8px 0; border-bottom: 1px solid var(--border); }
.cx-signers li:last-child { border-bottom: 0; }
.cx-signer-mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-sunken); font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.cx-signers li.is-done .cx-signer-mark { background: var(--ok-bg); color: var(--ok); }
.cx-signers li.is-declined .cx-signer-mark { background: var(--danger-bg); color: var(--danger); }
.cx-signer-state { font-size: .8rem; color: var(--text-muted); text-align: end; }
.cx-signers li.is-declined .cx-signer-state { color: var(--danger); }
.cx-signers li .po-link { grid-column: 2 / -1; justify-self: start; }
.cd-owner-signatures { display: flex; flex-wrap: wrap; gap: var(--space-5); margin-top: 2em; }
.cd-owner-card { max-width: 600px; margin-top: var(--space-5); display: grid; gap: var(--space-2); }
.cd-owner-card h2 { margin: 0; }
.cd-pad { width: 100%; max-width: 560px; height: 180px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; touch-action: none; }

/* ---- home: something waits for approval ---- */
.odpo-home-attention {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 18px; align-items: center; gap: var(--space-3);
  margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--border));
  border-radius: var(--radius-lg); background: var(--warn-bg); color: var(--text); text-decoration: none;
  transition: box-shadow .15s var(--ease);
}
.odpo-home-attention:hover { box-shadow: var(--shadow-sm); }
.odpo-home-attention:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; }
.odpo-home-attention-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface); color: var(--warn); }
.odpo-home-attention-icon svg { width: 20px; height: 20px; }
.odpo-home-attention-text { display: grid; gap: 2px; }
.odpo-home-attention-text small { font-size: .8rem; color: var(--text-muted); }

/* ---- home: an urgent message is unread; the notifications card's unread count ---- */
.odpo-home-attention.is-urgent { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: var(--danger-bg); }
.odpo-home-attention.is-urgent .odpo-home-attention-icon { color: var(--danger); }
.odpo-home-attention.is-urgent .odpo-home-attention-text b { color: var(--danger); }
.odpo-home-attention + .odpo-home-attention { margin-top: calc(-1 * var(--space-3)); }

.odpo-hub-card-icon { position: relative; }
.odpo-hub-card-badge {
  position: absolute; inset-block-start: -7px; inset-inline-end: -9px;
  min-inline-size: 22px; block-size: 22px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--brand-primary, var(--odpo-ink)); color: #fff;
  box-shadow: 0 0 0 2px var(--surface-raised);
  font-size: .72rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.odpo-hub-card-badge.is-urgent { background: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .po-tiles .po-tile, .po-rows .po-row, .po-seg, .rf-perm, .odpo-home-attention { transition: none; }
}

@media (max-width: 960px) {
  .po-overview { grid-template-columns: minmax(0, 1fr); }
  .po-rows .po-unit { grid-template-columns: minmax(0, 1fr) auto; }
  .po-rows .po-unit .po-unit-split { grid-column: 1 / -1; grid-row: 2; }
  .po-rows .po-unit .cx-go { display: none; }
}
@media (max-width: 640px) {
  .po-tiles { display: flex; gap: var(--space-2); margin-inline: calc(-1 * var(--space-4)); padding: 2px var(--space-4) 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .po-tiles::-webkit-scrollbar { display: none; }
  .po-tiles .po-tile { flex: 0 0 auto; min-height: 0; min-width: 132px; padding: 10px 14px; scroll-snap-align: start; }
  .po-hero { min-height: 0; }
  .po-toolbar { align-items: stretch; }
  .po-switch { width: 100%; }
  .po-switch button { flex: 1 1 0; justify-content: center; }
  .po-search, .po-search input { width: 100%; }
  .po-rows .po-row { padding: 12px var(--space-4); }
  .po-rows .po-owner { grid-template-columns: 40px minmax(0, 1fr); }
  .po-rows .po-owner .po-owner-facts { grid-column: 2; justify-content: flex-start; }
  .po-rows .po-owner .cx-go { display: none; }
  .po-pct input { width: 76px; }
  .ap-card { padding: var(--space-4); }
  .ap-card-head { flex-direction: column; }
  .cx-signers li { grid-template-columns: 26px minmax(0, 1fr); }
  .cx-signer-state { grid-column: 2; text-align: start; }
}

/* ---- Company registrations: the platform admin's queue (CompanyRegistrations.razor) ---- */
.crg-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--border));
  border-radius: var(--radius);
  background: var(--warn-bg);
  color: var(--warn);
  font-weight: 600;
  text-decoration: none;
}
.crg-banner svg { width: 18px; height: 18px; flex: none; }
.crg-banner-go { margin-inline-start: auto; text-decoration: underline; }
.crg-banner:hover { color: var(--warn); filter: brightness(.98); }

.crg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-4);
  border-bottom: 1px solid var(--border);
}
.crg-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.crg-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-bottom: -1px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 600;
}
.crg-tab:hover:not(.is-active):not(:disabled) { color: var(--text); background: none; }
.crg-tab.is-active { border-bottom-color: var(--brand-primary, var(--odpo-ink)); color: var(--text); }
.crg-tab-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-sunken);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.crg-tab-count.is-due { background: var(--warn-bg); color: var(--warn); }
.crg-search { margin-bottom: var(--space-2); }
.crg-search input { min-width: min(320px, 100%); }

.crg-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.crg-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  min-height: 64px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
  color: var(--text);
  font-weight: 400;
  text-align: start;
}
.crg-row:hover:not(:disabled):not([type="submit"]) { border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
.crg-row-main, .crg-row-person { display: grid; gap: 3px; min-width: 0; }
.crg-row-name { font-weight: 650; overflow-wrap: anywhere; }
.crg-row-sub, .crg-row-person { font-size: .82rem; color: var(--text-muted); }
.crg-row-person > span:first-child { color: var(--text); font-size: .9rem; }
.crg-row-phone { font-variant-numeric: tabular-nums; }
.crg-row-meta { display: grid; justify-items: end; gap: 6px; font-size: .8rem; color: var(--text-muted); }
.crg-pill-waiting { background: color-mix(in srgb, var(--brand-secondary, var(--odpo-violet)) 10%, var(--surface)); color: var(--brand-secondary, var(--odpo-violet)); }

.crg-empty {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  text-align: center;
}
.crg-empty p { margin: 0; max-width: 46ch; line-height: 1.7; }
.crg-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-sunken); }
.crg-empty-icon svg { width: 22px; height: 22px; }

.crg-skeleton { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.crg-skeleton span { display: block; height: 64px; border-radius: var(--radius); background: var(--surface-sunken); }
@media (prefers-reduced-motion: no-preference) {
  .crg-skeleton span { animation: ux-pulse 1.4s ease-in-out infinite; }
}

.crg-facts { display: grid; gap: var(--space-2); }
.crg-facts h3 { margin: 0; font-size: .95rem; }
.crg-facts dl {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 8px var(--space-4);
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font-size: .88rem;
}
.crg-facts dt { color: var(--text-muted); }
.crg-facts dd { margin: 0; overflow-wrap: anywhere; }
.crg-notes { margin: 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface-sunken); line-height: 1.7; white-space: pre-line; }
.crg-existing { margin: 0; }
.crg-link { justify-self: start; font-weight: 650; }
.crg-reject { display: grid; gap: var(--space-2); }
.crg-reject h3 { margin: 0; font-size: .95rem; }
.crg-reject textarea { width: 100%; }

.crg-foot .crg-foot-close { margin-inline-start: auto; }
.crg-primary, .crg-primary:hover:not(:disabled):not([type="submit"]) {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 88%, white),
      var(--brand-primary, var(--odpo-ink)));
  border: 1px solid color-mix(in srgb, var(--brand-primary, var(--odpo-ink)) 80%, black);
  color: #fff;
  font-weight: 650;
}
.crg-primary:hover:not(:disabled) { filter: brightness(1.08); }
.crg-danger, .crg-danger:hover:not(:disabled):not([type="submit"]) {
  background: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 80%, black);
  color: #fff;
  font-weight: 650;
}
.crg-danger-quiet { color: var(--danger); }

@media (max-width: 720px) {
  .crg-row { grid-template-columns: minmax(0, 1fr) auto; }
  .crg-row-person { grid-column: 1 / 2; grid-row: 2; }
  .crg-row-meta { grid-row: 1 / 3; grid-column: 2; }
  .crg-facts dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .crg-facts dd { margin-bottom: 6px; }
}

/* ===================================================================================
   Owners' shares of the rent (2026-11-15), prefix os- (with sp- for the period picker).
   «حصص المُلّاك» for the company and «حصتي من الإيجار» for the owner: (rent − expenses) ×
   the owner's percentage, per ownership period. Built on the owners screen's po- pieces (hero,
   switch, rows, empty states) and the shared .ux-sheet; the company's share keeps the accent,
   as on the ownership bar.
   =================================================================================== */

/* ---- the period: month or year, back and forth ---- */
.sp { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); max-width: 1160px; margin: 0 0 var(--space-4); }
.sp-nav { display: flex; align-items: center; gap: var(--space-2); }
.sp-step {
  display: grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: none; color: var(--text);
}
.sp-step:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-sunken); }
.sp-step:disabled { opacity: .4; }
.sp-step svg { width: 18px; height: 18px; }
/* The chevron points right: "next" goes forward in the reading direction, "previous" back. */
[dir="ltr"] .sp-prev svg, [dir="rtl"] .sp-next svg { transform: scaleX(-1); }
.sp-label { display: grid; min-width: 200px; text-align: center; line-height: 1.3; }
.sp-label b { font-size: 1.05rem; }
.sp-label small { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---- the period in figures ---- */
.os-overview { margin-bottom: var(--space-3); }
.os-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.os-figure {
  display: grid; align-content: space-between; gap: var(--space-2); min-height: 108px; padding: var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.os-figure-label { font-size: .84rem; font-weight: 600; color: var(--text-muted); }
.os-figure-value { font-size: 1.45rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.os-figure.is-company { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }
.os-rule { max-width: 1160px; margin: 0 0 var(--space-5); font-size: .84rem; line-height: 1.7; color: var(--text-muted); text-wrap: pretty; }
.os-figure.is-negative .os-figure-value, .os-unit-sum b.is-negative, .os-owner-amount.is-negative,
.os-card-amount b.is-negative, .os-sum .is-negative b { color: var(--danger); }

/* ---- rows ---- */
.po-rows .os-unit { grid-template-columns: minmax(120px, 1fr) minmax(0, 1.5fr) minmax(0, 1.6fr) auto 18px; }
.os-unit-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.os-unit-sum small { font-size: .72rem; color: var(--text-faint); }
.os-unit-sum b { font-size: 1rem; }
.os-op { color: var(--text-faint); }
.os-unit-who { overflow: hidden; font-size: .8rem; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.os-owner-amount { font-size: 1rem; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.os-owner-amount small { font-size: .74rem; font-weight: 600; color: var(--text-muted); }

/* ---- the unit's sheet ---- */
.os-sum { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-sunken); }
.os-sum > div { display: grid; gap: 2px; flex: 1 1 88px; }
.os-sum > div span { font-size: .78rem; color: var(--text-muted); }
.os-sum b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.os-sum .is-net b { color: var(--brand-primary, var(--odpo-ink)); }
.os-seg { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); }
.os-seg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-3); padding: 10px var(--space-4); background: var(--surface-sunken); font-size: .84rem; font-variant-numeric: tabular-nums; }
.os-seg-head span { color: var(--text-muted); }
.os-seg-head .os-seg-net { margin-inline-start: auto; color: var(--text); }
.os-parts { margin: 0; padding: 0; list-style: none; }
.os-parts li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: var(--space-3); padding: 10px var(--space-4); }
.os-parts li + li { border-top: 1px solid var(--border); }
.os-part-who { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.os-part-calc { font-size: .78rem; color: var(--text-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.os-part-amount { font-variant-numeric: tabular-nums; }
.os-parts li.is-company { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.os-parts li.is-company .os-part-who { color: var(--text-muted); }

.os-expenses { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.os-expenses li { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding-block: 8px; padding-inline: 12px 8px; border-radius: var(--radius); background: var(--surface-sunken); }
.os-exp-main { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
.os-exp-main b { font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.os-exp-main small { font-size: .76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.os-exp-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.os-exp-confirm { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.os-add { display: grid; gap: var(--space-2); margin-top: var(--space-2); padding: var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.os-add h4 { margin: 0; font-size: .92rem; }
.os-add-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.os-add-fields .odpo-field { margin: 0; }
.os-add-fields input { width: 100%; }
.os-add-what { grid-column: 1 / -1; }
.os-add input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.os-add button[type="submit"] { justify-self: start; min-height: 42px; }

/* ---- the owner's own screen ---- */
.os-mine-hero { max-width: 1160px; margin-bottom: var(--space-4); }
.os-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--space-3); max-width: 1160px; }
.os-card {
  display: grid; align-content: start; gap: var(--space-3); padding: var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm);
}
.os-card.is-skeleton { gap: 10px; }
.os-card.is-skeleton .odpo-skeleton { display: block; height: 14px; }
.os-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.os-card-amount { display: grid; justify-items: end; text-align: end; }
.os-card-amount span { font-size: .78rem; color: var(--text-muted); }
.os-card-amount b { font-size: 1.5rem; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; }
.os-card-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: .84rem; color: var(--text-muted); }
.os-mine-segs { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.os-mine-segs li { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-sunken); }
.os-mine-when { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.os-mine-calc { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: .92rem; font-variant-numeric: tabular-nums; }
.os-mine-calc > span { white-space: nowrap; }
.os-mine-calc small { font-size: .72rem; color: var(--text-faint); }
.os-mine-exp summary {
  display: flex; align-items: center; min-height: 32px; cursor: pointer;
  font-size: .84rem; font-weight: 600; color: var(--brand-secondary, var(--odpo-violet));
}
.os-mine-exp summary:focus-visible { outline: 2px solid var(--brand-secondary, var(--odpo-violet)); outline-offset: 2px; border-radius: 4px; }
.os-mine-exp .os-expenses { margin-top: 6px; }

@media (max-width: 960px) {
  .os-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .po-rows .os-unit { grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--space-3); }
  .po-rows .os-unit .os-unit-sum, .po-rows .os-unit .os-unit-who { grid-column: 1 / -1; }
  .po-rows .os-unit .po-flags { grid-column: 2; grid-row: 1; }
  .po-rows .os-unit .cx-go { display: none; }
}
@media (max-width: 640px) {
  .sp { gap: var(--space-2); }
  .sp-mode { width: 100%; }
  .sp-nav { flex: 1 1 100%; justify-content: space-between; }
  .sp-label { flex: 1 1 auto; min-width: 0; }
  .os-figure { min-height: 0; padding: 12px 14px; }
  .os-figure-value { font-size: 1.2rem; }
  .os-cards { grid-template-columns: minmax(0, 1fr); }
  .os-card { padding: var(--space-4); }
  .os-add-fields { grid-template-columns: minmax(0, 1fr); }
  .os-parts li { grid-template-columns: minmax(0, 1fr) auto; }
  .os-part-calc { grid-column: 1; grid-row: 2; }
  .os-part-amount { grid-row: 1 / span 2; align-self: center; }
}
