/* ==========================================================================
   CRM PANEL - Débora Masie & Asoc. Inmobiliaria
   Estilos del panel de administración. MODO OSCURO.
   Depende de: design-system.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. OVERRIDES MODO OSCURO - Variables del CRM
   -------------------------------------------------------------------------- */

.crm-layout {
  /* Sobrescribir colores para modo claro/crema (estilo web pública) */
  --bg-primary:     #ede6d8;
  --bg-secondary:   #f5f0e8;
  --bg-tertiary:    #ffffff;
  --bg-elevated:    #ffffff;
  --bg-surface:     #ffffff;
  --bg-hover:       #e8dcc8;
  --bg-active:      #d9cab0;

  /* Bordes en claro con tono dorado */
  --border-subtle:  rgba(184, 146, 58, 0.2);
  --border-default: rgba(184, 146, 58, 0.3);
  --border-strong:  rgba(184, 146, 58, 0.5);

  /* Texto oscuro */
  --text-primary:   #1a1610;
  --text-secondary: #2c2218;
  --text-tertiary:  #3d2f1e;
  --text-muted:     #7a6a58;

  /* Inputs en claro */
  --input-bg:       #ffffff;
  --input-border:   rgba(184, 146, 58, 0.2);
  --input-hover:    rgba(184, 146, 58, 0.4);
  --input-focus:    #b8923a;
  
  /* Fuentes */
  --font-body: 'Jost', sans-serif;
  --font-heading: 'Cormorant Garamond', serif;
}

/* --------------------------------------------------------------------------
   2. LAYOUT PRINCIPAL - Grid con sidebar + main
   -------------------------------------------------------------------------- */

.crm-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "sidebar navbar"
    "sidebar main";
  min-height: 100vh;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: grid-template-columns var(--transition-normal);
}

/* Layout con sidebar colapsada */
.crm-layout.sidebar-collapsed {
  grid-template-columns: 72px 1fr;
}

.crm-main {
  grid-area: main;
  padding: var(--space-6);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 64px);
}

/* --------------------------------------------------------------------------
   3. SIDEBAR - Navegación lateral fija
   -------------------------------------------------------------------------- */

.crm-sidebar {
  grid-area: sidebar;
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  transition: width var(--transition-normal);
  z-index: var(--z-sticky);
}

/* --- Logo / Marca --- */
.sidebar-logo {
  padding: var(--space-5) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 64px;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  object-fit: contain;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}

.sidebar-logo-text .brand-name {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--color-primary-400);
  line-height: var(--leading-tight);
}

.sidebar-logo-text .brand-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Ocultar texto en sidebar colapsada */
.sidebar-collapsed .sidebar-logo-text,
.sidebar-collapsed .sidebar-item-text,
.sidebar-collapsed .sidebar-section-title,
.sidebar-collapsed .sidebar-footer-info {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* --- Navegación --- */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-3) var(--space-3);
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

/* Título de sección */
.sidebar-section-title {
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: var(--color-primary-400);
  font-family: 'Jost', sans-serif;
  padding: var(--space-4) 0 var(--space-2) 0;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-fast);
}

/* --- Item de navegación --- */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  color: var(--text-primary);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 300;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, padding-left 0.3s, background 0.2s;
  white-space: nowrap;
  border-bottom: 1px solid rgba(184,146,58,0.15);
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sidebar-item:hover {
  color: var(--color-primary-400);
  padding-left: 10px;
}

/* Estado activo */
.sidebar-item.active {
  color: var(--color-primary-400);
  font-weight: 500;
  padding-left: 10px;
}

.sidebar-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.sidebar-item:hover .sidebar-item-icon,
.sidebar-item.active .sidebar-item-icon {
  opacity: 1;
}

.sidebar-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--transition-fast);
}

/* Badge de conteo en item */
.sidebar-item-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: var(--font-bold);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.15);
  color: var(--color-primary-400);
  line-height: 1.4;
}

.sidebar-collapsed .sidebar-item-badge {
  display: none;
}

/* --- Divisor --- */
.sidebar-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: var(--space-2) var(--space-3);
}

/* --- Footer del sidebar: info del usuario --- */
.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-4) var(--space-4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.sidebar-footer:hover {
  background-color: var(--bg-hover);
}

.sidebar-footer-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary-400), var(--color-primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: #1a1a1a;
  flex-shrink: 0;
}

.sidebar-footer-info {
  overflow: hidden;
  transition: opacity var(--transition-fast);
}

.sidebar-footer-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* --- Botón de colapsar sidebar --- */
.sidebar-toggle {
  position: absolute;
  top: 72px;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
  color: var(--text-tertiary);
}

.sidebar-toggle:hover {
  background: var(--color-primary-400);
  color: #1a1a1a;
  border-color: var(--color-primary-400);
  box-shadow: var(--shadow-glow-sm);
}

/* --------------------------------------------------------------------------
   4. NAVBAR SUPERIOR
   -------------------------------------------------------------------------- */

.crm-navbar {
  grid-area: navbar;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  gap: var(--space-4);
}

/* Lado izquierdo: título de página o breadcrumbs */
.navbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  min-width: 0;
}

.navbar-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  white-space: nowrap;
}

/* --- Buscador global --- */
.navbar-search {
  position: relative;
  max-width: 400px;
  width: 100%;
}

.navbar-search-input {
  width: 100%;
  padding: var(--space-2) var(--space-4) var(--space-2) 40px;
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-full);
  outline: none;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

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

.navbar-search-input:focus {
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
  background: var(--bg-elevated);
}

.navbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Atajo de teclado en buscador */
.navbar-search-shortcut {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  pointer-events: none;
}

/* Lado derecho: acciones */
.navbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* --- Botones de la navbar (Toggle, Notificaciones) --- */
.navbar-icon-btn,
.navbar-notification {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
}

.navbar-icon-btn:hover,
.navbar-notification:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Badge de notificaciones no leídas */
.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: var(--font-bold);
  line-height: 16px;
  text-align: center;
  color: white;
  background: var(--color-error);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
  animation: pulse 2s infinite;
}

/* --- Dropdown de usuario --- */
.navbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.navbar-user:hover {
  background: var(--bg-hover);
}

.navbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary-400), var(--color-primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: #1a1a1a;
}

.navbar-user-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   5. BREADCRUMBS
   -------------------------------------------------------------------------- */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
  color: var(--color-primary-400);
}

.breadcrumbs-separator {
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 12px;
}

.breadcrumbs-current {
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

/* --------------------------------------------------------------------------
   6. DASHBOARD - Grilla y tarjetas de estadísticas
   -------------------------------------------------------------------------- */

/* Encabezado del dashboard */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.dashboard-header h1 {
  font-size: var(--text-2xl);
  color: var(--text-primary);
}

/* Grilla del dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

/* --- Tarjeta de estadística --- */
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary-400), var(--color-primary-600));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
}

/* Variantes de color para íconos */
.stat-card-icon.gold {
  background: rgba(212, 175, 55, 0.12);
  color: var(--color-primary-400);
}

.stat-card-icon.blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-info);
}

.stat-card-icon.green {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-success);
}

.stat-card-icon.red {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-error);
}

.stat-card-value {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-card-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Indicador de tendencia */
.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: var(--space-2);
}

.stat-card-trend.up {
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
}

.stat-card-trend.down {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
}

/* Contenedor de gráficos */
.chart-container {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  min-height: 300px;
}

.chart-container-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.chart-container-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   7. TABLAS DE DATOS - Con ordenamiento y acciones
   -------------------------------------------------------------------------- */

.data-table-wrapper {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Encabezado de tabla con buscador y filtros */
.data-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.data-table-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.data-table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Contenedor con scroll horizontal */
.data-table-scroll {
  overflow-x: auto;
}

/* Tabla de datos */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--bg-surface);
}

.data-table th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
  position: relative;
}

.data-table th:hover {
  color: var(--text-secondary);
}

/* Indicador de ordenamiento */
.data-table th.sortable::after {
  content: '↕';
  margin-left: var(--space-2);
  opacity: 0.3;
  font-size: 11px;
}

.data-table th.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--color-primary-400);
}

.data-table th.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--color-primary-400);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

/* Filas alternas */
.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

/* Hover en filas */
.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(212, 175, 55, 0.04);
}

/* Selección de fila */
.data-table tbody tr.selected {
  background: rgba(212, 175, 55, 0.08);
}

/* Última fila sin borde */
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* --- Acciones de fila --- */
.row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.data-table tbody tr:hover .row-actions {
  opacity: 1;
}

.row-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.row-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.row-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-error);
}

/* Footer de tabla: paginación */
.data-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Paginación */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.pagination-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.pagination-btn:hover {
  border-color: var(--color-primary-400);
  color: var(--color-primary-400);
}

.pagination-btn.active {
  background: var(--color-primary-400);
  color: #1a1a1a;
  border-color: var(--color-primary-400);
  font-weight: var(--font-bold);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   8. FORMULARIOS CRM - Grid de formulario
   -------------------------------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

/* Inputs en modo oscuro */
.crm-layout .form-input,
.crm-layout input[type="text"],
.crm-layout input[type="email"],
.crm-layout input[type="password"],
.crm-layout input[type="number"],
.crm-layout input[type="tel"],
.crm-layout input[type="url"],
.crm-layout input[type="search"],
.crm-layout input[type="date"],
.crm-layout input[type="datetime-local"],
.crm-layout textarea,
.crm-layout select {
  color: var(--text-primary);
  background: var(--input-bg);
  border-color: var(--input-border);
}

.crm-layout .form-input:hover,
.crm-layout input:hover,
.crm-layout textarea:hover,
.crm-layout select:hover {
  border-color: var(--input-hover);
}

.crm-layout .form-input:focus,
.crm-layout input:focus,
.crm-layout textarea:focus,
.crm-layout select:focus {
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
  background: var(--bg-elevated);
}

.crm-layout .form-input::placeholder,
.crm-layout input::placeholder,
.crm-layout textarea::placeholder {
  color: var(--text-muted);
}

.crm-layout label,
.crm-layout .form-label {
  color: var(--text-secondary);
}

/* Select oscuro */
.crm-layout select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
}

/* Checkbox oscuro */
.crm-layout .checkbox-wrapper input[type="checkbox"] {
  background-color: var(--input-bg);
  border-color: var(--input-border);
}

/* Acciones del formulario */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-6);
}

/* --------------------------------------------------------------------------
   9. MODALES - Glassmorphism premium
   -------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(212, 175, 55, 0.05);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Variantes de tamaño */
.modal-content.modal-sm {
  max-width: 420px;
}

.modal-content.modal-lg {
  max-width: 780px;
}

.modal-content.modal-xl {
  max-width: 1000px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-header h2,
.modal-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* Modal de confirmación (centrado) */
.modal-confirm-body {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.modal-confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
  font-size: var(--text-2xl);
}

.modal-confirm-icon.danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-error);
}

.modal-confirm-icon.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-warning);
}

/* --------------------------------------------------------------------------
   10. TOASTS / NOTIFICACIONES FLOTANTES
   -------------------------------------------------------------------------- */

.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
  max-width: 420px;
  width: 100%;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: slideInRight var(--transition-normal) forwards;
  position: relative;
  overflow: hidden;
}

/* Barra lateral de color */
.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast-success::before { background: var(--color-success); }
.toast-error::before   { background: var(--color-error); }
.toast-warning::before { background: var(--color-warning); }
.toast-info::before    { background: var(--color-info); }

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon   { color: var(--color-error); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info .toast-icon    { color: var(--color-info); }

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
}

.toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Barra de progreso de auto-cierre */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--color-primary-400);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  animation: toastProgress 5s linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* Animación de salida */
.toast.removing {
  animation: slideOutRight 300ms ease-in forwards;
}

@keyframes slideOutRight {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* --------------------------------------------------------------------------
   11. DROPZONE - Área de carga de archivos
   -------------------------------------------------------------------------- */

.dropzone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: transparent;
  position: relative;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--color-primary-400);
  background: rgba(212, 175, 55, 0.04);
  box-shadow: inset 0 0 30px rgba(212, 175, 55, 0.03);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
  color: var(--color-primary-400);
}

.dropzone-text {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.dropzone-text strong {
  color: var(--color-primary-400);
}

.dropzone-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* Input file oculto */
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Archivos subidos dentro del dropzone */
.dropzone-files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
  justify-content: center;
}

.dropzone-file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.dropzone-file-remove {
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.dropzone-file-remove:hover {
  color: var(--color-error);
}

/* --------------------------------------------------------------------------
   12. VISTA DE DETALLE - Propiedad / Cliente / etc.
   -------------------------------------------------------------------------- */

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.detail-header h1 {
  font-size: var(--text-2xl);
  color: var(--text-primary);
}

.detail-header-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

.detail-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-6);
}

.detail-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}

.detail-section-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.detail-label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.detail-value {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

/* --------------------------------------------------------------------------
   13. TABS - Pestañas con transición suave
   -------------------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}

.tab-item {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
  user-select: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab-item:hover {
  color: var(--text-secondary);
}

.tab-item.active {
  color: var(--color-primary-400);
  border-bottom-color: var(--color-primary-400);
  font-weight: var(--font-semibold);
}

.tab-content {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
}

.tab-content.active {
  display: block;
}

/* --------------------------------------------------------------------------
   14. ESTADOS VACÍOS
   -------------------------------------------------------------------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-6);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  color: var(--text-muted);
  font-size: var(--text-3xl);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 400px;
  margin-bottom: var(--space-6);
  line-height: var(--leading-relaxed);
}

/* --------------------------------------------------------------------------
   15. LOADING - Spinners y skeletons
   -------------------------------------------------------------------------- */

/* Spinner circular */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--color-primary-400);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

/* Contenedor de loading centrado */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  gap: var(--space-4);
}

.loading-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  animation: pulse 1.5s infinite;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    var(--bg-hover) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: var(--space-2);
}

.skeleton-text:last-child {
  width: 70%;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: var(--space-4);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-lg);
}

.skeleton-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

/* --------------------------------------------------------------------------
   16. GALERÍA DE FOTOS
   -------------------------------------------------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  group: gallery;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Overlay al hacer hover */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--space-3);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-actions {
  display: flex;
  gap: var(--space-2);
}

.gallery-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gallery-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gallery-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.6);
}

/* Badge de foto principal */
.gallery-item-main {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: var(--font-bold);
  color: #1a1a1a;
  background: var(--color-primary-400);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   17. RESPONSIVE - Adaptación del CRM
   -------------------------------------------------------------------------- */

/* Tablet: sidebar semi-colapsada */
@media (max-width: 1024px) {
  .crm-layout {
    grid-template-columns: 72px 1fr;
  }

  /* Ocultar texto del sidebar */
  .sidebar-logo-text,
  .sidebar-item-text,
  .sidebar-section-title,
  .sidebar-footer-info,
  .sidebar-item-badge {
    display: none;
  }

  .sidebar-item {
    justify-content: center;
    padding: var(--space-3);
    border-left: none;
  }

  .sidebar-item.active {
    border-left: none;
    background: rgba(212, 175, 55, 0.15);
  }

  /* Dashboard grid: 2 columnas */
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Detail body: 1 columna */
  .detail-body {
    grid-template-columns: 1fr;
  }

  /* Navbar: ocultar buscador */
  .navbar-search {
    display: none;
  }
}

/* Móvil: sidebar como barra inferior */
@media (max-width: 767px) {
  .crm-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "navbar"
      "main"
      "sidebar";
  }

  /* Sidebar como barra inferior de navegación */
  .crm-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    width: 100%;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border-subtle);
    z-index: var(--z-fixed);
  }

  .sidebar-logo,
  .sidebar-section-title,
  .sidebar-divider,
  .sidebar-footer,
  .sidebar-toggle,
  .sidebar-item-text,
  .sidebar-item-badge {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    padding: 0 var(--space-2);
    overflow: visible;
  }

  .sidebar-item {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
    gap: 2px;
    border-left: none;
    font-size: 10px;
    border-radius: var(--radius-md);
    min-width: 48px;
  }

  .sidebar-item.active {
    border-left: none;
    background: rgba(212, 175, 55, 0.1);
  }

  .sidebar-item-icon {
    width: 24px;
    height: 24px;
  }

  /* Main con padding inferior para la barra */
  .crm-main {
    max-height: calc(100vh - 64px - 64px);
    padding: var(--space-4);
    padding-bottom: var(--space-20);
  }

  /* Dashboard: 1 columna */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  /* Form grid: 1 columna */
  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Detail grid: 1 columna */
  .detail-grid {
    grid-template-columns: 1fr;
  }

  /* Toast container */
  .toast-container {
    top: auto;
    bottom: calc(64px + var(--space-4));
    left: var(--space-4);
    right: var(--space-4);
    max-width: none;
  }

  /* Modal */
  .modal-content {
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: auto;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  /* Navbar user name oculto */
  .navbar-user-name {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   18. PRINT - Ocultar elementos de navegación
   -------------------------------------------------------------------------- */

@media print {
  .crm-sidebar,
  .crm-navbar,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }

  .crm-layout {
    display: block;
    background: white;
    color: black;
  }

  .crm-main {
    max-height: none;
    padding: 0;
    overflow: visible;
  }

  .stat-card,
  .detail-section,
  .data-table-wrapper,
  .chart-container {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
    background: white;
  }

  .data-table th,
  .data-table td {
    color: black;
    border-color: #ddd;
  }
}

/* --------------------------------------------------------------------------
   19. DROPDOWN MENÚ
   -------------------------------------------------------------------------- */

.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

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

.dropdown-item.danger {
  color: var(--color-error);
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.08);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
}

/* --------------------------------------------------------------------------
   20. CARD CRM (override para modo oscuro)
   -------------------------------------------------------------------------- */

.crm-layout .card {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.crm-layout .card-header {
  border-bottom-color: var(--border-subtle);
}

.crm-layout .card-header h3,
.crm-layout .card-header h4 {
  color: var(--text-primary);
}

.crm-layout .card-footer {
  border-top-color: var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.crm-layout .card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* --- Badges en oscuro --- */
.crm-layout .badge-success {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
}

.crm-layout .badge-warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
}

.crm-layout .badge-danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

.crm-layout .badge-info {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
}

.crm-layout .badge-neutral {
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.06);
}

/* --- Alertas en oscuro --- */
.crm-layout .alert-success {
  color: #86efac;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

.crm-layout .alert-warning {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.crm-layout .alert-danger {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.crm-layout .alert-info {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
}

/* --- Separador en oscuro --- */
.crm-layout hr,
.crm-layout .divider {
  background: var(--border-subtle);
}

/* --- Code en oscuro --- */
.crm-layout code {
  background: var(--bg-surface);
  color: var(--color-primary-300);
}

/* --------------------------------------------------------------------------
   21. FILTROS RÁPIDOS - Barra de filtros
   -------------------------------------------------------------------------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.filter-chip.active {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--color-primary-400);
  color: var(--color-primary-400);
}

.filter-chip-remove {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.filter-chip-remove:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Estilos para el dropdown de Notificaciones */
.notification-wrapper {
    position: relative;
}
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: none;
    flex-direction: column;
    z-index: 1000;
    margin-top: 10px;
}
.notification-dropdown.show {
    display: flex;
}
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.notif-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #1a1a1a;
}
.notif-header a {
    font-size: 0.8rem;
    color: #144d29;
    text-decoration: none;
}
.notif-header a:hover {
    text-decoration: underline;
}
.notif-body {
    max-height: 350px;
    overflow-y: auto;
}
.notif-item {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    gap: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.notif-item:hover {
    background: #f9fafb;
}
.notif-item--unread {
    background: #f0fdf4;
}
.notif-item__icon {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}
.notif-item__content {
    flex-grow: 1;
}
.notif-item__title {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
}
.notif-item__message {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.4;
}
.notif-item__time {
    font-size: 0.75rem;
    color: #9ca3af;
}
.notif-empty {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
