/* =========================================================
   Portal de Parceiros · Vero — identidade rosa + laranja
   ========================================================= */
:root {
  --pink: #E6007E;
  --pink-600: #C4006B;
  --pink-50: #FFF0F7;
  --orange: #FF6A13;
  --orange-50: #FFF4EC;
  --grad: linear-gradient(120deg, #E6007E 0%, #F2335C 45%, #FF6A13 100%);
  --grad-soft: linear-gradient(120deg, rgba(230,0,126,.10), rgba(255,106,19,.10));
  --ink: #1C1630;
  --ink-2: #3B3452;
  --muted: #6E6884;
  --line: #ECE8F2;
  --bg: #F7F5FA;
  --card: #FFFFFF;
  --side: #1C1630;
  --ok: #12A16B;
  --ok-50: #E8F7F0;
  --warn: #D98A00;
  --warn-50: #FFF6E3;
  --danger: #D7263D;
  --danger-50: #FDECEF;
  --info: #5B4BDB;
  --info-50: #EFEDFD;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28,22,48,.04), 0 6px 24px rgba(28,22,48,.06);
  --shadow-lg: 0 20px 60px rgba(28,22,48,.18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--pink); text-decoration: none; }
a:hover { color: var(--pink-600); }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .7rem; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: #F3F0F8; padding: .1em .35em; border-radius: 6px; }
.muted { color: var(--muted); }
.small, small { font-size: .82rem; }
.tiny { font-size: .78rem; }
.strong { font-weight: 700; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.inline { display: inline; }
.req { color: var(--pink); }
.ic { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; background: var(--side); color: #fff; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 30; transition: transform .25s; }
.sidebar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.4rem 1.3rem 1.2rem; color: #fff; }
.brand:hover { color: #fff; }
.brand strong { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.brand small { display: block; font-size: .72rem; opacity: .7; letter-spacing: .02em; margin-top: 3px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--grad); display: inline-grid; place-items: center; color: #fff; box-shadow: 0 6px 18px rgba(230,0,126,.35); flex-shrink: 0; }
.brand-mark .ic { width: 22px; height: 22px; }
.brand.big strong { font-size: 2rem; }
.brand.big .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
.sidebar nav { padding: .4rem .8rem; flex: 1; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.72); padding: .62rem .8rem; border-radius: 10px; font-weight: 500; margin-bottom: 2px; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: linear-gradient(120deg, rgba(230,0,126,.9), rgba(255,106,19,.85)); color: #fff; box-shadow: 0 6px 16px rgba(230,0,126,.3); }
.nav-sep { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.4); padding: 1rem .8rem .35rem; font-weight: 700; }
.side-foot { padding: 1rem 1.3rem; font-size: .75rem; color: rgba(255,255,255,.45); border-top: 1px solid rgba(255,255,255,.08); }
.main { flex: 1; margin-left: 248px; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .85rem 2rem; background: rgba(247,245,250,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.page-title { font-size: 1.2rem; font-weight: 800; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: .5rem; }
.who { display: flex; align-items: center; gap: .6rem; color: var(--ink); padding: .3rem .6rem .3rem .3rem; border-radius: 999px; }
.who:hover { background: #fff; color: var(--ink); }
.who-text strong { display: block; font-size: .86rem; line-height: 1.2; }
.who-text small { color: var(--muted); font-size: .74rem; }
.content { padding: 1.6rem 2rem 3rem; max-width: 1480px; width: 100%; }
.content.bare { padding: 0; max-width: none; }
.only-mobile, .icon-btn.only-mobile { display: none; }

.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.avatar.sm { width: 34px; height: 34px; }
.avatar.xs { width: 26px; height: 26px; font-size: .66rem; vertical-align: middle; margin-right: .3rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: 11px; padding: .62rem 1.05rem; font: inherit; font-weight: 600; cursor: pointer; transition: transform .08s, box-shadow .2s, background .2s; white-space: nowrap; text-decoration: none; line-height: 1.2; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(230,0,126,.25); }
.btn-primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(230,0,126,.35); }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover { color: #fff; background: #0E8A5B; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: #D9D3E4; color: var(--ink); background: #FCFBFE; }
.btn-ghost.danger { color: var(--danger); }
.btn-light { background: #fff; color: var(--pink); }
.btn-light:hover { color: var(--pink-600); }
.btn-sm { padding: .4rem .7rem; font-size: .84rem; border-radius: 9px; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.icon-btn { background: transparent; border: 0; width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: #fff; color: var(--pink); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn[disabled] { opacity: .3; cursor: default; }

/* ---------- Cards / layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; min-width: 0; }
.card.pad, .pad { padding: 1.3rem 1.4rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head.flat { padding: 0 0 .6rem; border: 0; }
.head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.link { font-weight: 600; font-size: .88rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.25rem; align-items: start; }
.grid-dash { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.narrow { max-width: 520px; }

.hero-band { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--grad); color: #fff; padding: 1.5rem 1.7rem; border-radius: 20px; margin-bottom: 1.25rem; position: relative; overflow: hidden; box-shadow: 0 14px 34px rgba(230,0,126,.22); }
.hero-band::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero-band h2 { font-size: 1.45rem; font-weight: 800; margin-bottom: .25rem; }
.hero-band p { margin: 0; opacity: .92; max-width: 640px; }
.hero-band .btn { position: relative; z-index: 1; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.15rem; color: var(--ink); box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(28,22,48,.1); color: var(--ink); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.kpi.k-vero::before { background: var(--pink); }
.kpi.k-parc::before { background: var(--info); }
.kpi.k-val::before { background: var(--warn); }
.kpi.k-ok::before { background: var(--ok); }
.kpi-label { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi strong { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: .2rem 0; }
.kpi-sub { font-size: .78rem; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .62rem; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge .ic { width: 13px; height: 13px; }
.st-pendente_vero { background: var(--pink-50); color: var(--pink-600); }
.st-pendente_parceiro { background: var(--info-50); color: var(--info); }
.st-aguardando_validacao { background: var(--warn-50); color: #9A6200; }
.st-fechado { background: var(--ok-50); color: var(--ok); }
.st-off { background: #F1EFF4; color: var(--muted); }
.st-erro { background: var(--danger-50); color: var(--danger); }
.st-helix { background: #F1EFF8; color: var(--ink-2); font-family: var(--mono); }
.chip { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 .4rem; border-radius: 7px; font-size: .76rem; font-weight: 700; }
.c-vero { background: var(--pink-50); color: var(--pink-600); }
.c-parc { background: var(--info-50); color: var(--info); }
.c-val { background: var(--warn-50); color: #9A6200; }
.role { font-size: .78rem; font-weight: 600; padding: .15rem .5rem; border-radius: 6px; background: #F3F0F8; color: var(--ink-2); white-space: nowrap; }
.role-vero_admin { background: var(--pink-50); color: var(--pink-600); }
.role-vero_supervisor { background: var(--orange-50); color: #B84A00; }
.age { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; white-space: nowrap; }
.age .ic { width: 14px; height: 14px; color: var(--muted); }
.age-hot { color: var(--danger); }
.age-hot .ic { color: var(--danger); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: #FCFBFD; white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid #F3F0F7; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: .5rem .8rem; font-size: .84rem; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #FDF8FB; }
.row-warn td { background: #FFFAF2; }
.ellipsis { max-width: 340px; }
.wrap-any { word-break: break-word; max-width: 420px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.2rem; border-top: 1px solid var(--line); }
.pager-links { display: flex; gap: .6rem; align-items: center; }

.empty { padding: 2.6rem 1rem; text-align: center; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; color: #CFC6DD; }
.empty.small { padding: 1.4rem; }

.partner-list { list-style: none; margin: 0; padding: .4rem; }
.partner-list a { display: grid; grid-template-columns: 1fr auto; gap: .15rem .6rem; padding: .7rem .8rem; border-radius: 10px; color: var(--ink); }
.partner-list a:hover { background: #FBF7FB; }
.pl-name { font-weight: 700; }
.pl-chips { display: flex; gap: .3rem; grid-row: span 2; align-self: center; }
.legend { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .76rem; color: var(--muted); padding: .2rem 1.2rem 1rem; }
.legend .chip { min-width: 12px; height: 12px; padding: 0; margin-left: .5rem; }

/* ---------- Toolbar / tabs ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs { display: flex; gap: .25rem; background: #fff; border: 1px solid var(--line); padding: .3rem; border-radius: 12px; flex-wrap: wrap; }
.tabs a { padding: .45rem .85rem; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: .86rem; }
.tabs a:hover { background: #F7F3F9; color: var(--ink); }
.tabs a.active { background: var(--grad); color: #fff; }
.filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.search { display: inline-flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 0 .7rem; }
.search .ic { color: var(--muted); width: 16px; }
.search input { border: 0 !important; box-shadow: none !important; padding: .55rem 0 !important; min-width: 230px; background: transparent; }

/* ---------- Forms ---------- */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=datetime-local], input[type=date], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #DDD7E6; border-radius: var(--radius-sm); padding: .62rem .8rem; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px rgba(230,0,126,.12); }
textarea { resize: vertical; min-height: 70px; }
select.sm, input.sm { width: auto; padding: .38rem .6rem; font-size: .84rem; }
.filters select, .head-actions select { width: auto; min-width: 190px; }
label { display: block; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
label > input, label > select, label > textarea { margin-top: .35rem; font-weight: 400; }
.label { display: block; font-weight: 600; font-size: .88rem; color: var(--ink-2); margin-bottom: .45rem; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; margin-top: .3rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--pink); margin: 0; }
.check.sm { font-size: .82rem; }
.form-stack { display: flex; flex-direction: column; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.form-grid h2 { margin-top: .6rem; }
.span2 { grid-column: span 2; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; padding: .8rem 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.inline-form { display: flex; gap: .4rem; margin-top: .6rem; }
.inline-form input { padding: .4rem .6rem; font-size: .84rem; }

.form-ticket { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem 1.4rem; }
.form-intro { grid-column: 1 / -1; padding-bottom: .9rem; border-bottom: 1px dashed var(--line); }
.form-intro h2 { font-size: 1.25rem; }
.field.wide, .form-actions.wide { grid-column: 1 / -1; }
.field > label { margin-bottom: .35rem; }
.choices { display: flex; flex-wrap: wrap; gap: .6rem; }
.choice { position: relative; font-weight: 500; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-flex; align-items: center; gap: .5rem; padding: .62rem 1rem; border: 1.5px solid #DDD7E6; border-radius: 12px; cursor: pointer; background: #fff; transition: all .15s; }
.choice span::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #CFC6DD; transition: all .15s; }
.choice input[type=checkbox] + span::before { border-radius: 5px; }
.choice input:checked + span { border-color: var(--pink); background: var(--pink-50); color: var(--pink-600); }
.choice input:checked + span::before { border-color: var(--pink); background: var(--pink); box-shadow: inset 0 0 0 3px #fff; }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px rgba(230,0,126,.15); }

.dropzone { position: relative; border: 2px dashed #DCCFE3; border-radius: 14px; background: #FDFBFE; transition: all .15s; }
.dropzone.drag, .dropzone:hover { border-color: var(--pink); background: var(--pink-50); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dz-text { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.4rem; text-align: center; color: var(--ink-2); pointer-events: none; }
.dz-text .ic { width: 26px; height: 26px; color: var(--pink); }
.dz-text small { color: var(--muted); }
.dz-list { list-style: none; margin: 0; padding: 0 1rem; }
.dz-list li { font-size: .84rem; padding: .35rem 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; }
.dz-list li:first-child { margin-top: -.3rem; }
.dz-list:not(:empty) { padding-bottom: .7rem; }

/* ---------- Alerts ---------- */
.alert { padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid transparent; font-size: .9rem; }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert-success { background: var(--ok-50); color: #0B6E49; border-color: #C9EBDC; }
.alert-danger { background: var(--danger-50); color: #A51C2F; border-color: #F6CBD3; }
.alert-warning { background: var(--warn-50); color: #835300; border-color: #F5DFAE; }
.alert-info { background: var(--info-50); color: #3F31B5; border-color: #D9D4FA; }
.err-box { background: var(--danger-50); color: #A51C2F; padding: .7rem; border-radius: 10px; font-size: .8rem; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }

/* ---------- Ticket ---------- */
.ticket-head { display: flex; justify-content: space-between; gap: 1.5rem; padding: 1.3rem 1.4rem; flex-wrap: wrap; position: relative; overflow: hidden; }
.ticket-head::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--grad); }
.th-main { min-width: 0; flex: 1 1 380px; }
.th-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .45rem; }
td a.mono.strong { white-space: nowrap; }
.th-proto { font-weight: 800; font-size: 1.05rem; color: var(--pink-600); }
.ticket-head h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: .2rem; }
.ticket-head p { margin: 0; font-size: .88rem; }
.th-metrics { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: .6rem; align-self: center; }
.th-metrics div { background: #FAF8FC; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; }
.th-metrics span { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.th-metrics strong { font-size: 1.08rem; font-weight: 800; }
.th-metrics .m-vero strong { color: var(--pink-600); }
.th-metrics .m-parc strong { color: var(--info); }
.th-metrics .m-val strong { color: #9A6200; }

.action-bar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.1rem; }
.action-bar:empty { display: none; }
.validate-box { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; width: 100%; background: var(--warn-50); border: 1px solid #F5DFAE; border-radius: 14px; padding: .9rem 1.1rem; }
.validate-box > div { flex: 1; min-width: 220px; }

.ticket-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.side-col .card { margin-bottom: 1rem; }
.chat-card { display: flex; flex-direction: column; overflow: hidden; }
.live-dot { font-size: .74rem; color: var(--ok); font-weight: 700; display: inline-flex; align-items: center; gap: .35rem; text-transform: uppercase; letter-spacing: .06em; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18,161,107,.5); } 70% { box-shadow: 0 0 0 8px rgba(18,161,107,0); } 100% { box-shadow: 0 0 0 0 rgba(18,161,107,0); } }
.thread { padding: 1.2rem 1.3rem; max-height: 62vh; min-height: 280px; overflow-y: auto; background:
  radial-gradient(circle at 10% 0%, rgba(230,0,126,.035), transparent 40%), radial-gradient(circle at 100% 100%, rgba(255,106,19,.04), transparent 40%), #FDFCFE; display: flex; flex-direction: column; gap: .9rem; scroll-behavior: smooth; }
.msg { display: flex; gap: .6rem; max-width: 82%; animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .avatar { width: 32px; height: 32px; font-size: .7rem; }
.msg.from-partner .avatar { background: linear-gradient(120deg, #5B4BDB, #7C6CF0); }
.msg.from-vero { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: #fff; border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: .65rem .9rem; box-shadow: 0 2px 8px rgba(28,22,48,.04); min-width: 0; }
.msg.from-vero .bubble { background: linear-gradient(135deg, #FFF0F7, #FFF4EC); border-color: #F7D5E5; border-radius: 16px 4px 16px 16px; }
.msg.internal .bubble { background: repeating-linear-gradient(135deg, #FFFBEA, #FFFBEA 10px, #FFF7DA 10px, #FFF7DA 20px); border-color: #F2DE9A; }
.meta { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; font-size: .76rem; margin-bottom: .2rem; }
.meta strong { font-size: .84rem; }
.meta .org { color: var(--muted); font-weight: 600; }
.meta time { color: var(--muted); margin-left: auto; padding-left: .5rem; }
.tag-internal { background: #F5C842; color: #5E4700; padding: .05rem .4rem; border-radius: 5px; font-weight: 700; font-size: .68rem; text-transform: uppercase; }
.text { white-space: normal; word-break: break-word; font-size: .92rem; }
.atts { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.att { display: inline-flex; align-items: center; gap: .45rem; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: .4rem .6rem; color: var(--ink); font-size: .84rem; max-width: 100%; margin: .15rem 0; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att small { color: var(--muted); white-space: nowrap; }
.att .ic { width: 15px; height: 15px; color: var(--pink); }
.att:hover { border-color: var(--pink); color: var(--ink); }
.msg-system { align-self: center; text-align: center; font-size: .78rem; color: var(--muted); background: #F3F0F8; border-radius: 999px; padding: .32rem .9rem; max-width: 92%; }
.msg-system time { margin-left: .5rem; opacity: .75; }
.status-changed { background: var(--warn-50); color: #835300; padding: .6rem 1.2rem; font-size: .86rem; border-top: 1px solid #F5DFAE; }
.composer { border-top: 1px solid var(--line); padding: .9rem 1.1rem; background: #fff; }
.composer textarea { border-radius: 12px; min-height: 76px; }
.composer.is-internal textarea { background: #FFFBEA; border-color: #F2DE9A; }
.composer-bar { display: flex; align-items: center; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }
.composer-bar .btn-primary { margin-left: auto; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-names { font-size: .8rem; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.closed-note { display: flex; align-items: center; gap: .5rem; padding: 1rem 1.3rem; background: var(--ok-50); color: #0B6E49; font-weight: 600; border-top: 1px solid #C9EBDC; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: .55rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .84rem; }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.kv.stacked { grid-template-columns: 1fr; gap: .1rem; }
.kv.stacked dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-top: .65rem; }
.kv.stacked dt:first-child { margin-top: 0; }

/* ---------- Dialog ---------- */
.dlg { border: 0; border-radius: 20px; padding: 0; width: min(560px, 94vw); box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: rgba(28,22,48,.45); backdrop-filter: blur(3px); }
.dlg form { padding: 1.5rem; }
.dlg textarea { margin: .6rem 0 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

/* ---------- Users / form builder ---------- */
.cred-box { border: 2px solid #C9EBDC; background: linear-gradient(120deg, #F3FBF7, #fff); }
.cred-box h3 { display: flex; align-items: center; gap: .5rem; color: #0B6E49; }
.cred-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: .8rem 0 .4rem; }
.cred-grid span { display: block; font-size: .76rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.cred-grid code { display: block; font-size: 1.05rem; padding: .6rem .8rem; background: #fff; border: 1px dashed #9ED9BF; cursor: pointer; margin-top: .25rem; user-select: all; }
.cred-grid code.copied { border-color: var(--ok); background: var(--ok-50); }
.perm-help { background: #FAF8FC; border-radius: 12px; padding: .8rem 1rem; font-size: .8rem; color: var(--ink-2); }
.perm-help p { margin: .2rem 0; }
.field-list { list-style: none; margin: 0; padding: 0; }
.field-list li { display: flex; align-items: center; gap: .8rem; padding: .75rem 1.2rem; border-bottom: 1px solid #F3F0F7; }
.field-list li:last-child { border-bottom: 0; }
.field-list li.inactive { opacity: .55; }
.fl-order { display: flex; flex-direction: column; }
.fl-body { flex: 1; min-width: 0; }
.fl-body strong { display: block; }
.fl-actions { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.info-card p { color: var(--ink-2); font-size: .9rem; }
.bullets { padding-left: 1.2rem; color: var(--ink-2); }
.bullets li { margin-bottom: .35rem; }

/* ---------- Sistema ---------- */
.editor-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.file-tree ul { list-style: none; margin: 0; padding: .4rem; max-height: 62vh; overflow-y: auto; }
.file-tree a { display: block; padding: .3rem .6rem; border-radius: 7px; font-family: var(--mono); font-size: .78rem; color: var(--ink-2); word-break: break-all; }
.file-tree a:hover { background: #F7F3F9; }
.file-tree a.active { background: var(--pink-50); color: var(--pink-600); font-weight: 700; }
.tree-filter { margin: .7rem .8rem 0; width: calc(100% - 1.6rem) !important; }
.new-file { display: flex; gap: .4rem; padding: .8rem; border-top: 1px solid var(--line); }
.new-file input { font-size: .8rem; padding: .4rem .6rem; font-family: var(--mono); }
textarea.code { font-family: var(--mono); font-size: .82rem; line-height: 1.55; background: #17131F; color: #F2EEF8; border-color: #17131F; tab-size: 4; white-space: pre; }
.editor-card textarea.code { border-radius: 0 0 var(--radius) var(--radius); min-height: 66vh; border: 0; }

/* ---------- Login ---------- */
.login-body { background: #fff; }
.login-split { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-hero { background: var(--grad); color: #fff; padding: 2.6rem 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::before, .login-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); }
.login-hero::before { width: 520px; height: 520px; right: -180px; bottom: -200px; }
.login-hero::after { width: 260px; height: 260px; left: -90px; top: 30%; }
.brand.light .brand-mark { background: rgba(255,255,255,.18); box-shadow: none; backdrop-filter: blur(4px); }
.hero-copy { position: relative; z-index: 1; max-width: 520px; }
.hero-copy h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.08; margin-bottom: 1rem; }
.hero-copy p { font-size: 1.05rem; opacity: .95; }
.hero-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: flex; flex-direction: column; gap: .7rem; }
.hero-points li { display: flex; gap: .7rem; align-items: center; font-weight: 600; }
.hero-points .ic { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: rgba(255,255,255,.18); }
.hero-foot { font-size: .8rem; opacity: .8; position: relative; z-index: 1; }
.login-panel { display: grid; place-items: center; padding: 2rem; background: #fff; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 1rem; }
.login-card h2 { font-size: 1.8rem; font-weight: 800; margin: 0; }
.login-card p { margin: 0; }

/* ---------- Error / install ---------- */
.error-body, .install-body { background: var(--bg); min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.error-card { max-width: 460px; padding: 2.2rem; text-align: center; }
.error-code { font-size: 4rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.install-wrap { width: 100%; max-width: 760px; }
.install-head { background: var(--grad); border-radius: 20px; padding: 1.5rem; margin-bottom: 1.25rem; color: #fff; }
.install-head .brand { padding: 0; }
.install-head .brand-mark { background: rgba(255,255,255,.2); box-shadow: none; }
.checks { list-style: none; padding: 0; margin: 0; columns: 2; }
.checks li { padding: .2rem 0; }
.checks .ok { color: var(--ok); }
.checks .no { color: var(--danger); font-weight: 700; }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-dash, .ticket-grid, .grid-side { grid-template-columns: 1fr; }
  .th-metrics { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .only-mobile, .icon-btn.only-mobile { display: inline-grid; }
  .topbar { padding: .7rem 1rem; }
  .content { padding: 1rem 1rem 2.5rem; }
  .who-text { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .form-grid, .form-ticket, .editor-grid, .cred-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .login-split { grid-template-columns: 1fr; }
  .login-hero { padding: 1.6rem; }
  .hero-copy h1 { font-size: 1.8rem; }
  .hero-points, .hero-foot { display: none; }
  .msg { max-width: 96%; }
  .hero-band { flex-direction: column; align-items: flex-start; }
  .search input { min-width: 0; }
  .checks { columns: 1; }
}
