/* Variables de colores corporativos */
:root {
  --color-primary: #FFC423;      /* Amarillo corporativo */
  --color-secondary: #008752;    /* Verde corporativo */
  --color-accent: #7AC142;       /* Verde claro corporativo */
  --color-dark: #2C3E50;         /* Azul oscuro simplificado */
  --color-light: #F8F9FA;        /* Gris claro */
  --color-white: #FFFFFF;
  --color-gray: #6C757D;
  --color-gray-light: #F8F9FA;
  --color-gray-border: #DEE2E6;
  --color-gray-dark: #495057;
  
  /* Colores específicos por chat */
  --color-lideres: #FFC423;
  --color-relaciones-laborales: #008752;
  --color-colaboradores: #7AC142;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--color-light);
  color: var(--color-dark);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 2.5em;
  background-color: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--color-gray-border);
}

h1 {
  text-align: center;
  color: var(--color-dark);
  margin-bottom: 1.5em;
  font-size: 2.5em;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h3 {
  color: var(--color-dark);
  margin-bottom: 1em;
  border-bottom: 3px solid var(--color-primary);
  padding-bottom: 0.5em;
  font-weight: 600;
}

h4 {
  color: #003865;
  margin-bottom: 0.8em;
}

h5 {
  color: #003865;
  margin-bottom: 0.5em;
  font-size: 1em;
}

/* Login Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-dark);
  padding: 2em;
  font-family: 'Inter', sans-serif;
}

.login-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 3em;
  max-width: 500px;
  width: 100%;
  text-align: center;
  border: 1px solid var(--color-gray-border);
}

.company-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2em;
  gap: 1em;
}

.logo-symbol {
  background: var(--color-primary);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 196, 35, 0.2);
}

.logo-icon {
  font-size: 2.5em;
  color: white;
}

.logo-text-container {
  text-align: left;
}

.company-name {
  color: var(--color-dark);
  margin: 0;
  font-size: 1.8em;
  font-weight: 700;
  letter-spacing: 1px;
}

.company-tagline {
  color: var(--color-gray);
  margin: 0;
  font-size: 0.9em;
  font-weight: 400;
}

.app-branding {
  margin-bottom: 2.5em;
  padding-bottom: 2em;
  border-bottom: 2px solid var(--color-gray-border);
}

.app-name {
  color: var(--color-secondary);
  margin: 0 0 0.5em 0;
  font-size: 2.2em;
  font-weight: 600;
}

.app-subtitle {
  color: var(--color-gray);
  margin: 0;
  font-size: 1em;
  font-weight: 400;
}

.login-content {
  margin: 2em 0;
}

.login-description h3 {
  color: var(--color-dark);
  margin-bottom: 1em;
  font-size: 1.4em;
  font-weight: 600;
  border: none;
}

.login-description p {
  color: var(--color-gray);
  margin-bottom: 2.5em;
  line-height: 1.6;
  font-size: 1em;
}

.features {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  margin: 2.5em 0;
}

.feature {
  display: flex;
  align-items: center;
  gap: 1.5em;
  padding: 1.5em;
  background: var(--color-light);
  border-radius: 12px;
  border-left: 4px solid var(--color-primary);
  transition: all 0.3s ease;
}

.feature:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.feature-icon {
  font-size: 2.5em;
  min-width: 60px;
  text-align: center;
}

.feature-content h4 {
  color: var(--color-dark);
  margin: 0 0 0.5em 0;
  font-size: 1.1em;
  font-weight: 600;
}

.feature-content p {
  color: var(--color-gray);
  margin: 0;
  font-size: 0.9em;
  line-height: 1.4;
}

.login-actions {
  margin: 3em 0;
}

.login-btn {
  display: inline-block;
  width: 100%;
  background: var(--color-secondary);
  color: white;
  padding: 1.2em 2em;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1em;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 135, 82, 0.2);
  border: none;
  cursor: pointer;
}

.login-btn:hover {
  background: #007A5E;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 135, 82, 0.3);
  text-decoration: none;
  color: white;
}

.btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8em;
}

.login-icon {
  font-size: 1.3em;
}

.btn-text {
  font-size: 1em;
  letter-spacing: 0.5px;
}

.login-info {
  margin-top: 2em;
  padding: 1.5em;
  background: var(--color-light);
  border-radius: 10px;
  border-left: 4px solid var(--color-accent);
}

.login-info p {
  color: var(--color-gray);
  margin: 0.5em 0;
  font-size: 0.95em;
  line-height: 1.5;
}

.security-note {
  color: var(--color-secondary) !important;
  font-weight: 500;
  margin-top: 1em !important;
}

.login-footer {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 2px solid var(--color-gray-border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1em;
}

.copyright {
  color: var(--color-gray);
  font-size: 0.9em;
  margin: 0;
}

.version {
  color: var(--color-accent);
  font-size: 0.85em;
  font-weight: 500;
  margin: 0;
}

/* Dashboard Styles */
.dashboard-header {
  background: var(--color-secondary);
  border-radius: 12px;
  padding: 1.5em 2em;
  margin-bottom: 2em;
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(0, 135, 82, 0.15);
  position: relative;
  overflow: hidden;
}

.dashboard-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.header-left {
  flex: 1;
}

.company-branding {
  display: flex;
  align-items: center;
  gap: 1em;
}

.company-logo-small {
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon-small {
  font-size: 1.5em;
  color: white;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.8em;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  color: var(--color-white);
}

.brand-subtitle {
  margin: 0.1em 0 0 0;
  font-size: 0.9em;
  opacity: 0.9;
  font-weight: 400;
  color: var(--color-white);
}

.header-right {
  text-align: right;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3em;
}

.user-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2em;
}

.user-name {
  color: var(--color-white);
  font-size: 1em;
  font-weight: 600;
}

.user-email {
  color: rgba(255,255,255,0.8);
  font-size: 0.85em;
}

.user-role {
  background-color: rgba(255,255,255,0.15);
  color: var(--color-white);
  padding: 0.2em 0.6em;
  border-radius: 16px;
  font-size: 0.75em;
  font-weight: 500;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.4em;
  background-color: #DC3545;
  color: white;
  text-decoration: none;
  padding: 0.6em 1em;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 500;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background-color: #C82333;
  text-decoration: none;
  color: white;
  transform: translateY(-1px);
}

.logout-icon {
  font-size: 1em;
}

/* Super Admin Panel */
.super-admin-panel {
  background: var(--color-primary);
  border-radius: 12px;
  padding: 2.5em;
  margin-bottom: 2.5em;
  color: var(--color-dark);
  box-shadow: 0 2px 8px rgba(255, 196, 35, 0.15);
  border: 1px solid var(--color-gray-border);
}

.panel-header {
  margin-bottom: 1.5em;
  text-align: center;
}

.panel-header h3 {
  color: var(--color-dark);
  margin: 0 0 0.5em 0;
  border: none;
  font-size: 1.5em;
  font-weight: 700;
}

.panel-header p {
  margin: 0;
  color: var(--color-gray);
  font-size: 1em;
}

.super-admin-actions {
  display: flex;
  gap: 1em;
  justify-content: center;
  flex-wrap: wrap;
}

.super-admin-header {
  text-align: center;
  margin-bottom: 2em;
}

.super-admin-header h1 {
  color: #FFD200;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 1em;
}

.chats-section {
  margin-bottom: 2.5em;
}

.section-header {
  margin-bottom: 1.5em;
  text-align: center;
}

.section-header h3 {
  color: var(--color-dark);
  margin: 0 0 0.5em 0;
  font-size: 1.8em;
  font-weight: 600;
  border: none;
}

.section-header p {
  margin: 0;
  color: var(--color-gray);
  font-size: 1em;
}

.chats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5em;
  margin-top: 1.5em;
}

.chat-card {
  background: var(--color-white);
  border-radius: 16px;
  padding: 2em;
  border: 2px solid var(--color-gray-border);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}

.chat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-primary);
}

.chat-card[data-chat-type="lideres"]::before {
  background: var(--color-lideres);
}

.chat-card[data-chat-type="relaciones_laborales"]::before {
  background: var(--color-relaciones-laborales);
}

.chat-card[data-chat-type="colaboradores"]::before {
  background: var(--color-colaboradores);
}

.chat-card[data-chat-type="colaboradores_zona_norte"]::before,
.chat-card[data-chat-type="colaboradores_zona_sur"]::before,
.chat-card[data-chat-type="colaboradores_mexico"]::before,
.chat-card[data-chat-type="colaboradores_chile"]::before {
  background: var(--color-colaboradores);
}

.chat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  border-color: var(--color-primary);
}

.chat-card[data-chat-type="lideres"]:hover {
  border-color: var(--color-lideres);
  box-shadow: 0 12px 32px rgba(255, 196, 35, 0.2);
}

.chat-card[data-chat-type="relaciones_laborales"]:hover {
  border-color: var(--color-relaciones-laborales);
  box-shadow: 0 12px 32px rgba(0, 135, 82, 0.2);
}

.chat-card[data-chat-type="colaboradores"]:hover {
  border-color: var(--color-colaboradores);
  box-shadow: 0 12px 32px rgba(122, 193, 66, 0.2);
}

.chat-card[data-chat-type="colaboradores_zona_norte"]:hover,
.chat-card[data-chat-type="colaboradores_zona_sur"]:hover,
.chat-card[data-chat-type="colaboradores_mexico"]:hover,
.chat-card[data-chat-type="colaboradores_chile"]:hover {
  border-color: var(--color-colaboradores);
  box-shadow: 0 12px 32px rgba(122, 193, 66, 0.2);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-bottom: 1.5em;
}

.chat-icon {
  background: var(--color-light);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-icon .icon {
  font-size: 1.5em;
}

.chat-title {
  flex: 1;
}

.chat-title h4 {
  margin: 0 0 0.3em 0;
  color: var(--color-dark);
  font-size: 1.3em;
  font-weight: 600;
}

.admin-badge {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-dark);
  padding: 0.2em 0.6em;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-badges {
  display: flex;
  gap: 0.5em;
}

.admin-badge {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: var(--color-white);
  padding: 0.5em 1em;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(255, 196, 35, 0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.super-admin-badge {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  color: var(--color-white);
  padding: 0.5em 1em;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 135, 82, 0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.chat-description {
  color: #6c757d;
  margin-bottom: 1.5em;
  line-height: 1.5;
}

.chat-actions {
  display: flex;
  gap: 0.8em;
  flex-wrap: wrap;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: var(--color-primary);
  color: var(--color-dark);
  text-decoration: none;
  padding: 1em 2em;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1em;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(255, 196, 35, 0.2);
}

.btn-primary:hover {
  background: #E6B000;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 196, 35, 0.3);
  text-decoration: none;
  color: var(--color-dark);
}

/* Botones específicos por tipo de chat */
.chat-card[data-chat-type="lideres"] .btn-primary {
  background: var(--color-lideres);
  color: var(--color-dark);
  box-shadow: 0 2px 4px rgba(255, 196, 35, 0.2);
}

.chat-card[data-chat-type="lideres"] .btn-primary:hover {
  background: #E6B000;
  box-shadow: 0 4px 8px rgba(255, 196, 35, 0.3);
  color: var(--color-dark);
}

.chat-card[data-chat-type="relaciones_laborales"] .btn-primary {
  background: var(--color-relaciones-laborales);
  color: var(--color-white);
  box-shadow: 0 2px 4px rgba(0, 135, 82, 0.2);
}

.chat-card[data-chat-type="relaciones_laborales"] .btn-primary:hover {
  background: #007A5E;
  box-shadow: 0 4px 8px rgba(0, 135, 82, 0.3);
  color: var(--color-white);
}

.chat-card[data-chat-type="colaboradores"] .btn-primary {
  background: var(--color-colaboradores);
  color: var(--color-white);
  box-shadow: 0 2px 4px rgba(122, 193, 66, 0.2);
}

.chat-card[data-chat-type="colaboradores_zona_norte"] .btn-primary,
.chat-card[data-chat-type="colaboradores_zona_sur"] .btn-primary,
.chat-card[data-chat-type="colaboradores_mexico"] .btn-primary,
.chat-card[data-chat-type="colaboradores_chile"] .btn-primary {
  background: var(--color-colaboradores);
  color: var(--color-white);
  box-shadow: 0 2px 4px rgba(122, 193, 66, 0.2);
}

.chat-card[data-chat-type="colaboradores"] .btn-primary:hover {
  background: #6BB53A;
  box-shadow: 0 4px 8px rgba(122, 193, 66, 0.3);
  color: var(--color-white);
}

.chat-card[data-chat-type="colaboradores_zona_norte"] .btn-primary:hover,
.chat-card[data-chat-type="colaboradores_zona_sur"] .btn-primary:hover,
.chat-card[data-chat-type="colaboradores_mexico"] .btn-primary:hover,
.chat-card[data-chat-type="colaboradores_chile"] .btn-primary:hover {
  background: #6BB53A;
  box-shadow: 0 4px 8px rgba(122, 193, 66, 0.3);
  color: var(--color-white);
}

.btn-icon {
  font-size: 1.1em;
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: var(--color-gray);
  color: white;
  text-decoration: none;
  padding: 0.8em 1.5em;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
  background: #5A6268;
  text-decoration: none;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.no-access {
  text-align: center;
  padding: 4em 2em;
  color: var(--color-gray);
  background: var(--color-light);
  border-radius: 16px;
  border: 2px dashed var(--color-gray-border);
}

.no-access-icon {
  font-size: 3em;
  margin-bottom: 1em;
  opacity: 0.5;
}

.no-access h4 {
  color: var(--color-dark);
  margin: 0 0 1em 0;
  font-size: 1.3em;
  font-weight: 600;
}

.no-access p {
  margin: 0.5em 0;
  font-size: 1em;
  line-height: 1.5;
}

.user-section {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5em;
  border: 1px solid #e9ecef;
}

.user-details {
  margin-top: 1em;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8em;
  padding: 0.5em 0;
  border-bottom: 1px solid #e9ecef;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: bold;
  color: #003865;
}

.detail-value {
  color: #6c757d;
}

.group-badge {
  display: inline-block;
  background-color: #e9ecef;
  color: #495057;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  font-size: 0.8em;
  margin: 0.2em;
}

.group-badge.admin {
  background-color: #FFD200;
  color: #003865;
}

.no-groups {
  color: #6c757d;
  font-style: italic;
}

/* Chat Header Navigation */
.chat-header, .admin-header {
  margin-bottom: 2em;
  background: linear-gradient(135deg, var(--color-light) 0%, var(--color-white) 100%);
  border-radius: 16px;
  padding: 2em;
  border: 2px solid var(--color-gray-border);
  position: relative;
  overflow: hidden;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5em;
}

.header-left {
  flex: 1;
  text-align: left;
}

.header-right {
  flex-shrink: 0;
  margin-left: 2em;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.alianza-logo {
  background: var(--color-secondary);
  border-radius: 12px;
  padding: 1em 1.5em;
  box-shadow: 0 2px 8px rgba(0, 135, 82, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}

.logo-text {
  color: var(--color-white);
  font-weight: bold;
  font-size: 0.9em;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  line-height: 1.2;
}

.chat-header::before, .admin-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-primary);
}

.chat-header[data-chat-type="lideres"]::before, 
.admin-header[data-chat-type="lideres"]::before {
  background: var(--color-lideres);
}

.chat-header[data-chat-type="relaciones_laborales"]::before, 
.admin-header[data-chat-type="relaciones_laborales"]::before {
  background: var(--color-relaciones-laborales);
}

.chat-header[data-chat-type="colaboradores"]::before, 
.admin-header[data-chat-type="colaboradores"]::before {
  background: var(--color-colaboradores);
}

.chat-header[data-chat-type="colaboradores_zona_norte"]::before,
.chat-header[data-chat-type="colaboradores_zona_sur"]::before,
.chat-header[data-chat-type="colaboradores_mexico"]::before,
.chat-header[data-chat-type="colaboradores_chile"]::before,
.admin-header[data-chat-type="colaboradores_zona_norte"]::before,
.admin-header[data-chat-type="colaboradores_zona_sur"]::before,
.admin-header[data-chat-type="colaboradores_mexico"]::before,
.admin-header[data-chat-type="colaboradores_chile"]::before {
  background: var(--color-colaboradores);
}

/* Colores de fondo específicos para el header del chat */
.chat-header[data-chat-type="lideres"] {
  background: var(--color-lideres);
  color: var(--color-dark);
}

.chat-header[data-chat-type="lideres"] h1 {
  color: var(--color-dark);
}

.chat-header[data-chat-type="lideres"] .chat-description {
  color: var(--color-dark);
  background: rgba(255, 255, 255, 0.9);
}

.chat-header[data-chat-type="relaciones_laborales"] {
  background: var(--color-relaciones-laborales);
  color: var(--color-white);
}

.chat-header[data-chat-type="relaciones_laborales"] h1 {
  color: var(--color-white);
}

.chat-header[data-chat-type="relaciones_laborales"] .chat-description {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.1);
}

.chat-header[data-chat-type="colaboradores"] {
  background: var(--color-colaboradores);
  color: var(--color-white);
}

.chat-header[data-chat-type="colaboradores"] h1 {
  color: var(--color-white);
}

.chat-header[data-chat-type="colaboradores"] .chat-description {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.1);
}

.chat-header[data-chat-type="colaboradores_zona_norte"],
.chat-header[data-chat-type="colaboradores_zona_sur"],
.chat-header[data-chat-type="colaboradores_mexico"],
.chat-header[data-chat-type="colaboradores_chile"] {
  background: var(--color-colaboradores);
  color: var(--color-white);
}

.chat-header[data-chat-type="colaboradores_zona_norte"] h1,
.chat-header[data-chat-type="colaboradores_zona_sur"] h1,
.chat-header[data-chat-type="colaboradores_mexico"] h1,
.chat-header[data-chat-type="colaboradores_chile"] h1 {
  color: var(--color-white);
}

.chat-header[data-chat-type="colaboradores_zona_norte"] .chat-description,
.chat-header[data-chat-type="colaboradores_zona_sur"] .chat-description,
.chat-header[data-chat-type="colaboradores_mexico"] .chat-description,
.chat-header[data-chat-type="colaboradores_chile"] .chat-description {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.1);
}

.chat-header h1, .admin-header h1 {
  margin-bottom: 0.5em;
  color: var(--color-dark);
  font-size: 2.2em;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-top: 0;
}

.chat-header .chat-description {
  color: var(--color-gray);
  font-size: 1.2em;
  line-height: 1.6;
  margin-bottom: 1.5em;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  font-style: italic;
  background: var(--color-white);
  padding: 1em 1.5em;
  border-radius: 12px;
  border-left: 4px solid var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.user-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
}

.user-info {
  color: #6c757d;
  font-size: 0.9em;
  font-weight: bold;
}

/* Header Navigation */
.chat-nav, .admin-nav {
  display: flex;
  justify-content: center;
  gap: 1em;
  flex-wrap: wrap;
}

.btn-nav, .btn-secondary {
  display: inline-block;
  padding: 0.6em 1.2em;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-nav {
  background-color: #f8f9fa;
  color: #003865;
  border-color: #dee2e6;
}

.btn-nav:hover, .btn-nav.active {
  background-color: #FFD200;
  color: #003865;
  border-color: #FFD200;
}

/* File Management Section */
.file-management {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5em;
  margin-bottom: 2em;
  border: 1px solid #e9ecef;
}

.upload-section {
  margin-bottom: 2em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid #dee2e6;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.file-input-group {
  display: flex;
  gap: 1em;
  align-items: center;
}

input[type="file"] {
  flex: 1;
  padding: 0.8em;
  border: 2px solid #003865;
  border-radius: 6px;
  background-color: white;
}

.upload-btn {
  background-color: #28a745;
  color: white;
  font-weight: bold;
  border: none;
  padding: 0.8em 1.5em;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.upload-btn:hover {
  background-color: #218838;
}

/* Files List */
.files-section {
  margin-top: 1.5em;
}

.files-list {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  margin-bottom: 1em;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1em;
  background-color: white;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

.file-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-item.invalid {
  background-color: #fff5f5;
  border-color: #fed7d7;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 1em;
  flex: 1;
}

.file-name {
  font-weight: bold;
  color: #003865;
}

.file-size {
  color: #6c757d;
  font-size: 0.9em;
}

.file-status {
  padding: 0.3em 0.6em;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: bold;
}

.file-status.valid {
  background-color: #d4edda;
  color: #155724;
}

.file-status.invalid {
  background-color: #f8d7da;
  color: #721c24;
}

.file-actions {
  display: flex;
  gap: 0.5em;
}

.delete-form {
  margin: 0;
}

.delete-btn {
  background-color: #dc3545;
  color: white;
  font-weight: bold;
  border: none;
  padding: 0.5em 1em;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.delete-btn:hover {
  background-color: #c82333;
}

.error-message {
  color: #dc3545;
  font-size: 0.9em;
  font-style: italic;
}

.files-summary {
  background-color: #e9ecef;
  padding: 1em;
  border-radius: 6px;
  margin-top: 1em;
}

.files-summary p {
  margin: 0.3em 0;
  font-size: 0.9em;
}

.no-files {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 2em;
}

/* Chat Section */
.chat-section {
  background: var(--color-white);
  border-radius: 12px;
  padding: 2.5em;
  border: 1px solid var(--color-gray-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}

.chat-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
}

.chat-branding {
  display: flex;
  align-items: center;
  gap: 1.5em;
}

.chat-icon-header {
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-icon-header .icon {
  font-size: 2em;
  color: white;
}

.chat-title-header h1 {
  margin: 0 0 0.3em 0;
  font-size: 2.2em;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  color: var(--color-white);
}

.chat-title-header .chat-description {
  margin: 0;
  color: rgba(255,255,255,0.9);
  font-size: 1em;
  font-weight: 400;
}

.nav-actions {
  display: flex;
  gap: 0.8em;
  flex-wrap: wrap;
}

.form-group {
  margin-bottom: 2em;
}

.form-group label {
  display: block;
  margin-bottom: 0.8em;
  color: var(--color-dark);
  font-weight: 600;
  font-size: 1.1em;
}

.input-group {
  display: flex;
  gap: 1em;
  align-items: stretch;
}

.input-group input[type="text"] {
  flex: 1;
  padding: 1.2em;
  border: 2px solid var(--color-gray-border);
  border-radius: 12px;
  font-size: 1em;
  transition: all 0.3s ease;
  background: var(--color-white);
}

.input-group input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 196, 35, 0.1);
}

.submit-btn {
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: var(--color-secondary);
  color: white;
  border: none;
  padding: 1.2em 2em;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 135, 82, 0.2);
}

.submit-btn:hover {
  background: #007A5E;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 135, 82, 0.3);
}

.chat-messages {
  margin-top: 2em;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin-bottom: 1em;
}

.message-icon {
  font-size: 1.5em;
}

.message-label {
  font-weight: 600;
  color: var(--color-dark);
  font-size: 1.1em;
}

.message-content {
  background: var(--color-light);
  padding: 1.5em;
  border-radius: 12px;
  border-left: 4px solid var(--color-primary);
  line-height: 1.6;
}

.message-content > *:first-child {
  margin-top: 0;
}

.message-content > *:last-child {
  margin-bottom: 0;
}

.message-content p {
  margin: 0 0 1em 0;
  line-height: 1.6;
  color: var(--color-dark);
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content strong {
  font-weight: 600;
  color: var(--color-dark);
}

.message-content em {
  font-style: italic;
  color: var(--color-gray-dark);
}

.message-content br {
  margin-bottom: 0.5em;
}

/* Estilos para listas */
.message-content ul,
.message-content ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

/* Estilos para configuración del chat */
.chat-config-section {
  background: var(--color-white);
  border-radius: 12px;
  padding: 2em;
  margin-bottom: 2em;
  border: 1px solid var(--color-gray-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chat-history-section {
  background: var(--color-white);
  border-radius: 12px;
  padding: 2em;
  margin-bottom: 2em;
  border: 1px solid var(--color-gray-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.history-log {
  background: var(--color-light);
  border: 1px solid var(--color-gray-border);
  border-radius: 8px;
  padding: 1.2em;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 0.9em;
  color: var(--color-gray-dark);
}

.chat-config-section h3 {
  color: var(--color-dark);
  margin-bottom: 1.5em;
  font-size: 1.5em;
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5em;
}

.config-item {
  margin-bottom: 2em;
}

.config-item h4 {
  color: var(--color-dark);
  margin-bottom: 0.5em;
  font-size: 1.2em;
  font-weight: 600;
}

.config-description {
  color: var(--color-gray);
  margin-bottom: 1.5em;
  line-height: 1.5;
  font-size: 0.95em;
}

.config-form {
  background: var(--color-light);
  padding: 1.5em;
  border-radius: 8px;
  border: 1px solid var(--color-gray-border);
}

.config-form .form-group {
  margin-bottom: 1.5em;
}

.config-form label {
  display: block;
  margin-bottom: 0.5em;
  color: var(--color-dark);
  font-weight: 600;
  font-size: 1em;
}

.config-textarea {
  width: 100%;
  padding: 1em;
  border: 2px solid var(--color-gray-border);
  border-radius: 8px;
  font-size: 1em;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.config-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 196, 35, 0.1);
}

.form-help {
  display: block;
  margin-top: 0.5em;
  color: var(--color-gray);
  font-size: 0.9em;
  font-style: italic;
}

.message-content ul {
  list-style-type: disc;
}

.message-content ol {
  list-style-type: decimal;
}

.message-content li {
  margin-bottom: 0.5em;
  line-height: 1.5;
  color: var(--color-dark);
}

.message-content li:last-child {
  margin-bottom: 0;
}

.message-content li strong {
  font-weight: 600;
  color: var(--color-dark);
}

.message-content li em {
  font-style: italic;
  color: var(--color-gray-dark);
}

.chat-form {
  margin-bottom: 1.5em;
}

form label {
  display: block;
  margin-bottom: 0.5em;
  font-weight: bold;
}

input[type="text"] {
  width: 100%;
  padding: 1em;
  font-size: 1.1em;
  border: 2px solid var(--color-gray-border);
  border-radius: 12px;
  margin-bottom: 1em;
  box-sizing: border-box;
  transition: all 0.3s ease;
  background: var(--color-white);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 196, 35, 0.1);
  transform: translateY(-1px);
}

button {
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: bold;
  border: none;
  padding: 1em 2em;
  border-radius: 12px;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 196, 35, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 196, 35, 0.4);
  background: #e6b000;
}

.respuesta, .pregunta {
  margin-top: 2em;
  padding: 1.5em;
  background: linear-gradient(135deg, var(--color-white) 0%, var(--color-light) 100%);
  border-left: 5px solid var(--color-primary);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 2px solid var(--color-gray-border);
  position: relative;
  overflow: hidden;
}

.respuesta::before, .pregunta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
}

.respuesta {
  border-left-color: var(--color-secondary);
}

.respuesta::before {
  background: var(--color-secondary);
}

.pregunta {
  border-left-color: var(--color-primary);
}

.pregunta::before {
  background: var(--color-primary);
}

/* Chat Info Section */
.chat-info-section {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5em;
  border: 1px solid #e9ecef;
  margin-bottom: 2em;
}

.chat-details {
  margin-top: 1em;
}

/* Super Admin Styles */
.system-stats-section {
  margin-bottom: 2em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1em;
  margin-top: 1em;
}

.stat-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5em;
  text-align: center;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-number {
  font-size: 2em;
  font-weight: bold;
  color: #003865;
  margin-bottom: 0.5em;
}

.stat-label {
  color: #6c757d;
  font-size: 0.9em;
}

.system-actions-section {
  margin-bottom: 2em;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5em;
  margin-top: 1em;
}

.action-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5em;
  text-align: center;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.action-icon {
  font-size: 2em;
  margin-bottom: 1em;
}

.action-title {
  font-weight: bold;
  color: #003865;
  margin-bottom: 0.5em;
}

.action-description {
  color: #6c757d;
  font-size: 0.9em;
  margin-bottom: 1em;
  line-height: 1.4;
}

.chats-detail-section {
  margin-bottom: 2em;
}

.chat-detail-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5em;
  margin-bottom: 1.5em;
  border: 1px solid #e9ecef;
}

.chat-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
  flex-wrap: wrap;
  gap: 1em;
}

.chat-detail-header h4 {
  margin: 0;
  color: #003865;
}

.chat-detail-actions {
  display: flex;
  gap: 0.8em;
  flex-wrap: wrap;
}

.chat-detail-stats {
  margin-bottom: 1.5em;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5em;
  padding: 0.3em 0;
}

.stat-label {
  font-weight: bold;
  color: #003865;
}

.stat-value {
  color: #6c757d;
}

.valid-count {
  color: #28a745;
  font-weight: bold;
}

.invalid-count {
  color: #dc3545;
  font-weight: bold;
}

.files-preview {
  margin-top: 1em;
}

.files-preview h5 {
  margin-bottom: 1em;
  color: #003865;
}

.files-list-compact {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.file-item-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5em;
  background-color: white;
  border-radius: 4px;
  border: 1px solid #dee2e6;
  font-size: 0.9em;
}

.file-item-compact.invalid {
  background-color: #fff5f5;
  border-color: #fed7d7;
}

.file-item-compact .file-name {
  flex: 1;
  margin-right: 1em;
}

.file-item-compact .file-size {
  margin-right: 1em;
}

.more-files {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 0.5em;
}

.config-info-section {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5em;
  border: 1px solid #e9ecef;
  margin-bottom: 2em;
}

.config-details {
  margin-top: 1em;
}

/* Flash Messages */
.flash-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
}

.flash-message {
  padding: 1em;
  margin-bottom: 0.5em;
  border-radius: 6px;
  color: white;
  font-weight: bold;
  transition: opacity 0.5s ease;
}

.flash-message.success {
  background-color: #28a745;
}

.flash-message.error {
  background-color: #dc3545;
}

.flash-message.warning {
  background-color: #ffc107;
  color: #212529;
}

.flash-message.info {
  background-color: #17a2b8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    margin: 20px auto;
    padding: 1em;
  }

  .login-card {
    padding: 2em;
  }

  .dashboard-header {
    flex-direction: column;
    text-align: center;
  }

  .header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-right {
    margin-left: 0;
    margin-top: 1em;
  }

  .alianza-logo {
    min-width: 100px;
    padding: 0.8em 1.2em;
  }

  .logo-text {
    font-size: 0.8em;
  }
  
  .user-nav {
    flex-direction: column;
    align-items: center;
  }
  
  .chats-grid {
    grid-template-columns: 1fr;
  }
  
  .chat-actions {
    flex-direction: column;
  }
  
  .file-input-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1em;
  }
  
  .file-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
  }
  
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
  }
  
  .flash-messages {
    position: static;
    margin-top: 1em;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .actions-grid {
    grid-template-columns: 1fr;
  }
  
  .chat-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .chat-detail-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Small text styling */
small {
  color: #6c757d;
  font-size: 0.85em;
}
