/* ============================================================
   NAYAH DESIGN SYSTEM — comunidad 55+ · "SPACE FOR CURIOSITY"
   Estética editorial, accesible (texto grande), paleta oficial.
   ============================================================ */

:root {
  /* Paleta oficial Nayah */
  --terracota: #BC5B43;
  --terracota-dark: #9E4632;
  --crema: #F4EFE0;
  --crema-soft: #FBF8F1;
  --petroleo: #1C4854;
  --petroleo-dark: #12333C;
  --ocre: #C69A4E;
  --ocre-soft: #E3C98C;
  --azulgris: #A3B8C2;
  --azulgris-soft: #D6E0E5;
  --negro: #1A1A1A;
  --gris: #6B6B6B;
  --gris-claro: #E7E2D6;
  --blanco: #FFFFFF;

  --ok: #4B8A6F;
  --warn: #C69A4E;
  --danger: #BC5B43;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 10px rgba(28,72,84,.06);
  --shadow: 0 10px 40px rgba(28,72,84,.10);
  --shadow-lg: 0 24px 70px rgba(28,72,84,.16);

  --font-title: 'Jost', 'Montserrat', system-ui, sans-serif;
  --font-body: 'Montserrat', system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.16,.84,.44,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--negro);
  background: var(--crema);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .title {
  font-family: var(--font-title);
  font-weight: 500;
  letter-spacing: .04em;
  line-height: 1.15;
  margin: 0 0 .5em;
}
h1 { font-size: 2.6rem; text-transform: uppercase; letter-spacing: .08em; }
h2 { font-size: 1.9rem; text-transform: uppercase; letter-spacing: .06em; }
h3 { font-size: 1.25rem; letter-spacing: .05em; }

a { color: var(--terracota); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--terracota-dark); }

.eyebrow {
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .72rem;
  color: var(--ocre);
  font-weight: 600;
}

.muted { color: var(--gris); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }

/* ---------- NAVBAR ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,239,224,.86);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--gris-claro);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-title);
  font-size: 1.5rem; letter-spacing: .32em; text-transform: uppercase; color: var(--petroleo);
  font-weight: 600; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--terracota);
  box-shadow: 0 0 0 4px rgba(188,91,67,.18); }
.nav-links { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.nav-links a {
  padding: 9px 16px; border-radius: 40px; color: var(--petroleo);
  font-weight: 500; font-size: .95rem; letter-spacing: .02em; transition: all .25s var(--ease);
}
.nav-links a:hover { background: var(--azulgris-soft); }
.nav-links a.active { background: var(--petroleo); color: var(--crema); }
.nav-user { display: flex; align-items: center; gap: 10px; margin-left: 8px;
  padding-left: 18px; border-left: 1px solid var(--gris-claro); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; letter-spacing: .02em;
  padding: 14px 28px; border-radius: 40px; border: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--terracota); color: #fff; box-shadow: 0 8px 24px rgba(188,91,67,.3); }
.btn-primary:hover { background: var(--terracota-dark); box-shadow: 0 12px 30px rgba(188,91,67,.4); color:#fff; }
.btn-dark { background: var(--petroleo); color: var(--crema); }
.btn-dark:hover { background: var(--petroleo-dark); color: var(--crema); }
.btn-ghost { background: transparent; color: var(--petroleo); border: 1.5px solid var(--azulgris); }
.btn-ghost:hover { background: var(--azulgris-soft); }
.btn-block { width: 100%; }
.btn-lg { padding: 17px 34px; font-size: 1.08rem; }

/* ---------- CARDS ---------- */
.card {
  background: var(--blanco); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 28px; transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  border: 1px solid rgba(163,184,194,.22);
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-pad-lg { padding: 40px; }
.card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-title h3 { margin: 0; color: var(--petroleo); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
@media (max-width: 900px){ .grid-2,.grid-3,.grid-4{ grid-template-columns:1fr; } }

/* ---------- AVATAR ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-family: var(--font-title); font-weight: 600;
  letter-spacing: .04em; flex-shrink: 0; box-shadow: 0 6px 18px rgba(28,72,84,.18);
}
.avatar-sm { width: 46px; height: 46px; font-size: 1rem; }
.avatar-md { width: 66px; height: 66px; font-size: 1.4rem; }
.avatar-lg { width: 110px; height: 110px; font-size: 2.4rem; }

/* ---------- ICON CIRCLE (línea delgada) ---------- */
.icon-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid var(--ocre); color: var(--petroleo); background: var(--crema-soft);
}
.icon-circle svg { width: 22px; height: 22px; stroke-width: 1.6; }

/* ---------- BADGES / PILLS ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px;
  border-radius: 30px; font-size: .8rem; font-weight: 600; letter-spacing: .03em;
}
.badge-active { background: rgba(75,138,111,.14); color: var(--ok); }
.badge-remission { background: rgba(198,154,78,.16); color: var(--ocre); }
.badge-severe { background: rgba(188,91,67,.14); color: var(--terracota); }
.badge-moderate { background: rgba(198,154,78,.16); color: #a9822f; }
.badge-mild { background: rgba(163,184,194,.24); color: var(--petroleo); }
.badge-neutral { background: var(--gris-claro); color: var(--gris); }

/* ---------- TABLES ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-family: var(--font-title); text-transform: uppercase;
  letter-spacing: .08em; font-size: .74rem; color: var(--petroleo); font-weight: 600;
  padding: 12px 14px; border-bottom: 2px solid var(--azulgris-soft);
}
.table td { padding: 14px; border-bottom: 1px solid var(--gris-claro); vertical-align: top; }
.table tbody tr { transition: background .2s var(--ease); }
.table tbody tr:hover { background: var(--crema-soft); }
.table-data th { background: rgba(163,184,194,.12); }

/* ---------- STAT TILE ---------- */
.stat { text-align: left; }
.stat .num { font-family: var(--font-title); font-size: 2.8rem; color: var(--terracota);
  line-height: 1; letter-spacing: .02em; }
.stat .lbl { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem;
  color: var(--gris); font-weight: 600; margin-top: 8px; }

/* ---------- CONSENT TOGGLE ---------- */
.switch { position: relative; display: inline-block; width: 52px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--azulgris);
  border-radius: 30px; transition: .3s var(--ease);
}
.slider:before {
  content: ""; position: absolute; height: 22px; width: 22px; left: 4px; bottom: 4px;
  background: #fff; border-radius: 50%; transition: .3s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--terracota); }
.switch input:checked + .slider:before { transform: translateX(22px); }

/* ---------- SPARKLINE / MINI CHART ---------- */
.spark { width: 100%; height: 60px; }
.vital-card { display: flex; flex-direction: column; gap: 10px; }
.vital-head { display: flex; align-items: baseline; justify-content: space-between; }
.vital-val { font-family: var(--font-title); font-size: 2rem; color: var(--petroleo); }
.vital-val small { font-size: .9rem; color: var(--gris); font-weight: 400; margin-left: 4px; }
.vital-name { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem;
  color: var(--gris); font-weight: 600; }

/* ---------- HERO ---------- */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, var(--petroleo) 0%, var(--petroleo-dark) 100%);
  color: var(--crema); padding: 64px 56px;
}
.hero:after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 340px; height: 340px;
  border-radius: 50%; border: 1.5px solid rgba(198,154,78,.4);
}
.hero:before {
  content: ""; position: absolute; right: 40px; bottom: -120px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(188,91,67,.5), transparent 70%);
}
.hero h1 { color: var(--crema); position: relative; }
.hero .tagline { font-family: var(--font-title); letter-spacing: .3em; text-transform: uppercase;
  color: var(--ocre-soft); font-size: .8rem; }

/* ---------- SECTION HEADER ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between;
  margin: 8px 0 26px; gap: 20px; flex-wrap: wrap; }
.section-head h2 { color: var(--petroleo); margin: 0; }

/* ---------- SEARCH ---------- */
.search {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 40px;
  padding: 4px 6px 4px 22px; box-shadow: var(--shadow-sm); border: 1px solid var(--gris-claro);
  max-width: 460px;
}
.search input { border: none; outline: none; flex: 1; font-size: 1rem; font-family: var(--font-body);
  background: transparent; padding: 12px 0; color: var(--negro); }
.search svg { width: 20px; height: 20px; color: var(--gris); }

/* ---------- FIELD ---------- */
.field { margin-bottom: 20px; }
.field label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--petroleo); font-weight: 600; margin-bottom: 8px; }
.input {
  width: 100%; padding: 15px 18px; border-radius: var(--radius-sm); font-size: 1.05rem;
  border: 1.5px solid var(--gris-claro); font-family: var(--font-body); background: #fff;
  transition: border .2s var(--ease), box-shadow .2s var(--ease);
}
.input:focus { outline: none; border-color: var(--terracota); box-shadow: 0 0 0 4px rgba(188,91,67,.12); }

/* ---------- PILLARS ---------- */
.pillars { display: flex; flex-wrap: wrap; gap: 10px; }
.pillar { padding: 8px 18px; border: 1.5px solid var(--ocre); border-radius: 40px;
  font-family: var(--font-title); text-transform: uppercase; letter-spacing: .16em;
  font-size: .74rem; color: var(--petroleo); }

/* ---------- FOOTER ---------- */
.footer { margin-top: 80px; padding: 40px 0; border-top: 1px solid var(--gris-claro);
  color: var(--gris); font-size: .88rem; text-align: center; }

.fade-up { animation: fadeUp .6s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.mt-0{margin-top:0}.mt-1{margin-top:12px}.mt-2{margin-top:24px}.mt-3{margin-top:40px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:12px}.mb-2{margin-bottom:24px}
.flex{display:flex}.items-center{align-items:center}.justify-between{justify-content:space-between}
.gap-1{gap:12px}.gap-2{gap:24px}.wrap{flex-wrap:wrap}

/* ============================================================
   SISTEMA DE TICKETS — bandeja, conversación tipo chat, timeline
   (módulo T2 · asistencia a miembros)
   ============================================================ */

/* ---------- INBOX TABS (conteos por estatus) ---------- */
.tk-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 24px; }
.tk-tab {
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 20px;
  border-radius: 40px; border: 1.5px solid var(--gris-claro); background: #fff;
  color: var(--petroleo); font-weight: 600; font-size: .92rem; letter-spacing: .02em;
  transition: all .25s var(--ease); cursor: pointer;
}
.tk-tab:hover { border-color: var(--azulgris); background: var(--crema-soft); color: var(--petroleo); }
.tk-tab.active { background: var(--petroleo); color: var(--crema); border-color: var(--petroleo); }
.tk-tab .n { font-family: var(--font-title); font-size: 1rem; opacity: .9; }
.tk-tab.active .n { color: var(--ocre-soft); }

/* ---------- INBOX ROWS ---------- */
.tk-row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center;
  padding: 18px 22px; background: #fff; border-radius: var(--radius-sm);
  border: 1px solid rgba(163,184,194,.22); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  text-decoration: none; color: inherit; margin-bottom: 12px;
}
.tk-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.tk-row .tk-cat { font-size: 1.7rem; text-align: center; }
.tk-row h3 { margin: 0 0 4px; color: var(--petroleo); font-size: 1.12rem; letter-spacing: .02em; }
.tk-row .tk-meta { color: var(--gris); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.tk-row .tk-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.tk-assigned { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--petroleo); font-weight: 600; }
.tk-assigned .bot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ocre); box-shadow: 0 0 0 3px rgba(198,154,78,.2); }
.tk-assigned .human-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--petroleo); box-shadow: 0 0 0 3px rgba(28,72,84,.15); }

/* ---------- CONVERSACIÓN (CHAT) ---------- */
.tk-conv { display: flex; flex-direction: column; gap: 18px; padding: 8px 4px 20px; }
.tk-bubble-row { display: flex; gap: 12px; align-items: flex-end; max-width: 78%; }
.tk-bubble-row.right { margin-left: auto; flex-direction: row-reverse; }
.tk-bubble {
  padding: 15px 20px; border-radius: 20px; font-size: 1.05rem; line-height: 1.55;
  box-shadow: var(--shadow-sm); position: relative;
}
.tk-bubble .who { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 700; margin-bottom: 5px; opacity: .8; }
.tk-bubble .when { display: block; font-size: .74rem; margin-top: 7px; opacity: .6; }
/* miembro (izquierda, crema) */
.tk-bubble.member { background: #fff; border: 1px solid var(--gris-claro); border-bottom-left-radius: 6px; color: var(--negro); }
.tk-bubble.member .who { color: var(--petroleo); }
/* staff (derecha, petróleo) */
.tk-bubble.staff { background: var(--petroleo); color: var(--crema); border-bottom-right-radius: 6px; }
.tk-bubble.staff .who { color: var(--ocre-soft); }
/* bot (izquierda, ocre suave) */
.tk-bubble.bot { background: var(--crema-soft); border: 1.5px solid var(--ocre-soft); border-bottom-left-radius: 6px; color: var(--negro); }
.tk-bubble.bot .who { color: #a9822f; }
/* sistema (centrado, discreto) */
.tk-sys { align-self: center; text-align: center; background: var(--gris-claro); color: var(--gris);
  padding: 7px 16px; border-radius: 30px; font-size: .82rem; letter-spacing: .02em; }
.tk-attach { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 14px;
  background: rgba(28,72,84,.06); border-radius: 12px; font-size: .88rem; color: var(--petroleo); font-weight: 600; }
.tk-attach svg { width: 16px; height: 16px; }

/* ---------- COMPOSER ---------- */
.tk-composer { display: flex; gap: 12px; align-items: flex-end; margin-top: 18px;
  background: #fff; border: 1px solid var(--gris-claro); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.tk-composer textarea { flex: 1; border: none; outline: none; resize: none; font-family: var(--font-body);
  font-size: 1.05rem; line-height: 1.5; background: transparent; color: var(--negro); min-height: 48px; }

/* ---------- DETALLE SIDEBAR ---------- */
.tk-side { display: flex; flex-direction: column; gap: 16px; }
.tk-side .row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--gris-claro); }
.tk-side .row:last-child { border-bottom: none; }
.tk-side .k { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--gris); font-weight: 600; }
.tk-side .v { font-weight: 600; color: var(--petroleo); text-align: right; }

.tk-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
@media (max-width: 900px){ .tk-layout { grid-template-columns: 1fr; } }
