/* ============ Mercadeo Burbay · estilos ============ */
:root {
  --ink: #1D1F23;
  --ink-2: #3B4048;
  --muted: #5B616B;
  --ground: #F4F3EF;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --line: #E4E1DA;
  --line-2: #EEECE6;
  --nav: #1C2340;
  --nav-2: #262E52;
  --nav-active: #313B66;
  --nav-muted: #B9C0D4;
  --gold: #F2B544;
  --red: #B42318;   --red-bg: #FDECEC;
  --amber: #8A4B00; --amber-bg: #FFF1D9;
  --gray: #3B4652;  --gray-bg: #EEF0F3;
  --blue: #1F4FA0;  --blue-bg: #E3ECFB;
  --purple: #6A2E8F; --purple-bg: #F1E9FA;
  --green: #1E6B3E; --green-bg: #E7F4EB;
  --teal: #0E5A5E;  --teal-bg: #E0F2F1;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #7EA2F0; outline-offset: 2px; }

/* ---------- Arranque e inicio de sesión ---------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.logo-box { width: 44px; height: 44px; border-radius: 12px; background: var(--gold); color: var(--nav); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; flex: none; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--nav); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 18px; padding: 32px 28px; display: flex; flex-direction: column; gap: 18px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.login-brand strong { font-size: 20px; font-weight: 800; }
.login-card h1 { font-size: 22px; font-weight: 800; }
.login-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.input, .select, .textarea {
  min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid #D7D3CA; background: var(--surface); width: 100%;
}
.textarea { padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.45; }
.input:disabled, .textarea:disabled, .select:disabled { background: #F4F3EF; color: var(--ink-2); cursor: not-allowed; }
.form-error { background: var(--red-bg); color: var(--red); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 13px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 14px; white-space: nowrap; }
.btn svg { flex: none; }
.btn-primary { background: var(--nav); color: #fff; }
.btn-primary:hover { background: #2A3460; }
.btn-green { background: #237A4B; color: #fff; }
.btn-green:hover { background: #1C6A40; }
.btn-ghost { background: var(--surface); border-color: #D7D3CA; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-purple { background: var(--surface); border-color: #D9C6EC; color: var(--purple); }
.btn-danger { background: var(--surface); border-color: #F0C4BF; color: var(--red); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: #E8F1EA; color: #237A4B; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn:hover { background: #D6E9DB; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid #D7D3CA; border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--nav); color: #fff; }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: var(--nav); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand small { display: block; font-size: 12px; color: var(--nav-muted); font-weight: 500; }
.brand strong { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nav-muted); padding: 0 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 600; color: #fff; min-height: 40px; }
.nav-link:hover { background: var(--nav-2); }
.nav-link[aria-current="page"] { background: var(--nav-active); }
.nav-link .grow { flex: 1; }
.nav-person { font-weight: 500; color: #E8EBF4; }
.badge { font-size: 11px; font-weight: 700; color: var(--nav); background: #E8EBF4; border-radius: 999px; padding: 2px 8px; }
.badge-gold { background: var(--gold); }
.avatar { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; font-weight: 800; }
.avatar-md { width: 34px; height: 34px; font-size: 13px; }
.avatar-sm { width: 20px; height: 20px; font-size: 8px; }
.me-card { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 10px; background: var(--nav-2); }
.me-row { display: flex; align-items: center; gap: 10px; }
.me-row strong { display: block; font-size: 13px; }
.me-row small { display: block; font-size: 12px; color: var(--nav-muted); }
.me-row small.admin { color: var(--gold); font-weight: 600; }
.me-actions { display: flex; gap: 6px; }
.me-actions button { flex: 1; min-height: 34px; border-radius: 8px; border: 1px solid #4A5480; background: transparent; color: #E8EBF4; font-size: 12px; font-weight: 600; }
.me-actions button:hover { background: var(--nav-active); }

.main { flex: 1; min-width: 0; padding: 26px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head .eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.save-state { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--green-bg); color: var(--green); font-size: 12px; font-weight: 600; }
.save-state.saving { background: var(--blue-bg); color: var(--blue); }
.save-state.error { background: var(--red-bg); color: var(--red); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-pad { padding: 18px 20px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel h2 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.notice .grow { flex: 1 1 300px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- Estados (chips) ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chip-lg { font-size: 13px; padding: 7px 12px; border-radius: 10px; }
.st-red { background: var(--red-bg); color: var(--red); }
.st-amber { background: var(--amber-bg); color: var(--amber); }
.st-gray { background: var(--gray-bg); color: var(--gray); }
.st-blue { background: var(--blue-bg); color: var(--blue); }
.st-purple { background: var(--purple-bg); color: var(--purple); }
.st-green { background: var(--green-bg); color: var(--green); }
.st-teal { background: var(--teal-bg); color: var(--teal); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Tarjetas de tarea ---------- */
.task {
  width: 100%; text-align: left; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); background: var(--surface);
}
.task:hover { filter: brightness(0.98); }
.task-title { font-size: 13px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.task-title.empty-title { color: var(--muted); font-style: italic; }
.task-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--ink-2); font-weight: 500; }
.task-who { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }

/* ---------- Tablero del equipo ---------- */
.board-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.board { min-width: 1240px; }
.board-row { display: grid; grid-template-columns: 190px repeat(5, minmax(200px, 1fr)); border-bottom: 1px solid var(--line); }
.board-row:last-child { border-bottom: 0; }
.board-head { background: var(--surface-2); }
.board-head > div { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.board-head > div + div { border-left: 1px solid var(--line); }
.board-head .count { font-weight: 500; color: var(--muted); font-size: 13px; }
.lane-label { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.lane-label a { text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.lane-label a:hover span:last-child { text-decoration: underline; }
.progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,.9); overflow: hidden; }
.progress > div { height: 100%; }
.progress-gray { background: var(--line-2); height: 8px; }
.cell { padding: 10px; display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--line); min-height: 110px; }
.cell-add { align-self: flex-start; min-height: 32px; padding: 0 10px; border-radius: 8px; border: 1px dashed #CFCAC0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.cell-add:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Perfil personal ---------- */
.cols-scroll { overflow-x: auto; }
.cols { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; min-width: 1150px; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 360px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.col-head h2 { font-size: 14px; font-weight: 700; }
.person-head { display: flex; align-items: center; gap: 16px; }

/* ---------- General ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi .k-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.kpi .k-num { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .k-sub { font-size: 13px; color: var(--muted); }
.strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.strip-day { border-radius: 10px; padding: 9px; min-height: 66px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); background: var(--surface); }
.strip-day.today { border: 2px solid var(--nav); background: #EEF0FA; }
.strip-day .sd-top { display: flex; justify-content: space-between; align-items: baseline; }
.strip-day .sd-w { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.strip-day .sd-n { font-size: 15px; font-weight: 700; }
.strip-day .sd-l { font-size: 10px; font-weight: 700; color: var(--red); line-height: 1.2; }
.strip-day .dots { display: flex; flex-wrap: wrap; gap: 4px; }
.split { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.split > .wide { flex: 2 1 560px; min-width: 0; }
.split > .narrow { flex: 1 1 300px; min-width: 0; }
.table-scroll { overflow-x: auto; }
table.list { width: 100%; min-width: 680px; border-collapse: collapse; }
table.list th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface-2); }
table.list th:first-child, table.list td:first-child { padding-left: 20px; }
table.list td { padding: 11px 12px; border-top: 1px solid var(--line-2); vertical-align: middle; }
table.list tr.row-red { background: #FFF7F6; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover { background: var(--surface-2); }
.who { display: inline-flex; align-items: center; gap: 8px; }
.prog-item { display: flex; flex-direction: column; gap: 7px; }
.prog-top { display: flex; align-items: center; gap: 10px; }
.prog-top .grow { flex: 1; font-weight: 600; }
.legend { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 14px; font-size: 13px; }
.legend span { display: flex; align-items: center; gap: 8px; }

/* ---------- Por aprobar ---------- */
.review-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.review-top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.review-info { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.review-info strong { font-size: 15px; }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.steps .n { flex: none; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.note-box { display: flex; gap: 8px; padding: 10px; border-radius: 8px; background: #FBF8FE; border: 1px solid #E2D3F0; font-size: 12px; line-height: 1.4; color: var(--ink-2); }

/* ---------- Parrilla ---------- */
.month-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav .title { font-size: 20px; font-weight: 800; min-width: 200px; text-align: center; }
.sq-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #D7D3CA; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; }
.month-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.month-tabs button { min-height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid #D7D3CA; background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 700; }
.month-tabs button[aria-pressed="true"] { background: var(--nav); border-color: var(--nav); color: #fff; }
.legend-row { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.add-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 14px 16px; }
.add-form h2 { flex: 1 1 100%; font-size: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 2px; }
.swatch { width: 30px; height: 30px; margin: 6px 4px; border-radius: 50%; border: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor; }
.cal-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.cal { min-width: 920px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.day { min-height: 132px; padding: 8px; display: flex; flex-direction: column; gap: 5px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: var(--surface); }
.day:nth-child(7n) { border-right: 0; }
.day.out { background: #F7F6F2; }
.day.weekend { background: #FCFBF8; }
.day.fest { background: #FFF7F6; }
.day-top { display: flex; align-items: center; justify-content: space-between; }
.day-n { min-width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.day.out .day-n { color: #6B717B; }
.day-n.today { background: var(--nav); color: #fff; }
.day-add { width: 26px; height: 26px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; opacity: .55; }
.day:hover .day-add, .day-add:focus-visible { opacity: 1; background: var(--line-2); }
.special { display: flex; align-items: flex-start; gap: 4px; font-size: 10px; font-weight: 700; line-height: 1.25; }
.special svg { flex: none; margin-top: 1px; }
.entry { width: 100%; text-align: left; display: flex; align-items: center; gap: 6px; padding: 6px 7px; border-radius: 6px; border: 0; font-size: 11px; font-weight: 600; line-height: 1.25; }
.entry span.t { flex: 1; word-break: break-word; }

/* ---------- Ajustes ---------- */
.settings-grid { display: flex; flex-direction: column; gap: 20px; }
.member-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.member-row .name-input { flex: 1 1 180px; }
.color-input { width: 44px; height: 44px; padding: 3px; border-radius: 10px; border: 1px solid #D7D3CA; background: var(--surface); }
.sd-list { display: flex; flex-direction: column; }
.sd-row { display: flex; align-items: center; gap: 12px; padding: 9px 20px; border-top: 1px solid var(--line-2); font-size: 13px; }
.sd-row .date { width: 90px; flex: none; color: var(--muted); font-weight: 600; }
.sd-row .grow { flex: 1; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 20px; height: 20px; }

/* ---------- Modal y avisos ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20, 24, 40, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 24px; z-index: 50; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: 16px; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 19px; font-weight: 800; }
.modal-close { width: 36px; height: 36px; border-radius: 8px; border: 0; background: var(--line-2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line-2); padding-top: 14px; }
.modal-foot .left { margin-right: auto; }
.row-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.lock-note { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(92vw, 460px); }
.toast { background: var(--nav); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.error { background: #8F1A1A; }

/* ---------- Celular y tableta ---------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--nav); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar .brand { padding: 0; }
  .topbar button { min-height: 44px; min-width: 44px; border-radius: 10px; border: 1px solid #4A5480; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
  .sidebar { display: none; width: 100%; height: auto; position: static; }
  .app.menu-open .sidebar { display: flex; }
  .sidebar .brand { display: none; }
  .main { padding: 20px 16px 40px; }
  .page-head h1 { font-size: 24px; }
}
