/* =====================================================================
   ep8.2 LAYOUT (2026-11-04): header strip, bottom tab bar, My Day, scan card
   Loaded after css/eps-blue.css. Same colour variables repeated here so the layout
   still works with ?s=classic (where eps-blue.css is not loaded).
   ===================================================================== */
:root {
  --bg: #eef1f5; --surface: #ffffff; --surface-2: #f6f8fa; --border: #d5dbe3;
  --text: #1f2a37; --text-muted: #5b6675; --blue: #1f6fd1; --blue-dark: #1859a8;
  --blue-tint: #e6f0fb; --blue-tint-2: #cfe1f7; --green: #1e8e5a; --red: #c2412d; --amber: #b7791f;
}

/* pages carry .ui-body-c, which the theme makes white for cards: keep the page itself grey */
.ui-mobile .ui-page, .ui-mobile .ui-page.ui-body-a, .ui-mobile .ui-page.ui-body-b, .ui-mobile .ui-page.ui-body-c,
.ui-mobile .ui-page.ui-body-d, .ui-mobile .ui-page.ui-body-e { background: var(--bg) !important; }

/* switches (Type/Camera, Qty/$$$): room for the label at tablet font size */
.ui-slider-switch { width: 8.5em !important; }

/* ---------- touch targets (tablet, no mouse): every link / button at least ~44px tall ---------- */
/* plain text links (emails, "more details....", report links): bigger tap area without moving the text */
.ui-content a.ui-link, .ui-popup a.ui-link {
  padding: 12px 6px; margin: 0 -6px; -webkit-tap-highlight-color: rgba(31, 111, 209, .18); }
/* header Back / Scan */
.ui-header .ui-btn { min-height: 40px; }
.ui-header .ui-btn-inner { padding-top: .75em !important; padding-bottom: .75em !important; }
/* small links in My Day / scan list headings */
.md-fulllink { display: inline-block; padding: 12px 8px; margin: -12px -8px; }
.md-fullbtn {
  display: block; min-height: 46px; line-height: 46px; text-align: center; margin: 4px 0 8px;
  background: var(--blue-tint); color: var(--blue-dark) !important; font-weight: 700; border-radius: 10px; text-decoration: none; }
/* list rows, buttons and radio/checkbox buttons */
a.md-row, .md-row { min-height: 52px; }
.md-seg button { min-height: 44px; }
.ui-content .ui-btn:not(.ui-btn-icon-notext) .ui-btn-inner { min-height: 22px; }
.ui-content .ui-btn.ui-mini:not(.ui-btn-icon-notext):not(.ui-slider-handle) { min-height: 42px; }
.ui-listview > li > .ui-btn-inner > .ui-btn-text > a.ui-link-inherit { min-height: 24px; }
/* on/off switches (Qty/$$$, Type/Camera): 44px tall track and handle */
html div.ui-slider-switch, html div.ui-slider-switch.ui-mini { height: 44px !important; line-height: 44px; }
html div.ui-slider-switch .ui-slider-label { line-height: 44px !important; font-size: 15px !important; }
html div.ui-slider-switch .ui-slider-handle { width: 40px !important; height: 40px !important; top: 2px !important; margin: 0 0 0 -20px !important; }
html div.ui-slider-switch .ui-slider-inneroffset { margin: 0 20px !important; }
/* horizontal button groups (Day range 1 / 7 / MTD / YTD, Mine / All ...): at least 44px wide */
.ui-controlgroup-horizontal .ui-btn { min-width: 44px; }
.ui-controlgroup-horizontal .ui-btn-inner { padding-left: 14px !important; padding-right: 14px !important; text-align: center; }
/* search button inside the barcode box */
html .sc-inputrow .ui-btn.ui-btn-icon-notext { width: 42px !important; height: 42px !important; }

/* ---------- header ---------- */
.eps-hdr .ui-title { line-height: 1.15; padding-top: .45em; padding-bottom: .45em; }
.eps-sub { display: block; font-size: 11px; font-weight: 400; opacity: .85; margin-top: 2px; }
.eps-strip {
  background: var(--surface);
  color: var(--text) !important;
  border-bottom: 1px solid var(--border);
  padding: 7px 14px !important;
  text-align: left !important;
  text-transform: none !important;
  font-size: 13px !important;
}
.eps-strip b { color: var(--blue-dark); text-transform: uppercase; letter-spacing: .3px; }
.eps-strip-lbl { color: var(--text-muted); }
.eps-strip-empty { display: none; }

/* ---------- bottom tab bar ---------- */
.eps-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -1px 3px rgba(16, 24, 40, .06);
}
/* only the open page shows its tab bar. Old pages with unbalanced <div>s (stopsession.php, editsession)
   can push a page's footer out of its page; it must not sit over another page's form. */
.eps-tabwrap { display: none; }
.ui-page-active .eps-tabwrap { display: block; }
html .eps-tabbar a.eps-tab, html .eps-tabbar a.eps-tab:visited {
  flex: 1; position: relative;
  display: block; text-align: center; text-decoration: none;
  padding: 7px 0 9px; min-height: 44px;
  font-size: 11px; font-weight: 600; color: var(--text-muted) !important;
}
.eps-tabbar .eps-ti { display: block; font-size: 20px; line-height: 24px; font-weight: 400; }
.eps-tabbar a.eps-tab-on { color: var(--blue) !important; }
.eps-tabbar a.eps-tab-on:before {
  content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px;
  background: var(--blue); border-radius: 0 0 3px 3px;
}
.eps-tabbar a.eps-tab-off { opacity: .4; pointer-events: none; }
.eps-badge {
  position: absolute; top: 3px; left: 54%;
  background: var(--red); color: #fff; font-size: 10px; line-height: 16px;
  min-width: 16px; padding: 0 4px; border-radius: 8px;
}
.ui-page { padding-bottom: 70px; }
.eps-more { min-width: 280px; }
.eps-more .ui-li-divider { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.eps-more .eps-cancel { color: var(--text-muted) !important; text-align: center; }

/* ---------- shared list rows ---------- */
.md-listhead { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 8px; font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.md-fulllink { font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 600; text-decoration: none; color: var(--blue) !important; }
a.md-row, .md-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: var(--text) !important;
}
a.md-row:active { background: var(--blue-tint); }
.md-row-main { flex: 1; min-width: 0; }
.md-row-main b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-row-main small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.md-tag { flex: none; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 3px 8px; background: var(--blue-tint); color: var(--blue-dark); }
.md-tag-buy, .md-tag-o3 { background: var(--green); color: #fff; }
.md-tag-close { background: #fbeae6; color: var(--red); }
.md-tag-suspended { background: #fbf1df; color: var(--amber); }
.md-tag-o2 { background: var(--surface-2); color: var(--text-muted); }
.md-tag-o1 { background: #e7f5ee; color: var(--green); }
.md-empty { text-align: center; color: var(--text-muted); padding: 18px 8px; }
.md-loading { opacity: .5; transition: opacity .15s; }

/* ---------- My Day ---------- */
.md-content { max-width: 760px; margin: 0 auto; }
.md-top { display: flex; gap: 8px; align-items: center; margin: 2px 0 10px; }
.md-seg { flex: 1; display: flex; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.md-seg button, .md-refresh { -webkit-appearance: none; appearance: none; border: 0; cursor: pointer; font: inherit; }
.md-seg button { flex: 1; min-height: 40px; border-radius: 7px; background: transparent; color: var(--text-muted); font-weight: 600; }
.md-seg button.md-on { background: var(--surface); color: var(--blue-dark); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.md-refresh { width: 46px; height: 46px; border-radius: 10px; background: var(--blue-tint); color: var(--blue-dark); font-size: 20px; }
.md-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .md-cards { grid-template-columns: repeat(3, 1fr); } }
.md-card {
  -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; text-align: left;
  position: relative; display: block; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
}
.md-card:after { content: "\203A"; position: absolute; right: 12px; top: 9px; color: var(--text-muted); font-size: 18px; }
.md-card.md-sel { border: 2px solid var(--blue); background: var(--blue-tint); padding: 10px 12px; }
.md-lbl { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.md-v { display: block; font-size: 28px; font-weight: 700; line-height: 1.15; margin-top: 2px; color: var(--text); }
.md-d { display: block; font-size: 12px; color: var(--text-muted); }
.md-open .md-v { color: var(--blue); }
.md-buy .md-v { color: var(--green); }
.md-susp .md-v { color: var(--amber); }
.md-fc .md-v { color: var(--red); }
.md-updated { font-size: 12px; color: var(--text-muted); text-align: right; margin: 6px 2px 12px; }
.md-list { min-height: 60px; }
.md-links { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.md-links a { display: flex; justify-content: space-between; padding: 14px; border-top: 1px solid var(--border);
  text-decoration: none; color: var(--text) !important; font-size: 15px; }
.md-links a:first-child { border-top: 0; }
.md-count { background: var(--blue); color: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 20px; }
.md-count:empty { display: none; }

/* ---------- Item detail page (inventory.php): show the picture large ---------- */
#itemimage img { height: 45vh !important; max-height: 640px; width: auto !important; max-width: 100%; object-fit: contain; padding: 8px 0 !important; }
@media (max-width: 599px) { #itemimage img { height: 34vh !important; } }
/* Like / Buy / Dislike on the detail page: finger-size */
.ui-footer a[onclick^="like("] { min-width: 28%; margin: 4px 1% !important; }
.ui-footer a[onclick^="like("] .ui-btn-inner { padding: 14px 10px !important; font-size: 17px !important; }
.ui-footer a[onclick="like(3)"] { background: var(--green) !important; border-color: var(--green) !important; }

/* ---------- Scan page ---------- */
/* switches row + barcode box, all on the same 640px column */
.sc-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 640px; margin: 4px auto 12px; }
.sc-switch { display: flex; align-items: center; gap: 8px; }
.sc-switchlbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); white-space: nowrap; padding-top: 4px; }
.sc-switch select { display: none !important; }   /* the native select stays hidden; jQuery Mobile draws the switch */
.sc-switch div.ui-slider-switch { margin: 0 !important; float: none !important; display: inline-block; vertical-align: middle; }
.sc-inputrow { position: relative; max-width: 640px; margin: 0 auto 12px; }
.sc-inputrow .ui-input-text { margin: 0 !important; width: 100%; box-sizing: border-box; }
.sc-inputrow #barcode { padding-right: 56px !important; padding-left: 56px !important; } /* keeps the centred text clear of the button */
.sc-inputrow .ui-btn { position: absolute !important; right: 8px; top: 50%; margin: 0 !important; transform: translateY(-50%); z-index: 2; }
#readerbox { margin-bottom: 12px !important; }
#scancontent { color: var(--text) !important; }
#scancontent #searchsku > div { max-width: 640px; margin: 0 auto; }
.sc-acts { display: flex; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.sc-btn, a.sc-btn {
  -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer;
  flex: 1; min-width: 80px; min-height: 46px; padding: 10px 6px; border-radius: 10px;
  border: 1px solid var(--blue-tint-2); background: var(--blue-tint); color: var(--blue-dark) !important;
  font-weight: 700; font-size: 15px; text-align: center; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.sc-btn:disabled { opacity: .5; }
a.sc-btn.sc-primary { background: var(--blue); border-color: var(--blue); color: #fff !important; }
.sc-session { text-align: left; margin-top: 4px; }
.sc-addcust { display: block; margin: 14px auto 4px; max-width: 640px; padding: 12px; border-radius: 10px; background: var(--blue-tint);
  color: var(--blue-dark) !important; font-weight: 700; text-decoration: none; text-align: center; }
.ss-acts { margin: 34px 0 10px; } /* the old listview has a -15px bottom margin */
#qtytext { color: var(--text-muted) !important; }

/* ---------- Statistics reports (tablesorter) ---------- */
#wisecategorywrap { margin: 6px 0; }
.eps-stats-filters { display: flex; gap: 8px; }
.eps-stats-filters > div { flex: 1 1 0; min-width: 0; } /* equal widths: a long category name must not push the other dropdown away */
.eps-stats-wrap { clear: both; margin-top: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.eps-stats {
  width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 15px;
  background: var(--surface, #fff) !important; border: 1px solid var(--border, #d5dbe3); border-radius: var(--radius, 8px);
}
table.eps-stats thead tr th {
  height: 44px; padding: 6px 22px 6px 8px !important; position: relative; text-align: left; vertical-align: middle;
  font-size: 13px; font-weight: 700; line-height: 1.2;
  background: var(--blue-tint, #e6f0fb) !important; color: var(--blue-dark, #1859a8) !important;
  border: 0 !important; border-bottom: 1px solid var(--blue-tint-2, #cfe1f7) !important;
  -webkit-user-select: none; user-select: none;
}
table.eps-stats thead tr th.num { text-align: right; }
table.eps-stats thead tr th.tablesorter-header { cursor: pointer; }
table.eps-stats thead tr th.tablesorter-header:after { content: "\2195"; position: absolute; right: 7px; top: 50%; margin-top: -9px; opacity: .45; }
table.eps-stats thead tr th.tablesorter-headerAsc:after { content: "\25B2"; opacity: 1; font-size: 11px; margin-top: -7px; }
table.eps-stats thead tr th.tablesorter-headerDesc:after { content: "\25BC"; opacity: 1; font-size: 11px; margin-top: -7px; }
table.eps-stats thead tr th.tablesorter-headerAsc, table.eps-stats thead tr th.tablesorter-headerDesc { background: var(--blue-tint-2, #cfe1f7) !important; }
table.eps-stats tbody td {
  padding: 10px 8px !important; font-size: 15px; background: var(--surface, #fff) !important; color: var(--text, #1f2a37) !important;
  border: 0 !important; border-bottom: 1px solid var(--border, #d5dbe3) !important;
}
table.eps-stats tbody tr.odd td { background: var(--surface-2, #f6f8fa) !important; }
table.eps-stats tbody tr:last-child td { border-bottom: 0 !important; }
table.eps-stats tbody td { text-align: left !important; }
table.eps-stats tbody td.num { text-align: right !important; font-variant-numeric: tabular-nums; }
table.eps-stats thead tr th.c, table.eps-stats tbody td.c { text-align: center !important; }
table.eps-calendar thead tr th { padding-right: 8px !important; }
table.eps-stats .sub { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted, #5b6675); }
.eps-stats-note { margin: 6px 2px; font-size: 12px; color: var(--text-muted, #5b6675); }
table.eps-stats td.who { font-weight: 700; }
table.eps-stats td.pct { font-weight: 700; color: var(--blue-dark, #1859a8) !important; }
@media (max-width: 480px) {
  table.eps-stats thead tr th { padding: 6px 15px 6px 4px !important; font-size: 11px; }
  table.eps-stats thead tr th.tablesorter-header:after { right: 3px; }
  table.eps-stats tbody td { overflow-wrap: anywhere; }
  table.eps-calendar { table-layout: fixed; }
  table.eps-calendar .sub { font-size: 10px; }
  table.eps-calendar thead tr th:first-child { width: 17%; }
  table.eps-calendar thead tr th { padding: 6px 2px !important; }
  table.eps-calendar tbody td { padding: 8px 2px !important; }
  table.eps-stats tbody td { padding: 10px 4px !important; font-size: 13px; }
}

/* Search Customer (mycustomers.php): search box, Sort on and Search on one row; on a phone the box takes its own row */
.custsearch-title { margin-bottom: 6px; }
.custsearch-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-bottom: 10px; }
.custsearch-text { flex: 1 1 260px; min-width: 0; }
.custsearch-sort { flex: 1 1 150px; min-width: 0; max-width: 240px; }
.custsearch-go { flex: 0 0 auto; }
.custsearch-row .ui-input-text, .custsearch-row .ui-select, .custsearch-row .ui-btn { margin: 0 !important; }
.custsearch-row input.ui-input-text { height: 44px !important; box-sizing: border-box; font-size: 16px !important; } /* 16px: iOS zooms the page on smaller inputs */
.custsearch-row .ui-btn { height: 44px; box-sizing: border-box; }
.custsearch-row .ui-btn-inner { padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 480px) {
  .custsearch-text { flex-basis: 100%; }
  .custsearch-sort { max-width: none; }
}