﻿:root {
  --bg: #070d18;
  --panel: #111c31;
  --panel-2: #1b2b47;
  --text: #e9eef8;
  --muted: #9aaac7;
  --accent: #2fb2ff;
  --accent-2: #5ef0ca;
  --danger: #ff647c;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Sora", "Manrope", "Nunito Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 650px at 8% -10%, rgba(47, 178, 255, 0.18), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(94, 240, 202, 0.15), transparent 62%),
    var(--bg);
  min-height: 100vh;
}

.container { width: min(1120px, 92%); margin: 0 auto; }

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(7, 13, 24, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }

.brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: var(--text);
}

.brand span { color: var(--accent); }

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  color: #06101c;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .18s ease, filter .18s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

.btn.secondary { background: #243856; color: var(--text); }

.btn.danger { background: linear-gradient(135deg, #ff647c, #ff925c); color: #fff; }

.card {
  background: linear-gradient(180deg, rgba(27, 43, 71, 0.94), rgba(17, 28, 49, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.30);
  animation: card-in .32s ease both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid { display: grid; gap: 16px; }

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.input,
textarea,
select {
  width: 100%;
  background: #0f1a30;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
}

.input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(47, 178, 255, 0.45);
  border-color: rgba(47, 178, 255, 0.55);
}

.label { font-size: 0.9rem; color: var(--muted); margin: 0 0 6px; }

.flash { padding: 10px 12px; border-radius: 10px; margin: 0 0 12px; font-size: 0.92rem; }
.flash.error { background: rgba(255, 100, 124, 0.14); border: 1px solid rgba(255, 100, 124, 0.35); }
.flash.success { background: rgba(94, 240, 202, 0.16); border: 1px solid rgba(94, 240, 202, 0.35); }

.table { width: 100%; border-collapse: collapse; }
.table th,
.table td { padding: 12px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.table th { color: var(--muted); font-size: 0.86rem; font-weight: 700; }

.status {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}
.status.cerrado { background: rgba(255, 100, 124, 0.18); color: #ff9fb0; }
.status.abierto { background: rgba(94, 240, 202, 0.2); color: #aff5e2; }
.status.en_proceso,
.status.nuevo,
.status.esperando_cliente { background: rgba(47, 178, 255, 0.2); color: #b2e3ff; }

.messages { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.msg { max-width: 76%; padding: 10px 12px; border-radius: 12px; line-height: 1.45; }
.msg.customer { align-self: flex-end; background: linear-gradient(135deg, #278fd6, #23c8cf); color: #fff; }
.msg.agent,
.msg.system { align-self: flex-start; background: #1b2b47; }
.msg-meta { margin-top: 6px; font-size: 0.78rem; color: var(--muted); }

.footer-note { color: var(--muted); font-size: .85rem; text-align: center; margin-top: 26px; }

@media (max-width: 860px) {
  .grid.two { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
}
