/* =========================================================
   ETÉREO SISTEMAS — app.css
   Estilos ADITIVOS para la capa PHP/MySQL (WhatsApp flotante,
   chatbot, formularios y panel administrativo). No modifica ni
   sobreescribe ninguna regla de main.css: reutiliza las mismas
   variables de diseño (--navy-*, --gold-*, --blue-*, --radius-*,
   --ease, fuentes) definidas en :root dentro de main.css.
   ========================================================= */

/* ---------- Botón flotante de WhatsApp ---------- */
.whatsapp-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.45);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  animation: wa-bounce 4s ease-in-out infinite;
}
.whatsapp-fab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  z-index: -1;
  animation: wa-pulse-ring 2.4s ease-out infinite;
}
@keyframes wa-pulse-ring {
  0%   { transform: scale(1);   opacity: .55; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes wa-bounce {
  0%, 55%, 100% { transform: translateY(0); }
  10% { transform: translateY(-16px); }
  20% { transform: translateY(0); }
  28% { transform: translateY(-8px); }
  36% { transform: translateY(0); }
  42% { transform: translateY(-4px); }
  48% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .whatsapp-fab { animation: none; }
  .whatsapp-fab::before { animation: none; display: none; }
}
.whatsapp-fab:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 14px 34px -8px rgba(0,0,0,.5); animation-play-state: paused; }
.whatsapp-fab:hover::before { animation-play-state: paused; opacity: 0; }
.whatsapp-fab svg { width: 30px; height: 30px; fill: #fff; }

@media (max-width: 480px) {
  .whatsapp-fab { right: 14px; width: 52px; height: 52px; bottom: 14px; }
}

/* ---------- Formularios (contacto) ---------- */
.form-field { margin-bottom: 18px; }
.form-label {
  display: block; font-family: var(--font-utility); font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--navy-900); margin-bottom: 7px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  border: 1px solid var(--gray-300, #dbe2ec);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: .92rem;
  color: var(--navy-900);
  background: #fff;
  outline: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(46,107,255,.12);
}
.form-textarea { min-height: 130px; resize: vertical; }
.form-error { color: #b91c1c; font-size: .78rem; margin-top: 6px; }

/* ---------- Botón de mostrar/ocultar contraseña ---------- */
.password-field-wrap { position: relative; }
.password-field-wrap input[type="password"], .password-field-wrap input[type="text"] { padding-right: 42px; }
.password-toggle-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; background: none; cursor: pointer;
  color: var(--gray-500, #8b98ab); display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: color .2s var(--ease), background .2s var(--ease);
}
.password-toggle-btn:hover { color: var(--navy-900); background: var(--gray-100, #f4f6f9); }
.form-alert {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: .88rem;
  margin-bottom: 22px;
}
.form-alert.success { background: rgba(37,211,102,.1); border: 1px solid rgba(37,211,102,.35); color: #1a7d43; }
.form-alert.error { background: rgba(214,69,69,.08); border: 1px solid rgba(214,69,69,.3); color: #b23a3a; }
.honeypot-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }

/* =========================================================================
   MICROINTERACCIONES PREMIUM
   Mejora animaciones ya existentes en main.css (.card, .btn-cta, .btn-ghost,
   .btn-dark, [data-reveal]) sin tocar ningún HTML. Como app.css se carga
   después de main.css, estas reglas los sobreescriben directamente.
   La regla global de prefers-reduced-motion ya está en main.css (línea ~40)
   y cubre automáticamente todo lo de aquí también.
   ========================================================================= */

/* ---------- Tarjetas (.card — servicios, nosotros, etc.) ---------- */
.card {
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 28px 56px -22px rgba(11,31,58,.28);
  border-color: rgba(46,107,255,.4);
}
.card-icon { transition: transform .3s var(--ease); }
.card:hover .card-icon { transform: scale(1.1); }

/* ---------- Botones principales: leve crecimiento + brillo ---------- */
.btn-cta, .btn-ghost, .btn-dark {
  transition: transform .28s var(--ease), box-shadow .3s var(--ease), filter .28s var(--ease), background .28s var(--ease), border-color .28s var(--ease);
}
.btn-cta:hover { transform: translateY(-2px) scale(1.025); filter: brightness(1.06); }
.btn-ghost:hover, .btn-dark:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.08); }
.btn-cta:active, .btn-ghost:active, .btn-dark:active { transform: translateY(0) scale(.99); }

/* ---------- Galería: zoom + oscurecido sutil + caption con leve realce ----------
   Usa la estructura ya existente en galeria.php (figure > img + figcaption),
   sin envolturas nuevas: el "overlay" se logra con box-shadow inset sobre la
   imagen (técnica CSS-only), y el fade del texto se logra sobre el propio
   figcaption ya visible, dándole movimiento al pasar el cursor. */
figure:has(> img) { transition: box-shadow .3s var(--ease); }
figure:has(> img) img {
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
figure:has(> img):hover img {
  transform: scale(1.045);
  box-shadow: inset 0 0 0 999px rgba(5,11,22,.08);
}
figure:has(> img) figcaption {
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
figure:has(> img):hover figcaption {
  transform: translateY(-3px);
  opacity: .85;
}

/* ---------- Transición de página (fade muy ligero, no bloqueante) ---------- */
body {
  opacity: 1;
  transition: opacity .28s ease;
}
body.page-transitioning { opacity: 0; }

/* ---------- Selector "¿Qué necesitas?" (tarjetas tipo segmented control) ---------- */
.contact-type-selector { border: 0; padding: 0; margin: 0 0 26px; }
.contact-type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 480px) { .contact-type-grid { grid-template-columns: 1fr; } }

.type-option {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 14px 14px 12px;
  border: 1px solid var(--gray-300, #dbe2ec);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: #fff;
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
}
.type-option:hover { border-color: var(--blue-400); transform: translateY(-1px); }
.type-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.type-option input:focus-visible ~ .type-option-icon { outline: 2px solid var(--gold-400); outline-offset: 2px; }
.type-option-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-100, #f4f6f9); color: var(--navy-800);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.type-option-icon svg { width: 18px; height: 18px; }
.type-option-label { font-family: var(--font-utility); font-weight: 700; font-size: .82rem; color: var(--navy-900); }
.type-option:has(input:checked) {
  border-color: var(--blue-500);
  background: rgba(46,107,255,.05);
  box-shadow: 0 6px 20px -12px rgba(46,107,255,.5);
}
.type-option:has(input:checked) .type-option-icon { background: var(--blue-500); color: #fff; }

/* ---------- Paneles dinámicos (cotización / soporte / información) ---------- */
.contact-panel { animation: panel-fade-in .35s var(--ease); }
.contact-panel[hidden] { display: none; }
@keyframes panel-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.support-section-title {
  font-family: var(--font-utility); font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500, #8b98ab);
  margin: 22px 0 12px;
}
.support-section-title:first-of-type { margin-top: 4px; }

.form-file { padding: 9px 12px; font-size: .85rem; cursor: pointer; }
.form-file::file-selector-button {
  border: 0; border-radius: 999px; padding: 6px 12px; margin-right: 10px;
  background: var(--navy-900); color: #fff; font-family: var(--font-utility);
  font-weight: 600; font-size: .76rem; cursor: pointer; transition: background .2s var(--ease);
}
.form-file:hover::file-selector-button { background: var(--navy-800); }
.support-file-note { font-size: .78rem; color: var(--gray-500, #8b98ab); margin: -8px 0 18px; }

/* ---------- Selector "¿Ya eres cliente?" (soporte técnico) ---------- */
.account-choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 640px) { .account-choice-grid { grid-template-columns: 1fr; } }
.account-choice-card {
  border: 1px solid var(--gray-300, #dbe2ec); border-radius: var(--radius-md);
  padding: 26px 24px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.account-choice-card:hover { border-color: var(--blue-500); box-shadow: 0 16px 36px -20px rgba(11,31,58,.3); transform: translateY(-2px); }
.account-choice-icon { color: var(--blue-500); margin-bottom: 4px; }
.account-choice-card h3 { font-family: var(--font-display); font-size: 1.05rem; color: var(--navy-900); margin: 0; }
.account-choice-card > p { font-size: .86rem; color: var(--gray-700, #3d4a5c); margin: 0; }
.account-choice-list { list-style: none; padding: 0; margin: 2px 0 6px; display: flex; flex-direction: column; gap: 6px; }
.account-choice-list li {
  font-size: .82rem; color: var(--gray-700, #3d4a5c); padding-left: 20px; position: relative;
}
.account-choice-list li::before {
  content: ''; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue-500);
}
.account-choice-card .btn-cta, .account-choice-card .btn-ghost { margin-top: auto; align-self: flex-start; }
.account-choice-card .btn-ghost { color: var(--navy-900); border-color: var(--gray-300, #dbe2ec); }
.account-choice-card .btn-ghost:hover { border-color: var(--blue-500); background: rgba(46,107,255,.06); }

/* ---------- Estado de éxito tras enviar sin cuenta ---------- */
.account-success-state { text-align: center; padding: 20px 10px 6px; animation: panel-fade-in .35s var(--ease); }
.account-success-icon { color: #1a7d43; margin-bottom: 14px; }
.account-success-state h3 { font-family: var(--font-display); font-size: 1.15rem; color: var(--navy-900); margin: 0 0 12px; }
.account-success-state p { font-size: .9rem; color: var(--gray-700, #3d4a5c); line-height: 1.6; max-width: 460px; margin: 0 auto 10px; }
.account-success-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Portal de clientes ---------- */
.portal-tab {
  font-family: var(--font-utility); font-weight: 600; font-size: .82rem; color: rgba(255,255,255,.65);
  padding: 9px 16px; border-radius: 999px; text-decoration: none; border: 1px solid rgba(255,255,255,.12);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.portal-tab:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.portal-tab.active { background: var(--gold-400); border-color: var(--gold-400); color: var(--navy-950); }
.portal-tab-logout { color: rgba(255,255,255,.4); }
.portal-tab-logout:hover { color: #f0a3a3; border-color: rgba(240,80,80,.4); }

.portal-card {
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-md, 16px);
  padding: 22px 24px;
  box-shadow: 0 14px 34px -22px rgba(0,0,0,.55);
}
.portal-card + .portal-card { margin-top: 16px; }
.portal-empty { text-align: center; padding: 50px 20px; color: rgba(255,255,255,.5); }
.portal-empty svg {
  width: 44px; height: 44px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
  padding: 12px; border-radius: 50%; background: rgba(255,255,255,.05); color: rgba(255,255,255,.35);
  box-sizing: content-box;
}

.portal-list-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.08); text-decoration: none;
}
.portal-list-item:last-child { border-bottom: 0; }
.portal-list-item:hover .pli-title { color: var(--gold-300); }
.pli-title { color: #fff; font-weight: 600; font-size: .92rem; transition: color .2s var(--ease); }
.pli-sub { color: rgba(255,255,255,.5); font-size: .78rem; margin-top: 2px; }
.pli-meta { display: flex; align-items: center; gap: 10px; }

.portal-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.portal-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.portal-badge.nuevo { background: rgba(46,107,255,.18); color: #7ea6ff; }
.portal-badge.en_proceso, .portal-badge.contactado { background: rgba(255,7,0,.18); color: var(--gold-300); }
.portal-badge.atendido, .portal-badge.resuelto { background: rgba(37,211,102,.18); color: #6ee0a0; }

.portal-filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.portal-filter-chip {
  font-family: var(--font-utility); font-weight: 600; font-size: .78rem; color: rgba(255,255,255,.6);
  padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.portal-filter-chip:hover { color: #fff; }
.portal-filter-chip.active { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }

.portal-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 640px) { .portal-detail-grid { grid-template-columns: 1fr; } }
.portal-detail-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,.4); font-weight: 700; margin-bottom: 4px; }
.portal-detail-value { color: #fff; font-size: .88rem; }

/* Hilo de comentarios */
.comment-thread { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.comment-item { max-width: 82%; padding: 12px 16px; border-radius: 14px; }
.comment-item.cliente { align-self: flex-end; background: rgba(46,107,255,.16); border: 1px solid rgba(46,107,255,.25); border-bottom-right-radius: 4px; }
.comment-item.admin { align-self: flex-start; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-bottom-left-radius: 4px; }
.comment-author { font-size: .72rem; font-weight: 700; color: rgba(255,255,255,.55); margin-bottom: 4px; }
.comment-text { color: #fff; font-size: .87rem; line-height: 1.5; white-space: pre-wrap; }
.comment-time { font-size: .68rem; color: rgba(255,255,255,.35); margin-top: 6px; }
@media (max-width: 640px) { .comment-item { max-width: 92%; } }

.comment-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; }
.comment-form textarea { flex: 1; resize: vertical; min-height: 46px; }

.portal-file-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .84rem; }
.portal-file-item:last-child { border-bottom: 0; }
.portal-file-item a { color: var(--gold-300); text-decoration: none; }
.portal-file-item a:hover { text-decoration: underline; }
.portal-file-badge { font-size: .68rem; color: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 1px 8px; }

.file-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.file-list:empty { display: none; }
.file-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--gray-100, #f4f6f9); border: 1px solid var(--gray-300, #dbe2ec);
  border-radius: 8px; padding: 6px 10px; font-size: .78rem; color: var(--navy-800);
}
.file-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li button {
  flex-shrink: 0; border: 0; background: none; color: var(--gray-500, #8b98ab);
  cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 4px; border-radius: 4px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.file-list li button:hover { color: #b91c1c; background: rgba(185,28,28,.08); }

.remote-toggle { display: flex; gap: 10px; }
.remote-toggle-option {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--gray-300, #dbe2ec); border-radius: 999px;
  padding: 8px 18px; font-size: .85rem; cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.remote-toggle-option input { accent-color: var(--blue-500); }
.remote-toggle-option:has(input:checked) { border-color: var(--blue-500); background: rgba(46,107,255,.06); }

.remote-fields { animation: panel-fade-in .3s var(--ease); }
.remote-fields[hidden] { display: none; }

/* ---------- Tarjeta "¿Ya eres cliente?" ---------- */
.already-client-card {
  display: flex; gap: 14px; align-items: flex-start;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  background: linear-gradient(160deg, var(--navy-900), var(--navy-800));
  color: #fff;
}
.already-client-card svg { color: var(--gold-300); }
.already-client-card p { color: rgba(255,255,255,.85); }
.already-client-card p.font-utility { color: #fff; }
.response-time-row { display: flex; flex-direction: column; gap: 4px; font-size: .76rem; color: rgba(255,255,255,.75); }
.response-time-row strong { color: var(--gold-300); font-weight: 700; }
/* =====================================================================
   Portal de clientes — Dashboard estilo SaaS (topbar de app, tarjetas
   de estadísticas, actividad reciente, empty states)
   ===================================================================== */

/* ---------- Topbar de la aplicación (reemplaza el navbar público) --- */
.app-topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5,11,22,.88);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-topbar-inner { display: flex; align-items: center; gap: 22px; padding: 13px 0; }
.app-topbar-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.app-topbar-brand img { height: 28px; width: auto; }
.app-topbar-brand-text { font-family: var(--font-display); font-weight: 600; color: #fff; font-size: .96rem; letter-spacing: -.01em; white-space: nowrap; }
.app-topbar-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* En móvil el nav queda oculto (display:none) y no empuja nada, así
   que el propio botón de hamburguesa se encarga de irse a la derecha
   junto al avatar. En escritorio no hace falta: el nav (flex:1 1 auto)
   ya empuja todo lo demás hacia la derecha por su cuenta. */
.app-topbar-inner .hamburger { margin-left: auto; }
.app-topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold-400), var(--blue-400)); color: var(--navy-950);
  font-family: var(--font-utility); font-weight: 800; font-size: .7rem; letter-spacing: .02em;
  box-shadow: 0 0 0 2px rgba(255,255,255,.12);
}
.app-topbar-username { color: #fff; font-size: .85rem; font-weight: 600; font-family: var(--font-utility); white-space: nowrap; }
@media (max-width: 640px) { .app-topbar-username { display: none; } }

.app-shell-section { padding-top: 40px; padding-bottom: 72px; }
@media (max-width: 640px) { .app-shell-section { padding-top: 26px; padding-bottom: 52px; } }

/* .portal-tabs ahora vive dentro del topbar: una sola fila que se
   desplaza horizontalmente en pantallas angostas en vez de amontonarse.
   Controla su propio display por completo (sin depender de las clases
   "hidden"/"lg:flex" de Tailwind) para evitar problemas de orden de
   carga entre hojas de estilo: en móvil queda oculto y aparece el
   hamburguesa en su lugar; desde 1024px se muestra en fila. */
.portal-tabs { display: none; flex-wrap: nowrap; gap: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.portal-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .portal-tabs { display: flex; } }
.portal-tab { white-space: nowrap; flex-shrink: 0; }

/* ---------- Encabezado del dashboard ---------- */
.dash-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; margin-bottom: 30px;
}
.dash-hero-title { font-size: 1.9rem; }
.dash-hero-sub { max-width: 46ch; }
.dash-hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.dash-hero-meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-utility); font-size: .76rem; font-weight: 600; color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.13);
  padding: 6px 12px; border-radius: 999px;
}
.dash-hero-meta-item svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--gold-300); }
.btn-cta-lg { padding: .9rem 1.7rem; font-size: .95rem; box-shadow: 0 10px 32px -14px rgba(255,7,0,.5); flex-shrink: 0; }
.btn-cta-lg svg { width: 17px; height: 17px; }

/* ---------- Tarjetas de estadísticas ---------- */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1024px) { .dash-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .dash-stats { grid-template-columns: 1fr; } }

.stat-card {
  position: relative; overflow: hidden;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.11); border-radius: var(--radius-md);
  padding: 20px 22px 18px;
  box-shadow: 0 14px 34px -20px rgba(0,0,0,.6);
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-300) 60%, var(--blue-400));
}
.stat-card:hover {
  transform: translateY(-4px); border-color: rgba(255,7,0,.32); background: rgba(255,255,255,.065);
  box-shadow: 0 22px 48px -24px rgba(0,0,0,.7);
}
.stat-card-icon {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,7,0,.14); color: var(--gold-300); margin-bottom: 14px;
}
.stat-card-icon svg { width: 18px; height: 18px; }
/* Un color distinto por KPI (según el orden del dashboard) para que se
   distingan de un vistazo en lugar de verse los 4 idénticos. */
.dash-stats .stat-card:nth-child(1) .stat-card-icon { background: rgba(46,107,255,.16); color: #7ea6ff; }
.dash-stats .stat-card:nth-child(2) .stat-card-icon { background: rgba(37,211,102,.16); color: #6ee0a0; }
.dash-stats .stat-card:nth-child(3) .stat-card-icon { background: rgba(255,7,0,.16); color: var(--gold-300); }
.dash-stats .stat-card:nth-child(4) .stat-card-icon { background: rgba(168,120,255,.16); color: #c3a6ff; }
.stat-card-value { font-family: var(--font-display); color: #fff; font-size: 2rem; font-weight: 600; line-height: 1; margin-bottom: 6px; }
.stat-card-title { color: #fff; font-size: .84rem; font-weight: 700; font-family: var(--font-utility); margin-bottom: 2px; }
.stat-card-desc { color: rgba(255,255,255,.42); font-size: .74rem; }

/* ---------- Tarjetas de contenido (listas, actividad) ---------- */
.portal-card { transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.portal-card:hover { border-color: rgba(255,255,255,.15); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

.portal-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.portal-card-head-title { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: .88rem; font-family: var(--font-utility); }
.portal-card-head-title svg { width: 15px; height: 15px; color: var(--gold-300); }
.portal-card-head a { color: var(--gold-300); font-size: .74rem; font-weight: 600; text-decoration: none; }
.portal-card-head a:hover { text-decoration: underline; }

/* Ítem de lista con icono (usado en la actividad reciente del dashboard) */
.portal-list-item { gap: 12px; }
.pli-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.55);
}
.pli-icon svg { width: 16px; height: 16px; }
.pli-icon.prioridad-alta { background: rgba(240,80,80,.15); color: #f0a3a3; }
.pli-icon.prioridad-media { background: rgba(255,7,0,.15); color: var(--gold-300); }
.pli-icon.prioridad-baja { background: rgba(46,107,255,.15); color: #7ea6ff; }
.pli-main { flex: 1 1 auto; min-width: 0; }
.pli-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Empty state con CTA */
.portal-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.portal-empty svg { margin: 0 0 2px; }
.portal-empty .btn-ghost, .portal-empty .btn-cta { margin-top: 2px; }

/* ---------- Adjuntos dentro de la conversación de un ticket ---------- */
.comment-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.comment-attachment-img {
  display: block; width: 120px; height: 90px; object-fit: cover; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15); transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.comment-attachment-img:hover { transform: scale(1.03); border-color: var(--gold-400); }
.comment-attachment-file {
  display: inline-flex; align-items: center; font-size: .78rem; font-weight: 600; color: var(--gold-300);
  text-decoration: none; padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,.06);
}
.comment-attachment-file:hover { text-decoration: underline; }

/* =====================================================================
   Portal — detalle de cotización (ficha de seguimiento comercial)
   ===================================================================== */
.cot-meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.cot-meta-item {
  display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); padding: 6px 12px; border-radius: 999px;
}
.cot-meta-item svg { width: 13px; height: 13px; color: var(--gold-300); flex-shrink: 0; }

/* Línea de progreso (3 pasos reales: recibida / en revisión / atendida) */
.cot-progress { display: flex; align-items: flex-start; }
.cot-progress-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; width: 90px; text-align: center; }
.cot-progress-dot {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.15); color: rgba(255,255,255,.4);
  font-size: .78rem; font-weight: 700; transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.cot-progress-step.done .cot-progress-dot { background: var(--gold-400); border-color: var(--gold-400); color: var(--navy-950); }
.cot-progress-step.current .cot-progress-dot { border-color: var(--gold-400); color: var(--gold-300); box-shadow: 0 0 0 4px rgba(255,7,0,.15); }
.cot-progress-label { font-size: .72rem; font-weight: 600; color: rgba(255,255,255,.5); }
.cot-progress-step.done .cot-progress-label, .cot-progress-step.current .cot-progress-label { color: #fff; }
.cot-progress-line { flex: 1 1 auto; height: 2px; background: rgba(255,255,255,.12); margin-top: 15px; transition: background .3s var(--ease); }
.cot-progress-line.done { background: var(--gold-400); }
@media (max-width: 480px) { .cot-progress-step { width: 64px; } .cot-progress-label { font-size: .64rem; } }

.cot-msg-box { font-size: .88rem; color: rgba(255,255,255,.8); line-height: 1.6; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-md); padding: 14px 16px; margin: 0; }

/* Tarjeta de "próximo paso" — un color consistente por estado */
.cot-next-card { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--radius-lg); padding: 20px 22px; }
.cot-next-card svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.cot-next-title { color: #fff; font-weight: 700; font-size: .88rem; margin: 0 0 4px; }
.cot-next-text { color: rgba(255,255,255,.75); font-size: .85rem; line-height: 1.5; margin: 0; }
.cot-next-eta { color: rgba(255,255,255,.55); font-size: .78rem; margin: 8px 0 0; }
.cot-next-nuevo { background: rgba(255,7,0,.06); border: 1px solid rgba(255,7,0,.25); }
.cot-next-nuevo svg { color: var(--gold-300); }
.cot-next-proceso { background: rgba(46,107,255,.08); border: 1px solid rgba(46,107,255,.25); }
.cot-next-proceso svg { color: #7ea6ff; }
.cot-next-atendida { background: rgba(37,211,102,.08); border: 1px solid rgba(37,211,102,.25); }
.cot-next-atendida svg { color: #6ee0a0; }