@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --brand: #3B4A2F;
  --brand-light: #4e6340;
  --brand-dark: #2a3620;
  --brand-muted: #7a8c6a;
  --cream: #F5F4F0;
  --cream-dark: #ebe9e3;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--cream);
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* ---- Botones ---- */
.btn-primary,
.btn-primary:not(:disabled):not(.disabled) {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--brand-light);
  border-color: var(--brand-light);
  color: #fff;
}
.btn-outline-brand {
  color: var(--brand);
  border-color: rgba(59, 74, 47, 0.25);
  background: #fff;
}
.btn-outline-brand:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--cream);
}
.btn-secondary-brand {
  background-color: var(--cream-dark);
  color: var(--brand);
  border: 1px solid rgba(59, 74, 47, 0.2);
}
.btn-secondary-brand:hover { background-color: var(--cream); color: var(--brand); }

.btn-check:checked + .btn-outline-brand {
  color: #fff;
  border-color: transparent;
}
.status-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.4rem 0.3rem;
}
.status-btn.active, .btn-check:checked + .status-btn {
  color: #fff;
  border-color: transparent;
}
.status-btn-gray.active, .btn-check:checked + .status-btn-gray   { background-color: #6b7280; }
.status-btn-amber.active, .btn-check:checked + .status-btn-amber { background-color: #f59e0b; }
.status-btn-brand.active, .btn-check:checked + .status-btn-brand { background-color: var(--brand); }
.status-btn-blue.active, .btn-check:checked + .status-btn-blue   { background-color: #3b82f6; }
.status-btn-red.active, .btn-check:checked + .status-btn-red     { background-color: #ef4444; }

/* Chips de filtro (Todos / por estado) */
.filter-chip {
  display: inline-flex; align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  background: #fff;
  text-decoration: none;
}
.filter-chip:hover { border-color: rgba(59, 74, 47, 0.4); color: #6b7280; }
.filter-chip.active { border-color: transparent; color: #fff; }

/* ---- Formularios ---- */
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(59, 74, 47, 0.15);
}
.form-label { font-weight: 500; font-size: 0.875rem; color: #374151; }

/* ---- Cards ---- */
.card {
  border: 1px solid rgba(59, 74, 47, 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.brand-box {
  background: rgba(59, 74, 47, 0.05);
  border: 1px solid rgba(59, 74, 47, 0.2);
  border-radius: 0.5rem;
}

/* ---- Texto/fondo de marca ---- */
.text-brand { color: var(--brand) !important; }
.text-brand-muted { color: var(--brand-muted) !important; }
.bg-brand { background-color: var(--brand) !important; }
.bg-cream { background-color: var(--cream) !important; }

/* ---- Badges suaves (estados) ---- */
.badge-soft-gray   { background-color: #f3f4f6; color: #4b5563; }
.badge-soft-amber  { background-color: #fef3c7; color: #b45309; }
.badge-soft-brand  { background-color: rgba(59, 74, 47, 0.1); color: var(--brand); }
.badge-soft-blue   { background-color: #dbeafe; color: #1d4ed8; }
.badge-soft-red    { background-color: #fee2e2; color: #b91c1c; }

/* ---- Tabla ---- */
.table-cream thead th {
  background-color: rgba(245, 244, 240, 0.6);
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom-width: 1px;
}
.table-cream tbody tr:hover { background-color: rgba(245, 244, 240, 0.5); }

/* ---- Header / nav ---- */
.app-header { background-color: var(--brand); }
.app-header .navbar-brand img { height: 4.5rem; width: auto; }
.app-header .nav-link {
  color: rgba(245, 244, 240, 0.7);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}
.app-header .nav-link:hover { color: var(--cream); background-color: rgba(245, 244, 240, 0.1); }
.app-header .nav-link.active { color: var(--cream); background-color: rgba(245, 244, 240, 0.15); }
.app-header .navbar-toggler { border-color: rgba(245, 244, 240, 0.3); }
.app-header .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(245, 244, 240, 0.9)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.user-avatar {
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background-color: rgba(122, 140, 106, 0.4);
  color: var(--cream);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 500;
}

/* ---- Stat cards ---- */
.stat-card { padding: 1rem 1.25rem; }
.stat-card .stat-icon { font-size: 1.15rem; }
.stat-card .stat-value { font-size: 1.25rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.75rem; color: #6b7280; }

/* ---- Calendario (Eventos) ---- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: #f3f4f6;
  border: 1px solid #f3f4f6;
  border-radius: 0.5rem;
  overflow: hidden;
}
.calendar-weekday {
  background-color: rgba(245, 244, 240, 0.6);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-muted);
  padding: 0.4rem 0;
}
.calendar-day {
  background-color: #fff;
  min-height: 64px;
  padding: 0.3rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border: none;
  width: 100%;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
@media (min-width: 768px) { .calendar-day { min-height: 100px; } }
.calendar-day:hover { background-color: rgba(245, 244, 240, 0.4); }
.calendar-day.calendar-day-out {
  background-color: rgba(245, 244, 240, 0.2);
  cursor: default;
  pointer-events: none;
}
.calendar-day-number {
  font-size: 0.72rem;
  width: 1.25rem; height: 1.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #4b5563;
  font-weight: 500;
}
.calendar-day-out .calendar-day-number { color: #d1d5db; }
.calendar-day-today .calendar-day-number {
  box-shadow: 0 0 0 2px var(--brand);
  color: var(--brand);
  font-weight: 700;
}
.event-pill {
  font-size: 0.62rem;
  line-height: 1.1;
  border-left: 2px solid;
  border-radius: 2px;
  padding: 0.1rem 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-pill-gray  { background: #f9fafb; border-color: #d1d5db; color: #4b5563; }
.event-pill-amber { background: #fffbeb; border-color: #fbbf24; color: #92400e; }
.event-pill-brand { background: rgba(59, 74, 47, 0.05); border-color: rgba(59, 74, 47, 0.4); color: var(--brand); }
.event-pill-blue  { background: #eff6ff; border-color: #60a5fa; color: #1e40af; }
.event-dot { width: 0.375rem; height: 0.375rem; border-radius: 50%; display: inline-block; }
.event-dot-gray  { background: #9ca3af; }
.event-dot-amber { background: #f59e0b; }
.event-dot-brand { background: var(--brand); }
.event-dot-blue  { background: #3b82f6; }

/* ---- Checklist (Eventos) ---- */
.checklist-progress { height: 0.375rem; background: var(--cream-dark); border-radius: 999px; overflow: hidden; }
.checklist-progress > div { height: 100%; background: var(--brand); }

/* ---- Icon buttons de fila (Editar/Duplicar/PDF/Eliminar) ---- */
.btn-row-action {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  background: #fff;
  white-space: nowrap;
}
.btn-row-action:hover { border-color: var(--brand); color: var(--brand); }
.btn-row-action.danger:hover { border-color: #fca5a5; color: #dc2626; }

.empty-state { padding: 4rem 1rem; text-align: center; }
.empty-state .empty-icon { font-size: 2.5rem; }
