/* ============================================
   VARIABLES Y RESET
   ============================================ */
:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a2e;
  --bg-card-hover: #1f1f3a;
  --bg-input: #16213e;
  --text: #e0e0e0;
  --text-muted: #8888aa;
  --primary: #6c63ff;
  --primary-hover: #5a52d5;
  --success: #00c853;
  --warning: #ffd600;
  --danger: #ff5252;
  --border: #2a2a4a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --nav-height: 72px;
  --header-height: 56px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 16px);
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-logo {
  font-size: 64px;
  margin-bottom: 8px;
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 16px;
}

/* ============================================
   APP HEADER
   ============================================ */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1001;
}

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

.header-logo { font-size: 24px; }

.header-title {
  font-size: 16px;
  font-weight: 700;
  display: none;
}

.header-center { flex: 1; display: flex; justify-content: center; }

.restaurant-select {
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  max-width: 250px;
  width: 100%;
}

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

.header-user {
  font-size: 13px;
  color: var(--text-muted);
  display: none;
}

/* ============================================
   NAVEGACIÓN INFERIOR
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: auto;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-btn.active { color: var(--primary); }
.nav-btn:hover { color: var(--primary); background: rgba(108,99,255,0.1); }
.nav-icon { font-size: 20px; }
.nav-label { font-size: 10px; font-weight: 600; }

/* ============================================
   LAYOUT
   ============================================ */
#app-container {
  padding-top: var(--header-height);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.section { display: none; }
.section.active { display: block; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
}

.section-header .section-title { margin-bottom: 0; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.interactive-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(108, 99, 255, 0.12);
}

.action-card {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chart-card { padding: 16px; }
.chart-card h3 { margin-bottom: 12px; font-size: 16px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ============================================
   SUMMARY CARD
   ============================================ */
.summary-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.stat { text-align: center; }

.stat-number {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #3a3a5a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #cc4444; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); }

/* ============================================
   FORMULARIOS
   ============================================ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

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

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn select { flex: 1; }

/* Checkbox group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ============================================
   MODALES
   ============================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  justify-content: center;
  align-items: flex-end;
  padding: 0;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-sm { max-width: 400px; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 { font-size: 20px; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
}

/* ============================================
   FILTROS Y TABS
   ============================================ */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filters select {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.tab {
  flex: 1;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
  min-width: fit-content;
}

.tab.active {
  background: var(--primary);
  color: #fff;
}

.inventory-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
}

/* ============================================
   LISTAS DE ITEMS
   ============================================ */
.task-group { margin-bottom: 20px; }

.task-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding-left: 4px;
}

.task-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s;
  cursor: pointer;
}

.task-item:hover { background: var(--bg-card-hover); }

.task-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.2s;
}

.task-check:hover { border-color: var(--success); }
.task-check.checked { background: var(--success); border-color: var(--success); }
.task-check.checked::after { content: '\2713'; color: #fff; font-size: 12px; font-weight: 700; }

.task-info { flex: 1; min-width: 0; }

.task-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-word;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-alta { background: rgba(255,82,82,0.2); color: var(--danger); }
.badge-media { background: rgba(255,214,0,0.2); color: var(--warning); }
.badge-baja { background: rgba(0,200,83,0.2); color: var(--success); }
.badge-laboral { background: rgba(108,99,255,0.2); color: var(--primary); }
.badge-personal { background: rgba(0,200,83,0.2); color: var(--success); }
.badge-overdue { background: rgba(255,82,82,0.3); color: var(--danger); }

.task-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

/* ============================================
   HÁBITOS
   ============================================ */
.habit-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s;
}

.habit-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}

.habit-toggle.done {
  border-color: var(--success);
  background: rgba(0,200,83,0.15);
  transform: scale(1.05);
}

.habit-info { flex: 1; }
.habit-name { font-weight: 600; font-size: 16px; }
.habit-streak { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.habit-actions {
  display: flex;
  gap: 4px;
}

/* Calendar grid */
.calendar-grid {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.calendar-grid h4 {
  font-size: 15px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day-label {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 4px 0;
}

.calendar-day {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-input);
}

.calendar-day.done { background: var(--success); color: #fff; font-weight: 600; }
.calendar-day.has-tasks { background: var(--warning); color: #1a1a2e; font-weight: 600; }
.calendar-day.today { border: 2px solid var(--primary); }
.calendar-day.selected { border: 2px solid #fff; }
.calendar-day.empty { background: transparent; }
.calendar-day.clickable { cursor: pointer; position: relative; }
.calendar-day.clickable:hover { opacity: 0.8; }
.day-count {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 9px;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.calendar-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.legend-dot.done { background: var(--success); }
.legend-dot.has-tasks { background: var(--warning); }

/* ============================================
   FITNESS
   ============================================ */
.fitness-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.fitness-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.fitness-stat-icon { font-size: 24px; margin-bottom: 4px; }
.fitness-stat-value { font-size: 20px; font-weight: 800; color: var(--primary); }
.fitness-stat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.chart-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.chart-tab {
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.chart-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.fitness-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.fitness-item-icon { font-size: 24px; }
.fitness-item-info { flex: 1; }
.fitness-item-value { font-weight: 700; font-size: 15px; }
.fitness-item-date { font-size: 12px; color: var(--text-muted); }

/* ============================================
   COMPACT LIST (Dashboard)
   ============================================ */
.list-compact { font-size: 14px; }

.list-compact-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-compact-item:last-child { border-bottom: none; }

.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================
   ALERTAS
   ============================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-warning {
  background: rgba(255,214,0,0.15);
  border: 1px solid rgba(255,214,0,0.3);
  color: var(--warning);
}

.alert-danger {
  background: rgba(255,82,82,0.15);
  border: 1px solid rgba(255,82,82,0.3);
  color: var(--danger);
}

/* ============================================
   ICON PICKER
   ============================================ */
.icon-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-option {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-option.selected { border-color: var(--primary); background: rgba(108,99,255,0.2); }

/* ============================================
   UTILIDADES
   ============================================ */
.mt-1 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 320px;
}

@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* Table styles */
table {
  font-size: 14px;
}

table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 599px) {
  .fitness-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .summary-stats {
    flex-direction: column;
    gap: 8px;
  }
}

@media (min-width: 600px) {
  .container { padding: 24px; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-card { grid-column: 1 / -1; }
  .chart-card { grid-column: 1 / -1; }
  .modal { align-items: center; padding: 16px; }
  .modal-content { border-radius: var(--radius); }
  .header-title { display: block; }
  .header-user { display: block; }
}

@media (min-width: 768px) {
  .bottom-nav {
    top: var(--header-height);
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid var(--border);
    height: 48px;
  }
  #app-container {
    padding-top: calc(var(--header-height) + 48px);
  }
  body {
    padding-bottom: 0;
  }
  .nav-btn { flex-direction: row; gap: 6px; }
  .nav-label { font-size: 13px; }
  .nav-icon { font-size: 16px; }
}

/* ============================================
   AREAS GRID
   ============================================ */

/* Rompé el max-width de .container sólo cuando entrás a áreas,
   para que el grid pueda centrarse en viewports anchos sin quedar pegado a la izquierda. */
@media (min-width: 961px) {
  #areas.section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-top: 8px;
  }
}

/* Flexbox + wrap: cada fila se centra sola, así la fila huérfana queda
   perfectamente centrada sin hacks de :nth-child. */
.areas-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 14px;
  /* 5 cards × 160px + 4 gaps × 14px + padding 48 = 904px → fija 5 por fila;
     la última fila incompleta queda centrada automáticamente por justify-content. */
  max-width: 904px;
  margin: 0 auto;
  padding: 16px 24px 24px;
}

.area-card {
  flex: 0 0 160px;
  width: 160px;
  aspect-ratio: 4 / 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.area-card:hover {
  transform: translateY(-4px);
  border-color: #d4a853;
  box-shadow: 0 10px 28px rgba(212, 168, 83, 0.22);
}

.area-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}

.area-label {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
  line-height: 1.2;
}

.area-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Tablets: cards un poco más chicas para que entren 3-4 por fila */
@media (max-width: 1023px) {
  .area-card { flex: 0 0 150px; width: 150px; }
}

/* Mobile: 2 por fila, cards fluidas */
@media (max-width: 600px) {
  .areas-grid { gap: 12px; padding: 12px 16px 20px; }
  .area-card {
    flex: 0 0 calc(50% - 6px);
    width: calc(50% - 6px);
    padding: 12px;
  }
  .area-icon { font-size: 28px; }
}

/* ============================================
   MEETINGS MODALS
   ============================================ */
.modal-meetings {
  min-width: 500px;
  max-width: 560px;
}

.meeting-form .form-group {
  margin-bottom: 20px;
}

.meeting-form .form-group label {
  font-size: 14px;
  margin-bottom: 8px;
  display: block;
  color: var(--text);
}

.meeting-form input[type="date"],
.meeting-form input[type="text"],
.meeting-form select,
.meeting-form textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.meeting-form input:focus,
.meeting-form select:focus,
.meeting-form textarea:focus {
  border-color: var(--primary);
  outline: none;
}

.meeting-form textarea {
  min-height: 100px;
  resize: vertical;
}

.meeting-form .form-actions {
  margin-top: 24px;
  gap: 12px;
}

.meeting-form .form-actions .btn {
  padding: 12px 32px;
  font-size: 16px;
}

.participants-list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.participant-check {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
}

.participant-check:has(input:checked) {
  background: #6C5CE7;
  border-color: #6C5CE7;
}

.participant-check:has(input:checked) span {
  color: #fff;
}

.participant-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.participant-check span {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .modal-meetings {
    min-width: unset;
    max-width: 100%;
    width: 100%;
    margin: 8px;
  }
}

/* ============================================
   LOADING / DISABLED STATES
   ============================================ */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.spinner-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

select {
  transition: border-color 0.15s ease;
}

/* ============================================
   MARKETING CALENDAR — Adapted from original
   ============================================ */
:root {
  --mk-fuego: #E8775A;
  --mk-voz: #6EA8D8;
  --mk-saber: #76B887;
  --mk-mesa: #D8A460;
  --mk-story: #A882CC;
  --mk-accion: #E8C84A;
  --mk-gold: #D8A460;
  --mk-header: #1a1520;
  --mk-radius: 14px;
  --mk-radius-sm: 8px;
}

/* Container */
.marketing-section { overflow: hidden; }

/* ─── HEADER ─────────────────────────── */
.mk-header {
  background: var(--mk-header);
  border-radius: var(--mk-radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.mk-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 8px;
}
.mk-brand-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}
.mk-header-title {
  font-size: 22px;
  font-weight: 600;
  color: #FFF;
  line-height: 1.1;
}
.mk-header-title em {
  color: var(--mk-gold);
  font-style: italic;
}
.mk-header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mk-stat-pill {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.mk-sync-dot {
  color: var(--mk-saber);
  animation: mk-pulse 2s infinite;
}
@keyframes mk-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Nav row */
.mk-header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 12px;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Tabs */
.mk-view-tabs {
  display: flex;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 3px;
}
.mk-view-tab {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  background: none;
  border: none;
  padding: 5px 14px;
  border-radius: var(--mk-radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.mk-view-tab:hover { color: rgba(255,255,255,0.8); }
.mk-view-tab.active {
  background: var(--mk-gold);
  color: #FFF;
}

/* Nav center */
.mk-nav-center {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mk-nav-arrow {
  width: 30px; height: 30px;
  border-radius: var(--mk-radius-sm);
  border: 1px solid rgba(255,255,255,0.15);
  background: none;
  color: #FFF;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.mk-nav-arrow:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--mk-gold);
}
.mk-nav-label {
  font-size: 18px;
  font-weight: 600;
  color: #FFF;
  min-width: 160px;
  text-align: center;
}
.mk-nav-today {
  font-size: 11px;
  color: var(--mk-gold);
  background: none;
  border: 1px solid rgba(216,164,96,0.3);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.mk-nav-today:hover { background: rgba(216,164,96,0.15); }

/* City filter */
.mk-city-filter {
  display: flex;
  gap: 4px;
}
.mk-filter-btn {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.mk-filter-btn:hover { color: #FFF; border-color: rgba(255,255,255,0.3); }
.mk-filter-btn.active {
  color: var(--mk-gold);
  border-color: var(--mk-gold);
  background: rgba(216,164,96,0.12);
}

/* Toolbar buttons */
.mk-toolbar-buttons {
  display: flex;
  gap: 6px;
}
.mk-tool-btn {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 5px 12px;
  border-radius: var(--mk-radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.mk-tool-btn:hover { color: #FFF; background: rgba(255,255,255,0.12); }
.mk-tool-btn.mk-primary { background: var(--mk-gold); color: #FFF; border-color: var(--mk-gold); }
.mk-tool-btn.mk-primary:hover { filter: brightness(1.1); }
.mk-tool-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--mk-fuego);
  color: #FFF;
  font-size: 9px;
  font-weight: 600;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ─── STATS BAR ──────────────────────── */
.mk-stats-bar {
  display: flex;
  gap: 14px;
  padding: 6px 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.mk-progress-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mk-progress-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.mk-progress-label strong { color: var(--text); }
.mk-progress-track {
  width: 100px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.mk-progress-fill {
  height: 100%;
  background: var(--mk-saber);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}
.mk-stats-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mk-stats-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.mk-stats-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.mk-type-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  transition: all 0.2s;
}
.mk-type-pill:hover { border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.9); }
.mk-type-pill .mk-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mk-stats-chip.mk-chip-fuego { background: rgba(232,119,90,0.15); color: var(--mk-fuego); }
.mk-stats-chip.mk-chip-voz { background: rgba(110,168,216,0.15); color: var(--mk-voz); }
.mk-stats-chip.mk-chip-saber { background: rgba(118,184,135,0.15); color: var(--mk-saber); }
.mk-stats-chip.mk-chip-mesa { background: rgba(216,164,96,0.15); color: var(--mk-mesa); }
.mk-stats-chip.mk-chip-story { background: rgba(168,130,204,0.15); color: var(--mk-story); }
.mk-stats-chip.mk-chip-accion { background: rgba(232,200,74,0.15); color: #b09520; }

/* ─── MONTH GRID ─────────────────────── */
.mk-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}
.mk-month-header-cell {
  padding: 8px 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: rgba(255,255,255,0.02);
}
.mk-month-day {
  background: var(--bg-card);
  min-height: 115px;
  padding: 8px 10px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  border-radius: 0;
  border: none;
  box-shadow: none;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mk-month-day:hover {
  background: rgba(255,255,255,0.04);
}
.mk-month-day.mk-has-content {
  background: rgba(255,255,255,0.025);
}
.mk-month-day.mk-other-month {
  opacity: 0.3;
  background: rgba(0,0,0,0.1);
}
.mk-month-day.mk-today {
  background: rgba(216,164,96,0.06);
  box-shadow: inset 0 0 0 2px var(--mk-gold);
}

/* Day number */
.mk-day-number {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 6px;
}
.mk-day-number > span:first-child {
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.mk-month-day.mk-other-month .mk-day-number > span:first-child { color: var(--text-muted); }
.mk-month-day.mk-today .mk-day-number > span:first-child { color: var(--mk-gold); }
.mk-day-dow {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.3px;
}
.mk-today-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mk-gold);
  margin-left: auto;
}

/* Efemeride */
.mk-day-efemeride {
  font-size: 8px;
  color: var(--mk-gold);
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
  line-height: 1.3;
  opacity: 0.8;
}

/* Chips container */
.mk-day-chips {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}

/* Overflow indicator */
.mk-day-overflow {
  font-size: 9px;
  color: var(--text-muted);
  padding: 1px 0;
  cursor: pointer;
}
.mk-day-overflow:hover { color: var(--text); }

/* Status indicators row */
.mk-day-indicators {
  display: flex;
  gap: 3px;
  margin-top: auto;
  padding-top: 4px;
}
.mk-day-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.mk-day-indicator.mk-ind-pub { background: var(--mk-saber); }
.mk-day-indicator.mk-ind-pending { background: rgba(255,255,255,0.2); }

/* Quick-add */
.mk-day-add {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.15s ease;
  z-index: 2;
}
.mk-month-day:hover .mk-day-add { opacity: 1; }
.mk-day-add:hover {
  background: var(--mk-gold);
  border-color: var(--mk-gold);
  color: #FFF;
  transform: scale(1.1);
}

/* ─── ENTRY CHIPS ────────────────────── */
.mk-entry-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 10.5px;
  line-height: 1.3;
  cursor: grab;
  transition: all 0.15s;
  overflow: hidden;
  max-width: 100%;
  background: none;
  color: rgba(255,255,255,0.75);
}
.mk-entry-chip:active { cursor: grabbing; }
.mk-entry-chip:hover { background: rgba(255,255,255,0.05); color: #FFF; }
.mk-entry-chip.mk-dragging { opacity: 0.4; }

.mk-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mk-chip-dot.mk-dot-fuego { background: var(--mk-fuego); }
.mk-chip-dot.mk-dot-voz { background: var(--mk-voz); }
.mk-chip-dot.mk-dot-saber { background: var(--mk-saber); }
.mk-chip-dot.mk-dot-mesa { background: var(--mk-mesa); }
.mk-chip-dot.mk-dot-story { background: var(--mk-story); }
.mk-chip-dot.mk-dot-accion { background: var(--mk-accion); }
.mk-chip-dot.mk-dot-reunion { background: var(--mk-accion); border: 1px dashed rgba(232,200,74,0.6); width: 6px; height: 6px; }

.mk-chip-icon { font-size: 10px; flex-shrink: 0; display: none; }
.mk-chip-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 10.5px;
  min-width: 0;
}
.mk-chip-status {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Chip type colors - minimal, just text color hint */
.mk-chip-fuego { color: rgba(255,255,255,0.75); }
.mk-chip-voz { color: rgba(255,255,255,0.75); }
.mk-chip-saber { color: rgba(255,255,255,0.75); }
.mk-chip-mesa { color: rgba(255,255,255,0.75); }
.mk-chip-story { color: rgba(255,255,255,0.75); }
.mk-chip-accion { color: rgba(255,255,255,0.75); }
.mk-chip-reunion {
  color: rgba(232,200,74,0.7);
  font-style: italic;
}

/* Status dot colors */
.mk-status-idea { background: #555; }
.mk-status-prod { background: var(--mk-voz); }
.mk-status-ready { background: var(--mk-saber); }
.mk-status-pub { background: var(--mk-gold); }

/* Drag over */
.mk-drag-over {
  border-color: var(--mk-gold) !important;
  box-shadow: 0 0 0 2px rgba(216,164,96,0.3) !important;
}

/* ─── WEEK GRID ──────────────────────── */
.mk-week-grid {
  display: grid;
  grid-template-columns: 90px repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: var(--mk-radius);
  overflow: hidden;
  width: 100%;
}
.mk-week-header-cell {
  background: rgba(255,255,255,0.03);
  padding: 10px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.mk-week-type-label {
  background: rgba(255,255,255,0.03);
  padding: 8px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}
.mk-week-cell {
  background: var(--bg-card);
  padding: 5px;
  min-height: 55px;
  cursor: pointer;
  transition: background 0.15s;
}
.mk-week-cell:hover { background: var(--bg-input); }
.mk-today-col { box-shadow: inset 0 0 0 1px var(--mk-gold); }

/* ─── LIST VIEW ──────────────────────── */
.mk-list-group {
  background: var(--bg-card);
  border-radius: var(--mk-radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 8px;
}
.mk-list-date-header {
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mk-list-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.mk-list-entry:hover { background: var(--bg-input); }
.mk-list-entry-icon {
  width: 32px; height: 32px;
  border-radius: var(--mk-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.mk-list-entry-icon.mk-type-fuego { background: rgba(232,119,90,0.15); }
.mk-list-entry-icon.mk-type-voz { background: rgba(110,168,216,0.15); }
.mk-list-entry-icon.mk-type-saber { background: rgba(118,184,135,0.15); }
.mk-list-entry-icon.mk-type-mesa { background: rgba(216,164,96,0.15); }
.mk-list-entry-icon.mk-type-story { background: rgba(168,130,204,0.15); }
.mk-list-entry-icon.mk-type-accion { background: rgba(232,200,74,0.15); }
.mk-list-entry-icon.mk-type-reunion { background: rgba(232,200,74,0.08); border: 1px dashed rgba(232,200,74,0.3); }

/* ─── MODALS ─────────────────────────── */
.mk-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
}
.mk-modal-overlay.active { display: block; }
.mk-modal {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% + 10px)) scale(0.97);
  background: var(--bg-card);
  border-radius: var(--mk-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
  z-index: 1000;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mk-modal.active {
  display: block;
  transform: translate(-50%, -50%) scale(1);
}
.mk-modal-large { max-width: 700px; }

.mk-modal .modal-header {
  background: var(--mk-header);
  color: #FFF;
  padding: 16px 20px;
  border-radius: var(--mk-radius) var(--mk-radius) 0 0;
}
.mk-modal .modal-header h2 {
  font-size: 20px;
  font-weight: 600;
}
.mk-modal .modal-close {
  width: 30px; height: 30px;
  border-radius: var(--mk-radius-sm);
  border: 1px solid rgba(255,255,255,0.15);
  background: none;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mk-modal .modal-close:hover { color: #FFF; background: rgba(255,255,255,0.1); }

/* Type/status card active state in modal */
.mk-type-card.active, .mk-status-card.active, .mk-arc-card.active, .mk-format-card.active {
  background: rgba(216,164,96,0.15) !important;
  color: var(--mk-gold) !important;
  border-color: var(--mk-gold) !important;
}

/* ============================================
   AUDITS
   ============================================ */
.audit-items-open { display: block !important; }
