/* ==========================================================================
   OKAY POS Mobile Companion - Header, Navigation & View Panes Layout (Onyx Black)
   ========================================================================== */

/* ─── Sticky Translucent Glass Header ─── */
header {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-heading);
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 10px rgba(9, 13, 22, 0.04);
}
.hdr-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  max-width: 580px;
  margin: 0 auto;
}
.hdr-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.hdr-menu-btn {
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-heading);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-xs);
}
.hdr-menu-btn:active {
  background: var(--primary-light);
  color: var(--primary);
  transform: scale(0.92);
}
.hdr-logo {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(9, 13, 22, 0.25);
  flex-shrink: 0;
  overflow: hidden;
}
.hdr-title {
  min-width: 0;
  overflow: hidden;
}
.hdr-title h1 {
  font-size: 14.5px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  color: var(--text-heading);
  letter-spacing: -0.2px;
}
.hdr-title small {
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.hdr-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ─── Main View Container ─── */
main {
  position: relative;
  padding: 12px 14px calc(88px + env(safe-area-inset-bottom, 0px)) 14px;
  max-width: 580px;
  margin: 0 auto;
}
.pane {
  display: none !important;
  position: relative;
}
.pane.active {
  display: block !important;
  animation: paneFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── 2-Column Modern KPI Grid ─── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.kpi {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 13px 15px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
}
.kpi:active {
  transform: scale(0.975);
  box-shadow: var(--shadow-xs);
  background: #f8fafc;
}
.kpi label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: capitalize;
}
.kpi .val {
  font-size: 19px;
  font-weight: 900;
  color: var(--text-heading);
  letter-spacing: -0.4px;
}

/* ─── Quick Actions 5-Grid ─── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}
.q-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 4px 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
  user-select: none;
}
.q-btn:active {
  transform: scale(0.93);
  background: #f8fafc;
}
.q-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  margin: 0 auto 5px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.q-btn:active .q-icon {
  transform: scale(1.08);
}
.q-btn span {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-heading);
  display: block;
  white-space: nowrap;
}

/* ─── Modern Bill Cards & Sales History ─── */
.bill-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.bill-card:active {
  transform: scale(0.992);
}
.bill-card.open {
  border-color: var(--primary);
  box-shadow: 0 6px 18px var(--primary-light);
}
.bill-toggle-wrap {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
}
.bill-toggle-wrap:active {
  background: #f8fafc;
}
.bill-head {
  padding: 13px 15px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.bill-title {
  font-weight: 900;
  font-size: 14px;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bill-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}
.bill-price {
  text-align: right;
  flex-shrink: 0;
}
.bill-total {
  font-size: 19px;
  font-weight: 900;
  color: var(--success);
  letter-spacing: -0.4px;
}
.bill-tag {
  font-size: 11px;
  font-weight: 850;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}
.bill-items-preview {
  padding: 0 15px 12px 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bill-drawer {
  display: none;
  background: #f8fafc;
  border-top: 1px dashed var(--border);
  padding: 14px 16px;
}
.bill-drawer.open {
  display: block;
  animation: paneFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.b-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 13.5px;
  font-weight: 750;
  border-bottom: 1px solid var(--border);
  color: var(--text-heading);
}
.b-item:last-child {
  border-bottom: none;
}
.bill-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #0f172a;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, color 0.2s ease;
  transform-origin: center;
  font-size: 12px;
  font-weight: 900;
}
.bill-card.open .bill-chevron {
  transform: rotate(180deg);
  background: var(--primary);
  color: #ffffff;
}

/* ─── Modern Products & Catalog Rows ─── */
.prod-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.prod-row:active {
  background: #f8fafc;
  transform: scale(0.99);
}
.prod-row:last-child {
  border: none;
}
.prod-icon {
  width: 42px;
  height: 42px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(9, 13, 22, 0.12);
}
.prod-info {
  flex: 1;
  min-width: 0;
}
.prod-name {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  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: 16px;
  font-weight: 950;
  color: var(--text-heading);
}

/* ==========================================================================
   ULTRA-MODERN NATIVE FLOATING DOCK BOTTOM NAVIGATION (ONYX BLACK ACTIVE)
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 580px;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding: 4px 6px env(safe-area-inset-bottom, 0px) 6px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(9, 13, 22, 0.06);
}
.nav-btn {
  flex: 1 1 0;
  width: auto;
  max-width: none;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  padding: 4px 2px;
  border-radius: var(--radius-md);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}
.nav-btn * {
  pointer-events: none;
}
.nav-btn .icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), color 0.18s ease;
}
.nav-btn span {
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--text-secondary);
  letter-spacing: -0.1px;
  transition: color 0.18s ease, font-weight 0.18s ease;
}
.nav-btn:active {
  transform: scale(0.9);
}
.nav-btn.active {
  color: var(--primary);
}
.nav-btn.active .icon {
  color: var(--primary);
  transform: scale(1.15) translateY(-1px);
}
.nav-btn.active span {
  color: var(--primary);
  font-weight: 900;
}
.nav-btn.active::before {
  content: "";
  position: absolute;
  top: 1px;
  width: 18px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 4px var(--primary-glow);
}

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

.pos-sticky-checkout-bar {
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 580px;
  box-sizing: border-box;
  z-index: 45;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1.5px solid var(--border);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px 14px;
  box-shadow: 0 -8px 25px rgba(9, 13, 22, 0.08);
}

.pos-search-dropdown {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 280px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  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: var(--radius-md);
  padding: 8px 12px;
  gap: 8px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-xs);
  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(9, 13, 22, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  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.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 35px rgba(9, 13, 22, 0.25);
  overflow: hidden;
  box-sizing: border-box;
}
.sidebar-drawer.active {
  transform: translateX(0);
}

.sd-header {
  padding: 18px 16px;
  background: var(--hero-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sd-logo-box {
  width: 42px;
  height: 42px;
  background: var(--primary-gradient);
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.sd-brand-text {
  display: flex;
  flex-direction: column;
}
.sd-title {
  font-size: 15px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.sd-sub {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.sd-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}
.sd-close-btn:active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: scale(0.92);
}

.sd-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}
.sd-nav-group-title {
  font-size: 10px;
  font-weight: 850;
  color: var(--text-light);
  letter-spacing: 0.8px;
  padding: 10px 10px 4px 10px;
  text-transform: uppercase;
}
.sd-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  border: none;
  font-size: 13.5px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.sd-nav-item:hover, .sd-nav-item:active {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(3px);
}
.sd-nav-item .icon {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.sd-nav-item:active .icon {
  color: var(--primary);
}
.sd-nav-logout {
  margin-top: 14px;
  background: var(--danger-light);
  color: var(--danger-dark);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.sd-nav-logout:hover, .sd-nav-logout:active {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}
.sd-nav-logout .icon {
  color: var(--danger);
}

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