/* ═══════════════════════════════════════════════════════════════
   RONDACLICK - MEJORAS ODOO v10.0.0 STYLES
   Timer, Kanban, Activities, Time Reports
   ═══════════════════════════════════════════════════════════════ */

/* ── TIMER FLOTANTE ── */
#timer-floating-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: none;
    animation: timerSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.timer-float-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
    font-family: 'Outfit', sans-serif;
    backdrop-filter: blur(12px);
}
.timer-float-inner > i { font-size: 1.3rem; color: #6366f1; }
.timer-float-info { display: flex; flex-direction: column; gap: 2px; }
.timer-float-task { font-size: 0.8rem; color: #94a3b8; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-float-time { font-size: 1.4rem; font-weight: 700; font-family: 'Courier New', monospace; color: #a5b4fc; letter-spacing: 2px; }
.timer-float-stop {
    width: 36px; height: 36px; border-radius: 50%;
    background: #ef4444; border: none; color: white;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s, background 0.2s;
}
.timer-float-stop:hover { transform: scale(1.1); background: #dc2626; }
.timer-float-pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: #10b981;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes timerSlideIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ── BOTÓN TIMER EN TARJETA DE TAREA ── */
.task-timer-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border: 1.5px solid #e2e8f0; border-radius: 6px;
    background: #f8fafc; color: #1C3A5A; cursor: pointer;
    font-size: 0.78rem; font-family: inherit; font-weight: 600;
    transition: all 0.2s;
}
.task-timer-btn:hover { background: #fff4ed; border-color: #E96A2E; color: #E96A2E; }
.task-timer-btn.active {
    background: #fff4ed;
    border-color: #E96A2E;
    color: #E96A2E;
    animation: timerBtnPulse 2s infinite;
}
.task-timer-btn .timer-display {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 1px;
}

@keyframes timerBtnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(233,106,46,0.3); }
    50% { box-shadow: 0 0 0 5px rgba(233,106,46,0); }
}

/* ── KANBAN BOARD ── */
#leads-kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 500px;
    scroll-snap-type: x mandatory;
}
.kanban-column {
    min-width: 240px;
    max-width: 280px;
    flex-shrink: 0;
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
}
.kanban-col-header {
    padding: 14px 16px 10px;
    border-radius: 12px 12px 0 0;
    background: white;
}
.kanban-col-title {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 0.9rem; color: #1e293b;
}
.kanban-col-count {
    background: #e2e8f0; color: #475569;
    font-size: 0.75rem; font-weight: 600;
    padding: 2px 8px; border-radius: 10px;
}
.kanban-col-budget {
    font-size: 0.8rem; color: #64748b;
    margin-top: 4px; font-weight: 500;
}
.kanban-col-body {
    flex: 1; padding: 8px;
    display: flex; flex-direction: column; gap: 8px;
    overflow-y: auto; max-height: 600px;
    min-height: 80px;
    transition: background 0.2s;
    border-radius: 0 0 12px 12px;
}
.kanban-col-body.kanban-drag-over {
    background: #dbeafe;
    outline: 2px dashed #3b82f6;
    outline-offset: -4px;
}

/* ── KANBAN CARDS ── */
.kanban-card {
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #f1f5f9;
}
.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.kanban-card.kanban-dragging { opacity: 0.5; }
.kanban-card.kanban-ghost { opacity: 0.3; }
.kanban-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 6px;
}
.kanban-card-header strong {
    font-size: 0.9rem; color: #1e293b;
    max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kanban-card-name-link {
    font-size: 0.9rem; font-weight: 700; color: #1C3A5A;
    max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s;
}
.kanban-card-name-link:hover { color: #E96A2E; text-decoration: underline; }
.kanban-card-score {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.kanban-card-company {
    font-size: 0.8rem; color: #64748b; margin-bottom: 4px;
}
.kanban-card-company i { font-size: 0.7rem; margin-right: 4px; }
.kanban-card-budget {
    font-size: 0.85rem; font-weight: 700; color: #1e293b;
    margin-bottom: 6px;
}
.kanban-card-footer {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.75rem; color: #94a3b8;
}
.kanban-card-footer i { font-size: 0.7rem; }
.kanban-card-date { margin-left: auto; }

/* ── TOGGLE TABLA/KANBAN ── */
.view-toggle-bar {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.view-toggle-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.view-toggle-btn.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── ACTIVITY CARDS ── */
.activity-card {
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.activity-card:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── TIME REPORTS ── */
.time-reports-filters {
    display: flex; gap: 12px; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   FASE 2 — VISTAS DE PROYECTO (v8.0.0)
   ═══════════════════════════════════════════════════════════════ */

/* ── PROJECT VIEW TOGGLE ── */
.project-view-toggle {
    display: inline-flex;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.pvt-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #1C3A5A;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 6px;
    text-shadow: none;
}
.pvt-btn:hover { background: rgba(28,58,90,0.1); color: #1C3A5A; }
.pvt-btn.active {
    background: #1C3A5A;
    color: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    text-shadow: none;
}

/* ── FONDOS DE VISTAS ── */
#project-lista-view {
    background: white;
    border-radius: 14px;
    padding: 16px 20px 24px;
    min-height: 400px;
}
#project-calendario-view {
    background: #1C3A5A;
    border-radius: 14px;
    padding: 16px 20px 24px;
    min-height: 400px;
}
#project-gantt-view {
    background: #1C3A5A;
    border-radius: 14px;
    padding: 0;
    min-height: 400px;
    overflow-x: auto;
}

/* ── VISTA LISTA — FILTROS ── */
.lista-filters-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 0 16px;
}
.lista-filter-input {
    padding: 7px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    min-width: 180px;
    flex: 1;
    transition: border-color 0.2s;
}
.lista-filter-input:focus { border-color: #1C3A5A; }
.lista-filter-select {
    padding: 7px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.82rem;
    background: white;
    color: #475569;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}
.lista-filter-select:focus { border-color: #1C3A5A; }
.lista-filter-clear {
    padding: 7px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #94a3b8;
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 5px;
}
.lista-filter-clear:hover { border-color: #ef4444; color: #ef4444; }

/* ── VISTA LISTA — TABLA ── */
.lista-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    font-family: inherit;
}
.lista-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.lista-row {
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}
.lista-row:hover { background: #f8fafc; }
.lista-row td { padding: 10px 14px; font-size: 0.85rem; color: #1e293b; vertical-align: middle; }
.lista-row-done .lista-task-title { text-decoration: line-through; color: #94a3b8; }
.lista-task-title { font-weight: 600; max-width: 260px; }
.lista-sub-badge {
    display: inline-flex;
    margin-left: 6px;
    padding: 1px 6px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    vertical-align: middle;
}
.lista-list-badge {
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 0.78rem;
    color: #475569;
    white-space: nowrap;
}
.lista-priority-badge {
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.lista-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.lista-empty i { font-size: 2rem; margin-bottom: 12px; display: block; }

/* ── VISTA CALENDARIO ── */
.cal-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 0 4px;
}
.cal-nav-btn {
    width: 34px; height: 34px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.cal-nav-btn:hover { border-color: #1C3A5A; color: #1C3A5A; }
.cal-month-title { font-weight: 700; font-size: 1.05rem; color: white; letter-spacing: 0.3px; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
    padding: 2px;
}
.cal-day-header {
    text-align: center;
    padding: 8px 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cal-cell {
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    min-height: 100px;
    padding: 6px;
    transition: background 0.15s;
    cursor: default;
}
.cal-cell-empty { background: transparent; }
.cal-cell-today { background: rgba(233,106,46,0.2); outline: 1.5px solid #E96A2E; }
.cal-cell-has-tasks { background: rgba(255,255,255,0.12); }
.cal-day-num {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin-bottom: 4px;
}
.cal-cell-today .cal-day-num {
    color: #E96A2E;
    font-size: 0.9rem;
}
.cal-tasks { display: flex; flex-direction: column; gap: 2px; }
.cal-task-chip {
    padding: 2px 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background 0.15s;
}
.cal-task-chip:hover { background: rgba(255,255,255,0.3); }
.cal-more { font-size: 0.65rem; color: rgba(255,255,255,0.5); padding: 1px 4px; }

/* ── VISTA GANTT ── */
.gantt-wrap { font-family: inherit; }
.gantt-empty { text-align: center; padding: 60px 20px; color: rgba(255,255,255,0.5); }
.gantt-empty i { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.gantt-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(28,58,90,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1.5px solid rgba(255,255,255,0.1);
}
.gantt-col-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex; align-items: center;
}
.gantt-task-label {
    min-width: 240px;
    max-width: 240px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.gantt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gantt-task-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.gantt-list-name {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
}
.gantt-timeline-header { overflow: hidden; }
.gantt-months-row { display: flex; }
.gantt-month-hdr {
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    text-transform: capitalize;
    border-right: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
    overflow: hidden;
}
.gantt-days-row { display: flex; }
.gantt-day-hdr {
    text-align: center;
    padding: 2px 0;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    border-right: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
}
.gantt-weekend { background: rgba(0,0,0,0.1); }
.gantt-today-col { background: rgba(233,106,46,0.15); color: #E96A2E; font-weight: 700; }
.gantt-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.15s;
}
.gantt-row:hover { background: rgba(255,255,255,0.04); }
.gantt-bars-area { position: relative; height: 36px; flex-shrink: 0; }
.gantt-bar {
    position: absolute;
    top: 6px;
    height: 24px;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-width: 4px;
    transition: opacity 0.2s;
}
.gantt-bar:hover { opacity: 0.85; }
.gantt-bar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    border-radius: 5px 0 0 5px;
    opacity: 0.4;
}
.gantt-bar-label {
    position: relative;
    z-index: 1;
    padding: 0 6px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}
.gantt-today-line {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: #E96A2E;
    opacity: 0.7;
    z-index: 5;
}

/* ── SUBTAREAS ── */
.subtasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.subtasks-progress-badge {
    background: #e0e7ff;
    color: #4338ca;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}
.btn-subtask-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 7px;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-subtask-add:hover { border-color: #1C3A5A; color: #1C3A5A; background: #f8fafc; }

/* Mini-ficha de subtarea */
.subtask-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    transition: all 0.15s;
}
.subtask-card:hover { background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-color: #cbd5e1; }
.subtask-card-done { opacity: 0.7; background: #f0fdf4; border-color: #bbf7d0; }
.subtask-status-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.15s;
    margin-top: 1px;
}
.subtask-status-btn:hover { transform: scale(1.2); }
.subtask-body { flex: 1; min-width: 0; }
.subtask-card-title {
    display: block;
    font-size: 0.87rem;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    cursor: text;
    border-radius: 4px;
    padding: 0 2px;
    transition: background 0.15s;
    line-height: 1.4;
}
.subtask-card-title:focus { background: #e0e7ff; }
.subtask-strikethrough { text-decoration: line-through; color: #94a3b8; }
.subtask-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.subtask-assignee-sel {
    font-size: 0.72rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 2px 5px;
    background: white;
    color: #475569;
    cursor: pointer;
    max-width: 120px;
    font-family: inherit;
}
.subtask-due-input {
    font-size: 0.72rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 2px 5px;
    background: white;
    color: #475569;
    cursor: pointer;
    font-family: inherit;
}
.subtask-due-badge {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
}
.subtask-due-badge.overdue { color: #ef4444; }
.subtask-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}
.subtask-card:hover .subtask-delete-btn { opacity: 1; }
.subtask-delete-btn:hover { color: #ef4444; background: #fee2e2; }

/* Add row inline */
.subtask-add-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #f0f9ff;
    border: 1.5px solid #bae6fd;
    border-radius: 9px;
}
.subtask-status-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-open { background: #e2e8f0; border: 2px solid #94a3b8; }
.subtask-inline-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.87rem;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    min-width: 80px;
}
.subtask-date-input {
    font-size: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 3px 6px;
    font-family: inherit;
    background: white;
    color: #475569;
}

/* ── ADJUNTOS ── */
.attachments-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: 0.83rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-wrap: wrap;
    text-align: center;
}
.attachments-dropzone i { font-size: 1.4rem; color: #cbd5e1; }
.attachments-dropzone.dz-over { border-color: #E96A2E; background: #fff4ed; color: #E96A2E; }
.dz-browse-btn {
    color: #1C3A5A;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}
.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: background 0.15s;
}
.attachment-item:hover { background: #f1f5f9; }
.att-info { flex: 1; min-width: 0; }
.att-name { font-size: 0.84rem; color: #1e40af; text-decoration: none; font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-name:hover { text-decoration: underline; }
.att-size { font-size: 0.7rem; color: #94a3b8; }
.att-pending-badge { font-size: 0.68rem; color: #f59e0b; font-weight: 600; margin-left: 6px; }
.att-pending { border-color: #fde68a; background: #fffbeb; }

/* ── CHATTER TABS ── */
.chatter-tabs {
    display: flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 12px;
}
.chatter-tab-btn {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.chatter-tab-btn.active { background: white; color: #1C3A5A; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.chatter-comment-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}
.chatter-textarea-side {
    width: 100%;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 60px;
    border: 1.5px solid #e2e8f0;
    font-family: inherit;
    font-size: 0.83rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.chatter-textarea-side:focus { border-color: #1C3A5A; }
.activity-item-system { opacity: 0.75; }
.activity-item-system .activity-body p { font-style: italic; color: #64748b; }

/* ═══════════════════════════════════════════════════════════
   FASE 5 — FACTURACIÓN & CONTABILIDAD
   ═══════════════════════════════════════════════════════════ */

/* F33 — Alerta de vencimiento */
.billing-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: 10px;
    padding: 12px 16px;
}
.billing-alert-icon { color: #f97316; font-size: 1.3rem; margin-top: 2px; flex-shrink: 0; }
.billing-alert-content { flex: 1; }
.billing-alert-content strong { color: #9a3412; font-size: 0.9rem; display: block; margin-bottom: 6px; }
.billing-alert-list { display: flex; flex-wrap: wrap; gap: 6px; }
.billing-alert-item {
    background: white;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.8rem;
    color: #64748b;
    transition: background 0.15s;
}
.billing-alert-item:hover { background: #fff1e6; }

/* F32 — Panel de pagos parciales */
.payments-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 4px;
}
.payments-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.payments-panel-header h4 { margin: 0; font-size: 0.95rem; color: #1e293b; }
.payments-status {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.payments-status.status-cobrada { background: #d1fae5; color: #065f46; }
.payments-status.status-pendiente { background: #fee2e2; color: #991b1b; }
.payments-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}
.payments-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.payments-amounts {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 12px;
}
.payments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 8px;
}
.payments-table th {
    background: #f8fafc;
    padding: 6px 10px;
    text-align: left;
    color: #475569;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}
.payments-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

/* F36 — Previsión de tesorería */
#treasury-forecast-panel .panel-body { padding: 16px; }
#treasury-chart-container canvas { max-width: 100%; }

/* F40 — Analítica de proyecto */
.analytics-margin-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* F38/F39 — Totales de factura preview */
#invoice-totals-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
}
.inv-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.88rem;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}
.inv-total-row:last-child { border-bottom: none; }
.inv-total-final {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
}

/* F30 — Botón Odoo deshabilitado */
#btn-odoo-facturas,
#btn-odoo-contabilidad { transition: opacity 0.2s; }


/* ============================================================
   FASE 6 — Documentos & Firma
   ============================================================ */

/* --- Vista principal documentos --- */
.doc-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.doc-toolbar input[type="text"],
.doc-toolbar select {
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
}
.doc-toolbar input[type="text"]:focus,
.doc-toolbar select:focus {
    border-color: #2A5298;
    background: #fff;
}
.documents-grid {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Sección por carpeta --- */
.doc-folder-section { }
.doc-folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
}
.doc-folder-count {
    background: #e2e8f0;
    color: #475569;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: auto;
}
.doc-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* --- Tarjeta de documento --- */
.doc-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.18s, border-color 0.18s;
    cursor: pointer;
    position: relative;
}
.doc-card:hover {
    box-shadow: 0 4px 16px rgba(42,82,152,0.10);
    border-color: #2A5298;
}
.doc-card-icon {
    font-size: 2rem;
    text-align: center;
    padding: 4px 0;
}
.doc-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.doc-card-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
    word-break: break-all;
    line-height: 1.3;
}
.doc-card-meta {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.doc-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.doc-action-btn {
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 0.75rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.doc-action-btn:hover {
    background: #2A5298;
    color: #fff;
    border-color: #2A5298;
}
.doc-action-btn.danger:hover {
    background: #ef4444;
    border-color: #ef4444;
}

/* --- Badges de firma --- */
.doc-sig-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.doc-sig-badge.signed  { background: #dcfce7; color: #16a34a; }
.doc-sig-badge.sent    { background: #fef3c7; color: #d97706; }
.doc-sig-badge.pending { background: #f1f5f9; color: #64748b; }

/* --- Estado vacío --- */
.doc-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
    font-size: 0.9rem;
}
.doc-empty-state i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* --- Documentos en perfil de cliente --- */
.doc-folder-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.doc-folder-tab {
    padding: 5px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    background: #f8fafc;
    color: #475569;
    transition: all 0.15s;
}
.doc-folder-tab:hover,
.doc-folder-tab.active {
    background: #2A5298;
    color: #fff;
    border-color: #2A5298;
}
.client-doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    margin-bottom: 6px;
    transition: box-shadow 0.15s;
}
.client-doc-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.client-doc-info { flex: 1; min-width: 0; }
.client-doc-name {
    font-weight: 600;
    font-size: 0.84rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.client-doc-meta {
    font-size: 0.73rem;
    color: #94a3b8;
}

/* --- Dropzone de carga --- */
.doc-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 32px;
    text-align: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
}
.doc-dropzone:hover,
.doc-dropzone.dragover {
    border-color: #2A5298;
    background: rgba(42,82,152,0.05);
    color: #2A5298;
}
.doc-dropzone.has-file {
    border-color: #22c55e;
    background: rgba(34,197,94,0.05);
    color: #16a34a;
}
.doc-upload-file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.84rem;
    color: #16a34a;
}
.doc-upload-file-preview i { font-size: 1.2rem; }

/* --- Versiones --- */
.doc-version-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.doc-version-row:last-child { border-bottom: none; }
.doc-version-badge {
    background: #e2e8f0;
    color: #475569;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    margin-top: 2px;
}
.doc-version-latest {
    background: #dbeafe;
    color: #2563eb;
}
.doc-version-info {
    flex: 1;
    font-size: 0.84rem;
    color: #1e293b;
}
.doc-version-info small {
    display: block;
    color: #94a3b8;
    font-size: 0.75rem;
    margin-top: 2px;
}

/* --- Editor de plantillas --- */
.template-sidebar-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.87rem;
    color: #1e293b;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.template-sidebar-item:hover { background: #f1f5f9; }
.template-sidebar-item.active {
    background: #dbeafe;
    color: #2563eb;
    font-weight: 600;
}
.tpl-var-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #ede9fe;
    color: #7c3aed;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: monospace;
}
.tpl-var-chip:hover { background: #7c3aed; color: #fff; }

/* ============================================================
   FASE 8 — Planificación & Recursos (F53–F56)
   ============================================================ */

/* --- Tabs de planificación --- */
.planning-tabs {
    display: flex;
    gap: 4px;
    margin: 16px 0 0;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}
.planning-tab {
    padding: 9px 18px;
    border: none;
    background: none;
    font-size: 0.88rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.planning-tab:hover { color: #1e293b; background: #f1f5f9; }
.planning-tab.active {
    color: #2A5298;
    font-weight: 700;
    border-bottom-color: #2A5298;
    background: #eff6ff;
}
.planning-tab-content { padding: 4px 0; }

/* --- Controles de navegación --- */
.planning-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

/* --- F53: Availability grid --- */
.avail-grid-wrap { overflow-x: auto; margin-bottom: 12px; }
.avail-table {
    border-collapse: collapse;
    min-width: 100%;
    font-size: 0.82rem;
}
.avail-table thead th { position: sticky; top: 0; z-index: 1; background: #fff; }
.avail-tech-col {
    min-width: 190px;
    width: 190px;
    padding: 8px 12px;
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 3;
    border-right: 1px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
}
.avail-day-hdr {
    min-width: 42px;
    width: 42px;
    text-align: center;
    padding: 6px 2px;
    border-bottom: 2px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    color: #475569;
    background: #fff;
}
.avail-day-hdr.avail-weekend  { background: #f9f9fb; }
.avail-day-hdr.avail-today-hdr { background: #dbeafe; color: #2A5298; font-weight: 700; }
.avail-day-name { font-size: 0.68rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; }
.avail-day-num  { font-size: 0.82rem; font-weight: 700; }

.avail-tech-cell {
    padding: 8px 12px;
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
}
.avail-tech-info { display: flex; align-items: center; gap: 8px; }
.avail-avatar {
    width: 32px; height: 32px; min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2A5298, #3b82f6);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700;
}
.avail-tech-name { font-weight: 600; font-size: 0.84rem; color: #1e293b; }
.avail-tech-role { font-size: 0.72rem; color: #94a3b8; }

.avail-cell {
    width: 42px; min-width: 42px;
    height: 40px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    text-align: center;
    transition: filter 0.15s;
}
.avail-cell:hover { filter: brightness(0.93); }
.avail-weekend-cell { background: #f9f9fb; cursor: default; }
.avail-past { opacity: 0.55; }

.avail-free   { background: #f0fdf4; }
.avail-light  { background: #dcfce7; }
.avail-medium { background: #fef9c3; }
.avail-full   { background: #fee2e2; }

.avail-bar {
    height: 3px;
    background: currentColor;
    position: absolute;
    bottom: 3px; left: 4px;
    border-radius: 2px;
    opacity: 0.5;
}
.avail-free   .avail-bar { color: #22c55e; }
.avail-light  .avail-bar { color: #86efac; }
.avail-medium .avail-bar { color: #facc15; }
.avail-full   .avail-bar { color: #f87171; }

.avail-load-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: #475569;
    display: block;
    line-height: 1;
    margin-top: 6px;
}
.avail-task-badge {
    position: absolute;
    top: 3px; right: 3px;
    background: #2A5298;
    color: #fff;
    border-radius: 8px;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 1px 4px;
    line-height: 1.3;
}

.avail-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 8px 4px;
    font-size: 0.78rem;
    color: #64748b;
    flex-wrap: wrap;
}
.avail-legend-item { display: flex; align-items: center; gap: 5px; }
.avail-dot {
    width: 12px; height: 12px; border-radius: 3px;
    display: inline-block;
}
.avail-dot.avail-free   { background: #f0fdf4; border: 1px solid #86efac; }
.avail-dot.avail-light  { background: #dcfce7; border: 1px solid #4ade80; }
.avail-dot.avail-medium { background: #fef9c3; border: 1px solid #facc15; }
.avail-dot.avail-full   { background: #fee2e2; border: 1px solid #f87171; }

/* --- F54: Resource Planning --- */
.rp-row { transition: background 0.1s; }
.rp-row:hover { background: #fafbfc; }
.rp-tech-label { transition: box-shadow 0.1s; }

/* --- Popover --- */
.planning-popover {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.planning-popover-inner {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-width: 380px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.planning-popover-close {
    position: absolute; top: 10px; right: 10px;
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 1rem; padding: 4px;
}
.planning-popover-close:hover { color: #ef4444; }

/* --- F55: Meetings --- */
.meetings-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    margin-top: 16px;
}
@media (max-width: 900px) {
    .meetings-layout { grid-template-columns: 1fr; }
    .meetings-sidebar { order: -1; }
}
.meeting-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.meeting-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); border-color: #cbd5e1; }
.meeting-card.meeting-past { opacity: 0.6; }
.meeting-card-date {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 6px 10px;
    text-align: center;
    min-width: 46px;
}
.meeting-card-day   { font-size: 1.2rem; font-weight: 700; color: #2A5298; line-height: 1; }
.meeting-card-month { font-size: 0.7rem; color: #64748b; text-transform: uppercase; font-weight: 600; }
.meeting-card-body  { flex: 1; min-width: 0; }
.meeting-card-title { font-weight: 700; font-size: 0.92rem; color: #1e293b; margin-bottom: 4px; }
.meeting-card-meta  { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.78rem; color: #64748b; }
.meeting-card-meta span { display: flex; align-items: center; gap: 4px; }
.meeting-card-desc  { font-size: 0.78rem; color: #94a3b8; margin-top: 5px; }
.meeting-card-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

/* --- F56: Google Calendar --- */
.gcal-connected-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 10px;
}
.gcal-config-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 4px;
}
.gcal-info-box {
    margin-top: 18px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.78rem;
    color: #64748b;
}

/* --- Empty state (shared) --- */
.planning-empty {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
    font-size: 0.9rem;
}
.planning-empty i { font-size: 2.5rem; display: block; margin-bottom: 10px; opacity: 0.4; }

/* --- iCal import --- */
.ical-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.7rem;
    font-weight: 700;
}
.ical-add-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.ical-add-row .form-control { padding: 7px 11px; font-size: 0.84rem; }
.ical-feed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #fff;
    transition: box-shadow 0.15s;
}
.ical-feed-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.ical-feed-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.ical-event-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}
.ical-event-row:last-child { border-bottom: none; }
.ical-event-row.ical-event-past { opacity: 0.55; }
.ical-event-dot {
    width: 8px; height: 8px; min-width: 8px;
    border-radius: 50%;
    background: #f59e0b;
    margin-top: 6px;
}
.ical-event-body { flex: 1; min-width: 0; }
.ical-event-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ical-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.75rem;
    color: #64748b;
}
.ical-event-meta span { display: flex; align-items: center; gap: 4px; }
.ical-event-desc {
    font-size: 0.73rem;
    color: #94a3b8;
    margin-top: 3px;
    white-space: pre-wrap;
}

/* --- Agenda: chips de reuniones y eventos iCal --- */
.agenda-chip {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.68rem;
    cursor: pointer;
    margin-bottom: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: opacity 0.15s;
}
.agenda-chip:hover { opacity: 0.8; }
.agenda-chip i { font-size: 0.6rem; flex-shrink: 0; }

.agenda-chip-meeting {
    background: #f5f3ff;
    color: #7c3aed;
    border-left: 3px solid #8b5cf6;
}
.agenda-chip-ical {
    background: #fffbeb;
    color: #92400e;
    border-left: 3px solid #f59e0b;
}

/* --- Agenda: filas del panel de día --- */
.agenda-day-event-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.12s;
}
.agenda-day-event-row:hover { background: #f8fafc; }
.agenda-day-event-row:last-child { border-bottom: none; }

/* ════════════════════════════════════════════════════════════
   FASE 7 — RRHH & Equipo  (F47–F52)
   ════════════════════════════════════════════════════════════ */

/* ── Tabs ─────────────────────────────────────────────────── */
.hr-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e2e8f0;
    margin-top: 8px;
    padding-bottom: 0;
}
.hr-tab {
    padding: 9px 16px;
    border: none;
    background: none;
    font-size: 0.84rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.hr-tab:hover  { color: #2A5298; background: #f1f5f9; }
.hr-tab.active { color: #2A5298; border-bottom-color: #2A5298; background: #fff; }
.hr-tab-content { display: block; }

/* ── KPI row ──────────────────────────────────────────────── */
.hr-kpi-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.hr-kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 20px;
    min-width: 120px;
    text-align: center;
    flex: 1;
}
.hr-kpi-val   { font-size: 1.6rem; font-weight: 800; color: #1e293b; line-height: 1; }
.hr-kpi-label { font-size: 0.72rem; color: #94a3b8; margin-top: 4px; }

/* ── F47: Employee card grid ──────────────────────────────── */
.hr-emp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.hr-emp-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
}
.hr-emp-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); transform: translateY(-2px); }

.hr-emp-card-header {
    padding: 20px 16px 14px;
    text-align: center;
}
.hr-emp-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 10px;
}
.hr-emp-card-name  { font-weight: 700; font-size: 0.95rem; color: #1e293b; }
.hr-emp-card-role  { font-size: 0.75rem; color: #64748b; margin-top: 2px; }
.hr-dept-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}
.hr-emp-card-stats {
    display: flex;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}
.hr-emp-stat {
    flex: 1;
    padding: 10px 6px;
    text-align: center;
    border-right: 1px solid #f1f5f9;
}
.hr-emp-stat:last-child { border-right: none; }
.hr-emp-stat-val   { font-size: 1.1rem; font-weight: 800; color: #1e293b; display: block; }
.hr-emp-stat-label { font-size: 0.65rem; color: #94a3b8; }
.hr-emp-card-footer {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hr-contract-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 20px;
}

/* ── Employee modal inner tabs ────────────────────────────── */
.hr-emp-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 0;
}
.hr-emp-tab {
    padding: 7px 14px;
    border: none;
    background: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 4px 4px 0 0;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.hr-emp-tab:hover  { color: #2A5298; background: #f8fafc; }
.hr-emp-tab.active { color: #2A5298; border-bottom-color: #2A5298; background: #fff; }

/* ── F48: Vacaciones ──────────────────────────────────────── */
.hr-vac-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.hr-vac-row:last-child { border-bottom: none; }
.hr-vac-color-bar {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}
.hr-vac-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}
.hr-status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── F50: Organigrama ─────────────────────────────────────── */
.org-chart-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.org-dept-block {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.org-dept-label {
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.org-dept-members {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
}
.org-node {
    text-align: center;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 10px;
    transition: background 0.15s;
    min-width: 100px;
    border: 1px solid #f1f5f9;
}
.org-node:hover { background: #f8fafc; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.org-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 8px;
}
.org-name { font-size: 0.8rem; font-weight: 700; color: #1e293b; }
.org-role { font-size: 0.68rem; color: #94a3b8; margin-top: 2px; }

/* ── F51: OKRs ────────────────────────────────────────────── */
.hr-okr-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.hr-okr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.hr-okr-progress-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: conic-gradient(var(--col) calc(var(--prog) * 1%), #e2e8f0 0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--col);
    position: relative;
}
.hr-okr-progress-ring::before {
    content: '';
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
}
.hr-okr-progress-ring span { position: relative; z-index: 1; }

.hr-kr-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px solid #f8fafc;
    font-size: 0.82rem;
}
.hr-okr-emp-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.12s;
    border-radius: 6px;
    padding-left: 8px;
}
.hr-okr-emp-row:hover { background: #f8fafc; }
.hr-okr-emp-row:last-child { border-bottom: none; }

/* OKR form KR rows */
.hr-kr-form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f8fafc;
}
.hr-kr-form-row .form-control { padding: 6px 8px; font-size: 0.82rem; }

/* ── F52: Onboarding ──────────────────────────────────────── */
.hr-onboard-emp-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 6px;
}
.hr-onboard-emp-row:last-child { border-bottom: none; }
.hr-onboard-emp-row:hover { background: #f8fafc; }

.hr-onboard-task {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.84rem;
    color: #1e293b;
    background: #fff;
}
.hr-onboard-task:hover { background: #f8fafc; }
.hr-onboard-task.done  { color: #94a3b8; text-decoration: line-through; background: #f8fafc; border-color: #f1f5f9; }
.hr-onboard-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.65rem;
    color: #22c55e;
    transition: border-color 0.12s, background 0.12s;
}
.hr-onboard-task.done .hr-onboard-check {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.hr-vac-list { display: flex; flex-direction: column; }

/* ══════════════════════════════════════════════════════════════
   FASE 3 — Timesheets & Tiempo
   ══════════════════════════════════════════════════════════════ */

/* Tab buttons */
.ts-tab-btn { transition: color 0.15s, border-color 0.15s; }
.ts-tab-btn.active {
    color: var(--color-primary, #6366f1) !important;
    border-bottom-color: var(--color-primary, #6366f1) !important;
}
.ts-tab-btn:hover { color: #334155 !important; }

/* Weekly grid */
.ts-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}
.ts-grid th {
    background: #f8fafc;
    padding: 8px 10px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.ts-col-project { text-align: left !important; min-width: 140px; }
.ts-col-day { min-width: 80px; }
.ts-col-total { background: #f1f5f9 !important; font-weight: 700 !important; }
.ts-today { background: #ede9fe !important; color: #5b21b6 !important; }
.ts-weekend { background: #fafafa !important; color: #94a3b8 !important; }
.ts-cell {
    text-align: center;
    padding: 6px 4px;
    border: 1px solid #f1f5f9;
    cursor: pointer;
    min-height: 38px;
    vertical-align: middle;
    transition: background 0.12s;
}
.ts-cell:hover { background: #f0f9ff; }
.ts-cell-has-entry { background: #ede9fe; cursor: pointer; }
.ts-cell-has-entry:hover { background: #ddd6fe; }
.ts-cell-locked { cursor: default; background: #f8fafc; }
.ts-cell-locked:hover { background: #f8fafc; }
.ts-cell-val { font-weight: 700; color: #5b21b6; font-size: 0.82rem; }
.ts-cell-add { color: #c4b5fd; font-size: 1.1rem; font-weight: 300; }
.ts-cell-project { padding: 8px 12px; font-weight: 600; color: #334155; text-align: left; border: 1px solid #f1f5f9; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-cell-row-total { text-align: center; font-weight: 700; background: #f8fafc; color: #334155; border: 1px solid #f1f5f9; padding: 6px 10px; }
.ts-cell-day-total { text-align: center; font-weight: 600; background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; padding: 6px 8px; }
.ts-cell-grand-total { text-align: center; font-weight: 700; background: #ede9fe; color: #5b21b6; border: 1px solid #e2e8f0; padding: 6px 10px; }
.ts-cell-total-label { text-align: left; padding: 6px 12px; background: #f8fafc; font-weight: 600; font-size: 0.8rem; color: #64748b; border: 1px solid #e2e8f0; }
.ts-totals-row td { border-top: 2px solid #e2e8f0; }
.ts-add-row td { border-top: 2px dashed #e2e8f0; }

/* Entry list */
.ts-entry-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.82rem;
    flex-wrap: wrap;
}
.ts-entry-row:last-child { border-bottom: none; }
.ts-entry-row:hover { background: #f8fafc; }
.ts-entry-locked { opacity: 0.65; }
.ts-entry-date { color: #64748b; white-space: nowrap; min-width: 85px; }
.ts-entry-project { padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.ts-entry-person { color: #64748b; white-space: nowrap; }
.ts-entry-desc { flex: 1; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 80px; }
.ts-entry-hours { font-weight: 700; color: #5b21b6; white-space: nowrap; }
.ts-entry-billable { color: #10b981; font-size: 0.8rem; }

/* Workload cards */
#view-time-reports {
    width: 100%;
}
#ts-panel-workload {
    width: 100%;
    min-height: calc(100vh - var(--topbar-height) - 190px);
}
#ts-workload-body {
    display: grid !important;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)) !important;
    gap: 16px !important;
    align-items: start;
}
.ts-workload-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.ts-wl-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}
.ts-wl-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.ts-wl-info { flex: 1; }
.ts-budget-badge { display: inline-flex; align-items: center; gap: 4px; }

/* Pause button */
.atc-btn-pause {
    display: none;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    gap: 6px;
    align-items: center;
    transition: all 0.15s;
}
.atc-btn-pause:hover { background: #f1f5f9; }
.timer-running ~ * .atc-btn-pause,
.atc-btn-pause.visible { display: flex !important; }

/* ══════════════════════════════════════════════════════════════
   FASE 4 — Comunicación Interna
   ══════════════════════════════════════════════════════════════ */

/* Announcement cards */
.chat-announcement-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.15s;
}
.chat-announcement-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.chat-pinned { border-left: 4px solid #6366f1; }

.chat-msg-header { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
}

/* Reaction buttons */
.chat-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.78rem;
    color: #475569;
    transition: background 0.1s;
}
.chat-reaction-btn:hover { background: #ede9fe; border-color: #c4b5fd; }
.chat-reaction-btn.reacted { background: #ede9fe; border-color: #a5b4fc; color: #5b21b6; }
.chat-add-reaction { font-size: 0.75rem !important; }

/* Chat messages */
.chat-msg-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    max-width: 80%;
}
.chat-msg-row.chat-own { flex-direction: row-reverse; align-self: flex-end; max-width: 80%; margin-left: auto; }
.chat-bubble-wrap { display: flex; flex-direction: column; gap: 2px; }
.chat-author-name { font-size: 0.75rem; font-weight: 600; color: #64748b; margin-bottom: 2px; }
.chat-bubble {
    background: #f1f5f9;
    border-radius: 16px 16px 16px 4px;
    padding: 10px 14px;
    font-size: 0.87rem;
    line-height: 1.45;
    color: #1e293b;
    word-break: break-word;
}
.chat-bubble-own {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
}
.chat-bubble-own a { color: #c7d2fe; }
.chat-msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #94a3b8;
    padding: 0 4px;
}
.chat-delete-btn {
    background: none;
    border: none;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.15s;
}
.chat-msg-row:hover .chat-delete-btn { opacity: 1; color: #ef4444; }
.chat-mention { color: #6366f1; font-weight: 600; }
.chat-empty { text-align: center; padding: 48px; color: #94a3b8; }
.chat-empty i { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.chat-channel-btn { transition: background 0.12s, color 0.12s; }

/* Notification rows */
.chat-notif-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
    margin-bottom: 4px;
    position: relative;
}
.chat-notif-row:hover { background: #f8fafc; }
.notif-unread { background: #fafbff; }
.notif-read { opacity: 0.7; }
.chat-notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.chat-notif-content { flex: 1; }
.chat-notif-title { font-weight: 600; font-size: 0.87rem; color: #1e293b; margin-bottom: 2px; }
.chat-notif-msg { font-size: 0.8rem; color: #64748b; margin-bottom: 3px; }
.chat-notif-time { font-size: 0.72rem; color: #94a3b8; }
.chat-notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
    flex-shrink: 0;
    margin-top: 4px;
}
