/* ============================================================
   ABtrico · by ABstudio Maker
   Paleta: troque as variáveis abaixo para mudar a identidade.
   ============================================================ */
:root {
  --primary: #0E7C66;
  --primary-600: #0B6A57;
  --primary-700: #085244;
  --primary-50: #E8F4F0;
  --primary-100: #CFE8E0;
  --accent: #C8893A;
  --ink: #141A21;
  --ink-2: #3A434E;
  --muted: #6B7480;
  --line: #E3E6E8;
  --line-2: #EEF0F1;
  --bg: #F5F6F4;
  --card: #FFFFFF;
  --side: #12181E;
  --side-2: #1B232B;
  --side-text: #B9C2CB;
  --ok: #15803D;
  --ok-50: #EAF6EE;
  --warn: #B45309;
  --warn-50: #FDF4E7;
  --danger: #B91C1C;
  --danger-50: #FCECEC;
  --info: #1D4ED8;
  --info-50: #EBF1FD;
  --wa: #1FA855;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 26, 33, .05), 0 2px 8px rgba(20, 26, 33, .04);
  --shadow-lg: 0 12px 40px rgba(20, 26, 33, .18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0; }
img { max-width: 100%; }
.ic { flex-shrink: 0; vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 236px; background: var(--side); color: var(--side-text); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .2s; }
.brand { display: block; padding: 20px 20px 16px; }
.brand img { height: 30px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: var(--side-text); cursor: pointer; font-weight: 500; list-style: none; margin-bottom: 2px; }
.nav-link::-webkit-details-marker { display: none; }
.nav-link span { flex: 1; }
.nav-link:hover { background: var(--side-2); color: #fff; }
.nav-link.is-active { background: var(--primary); color: #fff; }
.nav-group[open] > summary .ic:last-child { transform: rotate(90deg); }
.nav-group summary .ic:last-child { transition: transform .15s; opacity: .6; }
.nav-sub { display: flex; flex-direction: column; padding: 2px 0 6px 40px; }
.nav-sub a { color: var(--side-text); padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.nav-sub a:hover { color: #fff; background: var(--side-2); }
.nav-sub a.is-current { color: #fff; background: rgba(255, 255, 255, .08); }
.sidebar-foot { padding: 14px 20px; font-size: 11px; color: #6E7882; border-top: 1px solid var(--side-2); }
.main { flex: 1; margin-left: 236px; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-title { flex: 1; font-weight: 600; font-size: 15px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user .who { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-user small { color: var(--muted); font-size: 12px; }
.content { padding: 26px 28px 80px; max-width: 1400px; width: 100%; }
.sidebar-backdrop { display: none; }
.only-mobile { display: none !important; }

/* ---------- Elements ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-50); color: var(--primary-700); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; background: var(--primary); color: #fff; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--primary-600); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: var(--card); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-soft { background: var(--primary-50); color: var(--primary-700); }
.btn-soft:hover { background: var(--primary-100); color: var(--primary-700); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #991B1B; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #F1C9C9; }
.btn-danger-ghost:hover { background: var(--danger-50); color: var(--danger); }
.btn-wa { background: var(--wa); }
.btn-wa:hover { background: #178F47; }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #000; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.span2 { grid-column: span 2; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.green { color: var(--ok); } .red { color: var(--danger); }
.hidden { display: none !important; }

/* KPIs */
.kpi { padding: 18px 20px; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.kpi-label .ic { color: var(--primary); }
.kpi-value { font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.accent { border-top: 3px solid var(--primary); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.req::after { content: " *"; color: var(--danger); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input-sm { height: 32px; font-size: 13px; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon .input { padding-left: 34px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 12px; background: #CDD2D6; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font-size: 13px; user-select: none; }
.chip input { display: none; }
.chip:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); font-weight: 600; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #FAFBFA; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFBFA; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user small { display: block; color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-warn { background: var(--warn-50); color: var(--warn); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-primary { background: var(--primary-50); color: var(--primary-700); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.alert-ok { background: var(--ok-50); color: var(--ok); border-color: #CBE8D4; }
.alert-erro { background: var(--danger-50); color: var(--danger); border-color: #F3CFCF; }
.alert-info { background: var(--info-50); color: var(--info); border-color: #D2DEFA; }
.alert-warn { background: var(--warn-50); color: var(--warn); border-color: #F4DDBB; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--primary-700); border-color: var(--primary); }
.seg { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg a, .seg button { padding: 6px 12px; border-radius: 6px; color: var(--ink-2); font-weight: 600; font-size: 12.5px; border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.seg .is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(15, 20, 25, .5); display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 100; overflow-y: auto; }
.modal.is-open { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); animation: pop .15s ease-out; }
.modal-lg { max-width: 820px; }
.modal-sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { color: var(--primary); opacity: .7; margin-bottom: 10px; }
.empty h4 { color: var(--ink); margin-bottom: 6px; font-size: 15px; }

.video-wrap { position: relative; padding-top: 56.25%; border-radius: 8px; overflow: hidden; background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.help-fab { position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-lg); z-index: 50; }
.help-fab:hover { background: var(--primary); }

.toast { position: fixed; right: 22px; bottom: 80px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 200; max-width: 360px; animation: pop .15s; }
.toast.err { background: var(--danger); }

/* Quick actions */
.quick { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); transition: border-color .15s, transform .15s; }
.quick:hover { border-color: var(--primary); color: var(--ink); transform: translateY(-1px); }
.quick .qi { width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.quick strong { display: block; }
.quick small { color: var(--muted); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Agenda ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-toolbar .cal-title { font-weight: 700; font-size: 16px; margin: 0 8px; min-width: 160px; text-transform: capitalize; }
.cal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: 56px repeat(var(--days, 7), 1fr); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 10px 4px; text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.cal-head b { display: block; font-size: 19px; color: var(--ink); margin-top: 2px; }
.cal-head .today b { background: var(--primary); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; margin: 2px auto 0; font-size: 15px; }
.cal-body { display: grid; grid-template-columns: 56px repeat(var(--days, 7), 1fr); position: relative; max-height: 68vh; overflow-y: auto; }
.cal-hours div { height: 52px; font-size: 11px; color: var(--muted); text-align: right; padding: 0 8px; transform: translateY(-7px); }
.cal-col { position: relative; border-left: 1px solid var(--line-2); }
.cal-col.today { background: #FAFDFC; }
.cal-slot { height: 26px; border-bottom: 1px dashed var(--line-2); cursor: pointer; }
.cal-slot:nth-child(2n) { border-bottom: 1px solid var(--line-2); }
.cal-slot:hover { background: var(--primary-50); }
.cal-ev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 4px 6px; font-size: 11.5px; color: #fff; overflow: hidden; cursor: pointer; line-height: 1.3; border-left: 3px solid rgba(0, 0, 0, .2); }
.cal-ev b { display: block; font-size: 12px; }
.cal-ev.cancelado { opacity: .45; text-decoration: line-through; }
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-month .mday { min-height: 104px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; cursor: pointer; }
.cal-month .mday.out { background: #FAFBFA; color: var(--muted); }
.cal-month .mday .n { font-weight: 600; font-size: 12px; }
.cal-month .mday.today .n { color: var(--primary); }
.cal-month .mev { font-size: 11px; padding: 2px 5px; border-radius: 4px; color: #fff; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; }
.slot-grid button { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; }
.slot-grid button.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.slot-grid button:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.wa-preview { background: #E5DDD5; border-radius: 8px; padding: 16px; }
.wa-bubble { background: #DCF8C6; padding: 10px 12px; border-radius: 8px 0 8px 8px; margin-left: auto; max-width: 92%; white-space: pre-wrap; font-size: 13.5px; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors label { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.colors input { display: none; }
.colors label:has(input:checked) { box-shadow: 0 0 0 2px var(--ink); }

/* ---------- Anamnese / builder ---------- */
.form-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; display: flex; flex-direction: column; gap: 10px; }
.form-card .tag { align-self: flex-start; }
.form-card ul { margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 13px; }
.form-card ul li::before { content: "✓ "; color: var(--ok); }
.builder-item { border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 12px; margin-bottom: 10px; display: grid; grid-template-columns: 24px 1fr 170px auto; gap: 10px; align-items: start; }
.builder-item .drag { cursor: grab; color: var(--muted); padding-top: 8px; }
.builder-item.is-title { background: #FAFBFA; }
.answer { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.answer .q { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.answer .a { margin-top: 3px; white-space: pre-wrap; }
.answer-title { font-weight: 700; color: var(--primary-700); margin-top: 18px; padding-bottom: 6px; border-bottom: 2px solid var(--primary-100); }

/* ---------- Tricoscópio ---------- */
.trico { display: grid; grid-template-columns: 52px minmax(0, 1fr) 270px; gap: 14px; align-items: start; }
.trico-tools { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; }
.trico-tools button { width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; }
.trico-tools button:hover { background: var(--line-2); }
.trico-tools button.is-active { background: var(--primary); color: #fff; }
.trico-stage { background: #0F1418; border-radius: var(--radius); position: relative; overflow: hidden; min-height: 420px; display: grid; place-items: center; touch-action: none; }
.trico-stage canvas { max-width: 100%; display: block; cursor: crosshair; }
.trico-stage .stage-empty { color: #8A949E; text-align: center; padding: 40px; }
.trico-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 12px; }
.trico-bar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.mk { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.mk.is-active { border-color: currentColor; background: var(--line-2); color: var(--ink); }
.counter { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.counter .ctl { display: flex; align-items: center; gap: 4px; }
.counter .ctl button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.counter .ctl span { min-width: 28px; text-align: center; font-weight: 700; }
.total-box { background: var(--primary-50); border-radius: 8px; padding: 12px; margin: 12px 0; }
.total-box b { font-size: 24px; color: var(--primary-700); }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; }
.thumbs .th { position: relative; flex-shrink: 0; width: 76px; height: 58px; border-radius: 7px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #000; }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .th.is-active { border-color: var(--primary); }
.thumbs .th .del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; cursor: pointer; line-height: 1; }
.thumbs .th .cnt { position: absolute; left: 3px; bottom: 3px; font-size: 10px; background: rgba(0, 0, 0, .65); color: #fff; padding: 0 4px; border-radius: 3px; }
.ia-note { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--info-50); color: var(--info); border-radius: 8px; font-size: 12.5px; margin-bottom: 12px; }
.metric { padding: 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #FAFBFA; }
.metric small { color: var(--muted); font-size: 11.5px; display: block; }
.metric b { font-size: 20px; }
.metric .delta { font-size: 11.5px; font-weight: 600; }
.an-card { overflow: hidden; }
.an-card .cover { height: 150px; background: #111 center/cover; position: relative; }
.an-card .cover .badge { position: absolute; top: 8px; right: 8px; }
.an-card .cover label { position: absolute; top: 8px; left: 8px; background: rgba(255, 255, 255, .92); padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.mini-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; margin: 10px 0; }
.mini-counts small { display: block; font-size: 10.5px; color: var(--muted); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ann-img { position: relative; border-radius: 8px; overflow: hidden; background: #000; }
.ann-img img { display: block; width: 100%; }
.ann-img .box { position: absolute; border: 2px solid; border-radius: 3px; }
.ann-img .box span { position: absolute; top: -16px; left: -2px; font-size: 10px; color: #fff; padding: 0 3px; white-space: nowrap; border-radius: 2px; }
.ann-img .pin { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; transform: translate(-50%, -50%); }

/* ---------- Laudo ---------- */
.picker { border: 1px solid var(--line); border-radius: 9px; max-height: 360px; overflow-y: auto; }
.picker h5 { margin: 0; padding: 8px 12px; background: #FAFBFA; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; }
.picker label { display: flex; gap: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; border-top: 1px solid var(--line-2); }
.picker label:hover { background: var(--primary-50); }
.picker input { accent-color: var(--primary); margin-top: 3px; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 42px; min-height: 520px; box-shadow: var(--shadow); }
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 20px; gap: 16px; }
.paper h3 { margin: 18px 0 8px; color: var(--primary-700); font-size: 15px; }
.paper ul { padding-left: 20px; }
.paper li { margin-bottom: 4px; }
.paper p { margin-bottom: 10px; }
.editor-bar { display: flex; gap: 2px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: #FAFBFA; }
.editor-bar button { min-width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink-2); padding: 0 6px; }
.editor-bar button:hover { background: var(--line); }
.editor { border: 1px solid var(--line); border-radius: 0 0 8px 8px; min-height: 260px; padding: 14px 16px; background: #fff; outline: none; }
.editor:focus { border-color: var(--primary); }
.editor h3 { margin: 12px 0 6px; }
.rich ul, .editor ul { padding-left: 20px; }

/* ---------- Protocolos ---------- */
.proto-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; }
.proto-card h4 { font-size: 14px; }
.proto-card p { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proto-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; gap: 8px; }
.stat { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.comment b { font-size: 13px; }

/* ---------- Sessão ---------- */
.session-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.session-card .tools { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-grid .ph { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #eee; }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .ph form { position: absolute; top: 4px; right: 4px; }
.dropzone { border: 2px dashed var(--line); border-radius: 10px; padding: 28px; text-align: center; color: var(--muted); cursor: pointer; display: block; }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-50); }
.progress { height: 7px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); }

/* ---------- Auth & public ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--side); color: #D6DCE1; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { color: #fff; font-size: 30px; max-width: 420px; margin-top: 30px; }
.auth-side p { max-width: 420px; margin-top: 14px; color: #98A3AD; }
.auth-side ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.auth-side li { display: flex; gap: 10px; align-items: center; }
.auth-side li .ic { color: #5FC4A8; }
.auth-main { display: grid; place-items: center; padding: 32px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { margin-bottom: 6px; }
body.public { background: var(--bg); }
.public-wrap { max-width: 720px; margin: 0 auto; padding: 32px 18px 50px; }
.public-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.public-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trico { grid-template-columns: 52px minmax(0, 1fr); }
  .trico-side { grid-column: 1 / -1; }
}
@media (max-width: 920px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
  .main { margin-left: 0; }
  .only-mobile { display: inline-grid !important; }
  .topbar { padding: 0 14px; }
  .topbar-user .who { display: none; }
  .content { padding: 18px 14px 80px; }
  .g3, .g2, .split, .compare { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .builder-item { grid-template-columns: 1fr; }
  .builder-item .drag { display: none; }
  .paper { padding: 22px; }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .trico { grid-template-columns: 1fr; }
  .trico-tools { flex-direction: row; }
  .hide-sm { display: none; }
  .kpi-value { font-size: 23px; }
}

/* ---------- Print (laudo em PDF) ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .help-fab, .no-print, .page-head { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .paper { border: 0; box-shadow: none; padding: 0; }
  @page { margin: 18mm 16mm; }
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-lg); min-width: 210px; padding: 6px; z-index: 60; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--ink); font: inherit; font-size: 13px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--line-2); }
.dropdown-menu .danger { color: var(--danger); }
.dropdown-menu form { margin: 0; }

.slot-grid > span { grid-column: 1 / -1; }

/* Captura ao vivo */
.stage-opts { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.stage-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 210px; padding: 22px 16px; border: 1px dashed #3B4650; border-radius: 12px; background: rgba(255,255,255,.03); color: #D6DCE1; cursor: pointer; font: inherit; }
.stage-opt:hover { border-color: var(--primary); background: rgba(14,124,102,.15); color: #fff; }
.stage-opt small { color: #8A949E; font-size: 12px; }
.cam-view { position: relative; background: #0F1418; border-radius: 10px; overflow: hidden; height: min(52vh, 520px); display: grid; place-items: center; }
.cam-view video { width: 100%; height: 100%; object-fit: contain; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .12s; }
.cam-alvo { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%); border: 1.5px solid rgba(255,255,255,.55); border-radius: 50%; pointer-events: none; }
.cam-info { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: #fff; background: rgba(0,0,0,.5); padding: 2px 7px; border-radius: 5px; }
.cam-msg { position: absolute; inset: auto 16px 16px 16px; background: var(--danger-50); color: var(--danger); padding: 12px 14px; border-radius: 8px; font-weight: 500; }
#cam-thumbs .th { cursor: default; }
