:root {
  --mf-primary: #7B4397;
  --mf-secondary: #1E9A8A;
  --mf-primary-soft: rgba(123, 67, 151, 0.08);
  --mf-secondary-soft: rgba(30, 154, 138, 0.08);
  --mf-text: #1f2937;
  --mf-text-soft: #6b7280;
  --mf-bg: #f7f8fa;
  --mf-surface: #ffffff;
  --mf-border: #e5e7eb;
  --mf-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --mf-radius: 14px;
}

html, body {
  background: var(--mf-bg);
  color: var(--mf-text);
}

body, button, input, select, textarea {
  font-family: 'Poppins', sans-serif;
}

a {
  transition: all 0.2s ease;
}

/* Base controls */
.btn,
.btn-primary,
.btn-secondary,
button.btn-primary,
button.btn-secondary {
  border-radius: 10px !important;
  border: 1px solid transparent;
  box-shadow: none;
  transition: all 0.2s ease;
}

.btn-primary,
button.btn-primary {
  background: linear-gradient(135deg, var(--mf-primary), var(--mf-secondary)) !important;
  color: #fff !important;
}

.btn-primary:hover,
button.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(64, 49, 110, 0.2);
}

.btn-secondary,
button.btn-secondary {
  background: #fff !important;
  color: #584a77 !important;
  border-color: #d8ddef !important;
}

input,
select,
textarea {
  border-radius: 10px !important;
  border: 1px solid #dfe3ef !important;
  background: #fff;
  color: #2f3550;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #95a0bd !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: var(--mf-primary) !important;
  box-shadow: 0 0 0 3px rgba(123, 67, 151, 0.1) !important;
}

/* ===== INDEX ===== */
.navbar {
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid var(--mf-border);
  box-shadow: 0 10px 24px rgba(31, 28, 53, 0.08) !important;
}

.nav-logo span,
.nav-link,
.footer h4 {
  color: #2f3550 !important;
}

.nav-btn {
  border-radius: 999px !important;
  background: linear-gradient(135deg, var(--mf-primary), var(--mf-secondary)) !important;
  color: #fff !important;
}

.hero {
  position: relative;
  min-height: 100vh;
}

.hero::before {
  background: url('IMG_8801.jpeg') center center / cover no-repeat !important;
  opacity: 0.44 !important;
  transform: scale(1.02);
}

.hero-overlay {
  background: linear-gradient(118deg, rgba(69, 39, 103, 0.62), rgba(17, 120, 113, 0.50)) !important;
}

.hero-content {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 28px 26px !important;
  max-width: 900px;
  box-shadow: 0 20px 50px rgba(22, 17, 44, 0.25);
}

.hero-title {
  letter-spacing: -0.02em;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.30);
}

.gradient-text {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #ffffff !important;
  background-clip: initial !important;
  color: #ffffff !important;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.22);
}

.section-header h2 {
  color: #2f3550 !important;
  letter-spacing: -0.02em;
  font-weight: 800 !important;
}

.section-header p {
  color: #6e7690 !important;
}

.section-line {
  background: linear-gradient(135deg, var(--mf-primary), var(--mf-secondary)) !important;
  height: 4px !important;
  border-radius: 999px;
}

.footer {
  background: linear-gradient(135deg, #202433 0%, #2c3044 65%, #1e9a8a 180%) !important;
}

/* ===== DASHBOARD REDISEÑO LIMPIO FINAL ===== */
.dashboard {
  background: #f5f6fa !important;
}

.main-content {
  background: transparent !important;
  padding: 20px !important;
}

/* Sidebar */
.sidebar {
  background: #ffffff !important;
  border-right: 1px solid #ececf3 !important;
  box-shadow: 0 8px 24px rgba(35, 34, 66, 0.05) !important;
}

.sidebar-header {
  border-bottom: 1px solid #f1f2f7 !important;
  padding-bottom: 16px !important;
}

.sidebar-header h2 {
  color: #2f3550 !important;
  font-weight: 700 !important;
}

.sidebar-header p {
  color: #7e86a2 !important;
  font-weight: 500 !important;
}

.sidebar-toggle-btn {
  background: #fff !important;
  color: #5d6482 !important;
  border: 1px solid #e4e8f2 !important;
  border-radius: 12px !important;
}

.nav-menu li a {
  color: #3d4463 !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  margin: 4px 10px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.nav-menu li a i {
  color: #6f7693 !important;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  background: linear-gradient(135deg, var(--mf-primary-soft), var(--mf-secondary-soft)) !important;
  border-color: rgba(123,67,151,0.16) !important;
  color: #2f3550 !important;
}

.nav-menu li a:hover i,
.nav-menu li a.active i {
  color: var(--mf-primary) !important;
}

/* Top bars */
.top-bar,
.top-bar-bottom {
  background: #ffffff !important;
  border: 1px solid #ececf3 !important;
  border-radius: 14px !important;
  box-shadow: 0 6px 20px rgba(35, 34, 66, 0.05) !important;
}

.top-bar h1,
.top-bar-bottom h1,
#sectionTitle,
#sectionTitleBottom {
  color: #2f3550 !important;
  font-weight: 700 !important;
}

.user-info {
  background: #f8f9fd !important;
  border: 1px solid #e7e9f3 !important;
  border-radius: 999px !important;
  color: #4c5470 !important;
}

/* Sections/cards */
.section {
  background: transparent !important;
}

.section,
.section * {
  color: #2f3550;
}

.section p,
.section small {
  color: #4c5470 !important;
}

.modern-clock-container,
.welcome-section,
.cliente-welcome-section,
.stat-card,
.info-card,
.stat-card-alert,
.plan-info-card,
.plan-mf-info-card,
.contrato-card,
.mensajes-container,
.table-container {
  background: #ffffff !important;
  border: 1px solid #ececf3 !important;
  border-radius: 14px !important;
  box-shadow: 0 6px 20px rgba(35, 34, 66, 0.05) !important;
}

/* Clock elegant */
.clock-segment {
  background: #ffffff !important;
  border: 1px solid #e4e8f2 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(35, 34, 66, 0.05) !important;
  min-width: 92px;
}

.clock-number {
  color: #2f3550 !important;
  font-weight: 800 !important;
  text-shadow: none !important;
}

.clock-label {
  color: #1E9A8A !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
}

.clock-separator {
  color: #7B4397 !important;
  font-weight: 800 !important;
}

.clock-date,
#currentDate,
#currentDateCliente {
  background: #f4f1fa !important;
  border: 1px solid #e4deef !important;
  color: #505878 !important;
  border-radius: 10px !important;
  padding: 6px 12px !important;
}

/* Tables legibility */
.table-container table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-container thead th {
  background: #ede7f7 !important;
  color: #3d4463 !important; /* mismo tono base del menú */
  font-weight: 800 !important;
  border-bottom: 1px solid #ddd4ee !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.82rem !important;
}

/* Refuerzo específico para títulos en sección Clientes */
#clientes .table-container thead th,
#tablaClientes thead th,
#clientesTable thead th {
  color: #3d4463 !important;
}

.table-container tbody td {
  color: #414a69 !important;
  border-bottom: 1px solid #edf0f6 !important;
}

.table-container tbody tr:nth-child(even) {
  background: #fbfcff !important;
}

.table-container tbody tr:hover {
  background: rgba(123,67,151,0.04) !important;
}

/* Horarios / eventos del calendario: legibilidad alta */
.calendar-event,
.fc-event,
.event-item,
.evento-item,
[class*="event"] {
  color: #ffffff !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}

.calendar-event *,
.fc-event *,
.event-item *,
.evento-item *,
[class*="event"] * {
  color: inherit !important;
}

/* Ajuste fino para bloques claros (azules/celestes) */
.calendar-event[style*="rgb(66, 133, 244)"],
.calendar-event[style*="#4285f4"],
.fc-event[style*="rgb(66, 133, 244)"],
.fc-event[style*="#4285f4"] {
  color: #0f1b3d !important;
  text-shadow: none !important;
}

/* Unified modals dashboard+login */
.modal,
.plan-mf-modal,
.modal-login {
  backdrop-filter: blur(7px);
  background: rgba(18, 21, 35, 0.5) !important;
}

.modal .modal-content,
.plan-mf-modal .plan-mf-modal-content,
.modal-login .modal-login-content,
.login-modal-box {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%) !important;
  border: 1px solid #e7e9f3 !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 60px rgba(23, 28, 47, 0.18) !important;
}

.modal .modal-content h2,
.modal .modal-content h3,
.plan-mf-modal .plan-mf-modal-content h2,
.plan-mf-modal .plan-mf-modal-content h3,
.login-form-modal h2 {
  color: #2f3550 !important;
  font-weight: 700 !important;
}

.modal .close,
.plan-mf-close,
.close-login {
  color: #6f7896 !important;
  background: #f4f5fa !important;
  border: 1px solid #e1e5f1 !important;
  border-radius: 999px !important;
}

.modal .close:hover,
.plan-mf-close:hover,
.close-login:hover {
  color: #2f3550 !important;
  background: #eceff7 !important;
}

.modal .form-group label,
.plan-mf-modal .plan-mf-form-group label,
.form-group-modal label {
  color: #4a5372 !important;
  font-weight: 600 !important;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea,
.plan-mf-modal .plan-mf-form-group input,
.plan-mf-modal .plan-mf-form-group select,
.plan-mf-modal .plan-mf-form-group textarea,
.input-group-modal input,
.input-group-modal select {
  color: #2f3550 !important;
  border: 1px solid #dfe3ef !important;
  border-radius: 10px !important;
  background: #ffffff !important;
}

.login-options-modal a {
  color: #5d4f7f !important;
}

.login-options-modal a:hover {
  color: #1E9A8A !important;
}

/* Welcome legibility */
#welcomeMessage,
.cliente-welcome-section h2 {
  background: none !important;
  -webkit-text-fill-color: #2f3550 !important;
  color: #2f3550 !important;
  text-shadow: none !important;
}

@media (max-width: 768px) {
  .top-bar,
  .top-bar-bottom,
  .table-container,
  .modal .modal-content {
    border-radius: 12px !important;
  }

  .nav-menu li a {
    margin: 2px 8px !important;
  }

  .clock-segment {
    min-width: 84px;
    padding: 8px 10px !important;
  }

  .clock-number {
    font-size: 1.8rem !important;
  }
}
