/* ═══════════════════════════════════════════════════════════════════════════
   Planning de Ari — Estilos Neo-Brutalist al estilo Gumroad
   Fuente: Space Grotesk (Google Fonts)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Variables ─────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Paleta */
  --cream:        #FFF5E4;
  --cream-dark:   #FFE8C5;
  --black:        #0d0d0d;
  --gray-dark:    #1a1a1a;
  --gray-mid:     #4a4a4a;
  --gray-light:   #e8e8e8;

  /* Colores de acento */
  --pink:         #FF90E8;
  --green:        #B9FF66;
  --yellow:       #FFE600;
  --blue:         #4D9EFF;
  --red:          #FF4747;
  --orange:       #FF8C42;
  --purple:       #9B6DFF;

  /* Bordes y sombras Neo-Brutalist */
  --border:       3px solid var(--black);
  --border-thin:  2px solid var(--black);
  --shadow:       4px 4px 0px var(--black);
  --shadow-sm:    2px 2px 0px var(--black);
  --shadow-lg:    6px 6px 0px var(--black);

  /* Tipografía */
  --font:         'Space Grotesk', sans-serif;
  --radius:       8px;
  --radius-sm:    4px;

  /* Layout */
  --header-h:     64px;
  --sidebar-w:    280px;
}

html {
  font-family: var(--font);
  font-size: 16px;
  color: var(--black);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background: var(--cream);
}

/* ── Utilidades ─────────────────────────────────────────────────────────────── */
.hidden, [hidden] { display: none !important; }

/* ── Botones ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  border: var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  background: var(--cream);
  color: var(--black);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--black);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--black);
}

.btn-primary {
  background: var(--black);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--gray-dark);
}

.btn-outline {
  background: transparent;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--gray-light);
  box-shadow: none;
  transform: none;
}

.btn-danger {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.btn-danger:hover {
  background: #e03030;
}

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* ── LOGIN ──────────────────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 24px;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,144,232,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(185,255,102,0.15) 0%, transparent 50%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.login-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--gray-mid);
  margin-top: 4px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fee2e2;
  border: 2px solid var(--red);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  color: #991b1b;
  box-shadow: 2px 2px 0 var(--black);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.login-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--gray-mid);
  margin-top: 24px;
}

/* Emojis rápidos */
.emoji-quick-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  background: #f8f8f8;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #ddd;
}

.emoji-quick-item {
  cursor: pointer;
  font-size: 1.15rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: transform 0.1s, background 0.1s;
  user-select: none;
}

.emoji-quick-item:hover {
  background: var(--cream-dark);
  transform: scale(1.2);
}

/* ── Formularios ────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--grow { flex: 1; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-dark);
}

.required { color: var(--red); }
.optional { font-weight: 400; text-transform: none; color: var(--gray-mid); font-size: 0.78rem; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--black);
  background: var(--cream);
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--black);
  box-shadow: var(--shadow-sm);
}

.form-textarea { resize: vertical; }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper .form-input {
  padding-right: 48px;
}

.toggle-pwd-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 6px;
  line-height: 1;
  opacity: 0.7;
  z-index: 10;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.toggle-pwd-btn:hover,
.toggle-pwd-btn:active {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

/* ── Color Picker ───────────────────────────────────────────────────────────── */
.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-option {
  cursor: pointer;
  position: relative;
}

.color-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.color-swatch {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: var(--border-thin);
  border-color: transparent;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.color-option input:checked + .color-swatch {
  border-color: var(--black);
  box-shadow: var(--shadow-sm);
  transform: scale(1.15);
}

.color-option:hover .color-swatch {
  transform: scale(1.1);
}

/* ── APP HEADER ─────────────────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: #ffffff;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 0px var(--black);
}

.header-left { display: flex; align-items: center; gap: 12px; }

.header-logo { font-size: 1.8rem; }

.header-title-block { display: flex; flex-direction: column; }

.header-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.header-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.header-right { display: flex; align-items: center; gap: 10px; }

.offline-badge {
  padding: 4px 10px;
  background: var(--yellow);
  border: var(--border-thin);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 800;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ── APP BODY ───────────────────────────────────────────────────────────────── */
.app-body {
  display: flex;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

/* ── SIDEBAR ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: var(--border);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 12px;
  border-bottom: var(--border-thin);
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 800;
}

.filter-chips {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  flex-wrap: wrap;
  border-bottom: var(--border-thin);
  border-color: var(--gray-light);
}

.filter-chip {
  padding: 4px 10px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  border: 2px solid var(--gray-light);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--black);
  background: var(--cream);
}

.filter-chip.active {
  background: var(--black);
  color: var(--cream);
  border-color: var(--black);
}

/* Lista de actividades */
.activities-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activities-list::-webkit-scrollbar { width: 6px; }
.activities-list::-webkit-scrollbar-track { background: transparent; }
.activities-list::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 3px; }

.activities-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 16px;
  text-align: center;
  color: var(--gray-mid);
  font-size: 0.85rem;
}

.empty-icon { font-size: 2rem; }

/* Chip de actividad en el sidebar */
.activity-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  background: var(--cream);
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  animation: chipIn 0.2s ease;
}

@keyframes chipIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.activity-chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sm);
}

.activity-chip:active { cursor: grabbing; }

.activity-chip.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.chip-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,0.2);
}

.chip-name {
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chip-type {
  font-size: 0.75rem;
  opacity: 0.7;
}

.chip-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 2px;
}

.activity-chip:hover .chip-edit-btn { opacity: 0.6; }
.chip-edit-btn:hover { opacity: 1 !important; }

/* ── CALENDAR MAIN ──────────────────────────────────────────────────────────── */
.calendar-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calendar-main::-webkit-scrollbar { width: 8px; }
.calendar-main::-webkit-scrollbar-track { background: transparent; }
.calendar-main::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 4px; }

/* Navegación del mes */
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--black);
}

.nav-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.month-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.month-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.year-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-mid);
}

.today-btn { margin-left: auto; }

/* Días de semana */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.calendar-weekdays div {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-mid);
  padding: 4px 0;
}

.calendar-weekdays .weekend { color: var(--pink); }

/* Grid del calendario */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  flex: 1;
}

/* Celda de día */
.calendar-day {
  min-height: 110px;
  background: #ffffff;
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  position: relative;
}

.calendar-day:hover {
  border-color: var(--black);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.calendar-day.empty:hover {
  box-shadow: none;
}

.calendar-day.today {
  background: var(--cream);
  border-color: var(--black);
  border-width: 3px;
}

.calendar-day.today .day-number {
  background: var(--black);
  color: var(--cream);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day.weekend .day-number {
  color: #999;
}

.calendar-day.drag-over {
  background: var(--cream-dark);
  border-color: var(--pink);
  border-style: dashed;
  box-shadow: var(--shadow-sm);
}

.day-number {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-dark);
  line-height: 1;
}

.day-chips {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

/* Chip de actividad dentro del calendario */
.cal-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1.5px solid rgba(0,0,0,0.15);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s;
  max-width: 100%;
}

.cal-chip:hover { opacity: 0.8; }

.cal-chip-icon { flex-shrink: 0; }

.cal-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-chip-remove {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.65rem;
  padding: 0 1px;
  color: inherit;
  transition: opacity 0.15s;
}

.cal-chip:hover .cal-chip-remove { opacity: 0.7; }

.day-more {
  font-size: 0.65rem;
  color: var(--gray-mid);
  font-weight: 600;
  padding-left: 6px;
}

/* Leyenda */
.calendar-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: var(--border-thin);
  border-color: var(--gray-light);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-mid);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.2);
}

/* ── MODALES ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  background: #ffffff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card--day { max-width: 460px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: var(--border-thin);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

#activity-form {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

/* ── DAY MODAL ──────────────────────────────────────────────────────────────── */
.day-modal-body {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-modal-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-mid);
  margin-top: 4px;
}

.day-activities-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 40px;
}

.day-activity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.day-activity-item .remove-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.day-activity-item .remove-btn:hover { opacity: 1; color: var(--red); }

.day-activity-empty {
  font-size: 0.82rem;
  color: var(--gray-mid);
  font-style: italic;
  padding: 4px 0;
}

.day-activity-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-picker-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: var(--border-thin);
  border-radius: 100px;
  background: var(--cream);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.15s;
}

.day-picker-chip:hover {
  border-color: var(--black);
  box-shadow: var(--shadow-sm);
  transform: translate(-1px, -1px);
}

/* ── TOAST ──────────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  background: var(--black);
  color: var(--cream);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 300px;
}

.toast.toast-success { background: var(--gray-dark); }
.toast.toast-error   { background: var(--red); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── NAVEGACIÓN POR PESTAÑAS ────────────────────────────────────────────── */
.app-nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab-btn {
  background: white;
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--black);
  transition: all 0.1s;
}

.nav-tab-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--black);
}

.nav-tab-btn.active {
  background: var(--yellow);
  box-shadow: 0 0 0 var(--black);
  transform: translate(2px, 2px);
}

.view-panel {
  padding: 24px 32px;
  flex: 1;
  overflow-y: auto;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

.view-heading {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.view-subheading {
  font-size: 0.9rem;
  color: var(--gray-mid);
  margin-top: 4px;
}

/* ── TABLERO TRELLO (KANBAN) ──────────────────────────────────────────────── */
.trello-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.trello-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.trello-column {
  background: white;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  max-height: calc(100vh - 220px);
}

.trello-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: var(--border-thin);
}

.trello-col-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.trello-badge {
  background: var(--cream);
  border: 1.5px solid var(--black);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 800;
}

.trello-cards {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.trello-card {
  background: var(--cream);
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: transform 0.1s, box-shadow 0.1s;
}

.trello-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--black);
}

.trello-card-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.trello-card-date {
  display: inline-block;
  background: white;
  border: 1px solid var(--black);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.trello-card-notes {
  font-size: 0.8rem;
  color: var(--gray-mid);
  white-space: pre-wrap;
}

/* ── CORCHO DE POST-ITS ─────────────────────────────────────────────────────── */
.postits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.postit-note {
  min-height: 200px;
  padding: 20px 18px;
  border: 2px solid var(--black);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--black);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: rotate(-1deg);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.postit-note:nth-child(2n) { transform: rotate(1.5deg); }
.postit-note:nth-child(3n) { transform: rotate(-2deg); }
.postit-note:hover {
  transform: scale(1.03) rotate(0deg);
  box-shadow: 6px 6px 0 var(--black);
  z-index: 10;
}

.postit-tag-badge {
  align-self: flex-start;
  background: black;
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.postit-date-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--black);
  border-radius: 3px;
  padding: 1px 5px;
}

.postit-tag-urgente {
  background: var(--red) !important;
  color: white !important;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.postit-content {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-wrap;
  flex: 1;
}

.postit-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.postit-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
}
.postit-delete-btn:hover { opacity: 1; }

.postit-color-picker {
  display: flex;
  gap: 10px;
}

.postit-color-choice {
  width: 32px;
  height: 32px;
  border: 2px solid black;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.postit-color-choice input { cursor: pointer; }

/* ── TABLA DE NOTAS DE EXÁMENES ────────────────────────────────────────────── */
.grades-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: white;
  border: var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.summary-card-num {
  font-size: 2rem;
  font-weight: 800;
}

.summary-card-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-mid);
}

.grades-table-wrapper {
  background: white;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.grades-table {
  width: 100%;
  border-collapse: collapse;
}

.grades-table th {
  background: var(--cream);
  padding: 12px 16px;
  text-align: left;
  font-weight: 800;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--black);
}

.grades-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-light);
  font-size: 0.9rem;
}

.badge-grade {
  display: inline-block;
  padding: 4px 10px;
  border: 2px solid black;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.95rem;
}

.badge-grade-top   { background: #B9FF66; }
.badge-grade-good  { background: #70D6FF; }
.badge-grade-mid   { background: #FFE600; }
.badge-grade-low   { background: #FF4747; color: white; }

/* ── MODAL EVALUACIÓN EXAMEN ───────────────────────────────────────────────── */
.feeling-buttons-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.btn-feeling {
  background: var(--cream);
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--black);
  transition: all 0.1s;
}

.btn-feeling:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--black);
  background: white;
}

.btn-feeling.selected {
  background: var(--yellow);
  box-shadow: 0 0 0 var(--black);
  transform: translate(2px, 2px);
}

.feeling-emoji { font-size: 2rem; }
.feeling-text { font-weight: 800; font-size: 0.95rem; }

.exam-result-box {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

/* ── PRINT STYLES ───────────────────────────────────────────────────────────── */
.print-header { display: none; }

@media print {
  @page {
    size: A4 landscape;
    margin: 15mm 15mm 15mm 15mm;
  }

  html, body {
    background: white !important;
    font-size: 11px;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .login-screen,
  .app-header,
  .sidebar,
  .calendar-nav,
  .toast-container,
  .modal-overlay,
  #download-pdf-btn,
  #print-btn,
  #change-pwd-btn,
  #logout-btn,
  #today-btn {
    display: none !important;
  }

  .app { display: block !important; }
  .app-body { display: block !important; height: auto; }

  .print-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 3px solid black;
  }

  .print-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
  }

  .print-header p {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
  }

  .calendar-main {
    overflow: visible;
    padding: 0;
    gap: 12px;
  }

  .calendar-weekdays {
    border-bottom: 2px solid black;
    padding-bottom: 4px;
  }

  .calendar-weekdays div {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .calendar-grid {
    gap: 6px;
    page-break-inside: avoid;
  }

  .calendar-day {
    min-height: 85px;
    border: 1.5px solid #000;
    border-radius: 4px;
    padding: 5px;
    break-inside: avoid;
    cursor: default;
    background: #fff;
  }

  .calendar-day:hover { box-shadow: none; }

  .calendar-day.today {
    background: #fdfae5 !important;
    border: 2.5px solid black !important;
  }

  .cal-chip {
    font-size: 9px;
    padding: 2px 4px;
    border: 1px solid rgba(0,0,0,0.3);
    margin-bottom: 2px;
  }

  .cal-chip-remove { display: none !important; }

  .day-number {
    font-size: 11px;
    font-weight: 800;
  }

  /* La leyenda se muestra al pie en la hoja impresa */
  .calendar-legend {
    display: flex !important;
    justify-content: center;
    gap: 18px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 2px solid #000;
    page-break-inside: avoid;
  }

  .legend-item {
    font-size: 10px;
    font-weight: 700;
  }

  .legend-dot {
    width: 12px;
    height: 12px;
    border: 1.5px solid #000;
  }
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 220px;
  }

  .form-row { flex-direction: column; }
}

@media (max-width: 700px) {
  .app-body { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: var(--border);
    max-height: 220px;
  }

  .calendar-main { padding: 12px; }
  .month-name { font-size: 1.2rem; }

  .calendar-day { min-height: 70px; }
}
