/* =============================================================
   Apicultura - Paineis (cliente + admin). Camada fina sobre tokens.css/components.css.
   Convencao de classes (para o agente de design trocar por web/assets/):
   layout: .panel-layout .sidebar .panel-col .panel-topbar .panel-main .auth-layout
   blocos: .card .card-sm .card-honey .card-night .stat-card .alert .st .chip .btn(.ghost/.danger/.sm/.xs)
   dados:  .tbl-wrap .tbl .amt(.pos/.neg) .chart .meter .key-row .tool-card .pix-box .code
   ============================================================= */
body { min-height: 100vh; }
.muted { color: var(--text-soft); }
.mute2 { color: var(--text-mute); font-size: 13px; }
.mt { margin-top: 14px; } .mt2 { margin-top: 24px; }
.ico { flex-shrink: 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; transition: top .15s; }
.skip:focus { top: 10px; }
.link-btn { font: inherit; font-family: var(--f-ui); font-size: 13.5px; background: none; border: 0; padding: 4px 0; color: var(--accent-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 8px; }
.link-btn:hover { color: var(--ink); }
.sidebar-footer .link-btn { color: var(--text-soft); text-decoration: none; }
.sidebar-footer .link-btn:hover { color: var(--bad); }
.hive { width: 54px; height: 62px; display: block; background: linear-gradient(160deg, #FFD36B, #F5A300); opacity: .8; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(3deg); } }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn { position: relative; overflow: hidden; }
.btn:not(.ghost):not([disabled])::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%); transform: translateX(-120%); }
.btn:not(.ghost):not([disabled]):hover::after { transform: translateX(120%); transition: transform .7s cubic-bezier(.22,.8,.26,1); }
.btn.wide { width: 100%; }
.dark-hint { color: var(--text-mute); }

/* ---- layout ---- */
.panel-layout { grid-template-columns: 240px minmax(0, 1fr); }
.panel-col { min-width: 0; display: flex; flex-direction: column; }
.panel-topbar { padding: 14px 32px; border-bottom: 1px solid var(--line); background: var(--glass);  position: sticky; top: 0; z-index: 15; }
.panel-topbar h1 { font-size: 20px; margin: 0; outline: none; }
.panel-main { padding: 28px 32px 64px; max-width: 1180px; width: 100%; outline: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { position: relative; }
.sidebar nav a.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--accent); }
.sidebar .me { font-size: 13px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.role-tag { align-self: flex-start; margin: -12px 10px 14px; font-family: var(--f-ui); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; padding: 3px 10px; border-radius: var(--pill); background: var(--night); color: var(--on-night); }
.menu-btn { display: none; }
.bal-chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 7px 16px; border-radius: var(--pill); text-decoration: none; background: var(--accent-soft); color: var(--accent-strong); font-family: var(--f-ui); font-size: 14px; box-shadow: inset 0 0 0 1px var(--line); transition: transform .15s; }
.bal-chip:hover { transform: translateY(-1px); }
.bal-chip .bal-l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.scrim { display: none; }
@media (max-width: 900px) {
  .panel-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: flex; position: fixed; z-index: 90; inset: 0 auto 0 0; width: min(280px, 84vw); transform: translateX(-102%); transition: transform .25s cubic-bezier(.22,.8,.26,1); box-shadow: var(--sh); background: var(--bg); }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(20,12,0,.5);  opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .panel-topbar { padding: 10px 16px; gap: 10px; }
  .panel-main { padding: 20px 16px 56px; }
}
@media (max-width: 480px) { .bal-chip .bal-l { display: none; } .panel-topbar h1 { font-size: 17px; } }
.view-in { animation: view-in .35s cubic-bezier(.22,.8,.26,1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
.view-in > .card, .view-in > .grid-4 > *, .view-in > .grid-3 > *, .view-in > .grid-2 > * { animation: view-in .45s cubic-bezier(.22,.8,.26,1) both; }
.view-in > :nth-child(2) { animation-delay: 60ms; } .view-in > :nth-child(3) { animation-delay: 110ms; } .view-in > :nth-child(4) { animation-delay: 160ms; }

/* ---- auth ---- */
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-art { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--panel-1), var(--panel-2)); color: var(--panel-ink); padding: 40px; display: flex; }
.auth-art .logo { color: var(--panel-ink); }
.auth-art-in { display: flex; flex-direction: column; gap: 24px; max-width: 420px; margin: auto 0; }
.auth-claim { font-size: clamp(26px, 3.2vw, 40px); line-height: 1.12; letter-spacing: -.03em; font-weight: 500; }
.honey-grid i { position: absolute; background: rgba(255,255,255,.28); width: 140px; height: 160px; animation: bob 6s ease-in-out infinite; }
.honey-grid i:nth-child(1) { right: -30px; top: 8%; } .honey-grid i:nth-child(2) { right: 90px; top: 22%; width: 90px; height: 104px; animation-delay: -2s; background: rgba(255,255,255,.4); }
.honey-grid i:nth-child(3) { right: -50px; bottom: 14%; width: 190px; height: 218px; animation-delay: -4s; } .honey-grid i:nth-child(4) { left: 30%; bottom: -60px; width: 120px; height: 138px; animation-delay: -1s; }
.honey-grid i:nth-child(5) { left: -40px; top: 40%; width: 100px; height: 115px; animation-delay: -3s; background: rgba(255,255,255,.18); }
.auth-side { display: flex; flex-direction: column; padding: 20px 24px 32px; min-width: 0; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth-top .logo-sm { display: none; }
.auth-card { margin: auto; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; padding: 24px 0; outline: none; }
.auth-h { font-size: 30px; letter-spacing: -.03em; }
.auth-sub { color: var(--text-soft); margin-top: -8px; }
.auth-actions { display: flex; flex-direction: column; gap: 12px; }
.auth-foot { text-align: center; font-size: 14px; color: var(--text-soft); }
.auth-foot a { color: var(--accent-strong); font-weight: 600; }
.mock-note { text-align: center; font-size: 12.5px; color: var(--text-mute); }
.demo-box { font-size: 12.5px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-strong); font-family: var(--f-ui); }
@media (max-width: 900px) { .auth-layout { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; } .auth-top .logo-sm { display: block; } .auth-card { margin: 8px auto auto; } }

/* ---- blocos ---- */
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-intro p { color: var(--text-soft); max-width: 60ch; }
.card h2, .card-sm h2 { font-size: 18px; letter-spacing: -.01em; font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.bal-hero { position: relative; overflow: hidden; }
.bal-hero .big { font-family: var(--f-ui); font-size: clamp(34px, 6vw, 52px); letter-spacing: -.035em; font-weight: 500; line-height: 1.05; }
.bal-hero .lbl { font-family: var(--f-ui); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.bal-hero .hx-deco { position: absolute; right: -30px; top: -30px; width: 150px; height: 172px; background: rgba(255,255,255,.28); animation: bob 7s ease-in-out infinite; }
.card-honey .btn { background: linear-gradient(180deg, #4A2E00, #2A1A00); color: #fff; }
.card-honey .btn.ghost { background: rgba(255,255,255,.4); color: var(--panel-ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.card-honey .muted { color: rgba(42,26,0,.72); }
.stat-card .value { font-variant-numeric: tabular-nums; }
.alert { align-items: center; }
.alert .link-btn { color: inherit; }

/* ---- tabelas ---- */
.tbl-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt { font-family: var(--f-ui); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.pos { color: var(--good); } .amt.neg { color: var(--text); }
.tbl tr.rowlink { cursor: pointer; }
.tbl .sub { display: block; font-size: 12px; color: var(--text-mute); }
@media (max-width: 640px) {
  .tbl.rsp thead { position: absolute; left: -9999px; }
  .tbl.rsp, .tbl.rsp tbody, .tbl.rsp tr, .tbl.rsp td { display: block; width: 100%; }
  .tbl.rsp tr { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
  .tbl.rsp td { border: 0; padding: 2px 0; }
  .tbl.rsp td[data-l]::before { content: attr(data-l) ": "; color: var(--text-mute); font-size: 12px; }
  .tbl.rsp td.num, .tbl.rsp td.right { text-align: right; }
  .tbl.rsp td.full { grid-column: 1 / -1; }
  .tbl-wrap { margin: 0; padding: 0; }
}
.pagination { justify-content: center; margin-top: 8px; }
.pg-info { color: var(--text-soft); font-size: 13px; }

/* ---- filtros ---- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1; min-width: 200px; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-mute); }
.search input { width: 100%; font: inherit; font-size: 15px; padding: 11px 14px 11px 40px; border-radius: var(--pill); border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); }
.search input:focus, select.sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
select.sel { font: inherit; font-size: 14px; padding: 10px 14px; border-radius: var(--pill); border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---- grafico ---- */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar-bg { fill: var(--bg-2); opacity: .55; }
.chart .bar-fill { fill: var(--accent); transform-box: fill-box; transform-origin: bottom; animation: grow .7s cubic-bezier(.22,.8,.26,1) both; transition: fill .15s; }
.chart .bar:hover .bar-fill, .chart .bar:focus .bar-fill { fill: var(--accent-strong); }
.chart .bar:focus { outline: none; } .chart .bar:focus-visible .bar-bg { stroke: var(--accent); stroke-width: 2; }
.chart .bar-lbl { fill: var(--text-mute); font-size: 11px; font-family: var(--f-ui); }
@keyframes grow { from { transform: scaleY(0); } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-soft); }

/* ---- skeleton ---- */
.skel-wrap { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.skel-row { height: 22px; }

/* ---- forms extra ---- */
.form-group input[type="checkbox"], .form-group input[type="radio"] { width: auto; }
.form-group input[readonly] { background: var(--bg-2); }
.input-pre { display: flex; align-items: stretch; }
.input-pre > span { display: grid; place-items: center; padding: 0 14px; border: 1.5px solid var(--line); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--bg-2); color: var(--text-soft); font-family: var(--f-ui); font-size: 14px; }
.input-pre > input { border-radius: 0 var(--r-sm) var(--r-sm) 0 !important; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; }
.check small { display: block; color: var(--text-mute); }
.form-group textarea.code-in { font-family: ui-monospace, Menlo, monospace; font-size: 13px; min-height: 130px; }
.field-err { color: var(--bad); font-size: 12.5px; font-family: var(--f-ui); min-height: 0; }
.modal.sm { max-width: 440px; } .modal.lg { max-width: 760px; }
.modal-body { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 480px) { .modal { padding: 22px 18px; border-radius: 22px; } .modal-footer { flex-wrap: wrap; } .modal-footer .btn { flex: 1; } }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked + i { background: var(--accent); } .switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- chaves ---- */
.key-list { display: flex; flex-direction: column; gap: 12px; }
.key-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--r); background: var(--paper); box-shadow: var(--sh-sm), inset 0 0 0 1px var(--line); transition: transform .15s, box-shadow .15s; }
.key-row:hover { transform: translateY(-2px); }
.key-row.revoked { opacity: .6; }
.key-row h3 { font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.key-meta { font-size: 12.5px; color: var(--text-mute); display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 4px; }
.scopes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.scope { font-family: var(--f-ui); font-size: 11px; padding: 2px 9px; border-radius: 99px; background: var(--bg-2); color: var(--text-soft); }
.meter-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-soft); margin-bottom: 6px; gap: 8px; }
@media (max-width: 760px) { .key-row { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.reveal-key { display: flex; flex-direction: column; gap: 12px; }
.key-display { font-size: 13px; align-items: flex-start; }
.key-display code { overflow-wrap: anywhere; user-select: all; flex: 1; }

/* ---- pix ---- */
.amount-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.amount-btn { font: inherit; font-family: var(--f-ui); font-size: 16px; font-weight: 500; padding: 16px 10px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.amount-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.amount-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.pix-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; }
.qr { width: 220px; max-width: 100%; padding: 12px; border-radius: var(--r); background: #fff; box-shadow: inset 0 0 0 1px var(--line), var(--sh-sm); }
.qr svg { width: 100%; height: auto; display: block; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 11px 12px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--bg-2); color: var(--ink); text-overflow: ellipsis; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 100% { box-shadow: 0 0 0 12px transparent; } }
.paid { text-align: center; align-items: center; padding: 28px 12px; }
.paid .tick { width: 72px; height: 82px; display: grid; place-items: center; background: linear-gradient(160deg, #3FBF7F, #1F8F55); color: #fff; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); animation: pop .5s cubic-bezier(.22,1.4,.4,1) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@media (max-width: 640px) { .pix-box { grid-template-columns: minmax(0, 1fr); justify-items: center; } .pix-box > * { width: 100%; } .pix-box .qr { width: 200px; } }

/* ---- catalogo ---- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tool-card { text-align: left; font: inherit; color: inherit; cursor: pointer; border: 0; background: var(--paper); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sh-sm), inset 0 0 0 1px var(--line); transition: transform .18s, box-shadow .18s; min-width: 0; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--sh), inset 0 0 0 1px var(--accent); }
.tool-card h3 { font-size: 16px; overflow-wrap: anywhere; }
.tool-card p { font-size: 13.5px; color: var(--text-soft); flex: 1; }
.tool-card .price { font-family: var(--f-ui); font-weight: 600; color: var(--accent-strong); }
.method { font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--night); color: var(--on-night); }
.play-out { max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- saude / status ---- */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--text-mute); margin-right: 8px; }
.dot.ok { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 18px; font-size: 14px; }
.kv dt { color: var(--text-mute); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.recovery code { padding: 8px 10px; border-radius: 8px; background: var(--bg-2); text-align: center; font-size: 13px; }
.sparkline { display: flex; gap: 3px; align-items: flex-end; height: 48px; }
.sparkline i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-width: 3px; animation: grow .6s both; transform-origin: bottom; }
.sparkline i.bad { background: var(--bad); }

/* ---- complementos ---- */
.hero-row { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; }

.mini .stat-card { justify-content: center; }
.mini-wide { grid-column: 1 / -1; }
.hero-row .card-honey { justify-content: center; }
@media (max-width: 900px) { .hero-row { grid-template-columns: minmax(0, 1fr); } }
.sec-h { font-family: var(--f-ui); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); margin: 8px 0 0; }
.fs { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.fs legend { font-family: var(--f-ui); font-size: 12.5px; font-weight: 600; color: var(--text-soft); padding: 0 6px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-soft); font-size: 14px; }
.qr.center { margin: 0 auto; }
ul.key-list { list-style: none; margin: 0; padding: 0; }
.key-display { color: #F4E8C8; }
.empty-state { color: var(--text-soft); }
pre.code { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.page-intro + .toolbar, .toolbar + .toolbar { margin-top: -8px; }

[hidden] { display: none !important; }
.auth-art-in > :not(.honey-grid) { position: relative; z-index: 1; }
.chart .bar-lbl { font-size: 9px; }
@media (max-width: 640px) { .chart { overflow-x: auto; } .chart svg { min-width: 560px; } }
.switch { display: inline-block; }
