:root {
  --bg: #0b0a09;
  --bg-2: #100e0c;
  --surface: #15120f;
  --surface-2: #1b1713;
  --input: #0f0d0b;
  --line: #2a241d;
  --line-2: #3a3128;
  --text: #f3ede4;
  --text-2: #cfc6ba;
  --muted: #8f857a;
  --gold: #c9a27a;
  --gold-2: #e6cba3;
  --gold-3: #a8784f;
  --gold-grad: linear-gradient(120deg, #a8784f 0%, #e9d2ab 38%, #b88a5f 62%, #e3c69b 100%);
  --ok: #8fbf8f;
  --warn: #d9a45b;
  --bad: #d07a6a;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 10px;
  --sidebar: 268px;
}
* { box-sizing: border-box; scrollbar-color: #3a3128 transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #3a3128; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background: radial-gradient(1200px 600px at 50% 120%, rgba(120, 80, 45, .22), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: .01em; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 17px; }
.eyebrow { font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; font-weight: 600; color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot { display: grid; place-items: center; height: 100vh; }
.boot img { width: 72px; opacity: .8; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ───── Botões e campos ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text); padding: 10px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--gold); color: var(--gold-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--gold-grad); border: 0; color: #1d140b; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); color: #1d140b; }
.btn.ghost { border-color: transparent; color: var(--muted); padding: 6px 8px; }
.btn.ghost:hover { color: var(--gold-2); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.icon { padding: 9px; }
.btn svg { width: 16px; height: 16px; }
.linkbtn { background: none; border: 0; color: var(--gold); cursor: pointer; padding: 0; font-size: 12px; }
.linkbtn:hover { color: var(--gold-2); text-decoration: underline; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.input, select.input, textarea.input { width: 100%; background: var(--input); border: 1px solid var(--line-2); border-radius: 8px; padding: 11px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 122, .12); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 40px; }
.input-wrap .suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); background: none; border: 0; cursor: pointer; display: grid; }
.input-wrap .suffix svg { width: 18px; height: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ───── Login ───── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px; padding: 40px clamp(20px, 6vw, 90px); position: relative; overflow: hidden; }
.auth::before { content: ''; position: absolute; width: 900px; height: 900px; border-radius: 50%; border: 1px solid rgba(201, 162, 122, .12); left: -380px; top: -200px; pointer-events: none; }
.auth::after { content: ''; position: absolute; inset: auto 0 -260px 0; height: 520px; background: radial-gradient(closest-side, rgba(176, 122, 70, .35), transparent); pointer-events: none; }
.brand { text-align: center; position: relative; z-index: 1; }
.brand img { width: min(240px, 50vw); filter: drop-shadow(0 10px 40px rgba(201, 162, 122, .25)); }
.brand .wordmark { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 52px); line-height: 1.05; margin-top: 28px; letter-spacing: .02em; }
.brand .tag { margin-top: 18px; font-size: 13px; letter-spacing: .38em; color: var(--text-2); }
.brand .tag b { color: var(--gold-2); font-weight: 700; }
.brand .sub { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; font-size: 11px; letter-spacing: .34em; color: var(--muted); }
.brand .sub::before, .brand .sub::after { content: ''; width: 40px; height: 1px; background: var(--line-2); }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 420px; justify-self: center; background: rgba(21, 18, 15, .82); backdrop-filter: blur(8px); border: 1px solid var(--line-2); border-radius: 14px; padding: 26px 26px 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.tabs { display: flex; gap: 22px; justify-content: center; margin-bottom: 22px; }
.tabs button { background: none; border: 0; padding: 4px 2px 8px; color: var(--muted); cursor: pointer; font-size: 13px; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-color: var(--gold); }
.auth-card .btn.primary { width: 100%; padding: 13px; margin-top: 6px; }
.auth-foot { margin-top: 18px; text-align: center; }
.auth-foot .seal { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 18px; font-size: 11px; color: var(--muted); }
.auth-foot .seal::before, .auth-foot .seal::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.form-error { color: var(--bad); font-size: 12.5px; margin: -4px 0 10px; min-height: 0; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; gap: 26px; padding-top: 48px; }
  .brand img { width: 120px; }
  .brand .wordmark { font-size: 30px; margin-top: 16px; }
  .brand .tag { font-size: 11px; letter-spacing: .3em; }
}

/* ───── Shell ───── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: rgba(13, 11, 9, .96); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; z-index: 30; }
.sidebar .logo { text-align: center; padding: 6px 0 18px; }
.sidebar .logo img { width: 64px; }
.sidebar .logo .name { font-family: var(--serif); font-size: 17px; letter-spacing: .06em; margin-top: 8px; }
.sidebar .logo .prog { font-size: 9px; letter-spacing: .3em; color: var(--muted); margin-top: 2px; }
.sidebar .who { display: flex; gap: 10px; align-items: center; padding: 12px 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #221c16; border: 1px solid var(--line-2); font-size: 11px; font-weight: 600; color: var(--gold-2); flex: none; }
.who .n { font-weight: 600; font-size: 13px; }
.who .r { font-size: 11px; color: var(--muted); }
.nav-group { font-size: 9.5px; letter-spacing: .28em; color: var(--muted); text-transform: uppercase; margin: 16px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; color: var(--text-2); font-size: 13px; border-left: 2px solid transparent; }
.nav a svg { width: 17px; height: 17px; opacity: .8; flex: none; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.on { background: linear-gradient(90deg, rgba(201, 162, 122, .14), rgba(201, 162, 122, .03)); color: var(--gold-2); border-left-color: var(--gold); }
.nav a .count { margin-left: auto; font-size: 11px; color: var(--muted); }
.sidebar .bottom { margin-top: auto; padding-top: 16px; }
.topbar { display: none; }
.main { min-width: 0; }
.content { max-width: 1120px; margin: 0 auto; padding: 34px clamp(16px, 4vw, 40px) 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin-top: 6px; }
.scrim { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 82vw; max-width: 300px; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .shell.open .sidebar { transform: none; }
  .shell.open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 25; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(11, 10, 9, .92); backdrop-filter: blur(8px); z-index: 20; }
  .topbar button { background: none; border: 0; color: var(--text-2); padding: 4px; cursor: pointer; display: grid; }
  .topbar svg { width: 22px; height: 22px; }
  .topbar .mini { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 15px; }
  .topbar .mini img { width: 26px; }
  .content { padding-top: 22px; }
  h1 { font-size: 26px; }
}

/* ───── Cards ───── */
.card { background: linear-gradient(180deg, rgba(27, 23, 19, .9), rgba(21, 18, 15, .9)); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.card-head svg { width: 18px; height: 18px; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.cols > .card + .card, .prod-cards > .card + .card { margin-top: 0; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }

/* ───── Métricas ───── */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 170px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); margin-bottom: 16px; }
.seg button { display: flex; align-items: center; justify-content: center; gap: 8px; background: none; border: 0; padding: 10px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--gold-grad); color: #1d140b; font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; position: relative; }
.metric .lbl { font-size: 11.5px; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.metric .lbl svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.metric .val { font-size: 25px; font-weight: 500; margin: 8px 0 6px; letter-spacing: -.01em; }
.metric .goal { font-size: 11px; color: var(--muted); }
.metric .goal b { color: var(--text-2); font-weight: 500; }
.metric.calc .val { color: var(--gold-2); }
.bar { height: 4px; background: #241e18; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--gold-grad); border-radius: 4px; }
.bar.ok > i { background: linear-gradient(90deg, #6f9f6f, #a8d2a0); }
@media (max-width: 520px) { .metrics { grid-template-columns: 1fr 1fr; } .metric .val { font-size: 20px; } .metric { padding: 13px; } }

.plan { list-style: none; margin: 0; padding: 0; }
.plan li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.plan li:last-child { border-bottom: 0; }
.plan li.done span { color: var(--muted); text-decoration: line-through; }
.check { appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 5px; flex: none; margin: 1px 0 0; cursor: pointer; display: grid; place-items: center; background: var(--input); }
.check:checked { background: var(--gold-grad); border-color: transparent; }
.check:checked::after { content: ''; width: 5px; height: 9px; border: solid #1d140b; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check:disabled { cursor: default; }
.kv { padding: 14px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; padding-bottom: 0; }
.kv .k { font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.kv .v { font-size: 13px; color: var(--text-2); white-space: pre-wrap; }
.kv .v.none { color: var(--muted); }
.goal-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-top: 4px; }

.hist { display: grid; gap: 10px; }
.hist .item { border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; background: var(--surface); cursor: pointer; transition: border-color .15s; }
.hist .item:hover, .hist .item.on { border-color: var(--gold); }
.hist .item .m { font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.hist .item .v { font-family: var(--serif); font-size: 20px; margin: 3px 0; }
.hist .item .d { font-size: 11.5px; color: var(--muted); }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: rgba(201, 162, 122, .05); }
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 11px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.pill.ativo { color: var(--ok); border-color: rgba(143, 191, 143, .35); }
.pill.pausado { color: var(--warn); border-color: rgba(217, 164, 91, .35); }
.pill.cancelado { color: var(--bad); border-color: rgba(208, 122, 106, .35); }
.pill.gold { color: var(--gold-2); border-color: rgba(201, 162, 122, .4); }
.prod-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.prod-card { cursor: pointer; transition: border-color .15s, transform .15s; }
.prod-card:hover { border-color: var(--gold-3); transform: translateY(-1px); }
.prod-card .big { font-family: var(--serif); font-size: 30px; margin: 10px 0 2px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stats div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stats b { display: block; font-size: 18px; font-weight: 500; }
.stats span { font-size: 11px; color: var(--muted); }
.alerts li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li:last-child { border-bottom: 0; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.subtabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-size: 13px; white-space: nowrap; }
.subtabs a.on { color: var(--gold-2); border-color: var(--gold); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .25em; color: var(--gold-2); background: var(--input); border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 14px; display: inline-block; }
.notes .n { padding: 14px 0; border-bottom: 1px solid var(--line); }
.notes .n .meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; }
.notes .n .tx { white-space: pre-wrap; font-size: 13px; color: var(--text-2); }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search .input { padding-left: 34px; }

/* ───── Raio X ───── */
.rx-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 16px 0; }
.rx-grid button { aspect-ratio: 1.15; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: #4b4238; font-size: 12px; cursor: not-allowed; }
.rx-grid button.ok { border-color: var(--line-2); color: var(--text-2); cursor: pointer; }
.rx-grid button.done { border-color: rgba(201, 162, 122, .55); color: var(--gold-2); cursor: pointer; }
.rx-grid button.cur { background: var(--gold-grad); color: #1d140b; border-color: transparent; font-weight: 600; cursor: pointer; }
.sync { font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.sync b { color: var(--text-2); font-weight: 500; display: block; }
.sync.err b { color: var(--bad); }
.pend { border: 1.5px solid var(--gold-3); background: rgba(201, 162, 122, .05); }
.pend ul { margin: 10px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); }
.pend li { margin: 5px 0; cursor: pointer; }
.pend li:hover { color: var(--gold-2); }
.qs { margin-top: 6px; }
.qitem { padding: 22px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.qitem:last-child { border-bottom: 0; }
.qitem .ql { display: flex; gap: 12px; font-size: 14px; font-weight: 500; color: var(--text); }
.qitem .ql .num { color: var(--muted); font-size: 12px; font-weight: 500; padding-top: 2px; min-width: 18px; }
.qitem .opt-tag { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-left: 6px; font-weight: 500; }
.qitem .qb { padding-left: 30px; }
.qitem .help { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.qitem ul.bul { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.qitem ul.bul li { margin: 3px 0; }
.qitem .ans { margin-top: 14px; }
.qitem.missing textarea.input, .qitem.missing .opts, .qitem.missing .months { border-color: var(--gold-3); }
.qitem .miss { color: var(--gold); font-size: 12px; margin-top: 8px; display: none; }
.qitem.missing .miss { display: block; }
.opts { display: grid; gap: 8px; border: 1px solid transparent; border-radius: 10px; }
.opt { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); cursor: pointer; font-size: 13px; color: var(--text-2); transition: border-color .15s; }
.opt:hover { border-color: var(--line-2); }
.opt.on { border-color: var(--gold-3); color: var(--text); }
.opt input[type=radio] { appearance: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); margin: 0; flex: none; display: grid; place-items: center; }
.opt input[type=radio]:checked { border-color: var(--gold); }
.opt input[type=radio]:checked::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--gold-grad); }
.scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; }
.scale button { padding: 10px 0; border: 1px solid var(--line); border-radius: 7px; background: var(--input); color: var(--text-2); cursor: pointer; font-size: 13px; }
.scale button.on { background: var(--gold-grad); color: #1d140b; border-color: transparent; font-weight: 600; }
@media (max-width: 520px) { .scale { grid-template-columns: repeat(6, 1fr); } }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; border: 1px solid transparent; border-radius: 10px; }
.months label { display: flex; align-items: center; background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 0 0 0 12px; font-size: 12px; color: var(--muted); }
.months label span { width: 70px; flex: none; }
.months input { border: 0; background: transparent; outline: none; padding: 10px 10px 10px 0; width: 100%; color: var(--text); }
.months label:focus-within { border-color: var(--gold); }
details.compl { margin-top: 12px; }
details.compl summary, details.intro summary { cursor: pointer; color: var(--gold); font-size: 12.5px; list-style: none; }
details.compl summary::before, details.intro summary::before { content: '▸ '; }
details[open].compl summary::before, details[open].intro summary::before { content: '▾ '; }
details.compl textarea { margin-top: 8px; min-height: 70px; }
details.intro { margin-top: 14px; }
details.intro p { color: var(--text-2); font-size: 13px; margin: 10px 0 0; }
.rx-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.rx-links { display: flex; justify-content: space-between; margin-top: 14px; }
.readonly-ans { margin-top: 10px; font-size: 13px; color: var(--text-2); white-space: pre-wrap; background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.readonly-ans.none { color: var(--muted); font-style: italic; }
.banner { display: flex; gap: 14px; align-items: center; border: 1px solid rgba(143, 191, 143, .35); background: rgba(143, 191, 143, .06); border-radius: 12px; padding: 16px 18px; }
.banner svg { width: 26px; height: 26px; color: var(--ok); flex: none; }
.progress-ring { display: flex; align-items: center; gap: 14px; }
.foot { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ───── Modal / toast ───── */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 24px; box-shadow: 0 30px 90px rgba(0, 0, 0, .6); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(30px); background: #241d16; border: 1px solid var(--gold-3); color: var(--text); padding: 11px 18px; border-radius: 10px; font-size: 13px; opacity: 0; transition: .25s; pointer-events: none; z-index: 200; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { border-color: var(--bad); }
.plan-edit { display: grid; gap: 8px; }
.plan-edit .row { display: flex; gap: 8px; align-items: center; }
.plan-edit .row .input { flex: 1; padding: 9px 11px; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.banner { margin-bottom: 16px; }
#pendBox { scroll-margin-top: 80px; }

/* ───── Cor por produto, KPIs, comunicados ───── */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-grad); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.nav a .dot { margin: 0 5px 0 4px; }
.pill.prod { color: var(--gold-2); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.pill.prod .dot { width: 6px; height: 6px; box-shadow: none; }
.nav a .badge, .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--gold-grad); color: #1d140b; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: linear-gradient(180deg, rgba(27, 23, 19, .9), rgba(21, 18, 15, .9)); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.kpi span { display: block; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 8px 0 2px; }
.kpi b em { font-style: normal; font-size: 18px; color: var(--muted); }
.kpi small { font-size: 11.5px; color: var(--muted); }
.kpi .bar { margin-top: 10px; }
.prod-cards { align-items: stretch; }
.prod-card { display: flex; flex-direction: column; position: relative; overflow: hidden; border-top: 0; }
.prod-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--gold-grad); }
.prod-card h3 { margin-top: 6px; min-height: 2.6em; }
.prod-card .big { margin: 6px 0 2px; }
.prod-card .stats { margin-top: auto; padding-top: 16px; }
.prod-card:hover { border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.pill svg { width: 12px; height: 12px; }
.pill.kind { color: var(--gold-2); }
.pill.k-importante { color: #e7a08f; border-color: rgba(231, 160, 143, .4); }
.pill.k-conquista { color: var(--ok); border-color: rgba(143, 191, 143, .35); }
.pill.new { background: var(--gold-grad); color: #1d140b; border: 0; font-weight: 700; }
.ann-list { display: grid; gap: 12px; }
.ann { display: block; background: linear-gradient(180deg, rgba(27, 23, 19, .9), rgba(21, 18, 15, .9)); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; cursor: pointer; transition: border-color .15s; color: var(--text); position: relative; }
.ann.open { cursor: default; }
.ann:hover:not(.open) { border-color: var(--gold-3); }
.ann.unread { border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.ann.unread::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-grad); }
.ann-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ann h3 { font-size: 19px; margin-top: 10px; }
.ann-ex { color: var(--text-2); font-size: 13px; margin: 6px 0 0; }
.ann-body { color: var(--text-2); font-size: 13.5px; margin-top: 8px; white-space: pre-wrap; line-height: 1.65; }
.ann-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ann-home { margin-bottom: 16px; }
.kind-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.kind-pick input { display: none; }
.kind-pick span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 99px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.kind-pick span svg { width: 14px; height: 14px; }
.kind-pick input:checked + span { background: var(--gold-grad); color: #1d140b; border-color: transparent; font-weight: 600; }
.pick { display: grid; gap: 6px; margin-top: 10px; max-height: 220px; overflow-y: auto; padding-right: 4px; }
.pick .opt { padding: 10px 12px; }

/* ───── Identificação de produto (discreta) ───── */
.dot { background: var(--pc, var(--gold)); box-shadow: none; }
.prod-card::before { background: var(--pc, var(--gold)); }
.ptile { display: inline-grid; place-items: center; border-radius: 9px; background: var(--pc); flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.ptile img { width: 62%; height: 62%; object-fit: contain; }
.prod-id { display: flex; align-items: center; gap: 10px; }
.prod-head { display: flex; align-items: center; gap: 16px; }

/* ═════════════ Painel administrativo — modo claro e neutro ═════════════ */
body.light {
  --bg: #f6f6f4; --bg-2: #f3f3f1; --surface: #ffffff; --surface-2: #fafaf9; --input: #ffffff;
  --line: #e8e7e4; --line-2: #d9d7d3; --text: #1b1b1d; --text-2: #46454a; --muted: #85837f;
  --gold: #9c7a52; --gold-2: #7c5f3c; --gold-3: #b8976f; --gold-grad: #1b1b1d;
  --ok: #2f7a4f; --warn: #a3671c; --bad: #b2463b;
  background: var(--bg); color: var(--text);
}
body.light * { scrollbar-color: #d4d2ce transparent; }
body.light ::-webkit-scrollbar-thumb { background: #d4d2ce; }
body.light a { color: var(--text); }
body.light a:hover { color: var(--gold); }
body.light .eyebrow { color: var(--gold); }
body.light .sidebar { background: #ffffff; border-right-color: var(--line); }
body.light .sidebar .logo img, body.light .topbar .mini img { filter: none; }
body.light .sidebar .logo .name { color: var(--text); }
body.light .nav a { color: var(--text-2); }
body.light .nav a:hover { background: var(--bg-2); color: var(--text); }
body.light .nav a.on { background: var(--bg-2); color: var(--text); border-left-color: var(--text); font-weight: 600; }
body.light .avatar { background: var(--bg-2); color: var(--text); border-color: var(--line); }
body.light .topbar { background: rgba(255, 255, 255, .92); }
body.light .card, body.light .kpi, body.light .ann, body.light .metric, body.light .hist .item {
  background: #ffffff; border-color: var(--line); box-shadow: 0 1px 2px rgba(20, 20, 20, .04);
}
body.light .stats div { background: var(--bg-2); border-color: transparent; }
body.light .gold-text { background: none; color: var(--text); -webkit-text-fill-color: currentColor; }
body.light .metric .val, body.light .metric.calc .val { color: var(--text); }
body.light .bar { background: #ecebe8; }
body.light .bar > i { background: var(--gold-3); }
body.light .bar.ok > i { background: #4f9a6c; }
body.light .btn { border-color: var(--line-2); color: var(--text); background: #fff; }
body.light .btn:hover { border-color: var(--text); color: var(--text); }
body.light .btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
body.light .btn.primary { background: var(--text); color: #fff; }
body.light .btn.primary:hover { background: #000; color: #fff; filter: none; }
body.light .btn.danger:hover { border-color: var(--bad); color: var(--bad); }
body.light .linkbtn { color: var(--gold); }
body.light .input:focus { border-color: var(--text); box-shadow: 0 0 0 3px rgba(27, 27, 29, .07); }
body.light .seg { background: var(--bg-2); border-color: var(--line); }
body.light .seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
body.light .subtabs a { color: var(--muted); }
body.light .subtabs a.on { color: var(--text); border-color: var(--text); }
body.light table.t tr.click:hover td { background: var(--bg-2); }
body.light .pill { background: #fff; }
body.light .pill.ativo { border-color: rgba(47, 122, 79, .3); }
body.light .pill.pausado { border-color: rgba(163, 103, 28, .3); }
body.light .pill.cancelado { border-color: rgba(178, 70, 59, .3); }
body.light .pill.gold, body.light .pill.prod, body.light .pill.kind { color: var(--text-2); border-color: var(--line-2); }
body.light .pill.new { background: var(--text); color: #fff; }
body.light .pill.k-importante { color: var(--bad); border-color: rgba(178, 70, 59, .3); }
body.light .pill.k-conquista { color: var(--ok); border-color: rgba(47, 122, 79, .3); }
body.light .check { background: #fff; border-color: var(--line-2); }
body.light .check:checked { background: var(--text); }
body.light .check:checked::after { border-color: #fff; }
body.light .opt { background: #fff; color: var(--text-2); }
body.light .opt.on { border-color: var(--text); color: var(--text); }
body.light .opt input[type=radio]:checked { border-color: var(--text); }
body.light .opt input[type=radio]:checked::after { background: var(--text); }
body.light .kind-pick span { background: #fff; }
body.light .kind-pick input:checked + span { background: var(--text); color: #fff; }
body.light .code { background: var(--bg-2); color: var(--text); border-color: var(--line-2); }
body.light .readonly-ans { background: var(--bg-2); border-color: var(--line); }
body.light .ann.unread { border-color: var(--line-2); }
body.light .ann.unread::before { background: var(--text); }
body.light .hist .item.on, body.light .hist .item:hover, body.light .ann:hover:not(.open) { border-color: var(--text); }
body.light .hist .item .m { color: var(--gold); }
body.light .badge, body.light .nav a .badge { background: var(--text); color: #fff; }
body.light .modal-bg { background: rgba(24, 24, 27, .32); backdrop-filter: blur(2px); }
body.light .modal { background: #fff; border-color: var(--line); box-shadow: 0 24px 70px rgba(0, 0, 0, .16); }
body.light #toast { background: var(--text); color: #fff; border-color: var(--text); }
body.light .prod-card:hover { border-color: var(--line-2); box-shadow: 0 6px 20px rgba(20, 20, 20, .06); }
body.light .prod-card::before { height: 3px; }
body.light .foot { border-top-color: var(--line); }
body.light .dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line-2); }
.sidebar .logo .name { font-size: 15px; white-space: nowrap; }

/* ───── Ajustes responsivos ───── */
.sidebar { box-shadow: none; }
@media (max-width: 960px) {
  .shell.open .sidebar { box-shadow: 20px 0 60px rgba(0, 0, 0, .35); }
  .sidebar { visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
  .shell.open .sidebar { visibility: visible; transition: transform .25s ease; }
  .subtabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  table.t th:first-child, table.t td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
  table.t th:first-child { background: var(--surface); }
  body:not(.light) table.t th:first-child, body:not(.light) table.t td:first-child { background: #19150f; }
}
@media (max-width: 640px) {
  .content { padding: 18px 14px 40px; }
  h1 { font-size: 24px; }
  h2 { font-size: 19px; }
  .card { padding: 16px; }
  .page-head { margin-bottom: 18px; }
  .page-head > .btn, .page-head > .toolbar { width: 100%; }
  .toolbar { gap: 8px; }
  .toolbar .btn { flex: 1 1 auto; padding: 10px 12px; }
  .toolbar .btn.icon { flex: 0 0 auto; }
  .toolbar select.input, .toolbar .input { flex: 1 1 150px; min-width: 0; width: auto; }
  .toolbar .search { flex-basis: 100% !important; }
  .seg button { font-size: 12px; padding: 9px 6px; gap: 6px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi b { font-size: 22px; }
  .kpi span { letter-spacing: .14em; font-size: 9.5px; }
  .kpi small { font-size: 11px; }
  .prod-card .big { font-size: 26px; }
  .prod-head { gap: 12px; }
  .prod-head .ptile { width: 42px !important; height: 42px !important; }
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .modal-actions .btn { flex: 1 1 auto; }
  .goal-grid { grid-template-columns: 1fr 1fr; }
  .opts[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .ann { padding: 15px 16px; }
  .ann h3 { font-size: 17px; }
  .rx-foot { grid-template-columns: 1fr 1.4fr; }
  .foot { flex-direction: column; gap: 6px; }
}
@media (max-width: 340px) {
  .kpis { grid-template-columns: 1fr; }
  .goal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) and (min-width: 341px) { .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.subtabs { scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.goal-grid { align-items: end; }
@media (max-width: 640px) { .input, select.input, textarea.input, .months input { font-size: 16px; } }
@media (min-width: 641px) { .prod-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 641px) and (max-width: 1100px) { .prod-card .big { font-size: 24px; } .prod-card { padding: 18px; } .stats b { font-size: 16px; } }
