/**
 * HamlyERP
 * Copyright (c) 2026 Nolwa Private Limited. All rights reserved.
 * Proprietary and confidential. Unauthorised copying, modification or distribution of this file is prohibited.
 */
/* The v2 application shell (layouts/app-v2, P03b; owner decision 10 Oct 2026). Port of the frozen v3 prototype's
   shell rules (doc-form.css "App shell", app.css navigation / top bar / palette / user menu / drawer / icon rail /
   footer / scrollbars / steady scrolling, dark.css shell colours) on the tokens of css/doc-form.css, which sit on
   <body class="df-v2">. Today's stylesheets still load before this file (quick-add modals, select2, toastr), so the
   shell rules carry the body class where a legacy rule would otherwise win. */

/* ---------- fonts (ADDENDUM §12: WOFF2 / TTF with swap) ---------- */
/* One face per exact weight 100-900, never a range (W3, 22 Oct): riyal.css (R1j v2) adds a U+20C1 face to "Inter" and
   "Almarai" at each exact weight, and Chrome / Edge group faces by their weight descriptor. A ranged face here ("100 900",
   "600 700") is a separate group, the riyal face's group won, and the text fell back to Segoe UI / Tahoma (the sign was
   a box at 600-700). Same files, same look: Inter is variable (each face draws its own weight); Almarai 100-500 Regular,
   600-700 Bold, 800-900 ExtraBold, as the browser picked them before. */
@font-face { font-family: "Inter"; src: url("../fonts/Inter/InterVariable.woff2") format("woff2"); font-weight: 100; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter/InterVariable.woff2") format("woff2"); font-weight: 200; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter/InterVariable.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter/InterVariable.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter/InterVariable.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter/InterVariable.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter/InterVariable.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter/InterVariable.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter/InterVariable.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Almarai"; src: url("../fonts/Almarai/Almarai-Regular.ttf") format("truetype"); font-weight: 100; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../fonts/Almarai/Almarai-Regular.ttf") format("truetype"); font-weight: 200; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../fonts/Almarai/Almarai-Regular.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../fonts/Almarai/Almarai-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../fonts/Almarai/Almarai-Regular.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../fonts/Almarai/Almarai-Bold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../fonts/Almarai/Almarai-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../fonts/Almarai/Almarai-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../fonts/Almarai/Almarai-ExtraBold.ttf") format("truetype"); font-weight: 900; font-display: swap; }

/* ---------- page ---------- */
html.df-app { font-size: 16px; scrollbar-gutter: stable; overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ui-shell); }
@media (pointer: coarse), (max-width: 640px) { :root.df-app.df-app, .df-v2.df-v2 { --ui-field-h: 40px; --ui-cell-h: 40px; } }   /* 32px fields, 40px on touch and phones (UI-POL-01) */
html.df-app[data-theme="dark"] { background: #0a0c0b; }
html.df-app[data-theme="dark"][data-dark="warm"] { background: #1b1a19; }
html.df-app.df-locked { overflow: hidden; }
body.df-app-v2 {
  --z-topbar: 1030; --z-nav-backdrop: 1044; --z-nav: 1045; --z-scrim: 1046; --z-drawer: 1047;
  margin: 0; min-height: 100vh; background: var(--ui-shell); color: var(--ui-ink); font-family: var(--df-font); font-size: var(--fs-base); line-height: 1.4;
}
[dir="rtl"] body.df-app-v2 { font-family: var(--df-font-ar); }
body.df-app-v2.df-nav-open { overflow: hidden; }
body.df-app-v2 a:hover, body.df-app-v2 a:focus { text-decoration: none; }

/* ---------- app shell ---------- */
.df-app-v2 .df-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.df-app-v2 .df-side { display: flex; flex-direction: column; overflow-y: auto; background: var(--ui-chrome); border-inline-end: 1px solid var(--ui-line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; height: 100svh; scrollbar-width: thin; }
.df-app-v2 .df-logo { display: flex; align-items: center; padding: 4px 10px 22px; }
.df-app-v2 .df-logo-link { display: block; line-height: 0; }
.df-app-v2 .df-logo-img { display: block; width: 180px; max-width: 100%; height: auto; }
.df-app-v2 .df-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.df-app-v2 .df-content { flex: 1 0 auto; width: 100%; min-width: 0; }
.df-app-v2 .df-content > .df-v2 { display: contents; }
.df-app-v2 .df-page { background: transparent; max-width: 1440px; }
.df-app-v2 .df-backdrop { display: none; }
.df-app-v2 .df-hamburger { display: inline-grid; }

/* ---------- navigation (today's menu, prototype markup) ---------- */
.df-app-v2 .df-nav { flex: 1; }
.df-app-v2 .df-nav a, .df-app-v2 .df-nav-head { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 12px; border-radius: var(--r-lg); border: 0; background: none; color: var(--ui-ink); text-decoration: none; margin-bottom: 2px; font-size: var(--fs-base); font-weight: 500; line-height: 18px; text-align: start; cursor: pointer; }
/* icons and chevrons sit on the first text line, also when a long label wraps */
.df-app-v2 .df-nav a > span:not(.df-nav-ic), .df-app-v2 .df-nav-head > span:not(.df-nav-ic) { min-width: 0; overflow-wrap: anywhere; }
.df-app-v2 .df-nav a:hover, .df-app-v2 .df-nav-head:hover { background: var(--ui-hl); color: var(--ui-ink); }
.df-app-v2 .df-nav > a.is-active { background: linear-gradient(135deg, #0d2b1a, #123c27); color: #fff; }
.df-app-v2 .df-nav-ic { width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center; color: inherit; }
.df-app-v2 .df-nav-ic svg { width: 18px !important; height: 18px !important; }
.df-app-v2 .df-nav-ic i { font-size: 15px; width: auto; height: auto; }
.df-app-v2 .df-nav-caret { width: 14px; height: 14px; flex: none; margin-top: 2px; margin-inline-start: auto; color: var(--ui-icon); transition: transform .15s; }
[dir="rtl"] .df-app-v2 .df-nav-caret { transform: scaleX(-1); }
.df-app-v2 .df-nav-group.is-open .df-nav-caret { transform: rotate(90deg); }
.df-app-v2 .df-nav-head.is-current { color: var(--ui-heading); font-weight: var(--fw-semibold); }
.df-app-v2 .df-nav-head.is-current .df-nav-ic { color: var(--ui-gold-dark); }
.df-app-v2 .df-nav-sub { display: none; padding: 2px 0 6px; margin-inline-start: 21px; border-inline-start: 1px solid var(--ui-line); }
.df-app-v2 .df-nav-group.is-open .df-nav-sub { display: block; }
.df-app-v2 .df-nav .df-nav-sub a { padding: 7px 12px; font-size: var(--fs-md); font-weight: 400; color: var(--ui-muted); border-radius: var(--r-md); margin: 1px 0 1px 8px; width: auto; }
[dir="rtl"] .df-app-v2 .df-nav .df-nav-sub a { margin: 1px 8px 1px 0; }
.df-app-v2 .df-nav .df-nav-sub a:hover { color: var(--ui-ink); }
.df-app-v2 .df-nav .df-nav-sub a.is-active { background: var(--ui-brand-soft); color: var(--ui-heading); font-weight: var(--fw-semibold); }
.df-app-v2 .df-nav-more { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: var(--tt-label); letter-spacing: .5px; color: var(--ui-muted); padding: 10px 12px 2px 20px; }
[dir="rtl"] .df-app-v2 .df-nav-more { padding: 10px 20px 2px 12px; }
.df-app-v2 .df-nav-label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: var(--tt-label); letter-spacing: .5px; color: var(--ui-muted); padding: 14px 12px 4px; }
.df-app-v2 .df-nav-div { height: 1px; background: var(--ui-line); margin: 8px 12px; }

/* ---------- top bar ---------- */
.df-app-v2 .df-topbar { display: flex; align-items: center; gap: 6px; min-height: 60px; padding: 12px 24px; background: var(--ui-chrome); border-bottom: 1px solid var(--ui-line); position: sticky; top: 0; z-index: var(--z-topbar); transform: translateZ(0); }
.df-app-v2 .df-topbar .df-spacer { flex: 1; }
.df-app-v2 .df-icon-btn { width: 32px; height: 32px; border-radius: var(--r-md); border: 0; background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--ui-muted); padding: 0; }
.df-app-v2 .df-icon-btn:hover, .df-app-v2 .df-icon-btn[aria-expanded="true"]:not(.df-hamburger) { background: var(--ui-hl); color: var(--ui-heading); }
.df-app-v2 .df-icon-btn svg { width: 18px; height: 18px; }
.df-app-v2 .df-top-ic { width: 38px; height: 38px; border-radius: var(--r-lg); position: relative; text-decoration: none; color: var(--ui-muted); }
.df-app-v2 .df-top-ic svg { width: 19px; height: 19px; }
.df-app-v2 .df-lang-tx { font-weight: var(--fw-semibold); font-size: var(--fs-base); font-family: var(--df-font-ar); color: var(--ui-heading); }
[dir="rtl"] .df-app-v2 .df-lang-tx { font-family: var(--df-font); }
.df-app-v2 .df-bell-dot { position: absolute; top: 7px; inset-inline-end: 8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill); background: var(--ui-error); color: #fff; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); display: grid; place-items: center; border: 2px solid var(--ui-surface); line-height: 1; }
.df-app-v2 .df-bell-dot:empty { display: none; }
.df-app-v2 .df-jump { display: inline-flex; align-items: center; gap: 8px; min-width: 260px; height: 36px; padding: 0 10px; border: 1px solid var(--ui-line); background: var(--ui-bg); border-radius: var(--r-lg); color: var(--ui-muted); cursor: pointer; font-size: var(--fs-md); }
.df-app-v2 .df-jump:hover { border-color: var(--ui-line-strong); background: var(--ui-hl); }
.df-app-v2 .df-jump svg { width: 16px; height: 16px; }
.df-app-v2 .df-jump .df-kbd { margin-inline-start: auto; background: var(--ui-surface); }
.df-app-v2 .df-net { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: #c2410c; background: #fff1e6; border-radius: var(--r-pill); padding: 4px 10px; }
.df-app-v2 .df-net[hidden], .df-app-v2 #df-install[hidden] { display: none; }
.df-app-v2 .df-back-pill { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: var(--ui-error); color: #fff; font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-decoration: none; white-space: nowrap; }
.df-app-v2 .df-back-pill:hover { color: #fff; filter: brightness(1.08); }
.df-app-v2 .df-btn-pos { background: linear-gradient(135deg, #0d2b1a, #123c27); border-color: var(--ui-gold); color: var(--ui-on-brand); font-weight: var(--fw-semibold); }
.df-app-v2 .df-btn-pos:hover { color: var(--ui-on-brand); border-color: var(--ui-gold); filter: brightness(1.12); }   /* rule 37: no gold text under 18 px; gold stays the line (U2 K2) */
.df-app-v2 button.df-user { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: var(--r-xl); text-align: start; color: inherit; margin-inline-start: 4px; line-height: 1.3; }
.df-app-v2 button.df-user:hover, .df-app-v2 button.df-user[aria-expanded="true"] { background: var(--ui-hl); }
.df-app-v2 .df-user-tx b { color: var(--ui-ink); }
.df-app-v2 .df-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ui-brand-soft); color: var(--ui-heading); display: grid; place-items: center; font-weight: var(--fw-semibold); font-size: var(--fs-sm); flex: none; }
.df-app-v2 .df-hide-xs { display: inline; }

/* ---------- user menu ---------- */
.df-um { position: absolute; min-width: 280px; max-width: calc(100vw - 16px); z-index: var(--z-floating); padding: 8px; max-height: calc(100vh - 80px); overflow: auto; }
.df-um[hidden] { display: none; }
.df-um-who { display: flex; gap: 10px; align-items: center; padding: 8px 10px; font-size: var(--fs-md); }
.df-um-pkg { display: grid; gap: 1px; padding: 2px 10px 6px 54px; font-size: var(--fs-sm); }
[dir="rtl"] .df-um-pkg { padding: 2px 54px 6px 10px; }
.df-um-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; font-size: var(--fs-base); cursor: pointer; border-radius: var(--r-md); margin: 0; font-weight: 400; }
.df-um-row:hover { background: var(--ui-hl); }
.df-um-sub { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: var(--tt-label); letter-spacing: .5px; color: var(--ui-muted); padding: 4px 10px; }
.df-um-form { margin: 0; }
.df-um a.df-menu-item { text-decoration: none; color: inherit; }
.df-seg { display: inline-flex; background: var(--ui-bg); border: 1px solid var(--ui-line); border-radius: var(--r-lg); padding: 3px; gap: 2px; flex-wrap: wrap; }
.df-seg button { border: 0; background: none; border-radius: var(--r-md); padding: 6px 11px; font-weight: 600; font-size: var(--fs-md); color: var(--ui-muted); cursor: pointer; white-space: nowrap; }
.df-seg [aria-pressed="true"] { background: var(--ui-surface); color: var(--ui-heading); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.df-um-theme { display: flex; width: calc(100% - 12px); margin: 2px 6px 6px; }
.df-um-theme button { flex: 1 1 0; display: inline-flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; font-size: var(--fs-sm); min-height: 48px; justify-content: center; }
.df-um-theme svg { width: 18px; height: 18px; }

/* ---------- command palette, notifications drawer ---------- */
.df-pal-list { display: grid; gap: 2px; max-height: 60vh; overflow: auto; margin-top: 10px; }
.df-pal-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--r-md); cursor: pointer; text-decoration: none; color: var(--ui-ink); }
.df-pal-item:hover { color: var(--ui-ink); text-decoration: none; background: var(--ui-hl); }
.df-pal-item svg { width: 16px; height: 16px; color: var(--ui-muted); flex: none; }
.df-pal-item small { margin-inline-start: auto; color: var(--ui-muted); font-size: var(--fs-sm); white-space: nowrap; }
.df-pal-item[aria-selected="true"] { background: var(--ui-hl); box-shadow: inset 3px 0 0 var(--ui-brand); }
[dir="rtl"] .df-pal-item[aria-selected="true"] { box-shadow: inset -3px 0 0 var(--ui-brand); }
.df-empty { text-align: center; padding: 40px 20px; color: var(--ui-muted); }
.df-empty svg { width: 36px; height: 36px; color: var(--ui-icon); }
.df-empty h3 { color: var(--ui-ink); margin: 10px 0 4px; font-size: var(--fs-lg); }
.df-drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(420px, 100%); background: var(--ui-surface); z-index: var(--z-drawer); box-shadow: -20px 0 50px rgba(0, 0, 0, .18); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .2s; }
[dir="rtl"] .df-drawer { transform: translateX(-105%); }
.df-drawer.is-open { transform: none; }
.df-drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--ui-line); }
.df-drawer-head h3 { margin: 0; font-size: var(--fs-lg); color: var(--ui-heading); display: flex; align-items: center; gap: 8px; }
.df-drawer-body { padding: 16px 18px; overflow: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.df-scrim { position: fixed; inset: 0; background: rgba(13, 43, 26, .3); z-index: var(--z-scrim); }
.df-notif { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.df-notif li { display: block !important; list-style: none; margin: 0; padding: 0 !important; background: none !important; }
.df-notif li > :not(a) { display: none !important; }   /* stray nodes left by message markup */
.df-notif li > a { width: 100%; margin: 0 !important; box-sizing: border-box; display: grid !important; grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-lg); text-decoration: none; color: var(--ui-ink) !important; background: transparent !important; font-size: var(--fs-md); line-height: 1.35; }
.df-notif li > a:hover, .df-notif li > a:focus-visible { background: var(--ui-hl) !important; color: var(--ui-ink) !important; }
.df-notif li > a:active { background: var(--ui-hover) !important; }
.df-notif .notif-icon { width: 32px; height: 32px; border-radius: var(--r-md); display: grid !important; place-items: center; font-size: 14px; line-height: 1; margin: 0; background: var(--ui-brand-soft) !important; color: var(--ui-brand-ink) !important; }
.df-notif .notif-icon::before { line-height: 1; }
.df-notif .notif-icon.bg-yellow, .df-notif .notif-icon.bg-orange, .df-notif .notif-icon.bg-warning { background: var(--ui-warn-wash) !important; color: var(--ui-warn-ink) !important; }
.df-notif .notif-icon.bg-red, .df-notif .notif-icon.bg-danger { background: var(--ui-error-wash) !important; color: var(--ui-error) !important; }
.df-notif-tx { display: grid; gap: 2px; min-width: 0; }
.df-notif .notif-info { color: var(--ui-ink); font-weight: 600; overflow-wrap: anywhere; }
.df-notif .time { color: var(--ui-muted); font-size: var(--fs-sm); font-weight: 400; }
.df-notif .df-notif-dot { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--ui-brand); }
.df-notif li:not(.unread) .df-notif-dot { visibility: hidden; }
.df-notif .df-empty { padding: 30px 10px; }
.df-notif .df-empty svg { width: 36px; height: 36px; color: var(--ui-icon); }
.df-notif-more { justify-self: center; }
.df-notif-more[hidden], .df-v2 .df-btn[hidden] { display: none !important; }

/* ---------- install guide ---------- */
.df-inst-app { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: var(--r-xl); background: var(--ui-bg); }
.df-inst-app img { border-radius: var(--r-xl); flex: none; }
.df-inst-app span { display: grid; gap: 2px; }
.df-inst-app small { color: var(--ui-muted); font-size: var(--fs-sm); }
.df-inst-env { margin: 14px 0 6px; font-weight: 600; }
.df-inst-steps { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; line-height: 1.55; }
.df-inst-k { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--ui-line-strong); border-radius: var(--r-md); vertical-align: middle; background: var(--ui-surface); }
.df-inst-k svg { width: 16px; height: 16px; }
.df-inst-copy { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.df-inst-copy code { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; font: var(--fs-sm)/1.4 var(--df-mono); background: var(--ui-bg); padding: 6px 8px; border-radius: var(--r-md); color: var(--ui-ink); }

/* ---------- footer: at the bottom of short pages, above the save bar on forms ---------- */
.df-app-v2 .df-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--ui-line); background: var(--ui-chrome); font-size: var(--fs-sm); color: var(--ui-muted); }
.df-app-v2 .df-foot-v b { font-weight: var(--fw-semibold); color: var(--ui-heading); }
/* NEWUI-FOOTER-01: About Hamly in the user menu (the app footer is gone) */
.df-um-about > summary { list-style: none; cursor: pointer; }
.df-um-about > summary::-webkit-details-marker { display: none; }
.df-um-about-body { padding: 4px 12px 8px 40px; font-size: var(--fs-xs, 12px); line-height: 1.5; }
[dir="rtl"] .df-um-about-body { padding: 4px 40px 8px 12px; }
.df-app-v2 .df-content .df-page.has-sb { padding-bottom: 32px; }
.df-app-v2 .df-content .df-page:not(.has-sb) { padding-bottom: 28px; }   /* a page without a save bar (prototype app.css:454) */
/* the footer sits directly on the save bar (owner, 10 Oct 2026): exactly the bar's measured height, no strip */
body.df-app-v2:has(.df-sb) .df-main > .df-foot { margin-bottom: var(--df-sb-height, 80px); }

/* ---------- collapsed sidebar: icon rail with fly-outs (desktop / laptop) ---------- */
@media (min-width: 901px) {
  body.df-app-v2.df-rail .df-shell { grid-template-columns: 72px minmax(0, 1fr); }
  body.df-app-v2.df-rail .df-side { padding: 18px 10px; overflow-x: hidden; }
  body.df-app-v2.df-rail .df-logo { padding: 4px 0 22px; justify-content: center; }
  body.df-app-v2.df-rail .df-logo a::before { content: ""; width: 40px; height: 40px; border-radius: var(--r-lg); display: block; background: url("../img/v2/icons/icon-96.png") center / cover no-repeat; }
  body.df-app-v2.df-rail .df-logo-img { display: none; }
  body.df-app-v2.df-rail .df-nav a, body.df-app-v2.df-rail .df-nav-head { justify-content: center; padding: 11px 0; }
  body.df-app-v2.df-rail .df-nav a > span:not(.df-nav-ic), body.df-app-v2.df-rail .df-nav-head > span:not(.df-nav-ic), body.df-app-v2.df-rail .df-nav-caret, body.df-app-v2.df-rail .df-nav-sub, body.df-app-v2.df-rail .df-nav-label, body.df-app-v2.df-rail .df-nav-more { display: none !important; }
  body.df-app-v2.df-rail .df-nav-head.is-current { background: var(--ui-brand-soft); }
}
.df-nav-fly { position: fixed; z-index: var(--z-floating); min-width: 220px; max-height: calc(100vh - 16px); overflow: auto; padding: 6px; }
.df-nav-fly-t { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: var(--tt-label); letter-spacing: .5px; color: var(--ui-muted); padding: 6px 10px; }
.df-nav-fly a { display: block; padding: 8px 10px; border-radius: var(--r-md); color: var(--ui-ink); text-decoration: none; font-size: var(--fs-md); }
.df-nav-fly a:hover { background: var(--ui-hl); color: var(--ui-ink); text-decoration: none; }
.df-nav-fly a.is-active { background: var(--ui-brand-soft); color: var(--ui-heading); font-weight: var(--fw-semibold); text-decoration: none; }

/* ---------- tablets and phones: the sidebar slides in ---------- */
@media (max-width: 900px) {
  .df-app-v2 .df-shell { grid-template-columns: minmax(0, 1fr); }
  .df-app-v2 .df-side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: var(--z-nav); transform: translateX(-100%); transition: transform .2s; }
  [dir="rtl"] .df-app-v2 .df-side { transform: translateX(100%); }
  body.df-app-v2.df-nav-open .df-side { transform: none; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
  body.df-app-v2.df-nav-open .df-backdrop { display: block; position: fixed; inset: 0; background: rgba(13, 43, 26, .35); z-index: var(--z-nav-backdrop); }
  .df-app-v2 .df-topbar { padding: 10px 16px; }
  .df-app-v2 .df-jump { min-width: 0; width: 38px; height: 38px; padding: 0; justify-content: center; }
  .df-app-v2 .df-jump span:not(.df-kbd), .df-app-v2 .df-jump .df-kbd { display: none; }
}
@media (max-width: 640px) {
  .df-app-v2 .df-topbar { gap: 8px; min-height: 56px; }
  .df-app-v2 .df-user-tx, .df-app-v2 .df-hide-xs { display: none; }
  .df-app-v2 .df-user { margin-inline-start: 0; }
  .df-app-v2 .df-foot { justify-content: center; text-align: center; padding: 12px 16px; flex-direction: column; gap: 2px; }
  body.df-app-v2:has(.df-sb) .df-main > .df-foot { margin-bottom: var(--df-sb-height, 96px); }
  .df-app-v2 .df-back-pill { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- scrollbars: thin, no track colour ---------- */
html.df-app, html.df-app body, html.df-app * { scrollbar-width: thin; scrollbar-color: #cdd5d0 transparent; }
html.df-app ::-webkit-scrollbar { width: 10px; height: 8px; background: transparent; }
html.df-app ::-webkit-scrollbar-track, html.df-app ::-webkit-scrollbar-corner { background: transparent; }
html.df-app ::-webkit-scrollbar-thumb { background: #cdd5d0; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
html.df-app ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
html.df-app[data-theme="dark"], html.df-app[data-theme="dark"] body, html.df-app[data-theme="dark"] * { scrollbar-color: #1a1e1c transparent; }
html.df-app[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #1a1e1c; border: 2px solid transparent; background-clip: padding-box; }
html.df-app[data-theme="dark"][data-dark="warm"], html.df-app[data-theme="dark"][data-dark="warm"] body, html.df-app[data-theme="dark"][data-dark="warm"] * { scrollbar-color: #3b3937 transparent; }

/* ---------- Midnight Black: shell colours (prototype dark.css) ---------- */
:root[data-theme="dark"] .df-um, :root[data-theme="dark"] .df-nav-fly, :root[data-theme="dark"] .df-drawer { background: #161817; }
:root[data-theme="dark"] .df-app-v2 .df-nav > a.is-active { background: linear-gradient(135deg, #1d4a31, #23573a); color: #fff; }
:root[data-theme="dark"] .df-app-v2 .df-bell-dot { border-color: #161918; }
:root[data-theme="dark"] .df-app-v2 .df-jump .df-kbd { background: #161817; }
:root[data-theme="dark"] .df-app-v2 .df-btn-outline { border-color: #4f9d6d; color: #f2f4f3; }
:root[data-theme="dark"] body.df-app-v2.df-nav-open .df-backdrop, :root[data-theme="dark"] .df-scrim { background: rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .df-app-v2 .df-net { background: #3d2516; color: #ff9a5c; }
:root[data-theme="dark"] .df-seg [aria-pressed="true"] { background: #1c2420; }
/* ---------- Warm dark ---------- */
:root[data-theme="dark"][data-dark="warm"] .df-um, :root[data-theme="dark"][data-dark="warm"] .df-nav-fly, :root[data-theme="dark"][data-dark="warm"] .df-drawer { background: #31302e; }
:root[data-theme="dark"][data-dark="warm"] .df-app-v2 .df-bell-dot { border-color: #33322f; }
:root[data-theme="dark"][data-dark="warm"] .df-app-v2 .df-jump .df-kbd { background: #31302e; }
:root[data-theme="dark"][data-dark="warm"] .df-seg [aria-pressed="true"] { background: #3b3a37; }

@media print {
  .df-app-v2 .df-side, .df-app-v2 .df-topbar, .df-app-v2 .df-foot, .df-app-v2 .df-backdrop { display: none !important; }
  .df-app-v2 .df-shell { display: block; }
}

/* P07: the form preview inside the designer's iframe (layouts/app-v2 bare mode) */
.df-app-v2 .df-content.df-bare { min-height: 100vh; }

/* a phone has overlay scrollbars: no reserved gutter (it shifted the page 3 px in a right-to-left phone view and made every page look 3 px too wide) */
@media (max-width: 767px) { html.df-app { scrollbar-gutter: auto; } }
/* ---------- Green & Gold dark: shell colours (chrome comes from --ui-chrome in tokens.css) ---------- */
html.df-app[data-theme="dark"][data-dark="greengold"] { background: #132a1f; }
:root[data-theme="dark"][data-dark="greengold"] .df-um, :root[data-theme="dark"][data-dark="greengold"] .df-nav-fly, :root[data-theme="dark"][data-dark="greengold"] .df-drawer { background: #192f23; }

/* top bar at 1100 (owner 30 Oct, UI-POL-01): the jump box shrinks to its icon before the bar can overflow (it was 28 px too wide), the right-side buttons keep 8 px between them */
.df-app-v2 .df-topbar { gap: var(--sp-8); }
.df-app-v2 .df-topbar > * { min-width: 0; }
.df-app-v2 .df-topbar .df-icon-btn, .df-app-v2 .df-topbar .df-top-ic, .df-app-v2 .df-topbar .df-jump { flex: none; }
@media (max-width: 1180px) {
  .df-app-v2 .df-topbar { padding-inline: 16px; }
  .df-app-v2 .df-jump { min-width: 0; width: 38px; height: 38px; padding: 0; justify-content: center; }
  .df-app-v2 .df-jump span:not(.df-kbd), .df-app-v2 .df-jump .df-kbd { display: none; }
}
