:root {
  --navy: #08121e;
  --orange: #ff6a3d;
  --gray-bg: #f4f5f7;
  --border: #dfe3e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DM Sans", Arial, sans-serif;
  background: var(--gray-bg);
  color: #1c232b;
}

.topbar {
  background: var(--navy);
  color: #fff;
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand { font-weight: 700; }

.topbar nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 16px;
  opacity: 0.85;
}
.topbar nav a:hover { opacity: 1; }

.container {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 20px 60px;
}

.flash {
  background: #fff3cd;
  border: 1px solid #ffe08a;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.login-box {
  max-width: 320px;
  margin: 80px auto;
  background: #fff;
  padding: 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.login-box label { display: block; margin-bottom: 6px; font-size: 14px; }
.login-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

button, .login-box button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
button:hover { opacity: 0.92; }

.counts {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 14px;
  color: #4a5568;
}
.counts .dato-sla-riesgo { color: #8a6d1a; font-weight: 600; }
.counts .dato-sla-vencido { color: #b3441b; font-weight: 600; }

.filtros { margin-bottom: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.filtros select { padding: 8px; border-radius: 6px; border: 1px solid var(--border); }

table.tickets {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
table.tickets th, table.tickets td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}
table.tickets th { background: #eef1f4; }
table.tickets a { color: var(--navy); font-weight: 600; text-decoration: none; }
table.tickets a:hover { text-decoration: underline; }

.pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}
.pill-abierto { background: #fde2d0; color: #b3441b; }
.pill-en_progreso { background: #fff3cd; color: #8a6d1a; }
.pill-cerrado { background: #dcf3e3; color: #1c7c3f; }

.pill-sla-ok { background: #dcf3e3; color: #1c7c3f; }
.pill-sla-riesgo,
.pill-sla-en_riesgo { background: #fff3cd; color: #8a6d1a; }
.pill-sla-vencido { background: #fde2d0; color: #b3441b; }

.sla-detalle { margin: 10px 0 20px; display: flex; gap: 10px; flex-wrap: wrap; }

.meta { color: #667085; font-size: 14px; }

.cambiar-estado {
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hilo { margin: 20px 0; display: flex; flex-direction: column; gap: 12px; }
.mensaje {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.mensaje-agente { background: #eef6ff; }
.mensaje-cabecera {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #667085;
  margin-bottom: 6px;
}
.mensaje-cuerpo { white-space: pre-wrap; }

.responder textarea {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  font-family: inherit;
}
