/* ==========================================================================
   OMELETTE - MINIMALIST WHITE & GRAY DESIGN SYSTEM (INSPIRED BY ROLES.PNG)
   ========================================================================== */

:root {
  /* Color Palette - Minimalist White, Grays & Slate Accent */
  --bg-app: #f4f6f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-sidebar: #ffffff;
  
  --border-light: #edf2f7;
  --border-focus: #90A1B9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #90A1B9;
  --primary-hover: #414549;
  --primary-light: #070707;
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-text: #059669;
  
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #dc2626;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-text: #d97706;
  
  --gray-badge-bg: #f1f5f9;
  --gray-badge-text: #64748b;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-float: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  
  --sidebar-width: 260px;
  --header-height: 70px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

/* APP SHELL LAYOUT */
.app-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.2s ease;
}

.sidebar-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #475569, #1e293b);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-info h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 1rem;
  overflow-y: auto;
}

.nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  margin-bottom: 0.25rem;
}

.nav-item:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: #f1f5f9;
  color: var(--text-primary);
  font-weight: 600;
  border-left: 3px solid var(--primary-hover);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-light);
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background-color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.avatar.sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-meta-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-logout-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-xs);
  transition: color 0.15s;
}

.btn-logout-icon:hover {
  color: var(--danger-text);
}

/* MAIN CONTENT AREA */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* TOP HEADER */
.top-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-mobile-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-mobile-sidebar-toggle:hover {
  background-color: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-mobile-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0.35rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: auto;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.btn-mobile-sidebar-close:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 39;
  transition: opacity 0.2s ease;
}

.sidebar-backdrop.hidden {
  display: none !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* CONTENT CONTAINER */
.page-container {
  padding: 2rem;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
}

/* SECTION HEADER BANNER */
.section-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.section-banner-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-banner-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* CARDS */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ROLES OVERVIEW GRID (TOP 3 CARDS) */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.role-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.role-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
}

.role-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.role-card-see-all {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-subtle);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  transition: all 0.15s;
}

.role-card-see-all:hover {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.role-card-users {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.role-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.role-user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.role-user-text {
  min-width: 0;
}

.role-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-card-footer {
  margin-top: auto;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.btn-secondary {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  color: var(--text-primary);
}

.btn-manage {
  width: 100%;
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-manage:hover {
  background-color: #f1f5f9;
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* BADGES / PILLS - SISTEMA UNIFICADO */
.badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 96px;
  text-align: center;
  box-sizing: border-box;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

/* ESTADOS DE INCIDENTES */
.badge-status-abierto {
  background-color: #fef3c7;
  color: #b45309;
}

.badge-status-proceso,
.badge-status-en_proceso {
  background-color: #e0f2fe;
  color: #0369a1;
}

.badge-status-resuelto {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-status-cerrado {
  background-color: #f1f5f9;
  color: #475569;
}

/* PRIORIDADES DE INCIDENTES */
.badge-priority-critica {
  background-color: #fee2e2;
  color: #b91c1c;
}

.badge-priority-alta {
  background-color: #ffedd5;
  color: #c2410c;
}

.badge-priority-media {
  background-color: #f1f5f9;
  color: #334155;
}

.badge-priority-baja {
  background-color: #f8fafc;
  color: #64748b;
}

/* ESTADOS GENERALES */
.badge-enabled {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-disabled {
  background-color: #f1f5f9;
  color: #64748b;
}

.badge-blocked {
  background-color: #fee2e2;
  color: #b91c1c;
}

.badge-warning {
  background-color: #fef3c7;
  color: #b45309;
}

/* TABLE CARD & CONTROLS */
.table-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.table-search-box {
  display: flex;
  align-items: center;
  position: relative;
  width: 280px;
}

.table-search-input {
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2.2rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  outline: none;
  transition: all 0.15s;
}

.table-search-input:focus {
  background-color: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(144, 161, 185, 0.25);
}

.table-search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  width: 15px;
  height: 15px;
}

/* FILTER TABS */
.filter-tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.25rem;
}

.filter-tab {
  padding: 0.6rem 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--primary-hover);
}

.filter-count-badge {
  font-size: 0.72rem;
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
}

.filter-tab.active .filter-count-badge {
  background-color: #f1f5f9;
  color: var(--text-primary);
  font-weight: 700;
}

/* DATA TABLE */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.modern-table th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.modern-table td {
  padding: 0.9rem 1rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.modern-table tr:hover td {
  background-color: #fafbfc;
}

.cell-account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-name {
  font-weight: 600;
  color: var(--text-primary);
}

.account-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* INLINE SELECTS */
.inline-select {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  background-color: #ffffff;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.inline-select:focus {
  border-color: var(--border-focus);
}

/* ALERTS */
.alert {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success { background: var(--success-bg); color: var(--success-text); border-left: 4px solid var(--success-text); }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border-left: 4px solid var(--danger-text); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-left: 4px solid var(--warning-text); }
.alert-info { background: #f1f5f9; color: var(--text-primary); border-left: 4px solid var(--primary); }

/* AUTH SCREENS (LOGIN / REGISTER) */
.auth-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-app);
  padding: 1.5rem;
}

.auth-box {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: 2.25rem;
}

.auth-logo-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.75rem;
  text-align: center;
}

.auth-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #475569, #1e293b);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.auth-logo-center h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.auth-logo-center p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s;
}

.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(144, 161, 185, 0.25);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* HTMX INDICATOR */
.htmx-indicator {
  display: none;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
    z-index: 50;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .btn-mobile-sidebar-toggle {
    display: inline-flex;
  }
  .btn-mobile-sidebar-close {
    display: inline-flex;
  }
  .top-header {
    padding: 0 1rem;
  }
  .page-container {
    padding: 1.25rem 1rem;
  }
  .main-wrapper {
    margin-left: 0;
  }
  .roles-grid {
    grid-template-columns: 1fr;
  }

  /* PESTAÑAS DE FILTRO VERTICALES EN MÓVIL */
  .filter-tabs {
    flex-direction: column;
    gap: 0.35rem;
    border-bottom: none;
    background-color: var(--bg-subtle);
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 1.25rem;
  }

  .filter-tab {
    padding: 0.6rem 0.85rem;
    border-bottom: none;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background-color: transparent;
    transition: all 0.15s ease;
  }

  .filter-tab:hover {
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
  }

  .filter-tab.active {
    background-color: #ffffff;
    color: var(--text-primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-left: 3px solid var(--primary-hover);
  }
}

/* CHAT DE GESTIÓN DE INCIDENTES */
.chat-messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chat-message-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.chat-message-own {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background-color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.chat-message-own .chat-avatar {
  background-color: var(--primary);
  color: #ffffff;
}

.chat-bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  min-width: 0;
}

.chat-message-own .chat-bubble-wrapper {
  align-items: flex-end;
}

.chat-message-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
}

.chat-author-name {
  font-weight: 600;
  color: var(--text-primary);
}

.chat-author-role {
  font-size: 0.65rem;
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
}

.chat-timestamp {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.chat-bubble {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.45;
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  word-break: break-word;
}

.chat-message-own .chat-bubble {
  background-color: #f1f5f9;
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.chat-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   NOTIFICATIONS MODULE (CAMPANA, BADGE, DROPDOWN & REAL-TIME ALERTS)
   ========================================================================== */
.notification-system-root {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notification-bell-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notification-bell-btn {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  color: #64748b; /* Gris por defecto */
  position: relative;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-bell-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.notification-bell-btn.has-unread {
  color: #ef4444; /* Rojo cuando hay notificaciones */
}

.notification-bell-btn.has-unread .bell-icon {
  animation: bell-pulse 2s infinite ease-in-out;
}

@keyframes bell-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(4deg); }
}

.notification-badge-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  border-radius: 9999px;
  padding: 0 4px;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none !important;
}

.notification-dropdown-container {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  z-index: 1000;
  width: 400px;
  max-width: 90vw;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.notification-dropdown-container.hidden {
  display: none !important;
}

.notification-dropdown-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 520px;
}

.notification-dropdown-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background-color: var(--bg-subtle);
  flex-wrap: nowrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.dropdown-title {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-primary);
}

.unread-pill {
  font-size: 0.7rem;
  background-color: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-text-action {
  background: transparent;
  border: 1px solid var(--border-light);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary-hover);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background-color: #ffffff;
}

.btn-text-action:hover {
  background-color: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-text-action.danger {
  color: #ef4444;
  border-color: #fecaca;
  background-color: #fff5f5;
}

.btn-text-action.danger:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
}

.notification-permission-bar {
  padding: 0.6rem 1rem;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.notification-permission-bar .permission-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-perm-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-perm-inactive {
  background-color: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.btn-perm-inactive:hover {
  background-color: #e2e8f0;
  color: #1e293b;
}

.btn-perm-active {
  background-color: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.btn-perm-active:hover {
  background-color: #059669;
}

.notification-list-body {
  overflow-y: auto;
  max-height: 340px;
}

.notification-item {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.15s;
}

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

.notification-item:hover {
  background-color: #f8fafc;
}

.notification-item.is-unread {
  background-color: #fffdf5;
  border-left: 4px solid #f59e0b;
}

.notif-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.notif-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  flex: 1;
}

.notif-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.6rem;
  word-break: break-word;
}

.notif-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  gap: 0.5rem;
}

.notif-action-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.notif-action-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.btn-mark-read {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-xs);
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-mark-read:hover {
  background-color: #f1f5f9;
  color: var(--text-primary);
  border-color: #94a3b8;
}

.notification-empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.empty-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.empty-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}
