@charset "UTF-8";

/* ==========================================================================
   ShopCloneFF GetKey — iOS Sakura Minimal (Apple White & Soft Rose Pink)
   Pure crisp white surfaces, whisper-soft rose accents, zero dark purple,
   mobile Card-First Admin + Slide-Out Drawer, strict CSP safe, zero overflow.
   ========================================================================== */

:root {
  color-scheme: light;
  --font-display: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-body: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Apple / iOS Pure White & Soft Sakura Neutrals */
  --bg: #f9f6f8;
  --bg-subtle: #f3ecf0;
  --surface: #ffffff;
  --surface-tint: #fefafc;
  --surface-soft: #fdf2f7;
  --surface-hover: #fbe7f1;

  /* Hairline Apple Borders */
  --border: rgba(24, 24, 27, 0.08);
  --border-strong: rgba(24, 24, 27, 0.14);
  --border-pink: #f8cfe2;
  --border-accent: rgba(236, 72, 153, 0.36);

  /* Crisp iOS Ink */
  --text: #18181b;
  --text-secondary: #52525b;
  --muted: #8e8e93;

  /* Soft Luminous Rose Pink (zero dark maroon, zero harsh neon) */
  --pink-50: #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-300: #f9a8d4;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --pink-600: #db2777;

  --accent: #ec4899;
  --accent-hover: #db2777;
  --accent-active: #be185d;
  --accent-soft: #fce7f3;
  --accent-soft-text: #be185d;
  --accent-ring: rgba(236, 72, 153, 0.18);

  /* Semantic Apple Tints */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #bbf7d0;
  --success-text: #047857;

  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #b45309;

  --danger: #f43f5e;
  --danger-bg: #fff1f2;
  --danger-border: #fecdd3;
  --danger-text: #be123c;

  --info: #6366f1;
  --info-bg: #eef2ff;
  --info-border: #c7d2fe;
  --info-text: #4338ca;

  /* Frosted iOS Materials */
  --glass: rgba(255, 255, 255, 0.86);
  --backdrop: rgba(24, 24, 27, 0.38);

  /* Ultra-clean Apple Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 18px -6px rgba(236, 72, 153, 0.08);
  --shadow-md: 0 8px 28px -8px rgba(24, 24, 27, 0.08), 0 4px 12px -4px rgba(236, 72, 153, 0.1);
  --shadow-lg: 0 22px 54px -12px rgba(24, 24, 27, 0.18);
  --shadow-btn: 0 4px 14px -4px rgba(236, 72, 153, 0.48);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-full: 9999px;
}

/* Optional Clean Dark Mode (Apple Charcoal + Soft Sakura) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f12;
  --bg-subtle: #18181d;
  --surface: #16161b;
  --surface-tint: #1b1b21;
  --surface-soft: #221920;
  --surface-hover: #2c1f29;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-pink: rgba(244, 114, 182, 0.24);
  --border-accent: rgba(244, 114, 182, 0.42);

  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --muted: #71717a;

  --accent: #f472b6;
  --accent-hover: #ec4899;
  --accent-active: #db2777;
  --accent-soft: rgba(244, 114, 182, 0.14);
  --accent-soft-text: #f9a8d4;
  --accent-ring: rgba(244, 114, 182, 0.26);

  --success-bg: rgba(16, 185, 129, 0.14);
  --success-border: rgba(52, 211, 153, 0.26);
  --success-text: #6ee7b7;

  --warning-bg: rgba(245, 158, 11, 0.14);
  --warning-border: rgba(251, 191, 36, 0.26);
  --warning-text: #fde68a;

  --danger-bg: rgba(244, 63, 94, 0.14);
  --danger-border: rgba(251, 113, 133, 0.28);
  --danger-text: #fda4af;

  --info-bg: rgba(99, 102, 241, 0.15);
  --info-border: rgba(129, 140, 248, 0.28);
  --info-text: #c7d2fe;

  --glass: rgba(22, 22, 27, 0.86);
  --backdrop: rgba(0, 0, 0, 0.65);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 12px 30px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.65);
  --shadow-btn: 0 6px 18px -6px rgba(244, 114, 182, 0.4);
}

/* ==========================================================================
   Base Reset & Clean Apple Typography
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(700px 320px at 50% -120px, rgba(244, 114, 182, 0.1), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.26;
}

h1 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
h4 { font-size: 13.5px; font-weight: 650; }

p { margin: 0; color: var(--text-secondary); }
small { font-size: 12px; line-height: 1.48; color: var(--muted); }
em { font-style: normal; color: var(--accent); }
strong, b { font-weight: 650; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

strong, .stat-num, .stock-count, .metric-value, .task-number, time, td {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke-width: 1.85;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 250;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   iOS Frosted Top Bar & Seamless Bottom Tab Bar
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1220px;
  margin: 0 auto;
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

body[data-view="admin"] .header-inner,
body[data-view="admin"] main,
body[data-view="admin"] .footer-inner {
  max-width: 1360px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border-pink);
}

.brand-logo {
  width: 108px;
  height: auto;
  max-height: 26px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.16s, color 0.16s;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.site-nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent-soft-text);
}

.site-nav .icon { width: 15px; height: 15px; }

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

.icon-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s, color 0.16s;
}

.icon-circle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.ghost-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.16s, color 0.16s;
}

.ghost-link:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-btn);
  transition: background 0.16s, transform 0.15s;
}

.nav-cta:hover { background: var(--accent-hover); transform: translateY(-0.5px); }

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px 0 5px;
  border-radius: var(--radius-full);
  background: var(--surface-soft);
  border: 1px solid var(--border-pink);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.16s;
}

.account-pill:hover { background: var(--accent-soft); }

.account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Native iOS Bottom Tab Bar (Mobile only) */
.mobile-dock { display: none; }

main {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-links { display: flex; align-items: center; gap: 16px; }
.footer-links a { color: var(--text-secondary); font-weight: 500; }
.footer-links a:hover { color: var(--accent); }

/* ==========================================================================
   Buttons, Pills, Eyebrow & Panels
   ========================================================================== */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.eyebrow .icon { width: 13px; height: 13px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: var(--accent);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: var(--shadow-btn);
  transition: background 0.16s, transform 0.15s, border-color 0.16s, color 0.16s;
}

.button:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.button:active:not(:disabled) { transform: scale(0.98); }
.button .icon { width: 15px; height: 15px; }

.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.button.secondary:hover:not(:disabled) {
  background: var(--surface-soft);
  border-color: var(--border-accent);
  color: var(--accent-soft-text);
}

.button.soft {
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  box-shadow: none;
}
.button.soft:hover:not(:disabled) {
  background: var(--pink-200);
  color: var(--accent-active);
}
:root[data-theme="dark"] .button.soft:hover:not(:disabled) {
  background: rgba(244, 114, 182, 0.24);
  color: #fbcfe8;
}

.button.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
  box-shadow: none;
}
.button.danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #ffffff; }

.button.sm { min-height: 34px; padding: 6px 13px; font-size: 12.5px; gap: 5px; }
.button.sm .icon { width: 14px; height: 14px; }
.button.icon-only { width: 36px; min-height: 36px; padding: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.pill .icon { width: 13px; height: 13px; }
.pill.rose { background: var(--accent-soft); border-color: var(--border-pink); color: var(--accent-soft-text); }
.pill.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.pill.warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.pill.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.pill.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }

.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  min-width: 0;
  max-width: 100%;
}

.narrow { max-width: 480px; margin: 20px auto; }

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
}

.notice .icon { width: 17px; height: 17px; flex-shrink: 0; }
.notice.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.notice.warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.notice.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.notice.rose { background: var(--accent-soft); border-color: var(--border-pink); color: var(--accent-soft-text); }

.notice-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  opacity: 0.7;
}
.notice-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.05); }

/* Security Alert Banner & Full-Screen Incognito Shield */
.security-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
}

.security-alert-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--danger);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.security-alert-body { flex: 1; min-width: 0; }
.security-alert-body h2 { font-size: 15.5px; color: var(--danger-text); margin-bottom: 3px; }
.security-alert-body p { font-size: 13px; color: var(--text); }
.security-alert-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }

.security-wall {
  position: fixed;
  inset: 0;
  z-index: 200;
  padding: 20px;
  background: var(--backdrop);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.security-wall-card {
  width: min(430px, 100%);
  padding: 28px 24px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.security-wall-card h2 { font-size: 19px; margin-bottom: 8px; }
.security-wall-card p { font-size: 13.5px; margin-bottom: 18px; }

.security-steps {
  text-align: left;
  padding: 13px 15px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border-pink);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.security-steps span { display: flex; align-items: center; gap: 8px; }
.security-steps .icon { width: 15px; height: 15px; color: var(--accent); }

.message-panel { text-align: center; padding: 32px 24px; }

.message-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-icon .icon { width: 24px; height: 24px; }
.message-panel h1 { font-size: 22px; margin-bottom: 8px; }
.message-panel p { max-width: 380px; margin: 0 auto 22px; font-size: 13.5px; }

.message-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.empty { text-align: center; padding: 40px 20px; margin: 16px 0; }
.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty h2 { font-size: 16px; margin-bottom: 5px; }
.empty p { font-size: 13px; margin-bottom: 16px; }

/* ==========================================================================
   Public Storefront — Authentic Apple App Store "Today" & Grouped List Layout
   100% Different from Original Grid: Large iOS Title + Sakura Spotlight Card
   + iOS Segmented Control + App Store Row List (Squircle Icon + GET Pill)
   ========================================================================== */

.ios-page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 16px;
}

.ios-date-kicker {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}

.ios-page-title h1 {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.ios-rule-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border-pink);
  color: var(--accent-soft-text);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.ios-rule-pill .icon { width: 14px; height: 14px; color: var(--accent); }

/* Featured App Store Spotlight Card (Pure Luminous Pastel Sakura — Zero Dark Purple) */
.spotlight-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr);
  gap: 22px;
  align-items: center;
  padding: 18px;
  margin-bottom: 22px;
  border-radius: 26px;
  background: linear-gradient(135deg, #ffffff 0%, #fff4f9 58%, #fce7f3 100%);
  border: 1px solid var(--border-pink);
  box-shadow: 0 12px 32px -14px rgba(236, 72, 153, 0.22), 0 1px 2px rgba(0, 0, 0, 0.03);
}

:root[data-theme="dark"] .spotlight-card {
  background: linear-gradient(135deg, #1a1519 0%, #241720 65%, #2f1827 100%);
  border-color: var(--border-pink);
}

.spotlight-media {
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-soft);
  box-shadow: 0 10px 24px -10px rgba(236, 72, 153, 0.28);
}

.spotlight-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spotlight-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 6px 4px 0;
}

.spotlight-tags {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.spotlight-body h2 {
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.spotlight-body p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.spotlight-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* iOS Segmented Control + Spotlight Search + Stock Toggle */
.store-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.ios-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  width: 260px;
  flex-shrink: 0;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  cursor: text;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.ios-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.ios-search .icon { width: 15px; height: 15px; color: var(--muted); }
.ios-search:focus-within .icon { color: var(--accent); }

.ios-search input {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.ios-search input::placeholder { color: var(--muted); }

.catalog-tabs-scroll {
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.catalog-tabs-scroll::-webkit-scrollbar { display: none; }

.ios-segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 13px;
  background: var(--bg-subtle);
  white-space: nowrap;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}

.seg-btn:hover { color: var(--text); }

.seg-btn.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.seg-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.seg-btn.active .seg-count { color: var(--accent); }

.stock-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.stock-chip .icon { width: 14px; height: 14px; }
.stock-chip:hover,
.stock-chip.is-active {
  border-color: var(--border-pink);
  background: var(--accent-soft);
  color: var(--accent-soft-text);
}

/* Keep .filters / .filter styles for Admin history tab pills */
.filters { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 35px;
  padding: 0 13px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.filter.active { background: var(--accent); border-color: var(--accent); color: #ffffff; }

.ios-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.ios-section-head h2 { font-size: 18px; font-weight: 700; }
.muted-count { font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* Apple App Store Row Cards (2-col on Desktop, Seamless Inset Grouped List on Mobile!) */
.app-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.app-row:hover {
  transform: translateY(-2px);
  border-color: var(--border-pink);
  box-shadow: var(--shadow-md);
}

.app-row.is-soldout { opacity: 0.78; }
.app-row.is-soldout .app-icon img { filter: grayscale(0.45); }

.app-icon {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--border-pink);
  flex-shrink: 0;
  box-shadow: 0 4px 12px -4px rgba(236, 72, 153, 0.22);
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-icon-badge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  background: rgba(236, 72, 153, 0.92);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: center;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-main h3 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-sub {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}

.app-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.app-game {
  font-weight: 700;
  color: var(--accent);
}

.meta-dot { color: var(--muted); }

.card-stock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  color: var(--success-text);
  font-variant-numeric: tabular-nums;
}
.card-stock.is-empty { color: var(--danger-text); }

/* Iconic Apple App Store "GET" Pill Button */
.app-get-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.app-get-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  transition: background 0.16s, color 0.16s, transform 0.14s;
}

.app-get-btn:hover:not(:disabled):not(.is-disabled) {
  background: var(--accent);
  color: #ffffff;
  transform: scale(1.03);
}

.app-get-btn:active:not(:disabled) { transform: scale(0.96); }

.app-get-btn.is-disabled {
  background: var(--bg-subtle);
  color: var(--muted);
  cursor: not-allowed;
}

.app-get-note {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

/* ==========================================================================
   Task Progress Workspace (/?run=...) — Clean Pure White + Soft Pink
   ========================================================================== */

.task-shell { max-width: 580px; margin: 4px auto 20px; }

.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
}
.back-link:hover { color: var(--accent); border-color: var(--border-pink); }

.task-card { padding: 24px; }

.task-head {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.task-head h1 { font-size: 21px; margin-bottom: 5px; }

.task-package-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-soft-text);
}

.task-progress-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border-pink);
}

.task-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.task-progress-meta strong { color: var(--accent); }

progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--pink-200);
  display: block;
}
progress::-webkit-progress-bar { background: var(--pink-200); border-radius: var(--radius-full); }
progress::-webkit-progress-value { background: var(--accent); border-radius: var(--radius-full); }
progress::-moz-progress-bar { background: var(--accent); border-radius: var(--radius-full); }

.task-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.task-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.task-list li.current {
  border-color: var(--accent);
  background: var(--surface-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.task-list li.done { background: var(--success-bg); border-color: var(--success-border); }
.task-list li.future { opacity: 0.56; background: var(--bg); }

.task-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.task-list li.current .task-number { background: var(--accent); color: #ffffff; }
.task-list li.done .task-number { background: var(--success); color: #ffffff; }

.task-info { flex: 1; min-width: 0; }
.task-info strong { display: block; font-size: 13.5px; }
.task-info small { display: block; font-size: 12px; margin-top: 1px; }
.task-state-tag { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.task-list li.done .task-state-tag { color: var(--success-text); }
.task-list li.current .task-state-tag { color: var(--accent); }
.task-list li.future .task-state-tag { color: var(--muted); }

.task-action-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.task-action-form .button { width: 100%; min-height: 44px; font-size: 14px; }
.task-action-hint { text-align: center; font-size: 12.5px; color: var(--muted); }

.task-footer-notes {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.reward-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.reward-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.reward-field { padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-soft); border: 1px solid var(--border-pink); }
.reward-field small { display: block; font-size: 11.5px; margin-bottom: 3px; }
.reward-field code { display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 600; word-break: break-all; }
.reward { font-family: var(--font-mono); font-size: 13px; min-height: 84px; background: var(--bg); resize: none; }
.reward-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.reward-actions .button { flex: 1; }

/* ==========================================================================
   User History Page
   ========================================================================== */

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.history-summary { display: flex; gap: 8px; flex-wrap: wrap; }

.history-panel {
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}
.history-row:hover { background: var(--surface-soft); }
.history-row + .history-row { border-top: 1px solid var(--border); border-top-left-radius: 0; border-top-right-radius: 0; }

.history-product { display: flex; align-items: center; gap: 12px; min-width: 0; }
.history-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.history-product strong { display: block; font-size: 14px; }
.history-product small { display: block; margin-top: 1px; }
.history-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.history-right .icon { color: var(--muted); width: 15px; height: 15px; }

/* ==========================================================================
   Clean iOS Forms & Switches (:where zero-specificity base)
   ========================================================================== */

label { display: block; font-size: 13px; font-weight: 600; color: var(--text); }

:where(label:not(.ios-search)) > :where(input:not([type="checkbox"]):not([type="file"]), select, textarea, .secret-field) {
  margin-top: 6px;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color 0.16s, box-shadow 0.16s;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

input[readonly] { background: var(--bg-subtle); color: var(--text-secondary); cursor: default; }
textarea { resize: vertical; min-height: 88px; }
select { cursor: pointer; }
.field-hint { display: block; margin-top: 5px; font-size: 12px; font-weight: 400; color: var(--muted); }

/* Authentic iOS Toggle Switch */
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 14px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-tint);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 13.5px;
}
.switch:hover { border-color: var(--border-pink); }
.switch input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.switch-track {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: var(--radius-full);
  background: #e4e4e7;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
:root[data-theme="dark"] .switch-track { background: #3f3f46; }

.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.switch-text small { font-weight: 400; }

.secret-field { position: relative; display: flex; align-items: center; }
.secret-field input { padding-right: 42px; margin-top: 0; }
.secret-toggle {
  position: absolute;
  right: 5px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.secret-toggle:hover { color: var(--accent); background: var(--surface-soft); }

.banner-uploader {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: var(--surface-tint);
}
.banner-preview { aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-subtle); }
.banner-preview img { width: 100%; height: 100%; object-fit: cover; }
.banner-uploader input[type="file"] { font-size: 12.5px; color: var(--text-secondary); }
.banner-uploader input[type="file"]::file-selector-button {
  padding: 6px 12px;
  margin-right: 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-pink);
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row > label { flex: 1; min-width: 160px; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }

fieldset {
  margin: 0;
  padding: 15px;
  min-width: 0;
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-tint);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

legend {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border-pink);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-soft-text);
}

/* ==========================================================================
   NEW Admin Panel: Pure White iOS Card-First Dashboard + Slide-Out Drawer
   ========================================================================== */

.admin-app {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-drawer {
  position: sticky;
  top: 78px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.drawer-close { display: none; }

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

.drawer-badge {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-brand strong { display: block; font-size: 14.5px; line-height: 1.2; }
.drawer-brand small { display: block; font-size: 11.5px; }

.drawer-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.drawer-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.drawer-nav button .icon { width: 17px; height: 17px; color: var(--muted); }
.drawer-nav button:hover { background: var(--bg-subtle); color: var(--text); }
.drawer-nav button.active { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 700; }
.drawer-nav button.active .icon { color: var(--accent); }

.tab-count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.drawer-nav button.active .tab-count { background: var(--accent); color: #ffffff; }

.drawer-status {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid;
  gap: 8px;
  font-size: 12px;
}

.drawer-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drawer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--backdrop);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

body.drawer-open {
  overflow: hidden;
}

.admin-workspace {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.admin-workspace > *,
.dashboard > *,
.dashboard-charts > *,
.settings-top-grid > *,
.task-settings-grid > *,
.history-bottom-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* Mobile Admin Header (Drawer trigger + Title + Quick Add) */
.admin-mobile-bar {
  display: none;
}

.admin-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-page-head h1 { font-size: 23px; }
.admin-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

[data-admin-section]:not([hidden]) { animation: admin-enter 0.18s ease-out; }
@keyframes admin-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-toolbar h2 { margin-bottom: 2px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Admin Tab 1: Pure White iOS KPI & Charts */
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dashboard-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dashboard-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric.is-pink {
  border-color: var(--border-pink);
  background: linear-gradient(160deg, var(--surface) 45%, var(--surface-soft) 100%);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon.mint { background: var(--success-bg); color: var(--success); }
.metric-icon.indigo { background: var(--info-bg); color: var(--info); }

.metric-value { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--text); }
.metric-sub { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.growth {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 650;
  background: var(--success-bg);
  color: var(--success-text);
}
.growth.negative { background: var(--danger-bg); color: var(--danger-text); }
.growth.neutral { background: var(--bg-subtle); color: var(--muted); }

.conversion-chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 650;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
}

.dashboard-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr);
  gap: 16px;
  align-items: start;
}

.chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.chart-heading h3 { font-size: 15.5px; margin-bottom: 2px; }
.area-canvas { position: relative; height: 280px; min-width: 0; }
.chart-note { margin-top: 12px; font-size: 12px; color: var(--muted); }
.chart-data { margin-top: 12px; }
.chart-data .table-wrap { margin-top: 10px; }

.doughnut-canvas { position: relative; height: 170px; max-width: 185px; margin: 0 auto 16px; }
.doughnut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.doughnut-center strong { font-size: 24px; font-weight: 700; line-height: 1.1; }

.package-legend { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; max-height: 140px; overflow-y: auto; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-row > span:nth-child(2) { flex: 1; min-width: 0; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #ec4899; }
.legend-dot[data-color="1"] { background: #f43f5e; }
.legend-dot[data-color="2"] { background: #f472b6; }
.legend-dot[data-color="3"] { background: #a855f7; }
.legend-dot[data-color="4"] { background: #fb7185; }
.legend-dot[data-color="5"] { background: #db2777; }
.legend-dot[data-color="6"] { background: #818cf8; }
.legend-dot[data-color="7"] { background: #e879f9; }

.funnel-heading { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.funnel-heading h3 { font-size: 14.5px; margin-bottom: 2px; }
.dashboard-funnel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.funnel-row > div { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.funnel-row > div span { font-weight: 600; }
.funnel-row > div strong { font-size: 12px; color: var(--muted); }
.funnel-row progress { height: 5px; }
.feed-footer { margin-top: 12px; display: flex; justify-content: flex-end; }

/* Admin Tab 2: Card-First Package Grid (clean on BOTH desktop and mobile!) */
.pkg-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pkg-card {
  padding: 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-tint);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.pkg-card:hover { border-color: var(--border-pink); box-shadow: var(--shadow-sm); }

.pkg-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pkg-thumb {
  width: 58px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.pkg-info { flex: 1; min-width: 0; }
.pkg-info strong { display: block; font-size: 14.5px; line-height: 1.3; margin-bottom: 3px; }
.pkg-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pkg-code { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

.pkg-card-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.stock-count { font-size: 18px; font-weight: 700; color: var(--text); }
.stock-count.is-low { color: var(--warning-text); }
.stock-count.is-zero { color: var(--danger); }

.pkg-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pkg-card-actions > .button,
.pkg-card-actions > a.button,
.pkg-card-actions > form { flex: 1; }
.pkg-card-actions > form .button { width: 100%; }

.stock-validator { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.archived-details { margin-top: 14px; padding: 12px 15px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg); }
.archived-details .table-wrap { margin-top: 10px; }

/* Responsive Data Tables (Table on Desktop -> Clean iOS Cards on Mobile!) */
.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13.5px; }
thead th {
  padding: 11px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-tint); }
td small { display: block; margin-top: 2px; }
td pre { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; max-width: 280px; }
details summary { cursor: pointer; color: var(--accent); font-size: 12.5px; font-weight: 600; user-select: none; }

/* Admin Tab 3 & 4 Layout */
.settings-top-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.task-settings-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.2fr); gap: 18px; margin-top: 16px; }
.settings-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; }
.settings-col h3 { display: flex; align-items: center; gap: 7px; font-size: 14.5px; }
.settings-col h3 .icon { color: var(--accent); }
.provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.system-checks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 12px 0 16px; }
.system-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 10px 13px;
  border-radius: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
}

.sidebar-status-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.api-mapping-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }

.form-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.history-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ip-chip {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.history-bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }

/* Native iOS-Style Dialog Modals */
.admin-dialog {
  width: min(600px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.admin-dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.admin-dialog[open] { display: flex; flex-direction: column; animation: dialog-in 0.2s ease-out; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.dialog-head { padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 16.5px; }
.dialog-body { padding: 18px 20px 20px; overflow-y: auto; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--border); }

/* ==========================================================================
   Responsive Breakpoints (Mobile Drawer + Mobile Card-Tables — Zero Overflow)
   ========================================================================== */

@media (max-width: 1120px) {
  .app-list { grid-template-columns: minmax(0, 1fr); }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-charts,
  .settings-top-grid,
  .task-settings-grid,
  .history-bottom-grid,
  .pkg-card-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 920px) {
  .admin-app { grid-template-columns: minmax(0, 1fr); }

  /* Slide-Out Drawer on Mobile / Tablet */
  .admin-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(290px, 84vw);
    z-index: 100;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    border: 0;
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    transform: translateX(-108%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .admin-drawer.is-open { transform: translateX(0); }
  .drawer-close { display: inline-flex; }

  .admin-page-head { display: none; }

  .admin-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
  }

  .mobile-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .mobile-bar-title {
    font-size: 15.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 760px) {
  .desktop-only { display: none !important; }

  .header-inner { height: 54px; padding: 0 14px; gap: 10px; }
  .brand-logo { width: 92px; max-height: 22px; }
  .site-nav { display: none; }

  .icon-circle { width: 34px; height: 34px; }
  .nav-cta { height: 34px; padding: 0 14px; font-size: 12.5px; }
  .account-pill { height: 34px; max-width: 124px; padding: 0 10px 0 4px; font-size: 12.5px; }
  .account-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-avatar { width: 24px; height: 24px; font-size: 11px; }

  /* Seamless Edge-to-Edge iOS Bottom Tab Bar */
  .mobile-dock {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
    justify-content: space-around;
  }

  .mobile-dock a {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--muted);
  }
  .mobile-dock a .icon { width: 20px; height: 20px; }
  .mobile-dock a.is-active { color: var(--accent); }

  main { padding: 14px 14px 26px; }
  .site-footer { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .panel { padding: 16px; border-radius: var(--radius-md); }

  .spotlight-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
    gap: 14px;
    border-radius: 22px;
  }
  .spotlight-body { padding: 0 2px 2px; }

  .store-controls { flex-wrap: wrap; align-items: stretch; gap: 10px; }
  .ios-search { width: 100%; height: 42px; flex: 1 1 100%; }
  .stock-chip { height: 40px; }

  /* Seamless Apple Inset Grouped List on Mobile! */
  .app-list {
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
  }
  .app-row {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 13px 14px;
    gap: 12px;
  }
  .app-row:hover { transform: none; box-shadow: none; background: var(--surface-tint); }
  .app-row + .app-row { border-top: 1px solid var(--border); }
  .app-icon { width: 60px; height: 60px; border-radius: 15px; }
  .app-main h3 { font-size: 14.5px; }
  .app-get-btn { min-width: 66px; padding: 0 13px; height: 30px; font-size: 12px; }

  .toolbar-actions,
  .toolbar-actions .ios-search,
  .history-controls .ios-search {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
  }

  .form-row > label,
  .form-row > input,
  .form-row > select { min-width: 0; flex: 1 1 100%; width: 100%; }

  .provider-grid,
  .form-grid-2,
  .banner-uploader { grid-template-columns: minmax(0, 1fr); }

  .banner-preview { max-width: 170px; }
  .dashboard-status { max-width: 100%; flex-wrap: wrap; }
  .area-canvas { height: 220px; }
  .task-card { padding: 18px 16px; }
  .dialog-head, .dialog-body { padding: 15px 16px; }

  /* Card-First Responsive Tables on Mobile (NO horizontal table scrolling!) */
  .card-table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }
  .card-table thead { display: none; }
  .card-table,
  .card-table tbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .card-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
  }
  .card-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0;
    border: 0;
    font-size: 13px;
    text-align: right;
  }
  .card-table tbody td[colspan] {
    display: block;
    text-align: center;
    color: var(--muted);
  }
  .card-table tbody td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    flex-shrink: 0;
  }
  .card-table tbody td > div,
  .card-table tbody td details { text-align: right; max-width: 100%; }
  .card-table tbody td pre { text-align: left; max-width: 100%; }
}

@media (max-width: 560px) {
  .account-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 14px; }
  .metric-value { font-size: 24px; }
  .history-row { flex-direction: column; align-items: flex-start; }
  .history-right { width: 100%; justify-content: space-between; }
  .reward-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Shop logo supplied for the pink refresh. */
.brand-logo { width:160px; height:auto; max-height:55px; object-fit:contain; }
@media(max-width:640px){ .brand-logo { width:128px; max-height:44px; } }
