/* ============================================================
   productividad.css  —  Modulo Productividad
   Estilos para Kanban, tarjetas de equipo, actividades
   ============================================================ */

/* ── Variables del modulo ──────────────────────────────────── */
:root {
    --prod-bg: #f6f7fa;
    --prod-card-radius: 10px;
    --prod-shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --prod-shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --prod-shadow-hover: 0 6px 20px rgba(0,0,0,.12);
    --prod-transition: all 0.25s cubic-bezier(.4,0,.2,1);
    --prod-accent: var(--secundario, #fe7800);
    --prod-primary: var(--primario, #284A70);
    --prod-success: #22c55e;
    --prod-warning: #f59e0b;
    --prod-danger: #ef4444;
    --prod-muted: #94a3b8;
    --prod-border: #e2e8f0;
    --prod-bg-subtle: #f8fafc;
}

/* ── Mis Equipos - Grid de tarjetas ───────────────────────── */
.prod-equipos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    padding: 16px 0;
}

.prod-equipo-card {
    background: #fff;
    border-radius: var(--prod-card-radius);
    box-shadow: var(--prod-shadow-sm);
    border: 1px solid var(--prod-border);
    overflow: hidden;
    transition: var(--prod-transition);
    display: flex;
    flex-direction: column;
}

    .prod-equipo-card:hover {
        box-shadow: var(--prod-shadow-hover);
        transform: translateY(-2px);
    }

.prod-equipo-accent {
    height: 4px;
    border-radius: var(--prod-card-radius) var(--prod-card-radius) 0 0;
}

.prod-equipo-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.prod-equipo-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.prod-equipo-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.prod-equipo-modulo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--prod-muted);
    background: var(--prod-bg-subtle);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.prod-equipo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.prod-equipo-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
}

    .prod-equipo-count .count-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 24px;
        padding: 0 7px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 700;
        color: #fff;
    }

.prod-btn-ver {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--prod-transition);
    color: #fff;
}

    .prod-btn-ver:hover {
        filter: brightness(0.9);
        transform: translateX(2px);
    }

    .prod-btn-ver i {
        font-size: 0.7rem;
        transition: transform 0.2s ease;
    }

    .prod-btn-ver:hover i {
        transform: translateX(3px);
    }

/* Dropdown de acciones del equipo */
.prod-equipo-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--prod-border);
    background: #fff;
    color: #64748b;
    transition: var(--prod-transition);
}

    .prod-equipo-actions .btn:hover {
        background: var(--prod-bg-subtle);
        color: var(--prod-primary);
    }

/* ── Kanban Board ─────────────────────────────────────────── */
.prod-kanban-container {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

    .prod-kanban-container::-webkit-scrollbar {
        height: 6px;
    }

    .prod-kanban-container::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 3px;
    }

.prod-kanban-column {
    min-width: 300px;
    max-width: 340px;
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    border-radius: var(--prod-card-radius);
    height: 100%;
    transition: var(--prod-transition);
}

.prod-kanban-column-header {
    padding: 12px 14px;
    border-radius: var(--prod-card-radius) var(--prod-card-radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.prod-kanban-column-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prod-kanban-column-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255,255,255,.25);
}

.prod-kanban-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.15) transparent;
}

    .prod-kanban-column-body::-webkit-scrollbar {
        width: 4px;
    }

    .prod-kanban-column-body::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,.15);
        border-radius: 2px;
    }

.prod-kanban-column-footer {
    padding: 8px;
    flex-shrink: 0;
}

.prod-kanban-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    border: 2px dashed rgba(0,0,0,.12);
    border-radius: 8px;
    background: transparent;
    color: rgba(0,0,0,.4);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--prod-transition);
}

    .prod-kanban-add-btn:hover {
        border-color: var(--prod-accent);
        color: var(--prod-accent);
        background: rgba(254, 120, 0, .04);
    }

/* ── Activity Card (dentro del Kanban) ────────────────────── */
.prod-activity-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--prod-shadow-sm);
    border: 1px solid rgba(0,0,0,.06);
    padding: 12px;
    cursor: pointer;
    transition: var(--prod-transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .prod-activity-card:hover {
        box-shadow: var(--prod-shadow-md);
        border-color: rgba(0,0,0,.1);
    }

    .prod-activity-card.dragging {
        opacity: 0.5;
        transform: rotate(2deg) scale(1.02);
    }

.prod-activity-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.prod-activity-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
}

    .prod-activity-date i {
        font-size: 0.65rem;
    }

.prod-activity-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

    .prod-activity-status.status-open {
        background: #dbeafe;
        color: #1d4ed8;
    }

    .prod-activity-status.status-closed {
        background: #dcfce7;
        color: #15803d;
    }

.prod-activity-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prod-activity-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.prod-activity-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #64748b;
    background: #f8fafc;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

    .prod-activity-tag i {
        font-size: 0.6rem;
        opacity: 0.7;
    }

.prod-activity-ref {
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
}

    .prod-activity-ref:hover {
        text-decoration: underline;
        color: #2563eb;
    }

.prod-activity-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

/* Prioridad estrellas */
.prod-priority {
    display: inline-flex;
    gap: 1px;
}

    .prod-priority .star {
        color: #e2e8f0;
        font-size: 0.75rem;
    }

    .prod-priority .star.active {
        color: #f59e0b;
    }

/* Barra de progreso del checklist */
.prod-progress-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.prod-progress-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: fit-content;
}

    .prod-progress-info i {
        font-size: 0.7rem;
    }

    .prod-progress-info.complete {
        color: var(--prod-success);
        background: #dcfce7;
        padding: 2px 7px;
        border-radius: 4px;
    }

.prod-progress-track {
    flex: 1;
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.prod-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    background: var(--prod-primary);
}

    .prod-progress-fill.complete {
        background: var(--prod-success);
    }

.prod-progress-pct {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--prod-muted);
    min-width: 30px;
    text-align: right;
}

/* Avatar del usuario */
.prod-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #64748b;
}

.prod-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--prod-primary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Actions button dentro de card */
.prod-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.prod-card-action-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--prod-transition);
}

    .prod-card-action-btn:hover {
        background: #f1f5f9;
        color: #475569;
    }

/* Task clock indicator */
.prod-task-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--prod-transition);
    font-size: 0.85rem;
}

    .prod-task-indicator.overdue {
        color: var(--prod-danger);
        background: #fef2f2;
    }

    .prod-task-indicator.warning {
        color: var(--prod-warning);
        background: #fffbeb;
    }

    .prod-task-indicator.ontime {
        color: var(--prod-success);
        background: #f0fdf4;
    }

    .prod-task-indicator.empty {
        color: #cbd5e1;
        background: #f8fafc;
    }

    .prod-task-indicator:hover {
        transform: scale(1.1);
    }

/* ── Filtros mejorados ────────────────────────────────────── */
.prod-filter-panel {
    background: #fff;
    border: 1px solid var(--prod-border);
    border-radius: var(--prod-card-radius);
    box-shadow: var(--prod-shadow-md);
    padding: 16px;
    min-width: 280px;
    position: absolute;
    z-index: 100;
    top: 100%;
    left: 0;
    margin-top: 4px;
    display: none;
}

    .prod-filter-panel.show {
        display: block;
    }

.prod-filter-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--prod-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--prod-border);
}

.prod-filter-group {
    margin-bottom: 10px;
}

    .prod-filter-group label {
        font-size: 0.75rem;
        font-weight: 600;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        margin-bottom: 4px;
        display: block;
    }

    .prod-filter-group select {
        width: 100%;
        padding: 6px 10px;
        border: 1px solid var(--prod-border);
        border-radius: 6px;
        font-size: 0.82rem;
        color: #334155;
        background: #fff;
        transition: border-color 0.2s;
    }

        .prod-filter-group select:focus {
            outline: none;
            border-color: var(--prod-primary);
            box-shadow: 0 0 0 2px rgba(40,74,112,.1);
        }

.prod-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--prod-border);
}

/* ── Toolbar del Tablero ──────────────────────────────────── */
.prod-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.prod-search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--prod-border);
    border-radius: 8px;
    padding: 0 2px 0 10px;
    min-width: 280px;
    transition: border-color 0.2s;
}

    .prod-search-box:focus-within {
        border-color: var(--prod-primary);
        box-shadow: 0 0 0 2px rgba(40,74,112,.08);
    }

    .prod-search-box i {
        color: var(--prod-muted);
        font-size: 0.85rem;
    }

    .prod-search-box input {
        border: none;
        outline: none;
        padding: 7px 8px;
        font-size: 0.85rem;
        flex: 1;
        background: transparent;
    }

    .prod-search-box .btn {
        border-radius: 6px;
    }

.prod-btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--prod-border);
    border-radius: 8px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: var(--prod-transition);
    position: relative;
}

    .prod-btn-filter:hover {
        background: var(--prod-bg-subtle);
        border-color: #cbd5e1;
    }

    .prod-btn-filter.active {
        background: rgba(40,74,112,.06);
        border-color: var(--prod-primary);
        color: var(--prod-primary);
    }

.prod-btn-new {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: var(--prod-accent);
    color: #fff;
    cursor: pointer;
    transition: var(--prod-transition);
}

    .prod-btn-new:hover {
        filter: brightness(0.92);
        color: #fff;
    }

/* ── Empty state ──────────────────────────────────────────── */
.prod-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--prod-muted);
}

    .prod-empty-state i {
        font-size: 2.5rem;
        margin-bottom: 12px;
        opacity: 0.4;
    }

    .prod-empty-state p {
        font-size: 0.9rem;
        font-weight: 500;
        margin: 0;
    }

/* ── Modals mejorados ─────────────────────────────────────── */
.prod-modal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

.prod-modal .modal-header {
    background: var(--prod-bg-subtle);
    border-bottom: 1px solid var(--prod-border);
    padding: 14px 20px;
    border-radius: 12px 12px 0 0;
}

.prod-modal .modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--prod-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.prod-modal .modal-body {
    padding: 20px;
}

.prod-modal .modal-footer {
    border-top: 1px solid var(--prod-border);
    padding: 12px 20px;
    background: var(--prod-bg-subtle);
    border-radius: 0 0 12px 12px;
}

/* Tab navigation dentro del modal */
.prod-modal-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--prod-border);
    margin-bottom: 16px;
}

.prod-modal-tab {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--prod-transition);
}

    .prod-modal-tab:hover {
        color: var(--prod-primary);
    }

    .prod-modal-tab.active {
        color: var(--prod-primary);
        border-bottom-color: var(--prod-primary);
        font-weight: 600;
    }

/* ── Historial de cambios ─────────────────────────────────── */
.prod-history-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--prod-border);
}

    .prod-history-item:last-child {
        border-bottom: none;
    }

.prod-history-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--prod-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.prod-history-content {
    flex: 1;
}

.prod-history-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: #1e293b;
}

.prod-history-detail {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
}

.prod-history-time {
    font-size: 0.72rem;
    color: var(--prod-muted);
    margin-top: 4px;
}

/* ── Loading ──────────────────────────────────────────────── */
.prod-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--prod-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

    .prod-loading i {
        color: var(--prod-primary);
    }

/* ── Drag and Drop feedback ───────────────────────────────── */
.prod-kanban-column-body.drag-over {
    background: rgba(40,74,112,.04);
    border: 2px dashed rgba(40,74,112,.2);
    border-radius: 8px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .prod-equipos-grid {
        grid-template-columns: 1fr;
    }

    .prod-kanban-column {
        min-width: 280px;
        flex: 0 0 280px;
    }

    .prod-search-box {
        min-width: 200px;
    }
}

