/* =========================================================
   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; }
.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; }
.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; } }

/* ---------- 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: 264px; overflow-y: auto;
  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; }
