/* ═══════════════════════════════════════
   BRIEF DE CAMPAÑA — Notion-style Editor
   Prefix: bf-
   ═══════════════════════════════════════ */

/* ── Layout: Two-panel ── */
.bf-wrap {
    display: flex;
    height: calc(100vh - 64px);
    overflow: hidden;
}

/* ── Left Panel: Briefs List ── */
.bf-sidebar {
    width: 260px;
    min-width: 260px;
    border-right: 1px solid var(--border, #1a1a30);
    display: flex;
    flex-direction: column;
    background: var(--surface, #ffffff);
}
.bf-sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid var(--border, #1a1a30);
}
.bf-sidebar-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #6a6a88);
    margin-bottom: 12px;
}
.bf-new-btn {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px dashed var(--border, #1a1a30);
    background: transparent;
    color: var(--accent, #7c5cfc);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, border-color 0.2s;
}
.bf-new-btn:hover {
    background: rgba(124, 92, 252, 0.08);
    border-color: var(--accent, #7c5cfc);
}
.bf-search {
    padding: 12px 16px 8px;
}
.bf-search input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border, #1a1a30);
    background: var(--bg, #ffffff);
    color: var(--text, #e0e0e8);
    font-size: 0.8rem;
}
.bf-search input::placeholder { color: var(--text-muted, #6a6a88); }
.bf-search input:focus { outline: none; border-color: var(--accent, #7c5cfc); }

.bf-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.bf-list-item {
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 4px;
}
.bf-list-item:hover { background: rgba(0,0,0,0.03); }
.bf-list-item.active { background: rgba(124, 92, 252, 0.1); border: 1px solid rgba(124, 92, 252, 0.2); }
.bf-list-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text, #e0e0e8);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bf-list-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-muted, #6a6a88);
}
.bf-list-item-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
}
.bf-status-borrador { background: rgba(106,106,136,0.15); color: #8888aa; }
.bf-status-en_progreso { background: rgba(59,130,246,0.15); color: #60a5fa; }
.bf-status-revision { background: rgba(251,191,36,0.15); color: #fbbf24; }
.bf-status-aprobado { background: rgba(34,197,94,0.15); color: #4ade80; }
.bf-status-finalizado { background: rgba(124,92,252,0.15); color: #a78bfa; }

/* ── Right Panel: Editor ── */
.bf-editor {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px 60px;
    background: var(--bg, #ffffff);
}
.bf-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted, #6a6a88);
    gap: 12px;
}
.bf-empty-state i { opacity: 0.3; }
.bf-empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-secondary, #aaaabb); }
.bf-empty-state p { font-size: 0.82rem; }

/* ── Editor Header ── */
.bf-editor-header {
    margin-bottom: 32px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.bf-campaign-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text, #e0e0e8);
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}
.bf-campaign-name:focus { border-bottom-color: var(--accent, #7c5cfc); }
.bf-campaign-name::placeholder { color: var(--text-muted, #6a6a88); }

.bf-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.bf-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border, #1a1a30);
    background: var(--surface, #ffffff);
    color: var(--text-secondary, #aaaabb);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}
.bf-btn:hover { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); }
.bf-btn-primary {
    background: var(--accent, #7c5cfc);
    color: #fff;
    border-color: var(--accent, #7c5cfc);
}
.bf-btn-primary:hover { opacity: 0.9; }
.bf-btn-danger { color: #f87171; border-color: rgba(248,113,113,0.2); }
.bf-btn-danger:hover { background: rgba(248,113,113,0.08); }
.bf-btn i { width: 14px; height: 14px; }

/* ── Meta Row (brand + status + objective) ── */
.bf-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.bf-meta-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}
.bf-meta-field.bf-flex-1 { flex: 1; }
.bf-meta-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #6a6a88);
}
.bf-select, .bf-input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border, #1a1a30);
    background: var(--surface, #ffffff);
    color: var(--text, #e0e0e8);
    font-size: 0.82rem;
    transition: border-color 0.2s;
}
.bf-select:focus, .bf-input:focus { outline: none; border-color: var(--accent, #7c5cfc); }

/* ── Section Blocks ── */
.bf-section {
    margin-bottom: 28px;
    padding: 20px;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #1a1a30);
    border-radius: 14px;
}
.bf-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary, #aaaabb);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.bf-section-title i { width: 16px; height: 16px; color: var(--accent, #7c5cfc); }

/* ── Textarea (Description, Notes) ── */
.bf-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border, #1a1a30);
    background: var(--bg, #ffffff);
    color: var(--text, #e0e0e8);
    font-size: 0.82rem;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
}
.bf-textarea:focus { outline: none; border-color: var(--accent, #7c5cfc); }
.bf-textarea::placeholder { color: var(--text-muted, #6a6a88); }

/* ── Dates ── */
.bf-dates-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.bf-date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}
.bf-date-field label {
    font-size: 0.72rem;
    color: var(--text-muted, #6a6a88);
}
.bf-date-field input[type="date"] {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border, #1a1a30);
    background: var(--bg, #ffffff);
    color: var(--text, #e0e0e8);
    font-size: 0.8rem;
    font-family: inherit;
}
.bf-date-field input[type="date"]:focus { outline: none; border-color: var(--accent, #7c5cfc); }

/* ── Checklist (Pendientes) ── */
/* ── Pendientes: Full-width table layout ── */
.bf-checklist { display: flex; flex-direction: column; gap: 0; }
.bf-checklist-header {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border, #1a1a30);
    margin-bottom: 4px;
}
.bf-checklist-header span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #6a6a88);
}
.bf-check-item {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 7px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}
.bf-check-item:hover { background: rgba(0,0,0,0.025); }
.bf-check-item + .bf-check-item { border-top: 1px solid rgba(0,0,0,0.03); }

/* Column widths */
.bf-cl-col-check { width: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.bf-cl-col-owner { width: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.bf-cl-col-text { flex: 1; min-width: 0; }
.bf-cl-col-date { width: 120px; flex-shrink: 0; }
.bf-cl-col-del { width: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

/* Owner dot */
.bf-owner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}
.bf-owner-dot.agencia {
    background: #7c5cfc;
    border-color: rgba(124, 92, 252, 0.3);
}
.bf-owner-dot.cliente {
    background: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}
.bf-owner-dot:hover {
    transform: scale(1.25);
    box-shadow: 0 0 8px rgba(0,0,0,0.12);
}

/* Owner legend */
.bf-owner-legend {
    display: flex;
    gap: 16px;
    padding: 6px 12px 2px;
    margin-bottom: 4px;
}
.bf-owner-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--text-muted, #6a6a88);
}
.bf-owner-legend .bf-owner-dot {
    width: 8px;
    height: 8px;
    cursor: default;
    border: none;
}
.bf-owner-legend .bf-owner-dot:hover {
    transform: none;
    box-shadow: none;
}

/* Custom checkbox */
.bf-cl-col-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.bf-cl-col-check label {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bf-checkbox-visual {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--border, #e5e7ef);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.bf-checkbox-visual::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: -2px;
}
.bf-cl-col-check input[type="checkbox"]:checked + .bf-checkbox-visual {
    background: var(--accent, #7c5cfc);
    border-color: var(--accent, #7c5cfc);
}
.bf-cl-col-check input[type="checkbox"]:checked + .bf-checkbox-visual::after {
    transform: rotate(-45deg) scale(1);
}
.bf-cl-col-check input[type="checkbox"]:focus-visible + .bf-checkbox-visual {
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.25);
}

/* Text input */
.bf-check-item .bf-cl-col-text {
    background: transparent;
    border: none;
    color: var(--text, #e0e0e8);
    font-size: 0.82rem;
    padding: 4px 8px;
    outline: none;
    border-radius: 4px;
    transition: background 0.15s;
}
.bf-check-item .bf-cl-col-text:focus {
    background: rgba(0,0,0,0.04);
}
.bf-check-item.done .bf-cl-col-text {
    text-decoration: line-through;
    color: var(--text-muted, #6a6a88);
}

/* Delete */
.bf-check-item .bf-cl-col-del {
    opacity: 0;
    cursor: pointer;
    color: var(--text-muted, #6a6a88);
    transition: opacity 0.15s, color 0.15s;
}
.bf-check-item:hover .bf-cl-col-del { opacity: 1; }
.bf-check-item .bf-cl-col-del:hover { color: #f87171; }
.bf-add-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--accent, #7c5cfc);
    cursor: pointer;
    padding: 6px 0;
    border: none;
    background: none;
}
.bf-add-check:hover { text-decoration: underline; }

/* ── Visual References ── */
.bf-refs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.bf-ref-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px solid var(--border, #1a1a30);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}
.bf-ref-card:hover { border-color: rgba(124,92,252,0.3); }
.bf-ref-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bf-ref-card .bf-ref-delete {
    position: absolute;
    top: 6px; right: 6px;
    width: 24px; height: 24px;
    border-radius: 6px;
    background: rgba(0,0,0,0.7);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}
.bf-ref-card:hover .bf-ref-delete { opacity: 1; }
.bf-ref-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border, #1a1a30);
    font-size: 0.78rem;
    color: var(--accent, #7c5cfc);
    margin-bottom: 6px;
    word-break: break-all;
}
.bf-ref-link .bf-ref-delete {
    flex-shrink: 0;
    cursor: pointer;
    color: var(--text-muted, #6a6a88);
}
.bf-upload-zone {
    border: 2px dashed var(--border, #1a1a30);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: var(--text-muted, #6a6a88);
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.bf-upload-zone:hover {
    border-color: var(--accent, #7c5cfc);
    background: rgba(124,92,252,0.04);
}
.bf-upload-zone.dragover {
    border-color: var(--accent, #7c5cfc);
    background: rgba(124,92,252,0.08);
}

/* ── Buyer Personas Chips ── */
.bf-personas-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bf-persona-chip {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border, #1a1a30);
    background: var(--surface, #ffffff);
    font-size: 0.78rem;
    color: var(--text-secondary, #aaaabb);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bf-persona-chip:hover { border-color: rgba(124,92,252,0.3); }
.bf-persona-chip.selected {
    background: rgba(124,92,252,0.12);
    border-color: var(--accent, #7c5cfc);
    color: #c4b5fd;
}

/* ── Kanban Cards (rich style) ── */
.bf-kanban-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.bf-kanban-card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #1a1a30);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}
.bf-kanban-card:hover {
    border-color: var(--accent, #7c5cfc);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(124, 92, 252, 0.12);
}
.bf-kc-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--surface-3, #ffffff);
}
.bf-kc-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.bf-kc-media-count {
    position: absolute;
    bottom: 6px; right: 6px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}
.bf-kc-body { padding: 12px; }
.bf-kc-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.bf-kc-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text, #e0e0e8);
    flex: 1;
}
.bf-kc-headline {
    font-size: 0.75rem;
    color: var(--text-muted, #6a6a88);
    margin: 4px 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bf-kc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}
.bf-kc-col-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}
.bf-kc-tag {
    font-size: 0.7rem;
    color: var(--text-muted, #6a6a88);
    display: flex;
    align-items: center;
    gap: 3px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bf-kc-remove {
    cursor: pointer;
    color: var(--text-muted, #6a6a88);
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
    padding: 2px;
    border-radius: 4px;
}
.bf-kanban-card:hover .bf-kc-remove { opacity: 1; }
.bf-kc-remove:hover { color: #f87171; background: rgba(248,113,113,0.1); }
.bf-link-kanban-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px dashed var(--border, #1a1a30);
    background: transparent;
    color: var(--accent, #7c5cfc);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s;
}
.bf-link-kanban-btn:hover { background: rgba(124,92,252,0.06); }

/* ── Two Column Layout (Dates + Pendientes) ── */
.bf-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}
.bf-two-col .bf-section { margin-bottom: 28px; }

/* ── Budget ── */
.bf-budget-header {
    margin-bottom: 16px;
}
.bf-budget-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bf-budget-field label {
    font-size: 0.72rem;
    color: var(--text-muted, #6a6a88);
}
.bf-budget-field input, .bf-budget-field select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border, #1a1a30);
    background: var(--bg, #ffffff);
    color: var(--text, #e0e0e8);
    font-size: 0.82rem;
}
.bf-budget-table-wrap {
    overflow-x: auto;
}
.bf-budget-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.bf-budget-table th {
    text-align: left;
    padding: 8px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #6a6a88);
    border-bottom: 1px solid var(--border, #1a1a30);
    white-space: nowrap;
}
.bf-budget-table td {
    padding: 6px 6px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(26,26,48,0.5);
}
.bf-budget-table .bf-budget-select,
.bf-budget-table .bf-budget-input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border, #1a1a30);
    background: var(--bg, #ffffff);
    color: var(--text, #e0e0e8);
    font-size: 0.78rem;
}
.bf-budget-table .bf-budget-select:focus,
.bf-budget-table .bf-budget-input:focus {
    outline: none;
    border-color: var(--accent, #7c5cfc);
}
.bf-budget-row-delete:hover { color: #f87171 !important; }

/* ── Generated Pieces Log ── */
.bf-pieces-log {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bf-piece-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border, #1a1a30);
    font-size: 0.78rem;
}
.bf-piece-type {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(124,92,252,0.12);
    color: #a78bfa;
}
.bf-piece-name { flex: 1; color: var(--text, #e0e0e8); }
.bf-piece-date { color: var(--text-muted, #6a6a88); font-size: 0.72rem; }

/* ── Notes ── */
.bf-notes-list { display: flex; flex-direction: column; gap: 8px; }
.bf-note-item {
    padding: 12px;
    border-radius: 8px;
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #1a1a30);
}
.bf-note-text {
    font-size: 0.82rem;
    color: var(--text, #e0e0e8);
    line-height: 1.5;
    margin-bottom: 6px;
}
.bf-note-meta {
    font-size: 0.68rem;
    color: var(--text-muted, #6a6a88);
}
.bf-note-delete {
    float: right;
    cursor: pointer;
    color: var(--text-muted, #6a6a88);
    opacity: 0;
    transition: opacity 0.15s;
}
.bf-note-item:hover .bf-note-delete { opacity: 1; }

/* ── AI Summary ── */
.bf-summary-box {
    padding: 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(124,92,252,0.06), rgba(34,197,94,0.04));
    border: 1px solid rgba(124,92,252,0.15);
    font-size: 0.82rem;
    color: var(--text, #e0e0e8);
    line-height: 1.6;
    white-space: pre-wrap;
}
.bf-summary-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted, #6a6a88);
    font-size: 0.82rem;
}

/* ── Kanban Modal ── */
.bf-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.bf-modal-overlay.visible { opacity: 1; }
.bf-modal {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #1a1a30);
    border-radius: 16px;
    width: 480px;
    max-width: 90vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
}
.bf-modal-overlay.visible .bf-modal { transform: scale(1); }
.bf-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, #1a1a30);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bf-modal-header h3 { font-size: 0.92rem; font-weight: 700; }
.bf-modal-close {
    cursor: pointer;
    color: var(--text-muted, #6a6a88);
    padding: 4px;
}
.bf-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.bf-modal-search {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border, #1a1a30);
    background: var(--bg, #ffffff);
    color: var(--text, #e0e0e8);
    font-size: 0.82rem;
    margin-bottom: 12px;
}
.bf-modal-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.bf-modal-card:hover { background: rgba(0,0,0,0.03); }
.bf-modal-card.linked { background: rgba(124,92,252,0.08); }

/* ── Saving indicator ── */
.bf-saving {
    position: fixed;
    bottom: 20px; right: 20px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #1a1a30);
    font-size: 0.75rem;
    color: var(--text-muted, #6a6a88);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 900;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
}
.bf-saving.show { opacity: 1; transform: translateY(0); }

/* ── Responsive ── */
/* ── Share Button ── */
.bf-btn-share {
    background: linear-gradient(135deg, #7c5cfc22, #9b7eff18) !important;
    border: 1px solid #7c5cfc55 !important;
    color: #9b7eff !important;
}
.bf-btn-share:hover {
    background: linear-gradient(135deg, #7c5cfc33, #9b7eff28) !important;
    border-color: #9b7eff !important;
}

/* ── Check item date pickers ── */
.bf-check-date {
    padding: 5px 8px;
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #1a1a30);
    border-radius: 6px;
    color: var(--text, #e0e0e8);
    font-size: 0.72rem;
    color-scheme: dark;
    transition: border-color 0.15s;
}
.bf-check-item .bf-check-date.bf-cl-col-date {
    width: 120px;
    flex-shrink: 0;
}
.bf-check-date:focus {
    outline: none;
    border-color: var(--accent, #7c5cfc);
}
.bf-check-date::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

/* ── Calendar dates row (inline chips) ── */
.bf-dates-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.bf-date-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(124, 92, 252, 0.06);
    border: 1px solid var(--border, #1a1a30);
    border-radius: 8px;
    padding: 8px 14px;
    flex: 1;
    min-width: 180px;
}
.bf-date-chip-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #6a6a88);
    white-space: nowrap;
}
.bf-date-chip input[type="date"] {
    flex: 1;
    padding: 4px 8px;
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #1a1a30);
    border-radius: 6px;
    color: var(--text, #e0e0e8);
    font-size: 0.78rem;
    color-scheme: dark;
}
.bf-date-chip input[type="date"]:focus {
    outline: none;
    border-color: var(--accent, #7c5cfc);
}

/* ── Gantt Chart ── */
.bf-gantt {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #1a1a30);
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
}
/* Header row uses same flex layout as data rows for perfect alignment */
.bf-gantt-header-row {
    border-bottom: 1px solid var(--border, #1a1a30);
    padding-bottom: 8px;
    margin-bottom: 4px;
}
.bf-gantt-track-header {
    height: 20px !important;
    background: transparent !important;
}
.bf-gantt-date {
    position: absolute;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    transform: translateX(-50%);
    top: 2px;
}
.bf-gantt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    min-height: 28px;
}
.bf-gantt-label {
    width: 140px;
    min-width: 140px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary, #aaa);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bf-gantt-track {
    flex: 1;
    position: relative;
    height: 22px;
    background: rgba(0,0,0,0.02);
    border-radius: 4px;
}
.bf-gantt-bar {
    position: absolute;
    top: 3px;
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--accent, #7c5cfc), #9b7eff);
    opacity: 0.85;
    min-width: 6px;
    transition: opacity 0.2s;
}
.bf-gantt-bar:hover { opacity: 1; }
/* Owner colors */
.bf-gantt-bar.owner-agencia {
    background: linear-gradient(135deg, #7c5cfc, #9b7eff);
}
.bf-gantt-bar.owner-cliente {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.bf-gantt-bar.done {
    opacity: 0.5;
    filter: grayscale(0.4);
}
.bf-gantt-milestone .bf-gantt-label {
    color: var(--accent, #7c5cfc);
    font-weight: 700;
    font-size: 0.68rem;
}
/* Campaign timeline bar (single row with dots) */
.bf-gantt-timeline-bar {
    position: absolute;
    top: 8px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(124,92,252,0.25), rgba(124,92,252,0.15));
    border: 1px solid rgba(124,92,252,0.3);
}
.bf-gantt-timeline-dot {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent, #7c5cfc);
    border: 2px solid rgba(124,92,252,0.5);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px rgba(124,92,252,0.4);
    z-index: 1;
}
.bf-gantt-timeline-label {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--accent, #7c5cfc);
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.bf-gantt-timeline-label.below {
    bottom: auto;
    top: 14px;
}
.bf-gantt-milestone .bf-gantt-label {
    color: var(--text-muted, #6a6a88);
    font-weight: 600;
    font-size: 0.68rem;
    font-style: italic;
}
.bf-gantt-milestone .bf-gantt-track {
    height: 40px;
}
.bf-gantt-milestone {
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
/* Gantt legend */
.bf-gantt-legend {
    display: flex;
    gap: 18px;
    padding: 10px 0 2px;
    margin-top: 6px;
    border-top: 1px solid var(--border, #1a1a30);
}
.bf-gantt-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--text-muted, #6a6a88);
}
.bf-gantt-legend-color {
    display: inline-block;
    width: 14px;
    height: 8px;
    border-radius: 3px;
}
.bf-gantt-legend-color.owner-agencia {
    background: linear-gradient(135deg, #7c5cfc, #9b7eff);
}
.bf-gantt-legend-color.owner-cliente {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

/* ── Share Modal ── */
.bf-share-modal { max-width: 520px; }
.bf-share-modal .bf-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bf-share-section { padding: 4px 0; }

.bf-share-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bf-share-opt label { color: var(--text-secondary, #999); }

.bf-share-generate { font-size: 0.88rem !important; }

/* Share link box */
.bf-share-link-box {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #1a1a30);
    border-radius: 10px;
    padding: 14px;
}
.bf-share-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bf-share-link-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bf-share-link-dot.active { background: #34d399; box-shadow: 0 0 8px #34d39966; }
.bf-share-link-dot.inactive { background: #f87171; }
.bf-share-link-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary, #2b3040);
    font-size: 0.78rem;
    font-family: monospace;
    outline: none;
    cursor: text;
}
.bf-btn-sm {
    padding: 6px 12px !important;
    font-size: 0.72rem !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Approval status */
.bf-share-status-box {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #1a1a30);
    border-radius: 10px;
    padding: 14px;
}
.bf-share-status-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #666);
    margin-bottom: 8px;
}
.bf-share-approval {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}
.bf-share-comment {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-primary, #2b3040);
}

/* Stats */
.bf-share-stats {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #1a1a30);
    border-radius: 10px;
    padding: 14px;
}
.bf-share-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.bf-share-stat {
    text-align: center;
    padding: 10px;
    background: var(--bg, #ffffff);
    border-radius: 8px;
}
.bf-share-stat-num {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent, #7c5cfc);
}
.bf-share-stat-label {
    display: block;
    font-size: 0.66rem;
    color: var(--text-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}
.bf-share-views-list {
    padding-top: 8px;
    border-top: 1px solid var(--border, #1a1a30);
}
.bf-share-view-item {
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

@media (max-width: 768px) {
    .bf-wrap { flex-direction: column; height: auto; }
    .bf-sidebar {
        width: 100%;
        min-width: unset;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border, #1a1a30);
    }
    .bf-editor { padding: 20px 16px 40px; }
    .bf-campaign-name { font-size: 1.2rem; }
    .bf-meta-row { flex-direction: column; }
    .bf-refs-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .bf-header-actions { flex-wrap: wrap; }
    .bf-two-col { grid-template-columns: 1fr; }
    .bf-budget-table-wrap { font-size: 0.72rem; }
    /* Pendientes responsive */
    .bf-checklist-header { display: none; }
    .bf-check-item { flex-wrap: wrap; padding: 10px 8px; gap: 6px; }
    .bf-cl-col-check { width: 28px; }
    .bf-cl-col-text { width: calc(100% - 64px); flex: unset; }
    .bf-cl-col-date { width: calc(50% - 20px); }
    .bf-cl-col-del { position: absolute; right: 8px; top: 10px; }
    .bf-check-item { position: relative; }
    /* Date chips responsive */
    .bf-dates-row { flex-direction: column; }
    .bf-date-chip { min-width: unset; }
}

/* Templates */
.bf-new-brief-wrap{display:flex;gap:4px;align-items:center;}
.bf-new-from-tpl{width:36px !important;min-width:36px !important;padding:0 !important;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.bf-tpl-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;border:1px solid var(--border, #eef0f7);margin-bottom:6px;cursor:default;}
.bf-tpl-item:hover{background:var(--bg-hover, rgba(124,92,252,0.05));}
