/* ==========================================================================
   VARIABLES ENÉRGICAS Y VIBRANTES (COLOR PERSONALIZADO)
   ========================================================================== */
:root {
  --primary: #850337;          /* Color Guinda/Vino principal */
  --primary-hover: #b30a4f;    /* Hover aclarado para buen contraste */
  --text-main: #0f172a;
  --text-muted: #475569;
  --bg-app: #e2e8f0; 
  --bg-card: #ffffff;          /* Nota: Cambiado a blanco para que el contenido sea legible, el contenedor usa este fondo */
  --border-color: #cbd5e1;
  --radius: 10px;
  
  /* Alertas Muy Visibles (Colores más saturados) */
  --bg-success: #dcfce7;  --border-success: #22c55e;  --text-success: #14532d;
  --bg-warning: #fef9c3;  --border-warning: #eab308;  --text-warning: #713f12;
  --bg-error: #fee2e2;    --border-error: #ef4444;    --text-error: #7f1d1d;
  --bg-info: #e0f2fe;     --border-info: #0ea5e9;     --text-info: #0369a1;
}

html {
  font-size: 100%;
  overflow-y: scroll;
  text-size-adjust: 100%;
  background-color: var(--bg-app);
}

body {
  margin: 0;
  padding: 30px 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
  background: var(--bg-app);
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL CONTRASTADO
   ========================================================================== */
#container {
  background: var(--bg-card);
  width: 920px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 2px solid #94a3b8; /* Borde exterior grueso y visible */
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

#header {
  padding: 25px 40px;
  background: #f8fafc;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#header p {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

/* Menú de Navegación con Color de Fondo */
#nav {
  margin: 0;
  padding: 0 30px;
  height: 55px;
  background: #1e293b; /* Fondo oscuro para que los enlaces resalten muchísimo */
  border-bottom: 3px solid var(--primary);
  display: flex;
  align-items: center;
}

#nav li { list-style: none; display: inline-block; }

#nav li a {
  display: inline-block;
  height: 55px;
  line-height: 55px;
  padding: 0 20px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

#nav li a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

#nav li a.active {
  color: #ffffff;
  background: var(--primary); /* El botón activo brilla con el color de marca */
}

#content {
  padding: 40px;
  background: #ffffff;
}

/* Footer transparente integrado con el fondo de la página */
#footer {
  padding: 25px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent; /* Sin fondo */
  border-top: none;        /* Sin borde para que flote limpiamente */
}

/* ==========================================================================
   TIPOGRAFÍA Y ENLACES VISIBLES
   ========================================================================== */
h1, h2, h3, h4 {
  color: #0f172a;
  font-weight: 700;
  margin-top: 0;
}

h1 { font-size: 26px; color: var(--primary); margin-bottom: 20px; }
h2 { font-size: 20px; margin-bottom: 15px; }
h3 { font-size: 16px; margin-bottom: 10px; }

a, .link {
  color: var(--primary);
  text-decoration: underline; /* Subrayado por defecto para máxima accesibilidad */
  font-weight: 500;
}

a:hover, .link:hover {
  color: var(--primary-hover);
  background-color: #fdf2f8; /* Destacado rosa sutil al pasar el mouse */
}

/* ==========================================================================
   FORMULARIOS MEJORADOS Y MODERNOS
   ========================================================================== */
input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  background-color: #ffffff;
  font-size: 14px;
  color: #0f172a;
  font-weight: 500;
  box-sizing: border-box;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03); /* Sombra interna sutil */
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Efecto de enfoque de alto impacto con el color de tu marca */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 4px rgba(133, 3, 55, 0.15); /* Anillo guinda */
  background-color: #ffffff;
}

/* Mejoras visuales para las listas desplegables */
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  appearance: none; /* Quita la flecha nativa fea del navegador */
  padding-right: 40px;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1e293b;
  font-size: 13.5px;
}

/* ==========================================================================
   BOTONES LLAMATIVOS Y DE ALTO CONTRASTE
   ========================================================================== */
.button,
.button:visited {
  background-color: var(--primary);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 6px;
  border: none;
  display: inline-block;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(133, 3, 55, 0.2);
  transition: all 0.15s ease;
}

.button:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 12px rgba(133, 3, 55, 0.3);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(1px);
}

/* Variantes de Botones de Color */
.green.button, .green.button:visited { background-color: #16a34a; box-shadow: 0 4px 6px rgba(22, 163, 74, 0.2); }
.green.button:hover { background-color: #15803d; box-shadow: 0 6px 12px rgba(22, 163, 74, 0.3); }

.blue.button, .blue.button:visited { background-color: #0ea5e9; box-shadow: 0 4px 6px rgba(14, 165, 233, 0.2); }
.blue.button:hover { background-color: #0284c7; box-shadow: 0 6px 12px rgba(14, 165, 233, 0.3); }

.action-button {
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  color: #0f172a !important;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.action-button:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* ==========================================================================
   ALERTAS SUPER VISIBLES
   ========================================================================== */
#msg_notice, #msg_warning, .warning-banner, #msg_error, #msg_info {
  margin-bottom: 25px;
  padding: 16px 16px 16px 48px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#msg_notice {
  border: 2px solid var(--border-success);
  background: url('../images/icons/ok.png') 16px 50% no-repeat var(--bg-success);
  color: var(--text-success);
}

#msg_warning, .warning-banner {
  border: 2px solid var(--border-warning);
  background: url('../images/icons/alert.png') 16px 50% no-repeat var(--bg-warning);
  color: var(--text-warning);
}

#msg_error {
  border: 2px solid var(--border-error);
  background: url('../images/icons/error.png') 16px 50% no-repeat var(--bg-error);
  color: var(--text-error);
}

#msg_info {
  border: 2px solid var(--border-info);
  background: var(--bg-info);
  color: var(--text-info);
  padding-left: 20px;
}

/* ==========================================================================
   TABLAS CON FILAS DESTACADAS
   ========================================================================== */
#ticketTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

#ticketTable th {
  background: #334155;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  text-align: left;
}

#ticketTable th a { color: #ffffff; text-decoration: none; }

#ticketTable td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
}

#ticketTable tr:nth-child(even) td {
  background-color: #f8fafc;
}

#ticketTable tr:hover td {
  background-color: #fdf2f8 !important; /* Se ilumina sutilmente con tono de la marca */
  color: var(--primary);
}

/* ==========================================================================
   HILO DE DISCUSIÓN (ESTILO CHAT VIVO)
   ========================================================================== */
.thread-entry {
  margin-bottom: 25px;
  border-radius: var(--radius);
  border: 2px solid var(--border-color);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.thread-entry .header {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Mensajes del Cliente */
.thread-entry.message {
  border-color: #93c5fd;
}
.thread-entry.message .header {
  background-color: #2563eb;
  color: #ffffff;
}
.thread-entry.message .thread-body {
  background-color: #eff6ff;
}

/* Respuestas del Soporte */
.thread-entry.response {
  border-color: #86efac;
}
.thread-entry.response .header {
  background-color: #16a34a;
  color: #ffffff;
}
.thread-entry.response .thread-body {
  background-color: #f0fdf4;
}

.thread-entry .thread-body {
  padding: 22px;
  font-size: 14.5px;
  color: #000000;
}

.thread-body .attachments {
  background-color: #ffffff;
  margin: 15px -22px -22px -22px;
  padding: 12px 22px;
  border-top: 2px dashed var(--border-color);
}

/* Caja de login del cliente llamativa */
#clientLogin {
  max-width: 460px;
  margin: 40px auto;
  padding: 35px;
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.clear { clear: both; height: 0; }
#ticketThread::before { display: none; }

.thread-body img, 
.thread-entry img,
#content img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 15px 0;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

#header #logo img {
  max-height: 55px !important;
  max-width: 280px !important;
  width: auto !important;
  height: auto !important;
}