:root {
  --bg: #f6f6fb;
  --surface: #ffffff;
  --surface-sunk: #fbfbfe;
  --ink: #1b1c2b;
  --ink-soft: #4a4b61;
  --muted: #8688a0;
  --border: #e8e8f1;
  --border-soft: #f0f0f6;

  --accent: #6552f6;
  --accent-ink: #ffffff;
  --accent-soft: #efecff;
  --accent-glow: rgba(101, 82, 246, 0.25);

  --sidebar-bg: #15131f;
  --sidebar-ink: #c9c7db;
  --sidebar-ink-dim: #716f8a;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: rgba(255, 255, 255, 0.08);

  --danger: #d1453b;
  --danger-bg: #fdecea;
  --warn: #9a6b11;
  --warn-bg: #fff3dc;
  --ok: #1c8257;
  --ok-bg: #e4f7ee;
  --neutral: #6b6d82;
  --neutral-bg: #ececf4;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 43, 0.05);
  --shadow: 0 2px 8px rgba(20, 20, 43, 0.06), 0 1px 2px rgba(20, 20, 43, 0.04);
  --shadow-lg: 0 20px 48px rgba(20, 20, 43, 0.16), 0 2px 8px rgba(20, 20, 43, 0.08);

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Lexend', 'Inter', sans-serif; letter-spacing: -0.01em; }
::selection { background: var(--accent-glow); }

/* ─── Login ─── */
#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(101, 82, 246, 0.18), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(99, 179, 237, 0.14), transparent 45%),
    var(--sidebar-bg);
}
#login-view[hidden], #app-view[hidden] { display: none; }

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.login-brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #9c8bff);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.login-card h1 { font-size: 17px; margin: 0; }
.login-card .sub { font-size: 12px; color: var(--muted); margin: -8px 0 4px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 16px; margin: 0; }
.login-card input {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--surface-sunk);
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-card button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.login-card button:hover { box-shadow: 0 8px 20px var(--accent-glow); transform: translateY(-1px); }

/* ─── Shell: sidebar + main ─── */
#app-view { display: flex; min-height: 100vh; }

.sidebar {
  width: 228px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
}
.sidebar-brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #9c8bff);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.sidebar-brand .name { font-family: 'Lexend', sans-serif; font-size: 14.5px; color: #fff; font-weight: 600; line-height: 1.2; }
.sidebar-brand .fase { font-size: 10.5px; color: var(--sidebar-ink-dim); }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--sidebar-ink);
  text-align: left;
  transition: background .12s ease, color .12s ease;
}
.tab-btn svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.tab-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }
.tab-btn.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); }
.tab-btn.active svg { opacity: 1; }

.sidebar-footer { margin-top: auto; padding: 10px 8px 2px; font-size: 11px; color: var(--sidebar-ink-dim); line-height: 1.5; }

main { flex: 1; min-width: 0; padding: 32px 40px 60px; max-width: 1280px; }

.view { display: none; }
.view.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 24px; }
.page-head h2 { font-size: 21px; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13.5px; }

h3 { font-size: 15px; margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 13px; }

/* ─── Overview ─── */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat-tile .n { font-family: 'Lexend', sans-serif; font-size: 26px; font-weight: 600; }
.stat-tile .l { font-size: 12px; color: var(--muted); margin-top: 2px; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.brand-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, transform .15s ease;
  cursor: pointer;
}
.brand-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.brand-card .accent-bar { height: 6px; }
.brand-card .body { padding: 16px 18px 18px; }
.brand-card .head-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.brand-card .logo-thumb {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border-soft);
  overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--surface-sunk); font-size: 13px; font-weight: 700; color: var(--muted);
}
.brand-card .logo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.brand-card h4 { margin: 0; font-size: 15px; }
.brand-card .swatches { display: flex; gap: 5px; margin-bottom: 10px; }
.swatch { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(0,0,0,0.06); }
.brand-card .tono { color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; margin: 0 0 14px; min-height: 36px; }
.brand-card .meta-row { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--border-soft); }
.brand-card .lang-pill { background: var(--neutral-bg); color: var(--neutral); padding: 2px 8px; border-radius: 999px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: 10px; }

/* ─── Brand Kit ─── */
.split { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.split-list { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow-sm); }
.split-detail { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 22px; min-height: 240px; box-shadow: var(--shadow-sm); }

.list-row {
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
}
.list-row:hover { background: var(--surface-sunk); }
.list-row.selected { background: var(--accent-soft); color: var(--accent); }
.list-row .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.badge { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; text-transform: uppercase; letter-spacing: .02em; }
.badge.Borrador { background: var(--neutral-bg); color: var(--neutral); }
.badge.En-revisión { background: var(--warn-bg); color: var(--warn); }
.badge.Aprobado { background: var(--ok-bg); color: var(--ok); }
.badge.Error { background: var(--danger-bg); color: var(--danger); }

form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
input, textarea, select {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-sunk);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: #fff; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 8px; padding-top: 4px; }
button { font-family: inherit; }
.btn {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 10px 18px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease; align-self: flex-start;
}
.btn:hover { box-shadow: 0 8px 20px var(--accent-glow); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-sunk); box-shadow: none; transform: none; }
.btn.danger-ghost { background: transparent; color: var(--danger); border: 1px solid var(--danger-bg); box-shadow: none; }
button[type="submit"] { composes: btn; }

button.secondary {
  margin-top: 8px;
  width: 100%;
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
button.secondary:hover { border-color: var(--accent); color: var(--accent); }

.palette-preview { display: flex; gap: 6px; margin-top: -4px; }
.palette-preview .chip { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(0,0,0,0.08); }

/* ─── Logo + colores + imágenes (Brand Kit) ─── */
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-preview {
  width: 64px; height: 64px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface-sunk); display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; color: var(--muted);
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-actions { display: flex; flex-direction: column; gap: 6px; }
.file-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  color: var(--ink-soft); background: var(--surface-sunk); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px; cursor: pointer; width: fit-content;
}
.file-btn:hover { border-color: var(--accent); color: var(--accent); }
.file-btn input[type="file"] { display: none; }
.hint { font-size: 11px; color: var(--muted); font-weight: 400; }

.color-chip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-chip {
  position: relative; width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.08);
  cursor: pointer; overflow: hidden; flex-shrink: 0;
}
.color-chip input[type="color"] {
  position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px);
  border: none; padding: 0; cursor: pointer;
}
.color-chip .remove {
  position: absolute; top: -4px; right: -4px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 10px; line-height: 15px; text-align: center;
  cursor: pointer; opacity: 0; transition: opacity .12s; z-index: 2;
}
.color-chip:hover .remove { opacity: 1; }
.color-chip-add {
  width: 36px; height: 36px; border-radius: 10px; border: 1.5px dashed var(--border);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
  font-size: 18px; flex-shrink: 0; background: transparent;
}
.color-chip-add:hover { border-color: var(--accent); color: var(--accent); }

.image-gallery { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumb {
  position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); flex-shrink: 0;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb .remove {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(20,20,43,0.65); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
  cursor: pointer;
}
.gallery-add {
  width: 72px; height: 72px; border-radius: 12px; border: 1.5px dashed var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; color: var(--muted); font-size: 10.5px; font-weight: 600; text-align: center; flex-shrink: 0;
}
.gallery-add:hover { border-color: var(--accent); color: var(--accent); }
.gallery-add input[type="file"] { display: none; }
.gallery-add svg { width: 18px; height: 18px; }

/* ─── Content Studio ─── */
.studio-form { max-width: 640px; }
.brand-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.brand-pick {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 14px;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  transition: border-color .12s ease, background .12s ease;
}
.brand-pick .dot { width: 10px; height: 10px; border-radius: 50%; }
.brand-pick:hover { border-color: var(--accent); }
.brand-pick.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-option {
  border: 1.5px solid var(--border); border-radius: 999px; padding: 7px 14px; font-size: 12.5px;
  font-weight: 600; color: var(--ink-soft); cursor: pointer; background: var(--surface);
}
.pill-option.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.upload-row { display: flex; align-items: center; gap: 10px; }
.upload-gallery { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.upload-gallery:empty { margin-top: 0; }
.upload-thumb {
  position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); flex-shrink: 0; background: var(--surface-sunk);
  display: flex; align-items: center; justify-content: center;
}
.upload-thumb img, .upload-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumb .vid-badge {
  position: absolute; bottom: 3px; left: 3px; background: rgba(20,20,43,0.7); color: #fff;
  font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 999px; text-transform: uppercase;
}
.upload-thumb .remove {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(20,20,43,0.65); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
  cursor: pointer;
}
.drawer-assets { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.drawer-assets .upload-thumb { width: 84px; height: 84px; }

#studio-status { margin-top: 20px; }
.status-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); font-size: 13.5px;
}
.status-card.err { border-color: var(--danger-bg); background: var(--danger-bg); color: var(--danger); }
.status-card.ok { border-color: var(--ok-bg); background: var(--ok-bg); color: var(--ok); }
.steps { display: flex; gap: 18px; margin-top: 2px; }
.step { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.step .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background .2s; }
.step.active .dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.step.done .dot { background: var(--ok); }
.step.active { color: var(--ink); font-weight: 600; }
.link-like { background: none; border: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline; }

/* ─── Campaigns: kanban ─── */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.kanban-col { background: var(--surface-sunk); border-radius: var(--radius); padding: 12px; min-height: 120px; }
.kanban-col .col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; }
.kanban-col .col-head .title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }
.kanban-col .col-head .count { font-size: 11px; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 1px 8px; }
.kanban-cards { display: flex; flex-direction: column; gap: 9px; }
.kcard {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 12px 13px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: box-shadow .12s ease, transform .12s ease;
}
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard .top-row { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.kcard .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kcard .brand-name { font-size: 12px; font-weight: 700; color: var(--ink-soft); flex: 1; }
.kcard .pkg-id { font-size: 11px; color: var(--muted); }
.kcard .entrada-preview { font-size: 12.5px; color: var(--ink); line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .bottom-row { display: flex; align-items: center; justify-content: space-between; }
.kcard .flag-chip { font-size: 10.5px; font-weight: 700; color: var(--danger); background: var(--danger-bg); padding: 2px 7px; border-radius: 999px; }
.kcard .time { font-size: 10.5px; color: var(--muted); }
.kanban-empty { font-size: 12px; color: var(--muted); padding: 10px 6px; }

/* ─── Drawer (package detail) ─── */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15, 14, 26, 0.38);
  backdrop-filter: blur(1px); z-index: 40;
  animation: fadein .15s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 92vw);
  background: var(--surface); z-index: 41; box-shadow: var(--shadow-lg);
  overflow-y: auto; padding: 28px 30px 60px;
  animation: slidein .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes slidein { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-close {
  position: absolute; top: 22px; right: 26px; background: var(--surface-sunk); border: 1px solid var(--border);
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.drawer-close:hover { background: var(--neutral-bg); }

.drawer-head { padding-right: 50px; margin-bottom: 4px; }
.drawer-head .pkg-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.drawer-entrada {
  background: var(--surface-sunk); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 12.5px; color: var(--ink-soft); margin: 14px 0 20px; line-height: 1.5;
}
.drawer-entrada b { color: var(--ink); }

.drawer section { margin-bottom: 24px; }
.section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 10px; }

.flag {
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 7px;
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  line-height: 1.4;
}
.flag.bloqueante { background: var(--danger-bg); color: var(--danger); }
.flag.aviso { background: var(--warn-bg); color: var(--warn); }
.flag.resuelto { opacity: 0.4; text-decoration: line-through; }
.flag button { font-size: 10.5px; font-weight: 700; border: 1px solid currentColor; background: transparent; border-radius: 999px; padding: 3px 9px; cursor: pointer; flex-shrink: 0; }

.item-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--surface);
}
.item-card .item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.item-card .item-type { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.item-card .item-type .ico { width: 15px; height: 15px; color: var(--accent); }
.item-card .item-tag { font-size: 10.5px; color: var(--muted); background: var(--neutral-bg); padding: 2px 8px; border-radius: 999px; }
.item-rich { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.item-rich .hook { font-weight: 700; color: var(--ink); margin-bottom: 8px; font-size: 13.5px; }
.item-rich ol { margin: 0 0 8px; padding-left: 18px; }
.item-rich ol li { margin-bottom: 4px; }
.item-rich .cta-pill { display: inline-block; margin-top: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 11.5px; padding: 4px 10px; border-radius: 999px; }
.item-rich .slide { background: var(--surface-sunk); border-radius: 10px; padding: 9px 11px; margin-bottom: 7px; }
.item-rich .slide .st { font-weight: 700; color: var(--ink); font-size: 12.5px; margin-bottom: 2px; }
.item-rich .hashtags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.item-rich .hashtags span { font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.item-rich .story-step { display: flex; gap: 10px; margin-bottom: 8px; }
.item-rich .story-step .num { width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }

.item-edit-toggle { font-size: 11px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 0; text-decoration: underline; margin-top: 6px; }
.item-card textarea { width: 100%; font-family: ui-monospace, monospace; font-size: 11.5px; margin-top: 10px; }
.item-card .guardar-item-btn { margin-top: 8px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 10px; opacity: .5; }

/* ─── Item actions (regenerar/copiar) ─── */
.item-actions { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.icon-btn {
  font-size: 11px; font-weight: 600; color: var(--muted); background: none; border: none;
  cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 4px;
}
.icon-btn:hover { color: var(--accent); }
.icon-btn svg { width: 13px; height: 13px; }
.icon-btn.copied { color: var(--ok); }

/* ─── Drawer: adaptar / resultado ─── */
.drawer-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.drawer-tools select, .drawer-tools input[type="date"] {
  font-size: 12.5px; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-sunk);
}
.resultado-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.resultado-pill {
  border: 1.5px solid var(--border); border-radius: 999px; padding: 6px 13px; font-size: 12px;
  font-weight: 600; cursor: pointer; background: var(--surface); color: var(--ink-soft);
}
.resultado-pill.bien.selected { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.resultado-pill.regular.selected { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.resultado-pill.mal.selected { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.metricas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.metricas-grid input { font-size: 12px; padding: 7px 8px; }
.metricas-grid label { font-size: 10.5px; }

/* ─── Calendario ─── */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head h3 { margin: 0; font-size: 15px; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); width: 30px; height: 30px; cursor: pointer; color: var(--ink-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal-day {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px;
  min-height: 92px; padding: 7px; display: flex; flex-direction: column; gap: 4px;
}
.cal-day.outside { background: var(--surface-sunk); opacity: .5; }
.cal-day.today { border-color: var(--accent); }
.cal-day .daynum { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.cal-chip {
  font-size: 10px; font-weight: 600; padding: 3px 6px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.cal-chip .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sin-fecha-list { margin-top: 24px; }
.sin-fecha-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 9px 12px; margin-bottom: 8px; font-size: 12.5px;
}

/* ─── Competencia ─── */
.competitor-row { padding: 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-soft); display: flex; justify-content: space-between; }
.competitor-row:hover { background: var(--surface-sunk); }
.competitor-row.selected { background: var(--accent-soft); color: var(--accent); }
.competitor-row .n { color: var(--muted); font-weight: 400; font-size: 11px; }
.post-row {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 9px 11px; margin-bottom: 8px;
}
.post-row img { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.post-row .txt { flex: 1; font-size: 12.5px; color: var(--ink-soft); word-break: break-word; }
.post-row .del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.add-post-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.add-post-row input[type="text"] { flex: 1; min-width: 160px; }

.analisis-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.analisis-card h4 { margin: 0 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.analisis-card ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.analisis-resumen { font-size: 13.5px; line-height: 1.6; color: var(--ink); }

/* ─── Ocasiones (Story Bubble World) ─── */
.ocasiones-card {
  margin-top: 18px; background: linear-gradient(135deg, var(--accent-soft), #fff); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 18px 20px;
}
.ocasiones-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--accent); margin: 0 0 12px; }
.ocasion-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.ocasion-row:last-child { border-bottom: none; }
.ocasion-row .dias { font-weight: 700; color: var(--accent); font-size: 12px; }
