/* ═══════════════════════════════════════════════════════
   HEADER — DARK MODE
   Usa tokens del Design System (tokens.css)
   ═══════════════════════════════════════════════════════ */

/* ══════ LOGO ══════ */
.logo {
  line-height: 1;
}

@media (min-width: 1200px) {
  .logo {
    width: 280px;
  }
}

.logo img {
  max-height: 26px;
  margin-right: var(--ev-space-2);
}

.logo span {
  font-size: 26px;
  font-weight: 700;
  color: var(--ev-text-primary);
  font-family: "Nunito", sans-serif;
  letter-spacing: -0.5px;
}

/* ══════ HEADER PRINCIPAL ══════ */
.header {
  transition: all var(--ev-duration-slow);
  z-index: 997;
  height: 60px;
  background-color: var(--ev-bg-surface);
  border-bottom: 1px solid var(--ev-border-subtle);
  padding-left: var(--ev-space-5);
}

.header .toggle-sidebar-btn {
  font-size: 32px;
  padding-left: var(--ev-space-3);
  cursor: pointer;
  color: var(--ev-text-primary);
  transition: color var(--ev-duration-fast);
}

.header .toggle-sidebar-btn:hover {
  color: var(--ev-brand-light);
}

/* ══════ SEARCH BAR ══════ */
.search-bar {
  min-width: 360px;
  padding: 0 var(--ev-space-5);
}

.search-bar {
  max-width: 500px;
  padding: var(--ev-space-3);
}

.search-bar-left {
  max-width: 500px;
  padding: var(--ev-space-3);
}

@media (max-width: 1199px) {
  .search-bar {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    padding: var(--ev-space-5);
    box-shadow: var(--ev-shadow-lg);
    background: var(--ev-bg-surface);
    border-bottom: 1px solid var(--ev-border-default);
    z-index: 9999;
    transition: var(--ev-duration-slow);
    visibility: hidden;
    opacity: 0;
  }

  .search-bar-show {
    top: 60px;
    visibility: visible;
    opacity: 1;
  }
}

.search-form {
  width: 100%;
}

.search-form input {
  border: 1px solid var(--ev-border-default);
  font-size: 14px;
  color: var(--ev-text-primary);
  background: var(--ev-bg-raised);
  padding: var(--ev-space-2) 38px var(--ev-space-2) var(--ev-space-2);
  border-radius: var(--ev-radius-md);
  transition: all var(--ev-duration-normal) var(--ev-ease-default);
  width: 100%;
}

.search-form input::placeholder {
  color: var(--ev-text-muted);
}

.search-form input:focus,
.search-form input:hover {
  outline: none;
  box-shadow: 0 0 0 3px var(--ev-brand-glow);
  border: 1px solid var(--ev-brand-primary);
  background: var(--ev-bg-surface);
}

.search-form button {
  border: 0;
  padding: 0;
  margin-left: -30px;
  background: none;
  cursor: pointer;
  transition: transform var(--ev-duration-fast);
}

.search-form button:hover {
  transform: scale(1.1);
}

.search-form button i {
  color: var(--ev-text-muted);
  transition: color var(--ev-duration-fast);
}

.search-form button:hover i {
  color: var(--ev-brand-light);
}

/* ══════ HEADER NAV ══════ */
.header-nav ul {
  list-style: none;
}

.header-nav > ul {
  margin: 0;
  padding: 0;
}

.header-nav .nav-icon {
  font-size: 22px;
  color: var(--ev-text-secondary);
  margin-right: var(--ev-space-6);
  position: relative;
  transition: color var(--ev-duration-fast);
}

.header-nav .nav-icon:hover {
  color: var(--ev-text-primary);
}

.header-nav .nav-profile {
  color: var(--ev-text-primary);
  transition: all var(--ev-duration-fast);
}

.header-nav .nav-profile:hover {
  color: var(--ev-brand-light);
}

.header-nav .nav-profile img {
  max-height: 36px;
  border-radius: var(--ev-radius-full);
  border: 2px solid var(--ev-border-subtle);
}

.header-nav .nav-profile span {
  font-size: 14px;
  font-weight: 600;
}

/* ══════ BADGES DE NOTIFICACIÓN ══════ */
.header-nav .badge-number {
  position: absolute;
  inset: -2px -5px auto auto;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 6px;
  background: var(--ev-danger);
  color: var(--ev-text-primary);
  border-radius: var(--ev-radius-full);
  font-family: var(--ev-font-mono);
  box-shadow: var(--ev-shadow-glow-danger);
}

/* ══════ DROPDOWNS ══════ */
.header-nav .notifications {
  inset: 8px -15px auto auto !important;
}

.header-nav .notifications .notification-item {
  display: flex;
  align-items: center;
  padding: var(--ev-space-4) var(--ev-space-3);
  transition: all var(--ev-duration-fast);
  border-bottom: 1px solid var(--ev-border-subtle);
}

.header-nav .notifications .notification-item:last-child {
  border-bottom: none;
}

.header-nav .notifications .notification-item i {
  margin: 0 var(--ev-space-5) 0 var(--ev-space-3);
  font-size: 24px;
  color: var(--ev-brand-light);
}

.header-nav .notifications .notification-item h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: var(--ev-space-1);
  color: var(--ev-text-primary);
}

.header-nav .notifications .notification-item p {
  font-size: 13px;
  margin-bottom: 3px;
  color: var(--ev-text-secondary);
}

.header-nav .notifications .notification-item:hover {
  background-color: var(--ev-bg-hover);
}

/* Messages Dropdown */
.header-nav .messages {
  inset: 8px -15px auto auto !important;
}

.header-nav .messages .message-item {
  padding: var(--ev-space-4) var(--ev-space-3);
  transition: all var(--ev-duration-fast);
  border-bottom: 1px solid var(--ev-border-subtle);
}

.header-nav .messages .message-item:last-child {
  border-bottom: none;
}

.header-nav .messages .message-item a {
  display: flex;
}

.header-nav .messages .message-item img {
  margin: 0 var(--ev-space-5) 0 var(--ev-space-3);
  max-height: 40px;
  border-radius: var(--ev-radius-full);
  border: 2px solid var(--ev-border-subtle);
}

.header-nav .messages .message-item h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: var(--ev-space-1);
  color: var(--ev-text-primary);
}

.header-nav .messages .message-item p {
  font-size: 13px;
  margin-bottom: 3px;
  color: var(--ev-text-secondary);
}

.header-nav .messages .message-item:hover {
  background-color: var(--ev-bg-hover);
}

/* Profile Dropdown */
.header-nav .profile {
  min-width: 240px;
  padding-bottom: 0;
  top: 8px !important;
  background: var(--ev-bg-surface);
  border: 1px solid var(--ev-border-default);
  border-radius: var(--ev-radius-lg);
  box-shadow: var(--ev-shadow-lg);
}

.header-nav .profile .dropdown-header {
  padding: var(--ev-space-4);
  border-bottom: 1px solid var(--ev-border-subtle);
}

.header-nav .profile .dropdown-header h6 {
  font-size: 16px;
  margin-bottom: 0;
  font-weight: 600;
  color: var(--ev-text-primary);
}

.header-nav .profile .dropdown-header span {
  font-size: 13px;
  color: var(--ev-text-secondary);
}

.header-nav .profile .dropdown-item {
  font-size: 14px;
  padding: var(--ev-space-3) var(--ev-space-4);
  transition: all var(--ev-duration-fast);
  color: var(--ev-text-secondary);
  border-radius: var(--ev-radius-sm);
  margin: 2px var(--ev-space-2);
}

.header-nav .profile .dropdown-item i {
  margin-right: var(--ev-space-3);
  font-size: 18px;
  line-height: 0;
  color: var(--ev-text-muted);
  transition: color var(--ev-duration-fast);
}

.header-nav .profile .dropdown-item:hover {
  background-color: var(--ev-bg-hover);
  color: var(--ev-text-primary);
}

.header-nav .profile .dropdown-item:hover i {
  color: var(--ev-brand-light);
}

/* ══════ SIDEBAR TOGGLE BUTTON (MOBILE) ══════ */
.sidebar-toggle {
  background: transparent;
  border: 1px solid var(--ev-border-default);
  color: var(--ev-text-primary);
  padding: var(--ev-space-2);
  border-radius: var(--ev-radius-sm);
  cursor: pointer;
  transition: all var(--ev-duration-fast);
}

.sidebar-toggle:hover {
  background: var(--ev-bg-hover);
  border-color: var(--ev-brand-primary);
  color: var(--ev-brand-light);
}

.sidebar-toggle i {
  font-size: 20px;
}

/* ══════ SUBSCRIPTION WARNING (Alerta de suscripción vencida) ══════ */
.subscription-warning {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.2rem;
  border-radius: 0.75rem;
  background-color: rgba(255, 0, 0, 0.1);
  color: #c50000;
  font-weight: 700;
  border: 1px solid rgba(255, 0, 0, 0.3);
  box-shadow: 0 6px 12px -8px rgba(197, 0, 0, 0.45);
}

.subscription-warning i {
  font-size: 1.1rem;
}

.subscription-warning.d-none {
  display: none !important;
}

/* ══════ NOTIFICATION BADGES (TN y ML) ══════ */
.tn-notification-badge {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.tn-notification-badge .badge {
  position: absolute;
  top: -8px;
  right: -10px;
  padding: 0.25rem 0.4rem;
  font-size: 0.7rem;
  border-radius: 10px;
  background-color: var(--ev-danger);
  color: var(--ev-text-primary);
  font-weight: 600;
}

.tn-notification-badge:hover {
  opacity: 0.8;
}

.ml-notification-badge {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.ml-notification-badge .badge {
  position: absolute;
  top: -8px;
  right: -10px;
  padding: 0.25rem 0.4rem;
  font-size: 0.7rem;
  border-radius: 10px;
  background-color: var(--ev-danger);
  color: var(--ev-text-primary);
  font-weight: 600;
}

.ml-notification-badge:hover {
  opacity: 0.8;
}
