:root {
  --sidebar-bg: #0f172a;
  --sidebar-width: 250px;
  --primary: #6366f1;
  --body-bg: #f1f5f9;
}

body { background: var(--body-bg); font-family: 'Segoe UI', sans-serif; }

/* SIDEBAR */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform .3s ease;
}
#sidebar.active { transform: translateX(0); }

.sidebar-header { padding: 1.5rem 1.25rem 1rem; }
.logo { color: #fff; font-size: 1.2rem; font-weight: 700; letter-spacing: .5px; }
.logo i { color: var(--primary); }

.sidebar-user {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; flex-shrink: 0;
}

.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-nav .nav-link {
  color: #94a3b8; padding: .6rem 1.25rem;
  display: flex; align-items: center; gap: .6rem;
  border-radius: 0; transition: all .2s;
}
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link.active {
  color: #fff; background: rgba(99,102,241,.2);
  border-left: 3px solid var(--primary);
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; }
.nav-divider { border-top: 1px solid rgba(255,255,255,.08); margin: .5rem 0; }
.nav-label { color: #475569; font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; padding: .5rem 1.25rem; }

.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); }

/* MAIN CONTENT */
#page-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  flex: 1;
}

.topbar {
  background: #fff; border-bottom: 1px solid #e2e8f0;
  padding: .75rem 1.5rem; position: sticky; top: 0; z-index: 99;
}

.content-area { padding: 1.5rem; }

/* CARDS */
.card { border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-radius: 12px; }
.card-header { background: #fff; border-bottom: 1px solid #e2e8f0; font-weight: 600; border-radius: 12px 12px 0 0 !important; }

/* STAT CARDS */
.stat-card { border-radius: 12px; padding: 1.25rem; color: #fff; }
.stat-card .stat-icon { font-size: 2rem; opacity: .8; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; opacity: .85; margin-top: .25rem; }

/* DUE STATUS BADGES (semáforo) */
.due-ok { color: #22c55e; }
.due-soon { color: #f59e0b; animation: pulse-warning 1.5s infinite; }
.due-overdue { color: #ef4444; animation: pulse-danger 1s infinite; }
.due-none { color: #94a3b8; }
.due-done { color: #22c55e; }

@keyframes pulse-warning {
  0%, 100% { opacity: 1; } 50% { opacity: .5; }
}
@keyframes pulse-danger {
  0%, 100% { opacity: 1; } 50% { opacity: .3; }
}

/* KANBAN */
.kanban-board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; min-height: 70vh; }
.kanban-col { min-width: 240px; max-width: 280px; flex-shrink: 0; }
.kanban-col-header {
  padding: .6rem 1rem; border-radius: 8px 8px 0 0;
  font-weight: 600; font-size: .85rem; color: #fff;
  display: flex; justify-content: space-between; align-items: center;
}
.kanban-cards {
  background: #f8fafc; border: 1px solid #e2e8f0; border-top: none;
  border-radius: 0 0 8px 8px; min-height: 400px; padding: .5rem;
}
.kanban-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: .75rem; margin-bottom: .5rem; cursor: grab;
  transition: box-shadow .2s; font-size: .85rem;
}
.kanban-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.kanban-card.sortable-ghost { opacity: .4; }
.kanban-card .task-title { font-weight: 600; margin-bottom: .3rem; }
.kanban-card .task-meta { color: #64748b; font-size: .75rem; }

/* TASK TIMELINE */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: .5rem; top: 0; bottom: 0; width: 2px; background: #e2e8f0; }
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-dot {
  position: absolute; left: -1.75rem; top: .2rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary);
}
.timeline-body { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: .75rem 1rem; }
.timeline-meta { font-size: .75rem; color: #64748b; }

/* PROGRESS BAR */
.progress { height: 6px; border-radius: 3px; }

/* RESPONSIVE */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.active { transform: translateX(0); }
  #page-content { margin-left: 0; }
}
