:root {
  /* Identidad CVA (alineada a la app de la quiniela): azul royal + crema */
  --navy: #1b2a6b;
  --blue-700: #25379b;
  --blue-600: #2d49c9;
  --blue-500: #3a57e0;
  --blue-soft: #e8edfb;
  --blue-soft-2: #f0f3fc;

  --accent: #c9a227;          /* detalle calido puntual (badges/estado) */
  --ink: #181b22;
  --muted: #6b7280;
  --line: #e7e7e0;
  --bg: #f4f4ef;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(24, 33, 71, 0.06), 0 4px 14px rgba(24, 33, 71, 0.05);

  --todo: #6b7280;
  --progress: #2563eb;
  --blocked: #dc2626;
  --done: #16a34a;

  --radius: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); }

/* ── Encabezado de marca (barra blanca, estilo quiniela) ── */
.brand-header {
  background: #fff;
  color: var(--ink);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.brand-logo {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: var(--navy);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  letter-spacing: 0.5px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
}
.brand-title { font-size: 18px; font-weight: 800; line-height: 1.1; color: var(--navy); }
.brand-sub {
  font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 1px;
}

/* Etiqueta pequeña en mayusculas (kicker) */
.kicker {
  text-transform: uppercase; letter-spacing: 1.4px;
  font-size: 12px; font-weight: 700; color: var(--blue-600);
  margin: 0 0 6px;
}

/* ── Layout general ── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.card-panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 28px;
}

h1.page-title { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.4px; }
.page-intro { color: var(--muted); margin: 0 0 24px; font-size: 15px; }

/* ── Formularios ── */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 7px;
}
.field .hint { color: var(--muted); font-weight: 400; font-size: 12.5px; }

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(45, 73, 201, .15);
}
textarea { resize: vertical; min-height: 120px; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.category-option {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex; gap: 12px; align-items: flex-start;
}
.category-option:hover { border-color: var(--blue-500); }
.category-option input { position: absolute; opacity: 0; }
.category-option .emoji { font-size: 22px; line-height: 1; }
.category-option .opt-title { font-weight: 600; font-size: 14.5px; }
.category-option .opt-desc { font-size: 12px; color: var(--muted); }
.category-option.selected {
  border-color: var(--blue-600);
  background: var(--blue-soft-2);
  box-shadow: 0 0 0 1px var(--blue-600);
}

.image-drop {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.previews { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.preview-thumb {
  position: relative; width: 84px; height: 84px;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-thumb button {
  position: absolute; top: 3px; right: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.6); color: #fff;
  cursor: pointer; font-size: 13px; line-height: 1;
}

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border: none; border-radius: 10px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .05s, filter .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }
.btn-gold { background: var(--blue-soft); color: var(--blue-700); }
.btn-gold:hover { background: #dbe3fa; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--blocked); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Mensajes ── */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fdecec; color: #a01919; border: 1px solid #f5c2c2; }
.alert-ok { background: #e7f6ec; color: #11643a; border: 1px solid #b9e3c8; }

/* ── Pantalla de exito ── */
.success-screen { text-align: center; padding: 30px 10px; }
.success-screen .check {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue-600);
  display: grid; place-items: center; margin: 0 auto 18px;
  font-size: 38px;
}

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  background: var(--bg);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 18px; padding: 36px 32px;
  width: 100%; max-width: 400px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(24, 33, 71, .12);
}
.login-card .brand-logo { margin: 0 auto 16px; width: 56px; height: 56px; font-size: 20px; border-radius: 14px; }
.login-card h1 { text-align: center; font-size: 22px; margin: 0 0 4px; color: var(--navy); }
.login-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 24px; }

/* ── Board / Kanban ── */
.board-shell { min-height: 100vh; display: flex; flex-direction: column; }
.board-topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  color: var(--ink); padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.board-role-pill {
  background: var(--blue-soft); color: var(--blue-700);
  padding: 4px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
}
.board-actions { display: flex; gap: 10px; align-items: center; }
.board-user { font-size: 13.5px; color: var(--muted); }

.board-scroll { flex: 1; overflow-x: auto; padding: 24px; }
.board-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(270px, 1fr));
  gap: 16px;
  min-width: 1120px;
}
.kanban-col {
  background: #eef0f5; border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; min-height: 200px;
}
.kanban-col.drag-over { outline: 2px dashed var(--blue-500); outline-offset: -4px; }
.col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px 12px; font-weight: 700; font-size: 14px;
}
.col-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.dot-por_hacer { background: var(--todo); }
.dot-en_progreso { background: var(--progress); }
.dot-bloqueado { background: var(--blocked); }
.dot-completado { background: var(--done); }
.col-count {
  background: #fff; color: var(--muted); border-radius: 999px;
  font-size: 12px; font-weight: 700; padding: 1px 9px;
}
.col-cards { display: flex; flex-direction: column; gap: 10px; flex: 1; }

.ticket-card {
  background: #fff; border-radius: 12px; padding: 13px 14px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  cursor: grab; transition: box-shadow .15s, transform .05s;
}
.ticket-card:hover { box-shadow: 0 4px 14px rgba(24,33,71,.12); }
.ticket-card.dragging { opacity: .5; }
.ticket-card .tc-top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px;
}
.cat-badge {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .3px;
}
.cat-mantenimiento { background: #fff0d6; color: #92600a; }
.cat-deportes { background: #dce6ff; color: #1f3aa8; }
.cat-sociales { background: #ece1ff; color: #5a2fae; }
.cat-concesionario { background: #ffe1e1; color: #a01919; }
.tc-accion { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tc-desc {
  font-size: 13.5px; color: var(--ink); margin: 0 0 9px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-foot { display: flex; align-items: center; justify-content: space-between; }
.tc-date { font-size: 11.5px; color: var(--muted); }
.tc-flags { display: inline-flex; gap: 8px; }
.tc-img-flag { font-size: 11.5px; color: var(--blue-600); font-weight: 600; }
.tc-com-flag { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* ── Comentarios ── */
.comments {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 240px; overflow-y: auto;
  margin-bottom: 12px;
}
.comment {
  background: var(--blue-soft-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}
.comment-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 4px; flex-wrap: wrap;
}
.comment-author { font-size: 13px; font-weight: 700; color: var(--ink); }
.comment-role {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  color: var(--blue-700); background: var(--blue-soft); border-radius: 999px; padding: 1px 7px; margin-left: 4px;
}
.comment-date { font-size: 11.5px; color: var(--muted); }
.comment-del {
  background: none; border: none; color: var(--blocked); cursor: pointer;
  font-size: 11.5px; font-family: inherit; padding: 0;
}
.comment-del:hover { text-decoration: underline; }
.comment-body { font-size: 13.5px; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.comment-form textarea { min-height: 60px; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 28, 56, .5);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(20, 28, 56, .3);
}
.modal-head {
  padding: 20px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h2 { margin: 0; font-size: 18px; color: var(--navy); }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 22px 24px; }
.modal-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.modal-images { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.modal-images img {
  width: 140px; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in;
}
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}
.status-select-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }

.empty-hint { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 8px; }
.spinner-wrap { text-align: center; padding: 60px; color: var(--muted); }

/* ── Pestañas ── */
.tabbar {
  display: flex; gap: 4px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 20px; overflow-x: auto;
}
.tab {
  border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--muted);
  padding: 14px 16px; border-bottom: 3px solid transparent; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--blue-700); border-bottom-color: var(--blue-600); }
.tab-badge {
  background: var(--blue-soft); color: var(--blue-700);
  border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; min-width: 20px; text-align: center;
}

.pane { animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.pane-intro { color: var(--muted); font-size: 14px; max-width: 760px; margin: 0 0 18px; }

/* ── Bandeja de entrada / filas de lista ── */
.intake-list, .inbox-list { display: flex; flex-direction: column; gap: 10px; }
.intake-row, .inbox-row {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px 16px;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
}
.inbox-row.processed { opacity: .72; }
.intake-main { flex: 1; min-width: 0; }
.intake-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.intake-desc {
  margin: 0; font-size: 13.5px; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.intake-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-ghost.btn-sm { color: var(--ink); border: 1.5px solid var(--line); background: #fff; }
.btn-ghost.btn-sm:hover { background: var(--bg); }

/* ── Buzon ── */
.inbox-section { margin-bottom: 26px; }
.inbox-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; margin: 0 0 12px; color: var(--ink);
}

@media (max-width: 640px) {
  .intake-row, .inbox-row { flex-direction: column; align-items: stretch; }
  .intake-actions { justify-content: flex-end; }
}
@media (max-width: 560px) {
  .category-grid { grid-template-columns: 1fr; }
  .container { padding: 20px 14px 50px; }
  .card-panel { padding: 20px; }
}
