/* OKAY POS Mobile Companion - Header, Navigation & View Panes Layout */

/* Header */
header {
  background: #ffffff;
  color: #000000;
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1.5px solid var(--border);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}
.hdr-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  max-width: 580px;
  margin: 0 auto;
}
.hdr-brand { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.hdr-menu-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  border-radius: 9px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.hdr-logo {
  width: 34px;
  height: 34px;
  background: #0f172a;
  border-radius: 9px;
  border: 1.5px solid rgba(15, 23, 42, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
  flex-shrink: 0;
  overflow: hidden;
}
.hdr-title { min-width: 0; overflow: hidden; }
.hdr-title h1 {
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  color: #000000;
}
.hdr-title small {
  font-size: 10px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.hdr-btns { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

/* Sidebar Drawer & Responsive Navigation Menu */
.sidebar-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 99990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 285px;
  max-width: 85vw;
  background: #ffffff;
  z-index: 99995;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 6px 0 25px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-drawer.active {
  transform: translateX(0);
}

.sd-header {
  padding: 16px 14px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sd-logo-box {
  width: 38px;
  height: 38px;
  background: #ffffff;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}
.sd-brand-text { min-width: 0; }
.sd-title {
  font-size: 14.5px;
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sd-sub {
  font-size: 10.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
.sd-close-btn {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sd-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 10px;
}
.sd-nav-group-title {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 4px 8px;
  margin-bottom: 4px;
}
.sd-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10.5px 12px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
  margin-bottom: 2px;
}
.sd-nav-item:active, .sd-nav-item.active {
  background: #f1f5f9;
  color: #0f172a;
}
.sd-nav-item svg {
  color: #64748b;
  flex-shrink: 0;
}
.sd-nav-logout {
  color: #dc2626;
  margin-top: 6px;
  background: rgba(220, 38, 38, 0.06);
}
.sd-nav-logout svg { color: #dc2626; }

.sd-footer {
  padding: 12px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* OTA Banner */
#otaBanner {
  display: none;
  background: #ffffff;
  border-bottom: 2px solid var(--primary);
  color: #000000;
  padding: 9px 14px;
  font-size: 11.5px;
  font-weight: 800;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 580px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
#otaBanner button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

/* Main Layout & Panes */
main {
  position: relative;
  padding: 10px 12px calc(85px + env(safe-area-inset-bottom, 0px)) 12px;
  max-width: 580px;
  margin: 0 auto;
}
.pane { display: none !important; position: relative; }
.pane.active { display: block !important; animation: paneFadeIn 0.1s ease-out; }

/* 2-Column KPI Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 10px; }
.kpi {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.kpi:active { background: #f1f5f9; transform: scale(0.985); }
.kpi label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; color: #475569; margin-bottom: 4px; }
.kpi .val { font-size: 17px; font-weight: 950; color: #000000; }

/* Quick Actions 5-Grid */
.quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.q-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 9px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.q-btn:active { transform: scale(0.94); background: #f1f5f9; }
.q-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin: 0 auto 4px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.q-btn span { font-size: 10.5px; font-weight: 800; color: #000000; display: block; white-space: nowrap; }

/* Bill Cards & Overview */
.bill-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bill-card:active {
  background: #fafafa;
}
.bill-card.open {
  border-color: #cbd5e1;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}
.bill-head {
  padding: 11px 13px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
}
.bill-head:active {
  background: #f8fafc;
}
.bill-title {
  font-weight: 950;
  font-size: 13.5px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bill-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}
.bill-price {
  text-align: right;
  flex-shrink: 0;
}
.bill-total {
  font-size: 16px;
  font-weight: 950;
  color: var(--success);
  letter-spacing: -0.2px;
}
.bill-tag {
  font-size: 10px;
  font-weight: 850;
  padding: 2px 6px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}
.bill-items-preview {
  padding: 0 13px 9px 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.item-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  max-width: 100%;
}
.bill-drawer {
  display: none;
  background: #f8fafc;
  border-top: 1px dashed #cbd5e1;
  padding: 12px 13px;
}
.bill-drawer.open {
  display: block;
  animation: slideDown 0.18s ease-out;
}
.b-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}
.b-item:last-child {
  border: none;
}
.bill-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  transform-origin: center;
}
.bill-drawer.open ~ .bill-head .bill-chevron,
.bill-card.open .bill-chevron {
  transform: rotate(180deg);
}

/* Products & Rows */
.prod-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  gap: 10px;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.prod-row:active { background: #f1f5f9; transform: scale(0.99); }
.prod-row:last-child { border: none; }
.prod-icon {
  width: 40px;
  height: 40px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}
.prod-info { flex: 1; min-width: 0; }
.prod-name { font-size: 13.5px; font-weight: 900; color: #000000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-meta { font-size: 11px; color: #475569; font-weight: 700; margin-top: 2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.prod-right { text-align: right; flex-shrink: 0; }
.prod-price { font-size: 15px; font-weight: 950; color: #000000; }

/* Modern Compact Bottom Navigation Bar (6 Balanced Tabs) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 580px;
  height: calc(46px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}
.nav-btn {
  flex: 1 1 16.66%;
  width: 16.66%;
  max-width: 16.66%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: none;
  border: none;
  color: #334155;
  cursor: pointer;
  position: relative;
  padding: 2px 1px;
  transition: color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}
.nav-btn * { pointer-events: none; }
.nav-btn .icon {
  width: 15px;
  height: 15px;
  color: #334155;
  transition: transform 0.15s ease, color 0.15s ease;
}
.nav-btn.active {
  color: #000000;
}
.nav-btn.active .icon {
  color: #000000;
  transform: scale(1.08);
}
.nav-btn.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 20px;
  height: 2.5px;
  background: #000000;
  border-radius: 0 0 3px 3px;
}
.nav-btn span {
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: #334155;
  letter-spacing: -0.2px;
}
.nav-btn.active span {
  color: #000000;
  font-weight: 950;
}
.nav-btn:active { transform: scale(0.92); }

/* Dedicated Tab POS Padding for Fullscreen View & Fixed Checkout Bar */
#tabPos {
  padding-top: max(6px, env(safe-area-inset-top, 0px));
  padding-bottom: calc(230px + env(safe-area-inset-bottom, 0px));
}

/* Pinned Sticky Bottom Summary & Punch Sale Action Bar */
.pos-sticky-checkout-bar {
  position: fixed;
  bottom: calc(46px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 580px;
  box-sizing: border-box;
  z-index: 45;
  background: #f1f5f9;
  border-top: 1.5px solid #cbd5e1;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  border-radius: 14px 14px 0 0;
  padding: 8px 10px 8px 10px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* Interactive Product Search Dropdown */
.pos-search-dropdown {
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  animation: posDropdownAnim 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes posDropdownAnim {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.cart-item-row-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 9px;
  gap: 6px;
  margin-bottom: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: background 0.12s ease;
}
.cart-item-row-compact:active {
  background: #f8fafc;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * SLIDE-OUT NAVIGATION SIDEBAR DRAWER STYLING
 * ───────────────────────────────────────────────────────────────────────────── */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 295px;
  max-width: 84vw;
  background: #ffffff;
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 6px 0 28px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  box-sizing: border-box;
}
.sidebar-drawer.active {
  transform: translateX(0);
}

.sd-header {
  padding: 16px 14px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sd-logo-box {
  width: 40px;
  height: 40px;
  background: #1e293b;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.sd-brand-text {
  display: flex;
  flex-direction: column;
}
.sd-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.sd-sub {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.sd-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  outline: none;
}
.sd-close-btn:active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.sd-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}
.sd-nav-group-title {
  font-size: 9.5px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.6px;
  padding: 10px 10px 4px 10px;
  text-transform: uppercase;
}
.sd-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  border: none;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}
.sd-nav-item:hover, .sd-nav-item:active {
  background: #f1f5f9;
  color: #0f172a;
}
.sd-nav-item .icon {
  flex-shrink: 0;
  color: #64748b;
  transition: color 0.15s ease;
}
.sd-nav-item:active .icon {
  color: #0f172a;
}
.sd-nav-logout {
  margin-top: 12px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fee2e2;
}
.sd-nav-logout:hover, .sd-nav-logout:active {
  background: #fee2e2;
  color: #b91c1c;
}
.sd-nav-logout .icon {
  color: #dc2626;
}

.sd-footer {
  padding: 14px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}



