/* assets/css/offline.css - ogPumper Offline v15
   Field-friendly, no animation, large touch targets. Everything is prefixed ogp15- and
   lives outside the page's own layout (a bottom status that is only there while it has
   something to say, a sticky strip at the top of Entry/RT/WT, a panel). */

:root {
  --ogp15-ink: #1f2933;
  --ogp15-muted: #5c6570;
  --ogp15-line: #d9dde3;
  --ogp15-ok: #1b7f3b;
  --ogp15-ok-bg: #e6f4ea;
  --ogp15-warn: #9a5b00;
  --ogp15-warn-bg: #fff4d6;
  --ogp15-bad: #b3261e;
  --ogp15-bad-bg: #fde9e7;
  --ogp15-info: #1c64c6;
  --ogp15-info-bg: #e8f0fe;
  --ogp15-off: #444c56;
  --ogp15-off-bg: #e9ecef;
}

body.ogp15-has-bar { padding-bottom: 60px !important; }

/* ---- bottom status: one line, shown only while it matters; the whole bar opens the list ---- */
.ogp15-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10050;
  display: flex; align-items: stretch;
  min-height: 48px; box-sizing: border-box;
  background: #fff; border-top: 2px solid var(--ogp15-line);
  font: 15px/1.3 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ogp15-ink);
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
}
@media print { .ogp15-bar, .ogp15-strip, .ogp15-panel, .ogp15-toast { display: none !important; } }
.ogp15-status {
  flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 48px; padding: 4px 12px;
  border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.ogp15-status:focus { outline: none; }
.ogp15-status:focus-visible { outline: 2px solid var(--ogp15-info); outline-offset: -2px; }
.ogp15-link[disabled] { color: var(--ogp15-muted); text-decoration: none; cursor: default; }
.ogp15-pill {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  min-height: 34px; padding: 0 11px; border-radius: 17px; font-weight: 700; white-space: nowrap;
}
.ogp15-pill.offline, .ogp15-pill.held { background: var(--ogp15-off-bg); color: var(--ogp15-off); }
.ogp15-pill.sending, .ogp15-pill.review { background: var(--ogp15-info-bg); color: var(--ogp15-info); }
.ogp15-pill.login, .ogp15-pill.attention { background: var(--ogp15-bad-bg); color: var(--ogp15-bad); }
.ogp15-pill.waiting { background: var(--ogp15-warn-bg); color: var(--ogp15-warn); }
.ogp15-pill.note { background: var(--ogp15-ok-bg); color: var(--ogp15-ok); }
.ogp15-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; display: inline-block; }
.ogp15-summary { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ogp15-summary.waiting { color: var(--ogp15-warn); }
.ogp15-summary.login, .ogp15-summary.attention { color: var(--ogp15-bad); }
.ogp15-summary.note { color: var(--ogp15-ok); }
.ogp15-summary.sending, .ogp15-summary.review { color: var(--ogp15-info); }
.ogp15-more { flex: 0 0 auto; color: var(--ogp15-muted); font-size: 18px; line-height: 1; }
.ogp15-btn {
  flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--ogp15-info); background: #fff; color: var(--ogp15-info);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.ogp15-btn.primary { background: var(--ogp15-info); color: #fff; }
.ogp15-btn.danger { border-color: var(--ogp15-bad); color: var(--ogp15-bad); }
.ogp15-btn.ok { border-color: var(--ogp15-ok); color: var(--ogp15-ok); }
.ogp15-btn[disabled] { opacity: .45; cursor: default; }
.ogp15-link { border: 0; background: none; padding: 2px 4px; font: inherit; font-weight: 700; color: var(--ogp15-info); text-decoration: underline; cursor: pointer; }

/* ---- editing strip (Entry / RT / WT) ---- */
.ogp15-strip {
  position: sticky; top: 0; z-index: 10040;
  display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap;
  padding: 5px 10px; margin: 0 -15px 6px;
  background: var(--ogp15-info-bg); border-bottom: 2px solid var(--ogp15-info);
  font: 14px/1.25 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ogp15-ink);
}
.ogp15-strip.offline { background: var(--ogp15-off-bg); border-color: var(--ogp15-off); }
.ogp15-strip b { font-size: 15px; }
/* the toolkit's own .tag (badge) paints white text: always set the colour here */
.ogp15-strip .tag { padding: 1px 7px; border-radius: 6px; background: #fff; border: 1px solid var(--ogp15-line); font-weight: 700; font-size: 12px; color: var(--ogp15-ink); }
.ogp15-strip .tag.draft { color: var(--ogp15-info); border-color: var(--ogp15-info); }
.ogp15-strip .tag.offline { color: var(--ogp15-off); }
.ogp15-strip .tag.saved { color: var(--ogp15-ok); border-color: var(--ogp15-ok); }
.ogp15-strip .tag.virtual { color: var(--ogp15-warn); border-color: var(--ogp15-warn); }
.ogp15-strip .tag.restored { color: var(--ogp15-ok); border-color: var(--ogp15-ok); background: var(--ogp15-ok-bg); }
.ogp15-strip .tag.mode { color: var(--ogp15-info); border-color: var(--ogp15-info); }
.ogp15-strip .tag.notank { color: var(--ogp15-bad); border-color: var(--ogp15-bad); }
.ogp15-restored, .ogp15-unfinished-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ogp15-strip .ogp15-link { font-size: 12px; }

/* ---- inline notices (draft restored, saved offline, blocked) ---- */
.ogp15-notice {
  margin: 8px 0; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--ogp15-line);
  font: 15px/1.4 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ogp15-ink); background: #fff;
}
.ogp15-notice.ok { background: var(--ogp15-ok-bg); border-color: var(--ogp15-ok); }
.ogp15-notice.warn { background: var(--ogp15-warn-bg); border-color: var(--ogp15-warn); }
.ogp15-notice.bad { background: var(--ogp15-bad-bg); border-color: var(--ogp15-bad); }
.ogp15-notice.info { background: var(--ogp15-info-bg); border-color: var(--ogp15-info); }
.ogp15-notice h4 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.ogp15-notice p { margin: 4px 0; }
.ogp15-notice .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ogp15-saved-card { text-align: center; padding: 22px 14px; }
.ogp15-saved-card h4 { font-size: 22px; }
.ogp15-saved-card .ogp15-btn { min-height: 52px; font-size: 17px; flex: 1 1 45%; }

/* ---- panel (sync center) ---- */
.ogp15-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10060; max-height: 88vh; overflow: auto;
  background: #fff; border-top: 3px solid var(--ogp15-info); border-radius: 14px 14px 0 0;
  box-shadow: 0 -6px 24px rgba(0,0,0,.18); padding: 12px 12px 20px;
  font: 15px/1.35 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ogp15-ink);
}
.ogp15-panel .hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ogp15-panel .hd h3 { margin: 0; font-size: 19px; font-weight: 800; }
.ogp15-panel .sect { margin: 12px 0 4px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ogp15-muted); }
.ogp15-panel .actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.ogp15-item { border: 1px solid var(--ogp15-line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.ogp15-item .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ogp15-item .kind { font-weight: 800; }
.ogp15-item .when { color: var(--ogp15-muted); font-size: 13px; }
.ogp15-item .err { margin-top: 6px; color: var(--ogp15-bad); }
.ogp15-item .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ogp15-chip { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 13px; font-weight: 800; }
.ogp15-chip.queued, .ogp15-chip.retry { background: var(--ogp15-warn-bg); color: var(--ogp15-warn); }
.ogp15-chip.syncing { background: var(--ogp15-info-bg); color: var(--ogp15-info); }
.ogp15-chip.synced { background: var(--ogp15-ok-bg); color: var(--ogp15-ok); }
.ogp15-chip.needs_login, .ogp15-chip.needs_attention { background: var(--ogp15-bad-bg); color: var(--ogp15-bad); }
.ogp15-chip.held { background: var(--ogp15-off-bg); color: var(--ogp15-off); }
.ogp15-chip.review { background: var(--ogp15-info-bg); color: var(--ogp15-info); }
.ogp15-empty { color: var(--ogp15-muted); padding: 8px 0; }
.ogp15-readiness { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ogp15-progress { height: 10px; background: #eef1f4; border-radius: 5px; overflow: hidden; flex: 1 1 120px; }
.ogp15-progress > i { display: block; height: 100%; background: var(--ogp15-info); width: 0; }

/* ---- pumper page: work typed on this phone and not submitted (only when there is some) ---- */
.ogp15-unfinished { margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--ogp15-info); border-radius: 8px; background: var(--ogp15-info-bg);
  font: 15px/1.35 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ogp15-ink); }
.ogp15-unfinished .hd { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ogp15-muted); margin-bottom: 4px; }
.ogp15-unfinished .it { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--ogp15-line); }
.ogp15-unfinished .it:first-of-type { border-top: 0; }
.ogp15-unfinished .what { flex: 1 1 200px; min-width: 0; }
.ogp15-unfinished .acts { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.ogp15-unfinished .ogp15-btn { min-height: 40px; }

/* ---- toast ---- */
.ogp15-toast {
  position: fixed; left: 50%; bottom: 62px; transform: translateX(-50%); z-index: 10070;
  max-width: 92vw; padding: 12px 16px; border-radius: 10px; background: #1f2933; color: #fff;
  font: 15px/1.35 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.ogp15-toast.bad { background: var(--ogp15-bad); }

/* ---- offline greying of links that need the server ---- */
a.ogp15-unavailable { opacity: .45; pointer-events: none; }

/* ---- Entry page: tickets saved on this phone, in the server's own tables ---- */
tr.ogp15-tkt > td { background: var(--ogp15-warn-bg) !important; }
tr.ogp15-tkt.sent > td { background: var(--ogp15-ok-bg) !important; }
tr.ogp15-tkt.del > td { color: var(--ogp15-muted); text-decoration: line-through; }
tr.ogp15-tkt.del > td a, tr.ogp15-tkt.del .ogp15-tkt-tag { text-decoration: none; display: inline-block; }
tr.ogp15-replaced, .ogp15-ph-hidden { display: none !important; }
.ogp15-tkt-tag { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 800; font-style: normal; white-space: normal; text-wrap: balance; }
.ogp15-tkt-tag.saved { background: #fff; color: var(--ogp15-warn); border: 1px solid var(--ogp15-warn); }
.ogp15-tkt-tag.sending { background: var(--ogp15-info-bg); color: var(--ogp15-info); border: 1px solid var(--ogp15-info); }
.ogp15-tkt-tag.sent { background: #fff; color: var(--ogp15-ok); border: 1px solid var(--ogp15-ok); }
.ogp15-tkt-tag.bad { background: var(--ogp15-bad-bg); color: var(--ogp15-bad); border: 1px solid var(--ogp15-bad); }
.ogp15-sum-note { margin: 8px 0 2px; padding: 6px 9px; border-radius: 6px; background: var(--ogp15-warn-bg); color: var(--ogp15-warn); font-weight: 700; font-size: 13px; }
/* Recent Gauge History while it cannot show the current picture */
.ogp15-history-off > :not(.panel-heading):not(.ogp15-history-msg) { display: none !important; }
.ogp15-history-msg { padding: 10px 12px; color: var(--ogp15-muted); text-align: center; }
.ogp15-history-msg .ogp15-link { font-size: inherit; }

/* ---- the prepare after a sign-in: a small dialog, closed by a tap anywhere outside it ---- */
.ogp15-modal-back { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 10060; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(31, 41, 51, .38); }
.ogp15-modal { width: 100%; max-width: 360px; background: #fff; color: var(--ogp15-ink); border-radius: 12px; padding: 18px 18px 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
.ogp15-modal h3 { margin: 0 0 8px; font-size: 19px; font-weight: 800; line-height: 1.25; text-wrap: balance; }
.ogp15-modal .count { margin: 0 0 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ogp15-modal .sub { margin: 10px 0 0; color: var(--ogp15-muted); }
.ogp15-modal .row { display: flex; justify-content: flex-end; margin: 12px 0 0; }
.ogp15-modal .ogp15-btn { min-height: 44px; min-width: 120px; }
