/* Motion and feel (owner, 2026-11-06 — all 12 ideas of «معمل شكل البرنامج»). The styles of motion.js; loaded last. */
@layer ui-state;

/* (1) going from one page of the app to another (لوحة الإدارة → الـ IT …) cross-fades instead of a white flash
   (Chrome/Edge, Safari 18.2+; others just open the page) */
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: .28s; }

/* (1) the window going back into the card that opened it */
.ui-ghost { position: fixed; z-index: 99990; border-radius: 20px; pointer-events: none; transform-origin: 50% 50%;
  box-shadow: 0 30px 60px -24px rgba(15, 20, 60, .45); }

/* (2) the chosen tab's fill on its way to the new tab */
.ui-tabs-moving { position: relative; isolation: isolate; }
.ui-tabs-moving > button { position: relative; z-index: 1; }
.ui-pill { position: absolute; z-index: 0; pointer-events: none; transform-origin: 0 50%; }
@layer ui-state {
  .ui-tab-ghost { background: transparent !important; background-image: none !important; box-shadow: none !important; border-color: transparent !important; }
}

/* (3) a phone: the header of a window is where it is dragged from */
@media (max-width:760px), (max-height:500px) and (max-width:1000px) {
  :is(.wn, .limits-card, .po-mgmt-card, .rep-card, .v61-card, .v62-card, .v63-card, .v65-card, .v70-card, .modal-card) > :is(.wn-h, [class$="-head"]) { touch-action: none; }
  .wn > .wn-h { position: relative; padding-top: 22px; }
  .wn > .wn-h::before { content: ""; position: absolute; top: 8px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: color-mix(in srgb, var(--muted, #8a90a8) 45%, transparent); }
  /* (4) rows that can be swiped keep the page's own vertical scroll */
  .wn-row, .ac-row { touch-action: pan-y; }
}

/* (4) under the row while it is swiped: green «اعتماد» on the right, red «رفض» on the left */
.ui-swiping { position: relative; z-index: 1; will-change: transform; }
.ui-sw-under { position: fixed; z-index: 0; overflow: hidden; pointer-events: none; color: #fff; font: 700 14px/1 'Noto Kufi Arabic', Tahoma, sans-serif; }
.ui-sw-under > span { position: absolute; inset: 0; display: none; align-items: flex-start; gap: 8px; padding: var(--y, 18px) 20px 0; }
.ui-sw-under[data-side="ok"] .ui-sw-a { display: flex; background: #16834a; direction: ltr; justify-content: flex-end; }
.ui-sw-under[data-side="no"] .ui-sw-r { display: flex; background: #c4302b; direction: ltr; justify-content: flex-start; }
.ui-sw-under svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ui-spring, ease); }
.ui-sw-under:not([data-armed="0"]):not([data-armed=""]) svg { transform: scale(1.35); }
.ui-sw-under:not([data-armed="-1"]) .ui-sw-a, .ui-sw-under:not([data-armed="1"]) .ui-sw-r { filter: saturate(.55) brightness(.95); }

/* (5) a phone: the page's title, small, under the top bar once its big title has scrolled away */
.ui-ctitle { position: fixed; left: 0; right: 0; top: 0; z-index: 1400; height: 36px; display: flex; align-items: center; justify-content: center;
  padding-inline: 16px; font: 700 14px/1.2 'Noto Kufi Arabic', Tahoma, sans-serif; color: var(--text, #151b34); background: var(--card-bg, #fff);
  border-bottom: 1px solid var(--line, #e3e7f1); box-shadow: 0 8px 16px -12px rgba(16, 24, 40, .35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .2s ease, transform .35s var(--ui-spring, ease); }
.ui-ctitle.on { opacity: 1; transform: none; }
@media (min-width:761px) { .ui-ctitle { display: none; } }

/* (8) a laptop: a window opened from a row of another window stands on its left; the list stays where it is (moving or
   resizing a long list made every open and close lag), and its number and name columns on the right stay in view */
@media (min-width:1280px) {
  :root { --ui-dock-w: min(560px, 40vw); }
  .ui-dock > :first-child.ui-dock-wide { --ui-dock-w: min(720px, 46vw); }
  /* the panel: on the left edge of the screen (the list stays on the reading side, beside the menu) */
  html body .ui-dock.ui-dock { background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; pointer-events: none; }
  .ui-dock > :first-child { pointer-events: auto; position: fixed !important; left: 16px; top: 16px; bottom: 16px; width: var(--ui-dock-w) !important; max-width: var(--ui-dock-w) !important;
    max-height: none !important; margin: 0 !important; box-shadow: 0 30px 70px -20px rgba(15, 20, 60, .55), 0 0 0 1px rgba(43, 52, 132, .12) !important; }
  .ui-row-sel, .ui-row-sel > td { background: color-mix(in srgb, #2B3484 9%, var(--card-bg, #fff)) !important; }
  .ui-row-sel { box-shadow: inset -3px 0 0 #2B3484 !important; }
  :root[data-theme="dark"] :is(.ui-row-sel, .ui-row-sel > td) { background: color-mix(in srgb, #8592ff 16%, var(--card-bg, #181f30)) !important; }
}

/* (12) an empty list: a drawing above its words */
.ui-empty { text-align: center !important; color: var(--muted, #6b7390); padding-block: 18px !important; }
.ui-empty::before { content: ""; display: block; width: 92px; height: 70px; margin: 0 auto 10px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 120'%3E%3Cellipse cx='80' cy='108' rx='54' ry='7' fill='%23e9edf8'/%3E%3Cpath d='M34 46 80 26l46 20v44L80 110 34 90Z' fill='%23fff' stroke='%23C9CFE0' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M34 46 80 66l46-20M80 66v44' fill='none' stroke='%23C9CFE0' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='116' cy='30' r='19' fill='%232B3484'/%3E%3Cpath d='m107 30 7 7 11-12' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .ui-empty::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 120'%3E%3Cellipse cx='80' cy='108' rx='54' ry='7' fill='%23232a4d'/%3E%3Cpath d='M34 46 80 26l46 20v44L80 110 34 90Z' fill='%23181f30' stroke='%236b7399' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M34 46 80 66l46-20M80 66v44' fill='none' stroke='%236b7399' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='116' cy='30' r='19' fill='%234553c4'/%3E%3Cpath d='m107 30 7 7 11-12' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ui-empty::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 120'%3E%3Cellipse cx='80' cy='108' rx='54' ry='7' fill='%23232a4d'/%3E%3Cpath d='M34 46 80 26l46 20v44L80 110 34 90Z' fill='%23181f30' stroke='%236b7399' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M34 46 80 66l46-20M80 66v44' fill='none' stroke='%236b7399' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='116' cy='30' r='19' fill='%234553c4'/%3E%3Cpath d='m107 30 7 7 11-12' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); } }

/* (12) a finished job */
.ui-cele { position: fixed; inset: 0; z-index: 99995; display: grid; place-items: center; background: rgba(10, 14, 36, .38); animation: uiFade .2s ease; cursor: pointer; }
.ui-cele.out { opacity: 0; transition: opacity .25s ease; }
.ui-cele-cv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ui-cele-card { position: relative; z-index: 1; width: min(300px, calc(100vw - 48px)); padding: 26px 22px 22px; border-radius: 24px; background: var(--card-bg, #fff); color: var(--text, #151b34);
  text-align: center; display: grid; justify-items: center; gap: 6px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .5); animation: uiPop .5s var(--ui-spring, ease);
  font-family: 'Noto Kufi Arabic', Tahoma, sans-serif; }
.ui-cele-card b { font-size: 18px; font-weight: 700; }
.ui-cele-card small { font-size: 13px; color: var(--muted, #6b7390); }
.ui-cele-ring { width: 104px; height: 104px; margin-bottom: 6px; }
.ui-cele-ring circle { fill: none; stroke-width: 9; }
.ui-cele-ring .bg { stroke: color-mix(in srgb, #16834a 16%, transparent); }
.ui-cele-ring .fg { stroke: #16834a; stroke-linecap: round; stroke-dasharray: 314.2; stroke-dashoffset: 314.2; transform: rotate(-90deg); transform-origin: 60px 60px; animation: uiRing .8s .1s cubic-bezier(.2, .8, .2, 1) forwards; }
.ui-cele-ring .ck { fill: none; stroke: #16834a; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 70; stroke-dashoffset: 70; animation: uiCk .35s .75s ease-out forwards; }
@keyframes uiFade { from { opacity: 0; } }
@keyframes uiPop { from { opacity: 0; transform: scale(.85); } }
@keyframes uiRing { to { stroke-dashoffset: 0; } }
@keyframes uiCk { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .ui-ctitle { transition: none; }
  .ui-cele, .ui-cele-card, .ui-cele-ring .fg, .ui-cele-ring .ck { animation: none; }
  .ui-cele-ring .fg, .ui-cele-ring .ck { stroke-dashoffset: 0; }
}

/* (9) quieter tables on a laptop (ui-tables.js): the «⋯» of a row and its list, «عرض مضغوط», an item's small card */
@layer ui-state { .ui-in-menu { display: none !important; } }
.ui-more { all: unset; box-sizing: border-box; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
  color: var(--muted, #6b7390); border: 1px solid var(--line, #e3e7f1); background: var(--card-bg, #fff); vertical-align: middle; margin-inline-start: 6px; }
.ui-more:hover, .ui-more[aria-expanded="true"] { color: var(--text, #151b34); border-color: color-mix(in srgb, #2B3484 40%, var(--line, #e3e7f1)); }
.ui-more:focus-visible { outline: 2px solid #2B3484; outline-offset: 2px; }
.ui-menu { position: fixed; z-index: 100000; min-width: 200px; max-width: 300px; padding: 6px; border-radius: 14px; background: var(--card-bg, #fff); color: var(--text, #151b34);
  border: 1px solid var(--line, #e3e7f1); box-shadow: 0 22px 48px -14px rgba(15, 20, 60, .4); font-family: 'Noto Kufi Arabic', Tahoma, sans-serif; direction: rtl;
  transform-origin: top left; animation: uiMenuIn .3s var(--ui-spring, ease); }
.ui-menu button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.ui-menu button svg, .ui-menu .ui-mi { width: 17px; height: 17px; flex: none; color: var(--muted, #6b7390); }
.ui-menu button:hover, .ui-menu button:focus-visible { background: color-mix(in srgb, #2B3484 8%, transparent); }
.ui-menu button.danger, .ui-menu button.danger svg { color: #c4302b; }
.ui-menu button[disabled] { opacity: .45; cursor: not-allowed; }
.ui-menu hr { border: 0; border-top: 1px solid var(--line, #e3e7f1); margin: 5px 4px; }
@keyframes uiMenuIn { from { opacity: 0; transform: scale(.92); } }
.ui-dense-btn { all: unset; box-sizing: border-box; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--muted); cursor: pointer; border: 1px solid var(--line); flex: none; }
.ui-dense-btn:hover, .ui-dense-btn[aria-pressed="true"] { color: var(--text); }
.ui-dense-btn[aria-pressed="true"] { border-color: color-mix(in srgb, #2B3484 45%, var(--line)); }
.ui-dense-btn:focus-visible { outline: 2px solid var(--wn-ring, #2B3484); outline-offset: 2px; }
.wn-acts .ui-dense-btn { margin-inline-start: auto; } .wn-acts .ui-dense-btn + .wn-rf { margin-inline-start: 0; }
@layer ui-state {
  html.ui-dense :is(.wn, .po-mgmt-card, .modal-card, .limits-card, .rep-card) :is(tbody td, thead th) { padding-top: 5px !important; padding-bottom: 5px !important; line-height: 1.4 !important; }
  html.ui-dense :is(.wn, .po-mgmt-card, .modal-card, .limits-card, .rep-card) tbody td { font-size: 12.5px !important; }
  html.ui-dense :is(.wn, .po-mgmt-card, .modal-card, .limits-card, .rep-card) tbody td :is(button, .wn-b) { height: 28px !important; min-height: 28px !important; }
}
.ui-peek { position: fixed; z-index: 100000; width: 240px; padding: 12px 14px; border-radius: 14px; background: var(--card-bg, #fff); color: var(--text, #151b34);
  border: 1px solid var(--line, #e3e7f1); box-shadow: 0 22px 48px -14px rgba(15, 20, 60, .4); display: grid; gap: 6px; pointer-events: none; direction: rtl;
  font: 500 12.5px/1.5 'Noto Kufi Arabic', Tahoma, sans-serif; animation: uiMenuIn .3s var(--ui-spring, ease); }
.ui-peek > b { font-size: 14px; font-weight: 700; }
.ui-peek-code { font: 12px ui-monospace, Consolas, monospace; color: var(--muted, #6b7390); }
.ui-peek-bars { display: grid; gap: 6px; margin-top: 2px; }
.ui-peek-bars > div { display: grid; grid-template-columns: 58px 1fr 44px; gap: 8px; align-items: center; }
.ui-peek-bars i { display: flex; direction: rtl; height: 8px; border-radius: 8px; background: color-mix(in srgb, #2B3484 10%, transparent); overflow: hidden; }
.ui-peek-bars u { display: block; height: 100%; border-radius: 8px; background: #2B3484; text-decoration: none; }
.ui-peek-bars u.z { background: #c4302b; width: 4px !important; }
.ui-peek-bars b { text-align: end; font-variant-numeric: tabular-nums; }
.ui-peek small { color: var(--muted, #6b7390); font-size: 11.5px; }
:root[data-theme="dark"] :is(.ui-peek-bars u) { background: #8592ff; }
@media (prefers-reduced-motion: reduce) { .ui-menu, .ui-peek { animation: none; } }
/* the page's shared look (ui.css, a layer) paints a button inside a cell as a main button: the «⋯» keeps its quiet look */
@layer ui-state {
  .ui-more { background: var(--card-bg, #fff) !important; color: var(--muted, #6b7390) !important; border: 1px solid var(--line, #e3e7f1) !important; box-shadow: none !important;
    height: 32px !important; min-height: 32px !important; padding: 0 !important; }
  .ui-more:hover, .ui-more[aria-expanded="true"] { color: var(--text, #151b34) !important; border-color: color-mix(in srgb, #2B3484 40%, var(--line, #e3e7f1)) !important; }
}

/* (10) «اسأل الأرشيف»: the answer as a card (ask-cards.js) */
.ak-card { --ak-a: #2B3484; --ak-b: #C9CFE0; margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-bg); overflow: hidden; animation: uiPop .45s var(--ui-spring, ease); }
:root[data-theme="dark"] .ak-card { --ak-a: #8592ff; --ak-b: #3a4270; }
.ak-draw { padding: 14px 16px 8px; }
.ak-cap { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.ak-bars { display: grid; gap: 8px; }
.ak-bar { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.ak-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-bar i { display: flex; direction: rtl; height: 10px; border-radius: 10px; background: color-mix(in srgb, var(--ak-a) 10%, transparent); overflow: hidden; }
.ak-bar u { display: block; height: 100%; border-radius: 10px; background: var(--ak-a); text-decoration: none; }
.ak-bar b { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 48px; text-align: end; }
.ak-cols { width: 100%; height: auto; }
.ak-figs { display: flex; flex-wrap: wrap; gap: 12px; }
.ak-figs > div { flex: 1 1 140px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ak-a) 6%, transparent); display: grid; gap: 2px; }
.ak-figs b { font-size: 28px; font-weight: 700; color: var(--ak-a); font-variant-numeric: tabular-nums; line-height: 1.2; }
.ak-figs span { font-size: 12px; color: var(--muted); }
.ak-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--ak-a) 4%, transparent); border-top: 1px solid var(--line); }
.ak-src { font-size: 11.5px; color: var(--muted); }
.ak-acts { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 8px; }

/* (3) the staff app's and the driver's sheets: the grab bar (a finger-sized area around it) and the title are where a
   sheet is dragged down from */
.sheet.show > :is(.sheet-grab, h3) { touch-action: none; }
.sheet-grab { position: relative; }
.sheet-grab::after { content: ""; position: absolute; inset: -14px -70px; }
