/* ==========================================================================
   FroggyDay — Paleta crema y verde salvia en armonía con el logo
   ========================================================================== */

:root {
  --bg: #f6f2e8;
  --surface: #fffdf8;
  --surface-subtle: #ede6d6;
  --surface-hover: #faf6ed;
  --border: #e1d8c5;
  --border-strong: #ccc0a6;

  --text: #273e2b;
  --text-secondary: #485e4b;
  --text-muted: #6f8071;

  --primary: #5b8a5e;
  --primary-hover: #49734c;
  --primary-soft: #e6efe5;

  --danger: #c94a4a;
  --danger-soft: #fdefed;

  /* Colores por categoría estudiantil (suaves y cálidos) */
  --entrega: #d95d5d;
  --entrega-bg: #fdeeee;
  --entrega-text: #9e3131;

  --tarea: #4f8699;
  --tarea-bg: #eaf4f7;
  --tarea-text: #2c5b6b;

  --examen: #8c6aa8;
  --examen-bg: #f4eef8;
  --examen-text: #5d3e78;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(39, 62, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(39, 62, 43, 0.09);
  --shadow-lg: 0 20px 50px rgba(39, 62, 43, 0.16);
}

[data-theme="dark"] {
  --bg: #121a14;
  --surface: #19241b;
  --surface-subtle: #233126;
  --surface-hover: #1e2b21;
  --border: #2c3d30;
  --border-strong: #3e5443;

  --text: #f3efe4;
  --text-secondary: #d5cfc0;
  --text-muted: #9da89e;

  --primary: #7aa87d;
  --primary-hover: #8ebd91;
  --primary-soft: rgba(122, 168, 125, 0.18);

  --danger: #f07b7b;
  --danger-soft: rgba(217, 93, 93, 0.16);

  --entrega-bg: rgba(217, 93, 93, 0.18);
  --entrega-text: #f7b0b0;

  --tarea-bg: rgba(79, 134, 153, 0.22);
  --tarea-text: #a9d5e3;

  --examen-bg: rgba(140, 106, 168, 0.22);
  --examen-text: #d7c0eb;

  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Botones, inputs y elementos compartidos
   ========================================================================== */

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:active:not(:disabled) {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-subtle);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 11px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.icon-btn-subtle {
  width: 28px;
  height: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-compact {
  margin-top: 12px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.field textarea {
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.87rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-compact {
  margin-top: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.dot-entrega { background: var(--entrega); }
.dot-tarea { background: var(--tarea); }
.dot-examen { background: var(--examen); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.badge-soon {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.gcal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.muted-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.small-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Pantalla de Autenticación
   ========================================================================== */

.auth-screen {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    url('../img/fondo.jpg') center / cover no-repeat,
    var(--bg);
}

[data-theme="dark"] .auth-screen {
  background:
    linear-gradient(rgba(18, 26, 20, 0.78), rgba(18, 26, 20, 0.78)),
    url('../img/fondo.jpg') center / cover no-repeat,
    var(--bg);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.auth-logo-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(39, 62, 43, 0.14));
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
  flex-shrink: 0;
}

.brand-mark-sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: none;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-subtle);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.auth-tab {
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 7px;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-message {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.auth-message.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.auth-message.success {
  background: #ecfdf5;
  color: #047857;
}

.auth-features {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 4px 10px;
  border-radius: 999px;
}

.mode-badge {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auth-legal-link {
  text-align: center;
  font-size: 0.78rem;
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
}

.legal-links-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auth-legal-link a {
  color: var(--text-muted);
  text-decoration: underline;
}

.auth-legal-link a:hover {
  color: var(--primary);
}

/* ==========================================================================
   Página de Política de Privacidad
   ========================================================================== */

.legal-body {
  min-height: 100%;
  background: var(--bg);
  padding: 24px 16px 48px;
}

.legal-container {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.legal-card h1 {
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-section h2 {
  font-size: 1.05rem;
  color: var(--text);
}

.legal-section p,
.legal-section li {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.legal-section ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-section a {
  color: var(--primary);
}

@media (max-width: 600px) {
  .legal-card {
    padding: 20px 18px;
  }
}

/* ==========================================================================
   Estructura Principal (Topbar + Sidebar + Contenido)
   ========================================================================== */

.app-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: 8px;
}

.topbar-brand-name {
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.topbar-logo-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-arrows {
  display: flex;
  align-items: center;
  gap: 2px;
}

.period-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  margin-left: 4px;
}

.search-box {
  position: relative;
  width: 220px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  font-size: 0.85rem;
  transition: border-color 0.15s, background-color 0.15s;
}

.search-box input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
}

.view-switcher {
  display: inline-flex;
  background: var(--surface-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.view-btn {
  border: none;
  background: transparent;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.view-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px 3px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-size: 0.83rem;
  font-weight: 500;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-only {
  display: none;
}

.app-body {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-card {
  background: var(--surface-subtle);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.stat-card:hover {
  border-color: var(--border-strong);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-card.stat-entrega .stat-value { color: var(--entrega); }
.stat-card.stat-tarea .stat-value { color: var(--tarea); }
.stat-card.stat-examen .stat-value { color: var(--examen); }

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill:hover {
  background: var(--surface-subtle);
}

.filter-pill.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upcoming-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  text-align: left;
  width: 100%;
}

.upcoming-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.upcoming-item .dot {
  margin-top: 5px;
}

.upcoming-content {
  min-width: 0;
  flex: 1;
}

.upcoming-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.countdown-pill {
  font-weight: 600;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.countdown-pill.urgent {
  background: var(--entrega-bg);
  color: var(--entrega-text);
}

/* ==========================================================================
   Área principal: Vista Mensual
   ========================================================================== */

.main-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.month-view {
  flex: 1;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.month-weekday {
  padding: 9px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
}

.month-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(105px, 1fr);
}

.day-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background-color 0.12s;
  min-width: 0;
}

.day-cell:nth-child(7n) {
  border-right: none;
}

.day-cell:hover {
  background: var(--surface-hover);
}

.day-cell.outside {
  background: var(--bg);
  opacity: 0.62;
}

.day-cell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-number {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.day-cell.today .day-number {
  background: var(--primary);
  color: #ffffff;
}

.day-add-hint {
  opacity: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: opacity 0.12s;
  padding: 0 4px;
}

.day-cell:hover .day-add-hint {
  opacity: 1;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.event-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: filter 0.12s;
}

.event-chip:hover {
  filter: brightness(0.95);
}

.event-chip.type-entrega {
  background: var(--entrega-bg);
  color: var(--entrega-text);
  border-left-color: var(--entrega);
}

.event-chip.type-tarea {
  background: var(--tarea-bg);
  color: var(--tarea-text);
  border-left-color: var(--tarea);
}

.event-chip.type-examen {
  background: var(--examen-bg);
  color: var(--examen-text);
  border-left-color: var(--examen);
}

.event-chip.completed {
  opacity: 0.55;
  text-decoration: line-through;
}

.event-chip-time {
  font-weight: 600;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.event-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.more-events-label {
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  padding: 2px 4px;
  cursor: pointer;
}

.more-events-label:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Vista Semanal
   ========================================================================== */

.week-view {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.week-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  overflow: hidden;
}

.week-column.today {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-soft);
}

.week-col-header {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.week-col-dayname {
  font-size: 0.76rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
}

.week-col-date {
  font-size: 1.05rem;
  font-weight: 700;
}

.week-column.today .week-col-date {
  color: var(--primary);
}

.week-col-body {
  padding: 10px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-card {
  padding: 9px 10px;
  border-radius: 9px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, filter 0.12s;
}

.week-card:hover {
  filter: brightness(0.97);
}

.week-card.type-entrega {
  background: var(--entrega-bg);
  color: var(--entrega-text);
  border-left-color: var(--entrega);
}

.week-card.type-tarea {
  background: var(--tarea-bg);
  color: var(--tarea-text);
  border-left-color: var(--tarea);
}

.week-card.type-examen {
  background: var(--examen-bg);
  color: var(--examen-text);
  border-left-color: var(--examen);
}

.week-card.completed {
  opacity: 0.55;
}

.week-card.completed .week-card-title {
  text-decoration: line-through;
}

.week-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
}

.week-card-title {
  font-size: 0.86rem;
  font-weight: 600;
  margin-top: 3px;
}

.week-card-subject {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-top: 3px;
}

.week-empty-add {
  margin-top: auto;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 7px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}

.week-empty-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* ==========================================================================
   Vista Lista / Agenda
   ========================================================================== */

.list-view {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.list-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.list-group-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.list-row:hover {
  box-shadow: var(--shadow-sm);
}

.list-row.type-entrega { border-left-color: var(--entrega); }
.list-row.type-tarea { border-left-color: var(--tarea); }
.list-row.type-examen { border-left-color: var(--examen); }
.list-row.completed { opacity: 0.6; }

.list-check {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.list-row-main {
  flex: 1;
  min-width: 0;
}

.list-row-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.list-row.completed .list-row-title {
  text-decoration: line-through;
}

.list-row-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.type-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.type-tag.type-entrega { background: var(--entrega-bg); color: var(--entrega-text); }
.type-tag.type-tarea { background: var(--tarea-bg); color: var(--tarea-text); }
.type-tag.type-examen { background: var(--examen-bg); color: var(--examen-text); }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.empty-state h4 {
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ==========================================================================
   Modales y Notificaciones
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 490px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-form {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.type-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-inline-add {
  border: none;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn-inline-add:hover {
  filter: brightness(0.95);
}

.btn-link {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

.change-password-form {
  width: 100%;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.small-heading {
  font-size: 0.84rem;
  color: var(--text);
}

.select-with-add {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.select-with-add select {
  flex: 1;
  min-width: 0;
}

.btn-plus-square {
  width: 38px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-plus-square:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.quick-add-box {
  margin-top: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.quick-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.quick-add-row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.quick-add-row input[type="color"],
.settings-inline-form input[type="color"] {
  width: 34px;
  height: 32px;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}

.settings-inline-form {
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
}

.settings-inline-form input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.86rem;
}

.manager-chips {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.manager-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
}

.manager-chip-remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0 2px;
  border-radius: 999px;
}

.manager-chip-remove:hover {
  color: var(--danger);
}

/* ==========================================================================
   Dashboard Scrum Semanal
   ========================================================================== */

.scrum-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.scrum-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.scrum-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.scrum-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scrum-kpi-val {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.1;
}

.scrum-kpi-lbl {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

.scrum-progress-wrap {
  min-width: 200px;
  flex: 1;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scrum-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.scrum-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  overflow: hidden;
}

.scrum-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #84ae86);
  transition: width 0.25s ease;
}

.scrum-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  flex: 1;
  align-items: start;
}

.scrum-column {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 420px;
  transition: border-color 0.15s, background-color 0.15s;
}

.scrum-column.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.scrum-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
}

.scrum-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.scrum-col-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.scrum-col-dot.todo { background: #64748b; }
.scrum-col-dot.in_progress { background: #f59e0b; }
.scrum-col-dot.done { background: #10b981; }

.scrum-col-count {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.scrum-cards {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.scrum-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: transform 0.12s, box-shadow 0.12s;
}

.scrum-card:hover {
  box-shadow: var(--shadow-md);
}

.scrum-card.dragging {
  opacity: 0.45;
}

.scrum-card.done {
  opacity: 0.72;
}

.scrum-card.done .scrum-card-title {
  text-decoration: line-through;
}

.scrum-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.scrum-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.scrum-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.scrum-card-actions {
  display: flex;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.scrum-move-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.scrum-move-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.scrum-move-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.scrum-empty {
  text-align: center;
  padding: 24px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
}

.type-option {
  cursor: pointer;
}

.type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-option-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--surface);
  transition: all 0.15s;
}

.type-option input:checked + .type-option-card {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.type-option[data-type-option="entrega"] input:checked + .type-option-card {
  border-color: var(--entrega);
  background: var(--entrega-bg);
  color: var(--entrega-text);
}

.type-option[data-type-option="tarea"] input:checked + .type-option-card {
  border-color: var(--tarea);
  background: var(--tarea-bg);
  color: var(--tarea-text);
}

.type-option[data-type-option="examen"] input:checked + .type-option-card {
  border-color: var(--examen);
  background: var(--examen-bg);
  color: var(--examen-text);
}

.integration-inline-option {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.modal-form .modal-footer {
  margin: 4px -20px -18px;
}

.modal-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.settings-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.integration-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gcal-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #4285f4;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Responsivo (Tablet y Móvil — sin perder información)
   ========================================================================== */

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 30;
}

.sidebar-mobile-user {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-text strong {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-text span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-search-wrap input {
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  font-size: 0.86rem;
}

@media (max-width: 1024px) {
  .search-box {
    width: 165px;
  }

  .scrum-board {
    grid-template-columns: 1fr;
  }

  .scrum-column {
    min-height: 200px;
  }
}

@media (max-width: 960px) {
  .mobile-only {
    display: inline-flex;
  }

  .sidebar-mobile-user.mobile-only {
    display: flex;
  }

  .search-box,
  .topbar-brand-name,
  .user-name {
    display: none;
  }

  .topbar {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }

  .topbar-left {
    flex: 1 1 auto;
    gap: 6px;
  }

  .topbar-right {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .view-switcher {
    flex: 1;
    justify-content: space-between;
  }

  .view-btn {
    flex: 1;
    padding: 6px 6px;
    font-size: 0.8rem;
    text-align: center;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(310px, 86vw);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    padding: 12px;
  }

  .month-grid {
    grid-auto-rows: minmax(86px, 1fr);
  }

  .period-title {
    font-size: 0.94rem;
  }

  .week-view {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .week-column {
    min-height: auto;
  }
}

@media (max-width: 600px) {
  .topbar-brand {
    display: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .month-weekday {
    font-size: 0.68rem;
    padding: 7px 2px;
  }

  .day-cell {
    padding: 4px 3px;
  }

  .day-number {
    width: 22px;
    height: 22px;
    font-size: 0.74rem;
  }

  .event-chip {
    padding: 2px 4px;
    font-size: 0.68rem;
  }

  .event-chip-time {
    display: none;
  }

  .modal-card {
    max-height: 94vh;
    border-radius: 14px;
  }

  .modal-header,
  .modal-form,
  .settings-body,
  .modal-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .modal-form .modal-footer {
    margin: 4px -14px -18px;
  }

  .scrum-header-card {
    padding: 12px 14px;
  }

  .scrum-progress-wrap {
    max-width: none;
    width: 100%;
    flex: 1 1 100%;
  }
}
