/* ============================================================
   AGENTIC GROWTH OS — app.css
   Starmedia Paraguay · Design System
   ============================================================ */

/* ---------- Druk font-face (ASCII only → Barlow fallback) ---------- */
@font-face {
  font-family: "Druk";
  font-weight: 700;
  src: url("../../fonts/Druk-Bold.otf") format("opentype");
  unicode-range: U+0020-007F;
}
@font-face {
  font-family: "DrukText";
  font-weight: 500;
  src: url("../../fonts/DrukText-Medium.otf") format("opentype");
  unicode-range: U+0020-007F;
}
@font-face {
  font-family: "DrukWide";
  font-weight: 500;
  src: url("../../fonts/DrukWide-Medium.otf") format("opentype");
  unicode-range: U+0020-007F;
}

/* ---------- Tokens (Starmedia DS · canonical) ---------- */
:root {
  /* Backgrounds — deeper end of brand purple */
  --bg:          #1f1d4a;
  --bg-deep:     #15133a;
  --surface:     #2a2761;
  --surface-2:   #353179;
  --surface-3:   #4945b3;   /* brand purple — large blocks, hero */
  --surface-4:   #5b57cc;   /* hover purple */

  /* Brand accents */
  --accent:      #e2b1f7;   /* pink — primary action */
  --accent-2:    #c885ee;   /* darker pink — hover */
  --accent-glow: rgba(226,177,247,.22);
  --accent-dim:  rgba(226,177,247,.08);
  --pink:        #c885ee;
  --pink-glow:   rgba(200,133,238,.3);
  --purple:      #4945b3;
  --milk:        #ede4d9;

  /* Semantic — soft, brand-tinted (never harsh red) */
  --success:     #b6e8a3;
  --warn:        #f5c97a;
  --danger:      #e88aa7;
  --info:        #a3d8e8;

  /* Typography — milk on dark purple */
  --fg:          #ede4d9;
  --fg-muted:    rgba(237,228,217,.62);
  --fg-dim:      rgba(237,228,217,.38);

  /* Borders — pink-tinted hairlines */
  --line:        rgba(226,177,247,.18);
  --line-2:      rgba(226,177,247,.32);
  --line-accent: rgba(226,177,247,.32);

  /* Fonts — Druk display, Work Sans body */
  --font-display: "Druk","Barlow Condensed",Impact,sans-serif;
  --font-text:    "DrukText","Druk","Barlow Condensed",Impact,sans-serif;
  --font-wide:    "DrukWide","Barlow Condensed",Impact,sans-serif;
  --font-sans:    "Work Sans",system-ui,sans-serif;
  --font-body:    "Work Sans",system-ui,sans-serif;
  --font-mono:    ui-monospace,"SF Mono","JetBrains Mono",Menlo,monospace;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 256rem;

  /* Easing */
  --ease-out-soft: cubic-bezier(.22,1,.36,1);
  --ease-in-out-soft: cubic-bezier(.65,0,.35,1);
  --ease-spring:   cubic-bezier(.34,1.56,.64,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* noise texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../../assets/noise.gif") repeat;
  opacity: .04;
  pointer-events: none;
  z-index: 9999;
}

/* ---------- Typography ---------- */
.h-display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: .92;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--fg);
}

.eyebrow {
  font-family: var(--font-wide);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.label {
  font-family: var(--font-wide);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.metric {
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--fg);
}

.card-title {
  font-family: var(--font-wide);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* Glass morphism */
.glass {
  background: rgba(35,33,92,.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1);
}

.glass-surface {
  background: rgba(45,43,110,.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.08);
}

/* Gradient border technique */
.card-gradient-border {
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(135deg, rgba(226,177,247,.5), rgba(73,69,179,.3)) border-box;
  border: 1px solid transparent;
  border-radius: 12px;
}

/* ---------- Buttons ---------- */
button { cursor: pointer; border: none; background: transparent; color: inherit; font-family: var(--font-sans); -webkit-appearance: none; appearance: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .1s;
  letter-spacing: .01em;
}
.btn:active { transform: scale(.97); }

.btn-ghost {
  background: rgba(255,255,255,.05);
  color: var(--fg-muted);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.09);
  color: var(--fg);
  border-color: rgba(255,255,255,.14);
}

.btn-pink {
  background: linear-gradient(135deg, #c885ee, #a45fd8);
  color: #fff;
  box-shadow: 0 2px 12px rgba(200,133,238,.35);
}
.btn-pink:hover {
  background: linear-gradient(135deg, #d498f8, #b570e0);
  box-shadow: 0 4px 20px rgba(200,133,238,.5);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line-accent);
}
.btn-outline:hover {
  background: var(--accent-dim);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-icon:hover {
  background: rgba(255,255,255,.06);
  color: var(--fg);
  border-color: var(--line);
}

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-family: var(--font-wide);
  letter-spacing: .04em;
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-muted   { background: rgba(255,255,255,.07); color: var(--fg-muted); }
.pill-accent  { background: rgba(226,177,247,.14); color: var(--accent); border: 1px solid rgba(226,177,247,.25); }
.pill-success { background: rgba(74,222,128,.12);  color: var(--success); border: 1px solid rgba(74,222,128,.2); }
.pill-warn    { background: rgba(245,201,122,.12); color: var(--warn);    border: 1px solid rgba(245,201,122,.2); }
.pill-danger  { background: rgba(248,113,113,.12); color: var(--danger);  border: 1px solid rgba(248,113,113,.2); }
.pill-info    { background: rgba(103,232,249,.1);  color: var(--info);    border: 1px solid rgba(103,232,249,.2); }

.pill-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ---------- Avatar ---------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  font-family: var(--font-wide);
  letter-spacing: 0;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-sm  { width: 26px; height: 26px; font-size: 9px; }
.avatar-md  { width: 36px; height: 36px; font-size: 12px; }
.avatar-lg  { width: 48px; height: 48px; font-size: 15px; }

/* ---------- Inputs ---------- */
.input {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--fg-dim); }
.input:focus {
  border-color: rgba(226,177,247,.45);
  box-shadow: 0 0 0 3px rgba(226,177,247,.1);
}

textarea.input { resize: vertical; min-height: 72px; line-height: 1.5; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }

/* ---------- Pixel / 8-bit corner brackets ---------- */
.corner-bracket {
  position: relative;
}
.corner-bracket::before,
.corner-bracket::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent);
  border-style: solid;
  opacity: .6;
}
.corner-bracket::before {
  top: 0; left: 0;
  border-width: 2px 0 0 2px;
  clip-path: polygon(0 0,100% 0,100% 30%,30% 30%,30% 100%,0 100%);
}
.corner-bracket::after {
  bottom: 0; right: 0;
  border-width: 0 2px 2px 0;
  clip-path: polygon(70% 0,100% 0,100% 100%,0 100%,0 70%,70% 70%);
}

/* ---------- Glow utilities ---------- */
.glow-accent { box-shadow: 0 0 30px rgba(226,177,247,.2), 0 0 60px rgba(226,177,247,.08); }
.glow-pink   { box-shadow: 0 0 20px rgba(200,133,238,.3); }
.glow-success{ box-shadow: 0 0 20px rgba(74,222,128,.2); }

/* ---------- Lift on hover ---------- */
.lift {
  transition: transform .2s var(--ease-out-soft), box-shadow .2s;
}
.lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 20px rgba(226,177,247,.08);
}

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: var(--line);
}

/* ---------- Sidebar nav ---------- */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  user-select: none;
}
.nav-item:hover {
  background: rgba(255,255,255,.05);
  color: var(--fg);
}
.nav-item.active {
  background: var(--accent-dim);
  color: var(--fg);
  border: 1px solid rgba(226,177,247,.15);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px var(--accent);
}

/* ---------- Toast ---------- */
.toast {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(226,177,247,.1);
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--accent); }

/* ---------- Command palette ---------- */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,18,56,.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.cmd-box {
  background: var(--surface-2);
  border: 1px solid rgba(226,177,247,.2);
  border-radius: 14px;
  width: 560px;
  max-height: 420px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(226,177,247,.08), 0 0 60px rgba(226,177,247,.1);
  display: flex;
  flex-direction: column;
}
.cmd-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-size: 15px;
  padding: 16px 20px;
  outline: none;
  width: 100%;
  font-family: var(--font-sans);
}
.cmd-result {
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  transition: background .1s;
}
.cmd-result:hover, .cmd-result.selected {
  background: var(--accent-dim);
}

/* ---------- Sheet / Drawer ---------- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 200;
}
.sheet-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line);
  z-index: 201;
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 80px rgba(0,0,0,.5);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,.04);
  border-radius: 9px;
  padding: 3px;
  position: relative;
}
.tab {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color .15s;
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  font-family: var(--font-sans);
}
.tab.active { color: var(--fg); }
.tab-indicator {
  position: absolute;
  background: var(--surface-3);
  border-radius: 6px;
  transition: all .2s var(--ease-out-soft);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* ---------- Dropdown ---------- */
.dropdown {
  background: var(--surface-3);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04);
  padding: 6px;
  min-width: 180px;
  z-index: 100;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--fg-muted);
  transition: background .1s, color .1s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
}
.dropdown-item:hover { background: rgba(255,255,255,.06); color: var(--fg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(248,113,113,.1); }

/* ---------- Confidence ring colors ---------- */
.ring-high   { stroke: var(--success); }
.ring-medium { stroke: var(--warn); }
.ring-low    { stroke: var(--danger); }

/* ---------- Live activity strip ---------- */
.ticker-wrap {
  overflow: hidden;
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
}
.ticker-track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: ticker-scroll 28s linear infinite;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Sparkline ---------- */
.sparkline-path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Progress bar ---------- */
.progress-track {
  height: 4px;
  background: rgba(255,255,255,.06);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .6s var(--ease-out-soft);
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--pink);
  color: #fff;
  flex-shrink: 0;
}

/* ---------- Thinking dots ---------- */
.thinking span {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 2px;
  animation: thinking-dot 1.2s ease-in-out infinite;
}
.thinking span:nth-child(2) { animation-delay: .2s; }
.thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes thinking-dot {
  0%, 80%, 100% { transform: scale(.6); opacity: .4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* ---------- Live dot ---------- */
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  position: relative;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--success);
  opacity: .3;
  animation: pulse-ring 1.5s ease-out infinite;
}

/* ---------- Star decorations ---------- */
.star-spin {
  animation: spin-slow 12s linear infinite;
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---------- Gradient text ---------- */
.gradient-text {
  background: linear-gradient(135deg, var(--fg) 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Shimmer skeleton ---------- */
.shimmer {
  background: linear-gradient(90deg,
    rgba(255,255,255,.04) 0%,
    rgba(255,255,255,.1) 50%,
    rgba(255,255,255,.04) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ---------- Separator with label ---------- */
.sep-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-dim);
  font-size: 10px;
  font-family: var(--font-wide);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sep-label::before,
.sep-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Kanban column header accent ---------- */
.kanban-header {
  border-radius: 8px 8px 0 0;
  border-top-width: 2px;
  border-top-style: solid;
}

/* ---------- WhatsApp green ---------- */
.whatsapp-green { color: #25d366; }

/* ---------- HoverCard ---------- */
.hovercard {
  background: var(--surface-3);
  border: 1px solid rgba(226,177,247,.15);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  min-width: 200px;
  z-index: 200;
  pointer-events: none;
}

/* ---------- Select / Combobox ---------- */
.combobox-list {
  background: var(--surface-3);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}
.combobox-item {
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background .1s;
  color: var(--fg-muted);
}
.combobox-item:hover, .combobox-item.selected {
  background: var(--accent-dim);
  color: var(--fg);
}

/* ---------- DataTable ---------- */
.data-table th {
  font-family: var(--font-wide);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  user-select: none;
}
.data-table td {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--fg-muted);
  border-top: 1px solid var(--line);
}
.data-table tr:hover td { background: rgba(255,255,255,.02); }

/* ---------- Dialog ---------- */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dialog-box {
  background: var(--surface-2);
  border: 1px solid rgba(226,177,247,.18);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  padding: 28px;
  max-width: 480px;
  width: 90%;
}

/* ---------- Animations from motion.css dependency ---------- */
@keyframes pulse-ring {
  0%   { transform: scale(.8); opacity: .4; }
  80%, 100% { transform: scale(2); opacity: 0; }
}
