/* ============================================================
   LinkedIn Content OS · Daniel Noriega
   Design system: dark-neutral, high density, professional SaaS
   Referencia visual: Linear / Vercel / Resend
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  /* Base */
  --bg:           #111214;
  --surface:      #18191d;
  --surface-2:    #1e2024;
  --surface-3:    #25272c;
  --border:       rgba(255,255,255,.1);
  --border-strong: rgba(255,255,255,.18);

  /* Text — legibilidad mejorada */
  --text-1:  #f0f0f0;
  --text-2:  #c4c4c4;
  --text-3:  #8f8f8f;
  --text-4:  #5a5a5a;

  /* Accent — único color vivo, azul frío */
  --accent:    #3b82f6;
  --accent-dim: rgba(59,130,246,.12);
  --accent-border: rgba(59,130,246,.3);

  /* Semántica — sólo para datos, nunca para decorar */
  --green:     #22c55e;
  --green-dim: rgba(34,197,94,.1);
  --amber:     #f59e0b;
  --amber-dim: rgba(245,158,11,.1);
  --red:       #ef4444;
  --red-dim:   rgba(239,68,68,.1);

  /* Estructura */
  --sidebar-w:  220px;
  --topbar-h:   52px;
  --radius:     6px;
  --radius-lg:  8px;
  --radius-xl:  12px;

  /* Tipografía */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Sombras */
  --shadow-sm:  0 1px 2px rgba(0,0,0,.4);
  --shadow:     0 4px 20px rgba(0,0,0,.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.6);

  --transition: .15s cubic-bezier(.4,0,.2,1);
}

/* ─────────────────────────────────────────
   Base
───────────────────────────────────────── */
html { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); }

/* ─────────────────────────────────────────
   Scrollbar
───────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

/* ─────────────────────────────────────────
   Sidebar
───────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

#sidebar.collapsed { width: 52px; }

.sidebar-logo {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-shrink: 0;
}

.logo-mark {
  width: 24px; height: 24px;
  background: var(--accent);
  border-radius: 5px;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.5px;
}

.logo-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  transition: opacity var(--transition);
}
#sidebar.collapsed .logo-name { opacity: 0; pointer-events: none; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px;
}

.nav-group-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 12px 8px 4px;
  white-space: nowrap;
  transition: opacity var(--transition);
}
#sidebar.collapsed .nav-group-label { opacity: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
  margin-bottom: 1px;
}

.nav-link:hover {
  background: var(--surface-3);
  color: var(--text-1);
}

.nav-link.active {
  background: var(--surface-3);
  color: var(--text-1);
  border-color: var(--border);
}

.nav-link.active .nav-dot {
  background: var(--accent);
}

.nav-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  margin-left: auto;
  transition: background var(--transition);
}
#sidebar.collapsed .nav-dot { display: none; }

.nav-ico {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--text-3);
  transition: color var(--transition);
}
.nav-link:hover .nav-ico,
.nav-link.active .nav-ico { color: var(--text-1); }

.nav-label {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--transition), max-width var(--transition);
}
#sidebar.collapsed .nav-label { opacity: 0; max-width: 0; }

.sidebar-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* Footer del sidebar */
.sidebar-footer {
  padding: 8px 6px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-collapse {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-collapse:hover { background: var(--surface-3); color: var(--text-2); }
.collapse-label { transition: opacity var(--transition); }
#sidebar.collapsed .collapse-label { opacity: 0; }

/* ─────────────────────────────────────────
   Topbar
───────────────────────────────────────── */
#topbar {
  position: fixed;
  top: 0; right: 0;
  height: var(--topbar-h);
  left: var(--sidebar-w);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 100;
  transition: left var(--transition);
}
#topbar.sidebar-collapsed { left: 52px; }

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

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
}

.topbar-sep {
  width: 1px; height: 16px;
  background: var(--border-strong);
}

.topbar-sub {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Sync status indicator ── */
.sync-status {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 20px;
  transition: opacity .3s, background .3s;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.sync-status[data-state="loading"] {
  opacity: 1;
  color: var(--text-3);
  background: var(--surface-3);
}
.sync-status[data-state="ok"] {
  opacity: 1;
  color: var(--green);
  background: rgba(34,197,94,.1);
}
.sync-status[data-state="offline"] {
  opacity: 1;
  color: var(--amber);
  background: rgba(245,158,11,.1);
}

#btn-menu-mobile {
  display: none;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
}
#btn-menu-mobile:hover { background: var(--surface-3); }

/* ─────────────────────────────────────────
   Main
───────────────────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 24px 28px 60px;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
#main.sidebar-collapsed { margin-left: 52px; }

/* ─────────────────────────────────────────
   Sections
───────────────────────────────────────── */
.section { display: none; }
.section.active { display: block; }

/* ─────────────────────────────────────────
   Page header
───────────────────────────────────────── */
.page-header { margin-bottom: 22px; }

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -.3px;
  line-height: 1.2;
}

.page-header p {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────
   Cards
───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.card-sm {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 14px;
}

/* ─────────────────────────────────────────
   Grid
───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ─────────────────────────────────────────
   Buttons
───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn:active { opacity: .8; transform: scale(.99); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.btn-primary:hover { background: #2563eb; }

.btn-secondary {
  background: var(--surface-3);
  color: var(--text-2);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-1); }

.btn-ghost {
  background: transparent;
  color: var(--text-3);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text-2); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,.2);
}
.btn-danger:hover { background: rgba(239,68,68,.2); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 18px; font-size: 14px; }

/* ─────────────────────────────────────────
   Badges
───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-blue   { background: var(--accent-dim);  color: var(--accent); border: 1px solid var(--accent-border); }
.badge-green  { background: var(--green-dim);   color: var(--green);  border: 1px solid rgba(34,197,94,.2); }
.badge-amber  { background: var(--amber-dim);   color: var(--amber);  border: 1px solid rgba(245,158,11,.2); }
.badge-red    { background: var(--red-dim);     color: var(--red);    border: 1px solid rgba(239,68,68,.2); }
.badge-muted  { background: var(--surface-3);   color: var(--text-3); border: 1px solid var(--border); }

/* ─────────────────────────────────────────
   Tags inline
───────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-3);
  border: 1px solid var(--border);
}

/* ─────────────────────────────────────────
   Forms
───────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 8px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}
input::placeholder, textarea::placeholder { color: var(--text-4); }
textarea { resize: vertical; min-height: 120px; }

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}
.form-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

/* Select arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236f6f6f'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
select option { background: #1c1c1c; }

/* ─────────────────────────────────────────
   Table
───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ─────────────────────────────────────────
   Stat cards
───────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
  margin-top: 6px;
  line-height: 1;
  letter-spacing: -.5px;
}
.stat-delta { font-size: 11.5px; margin-top: 5px; color: var(--text-3); }
.stat-delta.up   { color: var(--green); }
.stat-delta.down { color: var(--red); }

/* ─────────────────────────────────────────
   Progress bar
───────────────────────────────────────── */
.progress-wrap {
  background: var(--surface-3);
  border-radius: 999px;
  height: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .4s ease;
}

/* ─────────────────────────────────────────
   Info blocks (reemplazan alerts de colores)
───────────────────────────────────────── */
.info-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}

.info-block.accent {
  border-left: 2px solid var(--accent);
}
.info-block.green {
  border-left: 2px solid var(--green);
}
.info-block.amber {
  border-left: 2px solid var(--amber);
}
.info-block.red {
  border-left: 2px solid var(--red);
}

/* ─────────────────────────────────────────
   Modal
───────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(2px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(6px) scale(.99);
  transition: transform var(--transition);
}
.modal-body {
  overflow-y: auto;
  flex: 1;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 4px;
  border-radius: var(--radius);
  display: grid; place-items: center;
}
.modal-close:hover { background: var(--surface-3); color: var(--text-1); }

.modal-body { padding: 20px; min-height: 0; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ─────────────────────────────────────────
   Semana / Calendar
───────────────────────────────────────── */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.day-col.today {
  border-color: rgba(59,130,246,.35);
  box-shadow: 0 0 0 1px rgba(59,130,246,.15) inset;
}

.day-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}

.day-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-4);
}
.day-col.today .day-name { color: var(--accent); }

.day-date {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
  margin-top: 2px;
  letter-spacing: -.5px;
}
.day-col.today .day-date { color: var(--accent); }

.day-body {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Action items en el calendario */
.action-item {
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 11.5px;
  line-height: 1.4;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  user-select: none;
}

.action-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

/* Estado: completado */
.action-item.done {
  background: var(--surface-2);
  border-color: rgba(34,197,94,.2);
  opacity: .75;
}

.action-item.done .action-label,
.action-item.done .action-desc {
  text-decoration: line-through;
  color: var(--text-4);
}

.action-item.done .action-check {
  color: var(--green);
}

.action-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.action-type-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.action-label {
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-2);
  flex: 1;
}

.action-check {
  font-size: 14px;
  color: var(--text-4);
  flex-shrink: 0;
  transition: color var(--transition);
}

.action-desc {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.4;
}

/* Colores de los dots por tipo de acción */
.dot-post    { background: var(--accent); }
.dot-engage  { background: var(--green); }
.dot-connect { background: var(--amber); }
.dot-reply   { background: #a78bfa; }
.dot-metrics { background: var(--text-4); }

/* ─────────────────────────────────────────
   Post cards
───────────────────────────────────────── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.post-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.post-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.post-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
}
.post-card-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.post-card-preview {
  font-size: 13px;
  color: var(--text-3);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.5;
  margin-bottom: 10px;
}
.post-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* ─────────────────────────────────────────
   Spinner de carga
───────────────────────────────────────── */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(59,130,246,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────
   Selector de modelo IA
───────────────────────────────────────── */
.model-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.model-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-2);
}
.model-btn.active {
  border-color: var(--accent-border);
  background: var(--accent-dim);
  color: var(--text-1);
}
.model-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.model-cost {
  font-size: 10px;
  color: var(--text-4);
  margin-left: 2px;
}
.model-btn.active .model-cost {
  color: var(--text-3);
}

/* ─────────────────────────────────────────
   Idea cards
───────────────────────────────────────── */
.idea-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: border-color var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
}
.idea-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
/* Ideas generadas por IA — borde verde sutil */
.idea-card-ai {
  border-color: rgba(34,197,94,.2);
}
.idea-card-ai:hover {
  border-color: rgba(34,197,94,.35);
}

.idea-card-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.idea-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 10px;
  line-height: 1.35;
}
.idea-card-hook {
  font-size: 12.5px;
  color: var(--text-2);
  font-style: italic;
  padding: 9px 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border-left: 2px solid var(--accent);
  margin-bottom: 10px;
  line-height: 1.5;
}
.idea-card-desc {
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 12px;
  line-height: 1.55;
  flex: 1;
}

/* ─────────────────────────────────────────
   Tabs
───────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.tab-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition);
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--text-1); border-bottom-color: var(--accent); }

/* ─────────────────────────────────────────
   Pestañas internas del modal de post
───────────────────────────────────────── */
.modal-tabs-bar {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  /* Evita que quede oculta por el scroll del modal-body */
  flex-shrink: 0;
}
.modal-tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.modal-tab-btn:hover  { color: var(--text-2); }
.modal-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Etiqueta de grupo en el panel de métricas */
.metrics-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin: 14px 0 6px;
}

/* ─────────────────────────────────────────
   Analizador de algoritmo
───────────────────────────────────────── */
.algo-score-box {
  padding: 14px 16px;
  border-radius: var(--radius);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}
.algo-score-box.good { background: var(--green-dim);  color: var(--green); border: 1px solid rgba(34,197,94,.2); }
.algo-score-box.ok   { background: var(--amber-dim);  color: var(--amber); border: 1px solid rgba(245,158,11,.2); }
.algo-score-box.bad  { background: var(--red-dim);    color: var(--red);   border: 1px solid rgba(239,68,68,.2); }

.algo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.algo-item.pass { border-color: rgba(34,197,94,.2); }
.algo-item.warn { border-color: rgba(245,158,11,.2); }
.algo-item.fail { border-color: rgba(239,68,68,.2); }

.algo-item .ico {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  width: 18px;
  text-align: center;
}
.algo-item.pass .ico { color: var(--green); }
.algo-item.warn .ico { color: var(--amber); }
.algo-item.fail .ico { color: var(--red); }

.algo-item .algo-label { font-weight: 600; color: var(--text-1); font-size: 12.5px; }
.algo-item .algo-desc  { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }

/* ─────────────────────────────────────────
   Char counter
───────────────────────────────────────── */
.char-counter {
  font-size: 11.5px;
  color: var(--text-4);
  text-align: right;
  margin-top: 5px;
}
.char-counter.ok   { color: var(--green); }
.char-counter.warn { color: var(--amber); }
.char-counter.over { color: var(--red); }

/* ─────────────────────────────────────────
   Tip banner (minimalista)
───────────────────────────────────────── */
.tip-banner {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.tip-icon { color: var(--accent); flex-shrink: 0; margin-top: 1px; }

/* ─────────────────────────────────────────
   Empty state
───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
}
.empty-icon { font-size: 28px; margin-bottom: 12px; }
.empty-state h3 { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.empty-state p  { font-size: 12.5px; max-width: 300px; margin: 0 auto 16px; color: var(--text-3); }

/* ─────────────────────────────────────────
   Semana — contadores
───────────────────────────────────────── */
.week-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.week-stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.week-stat-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-4);
  margin-bottom: 5px;
}
.week-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -.5px;
  line-height: 1;
}
.week-stat-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* Leyenda mínima */
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-3);
}
.legend-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}

/* ─────────────────────────────────────────
   Perfil — checklist
───────────────────────────────────────── */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  transition: background var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}
.check-row:hover { background: var(--surface-2); border-color: var(--border); }
.check-row.done .check-text {
  text-decoration: line-through;
  color: var(--text-4);
}
.check-row.done .check-circle {
  background: var(--green);
  border-color: var(--green);
}
.check-row.done .check-tick { display: flex; }

.check-circle {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  display: grid; place-items: center;
  transition: background var(--transition), border-color var(--transition);
  background: transparent;
}
.check-tick {
  display: none;
  width: 8px; height: 8px;
}
.check-text {
  font-size: 13px;
  color: var(--text-2);
  transition: color var(--transition);
  line-height: 1.4;
}

/* ─────────────────────────────────────────
   Roadmap
───────────────────────────────────────── */
.roadmap-item {
  display: flex;
  gap: 14px;
  padding-bottom: 24px;
  position: relative;
}
.roadmap-item:last-child { padding-bottom: 0; }

.roadmap-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.roadmap-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  background: var(--surface-2);
  flex-shrink: 0;
}
.roadmap-circle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.roadmap-connector {
  width: 1px;
  flex: 1;
  background: var(--border);
  margin: 5px 0;
  min-height: 16px;
}

.roadmap-content { flex: 1; padding-top: 2px; }
.roadmap-phase { font-size: 10.5px; font-weight: 600; color: var(--text-4); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
.roadmap-title { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 8px; }
.roadmap-actions { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.roadmap-actions li {
  font-size: 12.5px;
  color: var(--text-3);
  display: flex;
  gap: 7px;
}
.roadmap-actions li::before {
  content: '→';
  color: var(--text-4);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   Métricas
───────────────────────────────────────── */
.chart-wrap { position: relative; height: 240px; }

/* ─────────────────────────────────────────
   Mobile overlay
───────────────────────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
#sidebar-overlay.visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ─────────────────────────────────────────
   Algoritmo — bloques de texto
───────────────────────────────────────── */
.algo-phase {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.algo-phase:last-child { border-bottom: none; }
.algo-phase-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  margin-top: 1px;
}
.algo-phase-body { flex: 1; }
.algo-phase-title { font-size: 13.5px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.algo-phase-desc  { font-size: 12.5px; color: var(--text-3); line-height: 1.55; }

.check-list-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.check-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
}
.check-list-item .cli-ico { flex-shrink: 0; font-size: 13px; margin-top: 1px; }
.check-list-item.good .cli-ico { color: var(--green); }
.check-list-item.bad  .cli-ico { color: var(--red); }
.check-list-item.bad  { opacity: .85; }

/* Post structure steps */
.post-struct {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-struct-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.post-struct-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 76px;
  text-align: center;
}
.post-struct-desc {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.55;
  padding-top: 2px;
}

/* Horarios */
.horario-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.horario-title { font-size: 13.5px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.horario-desc  { font-size: 12px; color: var(--text-3); line-height: 1.5; margin-bottom: 8px; }

/* ─────────────────────────────────────────
   Responsive
───────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .week-grid { grid-template-columns: repeat(4, 1fr); }
  .check-list-2col { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .week-stats { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  /* Sidebar oculto por defecto — pointer-events off para no bloquear clicks */
  #sidebar {
    transform: translateX(-100%);
    pointer-events: none;
  }
  #sidebar.mobile-open {
    transform: translateX(0);
    pointer-events: auto;
  }

  /* Overlay: solo visible cuando el menú está abierto (gestionado por JS) */
  #sidebar-overlay.visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* Topbar ocupa todo el ancho */
  #topbar {
    left: 0 !important;
    padding: 0 12px;
    z-index: 150;           /* por encima del main, por debajo del sidebar */
  }

  /* Main sin margen del sidebar — margin-top ya lo gestiona la regla base */
  #main {
    margin-left: 0 !important;
    padding: 14px 14px 80px;
  }

  /* Botón hamburguesa visible */
  #btn-menu-mobile {
    display: grid !important;
    min-width: 36px;
    min-height: 36px;
    touch-action: manipulation;   /* evita delay de 300ms en móvil */
  }

  /* Layouts de columna única */
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr; }
  .day-col { min-height: auto; }
  .week-stats { gap: 6px; }
  .check-list-2col { grid-template-columns: 1fr; }

  /* Action items más fáciles de pulsar en táctil */
  .action-item {
    padding: 12px 10px;
    min-height: 48px;
    cursor: pointer;
    touch-action: manipulation;
  }

  /* Cards y botones más accesibles en táctil */
  .btn { min-height: 36px; touch-action: manipulation; }
  .nav-link { min-height: 44px; touch-action: manipulation; }
}
