/* ============================================================
   Portal Native Apps — Ultra Premium CSS Design System
   Visual Style: iOS 17 / Android 14 Material You Inspired
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --secondary: #0ea5e9;
  --accent: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --bg-frame: #0f172a;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --border-light: rgba(226, 232, 240, 0.8);
  
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --nav-height: 68px;
  --header-height: 64px;
  
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 50px;

  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-active: 0 6px 20px rgba(99, 102, 241, 0.35);
}

/* Base Frame Reset */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body.portal-body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-frame);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
}

/* Mobile App Frame Simulation */
#native-app-frame {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  min-height: 100vh;
  background-color: var(--bg-main);
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 481px) {
  #native-app-frame {
    min-height: 90vh;
    height: 90vh;
    margin: 3vh 0;
    border-radius: 40px;
    border: 10px solid #1e293b;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  }
}

/* App Header Topbar — Fixed Top */
.native-header {
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
}

.native-header .store-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.native-header .store-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.native-header .store-details h1 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-dark);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.native-header .store-details .badge-plan {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-top: 2px;
}

.badge-plan.pro { background: #dcfce7; color: #15803d; }
.badge-plan.standard, .badge-plan.standart { background: #e0f2fe; color: #0369a1; }
.badge-plan.starter, .badge-plan.free { background: #fef3c7; color: #b45309; }

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

.btn-native-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
  text-decoration: none;
}

.btn-native-icon:active {
  transform: scale(0.92);
  background: #f1f5f9;
}

/* App Viewport Container — Independent Scrollable Body */
.native-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  padding-bottom: 90px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Bottom Navigation Bar — Fixed Bottom */
.native-bottom-nav {
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  z-index: 1000;
  box-shadow: 0 -6px 25px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
  position: relative;
}

.nav-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
}

.nav-tab-item i {
  font-size: 1.3rem;
  margin-bottom: 3px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-tab-item.active {
  color: var(--primary-dark);
  font-weight: 800;
}

.nav-tab-item.active i {
  transform: translateY(-2px) scale(1.12);
  color: var(--primary-dark);
}

.nav-tab-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  background: var(--primary-dark);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 6px var(--primary-glow);
}

/* Native Cards */
.native-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.native-card:active {
  transform: scale(0.985);
}

/* Touch Action Buttons */
.btn-native-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 13px 22px;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-shadow: var(--shadow-active);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-native-primary:active {
  transform: scale(0.97);
  opacity: 0.95;
}

.btn-native-secondary {
  background: #ffffff;
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
  text-decoration: none;
}

.btn-native-secondary:active {
  transform: scale(0.96);
  background: #f1f5f9;
}

/* Quick Launcher Grid */
.quick-launcher-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.quick-tile {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-tile:active {
  transform: scale(0.92);
}

.quick-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 6px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.quick-tile span {
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-dark);
}

/* Pill Swiper Horizontal Scroll */
.pill-swiper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.pill-swiper::-webkit-scrollbar {
  display: none;
}

.pill-item {
  white-space: nowrap;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.pill-item.active {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-active);
}

/* Product Touch Cards */
.native-product-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
  height: 100%;
}

.native-product-card:active {
  transform: scale(0.95);
  border-color: var(--primary);
}

.native-product-card .prod-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
  line-height: 1.25;
}

.native-product-card .prod-price {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.native-product-card .badge-qty {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.4);
  border: 2px solid #ffffff;
}

/* Bottom Sheet Modal Drawer */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.bottom-sheet-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet-modal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 28px 28px 0 0;
  padding: 16px 18px 20px;
  z-index: 2001;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
}

.bottom-sheet-overlay.show .bottom-sheet-modal {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 10px;
  margin: 0 auto 16px;
}

/* Floating Action Bar Cart */
.native-cart-bar {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #ffffff;
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 30px rgba(30, 27, 75, 0.45);
  z-index: 990;
  cursor: pointer;
}

/* Status Badges */
.badge-status {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-pending { background: #fef3c7; color: #d97706; }
.badge-lunas, .badge-selesai { background: #dcfce7; color: #16a34a; }
.badge-batal { background: #fee2e2; color: #dc2626; }

/* KDS Kitchen Order Cards */
.kds-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border-left: 6px solid var(--warning);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.kds-card.cooking { border-left-color: var(--secondary); }
.kds-card.done { border-left-color: var(--success); opacity: 0.8; }

/* Utility Classes */
.text-xs { font-size: 0.72rem; }
.text-sm { font-size: 0.82rem; }
.fw-bold-900 { font-weight: 900; }
