/* =========================================================
   Gestor de tareas — Jaurés y Cía.
   Paleta compartida con Legal Wellness (navy + verde menta).
   ========================================================= */

:root {
  --navy: #0F2340;
  --emerald: #2DC89A;
  --emerald-deep: #1A7A5E;

  --ink: #0F2340;
  --ink-soft: #3a4a5c;
  --muted: #5d6b7a;
  --line: #e4e7ec;
  --bg: #F5F4F0;
  --surface: #ffffff;
  --brand: #0F2340;
  --brand-600: #0a1830;
  --brand-100: #e3f3ec;
  --accent: #2DC89A;

  --ok: #1A7A5E;
  --ok-bg: #e3f3ec;
  --wait: #b9821f;
  --wait-bg: #fbf0d8;
  --danger: #c0492f;
  --danger-bg: #fbe4de;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17, 36, 31, .06), 0 1px 3px rgba(17, 36, 31, .08);
  --shadow: 0 10px 30px -12px rgba(17, 36, 31, .25);
  --shadow-lg: 0 24px 60px -20px rgba(17, 36, 31, .35);

  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font-sans); color: var(--ink); background: var(--bg);
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-sans); font-weight: 600; font-size: .9rem;
  padding: .6rem 1.05rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-600); box-shadow: var(--shadow); }
.btn--accent { background: var(--emerald); color: var(--navy); box-shadow: var(--shadow-sm); }
.btn--accent:hover { background: #25b88c; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: #fff; border-color: var(--emerald-deep); color: var(--emerald-deep); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger-bg); }
.btn--danger:hover { background: var(--danger-bg); }
.btn--block { width: 100%; }
.btn--sm { padding: .4rem .75rem; font-size: .8rem; }
.btn--icon { padding: .4rem; width: 32px; height: 32px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ===== Marca / Login ===== */
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; }
.brand__mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--emerald); color: var(--navy); font-family: var(--font-display); font-weight: 700; font-size: .82rem;
}
.brand__name { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: -.01em; }
.brand__name strong { color: var(--emerald-deep); font-weight: 600; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login__card {
  width: min(400px, 100%); background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 2.2rem 2rem; text-align: center;
}
.login__card .brand { justify-content: center; margin-bottom: .4rem; }
.login__title { font-size: 1.5rem; margin: .6rem 0 .3rem; }
.login__sub { color: var(--muted); margin-bottom: 1.5rem; font-size: .92rem; }
.field { text-align: left; margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: .6rem .75rem; border-radius: var(--radius-sm); border: 1px solid var(--line);
  font-family: inherit; font-size: .92rem; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--emerald); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.login-error { color: var(--danger); font-size: .85rem; margin-top: .6rem; min-height: 1.1em; }
.login__demo { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); text-align: left; }
.login__demo code { color: var(--emerald-deep); }

/* ===== Shell de la app ===== */
.app-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #cdd9d5; padding: 1.3rem 1rem; display: flex; flex-direction: column; }
.sidebar .brand { padding: .3rem .5rem 1.3rem; }
.sidebar .brand__name, .sidebar .brand__name strong { color: #fff; }
.side-section-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #7f9690; padding: .8rem .7rem .4rem; }
.side-link {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 10px;
  cursor: pointer; font-size: .88rem; font-weight: 500; color: #cdd9d5; position: relative;
}
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.is-active { background: var(--emerald-deep); color: #fff; }
.side-link .si { width: 18px; text-align: center; }
.side-link .side-badge {
  margin-left: auto; background: rgba(255,255,255,.18); color: #fff; font-size: .7rem; font-weight: 700;
  padding: .1rem .45rem; border-radius: 999px;
}
.sidebar__foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); }
.side-user { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--emerald-deep); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.side-user .su-name { font-size: .82rem; color: #fff; font-weight: 600; }
.side-user .su-role { font-size: .72rem; color: #7f9690; }

.main { padding: 1.6rem 2rem 3rem; max-width: 1280px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; }
.page-head p { color: var(--muted); margin-top: .25rem; font-size: .92rem; }

.demo-bar {
  background: var(--wait-bg); border: 1px solid #e0cd97; color: #5e470f; padding: .55rem 1rem;
  border-radius: var(--radius-sm); font-size: .82rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}

/* ===== Tarjeta genérica ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .22rem .55rem; border-radius: 999px; white-space: nowrap; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--wait { background: var(--wait-bg); color: var(--wait); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--neutral { background: var(--brand-100); color: var(--emerald-deep); }

/* ===== Matriz de Eisenhower ===== */
.eisenhower { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.quadrant { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; min-height: 220px; display: flex; flex-direction: column; }
.quadrant__head { margin-bottom: .8rem; }
.quadrant__head h3 { font-size: .98rem; }
.quadrant__head span { font-size: .76rem; color: var(--muted); }
.quadrant--Q1 { border-top: 4px solid var(--danger); }
.quadrant--Q2 { border-top: 4px solid var(--emerald-deep); }
.quadrant--Q3 { border-top: 4px solid var(--wait); }
.quadrant--Q4 { border-top: 4px solid var(--muted); }
.quadrant__list { display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.quadrant__empty { color: var(--muted); font-size: .82rem; padding: .6rem 0; }

.task-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; }
.task-card.is-done { opacity: .55; }
.task-card__title { font-size: .9rem; font-weight: 600; }
.task-card.is-done .task-card__title { text-decoration: line-through; }
.task-card__meta { font-size: .76rem; color: var(--muted); margin-top: .2rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.task-card__actions { display: flex; gap: .3rem; margin-top: .55rem; flex-wrap: wrap; }
.task-card__actions .btn--icon { font-size: .82rem; }
.quadrant-move { font-size: .74rem; padding: .3rem .5rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-family: inherit; }

/* ===== Kanban de Cobrar ===== */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 1rem; overflow-x: auto; }
.kanban-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; min-height: 260px; }
.kanban-col__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.kanban-col__head h3 { font-size: .88rem; }
.kanban-col__total { font-size: .78rem; color: var(--muted); }
.kanban-col__list { display: flex; flex-direction: column; gap: .6rem; }
.cobrar-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; }
.cobrar-card__title { font-size: .88rem; font-weight: 600; }
.cobrar-card__meta { font-size: .76rem; color: var(--muted); margin-top: .2rem; }
.cobrar-card__monto { font-family: var(--font-display); font-size: 1.05rem; color: var(--emerald-deep); margin-top: .35rem; }
.cobrar-card__actions { margin-top: .55rem; display: flex; gap: .4rem; flex-wrap: wrap; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.stat-mini { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat-mini strong { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--emerald); }
.stat-mini span { font-size: .78rem; color: #c4d2e2; }

/* ===== Vista Hoy ===== */
.hoy-list { display: flex; flex-direction: column; gap: .7rem; }
.hoy-item { display: flex; align-items: center; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.hoy-item__cat { font-size: 1.1rem; }
.hoy-item__title { font-weight: 600; font-size: .9rem; }
.hoy-item__meta { font-size: .78rem; color: var(--muted); }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; background: rgba(17,36,31,.45); display: grid; place-items: center; padding: 1.5rem; z-index: 100; }
.modal__card { background: var(--surface); border-radius: var(--radius); width: min(560px, 96vw); max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.4rem; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 1.15rem; }
.modal__close { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal__body { padding: 1.4rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: .75rem 1.2rem; border-radius: 999px; box-shadow: var(--shadow-lg); opacity: 0; transition: all .25s ease; z-index: 200; font-size: .88rem; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .3rem; }
  .sidebar .brand { width: 100%; padding-bottom: .5rem; }
  .side-section-label, .sidebar__foot { display: none; }
  .main { padding: 1.2rem 1rem 3rem; }
  .eisenhower { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
}
