/* ROOT VIEWPORT & SAFE AREAS */
.app-container, body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
}
/* TOP HEADER */
.app-header {
  height: 54px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 22px;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.brand-sub {
  font-size: 11px;
  color: var(--accent-orange);
  display: block;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#header-printer-status,
.header-printer-badge,
#profile-badge,
.profile-badge {
  display: none !important;
}

.profile-badge {
  display: none !important;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s;
}

.profile-badge:active {
  background: var(--bg-elevated);
}

.profile-avatar {
  font-size: 15px;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-info b {
  font-size: 11px;
  color: #fff;
  line-height: 1.1;
}

.profile-info small {
  font-size: 9px;
  color: var(--accent-orange);
}

.profile-switch-arrow {
  font-size: 9px;
  color: var(--text-muted);
}

.header-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* NAVIGATION TABS & TOUCH PRIORITY */
.app-nav {
  height: 52px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 2px;
  padding: 4px;
  position: relative;
  z-index: 50;
}

.nav-tab {
  flex: 1;
  min-width: 0;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.nav-tab.active {
  background: var(--bg-card);
  color: var(--accent-orange);
  font-weight: 700;
}

.nav-icon {
  font-size: 16px;
  line-height: 1;
}

.nav-label {
  font-size: 11px;
  margin-top: 2px;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: 18%;
  background: var(--accent-red);
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 10px;
}

/* CONTENT CONTAINER & SMOOTH SCROLL SYSTEM */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  position: relative;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Barra de desplazamiento delgada, discreta y elegante (semi-invisible) */
.app-content::-webkit-scrollbar,
.sales-history-list::-webkit-scrollbar,
.tables-grid::-webkit-scrollbar,
.kitchen-orders-list::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.app-content::-webkit-scrollbar-track,
.sales-history-list::-webkit-scrollbar-track,
.tables-grid::-webkit-scrollbar-track,
.kitchen-orders-list::-webkit-scrollbar-track {
  background: transparent;
}
.app-content::-webkit-scrollbar-thumb,
.sales-history-list::-webkit-scrollbar-thumb,
.tables-grid::-webkit-scrollbar-thumb,
.kitchen-orders-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}
.app-content::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.6);
}

.view-section {
  display: none;
  min-height: 100%;
  height: auto;
}

.view-section.active {
  display: flex;
  flex-direction: column;
}
