/* ============================================================
   BTTR App — clon visual de Notion (modo oscuro)
   Paleta y proporciones calcadas del template de BTTR.
   ============================================================ */
:root {
    --bg: #191919;
    --bg-side: #202020;
    --bg-hover: rgba(255, 255, 255, .055);
    --bg-callout: rgba(255, 255, 255, .045);
    --bg-card: #252525;
    --bg-input: #2A2A2A;
    --border: rgba(255, 255, 255, .09);
    --border-soft: rgba(255, 255, 255, .055);
    --text: #D4D4D4;
    --text-strong: rgba(255, 255, 255, .92);
    --text-muted: #9B9B9B;
    --text-faint: #6E6E6E;
    --accent: #529CCA;
    /* chips: paleta EXACTA de Notion dark (verificada por deep research, votos 3-0) */
    --tag-gray-bg: #5A5A5A;   --tag-gray-fg: rgba(255,255,255,.88);
    --tag-brown-bg: #603B2C;  --tag-brown-fg: rgba(255,255,255,.88);
    --tag-orange-bg: #854C1D; --tag-orange-fg: rgba(255,255,255,.88);
    --tag-yellow-bg: #89632A; --tag-yellow-fg: rgba(255,255,255,.88);
    --tag-green-bg: #2B593F;  --tag-green-fg: rgba(255,255,255,.88);
    --tag-blue-bg: #28456C;   --tag-blue-fg: rgba(255,255,255,.88);
    --tag-purple-bg: #492F64; --tag-purple-fg: rgba(255,255,255,.88);
    --tag-pink-bg: #69314C;   --tag-pink-fg: rgba(255,255,255,.88);
    --tag-red-bg: #6E3630;    --tag-red-fg: rgba(255,255,255,.88);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --radius: 6px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
       -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button { font-family: var(--font); }
a { color: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #383838; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
input, select, textarea {
    background: var(--bg-input); color: var(--text-strong); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 7px 10px; font-family: var(--font); font-size: 14px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(82,156,202,.25); }

/* ============ LOGIN ============ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.login-box { width: 360px; max-width: 100%; text-align: center; }
.login-logo { font-size: 42px; font-weight: 800; letter-spacing: .04em; color: #fff; }
.login-logo span { font-size: 16px; vertical-align: super; }
.login-sub { color: var(--text-muted); margin: 6px 0 28px; }
.login-box form { display: flex; flex-direction: column; gap: 10px; }
.login-box input { padding: 11px 12px; font-size: 15px; }
.btn-primary { background: #fff; color: #191919; font-weight: 600; border: none; border-radius: var(--radius);
    padding: 11px; font-size: 14.5px; cursor: pointer; }
.btn-primary:hover { opacity: .9; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.login-err { color: var(--tag-red-fg); font-size: 13px; min-height: 18px; }

/* ============ LAYOUT ============ */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 242px; flex: 0 0 242px; background: var(--bg-side); border-right: 1px solid var(--border-soft);
    padding: 10px 8px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.ws { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 12px; }
.ws-logo { font-weight: 800; font-size: 16px; color: #fff; letter-spacing: .04em; }
.ws-logo span { font-size: 9px; vertical-align: super; }
.sb-close, .tb-menu { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 15px; border-radius: 4px; padding: 2px 7px; }
.sb-close:hover, .tb-menu:hover { background: var(--bg-hover); color: var(--text); }
.sb-nav { display: flex; flex-direction: column; gap: 1px; }
.sb-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 5px; cursor: pointer;
    color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; border: none; background: none; text-align: left; width: 100%; }
.sb-item:hover { background: var(--bg-hover); color: var(--text-strong); }
.sb-item.active { background: var(--bg-hover); color: var(--text-strong); }
.sb-ic { width: 18px; text-align: center; font-size: 14px; }
.sb-sec { font-size: 11.5px; font-weight: 600; color: var(--text-faint); padding: 14px 10px 4px; letter-spacing: .02em; }
.sb-add { color: var(--text-faint); font-size: 13.5px; }
.sb-badge { margin-left: auto; background: var(--tag-red-bg); color: var(--tag-red-fg); border-radius: 10px;
    font-size: 11px; font-weight: 700; padding: 0 7px; }
.sb-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; position: sticky; top: 0;
    background: rgba(25,25,25,.85); backdrop-filter: blur(8px); z-index: 40; }
.tb-menu { display: none; font-size: 18px; }
.tb-crumbs { font-size: 13.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tb-bell { background: none; border: none; cursor: pointer; font-size: 16px; position: relative; border-radius: 5px; padding: 3px 6px; }
.tb-bell:hover { background: var(--bg-hover); }
.bell-dot { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: #EB5757; }
.tb-user { font-size: 13px; color: var(--text-muted); }
.notif-pop { position: fixed; top: 46px; right: 18px; width: 380px; max-width: calc(100vw - 24px); max-height: 60vh;
    overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0,0,0,.5); z-index: 200; padding: 6px; }
.notif-item { padding: 9px 11px; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.no-leida { border-left: 2px solid var(--accent); background: rgba(82,156,202,.06); }
.notif-item small { color: var(--text-faint); display: block; margin-top: 2px; }
.notif-empty { padding: 20px; text-align: center; color: var(--text-faint); font-size: 13px; }

.content { flex: 1; padding: 18px clamp(20px, 6vw, 96px) 90px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ============ BLOQUES NOTION ============ */
.page-icon { font-size: 64px; line-height: 1; margin: 24px 0 8px; }
.page-title { font-size: 38px; font-weight: 700; color: var(--text-strong); letter-spacing: -.01em; margin-bottom: 4px; }
.page-title[contenteditable]:focus { outline: none; border-bottom: 1px solid var(--border); }
.page-sub { color: var(--text-muted); margin-bottom: 18px; }
/* propiedades tipo Notion (Client Contact / Email / Status…) */
.props { margin: 14px 0 8px; border-bottom: 1px solid var(--border-soft); padding-bottom: 14px; }
.prop-row { display: flex; align-items: center; min-height: 30px; font-size: 14px; }
.prop-k { flex: 0 0 160px; color: var(--text-faint); display: flex; gap: 8px; align-items: center; }
.prop-v { flex: 1; color: var(--text); min-width: 0; }
.prop-v input, .prop-v select { background: transparent; border: none; width: 100%; padding: 4px 6px; border-radius: 4px; }
.prop-v input:hover, .prop-v select:hover { background: var(--bg-hover); }
.prop-v input:focus, .prop-v select:focus { background: var(--bg-input); box-shadow: none; }
.prop-empty { color: var(--text-faint); }
/* headings con barra | */
.h-bar { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text-strong);
    font-size: 15.5px; margin: 30px 0 10px; }
.h-bar::before { content: ""; width: 3px; height: 20px; background: #fff; border-radius: 2px; }
/* callout ⚡ */
.callout { display: flex; gap: 12px; background: var(--bg-callout); border-radius: 6px; padding: 14px 16px;
    color: var(--text); font-size: 14px; margin: 10px 0 18px; }
.callout .co-ic { flex: 0 0 auto; }
/* tarjetas grises (Team / Client info) */
.gcard { background: var(--bg-callout); border: 1px solid var(--border-soft); border-radius: 8px;
    padding: 14px 16px; margin-bottom: 10px; }
.gcard b { color: var(--text-strong); }
.gcard small { color: var(--text-muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 10px; } }

/* ============ TABLA (base de datos Notion) ============ */
.db-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 6px; }
.db-title { font-size: 20px; font-weight: 700; color: var(--text-strong); display: flex; align-items: center; gap: 8px; }
.db-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.db-tools button, .ghost-btn { background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 13px; border-radius: 5px; padding: 4px 9px; }
.db-tools button:hover, .ghost-btn:hover { background: var(--bg-hover); color: var(--text-strong); }
.seg { display: inline-flex; gap: 2px; background: var(--bg-hover); border-radius: 6px; padding: 2px; }
.seg button { border: none; background: transparent; color: var(--text-muted); padding: 4px 12px; border-radius: 5px;
    cursor: pointer; font-size: 13px; }
.seg button.active { background: var(--bg-card); color: var(--text-strong); box-shadow: 0 1px 3px rgba(0,0,0,.4); }

.ntable-wrap { overflow-x: auto; border-top: 1px solid var(--border); }
.ntable { width: 100%; border-collapse: collapse; min-width: 760px; }
.ntable th { text-align: left; font-weight: 500; color: var(--text-faint); font-size: 13px; padding: 7px 10px;
    border-bottom: 1px solid var(--border); white-space: nowrap; }
.ntable th .th-ic { margin-right: 5px; opacity: .8; }
.ntable td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft);
    font-size: 14px; color: var(--text); vertical-align: middle; }
.ntable td:last-child { border-right: none; }
.ntable tr:hover td { background: rgba(255,255,255,.025); }
.row-name { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-strong); font-weight: 500; }
.row-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-name .doc-ic { opacity: .6; }
.new-row { color: var(--text-faint); cursor: pointer; padding: 8px 10px; font-size: 14px; border-bottom: 1px solid var(--border-soft); }
.new-row:hover { background: var(--bg-hover); color: var(--text); }

/* chips */
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12.5px; white-space: nowrap;
    line-height: 1.5; margin: 1px 3px 1px 0; }
.tag.gray { background: var(--tag-gray-bg); color: var(--tag-gray-fg); }
.tag.brown { background: var(--tag-brown-bg); color: var(--tag-brown-fg); }
.tag.orange { background: var(--tag-orange-bg); color: var(--tag-orange-fg); }
.tag.yellow { background: var(--tag-yellow-bg); color: var(--tag-yellow-fg); }
.tag.green { background: var(--tag-green-bg); color: var(--tag-green-fg); }
.tag.blue { background: var(--tag-blue-bg); color: var(--tag-blue-fg); }
.tag.purple { background: var(--tag-purple-bg); color: var(--tag-purple-fg); }
.tag.pink { background: var(--tag-pink-bg); color: var(--tag-pink-fg); }
.tag.red { background: var(--tag-red-bg); color: var(--tag-red-fg); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* checkbox estilo Notion */
.ncheck { width: 16px; height: 16px; accent-color: #2383E2; cursor: pointer; }

/* ============ CALENDARIO ============ */
.cal-head { display: flex; align-items: center; gap: 10px; margin: 8px 0; color: var(--text-muted); font-size: 13.5px; }
.cal-head b { color: var(--text-strong); font-size: 15px; }
.cal-nav-btns { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--border-soft); border-top: 1px solid var(--border-soft); }
.cal-dow { padding: 6px; text-align: center; font-size: 12px; color: var(--text-faint);
    border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.cal-cell { min-height: 96px; padding: 4px 5px; border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
    font-size: 12px; color: var(--text-muted); cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cal-cell:hover { background: rgba(255,255,255,.02); }
.cal-cell .dnum { text-align: right; font-size: 12px; }
.cal-cell.out .dnum { color: var(--text-faint); opacity: .5; }
.cal-cell.today .dnum { color: #fff; }
.cal-cell.today .dnum b { background: #EB5757; border-radius: 50%; padding: 2px 6px; font-weight: 600; }
.cal-ev { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 4px; padding: 2px 6px;
    font-size: 11.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; text-align: left; }
.cal-ev:hover { background: var(--bg-hover); }
.cal-ev .st { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }

/* ============ PEEK (ficha del post) ============ */
/* Side peek estilo Notion: la tabla queda VISIBLE e INTERACTIVA detrás (sin backdrop en desktop) */
.peek-backdrop { display: none !important; }
@media (max-width: 820px) { .peek-backdrop:not(.hidden) { display: block !important; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 300; } }
.peek { position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 96vw; background: var(--bg);
    border-left: 1px solid var(--border); z-index: 301; overflow-y: auto; padding: 18px 34px 60px;
    box-shadow: -18px 0 50px rgba(0,0,0,.45); animation: peekIn .18s ease; }
@keyframes peekIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.peek-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--text-faint); }
.peek-top button { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 15px; padding: 3px 7px; border-radius: 5px; }
.peek-top button:hover { background: var(--bg-hover); color: var(--text); }
.peek-title { font-size: 30px; font-weight: 700; color: var(--text-strong); border: none; background: transparent;
    width: 100%; margin-bottom: 10px; padding: 2px 0; }
.peek-title:focus { box-shadow: none; border-bottom: 1px solid var(--border); border-radius: 0; }
/* flujo: barra de acciones según estado */
.flow-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--bg-callout);
    border-radius: 8px; padding: 10px 12px; margin: 6px 0 16px; font-size: 13px; }
.flow-bar .fb-status { font-weight: 600; }
.fb-btn { border: 1px solid var(--border); background: var(--bg-card); color: var(--text-strong); border-radius: 6px;
    padding: 5px 12px; cursor: pointer; font-size: 13px; }
.fb-btn:hover { background: var(--bg-hover); }
.fb-btn.ok { background: #2B593F; border-color: #2B593F; color: #C7EED2; }
.fb-btn.warn { background: #522E2A; border-color: #522E2A; color: #F4C7C0; }
/* tabla de campos (Copy / Hashtags / Canción...) como el template */
.ftable { width: 100%; border: 1px solid var(--border); border-radius: 4px; border-collapse: collapse; margin: 12px 0; }
.ftable td { border: 1px solid var(--border-soft); padding: 8px 10px; font-size: 13.5px; vertical-align: top; }
.ftable td:first-child { width: 130px; color: var(--text-muted); background: rgba(255,255,255,.02); }
.ftable textarea, .ftable input { width: 100%; background: transparent; border: none; padding: 0; resize: vertical; min-height: 20px; font-size: 13.5px; }
.ftable textarea:focus, .ftable input:focus { box-shadow: none; }
.peek h3.sec { font-size: 22px; font-weight: 700; color: var(--text-strong); margin: 26px 0 8px; }
.peek textarea.script { width: 100%; min-height: 110px; background: transparent; border: none; font-size: 14px; color: var(--text); }
.peek textarea.script:focus { box-shadow: none; }
.todo-item { display: flex; align-items: center; gap: 9px; padding: 3px 0; }
.todo-item input[type="text"] { background: transparent; border: none; flex: 1; padding: 2px; }
.todo-item input[type="text"]:focus { box-shadow: none; }
.todo-item.done input[type="text"] { text-decoration: line-through; color: var(--text-faint); }
/* comentarios */
.cmt { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.cmt-av { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--tag-blue-bg);
    color: var(--tag-blue-fg); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.cmt-b { flex: 1; min-width: 0; }
.cmt-h { font-size: 12.5px; color: var(--text-muted); }
.cmt-h b { color: var(--text-strong); }
.cmt-t { font-size: 13.5px; margin-top: 2px; white-space: pre-wrap; }
.cmt.sys .cmt-t { color: var(--tag-red-fg); }
.cmt-form { display: flex; gap: 8px; margin-top: 10px; }
.cmt-form input { flex: 1; }
.link-arte { display: flex; align-items: center; gap: 8px; }
.link-arte a { color: var(--accent); font-size: 13.5px; word-break: break-all; }

/* ============ GENÉRICOS ============ */
.btn { border: 1px solid var(--border); background: var(--bg-card); color: var(--text-strong); border-radius: 6px;
    padding: 7px 14px; cursor: pointer; font-size: 13.5px; }
.btn:hover { background: var(--bg-hover); }
.btn.solid { background: #fff; color: #191919; border-color: #fff; font-weight: 600; }
.btn.danger { color: var(--tag-red-fg); border-color: var(--tag-red-bg); }
.btn.mini { padding: 3px 10px; font-size: 12.5px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ccard { background: var(--bg-callout); border: 1px solid var(--border-soft); border-radius: 8px; padding: 16px;
    cursor: pointer; transition: background .12s; }
.ccard:hover { background: var(--bg-hover); }
.ccard .ci { font-size: 26px; }
.ccard b { display: block; color: var(--text-strong); margin-top: 8px; font-size: 15px; }
.ccard small { color: var(--text-muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.kpi { background: var(--bg-callout); border-radius: 8px; padding: 12px 14px; }
.kpi small { color: var(--text-muted); font-size: 12px; display: block; }
.kpi b { font-size: 22px; color: var(--text-strong); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.row-actions button { opacity: 0; }
tr:hover .row-actions button { opacity: 1; }

/* modal genérico */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 400; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; width: 460px; max-width: 100%;
    max-height: 90vh; overflow-y: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.55); }
.modal h3 { color: var(--text-strong); margin-bottom: 14px; font-size: 17px; }
.modal .fld { margin-bottom: 11px; }
.modal .fld label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.modal .fld input, .modal .fld select, .modal .fld textarea { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* toasts */
.toasts { position: fixed; bottom: 18px; right: 18px; left: auto; transform: none; z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: #fff; color: #191919; border-radius: 8px; padding: 10px 18px; font-size: 13.5px; font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: tIn .18s ease; }
.toast.err { background: #E5484D; color: #fff; }
@keyframes tIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ v2: MENÚ NOTION / FILTROS / BOARD / STEPPERS ============ */
.nmenu { position: fixed; z-index: 600; width: 280px; background: #252525; border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.55); padding: 8px; animation: tIn .12s ease; }
.nm-q { width: 100%; margin-bottom: 6px; font-size: 13px; }
.nm-list { max-height: 250px; overflow-y: auto; }
.nm-it { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; cursor: pointer; font-size: 13.5px; }
.nm-it:hover { background: var(--bg-hover); }
.nm-it.on { background: rgba(82,156,202,.08); }
.nm-ck { margin-left: auto; color: var(--accent); }
.nm-new { color: var(--text-muted); border-top: 1px solid var(--border-soft); margin-top: 4px; padding-top: 8px; }
.nm-empty { padding: 10px; color: var(--text-faint); font-size: 13px; }

.prop-chip { background: transparent; border: none; cursor: pointer; padding: 3px 6px; border-radius: 5px; text-align: left; min-height: 26px; }
.prop-chip:hover { background: var(--bg-hover); }

.fbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 0 10px; }
.fb-q { font-size: 13px; padding: 5px 10px; width: 180px; }
.fb-btn2 { background: transparent; border: 1px solid var(--border); color: var(--text-muted); border-radius: 20px;
    padding: 4px 12px; font-size: 12.5px; cursor: pointer; }
.fb-btn2:hover { color: var(--text-strong); background: var(--bg-hover); }
.fb-btn2.on { border-color: var(--accent); color: var(--accent); background: rgba(82,156,202,.08); }
.fb-clear { color: var(--tag-red-fg); border-color: var(--tag-red-bg); }

.board { display: flex; gap: 12px; overflow-x: auto; padding: 8px 0 16px; align-items: flex-start; }
.bcol { flex: 0 0 240px; background: rgba(255,255,255,.02); border-radius: 8px; padding: 8px; }
.bcol-h { font-size: 13px; font-weight: 600; color: var(--text-muted); padding: 2px 6px 8px; }
.bcard { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 7px; padding: 9px 11px;
    margin-bottom: 7px; cursor: pointer; font-size: 13px; }
.bcard:hover { background: var(--bg-hover); }
.bcard b { display: block; color: var(--text-strong); font-weight: 500; margin-bottom: 4px; }

.stepper { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 6px; padding: 1px 4px; }
.stepper button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 15px; padding: 0 5px; }
.stepper button:hover { color: #fff; }
.stepper b { min-width: 18px; text-align: center; }

.row-name .open-btn { opacity: 0; margin-left: 8px; background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-muted); border-radius: 5px; font-size: 10px; padding: 2px 7px; cursor: pointer; letter-spacing: .04em; }
tr:hover .row-name .open-btn { opacity: 1; }

.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin: 8px 0; }
.perm-grid label { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; padding: 3px 0; }
.tagrow { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border-soft); }
.tagrow input[type="text"] { flex: 1; font-size: 13px; padding: 5px 9px; }
.color-dot { width: 16px; height: 16px; border-radius: 4px; cursor: pointer; border: 1px solid var(--border); }

/* ============ MÓVIL ============ */
@media (max-width: 820px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 250; transform: translateX(-110%); transition: transform .18s ease; width: 270px; }
    body.sb-open .sidebar { transform: none; }
    body.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 240; }
    .tb-menu { display: block; font-size: 24px; padding: 4px 12px; }
    #equipo-zone .mem-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
    #equipo-zone .mem-actions .btn.mini { flex: 1 1 auto; min-width: 90px; text-align: center; padding: 10px; }
    .content { padding: 12px 16px 80px; }
    /* chat IA: llenar la pantalla y que el input llegue al fondo */
    .content:has(.ai-chat) { padding-bottom: 10px; }
    .ai-chat { height: calc(100dvh - 84px); }
    .page-title { font-size: 28px; }
    .peek { width: 100vw; max-width: 100vw; padding: 14px 16px 60px; }
    .prop-k { flex-basis: 120px; }
    input, select, textarea { font-size: 16px !important; }  /* sin zoom iOS */
    .ntable { min-width: 640px; }
    .cal-cell { min-height: 64px; }
    .cal-ev { font-size: 10px; }
}

/* celdas editables inline */
td.cell-e { cursor: pointer; }
td.cell-e:hover { background: rgba(255,255,255,.045) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.cell-date { position: fixed; z-index: 650; background: #252525; border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px; color: var(--text-strong); }

/* Navegación: botones de acceso directo (estilo enlaces Notion) */
.nav-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.nav-quick button {
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
    border-radius: 7px; padding: 7px 14px; cursor: pointer; font-size: 13px; font-family: var(--font);
    transition: background .12s;
}
.nav-quick button:hover { background: var(--bg-hover); color: var(--text-strong); }

/* ===== Layout cliente estilo Notion: Navegación + Board arriba ===== */
.cli-top { display: grid; grid-template-columns: 230px 1fr; gap: 34px; align-items: start; margin: 8px 0 4px; }
.cli-nav { display: flex; flex-direction: column; gap: 1px; }
.navlink { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 5px; cursor: pointer;
    color: var(--text); font-size: 14px; text-decoration: underline; text-decoration-color: transparent; }
.navlink:hover { background: var(--bg-hover); color: var(--text-strong); text-decoration-color: var(--text-faint); }
.cli-board { min-width: 0; }
@media (max-width: 860px) { .cli-top { grid-template-columns: 1fr; gap: 12px; } }

/* ABRIR pegado a la derecha de la celda Name */
.row-name { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-strong); font-weight: 500; width: 100%; }
.row-name .rn-txt { flex: 1; min-width: 0; }
.row-name:hover .rn-txt { text-decoration: underline; text-underline-offset: 3px; }
.row-name .open-btn { opacity: 0; margin-left: auto; flex: 0 0 auto; }
tr:hover .row-name .open-btn { opacity: 1; }

/* Drag & drop — Board */
.bcard[draggable="true"] { cursor: grab; }
.bcard.dragging { opacity: .45; }
.bcol.drop-on { background: rgba(82,156,202,.10); box-shadow: inset 0 0 0 1.5px var(--accent); border-radius: 8px; }

/* Drag & drop — Calendario */
.cal-ev[draggable="true"] { cursor: grab; }
.cal-ev.dragging { opacity: .45; }
.cal-cell.drop-on { background: rgba(82,156,202,.10); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* Propiedad de cliente editable */
.cprop { cursor: pointer; border-radius: 4px; padding: 2px 5px; margin: -2px -5px; display: inline-block; }
.cprop:hover { background: var(--bg-hover); }
.ghost-btn.mini { font-size: 11px; padding: 2px 7px; }

/* Textareas que crecen con el texto (no scroll) */
textarea.grow { overflow: hidden; resize: none; width: 100%; background: transparent; border: none;
    color: var(--text-strong); font-family: var(--font); font-size: 14px; line-height: 1.55; margin-top: 6px; padding: 0; min-height: 24px; }
textarea.grow:focus { outline: none; }
.brief-card { padding: 16px 18px; margin-bottom: 12px; }
.peek textarea.script { overflow: hidden; resize: none; }

/* Campana de notificaciones más visible */
.tb-bell { color: var(--text-muted); }
.tb-bell:hover { color: var(--text-strong); }
.tb-bell svg { stroke: currentColor; }
/* Emoji + título editables */
.editable-icon { cursor: pointer; border-radius: 8px; padding: 2px; }
.editable-icon:hover { background: var(--bg-hover); }
.page-title[contenteditable] { cursor: text; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.page-title[contenteditable]:hover { background: var(--bg-hover); }
.page-title[contenteditable]:focus { outline: none; background: var(--bg-input); }



/* ftable del peek: textareas crecen (sin scroll) */
.ftable textarea.grow { min-height: 20px; }
.ftable td { vertical-align: top; }

/* Banner de impersonación */
#imp-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 700; background: #B45309; color: #fff;
    text-align: center; font-size: 13px; padding: 7px 14px; }
#imp-bar button { background: #fff; color: #7a3a06; border: none; border-radius: 5px; padding: 3px 10px; font-weight: 600; cursor: pointer; margin-left: 6px; }
body.has-imp { padding-top: 34px; }
body.has-imp .sidebar { top: 34px; height: calc(100vh - 34px); }

/* ===== Asistente de contenido IA — estilo chat (Gemini/Claude) ===== */
.ai-chat { display: flex; flex-direction: column; height: calc(100vh - 120px); width: 100%; max-width: 820px; margin: 0 auto; }
.ai-top { display: flex; align-items: center; gap: 8px; padding: 2px 2px 12px; flex-wrap: wrap; }
.ai-top select { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; flex: 1 1 130px; min-width: 0; }
.ai-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 10px 2px 18px; }
.ai-hello { margin: auto; text-align: center; max-width: 560px; padding: 20px; }
.ai-hello .ai-spark { font-size: 30px; color: var(--accent); margin-bottom: 10px; }
.ai-hello h2 { font-size: 30px; font-weight: 600; color: var(--text-strong); letter-spacing: -.01em; margin-bottom: 10px; }
.ai-hello p { margin-bottom: 18px; }
.ai-sugs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ai-sug { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); border-radius: 18px;
    padding: 8px 14px; font-size: 13px; cursor: pointer; }
.ai-sug:hover { background: var(--bg-hover); color: var(--text-strong); border-color: var(--accent); }
.ai-msg { max-width: 82%; padding: 11px 15px; border-radius: 16px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.ai-user { align-self: flex-end; background: var(--bg-card); color: var(--text-strong); border-bottom-right-radius: 5px; }
.ai-bot { align-self: flex-start; background: transparent; color: var(--text); padding-left: 4px; border-radius: 0; max-width: 100%; }
.ai-loading { padding: 8px 4px; }
.ai-typing { display: inline-flex; gap: 4px; align-items: center; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); display: inline-block; animation: aiblink 1.2s infinite both; }
.ai-typing i:nth-child(2) { animation-delay: .2s; } .ai-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes aiblink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }
.ai-idea { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); padding: 14px 16px; margin-bottom: 10px; }
.ai-idea .ai-i-title { font-weight: 600; color: var(--text-strong); font-size: 15px; }
.ai-idea .ai-i-meta { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.ai-idea .ai-i-copy { font-size: 13px; color: var(--text); margin: 6px 0; }
.ai-idea .ai-i-hash { font-size: 12.5px; color: var(--accent); }
.ai-form { display: flex; gap: 8px; align-items: center; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 26px; padding: 6px 6px 6px 18px; box-shadow: 0 6px 22px rgba(0,0,0,.28); }
.ai-form input { flex: 1; background: transparent; border: none; color: var(--text-strong); font-size: 15px; padding: 8px 0; }
.ai-form input:focus { outline: none; box-shadow: none; }
.ai-send { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.ai-send:hover { opacity: .9; }

/* acciones de tarjeta de idea IA */
.ai-i-acts { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.ai-idea.added { border-color: var(--tag-green-bg); } .ai-idea.dropped { opacity: .55; }
.ai-ok { color: #6bbf8a; font-size: 13px; font-weight: 600; } .ai-drop { color: var(--text-faint); font-size: 13px; }
.btn.solid { background: var(--accent); color: #fff; border: none; }

/* peek: X más grande, eliminar abajo (zona peligro) */
#peek-close { font-size: 22px; line-height: 1; padding: 2px 8px; }
.peek-danger { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.btn-del { background: none; border: 1px solid var(--border); color: #d98a8a; border-radius: 6px;
    padding: 7px 12px; font-size: 13px; cursor: pointer; }
.btn-del:hover { background: rgba(217,138,138,.12); border-color: #d98a8a; color: #e5a0a0; }

/* acciones de miembro (Equipo) — en escritorio a la derecha, en móvil envuelven */
.mem-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* markdown ligero en respuestas de la IA */
.ai-bot .md-h { font-weight: 700; color: var(--text-strong); margin: 10px 0 4px; font-size: 14.5px; }
.ai-bot .md-li { margin: 3px 0 3px 4px; }
.ai-bot b { color: var(--text-strong); }

/* ===== Mi tablero (kanban personal) ===== */
.tab-board { display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 14px; align-items: flex-start; -webkit-overflow-scrolling: touch; }
.tab-col { flex: 0 0 280px; max-width: 280px; background: var(--bg-side); border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; min-height: 320px; align-self: stretch; }
.tab-col-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.tab-col-title { flex: 1; background: transparent; border: none; font-weight: 700; color: var(--text-strong); font-size: 14px; padding: 4px 6px; border-radius: 5px; }
.tab-col-title:hover, .tab-col-title:focus { background: var(--bg-hover); }
.tab-col-menu { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 18px; padding: 2px 8px; border-radius: 5px; }
.tab-col-menu:hover { background: var(--bg-hover); color: var(--text); }
.tab-tasks { display: flex; flex-direction: column; gap: 7px; flex: 1; min-height: 140px; border-radius: 8px; padding: 4px; }
.tab-card { cursor: pointer; }
.tab-tasks.drop-on { background: rgba(82,156,202,.12); outline: 1px dashed var(--accent); }
.tab-card { display: flex; align-items: flex-start; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; cursor: grab; }
.tab-card.dragging { opacity: .4; }
.tab-card.done .tab-card-txt { text-decoration: line-through; color: var(--text-faint); }
.tab-chk { margin-top: 2px; accent-color: var(--accent); width: 15px; height: 15px; flex: 0 0 auto; }
.tab-card-txt { flex: 1; font-size: 13.5px; color: var(--text); cursor: pointer; word-break: break-word; }
.tab-newtask { width: 100%; background: transparent; border: none; margin-top: 8px; padding: 7px 6px; font-size: 13px; color: var(--text); border-radius: 6px; }
.tab-newtask:hover, .tab-newtask:focus { background: var(--bg-hover); }
.tab-addcol { flex: 0 0 240px; }
.tab-addcol input { width: 100%; background: var(--bg-hover); border: 1px dashed var(--border); border-radius: 10px; padding: 12px; color: var(--text-muted); font-size: 13px; }
.arch-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }

/* ===== Mi tablero: pestañas, badges, calendario, eventos ===== */
.tab-switch { display: inline-flex; background: var(--bg-side); border: 1px solid var(--border-soft); border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 14px; }
.tab-switch button { background: none; border: none; color: var(--text-muted); padding: 7px 16px; border-radius: 7px; font-weight: 600; font-size: 13px; cursor: pointer; }
.tab-switch button.on { background: var(--bg-card); color: var(--text-strong); }
.tab-card-body { flex: 1; min-width: 0; }
.tab-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; align-items: center; }
.tab-fecha { font-size: 11px; color: var(--accent); }
.tab-asig { font-size: 11px; color: var(--text-faint); }
/* calendario del tablero */
.ncal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; }
.ncal-h { background: var(--bg-side); color: var(--text-faint); font-size: 11px; padding: 6px 8px; text-align: right; }
.ncal-cell { background: var(--bg); min-height: 76px; padding: 5px 6px; overflow: hidden; min-width: 0; }
.ncal-cell.empty { background: var(--bg-side); }
.ncal-cell.hoy { background: rgba(82,156,202,.07); }
.ncal-d { font-size: 11px; color: var(--text-faint); text-align: right; margin-bottom: 3px; }
.ncal-item { font-size: 11px; padding: 3px 6px; border-radius: 5px; margin-bottom: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; box-sizing: border-box; }
.ncal-item.task { background: var(--bg-card); color: var(--text); }
.ncal-item[data-readonly] { cursor: default; opacity: .92; }
.ev-blue { background: var(--tag-blue-bg); color: #fff; } .ev-green { background: var(--tag-green-bg); color: #fff; }
.ev-yellow { background: var(--tag-yellow-bg); color: #fff; } .ev-red { background: var(--tag-red-bg); color: #fff; }
.ev-purple { background: var(--tag-purple-bg); color: #fff; } .ev-orange { background: var(--tag-orange-bg); color: #fff; }
.ev-vers { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow-y: auto; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.ev-chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); font-weight: 400; margin: 0; }
.ev-chk input { width: auto; }
@media (max-width: 820px) { .ncal-cell { min-height: 58px; } .ncal-item { font-size: 10px; } }

/* semáforo de atascados */
.sem { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-left: 6px; white-space: nowrap; }
.sem-yel { background: var(--tag-yellow-bg); color: #fff; }
.sem-red { background: var(--tag-red-bg); color: #fff; }

/* tarea nueva: textarea que crece hacia abajo (no scroll horizontal) */
textarea.tab-newtask { resize: none; overflow: hidden; line-height: 1.4; min-height: 20px; font-family: var(--font); }
/* reglamento de la agencia */
.regl-box { white-space: pre-wrap; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; color: var(--text); }

/* monto extra en tarjeta de tarea */
.tab-monto { font-size: 11px; font-weight: 700; color: #6bbf8a; background: rgba(107,191,138,.12); padding: 1px 7px; border-radius: 10px; }

/* peek de tarea personal */
.pkt-hecha-l { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.pkt-hecha-l input { width: 16px; height: 16px; accent-color: var(--accent); }
textarea.peek-title { resize: none; overflow: hidden; width: 100%; }

/* tarjeta de tarea: más legible + descripción */
.tab-card-txt { font-weight: 600; color: var(--text-strong); font-size: 13.5px; line-height: 1.4; }
.tab-card-nota { font-size: 12px; color: var(--text-muted); line-height: 1.45; margin-top: 3px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* peek de tarea estilo To-Do */
.pkt-star { background: none; border: none; color: var(--text-faint); font-size: 20px; cursor: pointer; }
.pkt-star.on { color: #E9C46A; }
.pkt-steps { margin: 4px 0 14px; display: flex; flex-direction: column; gap: 2px; }
.pkt-step { display: flex; align-items: center; gap: 9px; padding: 7px 6px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.pkt-step input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }
.pkt-step span { flex: 1; } .pkt-step span.done { text-decoration: line-through; color: var(--text-faint); }
.pkt-step-x { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 12px; opacity: 0; }
.pkt-step:hover .pkt-step-x { opacity: 1; }
.pkt-step.add .pkt-plus { color: var(--accent); font-size: 15px; }
.pkt-step.add input { flex: 1; background: transparent; border: none; color: var(--text); font-size: 13.5px; }
.pkt-link-open { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 13px; }
.tab-star { color: #E9C46A; }
.tab-steps-i { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* variaciones / propuestas de arte */
.pk-var { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 13.5px; }
.pk-var.elegida { border-color: var(--tag-green-bg); background: rgba(43,89,63,.12); }
.pk-var a { color: var(--accent); }
.pk-var [data-varx] { margin-left: auto; color: #d98a8a; }

/* enlaces múltiples en tarea + persona plana */
.pkt-link-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border-soft); border-radius: 7px; margin-bottom: 5px; font-size: 13px; }
.pkt-link-row a { color: var(--accent); flex: 1; word-break: break-all; }
.pkt-link-x { background: none; border: none; color: #d98a8a; cursor: pointer; font-size: 12px; }
.prop-chip.pkt-person { color: var(--text-strong); }
