/* WitherHost — painéis Admin e Staff */
:root {
  --bg: #060607; --bg-2: #0c0c0e; --bg-3: #131316; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.16);
  --text: #f1f1f3; --muted: #8b8b93; --dim: #55555c;
  --font-display: 'Oswald', 'Arial Narrow', Impact, sans-serif; --font: 'Inter', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(900px circle at 85% -10%, rgba(255,255,255,.06), transparent 60%), radial-gradient(600px circle at 0% 110%, rgba(255,255,255,.035), transparent 60%); }
a { color: inherit; } button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.i { width: 1.1em; height: 1.1em; flex: none; }
.demo { position: fixed; z-index: 50; left: 50%; top: 0; transform: translateX(-50%); padding: 5px 12px; border-radius: 0 0 8px 8px; background: #fff; color: #000; font: 700 10.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login__card { position: relative; width: min(400px, 100%); padding: 38px 32px; border-radius: 20px; border: 1px solid var(--line-2); background: linear-gradient(180deg, #111114, #08080a); box-shadow: 0 40px 100px rgba(0,0,0,.7), 0 0 80px rgba(255,255,255,.06); }
.login__card img { width: 52px; margin-bottom: 18px; filter: drop-shadow(0 0 14px rgba(255,255,255,.4)); }
.login h1 { margin: 0 0 4px; font: 700 30px/1 var(--font-display); text-transform: uppercase; letter-spacing: .02em; }
.login p { margin: 0 0 24px; color: var(--muted); }
.login__hint { margin-top: 16px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--line-2); font: 500 12px/1.5 var(--mono); color: var(--muted); }
.login__err { min-height: 20px; color: #fff; font-size: 13px; margin: 4px 0 10px; }

/* Layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100%; position: relative; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 22px 14px; border-right: 1px solid var(--line); background: rgba(8,8,9,.85); backdrop-filter: blur(10px); }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font: 700 19px/1 var(--font-display); letter-spacing: .04em; }
.side__brand img { width: 30px; } .side__brand small { display: block; font: 500 10px/1.4 var(--mono); letter-spacing: .2em; color: var(--muted); }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; transition: background .2s, color .2s; }
.side a:hover { background: rgba(255,255,255,.04); color: #fff; }
.side a.on { background: #fff; color: #000; box-shadow: 0 0 24px rgba(255,255,255,.18); }
.side a .count { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 10px; background: rgba(255,255,255,.12); font: 600 11px/1.4 var(--mono); text-align: center; }
.side a.on .count { background: #000; color: #fff; }
.side__foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 13px; color: var(--muted); }
.side__foot b { color: #fff; display: block; }
.main { min-width: 0; padding: 30px clamp(18px, 3vw, 40px) 60px; position: relative; }
.top { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.top h1 { margin: 0; font: 700 38px/1 var(--font-display); text-transform: uppercase; letter-spacing: .01em; }
.top p { margin: 6px 0 0; color: var(--muted); }
.top__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.burger { display: none; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; font: 600 12.5px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--line-2); transition: all .2s; white-space: nowrap; }
.btn:hover { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.05); }
.btn--light { background: #fff; color: #000; border-color: #fff; } .btn--light:hover { background: #fff; box-shadow: 0 0 24px rgba(255,255,255,.4); }
.btn--sm { height: 32px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }
.btn--danger:hover { background: #fff; color: #000; }
.btn--block { width: 100%; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); transition: all .2s; }
.icon-btn:hover { color: #fff; border-color: var(--line-2); background: rgba(255,255,255,.05); }

/* Cartões e KPIs */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.card { border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(18,18,21,.9), rgba(10,10,12,.9)); padding: 20px; min-width: 0; }
.card h2 { margin: 0 0 14px; font: 600 16px/1.2 var(--font-display); letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi small { display: block; color: var(--muted); font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.kpi b { display: block; margin: 12px 0 4px; font: 700 34px/1 var(--font-display); }
.kpi span { color: var(--muted); font-size: 12.5px; }
.cols-2 { grid-template-columns: 1.4fr 1fr; }
.meter { height: 10px; border-radius: 10px; background: rgba(255,255,255,.08); overflow: hidden; margin: 10px 0 6px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, rgba(255,255,255,.4), #fff); box-shadow: 0 0 12px rgba(255,255,255,.5); border-radius: inherit; transition: width .6s var(--ease); }
.meter.hot i { background: repeating-linear-gradient(45deg, #fff 0 8px, #bbb 8px 16px); }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); margin-bottom: 10px; }
.alert--hot { border-color: #fff; background: rgba(255,255,255,.09); box-shadow: 0 0 30px rgba(255,255,255,.08); }
.alert b { display: block; } .alert p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.alert .i { margin-top: 2px; }
.chart { width: 100%; height: 180px; }

/* Tabelas */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; padding: 12px 14px; font: 500 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); background: rgba(255,255,255,.025); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; } tbody tr:hover { background: rgba(255,255,255,.025); }
td.num { font-family: var(--mono); white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 100px; font: 600 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-2); color: #ccc; white-space: nowrap; }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag--on { background: #fff; color: #000; border-color: #fff; }
.tag--warn { border-style: dashed; color: #fff; }
.tag--off { color: var(--dim); }
.muted { color: var(--muted); } .mono { font-family: var(--mono); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select { height: 38px; }

/* Formulários */
.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 12.5px; color: var(--muted); }
.field input, .field select, .field textarea, .toolbar input, .toolbar select { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0,0,0,.35); color: #fff; font: 400 14px var(--font); }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
.field textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #fff; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: #ddd; margin-bottom: 14px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 22px; background: rgba(255,255,255,.15); position: relative; transition: background .2s; cursor: pointer; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.switch input:checked { background: #fff; } .switch input:checked::after { background: #000; transform: translateX(16px); }
.hint { font-size: 12px; color: var(--dim); margin: -8px 0 14px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__bg { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(8px); }
.modal__card { position: relative; width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; border-radius: 18px; border: 1px solid var(--line-2); background: #0d0d10; box-shadow: 0 40px 100px rgba(0,0,0,.8); animation: pop .35s var(--ease); }
.modal__card h3 { margin: 0 0 20px; font: 700 26px/1 var(--font-display); text-transform: uppercase; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; padding: 12px 18px; border-radius: 12px; background: #fff; color: #000; font-weight: 600; transform: translateY(150%); opacity: 0; transition: all .4s var(--ease); }
.toast.show { transform: none; opacity: 1; }

/* Tickets (staff/admin) */
.desk { display: grid; grid-template-columns: 340px 1fr; gap: 16px; height: calc(100vh - 150px); min-height: 480px; }
.queue { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.queue__filters { display: flex; gap: 4px; padding: 12px; border-bottom: 1px solid var(--line); }
.queue__filters button { flex: 1; padding: 8px 4px; border-radius: 8px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.queue__filters button.on { background: #fff; color: #000; }
.queue__list { overflow-y: auto; flex: 1; }
.qitem { display: block; width: 100%; text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); transition: background .15s; }
.qitem:hover { background: rgba(255,255,255,.03); } .qitem.on { background: rgba(255,255,255,.07); box-shadow: inset 3px 0 0 #fff; }
.qitem__top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.qitem b { font-size: 14px; } .qitem small { color: var(--muted); font-size: 12px; }
.qitem p { margin: 4px 0 6px; color: #bbb; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.convo__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.convo__head b { font: 600 18px/1.2 var(--font-display); letter-spacing: .04em; text-transform: uppercase; display: block; }
.convo__log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.bub { max-width: 72%; padding: 10px 14px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; }
.bub small { display: block; font: 500 10.5px/1.6 var(--mono); color: var(--muted); }
.bub--client { background: rgba(255,255,255,.07); border-bottom-left-radius: 4px; }
.bub--staff { align-self: flex-end; background: #fff; color: #000; border-bottom-right-radius: 4px; } .bub--staff small { color: #555; }
.bub--system { align-self: center; background: none; color: var(--dim); font: 500 11.5px/1.4 var(--mono); }
.convo__macros { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 10px; }
.convo__macros button { padding: 6px 10px; border-radius: 100px; border: 1px solid var(--line-2); font-size: 12px; color: #ccc; } .convo__macros button:hover { background: #fff; color: #000; }
.convo__form { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.convo__form textarea { flex: 1; min-height: 46px; max-height: 160px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.35); color: #fff; font: 400 14px var(--font); resize: vertical; }
.convo__form textarea:focus { outline: none; border-color: #fff; }
.convo__empty { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 40px; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .cols-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .35s var(--ease); }
  .side.open { transform: none; box-shadow: 40px 0 80px rgba(0,0,0,.6); }
  .burger { display: inline-grid; }
  .desk { grid-template-columns: 1fr; height: auto; } .queue { max-height: 340px; } .convo { min-height: 520px; }
  .row, .row-3 { grid-template-columns: 1fr; }
}

/* ---------- Área do cliente ---------- */
.client .main { padding-top: 34px; }
.client .burger { position: fixed; z-index: 70; left: 14px; top: 14px; background: #000; }
.login__back { display: inline-block; margin-bottom: 18px; color: var(--muted); text-decoration: none; font-size: 13px; }
.login__back:hover { color: #fff; }
.login__switch { margin: 16px 0 0 !important; font-size: 13.5px; text-align: center; }
.login__switch a { color: #fff; }
.login__prefs, .side__prefs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.prefs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; border: 1px solid var(--line); }
.prefs button { height: 28px; min-width: 32px; padding: 0 7px; border-radius: 6px; font: 600 11px/1 var(--mono); color: var(--muted); }
.prefs button[aria-pressed="true"] { background: #fff; color: #000; }
.side__new { margin-top: 10px; border: 1px dashed var(--line-2); }
.side__foot span { display: block; font-size: 12px; word-break: break-all; }
.side__foot > a { text-decoration: none; }
a.card { text-decoration: none; color: inherit; transition: border-color .2s, transform .3s var(--ease); }
a.card:hover { border-color: rgba(255,255,255,.3); transform: translateY(-2px); }
.kpi__date { font-size: 24px !important; }
.sec-title { margin: 30px 0 14px; font: 600 16px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.svc { display: grid; gap: 6px; }
.svc__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.svc__icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line-2); }
.svc__name { font: 600 21px/1.15 var(--font-display); letter-spacing: .03em; text-transform: uppercase; }
.svc__meta { color: var(--muted); font-size: 13px; }
.svc__addr { font-size: 12px; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc__due { font-size: 12px; color: var(--dim); }
.empty-state { display: grid; justify-items: center; gap: 14px; padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-state img { width: 54px; opacity: .8; filter: drop-shadow(0 0 16px rgba(255,255,255,.3)); }
.empty-state p { margin: 0; }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-size: 13.5px; }
.back:hover { color: #fff; }
.h1--sm { font-size: 30px !important; }
.power .btn[disabled] { opacity: .35; pointer-events: none; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 12px 20px; margin: 0; align-items: center; }
.dl dt { color: var(--muted); font-size: 13px; } .dl dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usage { margin-bottom: 14px; } .usage > div:first-child { display: flex; justify-content: space-between; font-size: 13px; } .usage span { color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; flex: none; margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert .btn { margin-left: auto; align-self: center; }
.pay__sum { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); margin-bottom: 16px; }
.pay__sum b { font: 700 26px/1 var(--font-display); white-space: nowrap; }
.co-label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.pay__methods { display: flex; gap: 6px; margin-bottom: 16px; }
.pay__methods button, .up { flex: 1; padding: 11px; border-radius: 10px; border: 1px solid var(--line-2); font: 600 13px/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); transition: all .2s; }
.pay__methods button[aria-pressed="true"], .up[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }
.pay__body { min-height: 80px; margin-bottom: 8px; }
.pix { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.pix__qr { background: #fff; border-radius: 12px; padding: 6px; } .pix__qr svg { display: block; width: 100%; }
.pix__code { font-size: 12px; padding: 10px; border-radius: 8px; background: rgba(0,0,0,.5); border: 1px solid var(--line); margin: 8px 0; word-break: break-all; }
.up-list { display: grid; gap: 8px; margin-bottom: 14px; }
.up { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 12px; }
.up span { grid-column: 1; font: 400 12px var(--font); letter-spacing: 0; text-transform: none; }
.up em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.trow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background .15s; }
.trow:last-child { border-bottom: 0; } .trow:hover { background: rgba(255,255,255,.03); }
.trow b { display: block; } .trow small { font-size: 12px; }
.convo--client { min-height: 460px; height: calc(100vh - 260px); }
.activity { display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.activity > div { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
@media (max-width: 600px) {
  table.stack thead { display: none; } table.stack tr { display: grid; padding: 10px 14px; border-bottom: 1px solid var(--line); } table.stack td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; } table.stack td::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-align: left; } table.stack td.actions { justify-content: flex-end; } table.stack td.actions::before { content: none; }
  .pix { grid-template-columns: 1fr; } .pix__qr { max-width: 180px; }
  .dl { grid-template-columns: 1fr; gap: 4px; } .dl dd { margin-bottom: 10px; }
}
@media (max-width: 860px) { .client .main { padding-top: 64px; } }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); }
.checks label { display: flex; gap: 8px; align-items: center; color: #ddd; font-size: 13px; cursor: pointer; }
.checks input { accent-color: #fff; }
.mini-select { height: 32px; border-radius: 8px; background: #000; color: #fff; border: 1px solid var(--line-2); padding: 0 8px; font: 500 12.5px var(--font); }
