/* ============================================================
   GESTOR WEB — Main Stylesheet
   Tipografías: Fraunces (títulos) + Inter (texto)
   Tema: Dark mode por defecto, Light mode opcional
   ============================================================ */

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

/* ── Variables (Dark Mode) ─────────────────────────────── */
:root {
  --bg:         #f8f3ef;
  --surface:    rgba(255, 251, 248, .88);
  --surface-2:  #f5ede7;
  --surface-3:  #efe4dd;
  --border:     #e5d6cf;
  --border-2:   #d8c5bc;
  --text:       #41363d;
  --text-muted: #7d6b73;
  --text-subtle:#b49fa4;

  --accent:       #c68aa3;
  --accent-hover: #b77794;
  --accent-dim:   rgba(198,138,163,.16);
  --accent-glow:  0 14px 34px rgba(198,138,163,.16);

  --success:     #84b79a;
  --success-dim: rgba(132,183,154,.16);
  --warning:     #d6b56f;
  --warning-dim: rgba(214,181,111,.18);
  --danger:      #d88a8a;
  --danger-dim:  rgba(216,138,138,.16);
  --info:        #8eaed3;
  --info-dim:    rgba(142,174,211,.18);
  --orange:      #daa385;
  --orange-dim:  rgba(218,163,133,.18);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow:    0 14px 36px rgba(125,107,115,.08);
  --shadow-lg: 0 24px 64px rgba(125,107,115,.14);

  --sidebar-w:  240px;
  --topbar-h:   60px;
  --transition: 0.18s ease;
}

/* ── Light Mode ──────────────────────────────────────────── */
[data-theme="light"] {
}

[data-theme="dark"] {
  --bg:         #211d24;
  --surface:    rgba(40, 34, 44, .92);
  --surface-2:  #312937;
  --surface-3:  #3a313f;
  --border:     #4b404f;
  --border-2:   #5d5060;
  --text:       #f4e9ec;
  --text-muted: #c5b0b8;
  --text-subtle:#8f7882;

  --accent:       #e2a6bc;
  --accent-hover: #ebb6c8;
  --accent-dim:   rgba(226,166,188,.16);
  --accent-glow:  0 14px 34px rgba(226,166,188,.16);

  --success:     #99c9ab;
  --success-dim: rgba(153,201,171,.16);
  --warning:     #e5c688;
  --warning-dim: rgba(229,198,136,.16);
  --danger:      #e29b9b;
  --danger-dim:  rgba(226,155,155,.16);
  --info:        #a9c1e0;
  --info-dim:    rgba(169,193,224,.16);
  --orange:      #e6b092;
  --orange-dim:  rgba(230,176,146,.16);

  --shadow:    0 14px 36px rgba(0,0,0,.24);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.34);
}

/* ── Base ────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.7), transparent 28%),
    radial-gradient(circle at top right, rgba(198,138,163,.12), transparent 24%),
    linear-gradient(180deg, #fbf6f2 0%, var(--bg) 48%, #f6efea 100%);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}
h4, h5, h6 { font-family: 'Inter', sans-serif; font-weight: 600; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ── Layout ──────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: color-mix(in srgb, var(--surface) 90%, white 10%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition), background var(--transition);
  overflow-y: auto;
  backdrop-filter: blur(18px);
  box-shadow: 18px 0 40px rgba(125,107,115,.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.logo-icon {
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1;
}
.logo-text {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.logo-text em { color: var(--accent); font-style: normal; }

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}
.nav-section-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: .9rem 1.5rem .3rem;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .72rem 1rem;
  margin: 0 .8rem .2rem;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  border-radius: calc(var(--radius) - 2px);
  position: relative;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}
.nav-link.active::before {
  display: none;
}

.sidebar-footer {
  padding: 1rem 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.theme-toggle, .logout-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
}
.theme-toggle:hover, .logout-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.theme-toggle svg, .logout-link svg { width: 16px; height: 16px; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* ── Main Wrap ───────────────────────────────────────────── */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin var(--transition);
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(255, 251, 248, .62);
  border-bottom: 1px solid rgba(229,214,207,.7);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
}
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .4rem;
  border-radius: var(--radius-xs);
}
.sidebar-toggle svg { width: 22px; height: 22px; }
.topbar-title {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 600;
  flex: 1;
  color: var(--text);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--text-muted);
}

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.card:hover { border-color: var(--border-2); }
.card-sm { padding: 1rem 1.25rem; border-radius: var(--radius); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.card-title {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.accent  { background: var(--accent-dim);  color: var(--accent); }
.stat-icon.success { background: var(--success-dim); color: var(--success); }
.stat-icon.warning { background: var(--warning-dim); color: var(--warning); }
.stat-icon.info    { background: var(--info-dim);    color: var(--info); }
.stat-icon.orange  { background: var(--orange-dim);  color: var(--orange); }
.stat-value {
  font-family: 'Fraunces', serif;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-bottom: .3rem;
}
.stat-label {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary   { background: linear-gradient(135deg, var(--accent), #d9a8ba); color: #fffafc; box-shadow: var(--accent-glow); }
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-hover), #cf96ad); color: #fff; transform: translateY(-1px); box-shadow: 0 18px 34px rgba(198,138,163,.22); }
.btn-success   { background: linear-gradient(135deg, var(--success), #9dc7ad); color: #fff; }
.btn-success:hover { opacity: .85; }
.btn-danger    { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(216,138,138,.24); }
.btn-danger:hover  { background: var(--danger); color: #fff; }
.btn-ghost     { background: rgba(255,255,255,.45); color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover   { color: var(--text); border-color: var(--border-2); background: rgba(255,255,255,.72); }
.btn-sm        { padding: .4rem .8rem; font-size: .8rem; }
.btn-icon      { padding: .5rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.btn-icon:hover { color: var(--text); border-color: var(--border-2); }
.btn-icon svg  { width: 15px; height: 15px; }

/* ── Badges / Estado ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .7rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.estado-progreso  { background: var(--accent-dim);  color: var(--accent); }
.estado-pausa     { background: var(--warning-dim); color: var(--warning); }
.estado-finalizado{ background: var(--success-dim); color: var(--success); }
.estado-espera    { background: var(--info-dim);    color: var(--info); }

.badge-cobrado    { background: var(--success-dim); color: var(--success); }
.badge-pendiente  { background: var(--warning-dim); color: var(--warning); }
.badge-vencido    { background: var(--danger-dim);  color: var(--danger); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.form-control {
  width: 100%;
  padding: .65rem 1rem;
  background: rgba(255,255,255,.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .92rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-control::placeholder { color: var(--text-subtle); }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239088C0' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px; padding-right: 2.2rem; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }

/* Checkbox */
.checkbox-group { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.checkbox-group input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.checkbox-group label { font-size: .9rem; cursor: pointer; margin: 0; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface-2); }
th {
  padding: .8rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  white-space: nowrap;
}
td {
  padding: .9rem 1rem;
  border-top: 1px solid var(--border);
  font-size: .88rem;
  color: var(--text);
  vertical-align: middle;
}
tr:hover td { background: rgba(255,255,255,.52); }
.td-actions { display: flex; gap: .4rem; align-items: center; }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(79, 63, 72, .24);
  backdrop-filter: blur(10px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(.97);
  z-index: 201;
  width: 90%;
  max-width: 620px;
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: all .22s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  backdrop-filter: blur(18px);
}
.modal.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 600;
}
.modal-close {
  width: 32px; height: 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}
.modal-close:hover { color: var(--text); border-color: var(--border-2); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 1.4rem 1.6rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 1rem 1.6rem 1.4rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .7rem;
}

.modal-lg { max-width: 820px; }

/* ── Kanban ──────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}
.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  min-height: 400px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
}
.kanban-col.drag-over {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.kanban-col-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.kanban-count {
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 99px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: .6rem;
  cursor: grab;
  transition: all var(--transition);
  user-select: none;
  box-shadow: 0 10px 24px rgba(125,107,115,.06);
}
.kanban-card:hover { border-color: var(--border-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.kanban-card.dragging { opacity: .4; cursor: grabbing; }
.kanban-card-name { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.kanban-card-client { font-size: .78rem; color: var(--text-muted); margin-bottom: .7rem; }
.kanban-card-meta { display: flex; flex-direction: column; gap: .3rem; }
.kanban-card-row { display: flex; align-items: center; justify-content: space-between; font-size: .76rem; color: var(--text-muted); }

/* ── Calendar ────────────────────────────────────────────── */
.calendar-nav { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.calendar-nav h2 { font-family: 'Fraunces', serif; font-size: 1.3rem; flex: 1; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day-name {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .5rem;
}
.cal-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 100px;
  padding: .5rem;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}
.cal-cell.other-month { background: var(--surface-2); opacity: .5; }
.cal-cell.today { border-color: var(--accent); }
.cal-cell-num {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.cal-cell.today .cal-cell-num {
  background: var(--accent);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem;
}
.cal-event {
  font-size: .68rem;
  padding: .15rem .4rem;
  border-radius: 4px;
  margin-bottom: 2px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.cal-event.entrega { background: var(--accent-dim); color: var(--accent); }
.cal-event.pago-pendiente { background: var(--warning-dim); color: var(--warning); }
.cal-event.pago-cobrado { background: var(--success-dim); color: var(--success); }
.cal-event.pago-vencido { background: var(--danger-dim); color: var(--danger); }

/* ── Finance ─────────────────────────────────────────────── */
.finance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.finance-list { display: flex; flex-direction: column; gap: .5rem; }
.finance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: background var(--transition);
}
.finance-item:hover { background: rgba(255,255,255,.56); border-color: var(--border-2); }
.finance-item-left { display: flex; align-items: center; gap: .8rem; }
.finance-item-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.finance-item-dot.ingreso { background: var(--success); }
.finance-item-dot.gasto   { background: var(--danger); }
.finance-item-desc { font-size: .88rem; font-weight: 500; }
.finance-item-meta { font-size: .75rem; color: var(--text-muted); }
.finance-item-amount { font-weight: 700; font-size: .92rem; }
.finance-item-amount.ingreso { color: var(--success); }
.finance-item-amount.gasto   { color: var(--danger); }

.balance-bar {
  height: 8px;
  background: rgba(255,255,255,.5);
  border-radius: 99px;
  overflow: hidden;
  margin: .5rem 0;
}
.balance-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--accent));
  border-radius: 99px;
  transition: width .5s ease;
}

/* ── Filtros ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.filter-bar .form-control { width: auto; flex: 1; min-width: 160px; max-width: 220px; }
.search-input { flex: 2 !important; max-width: 300px !important; }

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-title { font-family: 'Fraunces', serif; font-size: 1.65rem; font-weight: 600; letter-spacing: -.02em; }
.page-subtitle { font-size: .85rem; color: var(--text-muted); margin-top: .15rem; }

/* ── Tareas ──────────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: .4rem; }
.task-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .7rem;
  background: var(--surface-2);
  border-radius: var(--radius-xs);
  font-size: .88rem;
}
.task-item input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.task-item.done span { text-decoration: line-through; color: var(--text-muted); }
.task-item-del { margin-left: auto; cursor: pointer; color: var(--text-subtle); transition: color var(--transition); background: none; border: none; }
.task-item-del:hover { color: var(--danger); }
.task-item-del svg { width: 14px; height: 14px; }
.add-task-row { display: flex; gap: .5rem; margin-top: .5rem; }
.add-task-row input { flex: 1; }

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1.1rem;
  font-size: .88rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: .6rem;
  animation: slideUp .2s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--accent); }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Misc ────────────────────────────────────────────────── */
.sep { height: 1px; background: var(--border); margin: 1.2rem 0; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent  { color: var(--accent); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.fw-600 { font-weight: 600; }
.fs-sm { font-size: .82rem; }
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; opacity: .3; margin-bottom: 1rem; }
.empty-state p { font-size: .9rem; }

/* ── Payment indicators ──────────────────────────────────── */
.pago-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; font-size: .8rem; }
.pago-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex-shrink: 0; }
.pago-dot.cobrado { background: var(--success); }
.pago-dot.vencido { background: var(--danger); }

/* ── Overview list (dashboard) ───────────────────────────── */
.event-list { display: flex; flex-direction: column; gap: .5rem; }
.event-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .75rem 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: .85rem;
}
.event-date {
  min-width: 38px;
  text-align: center;
}
.event-date .day { font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 600; line-height: 1; }
.event-date .mon { font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.event-body { flex: 1; }
.event-name { font-weight: 600; }
.event-sub  { font-size: .75rem; color: var(--text-muted); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .kanban-board { grid-template-columns: 1fr 1fr; }
  .finance-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .cal-cell { min-height: 60px; }
  .cal-event { display: none; }
  .cal-cell .event-dot { display: block; }
}
@media (max-width: 600px) {
  .main-content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ── Sidebar Collapse ────────────────────────────────────── */
:root { --sidebar-w-collapsed: 64px; }

.sidebar-collapse-btn {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--text-subtle); padding: .25rem;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  display: flex; align-items: center;
}
.sidebar-collapse-btn:hover { color: var(--text); background: var(--surface-2); }

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .sidebar-text { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 1.4rem .8rem; }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
.sidebar.collapsed .nav-link { justify-content: center; padding: .72rem 0; margin: 0 .45rem .2rem; }
.sidebar.collapsed .nav-link.active::before { display: none; }
.sidebar.collapsed .sidebar-footer { align-items: center; padding: 1rem .5rem 1.5rem; }
.sidebar.collapsed .theme-toggle,
.sidebar.collapsed .logout-link { justify-content: center; padding: .55rem; }
.sidebar.collapsed .nav-section-label { display: none; }
.main-wrap.collapsed { margin-left: var(--sidebar-w-collapsed); }

/* ── Flatpickr overrides ─────────────────────────────────── */
.flatpickr-calendar {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--text) !important;
  font-family: 'Inter', sans-serif !important;
}
.flatpickr-day { color: var(--text) !important; border-radius: var(--radius-xs) !important; }
.flatpickr-day:hover { background: var(--surface-2) !important; border-color: var(--border) !important; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.flatpickr-day.today { border-color: var(--accent) !important; }
.flatpickr-months { background: var(--surface-2) !important; border-radius: var(--radius) var(--radius) 0 0 !important; }
.flatpickr-month { color: var(--text) !important; }
.flatpickr-weekday { color: var(--text-muted) !important; }
.flatpickr-current-month input.cur-year { color: var(--text) !important; }
.flatpickr-current-month .flatpickr-monthDropdown-months { color: var(--text) !important; background: var(--surface-2) !important; }
.flatpickr-prev-month svg, .flatpickr-next-month svg { fill: var(--text-muted) !important; }
.flatpickr-prev-month:hover svg, .flatpickr-next-month:hover svg { fill: var(--text) !important; }
.flatpickr-day.flatpickr-disabled { color: var(--text-subtle) !important; }

/* ── Sort links ──────────────────────────────────────────── */
.sort-link { display:inline-flex;align-items:center;gap:.3rem;color:var(--text-muted);font-weight:700;font-size:.72rem;text-transform:uppercase;letter-spacing:.07em;text-decoration:none; }
.sort-link:hover { color: var(--text); }

/* ── Etiqueta chip ───────────────────────────────────────── */
.etiq-chip { display:inline-flex;align-items:center;padding:.2rem .55rem;border-radius:99px;font-size:.72rem;font-weight:600;white-space:nowrap; }

/* ── Priority badges ─────────────────────────────────────── */
.prio-urgente { background:var(--danger-dim);  color:var(--danger); }
.prio-alta    { background:var(--warning-dim); color:var(--warning); }
.prio-media   { background:var(--accent-dim);  color:var(--accent); }
.prio-baja    { background:var(--surface-3);   color:var(--text-muted); }

/* ── Task estado badges ──────────────────────────────────── */
.est-backlog     { background:var(--surface-3);   color:var(--text-muted); }
.est-pendiente   { background:var(--warning-dim); color:var(--warning); }
.est-en-progreso { background:var(--accent-dim);  color:var(--accent); }
.est-completada  { background:var(--success-dim); color:var(--success); }

/* ── Task list (tareas.php) ──────────────────────────────── */
.task-full-list { display:flex; flex-direction:column; gap:.4rem; }

.tarea-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  transition: border-color var(--transition);
}
.tarea-row:hover { border-color: var(--border-2); }
.tarea-row.tarea-done { opacity: .6; }

.tarea-row-main { display:flex; align-items:center; gap:.6rem; }
.tarea-check input[type="checkbox"] { width:16px;height:16px;accent-color:var(--accent);cursor:pointer;flex-shrink:0; }
.tarea-info { flex:1; min-width:0; }
.tarea-nombre { font-size:.9rem; font-weight:500; display:block; }
.tarea-meta { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin-top:.2rem; }
.tarea-badges { display:flex; gap:.3rem; align-items:center; flex-shrink:0; }

/* ── Subtareas ───────────────────────────────────────────── */
.subtarea-list { padding:.4rem 0 .2rem 38px; display:flex; flex-direction:column; gap:.25rem; }
.subtarea-item { display:flex; align-items:center; gap:.5rem; font-size:.83rem; padding:.2rem 0; }
.subtarea-item input[type="checkbox"] { accent-color:var(--accent); width:14px; height:14px; cursor:pointer; flex-shrink:0; }
.subtarea-add { display:flex; gap:.4rem; margin-top:.4rem; }
.subtarea-add input { flex:1; }

/* ── Btn active ──────────────────────────────────────────── */
.btn.active { background:var(--accent); color:#fff; }

/* ── Stat icon danger ────────────────────────────────────── */
.stat-icon.danger { background:var(--danger-dim); color:var(--danger); }

/* ── Sidebar collapsible sections ───────────────────────── */
.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: .9rem 1.5rem .3rem;
}
.nav-section-toggle .section-chevron {
  width: 14px; height: 14px;
  color: var(--text-subtle);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.nav-section-toggle.collapsed .section-chevron { transform: rotate(-90deg); }
.nav-section-body { overflow: hidden; transition: max-height 0.2s ease; }
.nav-section-body.collapsed { max-height: 0 !important; }
.sidebar.collapsed .nav-section-toggle { justify-content: center; padding: .9rem 0 .3rem; }
.sidebar.collapsed .nav-section-toggle .section-chevron { display: none; }

/* ── Personal project indicator ──────────────────────────── */
.personal-badge {
  display:inline-flex; align-items:center; padding:.1rem .4rem;
  border-radius:4px; font-size:.65rem; font-weight:700; letter-spacing:.05em;
  background:var(--success-dim); color:var(--success);
}
.trabajo-badge {
  display:inline-flex; align-items:center; padding:.1rem .4rem;
  border-radius:4px; font-size:.65rem; font-weight:700; letter-spacing:.05em;
  background:var(--accent-dim); color:var(--accent);
}

/* ── Date range selector ─────────────────────────────────── */
.date-range-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.preset-btn {
  padding: .35rem .8rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.preset-btn:hover, .preset-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.date-range-custom {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
}
.date-range-custom input {
  width: 130px;
  padding: .3rem .6rem;
  font-size: .8rem;
}

/* ── Metas ───────────────────────────────────────────────── */
.meta-carpeta { margin-bottom: 1.5rem; }
.meta-carpeta-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .75rem;
}
.carpeta-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.carpeta-nombre { font-family: 'Fraunces', serif; font-size: .95rem; font-weight: 600; }
.meta-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: .9rem; }
.meta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  transition: border-color var(--transition);
}
.meta-card:hover { border-color: var(--border-2); }
.meta-card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:.5rem; margin-bottom:.75rem; }
.meta-card-title { font-weight: 600; font-size:.92rem; line-height:1.3; }
.meta-card-meta { display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:.75rem; }
.meta-progress-bar { height:6px; background:var(--surface-3); border-radius:99px; overflow:hidden; margin-bottom:.4rem; }
.meta-progress-fill { height:100%; background:var(--accent); border-radius:99px; transition:width .3s ease; }
.meta-progress-fill.completada { background:var(--success); }
.meta-progress-label { font-size:.75rem; color:var(--text-muted); text-align:right; }

/* ── Finance cards grid ──────────────────────────────────── */
.finance-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.25rem; }

/* ── Notas textarea in modal ─────────────────────────────── */
.form-control[rows] { resize: vertical; min-height: 80px; }
