/* =========================================================
   Grabann shared components. Colours come from tokens.css.
   Class prefix "g-" so nothing clashes with Bootstrap.
   ========================================================= */

/* ---------- Bootstrap follows our tokens ---------- */
:root, [data-bs-theme] {
  --bs-body-bg: var(--g-bg);
  --bs-body-color: var(--g-text);
  --bs-body-font-family: var(--g-font);
  --bs-border-color: var(--g-line);
  --bs-secondary-color: var(--g-muted);
  --bs-link-color: var(--g-pri-text);
  --bs-link-hover-color: var(--g-pri-hover);
  --bs-link-color-rgb: 19, 112, 47;
  --bs-focus-ring-color: var(--g-pri-soft);
}
.dropdown-menu { --bs-dropdown-bg: var(--g-surface); --bs-dropdown-border-color: var(--g-line); --bs-dropdown-link-color: var(--g-text); --bs-dropdown-link-hover-bg: var(--g-raised); --bs-dropdown-link-active-bg: var(--g-pri-soft); --bs-dropdown-link-active-color: var(--g-pri-text); border-radius: var(--g-radius); padding: 6px; box-shadow: var(--g-shadow); }
.dropdown-item { border-radius: 8px; padding: 9px 12px; font-weight: 500; }
.modal-content { background: var(--g-surface); border: 1px solid var(--g-line); border-radius: var(--g-radius-lg); }
:focus-visible { outline: 3px solid var(--g-pri-soft); outline-offset: 1px; }
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--g-text); letter-spacing: -0.01em; }
/* Phones must never pan sideways. "clip" (not "hidden") keeps the sticky top bar working. */
html, body { overflow-x: clip; }

/* ---------- Top bar ---------- */
.g-topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: 12px 20px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 20px 10px;
  background: var(--g-surface); border-bottom: 1px solid var(--g-line);
}
.g-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.g-brand-mark { width: 30px; height: 30px; }
.g-brand-word { height: 24px; width: auto; }
.g-badge {
  padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--g-hi); color: #1A1400;
}
.g-nav { display: flex; gap: 4px; }
.g-nav a {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px;
  color: var(--g-muted); font-weight: 500; text-decoration: none;
}
.g-nav a:hover { background: var(--g-raised); color: var(--g-text); }
.g-nav a.active { background: var(--g-pri-soft); color: var(--g-pri-text); font-weight: 600; }
.g-topbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.g-user { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 4px; border: 0; border-radius: 12px; background: transparent; color: var(--g-text); text-align: left; }
.g-user:hover { background: var(--g-raised); }
.g-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--g-text); color: var(--g-bg); font-size: 12px; font-weight: 700; flex: none; }
.g-user-text { flex-direction: column; line-height: 1.2; }
.g-user-text b { font-size: 13px; font-weight: 600; }
.g-user-text small { font-size: 11.5px; color: var(--g-muted); }

/* ---------- Page ---------- */
.g-page { max-width: 1240px; margin: 0 auto; padding: 24px 20px 120px; }
.g-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.g-page-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.g-sub { margin: 4px 0 0; font-size: 14px; color: var(--g-muted); }
@media (max-width: 767.98px) {
  .g-page { padding: 16px 16px 140px; }
  .g-page-head h1 { font-size: 22px; }
}

/* ---------- Buttons ---------- */
.g-btn, .g-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--g-radius); font-weight: 600; font-size: 15px;
  border: 0; text-decoration: none; transition: background .15s, transform .08s; white-space: nowrap;
}
.g-btn { background: var(--g-pri); color: var(--g-on-pri); }
.g-btn:hover { background: var(--g-pri-hover); color: var(--g-on-pri); }
.g-btn:active, .g-btn-ghost:active { transform: scale(.985); }
.g-btn:disabled { opacity: .7; }
.g-btn-ghost { background: var(--g-surface); color: var(--g-text); border: 1px solid var(--g-line-2); }
.g-btn-ghost:hover { background: var(--g-raised); }
.g-btn-danger { background: var(--g-bad-soft); color: var(--g-bad); border: 1px solid var(--g-bad); }
.g-btn-danger:hover { background: var(--g-bad); color: var(--g-surface); }
.g-btn-block { width: 100%; }
.g-btn-lg { min-height: 52px; font-size: 16px; }
.g-link-btn { border: 0; background: none; padding: 8px 0; font-weight: 600; font-size: 14px; color: var(--g-pri-text); }
.g-link-btn.danger { color: var(--g-bad); }
.g-icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--g-line); border-radius: 12px; background: var(--g-surface); color: var(--g-text); font-size: 18px;
}
.g-icon-btn:hover { background: var(--g-raised); }
.g-icon-btn.plain { border-color: transparent; background: var(--g-raised); }

/* ---------- Forms ---------- */
.g-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.g-label { font-size: 13px; font-weight: 600; color: var(--g-text); }
.g-opt { font-weight: 400; color: var(--g-faint); margin-left: 4px; }
.g-input {
  width: 100%; min-height: 46px; padding: 0 14px; border: 1.5px solid var(--g-line-2); border-radius: var(--g-radius);
  background: var(--g-surface); color: var(--g-text); font: 500 15px var(--g-font); font-feature-settings: "tnum" 1;
  transition: border-color .15s, box-shadow .15s;
}
textarea.g-input { padding: 12px 14px; min-height: 90px; resize: vertical; }
/* iPhone draws date fields wider than their box; keep them inside it */
input[type="date"].g-input { -webkit-appearance: none; appearance: none; min-width: 0; display: block; line-height: 44px; }
input[type="date"].g-input::-webkit-date-and-time-value { text-align: left; }
select.g-input {
  appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23889590' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
}
.g-input:focus { outline: 0; border-color: var(--g-pri); box-shadow: 0 0 0 4px var(--g-pri-soft); }
.g-input.is-invalid { border-color: var(--g-bad); }
.g-input:disabled, .g-input[readonly] { background: var(--g-raised); color: var(--g-muted); }
.g-input-group { display: flex; align-items: stretch; border: 1.5px solid var(--g-line-2); border-radius: var(--g-radius); background: var(--g-surface); overflow: hidden; }
.g-input-group:focus-within { border-color: var(--g-pri); box-shadow: 0 0 0 4px var(--g-pri-soft); }
.g-input-group .g-input { border: 0; box-shadow: none; border-radius: 0; }
.g-input-group .g-addon { display: flex; align-items: center; padding: 0 12px; color: var(--g-muted); font-weight: 500; background: var(--g-raised); }
.g-input-group .g-addon-btn { border: 0; background: transparent; color: var(--g-muted); width: 46px; font-size: 18px; }
.g-help { font-size: 12.5px; color: var(--g-muted); }
.g-err { font-size: 12.5px; font-weight: 500; color: var(--g-bad); }
.g-err:empty { display: none; }
.g-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
@media (max-width: 420px) { .g-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.g-section-title {
  margin: 22px 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-muted);
}
.g-section-title:first-child,
[data-form-alert][hidden] + .g-section-title { margin-top: 4px; }
.g-alert { padding: 11px 14px; border-radius: var(--g-radius); background: var(--g-bad-soft); color: var(--g-bad); font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.g-alert.warn { background: var(--g-hi-soft); color: var(--g-hi-text); }
.g-alert.info { background: var(--g-pri-soft); color: var(--g-pri-text); }

/* Segmented control (Active / Inactive) */
.g-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: var(--g-radius); background: var(--g-raised); }
.g-seg input { position: absolute; opacity: 0; pointer-events: none; }
.g-seg label { display: flex; align-items: center; justify-content: center; min-height: 38px; margin: 0; border-radius: 9px; font-weight: 500; color: var(--g-muted); cursor: pointer; }
.g-seg input:checked + label { background: var(--g-surface); color: var(--g-pri-text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.g-seg input:focus-visible + label { outline: 3px solid var(--g-pri-soft); }
.g-seg input[value="0"]:checked + label { color: var(--g-bad); }

/* Switch */
.g-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--g-line); border-radius: var(--g-radius); background: var(--g-surface); cursor: pointer; margin-bottom: 14px; }
.g-switch input { width: 46px; height: 26px; flex: none; }
.g-check { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 16px; cursor: pointer; font-size: 14px; font-weight: 500; }
.g-check input { width: 20px; height: 20px; flex: none; margin-top: 1px !important; cursor: pointer; }
.g-check input:checked { background-color: var(--g-pri); border-color: var(--g-pri); }
.g-switch .form-check-input:checked { background-color: var(--g-pri); border-color: var(--g-pri); }

/* ---------- Toolbar, search, chips ---------- */
.g-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.g-search {
  flex: 1 1 280px; max-width: 420px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; margin: 0;
  background: var(--g-surface); border: 1px solid var(--g-line); border-radius: var(--g-radius); color: var(--g-muted);
}
.g-search:focus-within { border-color: var(--g-pri); box-shadow: 0 0 0 4px var(--g-pri-soft); }
.g-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--g-text); font: 500 15px var(--g-font); }
/* Phones zoom into any field under 16px when it is tapped, so touch screens get 16px */
@media (pointer: coarse) { .g-input, .g-search input { font-size: 16px; } }
.g-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.g-chip {
  flex: none; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--g-line-2);
  background: var(--g-surface); color: var(--g-text); font-weight: 500; font-size: 14px;
}
.g-chip span { color: var(--g-muted); margin-left: 4px; }
.g-chip.active { background: var(--g-text); border-color: var(--g-text); color: var(--g-bg); font-weight: 600; }
.g-chip.active span { color: inherit; opacity: .7; }
@media (max-width: 767.98px) { .g-search { max-width: none; flex-basis: 100%; } }

/* ---------- Cards, tables, phone lists ---------- */
.g-card { background: var(--g-surface); border: 1px solid var(--g-line); border-radius: var(--g-radius-lg); box-shadow: var(--g-shadow); }
.g-card-body { padding: 20px; }
.g-card + .g-card { margin-top: 16px; }
.g-card h2:not(.g-section-title) { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.g-table-wrap { overflow-x: auto; }
.g-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.g-table th {
  padding: 12px 16px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--g-line);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--g-muted);
}
.g-table td { padding: 13px 16px; border-bottom: 1px solid var(--g-line); vertical-align: middle; }
.g-table tbody tr:last-child td { border-bottom: 0; }
.g-table tbody tr { cursor: pointer; }
.g-table tbody tr:hover { background: var(--g-sel); }
.g-table tr.is-off td { color: var(--g-faint); }
.g-cell-main { font-weight: 600; color: var(--g-text); }
.g-cell-sub { font-size: 12.5px; color: var(--g-muted); margin-top: 2px; }

.g-list { background: var(--g-surface); border: 1px solid var(--g-line); border-radius: var(--g-radius-lg); overflow: hidden; box-shadow: var(--g-shadow); }
.g-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left;
  border: 0; border-top: 1px solid var(--g-line); background: transparent; color: var(--g-text);
}
.g-row:first-child { border-top: 0; }
.g-row:active { background: var(--g-sel); }
.g-row.is-off { opacity: .62; }
.g-row-icon { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--g-raised); font-weight: 700; font-size: 14px; }
.g-row-icon.has-img { overflow: hidden; background: var(--g-surface); border: 1px solid var(--g-line); }
.g-row-icon.has-img img { width: 100%; height: 100%; object-fit: cover; }
.g-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.g-row-title { font-weight: 600; font-size: 15px; }
.g-row-meta { font-size: 13px; color: var(--g-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.g-pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.g-pill.on { background: var(--g-pri-soft); color: var(--g-pri-text); }
.g-pill.off { background: var(--g-raised); color: var(--g-muted); }
.g-pill.warn { background: var(--g-hi-soft); color: var(--g-hi-text); }
.g-pill.bad { background: var(--g-bad-soft); color: var(--g-bad); }

.g-empty { text-align: center; padding: 56px 20px; color: var(--g-muted); }
.g-empty > i { font-size: 34px; color: var(--g-faint); }
.g-empty h2 { font-size: 18px; margin: 12px 0 6px; }
.g-empty p { margin: 0 0 18px; }
.g-loading { display: flex; justify-content: center; padding: 48px 0; color: var(--g-muted); }

/* Floating Add button (phone) */
.g-fab {
  position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); z-index: 1030;
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px;
  border: 0; border-radius: 16px; background: var(--g-pri); color: var(--g-on-pri); font-weight: 600; font-size: 15px;
  box-shadow: var(--g-shadow-fab);
}

/* ---------- Bottom tabs (phone) ---------- */
.g-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: var(--g-surface); border-top: 1px solid var(--g-line);
}
.g-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; min-width: 0; justify-content: center; text-decoration: none; color: var(--g-muted); font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.g-tabbar a i { font-size: 21px; }
.g-tabbar a.active { color: var(--g-pri-text); font-weight: 600; }

/* ---------- Side panel (laptop) / bottom sheet (phone) ---------- */
.g-panel.offcanvas { --bs-offcanvas-bg: var(--g-surface); --bs-offcanvas-color: var(--g-text); --bs-offcanvas-border-color: var(--g-line); display: flex; flex-direction: column; }
.g-panel.offcanvas-end { --bs-offcanvas-width: 480px; }
.g-panel.offcanvas-bottom { --bs-offcanvas-height: auto; max-height: 92dvh; border-radius: var(--g-radius-sheet) var(--g-radius-sheet) 0 0; }
.g-panel-grab { align-self: center; width: 40px; height: 5px; border-radius: 99px; background: var(--g-line-2); margin-top: 8px; flex: none; }
.g-panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--g-line); flex: none; }
.g-panel-head > div { flex: 1; min-width: 0; }
.g-panel-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.g-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 8px; }
.g-panel-foot { display: flex; gap: 10px; padding: 12px 20px calc(env(safe-area-inset-bottom, 0px) + 12px); border-top: 1px solid var(--g-line); flex: none; background: var(--g-surface); }
.g-panel-foot .g-btn-ghost { flex: 1; }
.g-panel-foot .g-btn { flex: 2; }
.offcanvas-backdrop { --bs-backdrop-bg: #000; --bs-backdrop-opacity: .45; }

/* ---------- Change history ---------- */
.g-history { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.g-history-item { display: flex; gap: 10px; font-size: 13.5px; }
.g-history-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--g-line-2); flex: none; }
.g-history-item:first-child .g-history-dot { background: var(--g-pri); }
.g-history-what { font-weight: 500; }
.g-history-change { color: var(--g-muted); font-size: 12.5px; margin-top: 2px; word-break: break-word; }
.g-history-change b { color: var(--g-text); font-weight: 600; }
.g-history-meta { color: var(--g-faint); font-size: 12px; margin-top: 3px; }

/* ---------- Master box, credentials ---------- */
/* File picker (logo, documents) */
.g-file-box { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px dashed var(--g-line-2); border-radius: var(--g-radius); background: var(--g-surface); min-width: 0; }
.g-file-thumb { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--g-raised); color: var(--g-muted); font-size: 18px; overflow: hidden; }
.g-file.is-logo .g-file-thumb { width: 56px; height: 56px; }
/* A signature shown as it will print: on white paper, in light and dark mode */
.g-sign-preview { margin-bottom: 8px; padding: 10px 14px; border: 1px solid var(--g-line); border-radius: var(--g-radius); background: #fff; display: flex; align-items: center; justify-content: center; min-height: 80px; }
.g-sign-preview img { width: 270px; max-width: 100%; aspect-ratio: 3 / 1; object-fit: contain; mix-blend-mode: multiply; } /* the editor's 3:1 crop */
.g-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-file-thumb img:not([hidden]) + i { display: none; }
.g-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.g-file-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-file-actions { display: flex; gap: 12px; flex: none; }
.g-file-actions .g-link-btn { padding: 6px 0; }
.g-file.has-error .g-file-box { border-color: var(--g-bad); }
@media (max-width: 420px) {
  .g-file-box { flex-wrap: wrap; }
  .g-file-actions { width: 100%; justify-content: flex-end; }
}
.g-crop { max-height: 60vh; background: var(--g-raised); border-radius: var(--g-radius); overflow: hidden; }
.g-crop img { display: block; max-width: 100%; }
.g-session-note { font-size: 12.5px; color: var(--g-muted); padding: 6px 12px; max-width: 260px; white-space: normal; }
.g-box { padding: 14px; border: 1px solid var(--g-line); border-radius: var(--g-radius); background: var(--g-raised); margin-bottom: 14px; }
.g-cred { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; padding: 16px; border-radius: var(--g-radius); background: var(--g-raised); font-size: 15px; }
.g-cred dt { color: var(--g-muted); font-weight: 500; }
.g-cred dd { margin: 0; font-weight: 600; word-break: break-all; }
.g-cred .g-secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; letter-spacing: .04em; }

/* ---------- Toasts ---------- */
.g-toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); z-index: 1090; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.g-toast { padding: 12px 16px; border-radius: var(--g-radius); background: var(--g-text); color: var(--g-bg); font-weight: 500; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: g-toast-in .2s ease-out; }
/* "Grabann was updated · Refresh": only when typed changes stop the app updating itself (app.js G.update) */
.g-update { position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); z-index: 1095; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 999px; background: var(--g-text); color: var(--g-bg); font: inherit; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); cursor: pointer; }
.g-toast.bad { background: var(--g-bad); color: #fff; }
@keyframes g-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (min-width: 992px) { .g-toasts { bottom: 24px; } }

/* ---------- Sign-in page ---------- */
.g-login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 20px; position: relative; overflow: hidden; }
.g-login::before { content: ""; position: absolute; left: -140px; top: -180px; width: 460px; height: 460px; border-radius: 50%; background: var(--g-pri-soft); }
.g-login-card { position: relative; width: 100%; max-width: 400px; }
.g-login-word { width: 160px; height: auto; display: block; margin: 0 0 18px -5px; }
.g-login h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.g-login .g-sub { font-size: 15px; margin-bottom: 28px; }
@media (min-width: 768px) {
  .g-login-card { padding: 32px; background: var(--g-surface); border: 1px solid var(--g-line); border-radius: 20px; box-shadow: var(--g-shadow); }
}
.shake { animation: g-shake .35s ease; }
@keyframes g-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .shake, .g-toast { animation: none; } }

/* ---------- Loading bar (app.js G.loading) ---------- */
.g-loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2100; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .15s; }
.g-loadbar.is-on { opacity: 1; }
.g-loadbar::before { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 3px; background: var(--g-pri); animation: g-loadbar 1.1s ease-in-out infinite; }
@keyframes g-loadbar { from { left: -40%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .g-loadbar::before { left: 0; width: 100%; animation: g-loadbar-fade 1.2s ease-in-out infinite alternate; } }
@keyframes g-loadbar-fade { from { opacity: .35; } to { opacity: 1; } }
/* A page is opening: a see-through cover takes further taps, with a waiting cursor */
html.g-leaving body::after { content: ''; position: fixed; inset: 0; z-index: 2090; cursor: progress; }

/* ---------- Lists of entries (devices, notifications, logs) ---------- */
.g-entries { display: flex; flex-direction: column; }
.g-entry { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--g-line); min-width: 0; }
.g-entry:first-child { border-top: 0; padding-top: 4px; }
.g-entry-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--g-raised); color: var(--g-muted); font-size: 17px; }
.g-entry-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.g-entry-title { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.g-entry-text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.g-entry-meta { font-size: 12.5px; color: var(--g-muted); overflow-wrap: anywhere; }
.g-entry-change { font-size: 13px; color: var(--g-muted); overflow-wrap: anywhere; }
.g-entry-change b { color: var(--g-text); font-weight: 500; }
.g-entry .g-link-btn { flex: none; }
.g-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.g-more { display: flex; justify-content: center; padding-top: 12px; }
.g-counter { font-size: 12px; color: var(--g-faint); text-align: right; }
.g-danger-zone { border-color: var(--g-bad); }
.g-edit-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--g-pri-text); white-space: nowrap; }
.g-row-chevron { color: var(--g-faint); flex: none; }

/* Sections (tabs) inside a side panel / bottom sheet */
.g-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--g-line); flex: none; }
.g-tabs::-webkit-scrollbar { display: none; }
.g-tab { flex: none; border: 0; background: none; padding: 7px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--g-muted); white-space: nowrap; }
.g-tab:hover { background: var(--g-raised); color: var(--g-text); }
.g-tab.active { background: var(--g-pri-soft); color: var(--g-pri-text); }

/* Message boxes keep their size (no dragging the corner) */
#notifyForm textarea { resize: none; min-height: 140px; }

/* Date range filter (Logs) */
.g-dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: -4px 0 16px; }
.g-date { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--g-muted); flex: 1 1 0; min-width: 0; max-width: 200px; }
.g-date .g-input { min-height: 40px; }

/* Page numbers under long lists */
.g-pager-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--g-line); margin-top: 4px; }
.g-pager-row:has(.g-pager[hidden]):has(.g-help:empty) { display: none; }
.g-pager-plain { border-top: 0; margin-top: 0; }
.g-pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.g-page-btn { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--g-line-2); background: var(--g-surface); color: var(--g-text); font-weight: 600; font-size: 14px; font-feature-settings: "tnum" 1; }
.g-page-btn:hover:not(:disabled) { background: var(--g-raised); }
.g-page-btn.active { background: var(--g-pri); border-color: var(--g-pri); color: var(--g-on-pri); }
.g-page-btn:disabled { opacity: .4; }
.g-page-gap { padding: 0 4px; color: var(--g-muted); }

.g-bad-text { color: var(--g-bad) !important; }

/* ---------- Grabann Master ---------- */
/* Small number on a menu item (unread announcements) */
.g-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--g-bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.g-tab-icon { position: relative; display: inline-flex; }
.g-tab-icon .g-count { position: absolute; top: -4px; inset-inline-end: -10px; }
/* Read-only notice at the top of every page of an Inactive business */
.g-notice { display: flex; align-items: flex-start; }
/* Business card on Home */
.g-biz-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.g-biz-logo { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--g-raised); color: var(--g-muted); font-size: 24px; overflow: hidden; }
.g-biz-logo img { width: 100%; height: 100%; object-fit: cover; }
.min-w-0 { min-width: 0; }
/* Label / value list (business details, account) */
.g-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 12px; font-size: 14px; }
.g-facts dt { color: var(--g-muted); font-weight: 500; }
.g-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
/* An announcement not read before */
.g-entry.is-unread .g-entry-icon { background: var(--g-pri-soft); color: var(--g-pri-text); }
.g-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Pick or add field (core/ui/form.php field_picker, assets/js/picker.js) ---------- */
.g-picker { position: relative; }
.g-picker-list {
  position: absolute; z-index: 1060; inset-inline: 0; top: calc(100% + 4px); max-height: min(340px, 50vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; background: var(--g-surface); border: 1px solid var(--g-line); border-radius: var(--g-radius); box-shadow: var(--g-shadow);
}
.g-picker-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; padding: 8px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--g-text); font-weight: 500; text-align: start;
}
.g-picker-opt.is-active { background: var(--g-raised); }
.g-picker-opt.is-chosen { color: var(--g-pri-text); font-weight: 600; }
.g-picker-opt.is-add { color: var(--g-pri-text); font-weight: 600; border-top: 1px solid var(--g-line); border-radius: 0 0 8px 8px; }
.g-picker-opt.is-add:first-child { border-top: 0; border-radius: 8px; }
.g-picker-empty { padding: 10px 12px; color: var(--g-muted); font-size: 14px; }
/* Kind switch at the top of Items (Products / Raw Materials) */
.g-type-seg { max-width: 420px; }

/* ---------- Setup page tiles (master/setup) ---------- */
.g-setup-group { margin-bottom: 8px; }
.g-setup-group + .g-setup-group { margin-top: 32px; } /* clear gap between Catalogue, Business, Places & Vehicles ... */
.g-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.g-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 72px; text-decoration: none; color: var(--g-text);
  background: var(--g-surface); border: 1px solid var(--g-line); border-radius: var(--g-radius-lg); box-shadow: var(--g-shadow);
}
.g-tile:hover { border-color: var(--g-pri); color: var(--g-text); }
.g-tile-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--g-pri-soft); color: var(--g-pri-text); font-size: 20px; }
.g-tile-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.g-tile-title { font-weight: 600; font-size: 15px; }
.g-tile-help { font-size: 13px; color: var(--g-muted); }
/* Tap-to-toggle chips (raw material "Contains": sugar, gluten, nuts ...) */
.g-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.g-toggle { position: relative; margin: 0; cursor: pointer; }
.g-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.g-toggle span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--g-line-2); background: var(--g-surface); font-weight: 500; font-size: 14px; }
.g-toggle input:checked + span { background: var(--g-hi-soft); border-color: var(--g-hi); color: var(--g-hi-text); font-weight: 600; }
.g-toggle input:focus-visible + span { outline: 3px solid var(--g-pri-soft); }
.g-toggle input:disabled + span { opacity: .6; }
/* Number + unit side by side (shelf life once opened) */
.g-pair { margin: 0; }
.g-picker-meta { margin-inline-start: auto; font-size: 12.5px; color: var(--g-muted); font-weight: 400; }
.g-warn-text { color: var(--g-hi-text); }

/* ---------- Papers / documents (assets/js/documents.js) ---------- */
.g-doc { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--g-line); }
.g-doc:first-child { border-top: 0; }
.g-doc.is-old { opacity: .7; }
.g-doc .g-entry-title .g-pill { margin-inline-start: 6px; vertical-align: 1px; }
.g-doc-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.g-doc-older { margin: 8px 0 12px; }
.g-doc-older summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--g-muted); padding: 6px 0; }
.g-doc-form { padding: 14px; margin: 8px 0 12px; border: 1px solid var(--g-line); border-radius: var(--g-radius); background: var(--g-raised); }
.g-doc-form-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.g-file-input { padding-top: 10px; }
.g-attention { border-color: var(--g-hi); }
.g-entry-icon.is-warn { background: var(--g-hi-soft); color: var(--g-hi-text); }
.g-entry-icon.is-bad { background: var(--g-bad-soft); color: var(--g-bad); }
.g-field.is-dim { opacity: .5; }
.g-doc-row { cursor: default; }
.g-doc-row .g-row-meta { white-space: normal; }

/* ---------- Wide panel and item lines (Opening Stock) ---------- */
@media (min-width: 768px) { .g-panel.g-panel-wide.offcanvas-end { --bs-offcanvas-width: min(820px, 96vw); } }
.g-line { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1.3fr) minmax(0, 1.5fr) 100px 40px; gap: 8px; align-items: start;
          padding: 10px 0; border-top: 1px solid var(--g-line); }
.g-line:first-child { border-top: 0; }
.g-line-value { padding-top: 13px; text-align: end; font-weight: 600; font-feature-settings: "tnum" 1; white-space: nowrap; }
.g-line-remove { width: 40px; height: 46px; }
.g-line-more { grid-column: 1 / -1; }
.g-line-more summary { cursor: pointer; font-size: 13px; color: var(--g-muted); font-weight: 600; }
.g-line-more .g-grid-2 { margin-top: 8px; max-width: 520px; }
.g-line .g-addon { font-size: 13px; padding: 0 10px; }
.g-lines-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; margin-bottom: 16px;
                 border-radius: var(--g-radius); background: var(--g-raised); font-weight: 600; }
.g-lines-total b { font-size: 18px; font-feature-settings: "tnum" 1; }
@media (max-width: 767.98px) {
  .g-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .g-line-item { grid-column: 1 / 3; }
  .g-line-remove { grid-column: 3; grid-row: 1; }
  .g-line-value { grid-column: 1 / -1; padding-top: 0; }
}

/* ---------- Recipe steps (Recipes) ---------- */
.g-step { padding: 14px; margin-bottom: 12px; border: 1px solid var(--g-line); border-radius: var(--g-radius-lg); background: var(--g-surface); }
.g-step-head { display: flex; align-items: center; gap: 10px; }
.g-step-head .g-input { flex: 1 1 auto; font-weight: 600; }
.g-step-no { flex: none; min-width: 58px; font-weight: 700; color: var(--g-pri-text); }
.g-step-text { margin-top: 8px; min-height: 0; padding-top: 10px; resize: vertical; }
.g-step .g-lines { margin-top: 6px; }
.g-step-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 6px; }
.g-step .g-line-more { margin-top: 4px; }
.g-rline { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) 96px 40px; }
.g-rline .g-line-value { font-weight: 500; color: var(--g-muted); font-size: 13px; }
@media (max-width: 767.98px) {
  .g-rline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .g-rline .g-line-num { grid-column: 1 / 2; }
  .g-rline .g-line-value { grid-column: 2 / 3; padding-top: 13px; text-align: start; }
}

/* Cost & Label section of a recipe */
.g-table-compact th, .g-table-compact td { padding: 8px 10px; }
.g-label-text { white-space: pre-wrap; line-height: 1.55; }

/* ---------- Item photos (Items) ---------- */
.g-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.g-photo { position: relative; width: 96px; height: 96px; border-radius: var(--g-radius); overflow: hidden; border: 1px solid var(--g-line); background: var(--g-raised); }
.g-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-photo-badge { position: absolute; left: 6px; bottom: 6px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--g-pri); color: #fff; }
.g-photo-btn { position: absolute; top: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; }
.g-photo-btn.is-remove { right: 4px; }
.g-photo-btn.is-main { left: 4px; }
.g-photo-add { width: 96px; height: 96px; border-radius: var(--g-radius); border: 1.5px dashed var(--g-line-2); background: var(--g-surface); color: var(--g-pri-text);
               display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.g-photo-add i { font-size: 22px; }
.g-cell-item { display: flex; align-items: center; gap: 10px; }
.g-cell-thumb { width: 36px; height: 36px; flex: none; border-radius: 8px; object-fit: cover; border: 1px solid var(--g-line); }
.g-photo-stage { position: relative; }
.g-photo-stage.is-working .g-photo-preview { filter: saturate(.6) brightness(.92); transition: filter .3s; }
.g-photo-working { position: absolute; inset: 0; border-radius: var(--g-radius); overflow: hidden; display: flex; align-items: flex-end; justify-content: center; padding: 14px; }
.g-photo-scan { position: absolute; left: 0; right: 0; top: -30%; height: 30%;
                background: linear-gradient(180deg, transparent, rgba(47, 174, 69, .35) 70%, rgba(47, 174, 69, .9) 98%, transparent);
                animation: g-photo-scan 1.6s ease-in-out infinite; }
@keyframes g-photo-scan { from { top: -30%; } to { top: 100%; } }
.g-photo-working-text { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px;
                        background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .g-photo-scan { animation: none; top: 0; height: 100%; background: rgba(47, 174, 69, .15); } }
.g-photo-preview { display: block; width: 100%; height: auto; border-radius: var(--g-radius); border: 1px solid var(--g-line); }

/* A dropdown filter in a list's toolbar (e.g. Category on Items) */
.g-filter-select { width: auto; min-width: 170px; max-width: 260px; min-height: 42px; flex: 0 1 auto; }
@media (max-width: 767.98px) { .g-filter-select { max-width: none; flex: 1 1 100%; } }

/* Parts of a tax (Setup → Taxes) */
.g-tax-part { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 40px; gap: 8px; margin-bottom: 8px; }
.g-tax-part .g-err { grid-column: 1 / -1; margin-top: -4px; }
.g-tax-part .g-icon-btn { width: 40px; height: 46px; }
input[readonly].g-input { background: var(--g-raised); }

/* ---------- Suppliers and purchase orders ---------- */
.g-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.g-sline { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 0.9fr) 44px 40px; }
.g-star { position: relative; width: 44px; height: 46px; display: grid; place-items: center; margin: 0; cursor: pointer; color: var(--g-muted); font-size: 18px; }
.g-star input { position: absolute; opacity: 0; pointer-events: none; }
.g-star.is-on { color: #E0A800; }
.g-pline { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.15fr) minmax(0, 1.1fr) 92px 96px 40px; }
.g-rate-from { font-size: 11.5px; margin-top: 2px; }
.g-po-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 14px;
                border: 1px solid var(--g-line); border-radius: var(--g-radius); background: var(--g-raised); }
.g-po-actions .g-btn, .g-po-actions .g-btn-ghost { min-height: 38px; padding: 0 12px; font-size: 13.5px; }
.g-po-totals { margin-bottom: 16px; padding: 10px 14px; border-radius: var(--g-radius); background: var(--g-raised); font-feature-settings: "tnum" 1; }
.g-po-totals > div, #tTaxRows > div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--g-muted); }
.g-po-totals b { color: var(--g-text); font-weight: 600; }
.g-po-totals .is-total { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--g-line-2); color: var(--g-text); font-weight: 600; }
.g-po-totals .is-total b { font-size: 18px; }
.g-row-amount { flex: none; font-weight: 600; font-feature-settings: "tnum" 1; margin-inline: 8px; }
@media (max-width: 767.98px) {
  .g-sline { grid-template-columns: minmax(0, 1fr) 44px 40px; }
  .g-sline .g-line-item { grid-column: 1 / 2; }
  .g-sline .g-line-num { grid-column: 1 / -1; }
  .g-sline .g-star { grid-column: 2; grid-row: 1; }
  .g-pline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .g-pline .g-line-tax { grid-column: 1 / 2; }
  .g-pline .g-line-value { grid-column: 2 / 3; padding-top: 13px; }
  .g-grid-3 { grid-template-columns: 1fr; }
  .g-row-amount { display: none; }
}

/* ---------- Stock statement ---------- */
.g-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); column-gap: 12px; }
.g-filters .g-field { margin-bottom: 10px; }
.g-filters .g-opt { display: none; }
.g-filters-wide { grid-column: 1 / -1; margin: 0; }
.g-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.g-stat { padding: 14px 16px; border-radius: var(--g-radius-lg); background: var(--g-surface); border: 1px solid var(--g-line); }
.g-stat span { display: block; font-size: 12.5px; color: var(--g-muted); font-weight: 600; }
.g-stat b { font-size: 20px; font-feature-settings: "tnum" 1; }
.g-statement .num { text-align: end; white-space: nowrap; font-feature-settings: "tnum" 1; }
.g-statement .g-group td { background: var(--g-raised); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--g-muted); }
.g-statement .g-subtotal td { font-weight: 600; color: var(--g-muted); }
.g-statement tfoot td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--g-line-2); }
/* Unit dropdown inside an input group (Opening Stock lines: "12 [boxes]", "₹ 40 [per kg]") */
.g-unit-select { border: 0; border-inline-start: 1px solid var(--g-line); background: var(--g-raised); color: var(--g-text); font: 500 13px var(--g-font);
                 padding: 0 8px; max-width: 96px; cursor: pointer; }
.g-unit-select:focus { outline: 0; background: var(--g-pri-soft); }
.g-statement .g-lots td { padding-top: 0; font-size: 12.5px; color: var(--g-muted); border-top: 0; }

/* ---------- People: roles' workspaces, holiday dates, year switch ---------- */
.g-ws-list { display: grid; gap: 8px; margin-bottom: 16px; }
.g-ws-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--g-line); border-radius: var(--g-radius); }
.g-ws-row.is-on { border-color: var(--g-pri); background: var(--g-pri-soft); }
.g-ws-name { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; min-width: 0; }
.g-ws-name input { width: 20px; height: 20px; flex: none; }
.g-ws-name input:checked { background-color: var(--g-pri); border-color: var(--g-pri); }
.g-ws-name > i { font-size: 18px; color: var(--g-pri-text); }
.g-ws-name small { font-weight: 400; }
.g-seg-sm { flex: none; padding: 3px; }
.g-seg-sm label { min-height: 32px; padding: 0 12px; font-size: 13px; }
.g-ws-row .g-seg input[value="0"]:checked + label { color: var(--g-pri-text); }
@media (max-width: 575.98px) { .g-ws-row { flex-wrap: wrap; } .g-ws-row .g-seg { width: 100%; } }
.g-date-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; gap: 3px; text-align: center; }
.g-date-icon b { font-size: 16px; }
.g-date-icon small { font-size: 10.5px; font-weight: 600; color: var(--g-muted); text-transform: uppercase; }
.g-year-nav { display: inline-flex; align-items: center; gap: 10px; }
.g-year-nav b { font-size: 18px; min-width: 52px; text-align: center; font-feature-settings: "tnum" 1; }
.g-checks { display: grid; gap: 2px; }
.g-checks .g-check { margin-bottom: 8px; }
.g-ws-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.g-ws-tile { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--g-radius-lg); background: var(--g-surface); border: 1px solid var(--g-line);
             box-shadow: var(--g-shadow); color: var(--g-text); text-decoration: none; min-height: 132px; }
.g-ws-tile:hover { border-color: var(--g-pri); color: var(--g-text); }
.g-ws-tile > i { font-size: 26px; color: var(--g-pri-text); }
.g-ws-tile b { font-size: 16px; }
.g-ws-tile .g-pill { align-self: flex-start; margin-top: auto; }

/* ---------- Items: Add Many grid ---------- */
#bulkModal .modal-content { background: var(--g-bg); }
.g-bulk-wrap { overflow: auto; max-height: calc(100vh - 230px); border-top: 1px solid var(--g-line); border-bottom: 1px solid var(--g-line); background: var(--g-surface); }
.g-bulk { border-collapse: separate; border-spacing: 0; font-size: 13.5px; min-width: 100%; }
.g-bulk th { position: sticky; top: 0; z-index: 2; background: var(--g-raised); color: var(--g-muted); font-weight: 600; font-size: 12px; text-align: left;
             padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid var(--g-line); }
.g-bulk th .g-req { color: var(--g-bad); margin-left: 2px; }
.g-bulk td { padding: 0; border-bottom: 1px solid var(--g-line); border-right: 1px solid var(--g-line); vertical-align: top; }
.g-bulk td.g-bulk-n { padding: 9px 8px; color: var(--g-faint); text-align: right; width: 36px; background: var(--g-raised); }
.g-bulk input, .g-bulk select { width: 100%; min-width: 96px; height: 38px; border: 0; padding: 0 10px; background: transparent; color: var(--g-text); font: inherit; outline: none; }
.g-bulk input[data-wide] { min-width: 220px; }
.g-bulk input[type="checkbox"] { width: 18px; min-width: 0; height: 18px; margin: 10px auto; display: block; accent-color: var(--g-pri); }
.g-bulk td:focus-within { box-shadow: inset 0 0 0 2px var(--g-pri); }
.g-bulk tr.has-err td { background: var(--g-bad-soft); }
.g-bulk .g-bulk-err { display: block; padding: 0 10px 6px; color: var(--g-bad); font-size: 11.5px; white-space: normal; }
.g-bulk .g-bulk-x { border: 0; background: transparent; color: var(--g-faint); width: 36px; height: 38px; }

/* ---------- Passkey unlock ---------- */
.g-unlock-icon { width: 76px; height: 76px; margin: 4px auto 14px; border-radius: 22px; display: grid; place-items: center;
                 background: var(--g-pri-soft); color: var(--g-pri-text); font-size: 38px; }
.g-bulk td.is-off { background: var(--g-raised); }
.g-bulk td.is-off input, .g-bulk td.is-off select { color: var(--g-faint); cursor: not-allowed; }

/* Buttons beside a page title: in a row on a laptop, wrapping to full width on a phone */
.g-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 991.98px) {
  .g-head-actions { width: 100%; }
  .g-head-actions > * { flex: 1 1 auto; justify-content: center; }
}
.g-bulk-sug { position: absolute; z-index: 1100; inset-inline: auto; max-height: 240px; overflow: auto; }
/* Add Many: the row being worked on stands out (Mohit, 11 Oct 2026) */
.g-bulk tr:focus-within td { background: var(--g-pri-soft); }
.g-bulk tr:focus-within td.g-bulk-n { background: var(--g-pri); color: var(--g-on-pri); font-weight: 700; }
.g-bulk tr:focus-within td.is-off { background: color-mix(in srgb, var(--g-pri-soft) 60%, var(--g-raised)); }
.g-bulk tr.has-err:focus-within td { background: var(--g-bad-soft); }
/* Pack sizes on a product (Mohit, 11 Oct 2026) */
.g-pack-form { border: 1px solid var(--g-line); border-radius: var(--g-radius); padding: 14px; margin-bottom: 12px; background: var(--g-raised); }
/* Products list: a product's variants, one line each under it */
.g-table tr.g-variant-row td { padding-top: 7px; padding-bottom: 7px; font-size: 13px; color: var(--g-muted); background: var(--g-raised); }
.g-cell-variant { display: flex; align-items: center; gap: 8px; padding-left: 14px; color: var(--g-text); }
.g-cell-variant i { color: var(--g-faint); }
/* A number locked by a rule (same unit on both sides is 1): looks and behaves like Add Many's locked cells */
.g-input.is-locked { background: var(--g-raised); color: var(--g-faint); cursor: not-allowed; pointer-events: none; }

/* Prefix + first + last name in one row (Employees); on a phone the last name gets its own line */
.g-name-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
@media (max-width: 520px) { .g-name-row { grid-template-columns: 96px minmax(0, 1fr); } .g-name-row > .g-field:last-child { grid-column: 1 / -1; } }

/* Copy Holidays: tick, name and old date, new date */
.g-copy-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 150px; align-items: center; gap: 12px; }
.g-copy-row input[type="checkbox"] { width: 20px; height: 20px; }
.g-copy-row .g-row-main { margin: 0; cursor: pointer; }
.g-copy-date { min-height: 40px; }
@media (max-width: 420px) { .g-copy-row { grid-template-columns: auto minmax(0, 1fr); } .g-copy-date { grid-column: 2; } }

/* Upload progress under a file field (G.upload with a box) */
.g-upload { margin-top: 8px; }
.g-upload-bar { height: 6px; border-radius: 99px; background: var(--g-raised); overflow: hidden; }
.g-upload-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--g-pri); transition: width .2s ease; }
.g-upload-text { margin-top: 4px; font-size: 12.5px; color: var(--g-muted); font-variant-numeric: tabular-nums; }
.is-waiting { opacity: .5; pointer-events: none; }

/* Photo editor: a see-through result (a signature with its paper removed) shows on a chequered backdrop */
.g-photo-preview.is-clear { background-color: #fff; background-image: linear-gradient(45deg, #e9ecea 25%, transparent 25%), linear-gradient(-45deg, #e9ecea 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9ecea 75%), linear-gradient(-45deg, transparent 75%, #e9ecea 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.g-photo-preview { margin: 0 auto; max-height: 50vh; width: auto; max-width: 100%; }

/* Easy date entry: the date in words under the box (assets/js/date-entry.js) */
.g-date-words { display: block; min-height: 1.3em; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--g-pri-text); }
.g-date-words.is-bad { color: var(--g-bad, #C62828); }

/* ===== Grabann app (customers) ===== */
.g-static { padding: 10px 0 2px; font-weight: 600; font-size: 16px; }
.g-input-lg { min-height: 54px; font-size: 20px; font-weight: 600; letter-spacing: .02em; }
.g-code-input { text-align: center; letter-spacing: .5em; font-size: 26px; font-variant-numeric: tabular-nums; }
.c-logo { background: #fff; padding: 0; overflow: hidden; }
.c-logo img { width: 100%; height: 100%; object-fit: contain; }
.c-receipt { display: block; width: 100%; height: calc(100dvh - 120px); border: 0; background: #f4f4f4; }

/* The map for an outlet's pin (Places) */
.g-map { height: 260px; border-radius: var(--g-radius); border: 1px solid var(--g-line); overflow: hidden; background: var(--g-raised); }
.leaflet-container { font: inherit; }
/* The order panel (Master → Orders, the POS Orders sheet): lines and totals, with or without pos.css */
#orderPanel .pos-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--g-line); }
#orderPanel .pos-line-main { display: flex; flex-direction: column; min-width: 0; }
#orderPanel .pos-line-name { font-weight: 600; } #orderPanel .pos-line-meta { font-size: 12.5px; color: var(--g-muted); }
#orderPanel .pos-line-amount { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
#orderPanel .pos-totals { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
#orderPanel .pos-trow { display: flex; justify-content: space-between; font-size: 14px; color: var(--g-muted); }
#orderPanel .pos-trow.pos-total { font-size: 17px; font-weight: 800; color: inherit; }

/* ---------- Accounts board (core/ui/money_board.php): money in hand, rows with amounts, photos ---------- */
.mn-hand { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 20px; margin-bottom: 12px; border-radius: var(--g-radius-lg); background: var(--g-pri); color: #fff; }
.mn-hand.is-owed { background: var(--g-hi-text); }
.mn-hand-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mn-hand-label { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.mn-hand-amount { font-size: 34px; line-height: 1.1; font-feature-settings: "tnum" 1; }
.mn-hand-sub { font-size: 13px; opacity: .85; }
.mn-hand-who { font-weight: 600; text-align: end; }
.mn-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mn-actions .g-btn, .mn-actions .g-btn-ghost { flex: 1 1 auto; justify-content: center; }
.mn-trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 14px; }
.mn-stat { padding: 10px 12px; border-radius: var(--g-radius); background: var(--g-surface); border: 1px solid var(--g-line); text-align: center; min-width: 0; }
.mn-stat span { display: block; font-size: 12px; color: var(--g-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-stat b { font-size: 16px; font-feature-settings: "tnum" 1; white-space: nowrap; }
.mn-stat.is-main b { color: var(--g-pri-text); }
.mn-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; margin-inline: 4px; }
.mn-row-end b { font-feature-settings: "tnum" 1; white-space: nowrap; }
.mn-row-end .g-help { font-size: 12px; white-space: nowrap; }
.mn-in { color: var(--g-pri-text); }
.mn-owed { color: var(--g-hi-text); }
.g-row.is-big .g-row-title::after { content: " ●"; color: var(--g-hi-text); }
.mn-accept { align-items: center; flex-wrap: wrap; }
.mn-accept .g-row-main { flex-basis: 0; }
.mn-accept-act { display: flex; align-items: center; gap: 12px; flex: none; }
.mn-accept .g-btn { flex: none; padding-inline: 14px; }
@media (max-width: 480px) { .mn-accept .g-row-main { flex-basis: calc(100% - 56px); } .mn-accept-act { width: 100%; justify-content: space-between; padding-inline-start: 56px; } }
@media (max-width: 480px) { #expPanel .g-panel-foot { flex-wrap: wrap; } #expSaveMore { order: -1; width: 100%; } }
.mn-group { margin-bottom: 18px; }
.mn-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 8px; }
.mn-group-head b { display: block; }
.mn-big { font-size: 30px; font-weight: 700; font-feature-settings: "tnum" 1; margin-bottom: 10px; }
.mn-photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 8px; }
.mn-photo { margin: 0; width: 120px; }
.mn-photo img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--g-line); display: block; }
.mn-photo figcaption { font-size: 12px; color: var(--g-muted); margin-top: 3px; }
.mn-photo figcaption .g-link-btn { padding: 0; font-size: 12px; margin-inline-start: 4px; }
.mn-photo-pick label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mn-date-row { display: flex; gap: 8px; }
.mn-date-row .g-input { flex: 1; min-width: 0; }
.mn-date-row .g-btn-ghost { flex: none; }
.mn-unit { flex: 0 0 auto; width: auto; max-width: 42%; background: var(--g-raised); border-inline-start: 1px solid var(--g-line) !important; }
.mn-date { width: 170px; }
.g-row.is-off { opacity: .6; }
.g-btn-ghost.danger { color: var(--g-bad); border-color: var(--g-bad); }
@media (max-width: 420px) { .mn-hand-amount { font-size: 28px; } .mn-trio { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mn-stat b { font-size: 14px; } .mn-stat { padding: 8px 6px; } }
