/* ============================================================
 * YvorAIO iOS Mockups — Shared Design Tokens
 * Extracted from src/renderer/index.html + style.css
 * ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Purple palette — exact from YvorAIO renderer */
  --deep-dark-brown: #0f0820;
  --sidebar-brown:   #170e2d;
  --profile-brown:   #1f143a;
  --group-hover:     #1c1235;
  --table-brown:     #21163e;
  --dark-brown:      #2c1d52;
  --brown:           #3f2870;
  --border-brown:    #4a2d7a;
  --purple:          #562bae;
  --light-brown:     #9b6ed4;
  --text-brown:      #c49ee8;

  /* Accents */
  --green:       #40af2d;
  --green-soft:  rgba(64,175,45,0.18);
  --yellow:      #ffc007;
  --yellow-soft: rgba(255,192,7,0.18);
  --red:         #e40506;
  --red-soft:    rgba(228,5,6,0.18);
  --blue:        #4fc1ff;
  --blue-soft:   rgba(79,193,255,0.18);
  --orange:      #e68a00;
  --white:       #f8ebe3;
  --grey:        #7d7a7a;

  /* iPhone 14 viewport */
  --vw: 390px;
  --vh: 844px;
  --safe-top: 47px;
  --safe-bottom: 34px;

  /* Radii */
  --r-card: 18px;
  --r-pill: 999px;
  --r-input: 12px;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  background: #000;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── iPhone frame (used on gallery) ─── */
.iphone {
  width: var(--vw);
  height: var(--vh);
  background: var(--deep-dark-brown);
  border-radius: 48px;
  border: 11px solid #0a0512;
  box-shadow: 0 30px 60px -20px rgba(86,43,174,0.25), 0 0 0 1px rgba(155,110,212,0.1);
  position: relative;
  overflow: hidden;
}

/* ─── Full-screen mode (one screen per page) ─── */
.screen {
  width: 100vw;
  height: 100vh;
  max-width: var(--vw);
  max-height: var(--vh);
  margin: 0 auto;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(86,43,174,0.15) 0%, transparent 60%),
    linear-gradient(180deg, var(--deep-dark-brown) 0%, var(--sidebar-brown) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 500px) {
  body.standalone {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
  }
  body.standalone .screen {
    border-radius: 48px;
    border: 11px solid #0a0512;
    box-shadow: 0 30px 60px -20px rgba(86,43,174,0.35);
  }
}

/* ─── Status bar (mock iOS) ─── */
.statusbar {
  height: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.statusbar .icons {
  display: flex;
  align-items: center;
  gap: 6px;
}
.statusbar .icons svg { display: block; }
.notch {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 32px;
  background: #000;
  border-radius: 999px;
  z-index: 5;
}

/* ─── Page body (scrollable content) ─── */
.page {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 20px 100px;
  -webkit-overflow-scrolling: touch;
}
.page::-webkit-scrollbar { display: none; }

/* ─── Headings ─── */
.h-greeting {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-brown);
  margin: 14px 0 2px;
  letter-spacing: 0.2px;
}
.h-title {
  font-size: 30px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.h-sub {
  font-size: 13px;
  color: var(--text-brown);
  margin: 0 0 18px;
}
.section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 0 12px;
}
.section-h h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.2px;
}
.section-h .more {
  font-size: 13px;
  color: var(--light-brown);
  font-weight: 500;
  text-decoration: none;
}

/* ─── Cards & surfaces ─── */
.card {
  background: linear-gradient(160deg, rgba(31,20,58,0.8) 0%, rgba(44,29,82,0.55) 100%);
  border: 1px solid rgba(74,45,122,0.4);
  border-radius: var(--r-card);
  padding: 16px;
  backdrop-filter: blur(10px);
}
.card-flat {
  background: var(--profile-brown);
  border: 1px solid rgba(74,45,122,0.35);
  border-radius: var(--r-card);
  padding: 16px;
}

/* ─── Stat tiles ─── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat {
  background: linear-gradient(160deg, rgba(31,20,58,0.85) 0%, rgba(15,8,32,0.6) 100%);
  border: 1px solid rgba(74,45,122,0.35);
  border-radius: var(--r-card);
  padding: 16px;
  position: relative;
  overflow: hidden;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat .icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-soft);
  color: var(--green);
}
.stat.purple .icon-wrap { background: rgba(86,43,174,0.25); color: var(--light-brown); }
.stat.yellow .icon-wrap { background: var(--yellow-soft); color: var(--yellow); }
.stat.blue   .icon-wrap { background: var(--blue-soft);   color: var(--blue); }
.stat.red    .icon-wrap { background: var(--red-soft);    color: var(--red); }
.stat .v {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}
.stat .l {
  font-size: 12px;
  color: var(--text-brown);
  font-weight: 500;
  margin-top: 4px;
}

/* ─── Pills ─── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.pill-green  { background: var(--green-soft);  color: var(--green); }
.pill-yellow { background: var(--yellow-soft); color: var(--yellow); }
.pill-red    { background: var(--red-soft);    color: var(--red); }
.pill-blue   { background: var(--blue-soft);   color: var(--blue); }
.pill-purple { background: rgba(86,43,174,0.25); color: var(--light-brown); }
.pill-grey   { background: rgba(155,110,212,0.12); color: var(--text-brown); }
.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.live .dot {
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50%      { opacity: 0.6; box-shadow: 0 0 0 5px transparent; }
}

/* ─── Site logos (small inline brand chips) ─── */
.site-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-brown);
}
.site-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}
.site-amazon { background: linear-gradient(135deg,#ff9900,#e47900); }
.site-disney { background: linear-gradient(135deg,#1d3a8a,#5a3fcb); }
.site-funko  { background: linear-gradient(135deg,#0070d2,#003a72); }
.site-fnac   { background: linear-gradient(135deg,#dca301,#b08300); color:#000; }

/* ─── Inputs ─── */
.input, .select {
  width: 100%;
  background: var(--sidebar-brown);
  border: 1px solid var(--border-brown);
  border-radius: var(--r-input);
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
  padding: 12px 14px;
  outline: none;
  font-weight: 500;
}
.input::placeholder { color: var(--text-brown); opacity: 0.6; }
.label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-brown);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  display: block;
}
.field { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── Buttons ─── */
.btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, #7041d8 100%);
  color: #fff;
  box-shadow: 0 6px 18px -4px rgba(86,43,174,0.55);
}
.btn-success {
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 18px -4px rgba(64,175,45,0.45);
}
.btn-ghost {
  background: var(--profile-brown);
  border: 1px solid var(--border-brown);
  color: var(--white);
}
.btn-danger {
  background: var(--red-soft);
  color: var(--red);
}

/* ─── Bottom tab bar ─── */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(70px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(15, 8, 32, 0.95);
  border-top: 1px solid rgba(74,45,122,0.4);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 20;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--light-brown);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  position: relative;
  padding-top: 8px;
}
.tab.active {
  color: var(--green);
}
.tab.active::after {
  content: '';
  position: absolute;
  top: 4px;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--green);
}

/* ─── Search bar ─── */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--profile-brown);
  border: 1px solid rgba(74,45,122,0.4);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 6px 0 18px;
}
.search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
}
.search input::placeholder { color: var(--text-brown); opacity: 0.6; }
.search svg { color: var(--text-brown); flex-shrink: 0; }

/* ─── Filter chips (horizontal scroll) ─── */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -20px 16px;
  padding: 4px 20px;
  scroll-snap-type: x mandatory;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--profile-brown);
  color: var(--text-brown);
  border: 1px solid rgba(74,45,122,0.35);
  white-space: nowrap;
  scroll-snap-align: start;
}
.chip.active {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

/* ─── Task row ─── */
.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(74,45,122,0.2);
}
.task-row:last-child { border-bottom: none; }
.task-row .meta {
  flex: 1;
  min-width: 0;
}
.task-row .meta .name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-row .meta .sub {
  font-size: 11px;
  color: var(--text-brown);
}

/* ─── Group header (collapsible) ─── */
.group-h {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--profile-brown);
  border: 1px solid rgba(74,45,122,0.4);
  border-radius: 14px;
  margin-bottom: 10px;
}
.group-h .name { flex: 1; font-size: 14px; font-weight: 700; }
.group-h .count { font-size: 11px; color: var(--text-brown); }

/* ─── FAB ─── */
.fab {
  position: absolute;
  right: 20px;
  bottom: calc(90px + var(--safe-bottom));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple) 0%, #7041d8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -6px rgba(86,43,174,0.65);
  z-index: 15;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* ─── Toggle switch ─── */
.toggle {
  position: relative;
  width: 50px;
  height: 30px;
  background: var(--brown);
  border-radius: 999px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: left 0.2s;
}
.toggle.on { background: var(--green); }
.toggle.on::after { left: 23px; }

/* ─── Setting row ─── */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(74,45,122,0.2);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .l { font-size: 14px; font-weight: 500; }
.setting-row .r { font-size: 13px; color: var(--text-brown); }

/* ─── Live log (terminal-ish) ─── */
.log {
  background: var(--deep-dark-brown);
  border: 1px solid rgba(74,45,122,0.35);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 11px;
  line-height: 1.7;
  max-height: 200px;
  overflow-y: auto;
}
.log .l-ok    { color: var(--green); }
.log .l-warn  { color: var(--yellow); }
.log .l-info  { color: var(--blue); }
.log .l-err   { color: var(--red); }
.log .l-mute  { color: var(--text-brown); opacity: 0.7; }

/* ─── Avatar ─── */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--light-brown));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ─── Step progress ─── */
.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0;
}
.steps .step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--brown);
}
.steps .step.done { background: var(--green); }
.steps .step.cur  { background: var(--green); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
.steps-l {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-brown);
  margin-top: 2px;
}

/* ─── Product card thumbnail ─── */
.thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--brown);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ─── Util ─── */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.muted { color: var(--text-brown); }
.bold { font-weight: 700; }
.center { text-align: center; }
.flex-col { display: flex; flex-direction: column; }

/* Sheet handle (modal-style) */
.handle {
  width: 38px;
  height: 4px;
  background: var(--border-brown);
  border-radius: 2px;
  margin: 8px auto 4px;
}
