/* ==========================================================================
   Reusable building blocks — cards, mockups, badges, tables, diagrams
   ========================================================================== */

/* ---------- GRID HELPERS ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
.grid-3-2 { grid-template-columns: 3fr 2fr; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6, .grid-2-1, .grid-1-2, .grid-3-2 { grid-template-columns: 1fr; }
}

.flex { display: flex; gap: 12px; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.full-w { width: 100%; }

/* ---------- CARD ---------- */
.card {
  background: var(--vp-white);
  border: 1px solid var(--vp-ink-100);
  border-radius: var(--vp-r-md);
  padding: 20px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.card.is-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--vp-shadow-md);
  border-color: var(--vp-teal-200);
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--vp-teal-50), var(--vp-teal-100));
  color: var(--vp-teal-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.card-icon svg { width: 22px; height: 22px; }
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--vp-ink-900);
  margin-bottom: 6px;
}
.card-text {
  font-size: 0.88rem;
  color: var(--vp-ink-500);
  line-height: 1.55;
}
.card.is-accent {
  background: linear-gradient(135deg, var(--vp-teal-600), var(--vp-teal-800));
  color: var(--vp-white);
  border: 0;
}
.card.is-accent .card-icon { background: rgba(255,255,255,0.18); color: var(--vp-white); }
.card.is-accent .card-title { color: var(--vp-white); }
.card.is-accent .card-text { color: rgba(255,255,255,0.85); }
.card.is-outline {
  background: transparent;
  border: 1.5px dashed var(--vp-teal-300);
}
.card.is-feature {
  border-left: 4px solid var(--vp-teal-600);
}

/* ---------- BADGE ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--vp-ink-50);
  color: var(--vp-ink-700);
}
.badge.is-teal   { background: var(--vp-teal-50); color: var(--vp-teal-700); }
.badge.is-red    { background: #fee2e4; color: var(--vp-red-600); }
.badge.is-green  { background: #dcfce7; color: #166534; }
.badge.is-amber  { background: #fef3c7; color: #92400e; }
.badge.is-info   { background: #dbeafe; color: #1d4ed8; }
.badge.is-purple { background: #ede9fe; color: #6d28d9; }

/* Stat KPI */
.stat {
  background: var(--vp-white);
  border: 1px solid var(--vp-ink-100);
  border-radius: var(--vp-r-md);
  padding: 16px 18px;
}
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--vp-ink-400);
  font-weight: 700;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--vp-teal-700);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  line-height: 1;
}
.stat-sub { font-size: 0.78rem; color: var(--vp-ink-500); margin-top: 6px; }

/* ---------- LIST WITH CHECKMARKS ---------- */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  position: relative;
  padding: 6px 0 6px 28px;
  color: var(--vp-ink-700);
  font-size: 0.92rem;
  line-height: 1.5;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 11px;
  width: 18px; height: 18px;
  border-radius: 6px;
  background: var(--vp-teal-50);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230d8389' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6L9 17l-5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}
.check-list.is-tight li { padding: 3px 0 3px 26px; font-size: 0.86rem; }
.check-list.is-tight li::before { top: 7px; }

/* Numbered list */
.num-list { list-style: none; padding: 0; margin: 0; counter-reset: num; }
.num-list li {
  counter-increment: num;
  position: relative;
  padding: 8px 0 8px 38px;
  color: var(--vp-ink-700);
}
.num-list li::before {
  content: counter(num, decimal-leading-zero);
  position: absolute;
  left: 0; top: 8px;
  width: 28px;
  font-weight: 800;
  color: var(--vp-teal-600);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

/* ---------- MOCKUP: BROWSER WINDOW ---------- */
.mock {
  background: var(--vp-white);
  border-radius: var(--vp-r-md);
  border: 1px solid var(--vp-ink-100);
  box-shadow: var(--vp-shadow-md);
  overflow: hidden;
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #f4f6f7, #eaeded);
  border-bottom: 1px solid var(--vp-ink-100);
}
.mock-dots { display: flex; gap: 5px; }
.mock-dot { width: 10px; height: 10px; border-radius: 50%; }
.mock-dot.r { background: #ff5f57; }
.mock-dot.y { background: #febc2e; }
.mock-dot.g { background: #28c840; }
.mock-url {
  flex: 1;
  background: var(--vp-white);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  color: var(--vp-ink-500);
  font-family: var(--font-mono);
  border: 1px solid var(--vp-ink-100);
}
.mock-body { padding: 0; background: var(--vp-surface); }

/* ---------- MOCKUP: ODOO-LIKE NAV ---------- */
.odoo-nav {
  background: linear-gradient(135deg, var(--vp-teal-600), var(--vp-teal-700));
  color: var(--vp-white);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
}
.odoo-nav .o-brand { font-weight: 800; letter-spacing: 0.05em; }
.odoo-nav .o-tab {
  padding: 4px 10px;
  border-radius: 6px;
  cursor: default;
}
.odoo-nav .o-tab.is-active { background: rgba(255,255,255,0.2); font-weight: 600; }

.odoo-page {
  padding: 14px;
  background: var(--vp-surface);
}
.odoo-breadcrumb {
  font-size: 0.74rem;
  color: var(--vp-ink-500);
  margin-bottom: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.odoo-breadcrumb .crumb-sep { color: var(--vp-ink-300); }
.odoo-breadcrumb .crumb-active { color: var(--vp-teal-700); font-weight: 700; }

/* ---------- MOCKUP: TABLE ---------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: var(--vp-white);
  border-radius: var(--vp-r);
  overflow: hidden;
  border: 1px solid var(--vp-ink-100);
}
.tbl th, .tbl td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--vp-ink-100);
}
.tbl th {
  background: var(--vp-ink-50);
  font-weight: 700;
  color: var(--vp-ink-700);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--vp-teal-50); }
.tbl td.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- PIPELINE / FLOW ---------- */
.pipeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  padding: 4px 0;
}
.pipe-step {
  background: var(--vp-white);
  border: 1px solid var(--vp-ink-100);
  border-radius: var(--vp-r);
  padding: 12px;
  position: relative;
  transition: all 0.2s;
}
.pipe-step::after {
  content: "›";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--vp-teal-400);
  font-size: 1.5rem;
  font-weight: 700;
  z-index: 1;
}
.pipe-step:last-child::after { display: none; }
.pipe-step .pipe-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--vp-teal-600);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.pipe-step .pipe-title { font-size: 0.85rem; font-weight: 700; color: var(--vp-ink-900); }
.pipe-step .pipe-text { font-size: 0.74rem; color: var(--vp-ink-500); margin-top: 4px; }
.pipe-step.is-accent { background: linear-gradient(135deg, var(--vp-teal-600), var(--vp-teal-700)); color: white; border: 0; }
.pipe-step.is-accent .pipe-title { color: white; }
.pipe-step.is-accent .pipe-text { color: rgba(255,255,255,0.85); }
.pipe-step.is-accent .pipe-num { background: rgba(255,255,255,0.25); }

@media (max-width: 900px) {
  .pipeline { grid-auto-flow: row; }
  .pipe-step::after { display: none; }
}

/* ---------- TIMELINE (vertical) ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 9px; top: 4px; bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, var(--vp-teal-300), var(--vp-teal-100));
  border-radius: 2px;
}
.tl-item {
  position: relative;
  padding: 6px 0 14px;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: -25px; top: 10px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--vp-white);
  border: 3px solid var(--vp-teal-500);
  box-shadow: 0 0 0 3px var(--vp-teal-50);
}
.tl-item .tl-title { font-weight: 700; color: var(--vp-ink-900); font-size: 0.92rem; }
.tl-item .tl-text { font-size: 0.82rem; color: var(--vp-ink-500); margin-top: 2px; }

/* ---------- MODULE TILE (small) ---------- */
.tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--vp-white);
  border: 1px solid var(--vp-ink-100);
  border-radius: var(--vp-r);
  transition: all 0.2s;
}
.tile:hover {
  border-color: var(--vp-teal-300);
  background: var(--vp-teal-50);
}
.tile-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--vp-teal-50);
  color: var(--vp-teal-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tile-icon svg { width: 16px; height: 16px; }
.tile-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--vp-ink-900);
  line-height: 1.2;
}
.tile-text small {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--vp-ink-400);
  margin-top: 2px;
}

/* ---------- TECH PILL ---------- */
.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--vp-white);
  border: 1px solid var(--vp-ink-100);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--vp-ink-700);
}
.tech-pill .tp-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--vp-teal-500);
}
.tech-pill.is-red .tp-dot { background: var(--vp-red-500); }
.tech-pill.is-blue .tp-dot { background: #3b82f6; }
.tech-pill.is-amber .tp-dot { background: var(--vp-warn); }
.tech-pill.is-purple .tp-dot { background: #8b5cf6; }

/* ---------- FORM ROW MOCK ---------- */
.form-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--vp-ink-100);
  font-size: 0.82rem;
}
.form-row:last-child { border-bottom: 0; }
.form-row .fl { color: var(--vp-ink-500); font-weight: 600; }
.form-row .fv { color: var(--vp-ink-900); font-weight: 600; }

/* ---------- KEY-VALUE INLINE ---------- */
.kv {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.82rem;
}
.kv .kv-key { color: var(--vp-ink-500); }
.kv .kv-val { color: var(--vp-ink-900); font-weight: 700; }

/* ---------- QR placeholder (visual only) ---------- */
.qr {
  width: 140px; height: 140px;
  background-color: var(--vp-white);
  background-image:
    linear-gradient(45deg, var(--vp-ink-900) 25%, transparent 25%),
    linear-gradient(-45deg, var(--vp-ink-900) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--vp-ink-900) 75%),
    linear-gradient(-45deg, transparent 75%, var(--vp-ink-900) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0px;
  border: 6px solid var(--vp-white);
  box-shadow: 0 0 0 1px var(--vp-ink-200), var(--vp-shadow);
  border-radius: 6px;
}

/* ---------- MOBILE PHONE FRAME ---------- */
.phone {
  width: 240px;
  background: #1f2a2c;
  border-radius: 28px;
  padding: 8px;
  box-shadow: var(--vp-shadow-md);
}
.phone-screen {
  background: var(--vp-white);
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 9/19;
}
.phone-statusbar {
  height: 22px;
  background: var(--vp-teal-700);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: white;
  font-size: 0.6rem;
  font-weight: 600;
}
.phone-content {
  padding: 10px;
  font-size: 0.7rem;
  height: calc(100% - 22px);
  overflow: hidden;
  background: var(--vp-surface);
}

/* ---------- DIVIDER WITH LABEL ---------- */
.divider-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  color: var(--vp-ink-400);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.divider-label::before, .divider-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--vp-ink-100);
}

/* ---------- CALLOUT BOX ---------- */
.callout {
  border-left: 4px solid var(--vp-teal-500);
  background: var(--vp-teal-50);
  border-radius: 0 var(--vp-r) var(--vp-r) 0;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--vp-ink-700);
}
.callout.is-amber { border-color: var(--vp-warn); background: #fffbeb; }
.callout.is-red   { border-color: var(--vp-red-500); background: #fef2f2; }
.callout.is-info  { border-color: var(--vp-info); background: #eff6ff; }
.callout strong { color: var(--vp-ink-900); }

/* ---------- BIG NUMBER ---------- */
.big-num {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1;
  color: var(--vp-teal-600);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

/* ---------- LOGO MARK INLINE ---------- */
.logo-mark-sm { width: 28px; height: 28px; }
.logo-mark-md { width: 40px; height: 40px; }
.logo-mark-lg { width: 80px; height: 80px; }

/* ---------- ICON SVG sizing ---------- */
.icon { width: 1em; height: 1em; vertical-align: -0.125em; flex-shrink: 0; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 32px; height: 32px; }
