:root {
  /* Marca X Consulting: granate + negro + blanco */
  --brand: #6b0401;
  --brand-hover: #550301;
  --brand-deep: #3a0201;
  --brand-tint: #f7ecea;
  --brand-ring: rgba(107, 4, 1, .14);
  --navy: #0a0a0a;          /* menú lateral y oscuros */
  --navy-2: #1c1c1e;
  --blue: var(--brand);     /* color principal (antes azul) */
  --blue-soft: var(--brand-tint);
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --red: #b45309;           /* avisos (retrasos, vencidos): ámbar, para no confundir con la marca */
  --green: #2f7d4f;
  --orange: #c08a2e;
  --purple: #48484a;
  --client: #b8892f;        /* lo que espera al cliente */
  --danger: #d70015;        /* solo acciones destructivas */
  --radius: 16px;
  --shadow: 0 0 0 .5px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Inter, "Segoe UI", sans-serif;
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--navy); color: #cfd3ef; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.ws { position: relative; margin-bottom: 14px; }
.brand { display: block; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 10px;
  padding: 6px 10px 8px; cursor: pointer; color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 400; }
.brand:hover { background: var(--navy-2); border-color: #262d63; }
.brand .caret { font-size: 10px; opacity: .8; }
.ws-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 240px; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.35); padding: 6px; z-index: 60; }
.ws-menu a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.ws-menu a:hover { background: var(--bg); text-decoration: none; }
.ws-menu a.current { background: var(--blue-soft); }
.ws-menu a.current b::after { content: "  ✓"; color: var(--blue); }
.ws-menu a span { font-size: 12px; color: var(--muted); }
.brand small { display: block; font-family: Inter, sans-serif; font-size: 11px; color: #8d93c4; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: #cfd3ef; padding: 9px 10px; border-radius: 8px; font-weight: 500;
}
.nav a:hover { background: var(--navy-2); text-decoration: none; color: #fff; }
.nav a.active { background: var(--blue); color: #fff; }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar .spacer { flex: 1; }
.whoami { border-top: 1px solid #262d63; padding-top: 12px; margin-top: 8px; }
.whoami label { font-size: 11px; color: #8d93c4; text-transform: uppercase; letter-spacing: .08em; padding: 0 4px; }
.whoami select { width: 100%; margin-top: 6px; background: var(--navy-2); color: #fff; border: 1px solid #2c3470; }
.userbox { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.userbox .nm { color: #fff; font-weight: 600; font-size: 13px; }
.userbox .rl { color: #8d93c4; font-size: 11px; }
.userbox-actions { display: flex; gap: 6px; margin-top: 10px; }
.userbox-actions button { flex: 1; justify-content: center; background: var(--navy-2); color: #cfd3ef; border-color: #2c3470; font-size: 12px; padding: 6px 8px; }
.userbox-actions button:hover { color: #fff; border-color: #4a539b; }
.main { padding: 28px 32px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h3 { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }

/* ---------- Controls ---------- */
button, .btn {
  font: inherit; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
button:hover, .btn:hover { border-color: #c7cbe0; text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #2349e0; border-color: #2349e0; }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }
input, select, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--text); min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
textarea { resize: vertical; min-height: 70px; width: 100%; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 18px 0 8px; grid-column: 1 / -1; }

/* ---------- Chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #eef0f7; color: #3c4166; white-space: nowrap; }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.green { background: #e3f4ea; color: #1f7a45; }
.chip.red { background: #fde7ee; color: #b3164a; }
.chip.orange { background: #fdeedd; color: #b5620f; }
.chip.purple { background: #ece9fb; color: #5a4fb0; }
.chip.dark { background: var(--navy); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.avatar { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.status-onboarding { background: #fdeedd; color: #b5620f; }
.status-activo { background: #e3f4ea; color: #1f7a45; }
.status-pausado { background: #eef0f7; color: #6b7091; }
.status-finalizado { background: #eef0f7; color: #9a9db6; }

/* ---------- KPIs ---------- */
.kpi { padding: 16px 18px; }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.warn .v { color: var(--red); }

.progress { height: 6px; background: #eceef6; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--blue); border-radius: 99px; }
.stackbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: #eceef6; }
.stackbar > div { height: 100%; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* ---------- Client cards ---------- */
.client-card { cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: transform .1s; }
.client-card:hover { transform: translateY(-1px); box-shadow: 0 4px 22px rgba(11, 16, 51, .1); }
.client-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.client-card .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.column { background: #eceef6; border-radius: var(--radius); width: 252px; flex: none; display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.column-head { padding: 12px 12px 8px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.column-head h4 { font-size: 13px; }
.column-head .who { font-size: 11px; color: var(--muted); }
.column-body { padding: 4px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.column.drop { outline: 2px dashed var(--blue); background: var(--blue-soft); }
.vcard { background: #fff; border-radius: 10px; padding: 10px 11px; box-shadow: 0 1px 2px rgba(11, 16, 51, .08); cursor: grab; border-left: 3px solid transparent; display: flex; flex-direction: column; gap: 7px; }
.vcard:hover { box-shadow: 0 2px 10px rgba(11, 16, 51, .12); }
.vcard.late { border-left-color: var(--red); }
.vcard .t { font-weight: 600; font-size: 13px; line-height: 1.3; }
.vcard .m { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.vcard.dragging { opacity: .4; }

/* ---------- Journey ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.journey { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.week { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 220px; }
.week-head { background: linear-gradient(90deg, var(--navy), var(--blue)); color: #fff; padding: 12px 14px; border-radius: var(--radius) var(--radius) 0 0; display: flex; justify-content: space-between; align-items: center; }
.week-head.current { background: linear-gradient(90deg, var(--blue), #6b8cff); box-shadow: 0 0 0 3px #c8d4ff; }
.week-head .ph { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.week-body { padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.step { display: flex; gap: 8px; align-items: flex-start; padding: 8px 9px; border-radius: 9px; background: #f7f8fc; border-left: 4px solid var(--red); font-size: 12.5px; cursor: pointer; }
.step:hover { background: #eff1f9; }
.step.done { opacity: .55; }
.step.done .st { text-decoration: line-through; }
.step.skipped { opacity: .35; }
.step.overdue { background: #fff1f5; }
.step input[type=checkbox] { margin-top: 2px; width: 15px; height: 15px; flex: none; cursor: pointer; }
.step .st { line-height: 1.35; }
.step .sd { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.k-hito { border-left-color: var(--navy); }
.k-equipo { border-left-color: var(--red); }
.k-cliente { border-left-color: var(--client); }
.k-llamada { border-left-color: var(--green); }
.k-llamada_cm { border-left-color: var(--purple); }
.k-llamada_opcional { border-left-color: var(--orange); border-left-style: dashed; }
.k-content_manager { border-left-color: var(--orange); }
.k-decision { border-left-color: #9aa3c7; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal .dow { background: #fafbfe; padding: 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cal .day { background: #fff; min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day.other { background: #fafbfe; }
.cal .day.other .n { color: #b9bcd2; }
.cal .day.today .n { background: var(--blue); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.cal .n { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.ev { font-size: 11px; padding: 3px 6px; border-radius: 5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.ev.done { opacity: .5; text-decoration: line-through; }
.ev-llamada { background: var(--green); }
.ev-journey { background: var(--red); }
.ev-journey.cliente { background: var(--client); }
.ev-journey.content_manager { background: var(--orange); }
.ev-journey.hito, .ev-journey.decision { background: #7a82a8; }
.ev-grabacion { background: var(--purple); }
.ev-entrega { background: var(--navy); }
.ev-publicacion { background: var(--orange); }
.ev-tarea { background: #14b8a6; }
.ev-more { font-size: 11px; color: var(--muted); cursor: pointer; padding-left: 4px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(11, 16, 51, .45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(11, 16, 51, .3); }
.modal.wide { max-width: 980px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.x { border: none; background: none; font-size: 22px; line-height: 1; color: var(--muted); padding: 4px 8px; }
.video-modal { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; }
.activity { background: #f7f8fc; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.comment { font-size: 12.5px; }
.comment .who { font-weight: 600; }
.comment.cliente .who { color: var(--client); }
.comment .when { color: var(--muted); font-size: 11px; margin-left: 4px; }
.comment .txt { white-space: pre-wrap; margin-top: 2px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.error { background: var(--danger); }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f7f8fc; }
.tbl input, .tbl select { padding: 5px 8px; font-size: 13px; }
.scroll-x { overflow-x: auto; }

.linkbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.copybox { display: flex; gap: 6px; }
.copybox input { flex: 1; font-size: 12px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .brand { padding: 4px 8px; font-size: 18px; }
  .ws { margin: 0; width: 100%; }
  .brand small { font-size: 10px; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 7px 9px; font-size: 13px; }
  .sidebar .spacer { display: none; }
  .whoami { border: none; margin: 0; padding: 0; width: 100%; }
  .main { padding: 18px 16px 48px; }
  .cols-2, .cols-3, .cols-6, .form-grid { grid-template-columns: 1fr; }
  .cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-modal { grid-template-columns: 1fr; }
  .cal .day { min-height: 70px; }
  .ev { font-size: 10px; padding: 2px 4px; }
}

/* ---------- Calendario semanal de contenido (estilo Apple) ---------- */
:root { --ap-text: #1d1d1f; --ap-sub: #86868b; --ap-line: rgba(60, 60, 67, .12); --ap-fill: rgba(120, 120, 128, .12);
  --ap-red: #ff3b30; --ap-blue: #0071e3; }
.ap-cal {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Inter, sans-serif;
  color: var(--ap-text); -webkit-font-smoothing: antialiased; }
.ap-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ap-title h1 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.ap-title h1 span { color: var(--ap-sub); font-weight: 400; }
.ap-sub { color: var(--ap-sub); font-size: 13px; margin-top: 4px; }
.ap-actions { display: flex; align-items: center; gap: 10px; }
.ap-nav { display: flex; align-items: center; gap: 4px; }
.ap-cal button { font-family: inherit; }
.ap-icon { width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; font-size: 22px; line-height: 1;
  color: var(--ap-text); justify-content: center; padding: 0 0 2px; transition: background .15s; }
.ap-icon:hover { background: var(--ap-fill); }
.ap-pill { border: none; background: var(--ap-fill); color: var(--ap-text); border-radius: 999px; padding: 6px 14px; font-size: 13px;
  font-weight: 500; transition: background .15s, transform .1s; }
.ap-pill:hover { background: rgba(120, 120, 128, .2); }
.ap-pill:active, .ap-icon:active { transform: scale(.96); }
.ap-ghost { background: transparent; color: var(--ap-sub); }
.ap-seg { display: inline-flex; background: var(--ap-fill); border-radius: 9px; padding: 2px; }
.ap-seg button { border: none; background: transparent; border-radius: 7px; padding: 5px 16px; font-size: 13px; font-weight: 500;
  color: var(--ap-text); transition: background .2s, box-shadow .2s; }
.ap-seg button.is-on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); font-weight: 600; }
.ap-seg button:hover:not(.is-on) { color: #000; }
.ap-grid-wrap { background: #fff; border-radius: 16px; overflow-x: auto;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.05); }
.ap-grid { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.ap-grid th, .ap-grid td { border-bottom: 1px solid var(--ap-line); }
.ap-grid td + td, .ap-grid th + th, .ap-grid th + td { border-left: 1px solid var(--ap-line); }
.ap-grid tbody tr:last-child > * { border-bottom: none; }
.ap-corner { width: 168px; position: sticky; left: 0; z-index: 2; background: rgba(255,255,255,.92); backdrop-filter: blur(20px); }
.ap-day { padding: 14px 6px 12px; text-align: center; font-weight: 400; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(20px); position: sticky; top: 0; z-index: 1; }
.ap-dow { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--ap-sub); }
.ap-num { display: inline-flex; align-items: center; justify-content: center; margin-top: 4px; width: 34px; height: 34px;
  border-radius: 50%; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.ap-day.is-today .ap-dow { color: var(--ap-red); }
.ap-day.is-today .ap-num { background: var(--ap-red); color: #fff; font-weight: 600; }
.ap-day.is-weekend .ap-num { color: var(--ap-sub); }
.ap-day.is-today.is-weekend .ap-num { color: #fff; }
.ap-row { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; padding: 12px 14px; vertical-align: top; font-weight: 400; }
.ap-row { display: table-cell; }
.ap-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--row); margin-right: 8px;
  vertical-align: 0; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.15); }
.ap-rowname { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.ap-cell { position: relative; vertical-align: top; padding: 6px; height: 88px; cursor: pointer; transition: background .15s; }
.ap-cell.is-weekend { background: #fbfbfd; }
.ap-cell.is-today { background: rgba(255, 59, 48, .03); }
.ap-cell:hover { background: rgba(0, 113, 227, .04); }
.ap-add { position: absolute; top: 4px; right: 6px; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 15px; color: var(--ap-blue); background: rgba(0,113,227,.1); opacity: 0; transform: scale(.8);
  transition: opacity .15s, transform .15s; pointer-events: none; }
.ap-cell:hover .ap-add { opacity: 1; transform: scale(1); }
.ap-ev { position: relative; display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; padding: 5px 8px 5px 10px;
  border-radius: 7px; background: color-mix(in srgb, var(--row) 14%, white); color: var(--ap-text);
  box-shadow: inset 3px 0 0 var(--row); transition: transform .12s, box-shadow .15s, background .15s; overflow: hidden; }
.ap-ev:hover { background: color-mix(in srgb, var(--row) 22%, white); transform: translateY(-1px);
  box-shadow: inset 3px 0 0 var(--row), 0 3px 10px rgba(0,0,0,.08); }
.ap-ev-title { font-size: 12px; font-weight: 600; line-height: 1.3; letter-spacing: -.005em; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.ap-ev-meta { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ap-sub); font-weight: 500; }
.ap-ev-meta i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: none; }
.ap-note { background: #fff; box-shadow: inset 3px 0 0 var(--row), 0 0 0 .5px var(--ap-line); }
.ap-note:hover { background: #fff; box-shadow: inset 3px 0 0 var(--row), 0 0 0 .5px var(--ap-line), 0 3px 10px rgba(0,0,0,.08); }
.ap-note .ap-ev-title { font-weight: 500; }
.ap-ev-link { font-size: 10.5px; color: var(--ap-blue); font-weight: 500; }
.ap-ev.is-done { opacity: .45; }
.ap-ev.is-done .ap-ev-title { text-decoration: line-through; }
.ap-ev.is-late { box-shadow: inset 3px 0 0 var(--ap-red); }
.ap-foot { color: var(--ap-sub); font-size: 12px; text-align: center; margin-top: 14px; }
@media (max-width: 820px) {
  .ap-title h1 { font-size: 24px; }
  .ap-corner, .ap-row { width: 120px; }
}

/* ---------- Menú contextual (estilo macOS) ---------- */
.ctx-menu { position: fixed; z-index: 200; min-width: 190px; padding: 5px; border-radius: 10px;
  background: rgba(246, 246, 248, .86); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.18), 0 10px 30px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; animation: ctxIn .12s ease-out; }
@keyframes ctxIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.ctx-item { display: block; width: 100%; text-align: left; border: none; background: transparent; border-radius: 5px;
  padding: 5px 10px; font-size: 13px; font-weight: 400; color: #1d1d1f; cursor: default; }
.ctx-item:hover { background: #0a64d8; color: #fff; border-color: transparent; }
.ctx-item.is-danger { color: #d70015; }
.ctx-item.is-danger:hover { background: #d70015; color: #fff; }
.ctx-sep { height: 1px; margin: 4px 8px; background: rgba(0,0,0,.1); }

/* ---------- Filtros por formato ---------- */
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.fchip { border: none; background: rgba(120,120,128,.12); color: #1d1d1f; border-radius: 999px; padding: 6px 13px;
  font-size: 13px; font-weight: 500; transition: background .15s, color .15s; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif; }
.fchip span { color: #86868b; font-weight: 400; margin-left: 2px; }
.fchip:hover { background: rgba(120,120,128,.2); }
.fchip.is-on { background: #1d1d1f; color: #fff; }
.fchip.is-on span { color: rgba(255,255,255,.65); }


/* =====================================================================
   Tema premium (estilo Apple) — granate, negro y blanco
   ===================================================================== */
::selection { background: var(--brand-ring); }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 19px; font-weight: 650; letter-spacing: -.018em; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }

/* Menú lateral negro */
.sidebar { background: #0a0a0a; border-right: 1px solid #1c1c1e; padding: 18px 12px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 19px; letter-spacing: -.01em; }
.brand .brand-logo { height: 34px; width: auto; flex: none; opacity: .96; }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { color: #8e8e93; letter-spacing: .12em; font-size: 10px; margin-top: 4px; }
.brand:hover { background: #161618; border-color: #232326; }
.nav a { color: #a1a1a6; font-size: 13.5px; font-weight: 500; border-radius: 9px; padding: 8px 10px; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #f5f5f7; }
.nav a.active { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 6px 16px rgba(107,4,1,.35); }
.nav .ico { opacity: .8; }
.whoami { border-top: 1px solid #1c1c1e; }
.userbox .rl { color: #8e8e93; }
.userbox-actions button { background: #161618; border-color: #262628; color: #d1d1d6; border-radius: 9px; }
.userbox-actions button:hover { background: #222224; color: #fff; border-color: #333336; }
.ws-menu { border-radius: 14px; }
.ws-menu a.current { background: var(--brand-tint); }
.ws-menu a.current b::after { color: var(--brand); }

/* Tarjetas y superficies */
.card { border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi .v { font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.kpi .l { font-size: 12.5px; }
.client-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 .5px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.08); }

/* Botones */
button, .btn { border-radius: 10px; border-color: #d2d2d7; font-weight: 500; transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; }
button:active, .btn:active { transform: scale(.98); }
button:hover, .btn:hover { border-color: #b8b8bf; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(107,4,1,.25); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-dark { background: #1d1d1f; border-color: #1d1d1f; color: #fff; }
.btn-green { background: #1d1d1f; border-color: #1d1d1f; color: #fff; font-weight: 600; }
.btn-green:hover { background: #000; border-color: #000; }
.btn-danger { color: var(--danger); }
.btn-ghost { border-color: transparent; }

/* Formularios */
input, select, textarea { border-radius: 10px; border-color: #d2d2d7; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
input[type=checkbox] { accent-color: var(--brand); }
.field > span, .section-title { color: var(--muted); }

/* Chips */
.chip { background: #f2f2f7; color: #3a3a3c; }
.chip.blue { background: var(--brand-tint); color: var(--brand); }
.chip.red { background: #fdf1e3; color: #9a4a06; }
.chip.green { background: #e9f4ee; color: #23633e; }
.chip.orange { background: #fbf1e3; color: #8a5a12; }
.chip.purple { background: #f2f2f7; color: #48484a; }
.chip.dark { background: #1d1d1f; color: #fff; }

/* Pestañas, progreso */
.tabs { border-bottom-color: #e5e5ea; }
.tabs a.active { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }
.progress { background: #ececf0; }
.progress > div { background: var(--brand); }

/* Kanban */
.column { background: rgba(0,0,0,.035); border-radius: 16px; }
.column.drop { outline-color: var(--brand); background: var(--brand-tint); }
.vcard { border-radius: 12px; box-shadow: 0 0 0 .5px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.05); }
.vcard:hover { box-shadow: 0 0 0 .5px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.08); }
.vcard.late { border-left-color: var(--red); }

/* Journey */
.week { border-radius: 16px; }
.week-head { background: linear-gradient(120deg, #1d1d1f, #3a3a3c); border-radius: 16px 16px 0 0; }
.week-head.current { background: linear-gradient(120deg, var(--brand-deep), var(--brand)); box-shadow: 0 0 0 3px var(--brand-ring); }
.step { background: #f7f7f9; border-radius: 10px; }
.step:hover { background: #f0f0f3; }
.step.overdue { background: #fdf6ec; }
.k-hito { border-left-color: #1d1d1f; }
.k-equipo { border-left-color: var(--brand); }
.k-cliente { border-left-color: var(--client); }
.k-llamada { border-left-color: var(--green); }
.k-llamada_cm { border-left-color: #48484a; }
.k-llamada_opcional { border-left-color: var(--orange); }
.k-content_manager { border-left-color: #9c6b4a; }
.k-decision { border-left-color: #aeaeb2; }

/* Calendario mensual */
.cal { border-radius: 16px; }
.cal .dow { background: #fafafa; }
.cal .day.today .n { background: var(--brand); }
.ev { border-radius: 6px; }
.ev-llamada { background: var(--green); }
.ev-journey { background: var(--brand); }
.ev-journey.cliente { background: var(--client); }
.ev-journey.content_manager { background: #9c6b4a; }
.ev-journey.hito, .ev-journey.decision { background: #8e8e93; }
.ev-grabacion { background: #48484a; }
.ev-entrega { background: #1d1d1f; }
.ev-publicacion { background: var(--brand); }
.ev-tarea { background: #8e8e93; }

/* Modales y avisos */
.modal-bg { background: rgba(0,0,0,.32); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.modal { border-radius: 20px; box-shadow: 0 0 0 .5px rgba(0,0,0,.08), 0 30px 80px rgba(0,0,0,.25); }
.modal-head, .modal-foot { border-color: #ececf0; }
.toast { background: rgba(29,29,31,.94); border-radius: 12px; backdrop-filter: blur(12px); }
.toast.error { background: var(--danger); }
.tbl th { color: var(--muted); }
.tbl tr.click:hover td { background: #f7f7f9; }

/* Calendario semanal y menú contextual: acento de marca */
:root { --ap-red: var(--brand); --ap-blue: var(--brand); }
.ap-add { background: var(--brand-tint); }
.ap-cell:hover { background: rgba(107,4,1,.035); }
.ap-cell.is-today { background: rgba(107,4,1,.03); }
.ctx-item:hover { background: var(--brand); }
.fchip.is-on { background: #1d1d1f; }
