/* =========================================================
   Eisenhower — Task Board (PWA)
   - Dark-first, minimal, responsive
   - Arrastrar + reordenar con placeholder
   ========================================================= */

/* Reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0b1220;
  color: #e5e7eb;
}

/* Tokens */
:root{
  --bg:#0b1220;
  --surface:#101827;
  --surface-2:#0f172a;
  --border:#1f2937;
  --muted:#9aa4b2;
  --brand:#22c55e;
  --brand-2:#7dd3fc;
  --warning:#f59e0b;
  --danger:#ef4444;
  --ok:#10b981;
  --radius:14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* Topbar */
.topbar{
  display:flex; align-items:center; gap:16px;
  padding:16px clamp(16px, 4vw, 32px);
  border-bottom:1px solid var(--border);
  background: linear-gradient(180deg, #0b1220, #0b1220cc);
  position: sticky; top:0; backdrop-filter: blur(6px); z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 600;
}

.brand .logo {
  width: 250px;     /* ajustá el tamaño */
  height: auto;
  display: block;
}

.search{
  background: var(--surface);
  border:1px solid var(--border);
  color:#e5e7eb; outline:0;
  padding:10px 12px; border-radius: 12px; width:min(320px, 44vw);
}
.btn{
  border:1px solid var(--border);
  background: var(--surface);
  color:#e5e7eb; padding:10px 14px; border-radius:12px; cursor:pointer;
}
.btn.primary{ background: linear-gradient(180deg, #22c55e, #16a34a); border-color: transparent; color:#041108; font-weight:600; }
.btn.ghost{ background: transparent; }
.btn.danger{ background: linear-gradient(180deg, #ef4444, #b91c1c); border-color: transparent; color:#fff; }

/* Grid Matriz */
.grid{
  padding: clamp(12px, 3vw, 20px);
  display:grid; gap:12px;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(180px, auto);
  max-width: 1200px; margin-inline:auto;
}

.legend{
  display:grid; grid-template-columns: .7fr 1fr 1fr;
  gap:12px; align-items:center; color:var(--muted);
  grid-column: 1 / -1;
}
.legend > div{ padding:6px 4px; }
.legend-desc{ font-size: 12px; color: var(--muted); }

.col{
  background: var(--surface-2);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display:flex; flex-direction: column; min-height: 260px;
}

/* ======== Colores por cuadrante (pastel) ======== */
.col[data-quadrant="Q1"] {
  background: #ffe5e5;  /* rojo pastel (urgente e importante) */
  border-color: #ffb3b3;
}

.col[data-quadrant="Q2"] {
  background: #e5f6ff;  /* azul pastel (planificar) */
  border-color: #b3e0ff;
}

.col[data-quadrant="Q3"] {
  background: #fff8e5;  /* amarillo pastel (delegar) */
  border-color: #ffe9a3;
}

.col[data-quadrant="Q4"] {
  background: #e9ffe5;  /* verde pastel (eliminar / ocio) */
  border-color: #b9ffb3;
}

/* ======== Colores por cuadrante (pastel translúcido) ======== */
.col[data-quadrant="Q1"] { background: rgba(255, 170, 170, 0.3); }  /* rojo pastel */
.col[data-quadrant="Q2"] { background: rgba(170, 220, 255, 0.3); }  /* azul pastel */
.col[data-quadrant="Q3"] { background: rgba(255, 235, 170, 0.3); }  /* amarillo pastel */
.col[data-quadrant="Q4"] { background: rgba(180, 255, 180, 0.3); }  /* verde pastel */

.col[data-quadrant="Q1"] { border-color: rgba(255, 100, 100, 0.6); }
.col[data-quadrant="Q2"] { border-color: rgba(100, 180, 255, 0.6); }
.col[data-quadrant="Q3"] { border-color: rgba(255, 210, 100, 0.6); }
.col[data-quadrant="Q4"] { border-color: rgba(100, 255, 100, 0.6); }



.col header{
  display:flex; gap:8px; align-items:baseline;
  padding:12px 14px; border-bottom:1px solid var(--border);
}
.col h2{ font-size: 16px; margin:0; }
.col small{ color: var(--muted); }
.count{
  margin-left:auto; font-size:12px; color: #a1a1aa; background:#0b1220;
  padding:2px 8px; border-radius:999px; border:1px solid var(--border);
}
.dropzone{
  padding:12px; display:grid; gap:12px; align-content:flex-start;
  grid-auto-rows: minmax(64px, auto);
}
.dropzone.dragover{ outline: 2px dashed var(--brand-2); outline-offset: 6px; border-radius: 10px; }

/* Placeholder para reordenar */
.placeholder{
  height: 64px;
  border:2px dashed var(--brand-2);
  border-radius:12px;
  background: #0b122033;
}

/* Task Card */
.task{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: 14px; padding:10px 12px;
  box-shadow: var(--shadow);
}
.task[aria-grabbed="true"]{ opacity:.75; transform: scale(.98); }
.task-head{ display:flex; gap:8px; align-items:center; }
.task-title{ margin:0; font-size:14px; flex:1; }
.badge{
  width:12px; height:12px; border-radius: 999px;
  background: var(--brand);
  border:1px solid #0b1220;
}
.icon-btn{
  border:0; background:transparent; color:#cbd5e1; cursor:pointer;
  padding:6px; border-radius:10px;
}
.icon-btn:hover{ background:#0b1220; }
.task-desc{ color:#cbd5e1; margin:6px 0 8px; font-size:13px; }
.task-foot{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{
  font-size:12px; color:#a3a3a3; border:1px solid var(--border);
  padding:4px 8px; border-radius:999px; background:#0b1220;
}
.chip.due.overdue{ color:#fff; border-color: #ef4444; background:#7f1d1d; }
.chip.due.soon{ color:#111827; background:#f59e0b; border-color: transparent; }
.chip.status.done{ color:#111827; background:#10b981; border-color: transparent; }

/* Subtareas en modal */
.subtasks legend{ color:#cbd5e1; }
.subtasks-list{ display:grid; gap:8px; }
.subtasks-item{
  display:flex; gap:8px; align-items:center; background:#0b1220; border:1px solid var(--border);
  border-radius:10px; padding:6px 8px;
}
.subtasks-item input[type="text"]{
  flex:1; background:transparent; border:0; color:#e5e7eb; outline:none;
}
.subtasks-new{ display:flex; gap:8px; align-items:center; }

/* Modal */
.modal{
  border:1px solid var(--border);
  background: var(--surface-2);
  color:#e5e7eb; border-radius: 16px; width:min(800px, 96vw);
  padding:0; box-shadow: var(--shadow);
}
.modal::backdrop{ background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.modal-header{
  display:flex; align-items:center; gap:8px; padding:12px 14px;
  border-bottom:1px solid var(--border);
}
.modal-footer{
  display:flex; gap:8px; padding:12px 14px; border-top:1px solid var(--border);
}
.form-grid{
  display:grid; gap:12px; padding:14px; grid-template-columns: 1fr 1fr;
}
.fld{ display:flex; flex-direction: column; gap:6px; }
.fld-col2{ grid-column: span 2; }
.fld input, .fld textarea, .fld select{
  background:#0b1220; border:1px solid var(--border); color:#e5e7eb;
  border-radius:12px; padding:10px 12px; outline:0;
}
.check{ display:flex; gap:10px; align-items:center; }

/* Toasts */
.toasts{
  position: fixed; right: 16px; bottom: 16px;
  display:flex; flex-direction: column; gap:8px; z-index:999;
}
.toast{
  background:#111827; border:1px solid var(--border);
  color:#e5e7eb; padding:10px 12px; border-radius:12px; box-shadow: var(--shadow);
  max-width: 340px;
}

/* Responsive */
@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
  .legend{ grid-template-columns: .7fr 1fr 1fr; }
  .form-grid{ grid-template-columns: 1fr; }
}

#desc{ min-height: 220px; }

/* ======== PANEL DE ESTADÍSTICAS ======== */
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.stat {
  flex: 1 1 150px;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  padding: 16px 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform .2s ease;
}
.stat:hover { transform: translateY(-3px); }

.stat h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 8px;
}

.stat p {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--brand-2);
}

/* ======== RESPONSIVE DESIGN ======== */

/* 🧊 Tablets (≤1024px) */
@media (max-width: 1024px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .search {
    width: 100%;
  }
  .stats {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
  }
  .stat {
    flex: 1 1 45%;
    min-width: 200px;
  }
  .grid {
    grid-template-columns: 1fr 1fr;
  }
  .col {
    min-height: 220px;
  }
}

/* 📲 Celulares (≤768px) */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  .brand {
    justify-content: center;
    text-align: center;
  }
  .actions {
    justify-content: center;
    margin-top: 8px;
  }

  .stats {
    flex-direction: column;
    padding: 10px;
  }
  .stat {
    width: 100%;
    min-width: unset;
    padding: 12px 10px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .legend {
    grid-template-columns: 1fr 1fr;
    font-size: 12px;
    text-align: center;
  }

  .modal {
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .btn, .search {
    width: 100%;
  }

  .task {
    padding: 8px 10px;
  }
}

/* 📱 Mini móviles (≤480px) */
@media (max-width: 480px) {
  .brand span {
    font-size: 16px;
  }
  .stat h3 {
    font-size: 12px;
  }
  .stat p {
    font-size: 18px;
  }
  .task-title {
    font-size: 13px;
  }
  .task-desc {
    font-size: 12px;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
}

