/**
 * MCC Supershop - Manager Executive Mobile PWA Styles
 */

:root {
  --mcc-primary: #1B365D;
  --mcc-primary-dark: #0F1E36;
  --mcc-secondary: #059669;
  --mcc-accent: #D97706;
  --mcc-loss: #C2410C;
  --mcc-bg: #F8FAFC;
  --mcc-surface: #FFFFFF;
  --mcc-text: #0F172A;
  --mcc-text-muted: #64748B;
  --mcc-border: #E2E8F0;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--mcc-bg);
  color: var(--mcc-text);
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
  padding-bottom: calc(70px + var(--safe-bottom));
}

/* App Header */
.pwa-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--mcc-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.pwa-header h1 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-icon-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

/* Install Banner */
.pwa-install-banner {
  background: linear-gradient(135deg, #1B365D, #059669);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.pwa-install-banner button {
  background: #fff;
  color: var(--mcc-primary);
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Main Container */
.pwa-content {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* Cards & Panels */
.pwa-card {
  background: var(--mcc-surface);
  border: 1px solid var(--mcc-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pwa-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

/* KPI Box */
.pwa-kpi {
  padding: 14px;
  border-radius: 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100px;
}

.pwa-kpi.blue { background: linear-gradient(135deg, #2563EB, #1D4ED8); }
.pwa-kpi.orange { background: linear-gradient(135deg, #D97706, #B45309); }
.pwa-kpi.teal { background: linear-gradient(135deg, #0D9488, #0F766E); }
.pwa-kpi.red { background: linear-gradient(135deg, #DC2626, #B91C1C); }
.pwa-kpi.green { background: linear-gradient(135deg, #059669, #10B981); }

.pwa-kpi-title { font-size: 12px; font-weight: 600; opacity: 0.9; }
.pwa-kpi-val { font-size: 20px; font-weight: 800; margin: 4px 0; }
.pwa-kpi-sub { font-size: 11px; opacity: 0.85; }

/* Featured Net Profit Card */
.pwa-net-profit-card {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  color: #fff;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
  display: flex;
  align-items: center;
  gap: 14px;
}

.pwa-net-profit-card .icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* Quick Actions Scroll */
.pwa-quick-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.pwa-quick-scroll::-webkit-scrollbar { display: none; }

.pwa-quick-chip {
  background: #fff;
  border: 1px solid var(--mcc-border);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Order / List Items */
.pwa-order-item {
  background: #fff;
  border: 1px solid var(--mcc-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}

.pwa-order-item:active { background: #f1f5f9; }

.pwa-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.pwa-badge.pending { background: #FEF3C7; color: #B45309; }
.pwa-badge.approved { background: #D1FAE5; color: #047857; }
.pwa-badge.processing { background: #DBEAFE; color: #1D4ED8; }
.pwa-badge.delivered { background: #DCFCE7; color: #15803D; }
.pwa-badge.cancelled { background: #FEE2E2; color: #B91C1C; }

/* Filter Tabs */
.pwa-filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.pwa-filter-tabs::-webkit-scrollbar { display: none; }

.pwa-filter-tab {
  background: #fff;
  border: 1px solid var(--mcc-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mcc-text-muted);
  cursor: pointer;
}
.pwa-filter-tab.active {
  background: var(--mcc-primary);
  color: #fff;
  border-color: var(--mcc-primary);
}

/* Inputs & Form */
.pwa-input-group {
  margin-bottom: 14px;
}
.pwa-input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--mcc-text);
}
.pwa-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--mcc-border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.pwa-input:focus {
  border-color: var(--mcc-primary);
}

.pwa-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pwa-btn-primary { background: var(--mcc-primary); color: #fff; }
.pwa-btn-danger { background: var(--mcc-loss); color: #fff; }
.pwa-btn-success { background: var(--mcc-secondary); color: #fff; }

/* Bottom Nav Bar */
.pwa-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid var(--mcc-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.pwa-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--mcc-text-muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  flex: 1;
  padding: 6px 0;
}
.pwa-nav-item span.icon { font-size: 20px; margin-bottom: 2px; }
.pwa-nav-item.active { color: var(--mcc-primary); font-weight: 800; }

/* Modal & Invoice Popup */
.pwa-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}
.pwa-modal-sheet {
  background: #fff;
  width: 100%;
  max-height: 90vh;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Toast */
.pwa-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 600;
  z-index: 300;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: none;
}
