/* ============================================================
 * TaskFlow — Módulo Proyectos · Estilos
 * Hereda variables del style.css principal (--bg, --accent, etc.)
 * ============================================================ */

/* ── Layout general ────────────────────────────────────────── */
/* .pr-shell hereda scroll de .main (que tiene overflow:hidden) */
.pr-shell {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px 60px;
    box-sizing: border-box;
}
.pr-shell > * { max-width: 1480px; margin-left: auto; margin-right: auto; }
.pr-shell .muted { color: var(--muted, #8a8a9a); }

.pr-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; gap: 14px; flex-wrap: wrap;
}
.pr-head h1 { font-size: 22px; margin: 0; font-weight: 700; }

.pr-filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-filter-pills button {
    background: var(--bg2, #16161c); border: 1px solid var(--border, #2e2e38);
    color: var(--muted, #8a8a9a);
    padding: 7px 12px; border-radius: 999px; font-size: 12px; cursor: pointer;
    transition: all .15s;
}
.pr-filter-pills button:hover { color: var(--text); border-color: var(--accent); }
.pr-filter-pills button.on {
    background: var(--accent, #7c6aff); color: #fff; border-color: var(--accent, #7c6aff);
}

/* ── Cards de proyecto ─────────────────────────────────────── */
.pr-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 14px;
}
.pr-card {
    background: var(--bg2, #16161c); border: 1px solid var(--border, #2e2e38);
    border-radius: 12px; padding: 16px;
    transition: all .15s; cursor: pointer;
}
.pr-card:hover { border-color: var(--accent, #7c6aff); transform: translateY(-2px); }
.pr-card-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 8px; gap: 10px;
}
.pr-card-name { font-weight: 600; font-size: 15px; line-height: 1.3; margin-bottom: 3px; }
.pr-card-sub  { color: var(--muted); font-size: 12px; }
.pr-card-meta {
    display: flex; gap: 12px; margin: 10px 0 6px;
    font-size: 12px; color: var(--muted); flex-wrap: wrap;
}
.pr-card-meta strong { color: var(--text); }

.pr-progress {
    height: 6px; background: var(--bg3, #1c1c25); border-radius: 999px; overflow: hidden;
    margin-top: 6px;
}
.pr-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent, #7c6aff), var(--teal, #3dd9b5));
    border-radius: 999px;
}
.pr-card-current {
    font-size: 11px; color: var(--muted);
    margin-top: 7px;
}
.pr-card-current strong { color: var(--accent); }

.pr-type-badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 10px; font-weight: 700; letter-spacing: .3px;
    text-transform: uppercase;
}

.pr-status-tag {
    display: inline-block; padding: 3px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600; margin-top: 6px;
}
.pr-status-draft     { background: rgba(245,166,35,.15); color: #f5a623; }
.pr-status-active    { background: rgba(52,201,138,.15); color: #34c98a; }
.pr-status-paused    { background: rgba(138,138,154,.18); color: var(--muted); }
.pr-status-completed { background: rgba(74,158,255,.15); color: #4a9eff; }

.pr-pause-reason {
    font-size: 11px; margin-top: 8px; padding: 6px 8px;
    background: rgba(245,166,35,.08); border-left: 2px solid #f5a623;
    border-radius: 4px; color: var(--text);
}
.pr-pause-reason strong { color: #f5a623; }

.pr-card-empty {
    border-style: dashed; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 13px; min-height: 200px;
    text-align: center;
}
.pr-card-empty:hover { color: var(--accent); border-color: var(--accent); }

/* ── Wizard ───────────────────────────────────────────────── */
.pr-wizard {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
}
.pr-stepper {
    display: flex; padding: 18px 24px; border-bottom: 1px solid var(--border);
    background: var(--bg3, #1c1c25); gap: 4px;
}
.pr-step {
    flex: 1; display: flex; align-items: center; gap: 10px;
    color: var(--muted); font-size: 13px; cursor: pointer;
    padding: 4px 8px; border-radius: 8px;
    transition: all .15s;
}
.pr-step .num {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--border); color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.pr-step.done .num   { background: #34c98a; color: #fff; }
.pr-step.active      { color: var(--text); }
.pr-step.active .num { background: var(--accent); color: #fff; }

.pr-wbody { padding: 24px; min-height: 360px; }
.pr-wfoot {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 24px; border-top: 1px solid var(--border); background: var(--bg3);
}
.pr-wtitle { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.pr-wsub   { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

.pr-row { display: grid; gap: 12px; margin-bottom: 12px; }
.pr-row-2 { grid-template-columns: 1fr 1fr; }
.pr-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.pr-label {
    display: block; font-size: 12px; color: var(--muted);
    margin-bottom: 6px; font-weight: 500;
}
.pr-label .req { color: #ff4f4f; }
.pr-input,
.pr-select,
.pr-textarea {
    background: var(--bg3); color: var(--text); border: 1px solid var(--border);
    padding: 9px 12px; border-radius: 8px; font-size: 13px;
    width: 100%; font-family: inherit; box-sizing: border-box;
}
.pr-input:focus,
.pr-select:focus,
.pr-textarea:focus { outline: 0; border-color: var(--accent); }
.pr-textarea { resize: vertical; min-height: 70px; }

.pr-btn {
    background: var(--bg3); color: var(--text);
    border: 1px solid var(--border);
    padding: 9px 16px; border-radius: 8px;
    font-size: 13px; cursor: pointer; transition: all .15s;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit;
}
.pr-btn:hover { background: var(--border); }
.pr-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.pr-btn-primary:hover { background: #6855ee; }
.pr-btn-ghost   { background: transparent; }
.pr-btn-success { background: #34c98a; color: #fff; border-color: #34c98a; }
.pr-btn-warn    { background: #f5a623; color: #000; border-color: #f5a623; font-weight: 600; }
.pr-btn-sm      { padding: 6px 10px; font-size: 12px; }
.pr-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Plantilla cards en wizard paso 2 */
.pr-tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.pr-tpl-card {
    background: var(--bg3); border: 2px solid var(--border);
    border-radius: 12px; padding: 16px; cursor: pointer;
    transition: all .15s;
}
.pr-tpl-card:hover { border-color: var(--accent); }
.pr-tpl-card.on { border-color: var(--accent); background: rgba(124,106,255,.06); }
.pr-tpl-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.pr-tpl-desc { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }
.pr-tpl-stats { display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
.pr-tpl-stats strong { color: var(--text); }

.pr-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 18px 0; color: var(--muted); font-size: 12px;
}
.pr-divider::before, .pr-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.pr-note {
    padding: 12px 14px; background: rgba(124,106,255,.06);
    border-left: 3px solid var(--accent); border-radius: 8px;
    font-size: 12px; color: var(--muted); margin-bottom: 14px;
}
.pr-note strong { color: var(--text); }

.pr-alert {
    padding: 10px 12px; border-radius: 8px;
    font-size: 12px; margin-bottom: 14px;
    border: 1px solid;
}
.pr-alert-warn { background: rgba(245,166,35,.08); color: #f5a623; border-color: rgba(245,166,35,.3); }
.pr-alert-error { background: rgba(255,79,79,.08); color: #ff4f4f; border-color: rgba(255,79,79,.3); }
.pr-alert-ok    { background: rgba(52,201,138,.08); color: #34c98a; border-color: rgba(52,201,138,.3); }

/* ── Detalle de proyecto ──────────────────────────────────── */
.pr-detail-head {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.pr-detail-title {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 14px; flex-wrap: wrap;
}
.pr-detail-title h2 { font-size: 22px; margin: 0 0 4px; font-weight: 700; }
.pr-detail-meta-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px;
    margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.pr-meta-lbl { font-size: 11px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px; }
.pr-meta-val { font-size: 14px; font-weight: 600; }

.pr-timeline {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 12px; padding: 18px;
}
.pr-tl-strip {
    display: flex; gap: 4px; margin-bottom: 18px;
    background: var(--bg3); padding: 4px; border-radius: 8px;
    overflow-x: auto;
}
.pr-tl-ph {
    flex: 1; min-width: 80px; text-align: center;
    padding: 8px 4px; border-radius: 4px; font-size: 11px;
    color: var(--muted); cursor: pointer; position: relative;
    line-height: 1.3;
}
.pr-tl-ph.done { background: rgba(52,201,138,.12); color: #34c98a; }
.pr-tl-ph.active { background: var(--accent); color: #fff; }

/* Phase blocks dentro del detalle */
.pr-phase {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 12px; margin-bottom: 12px; overflow: hidden;
}
.pr-phase-head {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 14px; cursor: pointer; user-select: none;
    background: linear-gradient(90deg, rgba(124,106,255,.06), transparent);
}
.pr-phase-num {
    width: 24px; height: 24px; border-radius: 4px;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.pr-phase-name { font-weight: 600; font-size: 13px; flex: 1; min-width: 160px; }
.pr-phase-meta { font-size: 11px; color: var(--muted); }
.pr-phase-deadline {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--muted);
}
.pr-phase-deadline input { width: 130px; padding: 4px 8px; font-size: 11px; }

.pr-eff-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700;
    padding: 3px 8px; border-radius: 999px;
    border: 1px solid;
}
.pr-eff-good { background: rgba(52,201,138,.12); color: #34c98a; border-color: rgba(52,201,138,.3); }
.pr-eff-warn { background: rgba(245,166,35,.12); color: #f5a623; border-color: rgba(245,166,35,.3); }
.pr-eff-bad  { background: rgba(255,79,79,.12);  color: #ff4f4f; border-color: rgba(255,79,79,.3); }
.pr-eff-na   { background: var(--bg3); color: var(--muted); border-color: var(--border); }

.pr-phase-body { padding: 10px 14px 14px; display: none; }
.pr-phase.open .pr-phase-body { display: block; }

.pr-task-row {
    display: grid;
    grid-template-columns: 22px 2fr 1fr 100px 140px 60px 90px;
    gap: 10px; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.pr-task-row:last-child { border-bottom: 0; }
.pr-task-row .check {
    width: 18px; height: 18px; border-radius: 4px;
    border: 1.5px solid var(--border); cursor: pointer;
}
.pr-task-row .check.done {
    background: #34c98a; border-color: #34c98a;
}
.pr-task-name { color: var(--text); font-weight: 500; }
.pr-task-name.done { text-decoration: line-through; color: var(--muted); }

.pr-hours-cell { display: flex; align-items: center; gap: 6px; }
.pr-hours-bar {
    flex: 1; height: 4px; background: var(--bg); border-radius: 999px; overflow: hidden;
    border: 1px solid var(--border);
}
.pr-hours-fill { height: 100%; border-radius: 999px; }
.pr-hours-ok { background: #34c98a; }
.pr-hours-warn { background: #f5a623; }
.pr-hours-bad { background: #ff4f4f; }
.pr-hours-text { font-size: 11px; font-weight: 600; white-space: nowrap; }

.pr-pct { font-size: 11px; font-weight: 600; }
.pr-pct.ok { color: #34c98a; } .pr-pct.warn { color: #f5a623; } .pr-pct.bad { color: #ff4f4f; }

/* Stage badges (mini, dentro del detalle) */
.pr-stage-mini {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 10px; font-weight: 600;
}

/* Modal */
.pr-modal-back {
    position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.pr-modal {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 12px; padding: 22px;
    max-width: 540px; width: 100%; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.pr-modal h3 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
.pr-modal .sub { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.pr-modal-foot {
    display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px;
}

/* Loading inline */
.pr-loading {
    display: flex; align-items: center; justify-content: center;
    padding: 60px 20px; color: var(--muted); font-size: 13px;
}
.pr-loading::before {
    content: ''; width: 16px; height: 16px;
    border: 2px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; margin-right: 10px;
    animation: pr-spin .8s linear infinite;
}
@keyframes pr-spin { to { transform: rotate(360deg); } }

.pr-empty {
    text-align: center; padding: 60px 20px; color: var(--muted);
}
.pr-empty .ico { font-size: 38px; margin-bottom: 10px; opacity: .5; }
