/* ==========================================================================
   TuBox-POS Professional Desktop Cashier Interface & Desktop Hub
   Designed for EdalanGarch - 100% Responsive Engine (PC, Tablet, Phone, Landscape)
   ========================================================================== */

/* Root & Container */
.tubox-pos-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: #f1f5f9;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1e293b;
  overflow: hidden;
  position: fixed;
  inset: 0;
  z-index: 10;
}

/* ==================== 1. TOP POS HEADER BAR ==================== */
.tubox-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 1rem;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.82rem;
  border-bottom: 1px solid #1e293b;
  min-height: 42px;
  flex-shrink: 0;
}

.tubox-brand-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
}

.tubox-brand-tag span.badge-name {
  color: #f59e0b;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.tubox-status-indicators {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #cbd5e1;
}

.btn-install-pwa-pos-head {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000000;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-install-pwa-pos-head:hover {
  background: #fbbf24;
  transform: scale(1.03);
}

.badge-selling-local {
  background: #15803d;
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.badge-selling-local .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
}

/* ==================== 2. TOP SCANNER & SEARCH BAR ==================== */
.tubox-search-row {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  background: #f8fafc;
  border-bottom: 1.5px solid #e2e8f0;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.tubox-scanner-wrapper {
  flex: 1;
  min-width: 320px;
  position: relative;
  display: flex;
  align-items: center;
}

.scanner-icon-left {
  position: absolute;
  left: 1.1rem;
  font-size: 1.25rem;
  color: #f59e0b;
  pointer-events: none;
  z-index: 5;
  user-select: none;
}

.tubox-scanner-input {
  width: 100%;
  padding: 0.8rem 5.5rem 0.8rem 3rem;
  font-size: 1.12rem;
  font-weight: 700;
  border: 2.5px solid #f59e0b;
  border-radius: 10px;
  outline: none;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.12);
  transition: all 0.2s ease;
}

.tubox-scanner-input:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
  background: #ffffff;
}

.scanner-actions-right {
  position: absolute;
  right: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 5;
}

.btn-clear-search {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-clear-search:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.badge-f3-shortcut {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  user-select: none;
}

/* Customer selector */
.tubox-customer-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.25rem 0.5rem 0.25rem 0.75rem;
  gap: 0.4rem;
  width: 240px;
  transition: border-color 0.2s ease;
}

.tubox-customer-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.customer-icon {
  font-size: 1.1rem;
  color: #64748b;
}

.tubox-customer-input {
  border: none;
  outline: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  width: 100%;
  background: transparent;
}

.btn-customer-picker {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-customer-picker:hover {
  background: #e2e8f0;
}

.tubox-btn-weighed,
.tubox-btn-reprint {
  padding: 0.75rem 0.95rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tubox-btn-weighed:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0284c7;
}

.tubox-btn-reprint:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* ==================== POS LIVE PREDICTIVE SEARCH DROPDOWN ==================== */
.pos-search-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 2.5px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  z-index: 3000;
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeIn 0.15s ease-out;
}

.pos-search-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  background: #1e1b4b;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* 3-Column Anti-Collision Row: Left (Thumb+Stock) / Center (Info) / Right (Price+Btn) */
.pos-search-dropdown-item {
  display: grid;
  grid-template-columns: 56px 1fr 90px;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.15s ease;
  background: #ffffff;
  color: #1e293b;
}

.pos-search-dropdown-item:hover,
.pos-search-dropdown-item.selected {
  background: #fef3c7;
}

.pos-search-thumb-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.pos-search-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  overflow: hidden;
}

.pos-search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pos-search-stock-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.1;
  text-align: center;
}

.pos-stock-ok { background: #dcfce7; color: #15803d; }
.pos-stock-low { background: #fef3c7; color: #b45309; }
.pos-stock-out { background: #fee2e2; color: #dc2626; }

.pos-search-info-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pos-search-item-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.pos-search-item-meta {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-search-item-meta code {
  background: #f1f5f9;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  color: #0284c7;
  font-weight: 700;
}

.pos-search-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.pos-search-price {
  font-size: 0.95rem;
  font-weight: 900;
  color: #15803d;
  white-space: nowrap;
}

.btn-pos-add-search {
  background: #15803d;
  color: #ffffff;
  border: none;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.btn-pos-add-search:hover {
  background: #166534;
}

/* ==================== 3. CENTER POS WORK AREA (SPLIT TABLE + KEYPAD) ==================== */
.tubox-main-work-area {
  display: grid;
  grid-template-columns: 1fr 340px;
  flex: 1;
  overflow: hidden;
  background: #ffffff;
}

/* Left Table Panel */
.tubox-table-panel {
  display: flex;
  flex-direction: column;
  border-right: 2px solid #e2e8f0;
  overflow: hidden;
  background: #ffffff;
  min-height: 0;
}

.tubox-table-header {
  display: grid;
  grid-template-columns: 36px 1fr 120px 100px 110px 45px;
  padding: 0.65rem 1rem;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.8rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.tubox-table-items {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
}

.tubox-item-row {
  display: grid;
  grid-template-columns: 36px 1fr 120px 100px 110px 45px;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  font-weight: 600;
  align-items: center;
  transition: background 0.15s ease;
}

.tubox-item-row:hover {
  background: #f8fafc;
}

.row-num {
  font-weight: 700;
  color: #94a3b8;
  font-size: 0.85rem;
}

.row-product-name {
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.92rem;
}

.row-product-meta {
  font-size: 0.75rem;
  color: #64748b;
}

.row-qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.btn-qty-step {
  width: 26px;
  height: 26px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  font-weight: 900;
  font-size: 0.95rem;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-qty-step:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.tubox-item-row input.qty-field {
  width: 48px;
  padding: 0.25rem 0.2rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
}

.tubox-item-row input.qty-field:focus {
  border-color: #f59e0b;
}

.row-unit-price {
  text-align: right;
  font-size: 0.88rem;
  color: #475569;
  font-weight: 700;
}

.row-line-total {
  text-align: right;
  font-weight: 900;
  color: #0f172a;
  font-size: 1rem;
}

.btn-del-row {
  background: transparent;
  border: none;
  font-size: 1.05rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-del-row:hover {
  opacity: 1;
  transform: scale(1.15);
}

.tubox-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  text-align: center;
  padding: 2rem;
}

.tubox-empty-state h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 0.25rem;
}

/* ==================== BOTTOM TOTALS & OWNER PRIVATE MARGIN ==================== */
.tubox-bottom-totals-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.85rem 1.25rem;
  background: #fafafa;
  border-top: 2px solid #e2e8f0;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.tubox-left-summary-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tubox-public-items-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  width: fit-content;
  border: 1px solid #e2e8f0;
}

.btn-owner-margin-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn-owner-margin-lock:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
  transform: translateY(-1px);
}

.btn-owner-margin-lock .lock-pill {
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.tubox-owner-private-box {
  background: #fefce8;
  border: 1.5px dashed #f59e0b;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: #64748b;
  animation: fadeIn 0.2s ease-out;
}

.tubox-owner-box-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.tubox-owner-private-box .title {
  font-weight: 800;
  color: #b45309;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-hide-owner-margin {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-hide-owner-margin:hover {
  background: #fecaca;
}

.tubox-owner-metrics-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.85rem;
}

.tubox-owner-metrics-rows .metric-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #475569;
}

.tubox-owner-metrics-rows .metric-line strong {
  color: #0f172a;
}

.tubox-client-totals {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.88rem;
  color: #475569;
  text-align: right;
  align-items: flex-end;
}

.tubox-client-totals .tot-line {
  font-size: 0.88rem;
}

.tubox-client-totals .grand-total-row {
  font-size: 2.1rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-top: 0.2rem;
}

/* ==================== RIGHT KEYPAD PANEL (DESKTOP) ==================== */
.tubox-keypad-panel {
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  padding: 0.6rem;
  gap: 0.5rem;
  overflow-y: auto;
}

.tubox-btn-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.tubox-btn-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.tubox-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.65rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  min-height: 60px;
  position: relative;
}

.tubox-action-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.tubox-action-btn:active {
  transform: translateY(1px);
}

.tubox-action-btn .shortcut {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.tubox-action-btn .icon {
  font-size: 1.25rem;
}

.btn-tubox-cobrar {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  color: #166534 !important;
  font-weight: 900;
  font-size: 1.1rem;
  flex: 1;
  min-height: 80px;
}

.btn-tubox-cobrar:hover {
  background: #bbf7d0 !important;
  border-color: #4ade80 !important;
}

.btn-tubox-anular {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
  min-height: 50px;
}

/* ==================== 4. BOTTOM LEGEND BAR ==================== */
.tubox-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.78rem;
  border-top: 1px solid #1e293b;
  flex-shrink: 0;
}

.tubox-btn-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  color: #ffffff;
  border: 1.5px solid #f59e0b;
  padding: 0.4rem 1.1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tubox-btn-menu:hover {
  background: #f59e0b;
  color: #000000;
}

/* ==================== FULL-SCREEN DESKTOP POS MANAGEMENT HUB ==================== */
.tubox-desktop-hub-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0f172a;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}

.tubox-desktop-hub-overlay.hidden {
  display: none !important;
}

/* Top Windows App Title Bar */
.tubox-hub-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #081225;
  color: #ffffff;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  height: 38px;
  flex-shrink: 0;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.titlebar-left .app-icon { font-size: 1.1rem; }
.titlebar-left .app-title { font-weight: 900; color: #ffffff; letter-spacing: 0.5px; }
.titlebar-left .app-version { color: #64748b; font-size: 0.75rem; padding-left: 0.5rem; border-left: 1px solid #334155; }
.titlebar-center .store-badge-title { font-size: 0.8rem; font-weight: 800; color: #f59e0b; letter-spacing: 0.8px; text-transform: uppercase; }

.titlebar-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.win-btn {
  width: 28px;
  height: 22px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.win-btn:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.win-btn.win-close:hover { background: #dc2626; color: #ffffff; }

/* Main Hub Container */
.tubox-hub-main-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 38px);
}

/* Left Sidebar (Dark Navy) */
.tubox-hub-sidebar {
  background: #0f1d36;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  gap: 1rem;
  overflow-y: auto;
}

.sidebar-brand-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-sidebar-collapse {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.btn-sidebar-collapse:hover { background: rgba(255, 255, 255, 0.15); color: #ffffff; }

.sidebar-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.sidebar-nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #ffffff; }
.sidebar-nav-item.active { background: #1d4ed8; color: #ffffff; box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35); }
.sidebar-nav-item .nav-icon { font-size: 1.15rem; width: 24px; text-align: center; }

.sidebar-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-btn-pos {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #15803d;
  color: #ffffff;
  border: none;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar-btn-pos:hover { background: #166534; }

.sidebar-btn-store {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-btn-store:hover { background: rgba(2, 132, 199, 0.3); color: #ffffff; }

.sidebar-btn-install-pwa {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.sidebar-btn-install-pwa:hover { background: #f59e0b; color: #000000; }

.sidebar-btn-logout {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-btn-logout:hover { background: #dc2626; color: #ffffff; }

/* Right Content Area */
.tubox-hub-content-area {
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  position: relative;
  height: 100%;
}

/* Category Banner Header */
.hub-category-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.75rem 2.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.banner-icon-squircle {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.banner-titles { flex: 1; }
.banner-main-title { font-size: 1.8rem; font-weight: 900; color: #0f172a; margin: 0; letter-spacing: -0.5px; }
.banner-sub-title { font-size: 0.95rem; color: #64748b; margin: 0.25rem 0 0; font-weight: 500; }
.banner-niche-badge-box { display: flex; align-items: center; gap: 1.5rem; }
.dot-grid-decor { display: grid; grid-template-columns: repeat(4, 8px); gap: 4px; color: #cbd5e1; font-size: 0.8rem; line-height: 1; user-select: none; }
.banner-niche-pill { font-size: 0.85rem; font-weight: 900; color: #475569; letter-spacing: 1.5px; text-transform: uppercase; background: #f1f5f9; padding: 0.4rem 0.9rem; border-radius: 8px; border: 1px solid #e2e8f0; }

/* Action Cards Grid */
.hub-action-cards-grid {
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 960px;
}

.hub-card-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hub-card-item:hover { border-color: #93c5fd; box-shadow: 0 8px 22px rgba(37, 99, 235, 0.09); transform: translateY(-2px); }
.hub-card-item:active { transform: translateY(0); }

.hub-card-icon-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.hub-card-item:hover .hub-card-icon-circle { background: #eff6ff; }
.hub-card-text { flex: 1; min-width: 0; }
.hub-card-title { font-size: 1.05rem; font-weight: 800; color: #0f172a; margin-bottom: 0.2rem; }
.hub-card-desc { font-size: 0.86rem; color: #64748b; line-height: 1.35; }
.hub-card-chevron { font-size: 1.3rem; font-weight: 800; color: #94a3b8; transition: transform 0.15s ease, color 0.15s ease; }
.hub-card-item:hover .hub-card-chevron { color: #2563eb; transform: translateX(4px); }

/* Module Workspace Top Bar & Body */
.hub-workspace-view {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.workspace-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: #ffffff;
  border-bottom: 1.5px solid #e2e8f0;
  flex-shrink: 0;
}

.workspace-breadcrumb { display: flex; align-items: center; gap: 0.6rem; font-size: 0.92rem; }
.btn-breadcrumb-back { display: flex; align-items: center; gap: 0.4rem; background: #f1f5f9; border: 1px solid #cbd5e1; color: #1e293b; font-weight: 700; padding: 0.4rem 0.85rem; border-radius: 8px; cursor: pointer; transition: all 0.15s ease; }
.btn-breadcrumb-back:hover { background: #e2e8f0; border-color: #94a3b8; }
.breadcrumb-separator { color: #cbd5e1; font-weight: 800; }
.breadcrumb-current-module { font-weight: 800; color: #0f172a; font-size: 1.05rem; }
.btn-workspace-close { display: flex; align-items: center; gap: 0.5rem; background: #15803d; color: #ffffff; border: none; font-weight: 800; padding: 0.45rem 1rem; border-radius: 8px; cursor: pointer; transition: background 0.15s ease; }
.btn-workspace-close:hover { background: #166534; }

.workspace-body-container {
  flex: 1;
  padding: 1.5rem 2rem 140px 2rem;
  background: #ffffff;
  overflow: visible;
}

/* ==================== RESPONSIVE ENGINE (TABLETS & SMARTPHONES) ==================== */

.mobile-keypad-toggle-bar {
  display: none;
  background: #1e1b4b;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-top: 2px solid #f59e0b;
  user-select: none;
  z-index: 10;
}

.btn-hub-mobile-menu {
  display: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  align-items: center;
  gap: 0.35rem;
}

/* Static Bottom Navigation Dock (Fixed at bottom on phones) */
.hub-mobile-bottom-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: #081225;
  border-top: 2px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.5rem;
  z-index: 3500;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  scrollbar-width: none;
}

.hub-mobile-bottom-dock::-webkit-scrollbar { display: none; }

.dock-item-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 54px;
}

.dock-item-btn .dock-icon { font-size: 1.25rem; line-height: 1; }
.dock-item-btn.active { color: #38bdf8; background: rgba(56, 189, 248, 0.12); }
.dock-item-btn.dock-pos-btn { background: #15803d; color: #ffffff; font-weight: 800; box-shadow: 0 2px 8px rgba(21, 128, 61, 0.4); }

/* ==================== TABLETS & SMARTPHONES (<= 1024px) ==================== */
@media (max-width: 1024px) {
  
  /* POS Work Area */
  .tubox-main-work-area {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
  }

  .tubox-table-panel {
    border-right: none;
    flex: 1;
    min-height: 0;
  }

  .mobile-keypad-toggle-bar {
    display: flex;
  }

  .tubox-keypad-panel {
    display: none;
    position: fixed;
    bottom: 42px;
    left: 0;
    width: 100vw;
    max-height: 65vh;
    background: #ffffff;
    border-top: 3px solid #1e1b4b;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    overflow-y: auto;
    padding: 0.75rem;
    animation: slideUp 0.2s ease-out;
  }

  .tubox-keypad-panel.mobile-expanded {
    display: flex !important;
  }

  /* Desktop Hub Fullscreen Adaptation */
  .btn-hub-mobile-menu { display: inline-flex; }
  .hub-mobile-bottom-dock { display: flex !important; }

  .tubox-hub-main-container {
    display: block !important;
    position: relative;
    width: 100vw;
    overflow: hidden;
  }

  /* Off-canvas Sliding Sidebar */
  .hub-sidebar-backdrop {
    position: fixed;
    top: 38px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 38px);
    background: rgba(0, 0, 0, 0.65);
    z-index: 2550;
    backdrop-filter: blur(3px);
  }

  .hub-sidebar-backdrop.hidden { display: none !important; }

  .tubox-hub-sidebar {
    position: fixed !important;
    top: 38px;
    left: -320px;
    width: 290px;
    height: calc(100vh - 38px);
    z-index: 2600;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 15px 0 35px rgba(0, 0, 0, 0.6);
    background: #0f1d36;
  }

  .tubox-hub-sidebar.mobile-open {
    left: 0 !important;
  }

  /* Content Area 100% Full Width with Butter-Smooth Scroll */
  .tubox-hub-content-area {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box;
  }

  .hub-category-banner {
    padding: 1.15rem 1.25rem;
    gap: 0.85rem;
  }

  .banner-icon-squircle { width: 48px; height: 48px; font-size: 1.5rem; border-radius: 12px; }
  .banner-main-title { font-size: 1.45rem; }
  .banner-sub-title { font-size: 0.85rem; }
  .banner-niche-badge-box { display: none; }

  .hub-action-cards-grid {
    padding: 1rem 1.15rem 120px 1.15rem;
    gap: 0.75rem;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .hub-card-item {
    width: 100%;
    padding: 1rem 1.2rem;
    gap: 1rem;
    box-sizing: border-box;
  }

  .hub-card-icon-circle { width: 42px; height: 42px; font-size: 1.25rem; }
  .hub-card-title { font-size: 1rem; }
  .hub-card-desc { font-size: 0.82rem; }

  .workspace-body-container {
    padding: 1rem 1rem 140px 1rem !important;
  }

  .titlebar-left .app-version { display: none; }
  .titlebar-center { display: none; }
}

/* ==================== SMARTPHONES (< 768px) ==================== */
@media (max-width: 768px) {
  
  /* Top Bar Header */
  .tubox-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.65rem;
    min-height: 42px;
    height: auto;
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .tubox-brand-tag {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    font-size: 0.85rem;
  }

  .tubox-brand-tag span:nth-child(3),
  .tubox-brand-tag span:nth-child(4) {
    display: none !important;
  }

  .tubox-status-indicators {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
  }

  #posHwIndicators, #posCurrentDateTime, #posCashierInfo {
    display: none !important;
  }

  .btn-install-pwa-pos-head {
    font-size: 0.68rem;
    padding: 0.2rem 0.45rem;
    white-space: nowrap;
  }

  /* Search row */
  .tubox-search-row {
    padding: 0.5rem 0.65rem;
    gap: 0.4rem;
  }

  .tubox-scanner-wrapper { min-width: 100%; order: 1; }
  .tubox-customer-wrapper { width: 100%; order: 2; }
  .tubox-btn-weighed, .tubox-btn-reprint { flex: 1; justify-content: center; order: 3; padding: 0.5rem; font-size: 0.78rem; }

  /* Table Header & Rows */
  .tubox-table-header {
    grid-template-columns: 26px 1fr 85px 75px 35px;
    padding: 0.4rem 0.5rem;
    font-size: 0.7rem;
  }

  .tubox-table-header div:nth-child(4) { display: none; }
  .tubox-item-row { grid-template-columns: 26px 1fr 85px 75px 35px; padding: 0.45rem 0.5rem; }
  .row-unit-price { display: none; }
  .row-product-name { font-size: 0.85rem; }
  .btn-qty-step { width: 22px; height: 22px; font-size: 0.85rem; }
  .tubox-item-row input.qty-field { width: 32px; font-size: 0.85rem; padding: 0.15rem; }

  /* Bottom Summary */
  .tubox-bottom-totals-panel {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
  }

  .tubox-client-totals .grand-total-row { font-size: 1.6rem; }
  .tubox-shortcuts-legend { display: none !important; }
  .tubox-btn-menu { width: 100%; justify-content: center; }

  .workspace-top-bar { padding: 0.6rem 0.85rem; flex-wrap: wrap; gap: 0.4rem; }
}

/* ==================== MOBILE LANDSCAPE MODE (ROTATED PHONE / 350px - 550px HEIGHT) ==================== */
@media (orientation: landscape) and (max-height: 550px) {
  
  .tubox-top-bar { padding: 0.25rem 0.75rem; height: 34px; }
  .tubox-logo { font-size: 0.88rem; }

  .tubox-search-row { padding: 0.35rem 0.75rem; gap: 0.4rem; }
  .tubox-scanner-input { padding: 0.45rem 2.5rem 0.45rem 2rem; font-size: 0.88rem; }
  .scanner-icon-left { font-size: 0.95rem; left: 0.6rem; }
  .tubox-customer-wrapper { width: 180px; padding: 0.15rem 0.4rem; }
  .tubox-customer-input { font-size: 0.8rem; }
  .tubox-btn-weighed, .tubox-btn-reprint { padding: 0.35rem 0.5rem; font-size: 0.75rem; }

  /* 2-Column Landscape Split */
  .tubox-main-work-area {
    display: grid !important;
    grid-template-columns: 1fr 260px !important;
    flex-direction: row !important;
    height: calc(100vh - 75px);
  }

  .tubox-table-panel { border-right: 1.5px solid #cbd5e1; overflow-y: auto; }
  .tubox-table-header { padding: 0.35rem 0.5rem; font-size: 0.7rem; }
  .tubox-item-row { padding: 0.35rem 0.5rem; font-size: 0.8rem; }
  .mobile-keypad-toggle-bar { display: none !important; }

  .tubox-keypad-panel {
    display: flex !important;
    position: static !important;
    width: 260px !important;
    max-height: 100% !important;
    overflow-y: auto;
    padding: 0.4rem;
    gap: 0.25rem;
    background: #f8fafc;
    border-top: none !important;
    box-shadow: none !important;
  }

  .tubox-btn-grid-4 { grid-template-columns: repeat(4, 1fr); gap: 0.2rem; }
  .tubox-btn-grid-2 { grid-template-columns: repeat(2, 1fr); gap: 0.2rem; }
  .tubox-action-btn { padding: 0.3rem 0.2rem; min-height: 38px; font-size: 0.65rem; gap: 0.1rem; }
  .tubox-action-btn .icon { font-size: 0.85rem; }
  .tubox-action-btn .shortcut { display: none; }
  .btn-tubox-cobrar { min-height: 44px; font-size: 0.9rem; }
  .btn-tubox-anular { min-height: 36px; font-size: 0.72rem; }

  .tubox-bottom-totals-panel { padding: 0.35rem 0.6rem; display: flex; justify-content: space-between; align-items: center; }
  .tubox-client-totals .grand-total-row { font-size: 1.25rem; }
  .tubox-bottom-bar { display: none !important; }
}
