/* Correos Heroturfs — borradores de respuesta.
 *
 * Paleta y tipografía: fuente única en shared/static/rols-tokens.css. El
 * layout (sidebar, topbar) está calcado del de producción y Numbers para que
 * las secciones se lean como la misma casa; esta app tampoco carga Tailwind
 * por CDN. */
@import url("/shared/rols-tokens.css");

/* ============================ Base ============================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: #2a2a2a;
  min-height: 100vh;
  font-size: 16px;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ============================ Layout ============================ */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 16rem; flex-shrink: 0; display: flex; flex-direction: column;
  padding: 3rem 1rem 1.5rem;
  background: var(--bg-sidebar); color: var(--text-sidebar);
}
.sidebar-logo { padding: 0 0.5rem; margin-bottom: 3rem; }
.rols-logo { width: 150px; height: auto; display: block; filter: brightness(0) invert(1); }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-nav-pie { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid rgba(255,255,255,0.12); }
.sidebar a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.85rem; border-radius: 0.5rem;
  font-size: 0.875rem; color: var(--text-sidebar); transition: background 0.15s;
}
.sidebar a:hover { background: var(--bg-sidebar-hover); }
.sidebar a.active { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); font-weight: 500; }
.sidebar a .check {
  width: 16px; height: 16px; border: 1.5px solid #888879; border-radius: 4px;
  display: inline-block; flex-shrink: 0;
}
.sidebar a.active .check { background: var(--accent); border-color: var(--accent); }
.main { flex-grow: 1; min-width: 0; padding: 2.5rem 2.5rem 2rem; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.breadcrumb { font-size: 0.8rem; color: #9a9a9a; margin-bottom: 0.25rem; }
.breadcrumb a:hover { color: var(--accent); }
.titulo { font-size: 1.875rem; font-weight: 300; color: #323F49; line-height: 1.2; }
.titulo-fuerte { font-weight: 500; border-bottom: 2px solid #323F49; padding-bottom: 1px; }
.subtitulo { font-size: 0.85rem; color: #7a7a7a; margin-top: 0.5rem; max-width: 40rem; line-height: 1.55; }
.topbar-acciones { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* ============================ Piezas ============================ */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; }

.btn-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--accent); color: #fff; border-radius: 12px;
  padding: 0.65rem 1.2rem; font-size: 0.85rem; font-weight: 600;
  transition: background 0.15s;
}
.btn-accent:hover { background: var(--accent-hover); }
.btn-accent:disabled { background: #b9c6d0; cursor: not-allowed; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1rem; border-radius: 12px; font-size: 0.82rem; color: #6a6a6a;
}
.btn-ghost:hover { background: var(--bg-page); color: #323F49; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  font-size: 0.8rem; color: #4a5a66; transition: border-color 0.15s, color 0.15s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-hover); }
.btn-outline svg { width: 15px; height: 15px; }

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff;
  animation: girar 0.7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.input-line, select.input-line {
  width: 100%; padding: 0.5rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--border); background: #fff; font-size: 0.85rem;
  color: #2a2a2a; transition: border-color 0.15s, box-shadow 0.15s;
}
.input-line:focus, .area:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,94,148,0.12);
}
.area {
  width: 100%; padding: 0.65rem 0.85rem; border-radius: 12px;
  border: 1px solid var(--border); background: #fff;
  font-size: 0.85rem; line-height: 1.6; color: #2a2a2a;
  resize: vertical; min-height: 4.5rem;
}
.area-alta { min-height: 16rem; }
/* El borrador se lee como un correo: monoespaciado no, pero con aire. */
.area-salida { min-height: 20rem; line-height: 1.65; }

/* ============================ Las dos columnas ============================ */
.cols { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(27rem, 1fr)); align-items: start; }
.panel { padding: 1.2rem 1.35rem; display: flex; flex-direction: column; gap: 0.8rem; }
.panel-cab { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-tit { font-size: 0.95rem; font-weight: 600; color: #323F49; }
.fila-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.campo { display: flex; flex-direction: column; gap: 0.25rem; }
.campo-ancho { width: 100%; }
.campo-t { font-size: 0.72rem; font-weight: 500; color: #7a7a7a; }
.acciones { display: flex; align-items: center; gap: 0.5rem; }

.salida-vacia {
  border: 1px dashed var(--border); border-radius: 12px;
  padding: 2.5rem 1.5rem; text-align: center; color: #9aa7b0; font-size: 0.88rem;
}
.salida-vacia .chico {
  font-size: 0.76rem; margin-top: 0.6rem; line-height: 1.6;
  max-width: 26rem; margin-left: auto; margin-right: auto;
}
.ayuda { font-size: 0.72rem; color: #9aa7b0; line-height: 1.55; }

/* Lo que el modelo ha dejado a medias a propósito. En rojo de marca porque es
   lo único que impide enviar el correo tal cual. */
.aviso-linea {
  background: #FFF4F0; border: 1px solid #ffd6ca; border-radius: 10px;
  padding: 0.55rem 0.8rem; font-size: 0.8rem; color: #a33;
}

/* ============================ Modal de hechos ============================ */
.modal-fondo {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(50, 63, 73, 0.35);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.modal { width: min(46rem, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.modal-cab {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.2rem 1.35rem 0.9rem; border-bottom: 1px solid var(--border);
}
.modal-tit { font-size: 1rem; font-weight: 600; color: #323F49; }
.modal-sub { font-size: 0.78rem; color: #7a7a7a; margin-top: 0.3rem; line-height: 1.55; max-width: 34rem; }
.modal-x { font-size: 1.5rem; line-height: 1; color: #9aa7b0; padding: 0 0.25rem; }
.modal-x:hover { color: #323F49; }
.modal-cuerpo { padding: 1rem 1.35rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.7rem; }
.modal-pie {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.35rem; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.modal-pie-btns { display: flex; align-items: center; gap: 0.6rem; }

/* Título y texto en la columna ancha, la equis en la estrecha. Las tres
   posiciones van EXPLÍCITAS: dejando que el grid colocara solo, la equis
   (que ocupa dos filas) se metía en la primera columna y echaba el título
   a la derecha. */
.hecho {
  display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 0.6rem;
  background: var(--bg-page); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.7rem 0.8rem;
}
.hecho .hecho-tit { grid-column: 1; grid-row: 1; }
.hecho .hecho-txt { grid-column: 1; grid-row: 2; min-height: 5rem; }
.hecho-x {
  grid-column: 2; grid-row: 1; align-self: start;
  font-size: 1.25rem; line-height: 1; color: #9aa7b0; padding: 0.1rem 0.3rem;
}
.hecho-x:hover { color: var(--hero-red, #E3332B); }
.vacio { padding: 1.5rem; text-align: center; color: #9aa7b0; font-size: 0.85rem; }

/* ============================ Toast ============================ */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(1rem);
  background: #323F49; color: #fff; border-radius: 999px;
  padding: 0.6rem 1.2rem; font-size: 0.83rem;
  opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .main { padding: 1.25rem; }
}
