/* ============================================================
   REHMAT BAKERS — iOS Mobile App Design System (iOS 17/18 Style)
   Follows Apple Human Interface Guidelines
   ============================================================ */

:root {
  --ios-bg: #0b0f19;
  --ios-surface: #151d30;
  --ios-surface-elevated: #1e2942;
  --ios-surface-glass: rgba(21, 29, 48, 0.78);
  --ios-border: rgba(255, 255, 255, 0.08);
  --ios-border-focus: rgba(245, 158, 11, 0.5);
  
  --ios-primary: #f59e0b;
  --ios-primary-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --ios-success: #10b981;
  --ios-danger: #ef4444;
  --ios-warning: #f59e0b;
  --ios-blue: #3b82f6;
  --ios-purple: #8b5cf6;
  
  --ios-text: #f8fafc;
  --ios-text-secondary: #94a3b8;
  --ios-text-muted: #64748b;
  
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --safe-top: env(safe-area-inset-top, 20px);
  --safe-bottom: env(safe-area-inset-bottom, 20px);
  --tab-height: 64px;
  --header-height: 60px;
}

[data-theme="light"] {
  --ios-bg: #f1f5f9;
  --ios-surface: #ffffff;
  --ios-surface-elevated: #f8fafc;
  --ios-surface-glass: rgba(255, 255, 255, 0.85);
  --ios-border: rgba(0, 0, 0, 0.08);
  --ios-border-focus: rgba(217, 119, 6, 0.5);
  --ios-text: #0f172a;
  --ios-text-secondary: #475569;
  --ios-text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

html, body {
  background-color: var(--ios-bg);
  color: var(--ios-text);
  overflow-x: hidden;
  height: 100%;
  width: 100%;
  position: fixed;
}

#app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background-color: var(--ios-bg);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   iOS TOP NAVIGATION BAR
   ============================================================ */
.ios-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: var(--safe-top);
  background: var(--ios-surface-glass);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid var(--ios-border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--ios-primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--ios-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--ios-success);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--ios-success);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.header-status.offline {
  background: rgba(239, 68, 68, 0.12);
  color: var(--ios-danger);
  border-color: rgba(239, 68, 68, 0.25);
}

.header-status.offline .status-dot {
  background-color: var(--ios-danger);
  animation: none;
}

.header-status.cached {
  background: rgba(245, 158, 11, 0.15);
  color: var(--ios-warning);
  border-color: rgba(245, 158, 11, 0.35);
}

.header-status.cached .status-dot {
  background-color: var(--ios-warning);
  animation: none;
}

/* ============================================================
   DYNAMIC ISLAND / NOTIFICATION TOAST
   ============================================================ */
.dynamic-toast {
  position: absolute;
  top: calc(var(--safe-top) + 8px);
  left: 16px;
  right: 16px;
  z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
}

.dynamic-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ios-primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  overflow: hidden;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toast-time {
  font-size: 11px;
  color: var(--ios-text-muted);
  font-weight: 500;
}

.toast-body {
  font-size: 14px;
  font-weight: 600;
  color: var(--ios-primary);
  margin-top: 2px;
}

/* ============================================================
   MAIN SCROLLABLE CONTENT AREA
   ============================================================ */
.ios-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(var(--tab-height) + var(--safe-bottom) + 20px) 16px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CARDS & WIDGETS
   ============================================================ */
.card-hero {
  background: linear-gradient(135deg, #1e2942 0%, #151d30 100%);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  margin-bottom: 16px;
}

.card-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-subtitle {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--ios-text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--ios-primary);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.live-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ios-primary);
}

.hero-amount {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 10px 0 16px 0;
  color: var(--ios-text);
  line-height: 1;
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ios-border);
}

.hero-stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  color: var(--ios-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-val {
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
  color: var(--ios-text);
}

.stat-val.cash { color: var(--ios-success); }
.stat-val.easypaisa { color: #06b6d4; }
.stat-val.card { color: var(--ios-blue); }

/* GRID CARDS */
.ios-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--ios-surface);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease;
}

.stat-box:active {
  transform: scale(0.98);
}

.stat-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.box-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.box-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--ios-success); }
.box-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--ios-primary); }
.box-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--ios-blue); }
.box-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--ios-purple); }

.box-title {
  font-size: 11px;
  color: var(--ios-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.box-value {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-top: 2px;
}

.box-sub {
  font-size: 11px;
  color: var(--ios-text-muted);
  margin-top: 4px;
}

/* SECTION HEADERS */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px 0;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ios-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--ios-primary);
  background: none;
  border: none;
  cursor: pointer;
}

/* ============================================================
   CHART WIDGET
   ============================================================ */
.chart-card {
  background: var(--ios-surface);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.hourly-chart {
  display: flex;
  align-items: flex-end;
  height: 120px;
  gap: 6px;
  margin-top: 14px;
  padding-bottom: 22px;
  position: relative;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.chart-bar-fill {
  width: 100%;
  max-width: 16px;
  background: rgba(245, 158, 11, 0.35);
  border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
  min-height: 4px;
}

.chart-bar-fill.active {
  background: var(--ios-primary-gradient);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.chart-bar-label {
  position: absolute;
  bottom: 0;
  font-size: 9px;
  font-weight: 600;
  color: var(--ios-text-muted);
}

/* ============================================================
   LIVE SALES FEED LIST
   ============================================================ */
.feed-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.feed-filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--ios-surface);
  border: 1px solid var(--ios-border);
  color: var(--ios-text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill.active {
  background: var(--ios-primary);
  color: #0f172a;
  border-color: var(--ios-primary);
  font-weight: 700;
}

.sales-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sale-item-card {
  background: var(--ios-surface);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.sale-item-card:active {
  transform: scale(0.98);
  background: var(--ios-surface-elevated);
}

.sale-item-card.highlight {
  border-color: var(--ios-primary);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
  animation: glowPulse 2s ease-out;
}

@keyframes glowPulse {
  0% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.sale-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sale-number {
  font-size: 14px;
  font-weight: 700;
  color: var(--ios-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sale-time {
  font-size: 11px;
  color: var(--ios-text-muted);
}

.sale-card-middle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 8px 0;
}

.sale-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--ios-primary);
}

.badge-payment {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.badge-payment.cash { background: rgba(16, 185, 129, 0.15); color: var(--ios-success); }
.badge-payment.easypaisa { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.badge-payment.card { background: rgba(59, 130, 246, 0.15); color: var(--ios-blue); }

.sale-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ios-text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.cashier-tag {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   STOCK ALERTS LIST
   ============================================================ */
.stock-card {
  background: var(--ios-surface);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stock-card.critical {
  border-left: 4px solid var(--ios-danger);
}

.stock-card.low {
  border-left: 4px solid var(--ios-warning);
}

.stock-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ios-text);
  margin-bottom: 2px;
}

.stock-info p {
  font-size: 12px;
  color: var(--ios-text-muted);
}

.stock-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-align: right;
}

.stock-pill.out {
  background: rgba(239, 68, 68, 0.15);
  color: var(--ios-danger);
}

.stock-pill.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--ios-warning);
}

/* ============================================================
   ANALYTICS TAB
   ============================================================ */
.ranking-item {
  background: var(--ios-surface);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ranking-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ios-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: var(--ios-text-secondary);
}

.ranking-badge.top-1 { background: var(--ios-primary-gradient); color: #0f172a; }
.ranking-badge.top-2 { background: #94a3b8; color: #0f172a; }
.ranking-badge.top-3 { background: #d97706; color: #ffffff; }

.ranking-content {
  flex: 1;
}

.ranking-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.ranking-progress-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.ranking-progress-fill {
  height: 100%;
  background: var(--ios-primary);
  border-radius: 3px;
}

.ranking-revenue {
  font-size: 13px;
  font-weight: 700;
  color: var(--ios-primary);
  text-align: right;
}

.ranking-units {
  font-size: 11px;
  color: var(--ios-text-muted);
}

/* ============================================================
   SETTINGS TAB
   ============================================================ */
.settings-group {
  background: var(--ios-surface);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ios-border);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ios-text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-input {
  background: var(--ios-surface-elevated);
  border: 1px solid var(--ios-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ios-text);
  font-size: 13px;
  outline: none;
  width: 60%;
  text-align: right;
}

.settings-input:focus {
  border-color: var(--ios-primary);
}

/* iOS SWITCH */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 34px;
}

.ios-slider:before {
  position: absolute;
  content: "";
  height: 27px;
  width: 27px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

input:checked + .ios-slider {
  background-color: var(--ios-success);
}

input:checked + .ios-slider:before {
  transform: translateX(20px);
}

/* ============================================================
   BOTTOM TAB BAR (Apple Native Style)
   ============================================================ */
.ios-tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--ios-surface-glass);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid var(--ios-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
}

.tab-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ios-text-muted);
  cursor: pointer;
  position: relative;
  width: 20%;
  transition: color 0.15s ease;
}

.tab-btn svg {
  width: 22px;
  height: 22px;
  transition: transform 0.15s ease;
}

.tab-btn span {
  font-size: 10px;
  font-weight: 600;
}

.tab-btn.active {
  color: var(--ios-primary);
}

.tab-btn.active svg {
  transform: translateY(-2px);
}

.tab-badge {
  position: absolute;
  top: -2px;
  right: 18px;
  background: var(--ios-danger);
  color: white;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--ios-bg);
}

/* ============================================================
   SLIDE-UP RECEIPT MODAL (iOS Action Sheet)
   ============================================================ */
.ios-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ios-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.ios-sheet {
  background: var(--ios-surface);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 1px solid var(--ios-border);
}

.ios-modal-overlay.open .ios-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin: 10px auto 4px auto;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ios-border);
}

.sheet-title {
  font-size: 17px;
  font-weight: 700;
}

.sheet-close-btn {
  background: var(--ios-surface-elevated);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--ios-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sheet-body {
  padding: 20px;
  overflow-y: auto;
}

/* RECEIPT DESIGN */
.receipt-paper {
  background: #ffffff;
  color: #1e293b;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  font-family: 'Courier New', Courier, monospace;
}

.receipt-title {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
}

.receipt-subtitle {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.receipt-divider {
  border-top: 1px dashed #cbd5e1;
  margin: 12px 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 12px;
}

.receipt-table th {
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
  font-weight: 700;
}

.receipt-table td {
  padding: 6px 0;
  border-bottom: 1px dashed #f1f5f9;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 900;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid #0f172a;
}

/* ============================================================
   ADMIN LOGIN OVERLAY
   ============================================================ */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--ios-bg);
  z-index: 300;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  max-width: 480px;
  margin: 0 auto;
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  background: var(--ios-surface);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.login-brand {
  margin-bottom: 32px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--ios-primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.login-header h2 {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.login-header p {
  text-align: center;
  font-size: 13px;
  color: var(--ios-text-secondary);
  margin-top: 4px;
  margin-bottom: 24px;
}

.input-field {
  width: 100%;
  background: var(--ios-surface-elevated);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--ios-text);
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--ios-primary);
}

.btn-primary {
  width: 100%;
  background: var(--ios-primary-gradient);
  color: #0f172a;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
  transition: transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-demo-helper {
  background: none;
  border: 1px dashed rgba(245, 158, 11, 0.4);
  color: var(--ios-primary);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
  margin-top: 14px;
  cursor: pointer;
}

/* ============================================================
   DAY CLOSE TEXT REPORT & MONOSPACE RECEIPT VIEWER
   ============================================================ */
.day-close-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.day-close-banner:active {
  transform: scale(0.98);
  border-color: var(--ios-primary);
}

.banner-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.25);
  color: var(--ios-primary);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.banner-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.banner-sub {
  font-size: 11px;
  color: var(--ios-text-secondary);
  margin-top: 2px;
}

.banner-action-btn {
  background: var(--ios-primary-gradient);
  color: #0f172a;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.text-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.btn-report-action {
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease, opacity 0.2s;
  white-space: nowrap;
}

.btn-report-action:active {
  transform: scale(0.96);
}

.btn-report-action.copy {
  background: #334155;
  color: #f8fafc;
}

.btn-report-action.whatsapp {
  background: #16a34a;
  color: #ffffff;
}

.btn-report-action.download {
  background: var(--ios-primary-gradient);
  color: #0f172a;
}

.btn-sheet-mini {
  background: var(--ios-surface-elevated);
  border: 1px solid var(--ios-border);
  color: var(--ios-text);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-sheet-mini:active {
  transform: scale(0.95);
}

.copy-alert {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.receipt-terminal-wrap {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 14px;
  max-height: 48vh;
  overflow-y: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
  -webkit-overflow-scrolling: touch;
}

.receipt-terminal-code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  color: #38bdf8;
  white-space: pre;
  margin: 0;
  user-select: text;
  -webkit-user-select: text;
}

.day-close-info-footer {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--ios-surface-elevated);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-sm);
}

.history-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--ios-surface);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-item-row:active {
  transform: scale(0.98);
  border-color: var(--ios-primary);
}

/* ============================================================
   MULTI-BRANCH NETWORK SYSTEM (iOS 17/18 HIG STYLING)
   ============================================================ */

/* HEADER BRANCH NAVIGATION BAR */
.branch-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px 16px;
  gap: 8px;
}

.branch-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ios-surface-elevated);
  border: 1px solid var(--ios-border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  color: var(--ios-text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  max-width: 75%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.branch-pill-btn:active {
  transform: scale(0.96);
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--ios-primary);
}

.branch-pill-icon {
  font-size: 14px;
  line-height: 1;
}

.branch-pill-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  letter-spacing: -0.2px;
}

.branch-pill-chevron {
  font-size: 11px;
  color: var(--ios-primary);
  font-weight: 800;
}

.branch-mode-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.12);
  color: var(--ios-primary);
  border: 1px solid rgba(245, 158, 11, 0.25);
  white-space: nowrap;
}

/* COMBINED MULTI-BRANCH CARD ON DASHBOARD */
.combined-branches-card {
  background: var(--ios-surface);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}

.combined-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--ios-border);
  padding-bottom: 10px;
}

.combined-card-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.combined-card-subtitle {
  font-size: 11px;
  color: var(--ios-text-secondary);
  margin-top: 2px;
}

.combined-branches-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.branch-perf-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--ios-surface-elevated);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.branch-perf-card:active {
  transform: scale(0.98);
  border-color: var(--ios-primary);
}

.perf-branch-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.perf-branch-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.perf-branch-name {
  font-size: 13.5px;
  font-weight: 700;
}

.perf-branch-meta {
  font-size: 11px;
  color: var(--ios-text-muted);
}

.perf-branch-right {
  text-align: right;
}

.perf-branch-sales {
  font-size: 15px;
  font-weight: 800;
  color: var(--ios-primary);
}

.perf-branch-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-top: 2px;
}

.perf-branch-status.online {
  color: var(--ios-success);
}

.perf-branch-status.offline {
  color: var(--ios-danger);
}

/* BRANCH MODAL SHEET */
.branch-mode-switch {
  display: flex;
  gap: 6px;
  background: var(--ios-surface-elevated);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 1px solid var(--ios-border);
}

.branch-mode-pill {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ios-text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.branch-mode-pill.active {
  background: var(--ios-primary);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.branch-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--ios-text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.branch-counter-pill {
  font-size: 11px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--ios-primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.branch-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.branch-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--ios-surface-elevated);
  border: 1.5px solid var(--ios-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
}

.branch-item-card.selected {
  border-color: var(--ios-primary);
  background: rgba(245, 158, 11, 0.08);
}

.branch-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.branch-item-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ios-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.branch-item-card.selected .branch-item-radio {
  border-color: var(--ios-primary);
  background: var(--ios-primary);
}

.branch-item-radio::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f172a;
  display: none;
}

.branch-item-card.selected .branch-item-radio::after {
  display: block;
}

.branch-item-details {
  overflow: hidden;
}

.branch-item-name {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.branch-item-url {
  font-size: 11px;
  color: var(--ios-text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.branch-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-branch-icon {
  background: transparent;
  border: none;
  color: var(--ios-text-secondary);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-branch-icon:hover {
  background: var(--ios-surface);
  color: var(--ios-text);
}

.btn-branch-icon.danger:hover {
  color: var(--ios-danger);
}

.btn-add-branch-trigger {
  width: 100%;
  background: rgba(245, 158, 11, 0.1);
  border: 1.5px dashed rgba(245, 158, 11, 0.4);
  color: var(--ios-primary);
  font-size: 13.5px;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.btn-add-branch-trigger:active {
  background: rgba(245, 158, 11, 0.2);
  transform: scale(0.99);
}

/* BRANCH FORM BOX */
.branch-form-box {
  background: var(--ios-surface-elevated);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 14px;
}

.branch-form-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ios-border);
}

.branch-input-field-wrap {
  margin-bottom: 10px;
}

.branch-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ios-text-secondary);
  margin-bottom: 4px;
  display: block;
}

.branch-field-hint {
  font-size: 10.5px;
  color: var(--ios-text-muted);
  margin-top: 3px;
  display: block;
}

.branch-form-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.branch-test-result {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.branch-test-result.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--ios-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.branch-test-result.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--ios-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.branch-how-it-works {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ios-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
}

.branch-how-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ios-primary);
  margin-bottom: 4px;
}

.branch-how-desc {
  font-size: 11px;
  color: var(--ios-text-muted);
  line-height: 1.45;
  margin: 0;
}


