/* ================================================================
   CLAROS CALENDAR - Hoja de estilos principal
   ================================================================ */

/* --- Variables CSS --- */
:root {
  --orange:       #F7941D;
  --orange-dark:  #D97B15;
  --orange-light: #FFF3E0;
  --gray:         #6B6B6B;
  --gray-dark:    #3A3A3A;
  --gray-light:   #F5F5F5;
  --white:        #FFFFFF;
  --border:       #E0E0E0;
  --text:         #2C2C2C;
  --text-muted:   #9E9E9E;
  --success:      #27AE60;
  --error:        #E74C3C;
  --warning:      #F39C12;
  --info:         #3498DB;
  --sidebar-w:    280px;
  --header-h:     64px;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.16);
  --transition:   0.2s ease;
  --font:         'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--gray-light);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dark); }

img { max-width: 100%; height: auto; display: block; }

button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: var(--font); }

ul { list-style: none; }

/* --- Scrollbars --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }

/* ================================================================
   BOTONES
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(247,148,29,0.35); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--white);
  color: var(--gray-dark);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--gray-light); border-color: var(--gray); }

.btn-danger {
  background: var(--error);
  color: var(--white);
}
.btn-danger:hover { background: #C0392B; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--gray);
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--gray-light); color: var(--text); }

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gray);
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--gray-light); color: var(--text); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-full { width: 100%; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ================================================================
   FORMULARIOS
   ================================================================ */
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(247,148,29,0.15);
}
.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 80px; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6B6B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.form-help { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--error); margin-top: 5px; display: none; }
.form-control.is-invalid { border-color: var(--error); }
.form-control.is-invalid + .form-error { display: block; }

/* Toggle switch */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--orange); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-label { font-size: 14px; color: var(--text); }

/* Color picker */
.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition);
  position: relative;
}
.color-option:hover { transform: scale(1.15); }
.color-option.selected {
  border-color: var(--white);
  box-shadow: 0 0 0 2.5px currentColor, 0 0 0 5px var(--border);
}
.color-option.selected::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  font-weight: bold;
}

/* ================================================================
   MODALES
   ================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.modal-backdrop.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition);
}
.modal-backdrop.active .modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  line-height: 1;
}
.modal-close:hover { background: var(--gray-light); color: var(--text); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ================================================================
   NOTIFICACIONES TOAST
   ================================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--gray-dark);
  color: var(--white);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  transform: translateX(110%);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  min-width: 260px;
}
.toast.show { transform: translateX(0); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-message { flex: 1; line-height: 1.4; }
.toast.success { background: #1D6F42; }
.toast.error   { background: #B91C1C; }
.toast.warning { background: #B45309; }
.toast.info    { background: #1D4ED8; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-orange  { background: var(--orange-light); color: var(--orange-dark); }
.badge-green   { background: #E8F5E9; color: #2E7D32; }
.badge-gray    { background: var(--gray-light); color: var(--gray); }
.badge-red     { background: #FFEBEE; color: #C62828; }

/* ================================================================
   PÁGINA DE LOGIN
   ================================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #2C2C2C 50%, #3a3a4e 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
  overflow-x: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247,148,29,0.15), transparent 70%);
  top: -200px;
  right: -200px;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247,148,29,0.1), transparent 70%);
  bottom: -150px;
  left: -100px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo img {
  height: 72px;
  margin: 0 auto;
  object-fit: contain;
}

.login-title {
  text-align: center;
  margin-bottom: 32px;
}
.login-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.login-title p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.input-icon-wrap {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}
.input-icon-wrap .form-control { padding-left: 42px; }

.input-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.input-icon-right:hover { color: var(--text); }

.login-submit {
  margin-top: 8px;
}

.login-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ================================================================
   LAYOUT PRINCIPAL (HEADER + SIDEBAR + CONTENT)
   ================================================================ */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Header --- */
.app-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--gray);
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.menu-toggle:hover { background: var(--gray-light); color: var(--text); }

.header-logo img {
  height: 40px;
  width: auto;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-light);
  border-radius: 24px;
  padding: 8px 16px;
  flex: 1;
  max-width: 360px;
  margin: 0 20px;
}
.header-search input {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  width: 100%;
  outline: none;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search-icon { color: var(--text-muted); font-size: 15px; }

.header-user-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.3;
  margin: 0 12px;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}
.header-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.header-user-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

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

.header-today-btn {
  padding: 7px 16px;
  border-radius: 20px;
  background: var(--orange);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.header-today-btn:hover { background: var(--orange-dark); }

.user-menu { position: relative; }
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}
.user-avatar:hover { border-color: var(--orange); transform: scale(1.05); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
}
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }

.user-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.user-dropdown-name { font-weight: 700; font-size: 14px; color: var(--text); }
.user-dropdown-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.user-dropdown-last-login {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.last-login-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.last-login-value {
  display: block;
  font-size: 12px;
  color: var(--gray-dark);
  font-weight: 500;
  line-height: 1.4;
}

.user-dropdown-menu { padding: 6px 0; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
  width: 100%;
  text-align: left;
  background: none;
  border: none;
}
.user-dropdown-item:hover { background: var(--gray-light); }
.user-dropdown-item.danger { color: var(--error); }
.user-dropdown-item .item-icon { font-size: 16px; color: var(--text-muted); }
.user-dropdown-item.danger .item-icon { color: var(--error); }

.admin-badge-header {
  font-size: 10px;
  font-weight: 700;
  background: var(--orange-light);
  color: var(--orange-dark);
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* --- Sidebar --- */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--header-h));
  position: fixed;
  top: var(--header-h);
  left: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.sidebar-content { flex: 1; padding: 16px 10px; }

.btn-create-event {
  width: 100%;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(247,148,29,0.3);
  margin-bottom: 20px;
}
.btn-create-event:hover { background: var(--orange-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(247,148,29,0.4); }

/* Mini calendar */
.mini-calendar { margin-bottom: 24px; }
.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}
.mini-cal-title { font-size: 14px; font-weight: 700; color: var(--text); }
.mini-cal-nav {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all var(--transition);
}
.mini-cal-nav:hover { background: var(--gray-light); color: var(--text); }

.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-cal-dayname {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
  text-transform: uppercase;
}
.mini-cal-day {
  text-align: center;
  font-size: 12px;
  padding: 5px 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  transition: all var(--transition);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-cal-day:hover { background: var(--gray-light); }
.mini-cal-day.today { background: var(--orange); color: var(--white); font-weight: 700; }
.mini-cal-day.selected { background: var(--orange-light); color: var(--orange-dark); font-weight: 700; }
.mini-cal-day.other-month { color: var(--text-muted); }
.mini-cal-day.has-events::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background: var(--orange);
  border-radius: 50%;
  margin: 1px auto 0;
}
.mini-cal-day.today::after { background: white; }

/* Calendars list */
.sidebar-section { margin-bottom: 4px; }
.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.sidebar-section-header:hover { background: var(--gray-light); }
.sidebar-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--gray-dark);
}
.sidebar-section-toggle {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all var(--transition);
}
.sidebar-section-toggle:hover { background: var(--orange-light); color: var(--orange); }

.calendar-list { padding-bottom: 6px; }

.calendar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.calendar-item:hover { background: var(--gray-light); }

.calendar-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid;
  flex-shrink: 0;
  transition: all var(--transition);
  position: relative;
}
.calendar-checkbox.checked::after {
  content: '✓';
  position: absolute;
  inset: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: white;
  font-weight: 900;
}
.calendar-checkbox.checked { background: currentColor; }

.calendar-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-item-actions {
  display: none;
  gap: 2px;
}
.calendar-item:hover .calendar-item-actions { display: flex; }
.calendar-item-btn {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  transition: all var(--transition);
}
.calendar-item-btn:hover { background: var(--border); color: var(--text); }

/* --- Main content --- */
.app-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  flex: 1;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
}

.calendar-container {
  flex: 1;
  padding: 20px;
  background: var(--gray-light);
}

/* ================================================================
   FULLCALENDAR CUSTOMIZATION
   ================================================================ */
.fc {
  font-family: var(--font) !important;
}

.fc .fc-toolbar {
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.fc .fc-toolbar-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  text-transform: capitalize;
}

.fc .fc-button {
  background: var(--white) !important;
  border: 1.5px solid var(--border) !important;
  color: var(--gray-dark) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 7px 14px !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  transition: all var(--transition) !important;
  font-family: var(--font) !important;
  text-transform: none !important;
}

.fc .fc-button:hover {
  background: var(--gray-light) !important;
  border-color: var(--gray) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--orange) !important;
  border-color: var(--orange) !important;
  color: var(--white) !important;
}

.fc .fc-today-button {
  background: var(--orange) !important;
  border-color: var(--orange) !important;
  color: var(--white) !important;
}
.fc .fc-today-button:hover {
  background: var(--orange-dark) !important;
  border-color: var(--orange-dark) !important;
}

.fc-theme-standard .fc-scrollgrid { border-color: var(--border) !important; }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--border) !important; }

.fc .fc-col-header-cell {
  background: var(--white) !important;
  padding: 10px 0 !important;
}
.fc .fc-col-header-cell-cushion {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  text-decoration: none !important;
}

.fc .fc-daygrid-day { background: var(--white); }
.fc .fc-daygrid-day:hover { background: #FAFAFA; }
.fc .fc-daygrid-day.fc-day-today { background: var(--orange-light) !important; }
.fc .fc-daygrid-day-number {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  text-decoration: none !important;
  padding: 6px 8px !important;
}
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  background: var(--orange) !important;
  color: white !important;
  border-radius: 50% !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 4px !important;
}

.fc .fc-event {
  border: none !important;
  border-radius: 4px !important;
  padding: 2px 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  overflow: hidden !important;
  max-width: 100% !important;
}
.fc .fc-event:hover { filter: brightness(0.9); }

.fc .fc-event-main {
  overflow: hidden !important;
  min-width: 0 !important;
}

.fc .fc-event-title {
  font-size: 12px !important;
  font-weight: 600 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.fc .fc-daygrid-event-harness {
  overflow: hidden !important;
}

.fc .fc-daygrid-day-events {
  overflow: hidden !important;
}

.fc .fc-list-event-title a { color: inherit !important; text-decoration: none !important; }
.fc .fc-list-day-cushion { background: var(--gray-light) !important; }
.fc .fc-list-day-text, .fc .fc-list-day-side-text { color: var(--text) !important; font-weight: 700 !important; text-decoration: none !important; }

.fc .fc-timegrid-slot { height: 40px !important; }
.fc .fc-timegrid-axis-cushion { font-size: 11px !important; color: var(--text-muted) !important; }

/* ================================================================
   RECORDATORIO EN PANTALLA
   ================================================================ */
.reminder-alerts-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100vw - 48px);
}

.reminder-alert {
  pointer-events: all;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.20), 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  animation: reminderSlideIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
  border: 1px solid rgba(247,148,29,0.2);
}

.reminder-alert.hiding {
  animation: reminderSlideOut 0.3s ease forwards;
}

@keyframes reminderSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes reminderSlideOut {
  from { transform: translateX(0);    opacity: 1; max-height: 300px; }
  to   { transform: translateX(120%); opacity: 0; max-height: 0;     }
}

/* Header */
.reminder-alert-header {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.reminder-alert-header-icon {
  font-size: 20px;
  animation: bellShake 0.7s ease 0.3s;
  flex-shrink: 0;
}
@keyframes bellShake {
  0%,100% { transform: rotate(0) scale(1); }
  20%     { transform: rotate(-22deg) scale(1.1); }
  40%     { transform: rotate(18deg) scale(1.1); }
  60%     { transform: rotate(-10deg); }
  80%     { transform: rotate(8deg); }
}
.reminder-alert-header-label {
  flex: 1;
  color: rgba(255,255,255,0.95);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.reminder-alert-close {
  background: rgba(255,255,255,0.18);
  border: none;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
  line-height: 1;
}
.reminder-alert-close:hover { background: rgba(255,255,255,0.32); }

/* Body */
.reminder-alert-body {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.reminder-alert-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.35;
}
.reminder-alert-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.reminder-alert-time {
  font-size: 13px;
  color: var(--orange-dark);
  font-weight: 600;
}
.reminder-alert-location {
  font-size: 12px;
  color: var(--text-muted);
}

/* Actions */
.reminder-alert-actions {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reminder-alert-row {
  display: flex;
  gap: 8px;
}
.reminder-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}
.reminder-btn-snooze {
  background: var(--orange-light);
  color: var(--orange-dark);
  border: 1.5px solid rgba(247,148,29,0.3);
}
.reminder-btn-snooze:hover { background: #FFE0B2; border-color: var(--orange); }

.reminder-btn-dismiss {
  background: var(--gray-light);
  color: var(--gray-dark);
  border: 1.5px solid var(--border);
}
.reminder-btn-dismiss:hover { background: #EEEEEE; border-color: #BDBDBD; }

.reminder-btn-dismiss-all {
  width: 100%;
  background: #FFF3F3;
  color: #C62828;
  border: 1.5px solid #FFCDD2;
  font-size: 12px;
}
.reminder-btn-dismiss-all:hover { background: #FFEBEE; border-color: #EF9A9A; }

/* Countdown */
.reminder-alert-countdown {
  height: 3px;
  background: var(--border);
  overflow: hidden;
}
.reminder-alert-countdown-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-dark));
  width: 100%;
}

@media (max-width: 480px) {
  .reminder-alerts-container { right: 12px; left: 12px; top: 74px; width: auto; }
}

/* ================================================================
   PANEL DE ADMINISTRACIÓN
   ================================================================ */
.admin-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
  gap: 16px;
}

.admin-header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.admin-nav-tabs {
  display: flex;
  gap: 2px;
  background: var(--gray-light);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.admin-nav-tab {
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  background: none;
  border: none;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-nav-tab:hover { color: var(--text); }
.admin-nav-tab.active { background: var(--white); color: var(--orange); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

.admin-content {
  margin-top: var(--header-h);
  padding: 28px;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition);
}
.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon.orange { background: var(--orange-light); }
.stat-icon.green  { background: #E8F5E9; }
.stat-icon.blue   { background: #E3F2FD; }
.stat-icon.purple { background: #F3E5F5; }

.stat-info { flex: 1; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Users table */
.users-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-title { font-size: 16px; font-weight: 700; color: var(--text); }

.panel-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.search-input-wrap {
  position: relative;
}
.search-input-wrap input {
  padding: 8px 12px 8px 36px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  background: var(--gray-light);
  color: var(--text);
  width: 220px;
  transition: all var(--transition);
  outline: none;
}
.search-input-wrap input:focus { border-color: var(--orange); background: var(--white); }
.search-input-wrap .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* Table */
.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  background: var(--gray-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid #F0F0F0;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFAFA; }

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-cell-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.user-cell-name { font-weight: 600; color: var(--text); }
.user-cell-email { font-size: 12px; color: var(--text-muted); }

.table-actions { display: flex; gap: 4px; }
.action-btn {
  background: none;
  border: none;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition);
  color: var(--gray);
}
.action-btn:hover { background: var(--gray-light); color: var(--text); }
.action-btn.danger:hover { background: #FFEBEE; color: var(--error); }
.action-btn.warning:hover { background: #FFF8E1; color: var(--warning); }
.action-btn.success:hover { background: #E8F5E9; color: var(--success); }
.action-btn[title] { position: relative; }

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state-text { font-size: 14px; }

/* ================================================================
   MODAL DEL EVENTO
   ================================================================ */
.event-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.event-modal .modal { max-width: 600px; }

.event-detail-header {
  background: var(--orange);
  height: 8px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.members-list { display: flex; flex-direction: column; gap: 8px; }
.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--gray-light);
}
.member-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.member-item-info { flex: 1; min-width: 0; }
.member-item-name { font-size: 13px; font-weight: 600; }
.member-item-email { font-size: 11px; color: var(--text-muted); }
.member-item-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.invitations-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.invitation-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #FFF3E0;
  font-size: 13px;
}
.invitation-item-email { flex: 1; color: var(--text); }
.invitation-item-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--orange-dark);
  background: white;
  padding: 2px 7px;
  border-radius: 10px;
}

/* Confirmation dialog */
.confirm-dialog {
  max-width: 400px !important;
}
.confirm-dialog .modal-body {
  text-align: center;
  padding: 28px 24px;
}
.confirm-dialog .confirm-icon { font-size: 44px; margin-bottom: 16px; }
.confirm-dialog .confirm-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.confirm-dialog .confirm-text { font-size: 14px; color: var(--text-muted); }

/* ================================================================
   PÁGINA DE INVITACIÓN
   ================================================================ */
.invite-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #2C2C2C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.invite-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  text-align: center;
}
.invite-logo { margin: 0 auto 32px; height: 56px; }
.invite-icon { font-size: 56px; margin-bottom: 16px; }
.invite-calendar-name {
  background: var(--orange-light);
  border-left: 4px solid var(--orange);
  border-radius: 4px;
  padding: 16px 20px;
  margin: 20px 0;
  text-align: left;
}
.invite-calendar-name h3 { font-size: 18px; font-weight: 700; color: var(--text); }
.invite-calendar-name p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ================================================================
   LOADING SPINNER
   ================================================================ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner.dark {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--orange);
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}

/* ================================================================
   RESPONSIVE — TABLET & MOBILE
   ================================================================ */
@media (max-width: 1024px) {
  .header-search { display: none; }
  .header-user-info { display: none; }
  :root { --sidebar-w: 260px; }
}

@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .app-sidebar {
    transform: translateX(-100%);
    z-index: 300;
    box-shadow: var(--shadow-lg);
  }
  .app-sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 299;
    display: none;
  }
  .sidebar-overlay.active { display: block; }

  .app-main { margin-left: 0; }

  .calendar-container { padding: 12px; }

  .fc .fc-toolbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .fc .fc-toolbar-title { font-size: 16px !important; }
  .fc .fc-button { padding: 6px 10px !important; font-size: 12px !important; }

  .login-card { padding: 32px 24px; }

  .admin-content { padding: 16px; margin-top: var(--header-h); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-nav-tabs { display: none; }

  .modal { max-width: 100%; margin: 0; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-backdrop { align-items: flex-end; padding: 0; }

  .header-today-btn { display: none; }
}

@media (max-width: 480px) {
  :root { --header-h: 56px; }
  .header-logo img { height: 34px; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
  .admin-header { padding: 0 16px; }
}

/* ================================================================
   UTILIDADES
   ================================================================ */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-orange { color: var(--orange); }
.text-success { color: var(--success); }
.text-danger { color: var(--error); }
.fw-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.gap-2 { gap: 8px; }
.w-100 { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
