/* ═══════════════════════════════════════════════════════════════
   style.css — GesTrack Sistema de Gestión de Tareas
   Diseño premium con variables CSS, modo oscuro-claro y animaciones
═══════════════════════════════════════════════════════════════ */

/* ─── Variables de diseño ────────────────────────────────────── */
:root {
    --primary:       #6366f1;
    --primary-dark:  #4f46e5;
    --primary-light: #818cf8;
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --info:          #3b82f6;

    --bg-app:        #0f0f1a;
    --bg-sidebar:    #13131f;
    --bg-card:       #1a1a2e;
    --bg-card-hover: #1e1e35;
    --bg-input:      #22223a;
    --bg-modal:      #1c1c30;

    --text-primary:  #e8e8f0;
    --text-secondary:#9494b0;
    --text-muted:    #606080;

    --border:        rgba(255,255,255,.08);
    --border-hover:  rgba(255,255,255,.15);
    --shadow:        0 4px 24px rgba(0,0,0,.4);
    --shadow-card:   0 2px 12px rgba(0,0,0,.3);

    --sidebar-w:     260px;
    --radius:        12px;
    --radius-sm:     8px;
    --radius-lg:     16px;

    --font:          'Inter', system-ui, sans-serif;
    --transition:    all .2s ease;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg-app);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT APP
═══════════════════════════════════════════════════════════════ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .3s ease;
}
.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.logo {
    display: flex; align-items: center; gap: .6rem;
}
.logo-icon {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 8px; overflow: hidden;
}
.logo-img {
    width: 100%; height: 100%; object-fit: cover;
}
.logo-text {
    font-weight: 800; font-size: 1.2rem;
    background: linear-gradient(90deg, var(--primary-light), #c7b8ff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-user {
    padding: .9rem 1.25rem;
    display: flex; align-items: center; gap: .75rem;
    border-bottom: 1px solid var(--border);
}
.user-avatar {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700; font-size: .9rem; color: white;
    flex-shrink: 0;
}
.user-name  { font-weight: 600; font-size: .875rem; line-height: 1.2; }
.user-role  { font-size: .7rem; margin-top: .15rem; padding: .15rem .5rem; border-radius: 20px; display: inline-block; }
.user-role.admin        { background: #6366f122; color: var(--primary-light); }
.user-role.colaborador  { background: #10b98122; color: #34d399; }

.sidebar-nav { flex: 1; padding: .75rem 1rem; overflow-y: auto; }
.nav-section-label {
    font-size: .65rem; font-weight: 700; letter-spacing: .08em;
    color: var(--text-secondary); text-transform: uppercase;
    padding: 1rem .5rem .3rem; opacity: .7;
}
.nav-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .85rem; border-radius: var(--radius-sm);
    color: var(--text-secondary); text-decoration: none;
    font-size: .875rem; font-weight: 500;
    transition: var(--transition); cursor: pointer; border: none; background: none; width: 100%;
    margin-bottom: .15rem;
}
.nav-item:hover { background: rgba(99,102,241,.1); color: var(--primary-light); }
.nav-item.active { background: rgba(99,102,241,.18); color: #a5b4fc; font-weight: 600; }
.nav-item i { font-size: 1rem; width: 18px; }
.sidebar-footer { padding: .75rem 1rem; border-top: 1px solid var(--border); }
.logout-btn { color: #f87171 !important; }
.logout-btn:hover { background: rgba(239,68,68,.12) !important; color: #fca5a5 !important; }

/* ─── Main content ───────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex; flex-direction: column;
    min-height: 100vh;
}
.topbar {
    height: 60px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 900;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text-secondary); flex: 1; }
.btn-sidebar-toggle {
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.3rem; cursor: pointer; padding: .25rem;
    border-radius: var(--radius-sm); transition: var(--transition);
}
.btn-sidebar-toggle:hover { color: var(--text-primary); background: var(--border); }
.page-content { padding: 1.5rem; flex: 1; }
.flash-container { padding: .75rem 1.5rem 0; }
.flash-alert { border-radius: var(--radius-sm); border: none; }

/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh; display: flex; align-items: stretch;
    position: relative;
}
.login-bg {
    position: fixed; inset: 0; z-index: -1;
    background: radial-gradient(ellipse at 20% 50%, #4f46e530 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, #8b5cf630 0%, transparent 50%),
                var(--bg-app);
}
.login-container {
    display: flex; width: 100%; max-width: 900px;
    margin: auto; border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: var(--bg-card);
    overflow: hidden; min-height: 520px;
}
.login-branding {
    flex: 1; background: linear-gradient(135deg, #4f46e5, #7c3aed, #a21caf);
    padding: 3rem 2.5rem; display: flex; align-items: center;
    position: relative; overflow: hidden;
}
.login-branding::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.branding-content { position: relative; z-index: 1; color: white; }
.brand-logo {
    width: 64px; height: 64px;
    background: rgba(255,255,255,.2);
    border-radius: 18px; display: grid; place-items: center;
    font-size: 2rem; margin-bottom: 1.25rem;
    backdrop-filter: blur(10px);
}
.brand-name { font-size: 2.2rem; font-weight: 800; margin: 0 0 .5rem; }
.brand-subtitle { opacity: .85; margin-bottom: 1.5rem; font-size: .95rem; }
.brand-features { list-style: none; padding: 0; margin: 0; }
.brand-features li {
    display: flex; align-items: center; gap: .6rem;
    margin-bottom: .5rem; font-size: .9rem; opacity: .9;
}
.brand-features i { color: #a5f3fc; }

.login-form-panel { flex: 1; padding: 3rem 2.5rem; display: flex; align-items: center; }
.login-form-wrapper { width: 100%; }
.login-title    { font-size: 1.6rem; font-weight: 800; margin-bottom: .25rem; }
.login-subtitle { color: var(--text-secondary); margin-bottom: 1.75rem; }
.form-label     { font-weight: 600; font-size: .875rem; color: var(--text-secondary); margin-bottom: .4rem; }
.form-control, .form-select {
    background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: var(--radius-sm);
    padding: .6rem .875rem; font-size: .9rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    background: var(--bg-input); color: var(--text-primary);
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}
.form-control::placeholder { color: var(--text-secondary); opacity: .7; }
.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; }
.input-with-icon { padding-left: 2.4rem; }
.btn-toggle-pwd {
    position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-secondary); cursor: pointer;
    transition: var(--transition);
}
.btn-toggle-pwd:hover { color: var(--primary-light); }
.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none; padding: .7rem; font-weight: 600;
    border-radius: var(--radius-sm); color: white; font-size: .95rem;
    transition: var(--transition); position: relative; overflow: hidden;
}
.btn-login:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.4); }
.login-hint { font-size: .8rem; color: var(--text-secondary); padding: .75rem; background: var(--bg-input); border-radius: var(--radius-sm); border-left: 3px solid var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   KANBAN BOARD
═══════════════════════════════════════════════════════════════ */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.kanban-column {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    min-height: 200px;
}
.column-header {
    padding: .9rem 1rem;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.column-header.pending   { border-top: 3px solid #f59e0b; }
.column-header.inprogress{ border-top: 3px solid #3b82f6; }
.column-header.done      { border-top: 3px solid #10b981; }
.column-title { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .9rem; }
.column-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.column-header.pending   .column-dot { background: #f59e0b; }
.column-header.inprogress .column-dot{ background: #3b82f6; }
.column-header.done      .column-dot { background: #10b981; }
.column-count { background: var(--bg-input); color: var(--text-secondary); font-size: .75rem; }
.column-body { padding: .75rem; display: flex; flex-direction: column; gap: .6rem; min-height: 120px; }

/* Drag & drop */
.kanban-column.drag-over .column-body {
    background: rgba(99,102,241,.06);
    border-radius: var(--radius-sm);
    outline: 2px dashed var(--primary);
    outline-offset: -4px;
}
.tarea-card.dragging { opacity: .4; transform: rotate(2deg) scale(.97); }

/* ─── Tarjeta de tarea ───────────────────────────────────────── */
.tarea-card {
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .875rem;
    cursor: grab;
    transition: var(--transition);
    position: relative;
    animation: slideIn .25s ease;
}
.tarea-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    transform: translateY(-2px);
}
.tarea-card.card-done { opacity: .7; }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card-tag {
    display: inline-block; padding: .2rem .6rem;
    border-radius: 4px; font-size: .7rem; font-weight: 600;
    margin-bottom: .5rem;
}
.card-title-link { text-decoration: none; }
.card-task-title {
    font-size: .875rem; font-weight: 600;
    color: var(--text-primary); margin: 0 0 .6rem; line-height: 1.35;
}
.card-title-link:hover .card-task-title { color: var(--primary-light); }

/* ─── Barra de progreso ──────────────────────────────────────── */
.progress-section { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.progress-bar-wrap {
    flex: 1; height: 5px; background: var(--bg-input); border-radius: 3px; overflow: hidden;
}
.progress-bar-fill {
    height: 100%; border-radius: 3px; transition: width .4s ease;
    background: #4b5563;
}
.progress-bar-fill.partial  { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.progress-bar-fill.complete { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-pct { font-size: .7rem; font-weight: 700; color: var(--text-secondary); min-width: 32px; text-align: right; }

.card-meta {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .35rem;
}
.card-assignees { display: flex; flex-wrap: wrap; gap: .25rem; }
.assignee-chip {
    background: rgba(99,102,241,.15); color: var(--primary-light);
    font-size: .68rem; padding: .15rem .5rem; border-radius: 20px; font-weight: 500;
}
.assignee-chip.more { background: var(--bg-input); color: var(--text-secondary); }
.due-date { font-size: .72rem; color: var(--text-secondary); display: flex; align-items: center; gap: .25rem; }
.due-date.overdue { color: #f87171; }

/* ─── Alertas de vencimiento en tarjeta ───────────────── */
.due-alert {
    font-size: .72rem; font-weight: 700;
    padding: .25rem .6rem; border-radius: 6px;
    display: flex; align-items: center; gap: .3rem;
}
.due-alert.vencido  { background: rgba(239,68,68,.18);  color: #fca5a5; }
.due-alert.proximo  { background: rgba(251,191,36,.15); color: #fde68a; }

.card-subtasks { font-size: .72rem; color: var(--text-secondary); margin-top: .4rem; display: flex; align-items: center; gap: .3rem; }

.card-actions {
    display: none; gap: .25rem; margin-top: .5rem; justify-content: flex-end;
}
.tarea-card:hover .card-actions { display: flex; }
.btn-card-action {
    background: var(--bg-input); border: none; width: 28px; height: 28px;
    border-radius: 6px; display: grid; place-items: center;
    color: var(--text-secondary); cursor: pointer; font-size: .8rem;
    transition: var(--transition);
}
.btn-card-action:hover { background: var(--primary); color: white; }
.btn-card-action.danger:hover { background: var(--danger); color: white; }

/* Empty column */
.empty-column {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 2rem 1rem; color: var(--text-secondary); text-align: center; gap: .5rem;
}
.empty-column i { font-size: 1.75rem; opacity: .5; }
.empty-column p  { font-size: .85rem; margin: 0; }

/* ─── Filtros ────────────────────────────────────────────────── */
.filters-bar {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: .75rem; margin-bottom: 1.25rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .75rem 1rem;
}
.filter-select { max-width: 180px; }
.stats-pills { display: flex; gap: .5rem; }
.stat-pill {
    font-size: .75rem; font-weight: 600; padding: .3rem .75rem;
    border-radius: 20px; white-space: nowrap;
}
.stat-pill.pending    { background: #f59e0b22; color: #fcd34d; }
.stat-pill.inprogress { background: #3b82f622; color: #93c5fd; }
.stat-pill.done       { background: #10b98122; color: #6ee7b7; }

/* ═══════════════════════════════════════════════════════════════
   DETAIL PAGE
═══════════════════════════════════════════════════════════════ */
.detalle-wrapper { }
.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.detail-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: .75rem;
}
.detail-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 .75rem; line-height: 1.3; }
.detail-description { color: var(--text-secondary); font-size: .9rem; margin-bottom: .75rem; }
.detail-field { margin-top: .75rem; }
.field-label {
    font-size: .78rem; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: .35rem;
    display: flex; align-items: center; gap: .35rem;
}
.field-value { font-size: .9rem; }
.resp-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.25);
    color: #a5b4fc; padding: .3rem .7rem; border-radius: 20px;
    font-size: .8rem; margin-right: .35rem; margin-bottom: .35rem;
}
.resp-avatar {
    width: 22px; height: 22px; background: var(--primary);
    border-radius: 50%; display: grid; place-items: center;
    font-size: .7rem; font-weight: 700; color: white;
}
.seccion-badge {
    display: inline-block; padding: .25rem .7rem; border-radius: 6px;
    font-size: .78rem; font-weight: 600; margin-right: .4rem;
}
.seccion-badge-sm {
    display: inline-block; padding: .15rem .5rem; border-radius: 5px;
    font-size: .72rem; font-weight: 600;
}
.estado-badge {
    display: inline-block; padding: .25rem .7rem; border-radius: 6px;
    font-size: .78rem; font-weight: 600;
}
.estado-badge.pendiente  { background: #f59e0b22; color: #fcd34d; }
.estado-badge.en_proceso { background: #3b82f622; color: #93c5fd; }
.estado-badge.finalizada { background: #10b98122; color: #6ee7b7; }
.progress-big { height: 10px; background: var(--bg-input); border-radius: 5px; overflow: hidden; }
.progress-big-bar {
    height: 100%; border-radius: 5px; transition: width .4s ease;
    background: #4b5563;
}
.progress-big-bar.partial  { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.progress-big-bar.complete { background: linear-gradient(90deg, #10b981, #34d399); }

/* ─── Checklist ──────────────────────────────────────────────── */
.checklist-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; gap: .75rem;
}
.checklist-header h5 { margin: 0; font-size: 1rem; font-weight: 700; }
.add-subtask-form { margin-bottom: 1rem; }
.subtask-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.subtask-item {
    display: flex; align-items: center; gap: .65rem;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: .6rem .75rem;
    transition: var(--transition);
    position: relative;
}
.subtask-item:hover { border-color: var(--border-hover); transform: translateX(2px); }

/* ─── Adjuntos ───────────────────────────────────────────────── */
.adjuntos-section { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }
.adjuntos-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.adjunto-item {
    display: flex; align-items: center; justify-content: space-between;
    background: #1e1e35; padding: .6rem .8rem; border-radius: 8px;
    border: 1px solid var(--border); font-size: .85rem;
}
.adjunto-info { display: flex; align-items: center; gap: .6rem; overflow: hidden; }
.adjunto-name { 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
    max-width: 250px; color: #e8e8f0; text-decoration: none;
}
.adjunto-name:hover { color: var(--primary); }
.adjunto-meta { font-size: .7rem; color: var(--text-secondary); }
.adjunto-actions { display: flex; gap: .4rem; }

.btn-adjunto {
    background: transparent; border: none; color: var(--text-secondary);
    width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center;
    transition: .2s;
}
.btn-adjunto:hover { background: rgba(255,255,255,.1); color: white; }
.btn-adjunto.delete:hover { color: var(--danger); }

/* Clip icon in subtask (Mini) */
.btn-subtask-action.attach { color: var(--text-secondary); }
.btn-subtask-action.attach:hover { color: #10b981; }
.subtask-adjuntos-mini {
    display: flex; gap: .3rem; margin-left: auto; margin-right: .5rem;
}
.mini-adjunto {
    width: 22px; height: 22px; background: rgba(16,185,129,.15);
    color: #34d399; border-radius: 4px; display: grid; place-items: center;
    font-size: .7rem; cursor: pointer; transition: .2s;
}
.mini-adjunto:hover { background: rgba(16,185,129,.3); transform: scale(1.1); }

/* ─── Comentarios y Actividades ──────────────────────────────── */
.audit-section { margin-top: 2rem; }
.audit-tabs {
    display: flex; gap: 1rem; border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.audit-tab {
    padding: .6rem 1rem; cursor: pointer; color: var(--text-secondary);
    font-size: .9rem; font-weight: 600; border-bottom: 2px solid transparent;
    transition: .2s;
}
.audit-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.audit-content { display: none; }
.audit-content.active { display: block; }

/* Activities Feed */
.activity-feed { display: flex; flex-direction: column; gap: .75rem; }
.activity-item {
    display: flex; gap: .75rem; font-size: .85rem; padding: .5rem 0;
    border-left: 2px solid var(--border); padding-left: 1rem; position: relative;
}
.activity-item::before {
    content: ''; position: absolute; left: -5px; top: 10px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--border);
}
.activity-item.creacion::before { background: #3b82f6; }
.activity-item.estado::before   { background: #f59e0b; }
.activity-item.archivo::before  { background: #10b981; }

.activity-user { font-weight: 700; color: #e8e8f0; }
.activity-desc { color: var(--text-secondary); }
.activity-time { font-size: .7rem; color: #6b7280; margin-left: auto; }

/* Comments Chat */
.comments-list { display: flex; flex-direction: column; gap: 1rem; max-height: 400px; overflow-y: auto; padding-right: .5rem; }
.comment-item { display: flex; flex-direction: column; gap: .25rem; }
.comment-header { display: flex; justify-content: space-between; align-items: center; font-size: .75rem; }
.comment-user { font-weight: 700; color: var(--primary); }
.comment-time { color: #6b7280; }
.comment-bubble {
    background: #1e1e35; border: 1px solid var(--border);
    padding: .75rem; border-radius: 12px; font-size: .88rem; color: #d1d5db;
    line-height: 1.4; white-space: pre-wrap;
}
.comment-form { margin-top: 1.25rem; }
.comment-input-wrapper { position: relative; }
#comentario-texto { border-radius: 10px; padding-right: 3rem; }
.btn-send-comment {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: transparent; border: none; color: var(--primary); font-size: 1.1rem;
}
.subtask-check { flex-shrink: 0; }
.subtask-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.subtask-label { flex: 1; font-size: .875rem; cursor: pointer; }
.subtask-actions { display: none; gap: .25rem; }
.subtask-item:hover .subtask-actions { display: flex; }
.btn-subtask-action {
    background: none; border: none; width: 26px; height: 26px;
    border-radius: 5px; display: grid; place-items: center;
    color: var(--text-secondary); cursor: pointer; font-size: .75rem;
    transition: var(--transition);
}
.btn-subtask-action.edit:hover   { background: rgba(99,102,241,.2); color: var(--primary-light); }
.btn-subtask-action.delete:hover { background: rgba(239,68,68,.2);  color: #f87171; }
.empty-checklist {
    text-align: center; padding: 2rem; color: var(--text-secondary);
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.empty-checklist i { font-size: 2rem; opacity: .4; }
.empty-checklist p { font-size: .85rem; margin: 0; }

/* ─── Status buttons ─────────────────────────────────────────── */
.btn-estado { font-size: .78rem; padding: .3rem .65rem; transition: var(--transition); }

/* ═══════════════════════════════════════════════════════════════
   TABLEROS (HOME)
═══════════════════════════════════════════════════════════════ */
.tablero-page-title { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text-primary); }
.tablero-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 10px rgba(255,255,255,.2); }
.nav-board-item { padding-left: 1.5rem; font-size: .8rem; }
.nav-board-dot { width: 8px; height: 8px; border-radius: 50%; margin-right: .5rem; }
.nav-board-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.board-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    border-top: 4px solid var(--board-color, var(--primary));
    display: flex; flex-direction: column;
    cursor: grab;
}
.board-card:active {
    cursor: grabbing;
}
.board-card.dragging {
    opacity: 0.4;
    transform: scale(0.96) !important;
    border: 2px dashed var(--primary);
    box-shadow: none !important;
}
.board-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
    border-color: var(--border-hover);
}
.board-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 1.25rem 1.25rem 0;
}
.board-icon {
    width: 44px; height: 44px;
    border-radius: 12px; display: grid; place-items: center;
    font-size: 1.4rem; color: white;
    background: linear-gradient(135deg, var(--board-color, var(--primary)), rgba(255,255,255,.2));
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.board-actions { display: flex; gap: .25rem; opacity: 0; transition: var(--transition); }
.board-card:hover .board-actions { opacity: 1; }
.btn-board-action {
    background: var(--bg-input); border: none; width: 28px; height: 28px;
    border-radius: 6px; display: grid; place-items: center;
    color: var(--text-secondary); cursor: pointer; font-size: .8rem;
    transition: var(--transition);
}
.btn-board-action:hover { background: var(--primary); color: white; }
.btn-board-action.danger:hover { background: var(--danger); }

.board-card-body {
    padding: 1rem 1.25rem 1.25rem; flex: 1;
    display: flex; flex-direction: column;
    text-decoration: none; color: inherit;
}
.board-name { font-size: 1.15rem; font-weight: 700; margin: 0 0 .4rem; transition: var(--transition); }
.board-card-body:hover .board-name { color: var(--board-color, var(--primary-light)); }
.board-desc { font-size: .85rem; color: var(--text-secondary); margin: 0 0 1rem; line-height: 1.4; flex: 1; }

.board-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
    margin-bottom: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.board-stat { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; }
.stat-num { font-size: 1.1rem; font-weight: 800; line-height: 1; }
.stat-lbl { font-size: .65rem; color: var(--text-secondary); text-transform: uppercase; font-weight: 600; letter-spacing: .05em; }
.stat-num.pending { color: #fcd34d; }
.stat-num.inprogress { color: #93c5fd; }
.stat-num.done { color: #6ee7b7; }

.board-progress { height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; margin-bottom: .4rem; }
.board-progress-bar { height: 100%; background: linear-gradient(90deg, var(--board-color, var(--primary)), #a5b4fc); border-radius: 3px; transition: width .5s ease; }
.board-progress-label { font-size: .75rem; color: var(--text-secondary); display: flex; justify-content: space-between; font-weight: 500; }

.board-card-add {
    border: 2px dashed var(--border); border-top: 2px dashed var(--border);
    cursor: pointer; background: transparent; display: flex; align-items: center; justify-content: center;
    min-height: 220px;
}
.board-card-add:hover { background: rgba(99,102,241,.05); border-color: var(--primary); }
.board-add-content { display: flex; flex-direction: column; align-items: center; gap: .75rem; color: var(--text-secondary); transition: var(--transition); }
.board-card-add:hover .board-add-content { color: var(--primary); transform: scale(1.05); }
.board-add-icon { font-size: 2.5rem; }
.board-add-label { font-size: 1rem; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   TABLAS
═══════════════════════════════════════════════════════════════ */
.data-table {
    color: var(--text-primary);
    border-color: var(--border);
}
.data-table thead th {
    background: var(--bg-card); border-color: var(--border);
    font-size: .78rem; font-weight: 700; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: .05em;
    white-space: nowrap;
}
.data-table tbody td { background: var(--bg-card); border-color: var(--border); vertical-align: middle; color: var(--text-primary); }
.data-table tbody tr:hover td { background: var(--bg-card-hover); }
.data-table .text-muted,
.data-table .small.text-muted,
.data-table td.text-muted { color: var(--text-secondary) !important; }
.data-table td.small,
.data-table .small { color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   EXCEL UPLOAD
═══════════════════════════════════════════════════════════════ */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}
.upload-dropzone.drag-over, .upload-dropzone.has-file {
    border-color: var(--primary);
    background: rgba(99,102,241,.06);
}
.upload-icon { font-size: 3rem; color: var(--text-secondary); margin-bottom: .75rem; display: block; }
.upload-text { font-weight: 600; margin-bottom: .5rem; }
.upload-hint { font-size: .8rem; color: var(--text-secondary); margin-top: .5rem; margin-bottom: 0; }
.info-box {
    background: var(--bg-input); border-radius: var(--radius-sm);
    padding: 1rem; border-left: 3px solid var(--info);
}
.import-history { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.import-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-input); border-radius: var(--radius-sm); padding: .6rem .75rem;
}

/* ═══════════════════════════════════════════════════════════════
   USUARIOS
═══════════════════════════════════════════════════════════════ */
.mini-avatar {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 50%; display: grid; place-items: center;
    font-weight: 700; font-size: .8rem; color: white; flex-shrink: 0;
}
.rol-badge {
    padding: .2rem .65rem; border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.rol-badge.administrador { background: rgba(99,102,241,.15); color: var(--primary-light); }
.rol-badge.colaborador   { background: rgba(16,185,129,.15);  color: #34d399; }

/* ═══════════════════════════════════════════════════════════════
   MODALES
═══════════════════════════════════════════════════════════════ */
.app-modal {
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
}
.app-modal .modal-header { border-bottom: 1px solid var(--border); }
.app-modal .modal-footer { border-top:    1px solid var(--border); }
.app-modal .btn-close     { filter: invert(1) brightness(.6); }

/* ═══════════════════════════════════════════════════════════════
   ERROR PAGES
═══════════════════════════════════════════════════════════════ */
.error-page {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 70vh; text-align: center;
}
.error-code {
    font-size: 8rem; font-weight: 800; line-height: 1;
    background: linear-gradient(135deg, var(--primary-light), #f0abfc);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: .5rem;
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center; padding: 3rem;
}
.empty-icon { font-size: 3.5rem; color: var(--text-secondary); opacity: .3; margin-bottom: 1rem; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS & BADGES
═══════════════════════════════════════════════════════════════ */
.btn-primary  { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border: none; }
.btn-primary:hover { opacity: .88; box-shadow: 0 4px 14px rgba(99,102,241,.4); }
.btn-success  { background: linear-gradient(135deg, #059669, var(--success)); border: none; }
.btn-success:hover { opacity: .88; }
.badge-sm     { font-size: .65rem; padding: .15rem .45rem; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MÓVIL
═══════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.55); z-index: 999;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

@media (max-width: 991.98px) {
    .main-content { margin-left: 0; }
    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }
    .sidebar.open { transform: translateX(0); }
    .kanban-board {
        grid-template-columns: 1fr;
    }
    .login-branding { display: none; }
    .login-container { max-width: 440px; }
    .login-form-panel { padding: 2rem 1.5rem; }
    .btn-sidebar-toggle.d-lg-none { display: block !important; }
}

@media (max-width: 575.98px) {
    .page-content { padding: 1rem; }
    .detail-card { padding: 1rem; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-select { max-width: 100%; }
    .stats-pills { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR PERSONALIZADO
═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ─── Animaciones globales ───────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}
.page-content { animation: fadeIn .3s ease; }
