/* ===== Sistema de Tickets - Informática Precisa Frozen ===== */
:root {
  --brand-900: #006b80;
  --brand-700: #007f91;
  --brand-500: #0098a8;
  --brand-400: #00b3bd;
  --brand-300: #00cfd6;
  --cyan: #00ecec;

  --ink: #031319;
  --ice: #f2fafc;
  --frost: #dff3f7;
  --text: #0c2a33;
  --muted: #5a7780;
  --line: #d3e6eb;
  --warm: #ffb35c;

  --grad: linear-gradient(100deg, var(--cyan), var(--brand-300) 40%, var(--brand-500));
  --radius: 14px;
  --shadow: 0 16px 40px -20px rgba(3, 19, 25, .25);
  --head: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--body); color: var(--text);
  background: var(--ice); line-height: 1.5;
  overflow-wrap: anywhere;
}
h1, h2, h3, h4 { font-family: var(--head); margin: 0 0 .5em; letter-spacing: -.01em; }
a { color: var(--brand-700); }
.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }

/* ---- layout de autenticación (login / activar) ---- */
.auth-page {
  min-height: 100svh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 10% -10%, var(--brand-300) 0%, transparent 60%),
              radial-gradient(1000px 500px at 110% 110%, var(--brand-500) 0%, transparent 55%),
              var(--ink);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px; min-width: 0; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px 28px;
}
.auth-card img.logo { height: 36px; margin-bottom: 18px; }
.auth-card h1 { font-size: 22px; }
.auth-card p.lead { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* ---- formularios ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font: 14px var(--body); color: var(--text); background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(0,152,168,.15);
}
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 18px; border-radius: 10px; border: 0;
  font: 700 14px var(--body); cursor: pointer; text-decoration: none;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn--primary { background: var(--grad); color: var(--ink); box-shadow: 0 10px 24px -10px rgba(0,152,168,.55); }
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--brand-700); border: 1px solid var(--line); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.alert--error { background: #fdecea; color: #b3261e; border: 1px solid #f6c6c2; }
.alert--ok { background: #e8f8ee; color: #1e7e42; border: 1px solid #bfe9cd; }

.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }

/* ---- badges de prioridad (colores definidos por PHP vía etiqueta_prioridad()) ---- */
.badge-prioridad, .badge-estado {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff;
  white-space: nowrap;
}

/* ---- barra superior / layout de app ---- */
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; row-gap: 10px; }
.topbar nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; row-gap: 10px; }
.topbar nav a { color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; }
.topbar nav a:hover { color: var(--brand-700); }
.topbar .brand { font-family: var(--head); font-weight: 700; color: var(--brand-900); font-size: 17px; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.topbar .brand-logo { height: 32px; width: auto; display: block; }
.topbar .usuario { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .topbar nav { width: 100%; justify-content: flex-start; }
  .topbar .usuario { width: 100%; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
}
.main { padding: 28px 0 60px; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }

.btn-sm { width: auto; padding: 8px 16px; font-size: 13px; }
.btn--danger { background: #fdecea; color: #b3261e; border: 1px solid #f6c6c2; }
.btn--success { background: #e8f8ee; color: #1e7e42; border: 1px solid #bfe9cd; }

.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }

.tabla { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tabla th, .tabla td { padding: 12px 14px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.tabla th { background: var(--frost); color: var(--brand-900); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
.tabla tbody tr:hover { background: var(--ice); }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla a.folio { font-weight: 700; color: var(--brand-700); }
.tabla-vacia { padding: 30px; text-align: center; color: var(--muted); font-size: 14px; }

.detalle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 18px 0; }
.detalle-grid .campo .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.detalle-grid .campo .v { font-size: 14.5px; font-weight: 600; }

.descripcion-box { background: var(--ice); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; white-space: pre-wrap; font-size: 14px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.timeline li:last-child { border-bottom: none; }
.timeline .meta { color: var(--muted); font-size: 12px; }

.acciones-ticket { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.acciones-ticket form { flex: 1; min-width: 220px; }
.acciones-ticket .btn { width: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat-card .num { font-family: var(--head); font-size: 28px; font-weight: 700; color: var(--brand-900); }
.stat-card .lbl { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.pill-select { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill-select a { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--brand-700); border: 1px solid var(--line); background: #fff; }
.pill-select a.activo { background: var(--grad); color: var(--ink); border-color: transparent; }

/* ---- asistente: burbujas de chat ---- */
.chat-bubble { max-width: 85%; padding: 12px 16px; border-radius: 14px; font-size: 14.5px; margin-bottom: 14px; line-height: 1.45; }
.chat-bubble--bot { background: var(--frost); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble--user { background: var(--grad); color: var(--ink); margin-left: auto; border-bottom-right-radius: 4px; font-weight: 600; }
.solucion-card { background: var(--ice); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.solucion-card h3 { font-size: 15px; margin-bottom: 8px; color: var(--brand-900); }
