/* =============================================================
   ToDo Interno — Hoja de estilos principal
   ============================================================= */

:root {
    --primary: #6366f1;
    --primary-hover: #5558e3;
    --primary-soft: rgba(99, 102, 241, 0.10);
    --primary-soft-2: rgba(99, 102, 241, 0.18);

    --bg: #f5f6fb;
    --surface: #ffffff;
    --surface-2: #fbfbfe;
    --sidebar-bg: #11131a;
    --sidebar-surface: #1a1d28;
    --sidebar-hover: #232636;
    --sidebar-text: #c7cbdb;
    --sidebar-text-muted: #6b7180;
    --sidebar-active: rgba(99, 102, 241, 0.16);

    --border: #e8eaf2;
    --border-soft: #f0f1f7;

    --text: #1e2130;
    --text-soft: #4b4f63;
    --text-muted: #8b8fa3;

    --green: #22c55e;
    --green-soft: rgba(34, 197, 94, 0.12);
    --amber: #f59e0b;
    --amber-soft: rgba(245, 158, 11, 0.12);
    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, 0.12);
    --blue: #3b82f6;
    --blue-soft: rgba(59, 130, 246, 0.12);
    --pink: #ec4899;
    --pink-soft: rgba(236, 72, 153, 0.12);

    --teal: #14b8a6;
    --teal-soft: rgba(20, 184, 166, 0.12);
    --slate: #64748b;
    --slate-soft: rgba(100, 116, 139, 0.12);

    --shadow-xs: 0 1px 2px rgba(16, 18, 30, 0.04);
    --shadow-sm: 0 2px 8px rgba(16, 18, 30, 0.06);
    --shadow-md: 0 6px 22px rgba(16, 18, 30, 0.08);
    --shadow-lg: 0 18px 48px rgba(16, 18, 30, 0.14);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --sidebar-width: 280px;
    --topbar-height: 64px;

    --font: 'Outfit', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.14); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }
.sidebar ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); }

/* =============================================================
   Layout principal
   ============================================================= */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
    grid-template-areas: "sidebar topbar" "sidebar main";
    height: 100vh;
    overflow: hidden;
}

/* =============================================================
   Sidebar (columna de proyectos)
   ============================================================= */
.sidebar {
    grid-area: sidebar;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar-head {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.brand-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 15px; font-weight: 700; color: #fff;
    letter-spacing: -0.2px;
}
.brand-text span {
    font-size: 11px; color: var(--sidebar-text-muted);
}

.sidebar-section {
    padding: 18px 16px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-section h2 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--sidebar-text-muted);
}

.sidebar-project-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-icon-btn {
    width: 26px; height: 26px;
    border-radius: 8px;
    color: var(--sidebar-text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    transition: background .18s, color .18s;
}
.sidebar-icon-btn:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }

.sidebar-project-search {
    position: relative;
    margin: 0 16px 8px;
    flex-shrink: 0;
}
.sidebar-project-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sidebar-text-muted);
    font-size: 11px;
    pointer-events: none;
}
.sidebar-project-search input {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    outline: none;
    background: rgba(255,255,255,0.05);
    color: var(--sidebar-text);
    padding: 7px 10px 7px 30px;
    font-size: 12px;
    transition: border .15s, background .15s, box-shadow .15s;
}
.sidebar-project-search input::placeholder { color: var(--sidebar-text-muted); }
.sidebar-project-search input:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.16);
}

.btn-add {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    transition: background .18s, transform .18s;
    flex-shrink: 0;
}
.btn-add:hover { background: var(--primary-hover); transform: scale(1.06); }

.projects-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 16px;
}

.projects-empty {
    padding: 18px 10px;
    color: var(--sidebar-text-muted);
    font-size: 12px;
    text-align: center;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s;
    margin-bottom: 2px;
    position: relative;
}
.project-item:hover { background: var(--sidebar-hover); }
.project-item.active { background: var(--sidebar-active); }
.project-item.active .project-name { color: #fff; }
.project-item[draggable="true"] { cursor: grab; }
.project-item.dragging {
    opacity: .55;
    cursor: grabbing;
}
.project-item.drag-over-before::before,
.project-item.drag-over-after::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(99,102,241,.65);
}
.project-item.drag-over-before::before { top: -2px; }
.project-item.drag-over-after::after { bottom: -2px; }

.project-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}

.project-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--sidebar-text-muted);
    background: rgba(255,255,255,0.06);
    padding: 1px 7px;
    border-radius: 20px;
    flex-shrink: 0;
}
.project-item.active .project-count {
    background: var(--primary);
    color: #fff;
}

/* Badge latente: proyectos con tareas que requieren más información.
   Pulsa en ámbar para llamar la atención sobre el proyecto. */
.project-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    color: #b07308;
    background: var(--amber-soft);
    border: 1px solid transparent;
    animation: pulse-badge 1.6s ease-in-out infinite;
}
.project-info-badge i { font-size: 10px; }
.project-item.active .project-info-badge {
    background: rgba(255,255,255,0.92);
    color: #b07308;
}
@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
    50%      { box-shadow: 0 0 0 5px rgba(245, 158, 11, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .project-info-badge { animation: none; }
}

/* Presencia en vivo: avatares de quién está mirando esta sección */
.project-presence {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.project-presence:empty { display: none; }
.presence-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--sidebar-bg, #1e1e2e);
    margin-left: -7px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.presence-avatar:first-child { margin-left: 0; }
.presence-avatar .avatar-ini {
    width: 100%; height: 100%;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 9px; font-weight: 700;
}
.presence-avatar.more {
    background: rgba(255,255,255,0.12);
    color: var(--sidebar-text-muted);
    font-size: 9px; font-weight: 700;
}

.project-del {
    opacity: 0;
    color: var(--sidebar-text-muted);
    font-size: 12px;
    transition: opacity .15s, color .15s;
    flex-shrink: 0;
    padding: 2px;
}
.project-item:hover .project-del { opacity: 1; }
.project-del:hover { color: var(--red); }

/* Caret expand/collapse de proyecto */
.project-caret {
    width: 18px; height: 18px;
    border-radius: 5px;
    color: var(--sidebar-text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 9px;
    flex-shrink: 0;
    transition: transform .18s, color .15s, background .15s;
}
.project-caret:hover { background: rgba(255,255,255,0.08); color: var(--sidebar-text); }
.project-caret.expanded { transform: rotate(90deg); }

/* Botón añadir carpeta */
.project-add-folder {
    opacity: 0;
    color: var(--sidebar-text-muted);
    font-size: 11px;
    transition: opacity .15s, color .15s;
    flex-shrink: 0;
    padding: 2px;
}
.project-item:hover .project-add-folder { opacity: 1; }
.project-add-folder:hover { color: var(--primary); }

/* Subárbol de carpetas */
.folder-subtree {
    padding: 2px 0 4px 22px;
    border-left: 1px dashed rgba(255,255,255,0.08);
    margin-left: 16px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s;
    margin-bottom: 1px;
    position: relative;
}
.folder-item:hover { background: var(--sidebar-hover); }
.folder-item.active { background: var(--sidebar-active); }
.folder-item.active .folder-name { color: #fff; }

.folder-ico {
    font-size: 11px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.folder-name {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-count {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--sidebar-text-muted);
    background: rgba(255,255,255,0.05);
    padding: 1px 6px;
    border-radius: 20px;
    flex-shrink: 0;
}
.folder-item.active .folder-count {
    background: var(--primary);
    color: #fff;
}

.folder-del {
    opacity: 0;
    color: var(--sidebar-text-muted);
    font-size: 10px;
    transition: opacity .15s, color .15s;
    flex-shrink: 0;
    padding: 2px;
}
.folder-item:hover .folder-del { opacity: 1; }
.folder-del:hover { color: var(--red); }

/* Badge de carpeta en task-card */
.badge-folder {
    background: var(--surface-2);
    color: var(--text-soft);
    border: 1px solid var(--border);
}
.badge-folder i { color: var(--amber); }

.badge-comments {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid transparent;
}
.badge-comments i { color: var(--primary); }

/* Item "Todas" */
.project-item.all-tasks .project-dot {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
}

.sidebar-foot {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px; border-radius: var(--radius-sm);
    cursor: pointer; transition: background .15s;
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-user .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.sidebar-user .avatar img { width:100%; height:100%; border-radius:50%; object-fit:cover; }
.sidebar-user .uinfo { flex: 1; min-width: 0; }
.sidebar-user .uname { font-size: 13px; font-weight: 600; color: #fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user .urole { font-size: 11px; color: var(--sidebar-text-muted); }

/* =============================================================
   Topbar
   ============================================================= */
.topbar {
    grid-area: topbar;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 24px;
    flex-shrink: 0;
}

.topbar-title {
    display: flex; flex-direction: column;
    min-width: 0;
}
.topbar-title .crumb {
    font-size: 11px; color: var(--text-muted); font-weight: 500;
    text-transform: uppercase; letter-spacing: .8px;
}
.topbar-title h2 {
    font-size: 17px; font-weight: 700; color: var(--text);
    letter-spacing: -0.3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.search-box {
    flex: 1;
    max-width: 420px;
    margin-left: auto;
    position: relative;
}
.search-box i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 13px;
}
.search-box input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px 9px 38px;
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border .15s, box-shadow .15s;
}
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-box input::placeholder { color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.ws-status {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    transition: background .3s, box-shadow .3s;
}
.ws-status.online {
    background: var(--green);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: wsPulse 2s infinite;
}
@keyframes wsPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
    50% { box-shadow: 0 0 14px rgba(34, 197, 94, 0.7); }
}

.icon-btn {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: background .15s, color .15s, border .15s;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* =============================================================
   Main content
   ============================================================= */
.main {
    grid-area: main;
    overflow-y: auto;
    padding: 24px 28px 40px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.filter-chip {
    padding: 6px 13px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.filter-chip:hover { color: var(--text); }
.filter-chip.active {
    background: var(--primary);
    color: #fff;
}

.select-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 32px 8px 14px;
    font-size: 12.5px;
    color: var(--text-soft);
    outline: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238b8fa3' stroke-width='2'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border .15s;
}
.select-pill:hover { border-color: var(--primary); }
.select-pill:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }
.btn-primary:active { transform: scale(.98); }

.btn-ghost {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-soft);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .15s, border .15s;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text-muted); }

.toolbar-spacer { flex: 1; }

/* ---------- Estadísticas rápidas ---------- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-ico {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.stat-ico.pendiente  { background: var(--amber-soft); color: var(--amber); }
.stat-ico.progreso   { background: var(--blue-soft);  color: var(--blue); }
.stat-ico.completada { background: var(--green-soft); color: var(--green); }
.stat-ico.sin_problema    { background: var(--teal-soft);  color: var(--teal); }
.stat-ico.no_reproducible { background: var(--slate-soft); color: var(--slate); }
.stat-ico.fallo      { background: var(--red-soft);   color: var(--red); }
.stat-info .num { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-info .lbl { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* =============================================================
   Task cards
   ============================================================= */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
}

/* Separador/subtítulo de sección dentro de la grilla (ocupa todo el ancho) */
.tasks-section {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 2px 0;
}
.tasks-section:not(:first-child) { margin-top: 18px; }
.tasks-section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-soft);
}
.tasks-section-count {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.tasks-section-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}
.tasks-section.is-pendiente .tasks-section-label { color: var(--primary); }
.tasks-section.is-completada .tasks-section-label { color: var(--green, #22c55e); }
.tasks-section.is-info-req .tasks-section-label { color: var(--amber); }
.tasks-section.is-info-req .tasks-section-count { background: var(--amber-soft); color: #b07308; border-color: transparent; }

.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 17px;
    transition: box-shadow .2s, border .2s, transform .15s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 11px;
    cursor: default;
}
.task-card:hover {
    box-shadow: var(--shadow-md);
    border-color: transparent;
    transform: translateY(-2px);
}
.task-card.completada { opacity: .55; }
.task-card.completada .task-title { text-decoration: line-through; color: var(--text-muted); }

/* ── "Necesita información" (sin_problema / no_reproducible): la tarea sigue
   pendiente pero se resalta con borde + glow pulsante para que el reportero
   vea que se le pide más detalle. Diferencia el motivo con color. ── */
.task-card.necesita-info {
    border-color: var(--accent, var(--teal));
    background: linear-gradient(var(--accent-soft, var(--teal-soft)), var(--accent-soft, var(--teal-soft))) padding-box;
    box-shadow: 0 0 0 0 var(--accent-soft, var(--teal-soft));
    animation: pulse-info 1.8s ease-in-out infinite;
}
.task-card.necesita-info.sin_problema    { --accent: var(--teal);  --accent-soft: var(--teal-soft); }
.task-card.necesita-info.no_reproducible { --accent: var(--slate); --accent-soft: var(--slate-soft); }
.task-card.necesita-info::before { width: 6px; background: var(--accent); }
.task-card.necesita-info:hover { transform: translateY(-2px); }

@keyframes pulse-info {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
    50%      { box-shadow: 0 0 0 6px var(--accent-soft); }
}
@media (prefers-reduced-motion: reduce) {
    .task-card.necesita-info { animation: none; }
}

/* Banner dentro de la tarjeta: mensaje claro al reportero. */
.task-info-req {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 9px;
    background: var(--accent, var(--teal));
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.task-info-req i { font-size: 14px; flex-shrink: 0; }
.task-info-req span { flex: 1; }

/* El check de "necesita info" toma el color del motivo. */
.task-check.needs-info {
    background: var(--accent, var(--teal));
    border-color: var(--accent, var(--teal));
    color: #fff;
}
.task-check.needs-info.status-sin_problema    { --accent: var(--teal); }
.task-check.needs-info.status-no_reproducible { --accent: var(--slate); }


/* Franja lateral con el color del proyecto: identifica de un vistazo a qué proyecto pertenece */
.task-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--proj-color, var(--border));
    border-radius: var(--radius) 0 0 var(--radius);
}

/* Los fallos se resaltan más para darles prioridad visual */
.task-card.fallo {
    border-color: var(--red);
    background: linear-gradient(var(--red-soft), var(--red-soft)) padding-box;
}
.task-card.fallo::before {
    width: 6px;
    background: var(--red);
}
.task-card.fallo .task-title { color: var(--red); }

/* Tarea fijada (alcance local, solo este equipo): se destaca y va arriba */
.task-card.pinned {
    border-color: var(--amber);
    background: linear-gradient(var(--amber-soft), var(--amber-soft)) padding-box;
    box-shadow: var(--shadow-sm);
}
.task-card.pinned::before {
    width: 6px;
    background: var(--amber);
}
.task-pin-flag {
    position: absolute;
    top: -8px; right: 12px;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    background: var(--amber);
    color: #fff;
    font-size: 11px;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transform: rotate(20deg);
    z-index: 2;
}

.task-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}


.task-check {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: background .15s, border .15s;
    color: #fff;
    font-size: 10px;
}
.task-check:hover { border-color: var(--primary); }
.task-check.done {
    background: var(--green);
    border-color: var(--green);
}
.task-check.in-progress { border-color: var(--blue); }

.fallo .task-check {
    border-color: red;
}

.task-title {
    flex: 1;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;
}

.task-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Cabecera (proyecto + título) ── */
.task-head-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.task-project-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--proj-color, var(--text-muted));
}
.task-project-tag .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.task-bug { color: var(--red); margin-right: 6px; font-size: 12px; }

/* ── Chips esenciales (estado / prioridad / fallo) ── */
.task-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 7px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.chip i { font-size: 9px; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-status.status-pendiente   { background: var(--amber-soft); color: #b07308; }
.chip-status.status-en_progreso { background: var(--blue-soft);  color: #1d6fd6; }
.chip-status.status-completada  { background: var(--green-soft); color: #16864a; }
/* Cierres por investigación: tonos distinguibles de "completada" */
.chip-status.status-sin_problema    { background: var(--teal-soft);  color: #0d8a7c; }
.chip-status.status-no_reproducible { background: var(--slate-soft); color: #475569; }
/* La prioridad alta resalta; media/baja quedan discretas para no competir */
.chip-prio.prio-alta  { background: var(--red-soft);  color: #c53b3b; }
.chip-prio.prio-media { background: var(--surface-2); color: var(--text-soft);  border-color: var(--border); }
.chip-prio.prio-baja  { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
.chip-fallo { background: var(--red); color: #fff; }

/* ── Galería de imágenes adjuntas ── */
.task-gallery {
    display: flex;
    gap: 6px;
}
.task-thumb {
    position: relative;
    height: 58px;
    flex: 1;
    max-width: 84px;
    padding: 0;
    display: block;
    cursor: pointer;
    border-radius: 9px;
    border: 1px solid var(--border);
    background-size: cover;
    background-position: center;
    background-color: var(--surface-2);
    transition: transform .12s, box-shadow .12s;
}
.task-thumb:hover { transform: scale(1.03); box-shadow: var(--shadow-sm); }
.task-thumb-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 18, 30, .55);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
}

/* ── Lightbox (visor de imágenes) ── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(10, 12, 20, .9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s, visibility .18s;
}
.lightbox.show { opacity: 1; visibility: visible; }
.lb-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 88vw;
    max-height: 86vh;
}
.lb-img {
    max-width: 88vw;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
    transform: scale(.97);
    transition: transform .18s;
}
.lightbox.show .lb-img { transform: scale(1); }
.lb-counter {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .82);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .3px;
}
.lb-close {
    position: absolute;
    top: 18px; right: 22px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.lb-nav {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .24); }

/* ── Meta sutil (carpeta · fecha ··· contadores) ── */
.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--text-muted);
}
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.meta-item i { font-size: 11px; opacity: .85; }
.meta-item.is-overdue { color: var(--red); font-weight: 600; }
.meta-item.task-tiempo { font-weight: 600; }
.meta-item.task-tiempo.resuelta { color: var(--green); }
.meta-item.task-tiempo.espera { color: var(--amber); }
.meta-item.task-tiempo.espera-info { color: var(--red); }
.meta-spacer { flex: 1; min-width: 8px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.badge i { font-size: 9px; }

.badge-status-pendiente  { background: var(--amber-soft); color: #b07308; }
.badge-status-en_progreso { background: var(--blue-soft);  color: #1d6fd6; }
.badge-status-completada  { background: var(--green-soft); color: #16864a; }

.badge-prioridad-alta  { background: var(--red-soft);  color: #c53b3b; }
.badge-prioridad-media { background: var(--amber-soft); color: #b07308; }
.badge-prioridad-baja  { background: var(--blue-soft); color: #1d6fd6; }

.badge-fallo { background: var(--red-soft); color: var(--red); }
.badge-tarea { background: var(--primary-soft); color: var(--primary); }

.badge-project {
    background: var(--surface-2);
    color: var(--text-soft);
    border: 1px solid var(--border);
}
.badge-project .dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}

.badge-due {
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.badge-due.overdue { background: var(--red-soft); color: var(--red); border-color: transparent; }

.task-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    opacity: 0;
    transition: opacity .15s;
}
.task-card:hover .task-actions { opacity: 1; }
.task-act {
    width: 28px; height: 28px;
    border-radius: 7px;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    transition: background .15s, color .15s;
}
.task-act:hover { background: var(--surface-2); color: var(--text); }
.task-act.del:hover { background: var(--red-soft); color: var(--red); }

/* ---------- Pie de personas en task-card (compacto) ---------- */
.task-people {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 11px;
    margin-top: auto;          /* empuja el pie al fondo cuando la tarjeta se estira */
    border-top: 1px solid var(--border-soft);
}
.people-avatars { display: flex; align-items: center; gap: 6px; }
.task-people .btn-take { margin-left: auto; }

/* Avatar base (compartido con chat/modales) */
.person-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700;
    overflow: hidden; flex-shrink: 0;
}
.person-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-avatar .avatar-ini {
    width: 100%; height: 100%;
    border-radius: inherit;
    display: flex; align-items: center; justify-content: center;
}
.person-avatar.mini { width: 18px; height: 18px; font-size: 8px; }

/* Owner / asignado: avatar con anillo e indicador */
.avatar-chip { position: relative; display: inline-flex; }
.task-people .person-avatar { width: 26px; height: 26px; font-size: 10px; }
.avatar-chip .person-avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-chip.assigned .person-avatar {
    background: linear-gradient(135deg, var(--blue), #60a5fa);
    box-shadow: 0 0 0 2px var(--blue-soft);
}
.owner-flag {
    position: absolute;
    bottom: -3px; right: -4px;
    width: 13px; height: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 7px;
    color: #fff;
    background: var(--amber);
    border: 1.5px solid var(--surface);
    border-radius: 50%;
}

/* Stack de participantes (avatares apilados) */
.participants-stack { display: flex; align-items: center; }
.task-people .participants-stack .person-avatar { width: 24px; height: 24px; font-size: 9px; }
.person-avatar.stacked {
    border: 2px solid var(--surface);
    margin-left: -8px;
}
.person-avatar.stacked:first-child { margin-left: 0; }
.person-avatar.stacked.more {
    background: var(--border);
    color: var(--text-soft);
}

/* Botón Tomar / Participando */
.people-actions { margin-left: auto; }
.btn-take {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary-soft-2);
    border-radius: 20px;
    padding: 4px 11px;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}
.btn-take:hover { background: var(--primary); color: #fff; }
.btn-take:active { transform: scale(.96); }
.btn-take.leaving {
    color: var(--green);
    background: var(--green-soft);
    border-color: transparent;
}
.btn-take.leaving:hover { background: var(--red-soft); color: var(--red); }
.btn-take.leaving:hover i { }
.btn-take i { font-size: 10px; }

/* ---------- Empty state ---------- */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 42px;
    color: var(--border);
    margin-bottom: 14px;
}
.empty-state h3 {
    font-size: 16px; font-weight: 600; color: var(--text-soft);
    margin-bottom: 4px;
}
.empty-state p { font-size: 13px; }

/* ---------- Loading skeleton ---------- */
.skeleton-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    height: 130px;
    overflow: hidden;
}
.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, var(--border-soft) 25%, var(--border) 50%, var(--border-soft) 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: shimmer 1.4s infinite;
    margin-bottom: 10px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* =============================================================
   Modal
   ============================================================= */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 17, 28, 0.55);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(14px) scale(.98);
    transition: transform .22s;
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal.small { max-width: 720px; }

#taskModal .modal {
    max-width: 1400px;
    height: calc(100vh - 40px);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#taskModal .modal-head {
    flex-shrink: 0;
}

#taskModal .modal-body {
    padding: 20px 24px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

#taskModal .modal-foot {
    flex-shrink: 0;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
}

.task-modal-grid {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.55fr);
    gap: 20px;
    height: 100%;
    min-height: 0;
}

.task-form-panel {
    padding-right: 20px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.task-chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.task-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text);
}
.task-chat-head strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
}
.task-chat-head span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}
.task-chat-head i {
    color: var(--primary);
    background: var(--primary-soft);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-chat-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 14px;
    min-height: 0;
}

.task-chat-empty {
    height: 100%;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}
.task-chat-empty i {
    font-size: 28px;
    color: var(--border);
}

.task-chat-msg {
    display: flex;
    gap: 9px;
    margin-bottom: 12px;
}
.task-chat-msg.mine {
    flex-direction: row-reverse;
}
.chat-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
    margin-top: 2px;
}
.task-chat-bubble {
    max-width: 82%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 9px 11px;
    box-shadow: var(--shadow-xs);
}
.task-chat-msg.mine .task-chat-bubble {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.task-chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 11px;
}
.task-chat-meta strong { font-weight: 700; }
.task-chat-meta span { color: var(--text-muted); }
.task-chat-msg.mine .task-chat-meta span { color: rgba(255,255,255,.68); }
.task-chat-text {
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
    white-space: normal;
}

.task-chat-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.task-chat-form textarea {
    flex: 1;
    min-height: 46px;
    max-height: 110px;
    resize: vertical;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    outline: none;
    font-size: 13px;
    color: var(--text);
}
.task-chat-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.task-chat-form button {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}
.task-chat-form button:hover { background: var(--primary-hover); }
.task-chat-form button:active { transform: scale(.96); }
.task-chat-form button:disabled { opacity: .65; cursor: not-allowed; }

/* ---------- Título del topbar: botón de editar ---------- */
.topbar-title-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.title-edit-btn {
    width: 28px; height: 28px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    transition: background .15s, color .15s, border .15s;
}
.title-edit-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* ---------- Widget de archivos adjuntos ---------- */
.attachments-row { margin-bottom: 18px; }

.attach-upload-zone {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    transition: border .18s, background .18s;
    margin-bottom: 12px;
}
.attach-upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    flex-shrink: 0;
    transition: background .15s;
}
.attach-btn:hover { background: var(--primary-hover); }
.attach-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.attach-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.attach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    width: 100%;
    transition: box-shadow .15s, border .15s;
}
.attach-item:hover { box-shadow: var(--shadow-xs); border-color: var(--text-muted); }
.attach-item.is-pending { border-style: dashed; background: var(--surface-2); }
.attach-item.is-pending .attach-meta { color: var(--amber); }

.attach-thumb {
    width: 42px; height: 42px;
    border-radius: 8px;
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}
.attach-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.attach-thumb i {
    font-size: 18px;
    color: var(--text-muted);
}
.attach-item.is-image .attach-thumb i { display: none; }

.attach-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.attach-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
.attach-name:hover { color: var(--primary); }
.attach-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.attach-del {
    width: 26px; height: 26px;
    border-radius: 7px;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.attach-del:hover { background: var(--red-soft); color: var(--red); }

.modal-head {
    padding: 20px 24px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 {
    font-size: 17px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 10px;
}
.modal-head h3 i { color: var(--primary); font-size: 15px; }
.modal-close {
    width: 32px; height: 32px; border-radius: 8px;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

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

.modal-foot {
    padding: 14px 24px 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-soft);
}

/* ---------- Form ---------- */
.form-row { margin-bottom: 16px; }
.form-row label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    font-size: 13.5px;
    color: var(--text);
    outline: none;
    transition: border .15s, box-shadow .15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    background: var(--surface);
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238b8fa3' stroke-width='2'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 32px;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.task-footer-share {
    flex: 1;
    max-width: 520px;
    min-width: 0;
}
.task-footer-share:empty { display: none; }
.task-footer-share label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}
.task-share-control {
    display: flex;
    gap: 8px;
}
.task-share-control .form-input {
    background: var(--surface);
    font-size: 12.5px;
}
.task-copy-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 0 13px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    transition: background .15s, transform .1s;
}
.task-copy-link:hover { background: var(--primary-hover); }
.task-copy-link:active { transform: scale(.97); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* Participantes en el modal */
.modal-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.modal-participant {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px 4px 4px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-soft);
}
.modal-participant .person-avatar { width: 26px; height: 26px; font-size: 10px; }

.color-picker {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.color-opt {
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .15s, border .15s;
    position: relative;
}
.color-opt:hover { transform: scale(1.12); }
.color-opt.selected { border-color: var(--text); transform: scale(1.1); }
.color-opt.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10px;
}

/* ---------- Type toggle (tarea / fallo) ---------- */
.type-toggle {
    display: flex;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.type-opt {
    flex: 1;
    padding: 8px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: background .15s, color .15s;
}
.type-opt:hover { color: var(--text); }
.type-opt.active.tarea { background: var(--primary-soft); color: var(--primary); }
.type-opt.active.fallo { background: var(--red-soft); color: var(--red); }

/* =============================================================
   Toast / notificaciones flotantes
   ============================================================= */
.toast-stack {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 2000;
    display: flex; flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; font-weight: 500;
    color: var(--text);
    min-width: 240px; max-width: 360px;
    pointer-events: auto;
    animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
.toast .ico { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.toast.success .ico { background: var(--green-soft); color: var(--green); }
.toast.error .ico { background: var(--red-soft); color: var(--red); }
.toast.info .ico { background: var(--blue-soft); color: var(--blue); }

/* ---------- Toast especial para chat ---------- */
.toast.toast-chat {
    min-width: 300px;
    max-width: 400px;
    padding: 0;
    overflow: hidden;
    border-left: 4px solid var(--primary);
    animation: toastChatIn .35s cubic-bezier(.18,.89,.32,1.28);
}
@keyframes toastChatIn {
    from { opacity: 0; transform: translateX(40px) scale(.92); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
.toast-chat-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    flex-shrink: 0;
    margin: 12px 0 12px 14px;
}
.toast-chat-body {
    flex: 1;
    padding: 10px 14px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.toast-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.toast-chat-header strong {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toast-chat-header i {
    color: var(--primary);
    font-size: 13px;
    flex-shrink: 0;
}
.toast-chat-task {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toast-chat-proy {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}
.toast-chat-preview {
    font-size: 12px;
    color: var(--text);
    line-height: 1.4;
    margin-top: 3px;
    padding: 5px 8px;
    background: var(--surface-2);
    border-radius: 6px;
    border-left: 2px solid var(--primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.toast.toast-chat.out { animation: toastChatOut .3s ease forwards; }
@keyframes toastChatOut {
    to { opacity: 0; transform: translateX(40px) scale(.95); }
}

/* =============================================================
   Login
   ============================================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(120% 120% at 80% 0%, #1e2235 0%, #11131a 55%, #0c0e15 100%);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    top: -120px; right: -120px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(99,102,241,0.25), transparent 70%);
    pointer-events: none;
}
.login-page::after {
    content: '';
    position: absolute;
    bottom: -160px; left: -100px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(139,92,246,0.18), transparent 70%);
    pointer-events: none;
}
.login-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xl);
    padding: 36px 34px;
    backdrop-filter: blur(20px);
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.login-brand {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; margin-bottom: 28px;
}
.login-brand .mark {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px;
    box-shadow: 0 8px 28px rgba(99,102,241,0.5);
}
.login-brand h1 { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.login-brand p { font-size: 12.5px; color: rgba(255,255,255,0.45); }

.login-form .form-group { margin-bottom: 16px; }
.login-form label {
    display: block;
    font-size: 12.5px; font-weight: 600;
    color: rgba(255,255,255,0.6);
    margin-bottom: 7px;
}
.login-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    color: #fff;
    outline: none;
    transition: border .15s, background .15s;
}
.login-input::placeholder { color: rgba(255,255,255,0.3); }
.login-input:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.login-input-wrap { position: relative; }
.login-input-wrap .input-ico {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.35); font-size: 14px;
}
.login-input-wrap .login-input { padding-left: 40px; }
.login-input-wrap .toggle-pass {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.35); font-size: 14px;
    background: none; border: none; cursor: pointer;
}
.login-input-wrap .toggle-pass:hover { color: rgba(255,255,255,0.6); }

.login-alert {
    background: rgba(239,68,68,0.10);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 12.5px;
    margin-bottom: 16px;
    display: none;
    align-items: center; gap: 8px;
}
.login-alert.show { display: flex; }

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #7c6cf0);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 13px;
    font-size: 14px;
    font-weight: 600;
    transition: transform .1s, box-shadow .2s, opacity .2s;
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
    margin-top: 4px;
}
.btn-login:hover { box-shadow: 0 10px 30px rgba(99,102,241,0.55); }
.btn-login:active { transform: scale(.98); }
.btn-login:disabled { opacity: .65; cursor: not-allowed; }

.login-foot {
    text-align: center;
    margin-top: 22px;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 980px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    #taskModal .modal-body {
        overflow-y: auto;
    }
    .task-modal-grid {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }
    .task-form-panel {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 18px;
        overflow: visible;
    }
    .task-chat-panel { min-height: 420px; }
    .task-chat-list {
        min-height: 200px;
    }
}
@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-areas: "topbar" "main";
    }
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        width: var(--sidebar-width);
        z-index: 500;
        transform: translateX(-100%);
        transition: transform .25s;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop {
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 450;
        opacity: 0; visibility: hidden;
        transition: opacity .2s, visibility .2s;
    }
    .sidebar-backdrop.show { opacity: 1; visibility: visible; }
    .btn-menu { display: flex !important; }

    /* ── Topbar compacta: sin esto los botones con texto no se encogen
          y fuerzan un ancho mayor que el viewport (todo se corta a la derecha) ── */
    .topbar { gap: 10px; padding: 0 14px; }
    .topbar-title { min-width: 0; }
    .topbar-title h2 { font-size: 15px; }
    .topbar-title .crumb { font-size: 10px; }
    .search-box { max-width: none; min-width: 0; }
    /* El "Nuevo proyecto" del topbar es redundante (ya está en el sidebar) */
    .topbar-actions #btnNewProject { display: none; }
    /* "Nueva tarea" queda como botón solo-icono para ahorrar espacio */
    .topbar-actions .btn-primary span,
    .topbar-actions .btn-ghost span { display: none; }
    .topbar-actions .btn-primary,
    .topbar-actions .btn-ghost { padding: 9px 12px; }

    /* ── Contenido principal ── */
    .main { padding: 16px 14px 32px; }
    .tasks-grid { grid-template-columns: 1fr; }

    /* ── Toolbar de filtros: que no desborde horizontalmente ── */
    .filter-group { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .toolbar > .select-pill { flex: 1; min-width: 130px; }

    #taskModal .modal-foot { align-items: stretch; }
    .task-footer-share { flex-basis: 100%; max-width: none; }
    .modal-actions { width: 100%; }
    .modal-actions .btn-ghost,
    .modal-actions .btn-primary { flex: 1; }
    .task-share-control { flex-direction: column; }
    .task-copy-link { min-height: 38px; }
}
@media (max-width: 480px) {
    .stats-row { gap: 10px; }
    .stat-card { padding: 13px 14px; gap: 11px; }
    .stat-ico { width: 38px; height: 38px; font-size: 15px; }
    .stat-info .num { font-size: 19px; }
    .stat-info .lbl { font-size: 11px; }
    .toolbar { gap: 8px; }
    .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
}
.btn-menu { display: none; }

/* =============================================================
   Menú contextual de tarea (click derecho sobre una task-card)
   ============================================================= */
.ctx-menu {
    position: fixed;
    z-index: 3000;
    min-width: 210px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 1px;
    animation: ctxIn .12s ease;
}
.ctx-menu.show { display: flex; }
@keyframes ctxIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.ctx-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-soft);
    text-align: left;
    transition: background .12s, color .12s;
}
.ctx-item i { width: 16px; text-align: center; font-size: 12px; color: var(--text-muted); }
.ctx-item:hover { background: var(--primary-soft); color: var(--primary); }
.ctx-item:hover i { color: var(--primary); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger i { color: var(--red); }
.ctx-item.danger:hover { background: var(--red-soft); color: var(--red); }
.ctx-sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* =============================================================
   Panel "Info" del proyecto
   ============================================================= */
.info-panel {
    animation: infoIn .18s ease;
}
@keyframes infoIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.info-loading {
    display: flex; align-items: center; gap: 10px;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
}
.info-loading i { color: var(--primary); font-size: 16px; }

.info-head {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--info-color, var(--primary)) 10%, var(--surface)), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 22px;
}
.info-head-avatar {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 19px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--info-color, var(--primary)) 35%);
}
.info-head-meta { flex: 1; min-width: 0; }
.info-head-meta h2 {
    font-size: 19px; font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 4px;
}
.info-head-meta p {
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.4;
    max-width: 720px;
}
.info-head-meta p .muted { color: var(--text-muted); font-style: italic; }
.info-head-actions {
    display: flex; gap: 8px; margin-top: 10px;
}
.info-head-actions .btn-ghost { font-size: 12px; padding: 6px 11px; }

/* Layout en dos columnas: principal (1.5fr) + lateral (1fr) */
.info-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 18px;
    align-items: start;
}
.info-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}
@media (max-width: 980px) {
    .info-grid { grid-template-columns: 1fr; }
}

.info-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-xs);
}
.info-section-head {
    display: flex; align-items: center; gap: 9px;
    margin-bottom: 12px;
}
.info-section-head i {
    color: var(--primary);
    font-size: 13px;
    width: 18px; text-align: center;
}
.info-section-head h3 {
    font-size: 13px; font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .6px;
}
.info-section-body { font-size: 13.5px; color: var(--text-soft); }

.info-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 6px 0;
    font-style: italic;
}

/* ----- Links (dominios, repo) ----- */
.info-links { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.info-link-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    transition: border .15s, background .15s;
}
.info-link-item:hover { border-color: var(--border); background: var(--surface); }
.info-link-ico { color: var(--text-muted); font-size: 12px; flex-shrink: 0; width: 14px; text-align: center; }
.info-link-url {
    flex: 1; min-width: 0;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.info-link-url:hover { color: var(--primary); }
.info-link-open,
.info-link-copy {
    width: 26px; height: 26px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}
.info-link-open:hover,
.info-link-copy:hover { background: var(--primary-soft); color: var(--primary); }

/* ----- Donut chart ----- */
.donut-wrap {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    align-items: center;
}
.donut { display: block; }
.donut-seg { transition: stroke-width .15s; }
.donut-center {
    grid-column: 1; grid-row: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    pointer-events: none;
    text-align: center;
}
.donut-center-num { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.donut-center-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; }
.donut-legend { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.donut-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-label { flex: 1; color: var(--text-soft); }
.donut-legend-value { font-weight: 700; color: var(--text); }
@media (max-width: 520px) {
    .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
    .donut-legend { width: 100%; }
}

/* ----- Cuadrícula de actividad (estilo GitHub) ----- */
.commit-grid-wrap { display: flex; flex-direction: column; gap: 10px; }
.commit-grid {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.commit-col { display: flex; flex-direction: column; gap: 3px; }
.commit-cell {
    width: 12px; height: 12px;
    border-radius: 3px;
    background: var(--border-soft);
    display: inline-block;
    cursor: default;
    transition: outline .12s;
}
.commit-cell.future { background: transparent; }
.commit-cell:hover { outline: 1px solid var(--text-muted); outline-offset: 1px; }
.commit-cell.lvl-1 { background: color-mix(in srgb, var(--green) 28%, var(--border-soft)); }
.commit-cell.lvl-2 { background: color-mix(in srgb, var(--green) 50%, var(--border-soft)); }
.commit-cell.lvl-3 { background: color-mix(in srgb, var(--green) 72%, var(--border-soft)); }
.commit-cell.lvl-4 { background: var(--green); }

.commit-grid-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
}
.commit-total { font-size: 12px; color: var(--text-muted); }
.commit-legend { display: flex; align-items: center; gap: 4px; }
.commit-legend .commit-cell { width: 11px; height: 11px; }
.commit-legend-lbl { font-size: 11px; color: var(--text-muted); margin: 0 4px; }

/* ----- Mejoras: placeholder ----- */
.info-mejoras-placeholder {
    text-align: center;
    padding: 26px 16px;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}
.info-mejoras-placeholder i {
    font-size: 26px;
    color: var(--primary);
    opacity: .55;
    margin-bottom: 10px;
    display: block;
}
.info-mejoras-placeholder p {
    font-size: 13px;
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ----- Mejoras: timeline de entradas ----- */
.info-mejoras-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}
.info-mejora-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 11px 13px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    transition: border-color .15s, background .15s;
}
.info-mejora-item:hover { background: var(--surface); border-left-color: var(--primary-hover); }
/* La fecha encabeza el bloque, como badge destacado */
.info-mejora-date {
    display: inline-flex; align-items: center; gap: 7px;
    align-self: flex-start;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary-soft-2);
    border-radius: 999px;
    padding: 3px 11px;
    white-space: nowrap;
}
.info-mejora-date i { color: var(--primary); font-size: 11px; opacity: .8; flex-shrink: 0; }
.info-mejora-text {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.55;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Cada mensaje del log: chips de tipo/área arriba y el texto debajo */
.mejora-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 6px;
}
.mejora-line + .mejora-line {
    border-top: 1px dashed var(--border);
    padding-top: 9px;
}
.mejora-line-text { flex: 1 0 100%; min-width: 0; }
.mejora-area {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 6px;
    flex-shrink: 0;
}

/* Chips de tags [UPDATE], [FIX], etc. dentro del texto de mejoras */
.mejora-tag {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 4px;
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
    vertical-align: 1px;
    border: 1px solid transparent;
}
.mejora-line > .mejora-tag { margin-right: 0; flex-shrink: 0; }
.mejora-tag.tag-generic  { background: var(--surface);    color: var(--text-muted); border-color: var(--border); }
.mejora-tag.tag-blue     { background: var(--blue-soft);  color: var(--blue); }
.mejora-tag.tag-green    { background: var(--green-soft); color: var(--green); }
.mejora-tag.tag-red      { background: var(--red-soft);   color: var(--red); }
.mejora-tag.tag-red-solid{ background: var(--red);        color: #fff; }
.mejora-tag.tag-pink     { background: var(--pink-soft);  color: var(--pink); }
.mejora-tag.tag-amber    { background: var(--amber-soft); color: var(--amber); }
.mejora-tag.tag-muted    { background: var(--surface-2);  color: var(--text-muted); border-color: var(--border); }
.mejora-tag.tag-primary  { background: var(--primary-soft); color: var(--primary); }

/* ----- Drop-zone de archivos en Info ----- */
.info-attach-zone {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    margin-bottom: 10px;
    transition: background .15s, border-color .15s;
}
.info-attach-zone.drag-over { background: var(--primary-soft); border-color: var(--primary); }

/* =============================================================
   Editor de dominios (dentro del modal de proyecto)
   ============================================================= */
.label-hint { color: var(--text-muted); font-weight: 400; font-size: 11.5px; }

.domains-editor {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 8px;
}
.domain-row {
    display: flex; align-items: center; gap: 6px;
    flex-wrap: wrap;
}
.domain-row .domain-input {
    flex: 1; min-width: 180px;
    font-size: 13px;
    padding: 8px 10px;
}
.domain-row .domain-vence-input {
    width: 158px;
    flex-shrink: 0;
    font-size: 12.5px;
    padding: 8px 10px;
    color: var(--text-soft);
}
.domain-row .domain-vence-input.hidden { display: none; }
.domain-open {
    width: 34px; height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: background .15s, color .15s;
}
.domain-open:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.domain-del {
    width: 34px; height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: background .15s, color .15s;
}
.domain-del:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); }

.btn-add-domain {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    font-size: 12.5px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px dashed color-mix(in srgb, var(--primary) 40%, transparent);
    border-radius: var(--radius-sm);
    transition: background .15s;
}
.btn-add-domain:hover { background: var(--primary-soft-2); }

.repo-input-row {
    display: flex; gap: 6px;
}
.repo-input-row .form-input {
    flex: 1; min-width: 0;
    font-size: 13px;
    padding: 8px 10px;
}
.repo-open-btn {
    width: 40px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: background .15s, color .15s;
}
.repo-open-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

/* ===== Editor de repositorios (filas label+url) ===== */
.repos-editor {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 8px;
}
.repo-row {
    display: grid;
    grid-template-columns: 130px 1fr 34px 34px;
    gap: 6px;
    align-items: center;
}
.repo-row .form-input { font-size: 13px; padding: 8px 10px; }
.repo-label-input { color: var(--text-soft); font-weight: 500; }
.repo-url-input { min-width: 0; }
.repo-open {
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: background .15s, color .15s;
}
.repo-open:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
@media (max-width: 560px) {
    .repo-row { grid-template-columns: 1fr; }
    .repo-row .repo-open { height: 32px; }
}

/* Tag/etiqueta dentro del listado de repos del panel Info */
.info-link-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .4px;
    flex-shrink: 0;
}

/* Badge de vencimiento de dominio (en el listado del panel Info) */
.info-link-vence {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
}
.info-link-vence i { font-size: 9px; }
.info-link-vence.ok        { background: var(--green-soft);  color: var(--green); border-color: color-mix(in srgb, var(--green) 22%, transparent); }
.info-link-vence.proximo   { background: var(--amber-soft);  color: var(--amber); border-color: color-mix(in srgb, var(--amber) 22%, transparent); }
.info-link-vence.urgente   { background: var(--red-soft);    color: var(--red);   border-color: color-mix(in srgb, var(--red)   22%, transparent); }
.info-link-vence.vencido   { background: var(--red);         color: #fff;        border-color: var(--red); }
.info-link-vence.none      { background: var(--surface-2);   color: var(--text-muted); border-color: var(--border); font-style: italic; font-weight: 500; }
.info-link-vence.internal  { background: var(--blue-soft);   color: var(--blue); border-color: color-mix(in srgb, var(--blue) 22%, transparent); }

/* Chips de desglose por repo en la cuadrícula de actividad */
.commit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.commit-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 11.5px;
}
.commit-chip.is-error {
    background: var(--red-soft);
    border-color: color-mix(in srgb, var(--red) 30%, transparent);
}
.commit-chip-name { font-weight: 600; color: var(--text); }
.commit-chip-count { color: var(--text-muted); }
.commit-chip.is-error .commit-chip-count { color: var(--red); font-weight: 600; }
.commit-chip-link {
    color: var(--text-muted);
    font-size: 10px;
    margin-left: 2px;
    padding: 2px;
}
.commit-chip-link:hover { color: var(--primary); }

/* ----- Item "Info" en sidebar ----- */
.folder-info {
    background: rgba(99, 102, 241, 0.04);
}
.folder-info .folder-ico { font-size: 11px; }
.folder-info:hover { background: rgba(99, 102, 241, 0.10); }
.folder-info.active { background: var(--sidebar-active); }
