/* =========================================================
   Naryen — Painel Administrativo (v2)
   Design system: vidro escuro + acentos violeta/magenta/ice.
   Mobile-first: tabelas viram cards, gavetas viram bottom sheets,
   barra de navegação inferior e botão de ação flutuante.
   ========================================================= */
:root {
    --mag: #FF66FF; --vio: #B26BFF; --sky: #6FCFFF; --ice: #B2FFFF; --ink: #EEEBFF;
    --dim: rgba(238, 235, 255, .70); --faint: rgba(238, 235, 255, .46);
    --line: rgba(238, 235, 255, .09); --line-2: rgba(238, 235, 255, .18);
    --bg: #05030E; --bg-2: #0B0719; --panel: rgba(21, 15, 44, .72); --panel-solid: #120C28; --panel-2: rgba(34, 24, 68, .62);
    --ok: #5CF2B0; --warn: #FFC56B; --bad: #FF7A93; --info: #6FCFFF;
    --grad: linear-gradient(120deg, #9B5CFF, #FF66FF);
    --grad-soft: linear-gradient(120deg, rgba(155, 92, 255, .22), rgba(255, 102, 255, .14));
    --radius: 16px; --radius-sm: 11px;
    --sb: 268px; --sb-collapsed: 78px; --tabbar: 66px;
    --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
    --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.4, .5, 1);
    --shadow: 0 18px 50px -18px rgba(0, 0, 0, .75), 0 0 0 1px var(--line) inset;
}
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); font: 400 15px/1.55 'Manrope', system-ui, sans-serif; background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: clip; max-width: 100vw; }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: 'Unbounded', sans-serif; font-weight: 400; letter-spacing: -.02em; }
p { margin: 0; }
img { max-width: 100%; display: block; }
::selection { background: rgba(178, 107, 255, .45); }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--dim); } .faint { color: var(--faint); } .small { font-size: 13px; }
.mono { font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; font-size: 13px; letter-spacing: .02em; }
.num { font-variant-numeric: tabular-nums; } .upper { text-transform: uppercase; } .ta-r { text-align: right !important; }
.c-ok { color: var(--ok); } .c-bad { color: var(--bad); } .c-info { color: var(--ice); } .c-warn { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scroll-thin { scrollbar-width: thin; scrollbar-color: rgba(238, 235, 255, .2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(238, 235, 255, .14); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* ---------- Fundo animado ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; contain: strict; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.o1 { width: 52vmax; height: 52vmax; left: -18vmax; top: -22vmax; background: radial-gradient(circle, rgba(155, 92, 255, .55), transparent 68%); animation: drift 22s ease-in-out infinite alternate; }
.o2 { width: 44vmax; height: 44vmax; right: -16vmax; bottom: -20vmax; background: radial-gradient(circle, rgba(255, 102, 255, .38), transparent 68%); animation: drift 26s ease-in-out infinite alternate-reverse; }
.grid { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%); opacity: .5; }
@keyframes drift { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); } }

/* ---------- Barra de progresso global ---------- */
#progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300; overflow: hidden; opacity: 0; transition: opacity .25s; pointer-events: none; }
#progress.on { opacity: 1; }
#progress::before { content: ""; position: absolute; inset: 0; width: 40%; background: var(--grad); box-shadow: 0 0 14px var(--mag); border-radius: 3px; animation: indet 1.1s var(--ease) infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Splash ---------- */
#splash { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: var(--bg); transition: opacity .5s var(--ease), visibility .5s; }
#splash.done { opacity: 0; visibility: hidden; }
.splash-core { position: relative; width: 112px; height: 112px; display: grid; place-items: center; }
.splash-core img { width: 54px; height: 54px; border-radius: 14px; animation: breathe 2s ease-in-out infinite; position: relative; z-index: 2; }
.splash-core .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--mag); border-right-color: var(--vio); animation: spin 1.1s linear infinite; }
.splash-core .ring.r2 { inset: 14px; border-top-color: var(--ice); border-right-color: transparent; border-left-color: var(--sky); animation-duration: 1.7s; animation-direction: reverse; opacity: .7; }
.splash-core::after { content: ""; position: absolute; inset: -30px; background: radial-gradient(circle, rgba(178, 107, 255, .35), transparent 65%); animation: breathe 2s ease-in-out infinite; z-index: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.1); opacity: .85; } }

/* ---------- Botões ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(238, 235, 255, .04); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .3s, opacity .2s; user-select: none; }
.btn:hover { background: rgba(238, 235, 255, .09); border-color: rgba(238, 235, 255, .32); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { border: 0; background: var(--grad); color: #fff; box-shadow: 0 8px 26px -8px rgba(255, 102, 255, .6), 0 0 0 1px rgba(255, 255, 255, .12) inset; }
.btn-primary:hover { background: var(--grad); box-shadow: 0 12px 34px -8px rgba(255, 102, 255, .8), 0 0 0 1px rgba(255, 255, 255, .2) inset; transform: translateY(-1px); }
.btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60%; left: -80%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-18deg); transition: left .7s var(--ease); }
.btn-primary:hover::after { left: 130%; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); border-color: rgba(255, 122, 147, .35); background: rgba(255, 122, 147, .08); }
.btn-danger:hover { background: rgba(255, 122, 147, .18); border-color: rgba(255, 122, 147, .6); }
.btn-danger.solid { background: linear-gradient(120deg, #FF4D6D, #FF7A93); color: #fff; border: 0; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; min-height: 48px; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { opacity: 0; }
.btn.is-loading::before { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; z-index: 2; }
.btn.is-done { pointer-events: none; }
.btn.is-done::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, #2fd18a, #5CF2B0); animation: pop .35s var(--spring); z-index: 1; }
.btn.is-done::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #04200f; font-weight: 800; font-size: 18px; z-index: 2; left: 0; width: auto; background: none; transform: none; animation: pop .35s var(--spring); }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent; transition: background .2s, border-color .2s, transform .2s var(--ease), color .2s; flex: none; }
.icon-btn:hover { background: rgba(238, 235, 255, .08); border-color: var(--line); }
.icon-btn:active { transform: scale(.92); }
.action-btn { white-space: nowrap; overflow-wrap: normal; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line); background: rgba(238, 235, 255, .04); font-size: 12.5px; font-weight: 600; transition: all .2s var(--ease); }
.action-btn .ic { width: 14px; height: 14px; }
.action-btn:hover { background: rgba(238, 235, 255, .1); border-color: var(--line-2); transform: translateY(-1px); }
.action-btn.success { color: var(--ok); border-color: rgba(92, 242, 176, .3); background: rgba(92, 242, 176, .07); }
.action-btn.success:hover { background: rgba(92, 242, 176, .16); }
.action-btn.danger { color: var(--bad); border-color: rgba(255, 122, 147, .28); background: rgba(255, 122, 147, .06); }
.action-btn.danger:hover { background: rgba(255, 122, 147, .16); }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
@media (min-width: 761px) { td .action-btn:not(.success) { width: 34px; padding: 0; justify-content: center; } td .action-btn:not(.success) .al { display: none; } .action-btn .ic { width: 15px; height: 15px; } }

/* ---------- Formulários ---------- */
.field { margin-bottom: 16px; position: relative; }
.field label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--dim); }
.field label small, .hint { font-weight: 400; color: var(--faint); }
.hint { display: block; margin-top: 6px; font-size: 12px; }
.form-control { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; color: var(--ink); background: rgba(238, 235, 255, .045); border: 1px solid var(--line-2); font: inherit; font-size: 15px; transition: border-color .25s, box-shadow .25s, background .25s; appearance: none; -webkit-appearance: none; }
textarea.form-control { resize: vertical; min-height: 92px; line-height: 1.55; }
select.form-control { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23EEEBFF' stroke-opacity='.6' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
select.form-control option { background: #120C28; color: var(--ink); }
.form-control::placeholder { color: var(--faint); }
.form-control:hover { border-color: rgba(238, 235, 255, .3); }
.form-control:focus { outline: none; border-color: var(--vio); background: rgba(178, 107, 255, .08); box-shadow: 0 0 0 4px rgba(178, 107, 255, .2); }
.form-control[readonly] { color: var(--dim); }
.form-control.invalid { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(255, 122, 147, .15); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.input-group { display: flex; flex-wrap: wrap; gap: 8px; } .input-group .form-control { flex: 1 1 170px; min-width: 0; } .input-group .btn { flex: 0 0 auto; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.switches { display: grid; gap: 10px; margin-bottom: 4px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(238, 235, 255, .03); cursor: pointer; font-weight: 600; font-size: 14px; transition: border-color .2s, background .2s; }
.switch:hover { border-color: var(--line-2); background: rgba(238, 235, 255, .06); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { order: 2; position: relative; width: 44px; height: 26px; border-radius: 99px; background: rgba(238, 235, 255, .16); transition: background .3s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .35s var(--spring); }
.switch input:checked + .track { background: var(--grad); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ice); outline-offset: 2px; }

/* ---------- Login ---------- */
#login-view { position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh; display: none; align-items: center; justify-content: center; padding: 24px 16px; }
#login-view.show { display: flex; }
.login-card { width: 100%; max-width: 420px; padding: 36px 30px 30px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line-2); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9), 0 0 80px -30px rgba(178, 107, 255, .5); animation: rise .8s var(--ease) both; position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--grad); }
.login-card .brand { justify-content: center; margin-bottom: 26px; }
.login-title { font-size: 24px; text-align: center; margin-bottom: 8px; }
.login-card > .muted { text-align: center; margin-bottom: 26px; }
.login-card .field { animation: rise .7s var(--ease) both; } .login-card .field:nth-of-type(1) { animation-delay: .12s; } .login-card .field:nth-of-type(2) { animation-delay: .2s; }
.pw-wrap { position: relative; } .pw-wrap .form-control { padding-right: 48px; }
.pw-wrap .icon-btn { position: absolute; right: 3px; top: 3px; width: 40px; height: 40px; }
#login-error { margin-top: 14px; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; color: var(--bad); background: rgba(255, 122, 147, .1); border: 1px solid rgba(255, 122, 147, .3); display: none; animation: shake .4s; }
.login-foot { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--faint); }
.login-foot a:hover { color: var(--ice); }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 12px; font-family: 'Unbounded', sans-serif; font-weight: 500; letter-spacing: .22em; font-size: 14px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand-lg img { width: 46px; height: 46px; border-radius: 13px; }
.brand-lg { font-size: 17px; }

/* ---------- App shell ---------- */
#dashboard-view { position: relative; z-index: 2; display: none; min-height: 100vh; min-height: 100dvh; }
#dashboard-view.show { display: flex; animation: appIn .7s var(--ease) both; }
@keyframes appIn { from { opacity: 0; transform: scale(.992); } to { opacity: 1; transform: none; } }
.sidebar { position: sticky; top: 0; align-self: flex-start; width: var(--sb); height: 100vh; height: 100dvh; padding: 22px 14px 14px; display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(14, 9, 32, .86), rgba(8, 5, 20, .92)); border-right: 1px solid var(--line); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); transition: width .35s var(--ease), transform .4s var(--ease); z-index: 80; flex: none; }
.sidebar .brand { padding: 4px 8px 24px; }
.brand-txt { transition: opacity .2s; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-label { display: block; padding: 18px 12px 8px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.tab-btn { position: relative; display: flex; align-items: center; gap: 13px; width: 100%; height: 44px; padding: 0 12px; margin-bottom: 3px; border: 0; border-radius: 12px; background: transparent; color: var(--dim); font-weight: 600; font-size: 14.5px; text-align: left; white-space: nowrap; overflow: hidden; transition: color .25s, background .25s, transform .2s var(--ease); }
.tab-btn:hover { color: var(--ink); background: rgba(238, 235, 255, .06); }
.tab-btn:active { transform: scale(.98); }
.tab-btn .ic { transition: transform .3s var(--spring), color .25s; }
.tab-btn:hover .ic { transform: scale(1.12); }
.tab-btn.active { color: #fff; background: var(--grad-soft); box-shadow: 0 0 0 1px rgba(178, 107, 255, .35) inset; }
.tab-btn.active .ic { color: var(--ice); }
.tab-btn.active::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px var(--mag); animation: grow .4s var(--ease); }
@keyframes grow { from { transform: scaleY(0); } }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 99px; font-size: 11.5px; font-weight: 800; background: var(--grad); color: #fff; box-shadow: 0 4px 14px -3px rgba(255, 102, 255, .7); animation: pop .4s var(--spring); }
.user { display: flex; align-items: center; gap: 11px; padding: 10px; margin-top: 8px; border-radius: 14px; border: 1px solid var(--line); background: rgba(238, 235, 255, .04); }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; flex: none; font-family: 'Unbounded', sans-serif; font-size: 15px; }
.user-meta { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.user-meta small { font-size: 11px; color: var(--faint); }
.user-meta span { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collapse-btn { position: absolute; top: 26px; right: -14px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-solid); display: grid; place-items: center; transition: transform .35s var(--ease), background .2s; z-index: 5; }
.collapse-btn:hover { background: #1b1240; }
.collapse-btn .ic { width: 14px; height: 14px; }

/* sidebar recolhida (desktop) */
body.sb-collapsed .sidebar { width: var(--sb-collapsed); }
body.sb-collapsed .brand-txt, body.sb-collapsed .user-meta, body.sb-collapsed .tab-btn .lbl, body.sb-collapsed #btn-logout { display: none; }
body.sb-collapsed .nav-label { height: 1px; padding: 0; margin: 14px 10px; background: var(--line); font-size: 0; }
body.sb-collapsed .tab-btn { justify-content: center; padding: 0; }
body.sb-collapsed .tab-btn .nav-count { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; font-size: 10px; margin: 0; }
body.sb-collapsed .sidebar .brand { justify-content: center; padding-inline: 0; }
body.sb-collapsed .user { justify-content: center; padding: 8px; }
body.sb-collapsed .collapse-btn { transform: rotate(180deg); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; padding: calc(14px + var(--safe-t)) clamp(16px, 3vw, 34px) 14px; background: linear-gradient(180deg, rgba(5, 3, 14, .92), rgba(5, 3, 14, .72)); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line); }
.topbar .titles { min-width: 0; flex: 1; }
.crumb { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.page-title { font-size: clamp(17px, 2.4vw, 22px); line-height: 1.25; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-title.swap, .crumb.swap { animation: titleIn .45s var(--ease); }
@keyframes titleIn { from { opacity: 0; transform: translateY(8px); } }
.cmd-btn { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px 0 14px; min-width: 220px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(238, 235, 255, .04); color: var(--faint); font-size: 14px; transition: all .25s var(--ease); }
.cmd-btn:hover { border-color: rgba(238, 235, 255, .35); color: var(--ink); background: rgba(238, 235, 255, .08); }
.cmd-btn kbd { margin-left: auto; font: 600 11px 'Manrope'; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--dim); }
.content { padding: clamp(16px, 3vw, 34px); width: 100%; max-width: 1360px; margin: 0 auto; flex: 1; }

/* ---------- Abas (transição) ---------- */
.tab-content { display: none; }
.tab-content.active { display: block; animation: tabIn .55s var(--ease) both; }
@keyframes tabIn { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.rise { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.stagger > * { animation: rise .65s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .04s; } .stagger > *:nth-child(2) { animation-delay: .1s; } .stagger > *:nth-child(3) { animation-delay: .16s; } .stagger > *:nth-child(4) { animation-delay: .22s; } .stagger > *:nth-child(5) { animation-delay: .28s; } .stagger > *:nth-child(6) { animation-delay: .34s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.lead { color: var(--dim); max-width: 62ch; margin-bottom: 22px; }

/* ---------- Cards ---------- */
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); transition: border-color .3s, transform .35s var(--ease), box-shadow .35s; }
.card.hoverable:hover { border-color: rgba(178, 107, 255, .38); transform: translateY(-3px); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-head h2 { font-size: 17px; margin-top: 3px; }
.eyebrow { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--vio); font-weight: 700; }
.narrow { max-width: 640px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.cms-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.cms-card.wide { grid-column: 1 / -1; }
.cms-card .dirty { display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 10px var(--warn); margin-left: 8px; vertical-align: middle; animation: pop .3s var(--spring); }
.cms-card.is-dirty .dirty { display: inline-block; }
.cms-card.is-dirty { border-color: rgba(255, 197, 107, .35); }
.counter { float: right; font-weight: 500; color: var(--faint); font-size: 11.5px; }

/* ---------- Hero / saudação ---------- */
.hero-card { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: clamp(22px, 3vw, 32px); margin-bottom: 18px; border-radius: 22px; border: 1px solid rgba(178, 107, 255, .3); background: radial-gradient(120% 140% at 0% 0%, rgba(155, 92, 255, .32), transparent 60%), radial-gradient(90% 120% at 100% 100%, rgba(255, 102, 255, .22), transparent 60%), var(--panel); }
.hero-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .06) 50%, transparent 60%); transform: translateX(-100%); animation: sweep 6s ease-in-out infinite 1.5s; pointer-events: none; }
@keyframes sweep { 40%, 100% { transform: translateX(100%); } }
.hero-card h2 { font-size: clamp(20px, 3vw, 28px); line-height: 1.2; }
.hero-card h2 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-card p { margin-top: 8px; color: var(--dim); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 2; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .35s var(--ease), border-color .3s; }
.kpi:hover { transform: translateY(-3px); border-color: var(--line-2); }
.kpi::after { content: ""; position: absolute; width: 120px; height: 120px; right: -40px; top: -50px; border-radius: 50%; background: radial-gradient(circle, var(--kc, rgba(178, 107, 255, .35)), transparent 70%); opacity: .6; pointer-events: none; }
.kpi .kpi-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 8px; background: rgba(238, 235, 255, .07); color: var(--kcol, var(--vio)); }
.kpi > span { font-size: 12.5px; color: var(--dim); font-weight: 600; }
.kpi > strong { font: 500 clamp(20px, 2.6vw, 26px)/1.2 'Unbounded', sans-serif; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi > small { font-size: 12px; color: var(--faint); }
.kpi.k-ok { --kc: rgba(92, 242, 176, .3); --kcol: var(--ok); } .kpi.k-bad { --kc: rgba(255, 122, 147, .32); --kcol: var(--bad); }
.kpi.k-info { --kc: rgba(111, 207, 255, .3); --kcol: var(--sky); } .kpi.k-warn { --kc: rgba(255, 197, 107, .3); --kcol: var(--warn); }

/* ---------- Gráfico ---------- */
.chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(6px, 2vw, 18px); align-items: end; height: 210px; padding-top: 10px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; min-width: 0; }
.bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 5px; border-bottom: 1px solid var(--line-2); position: relative; }
.bar { width: min(22px, 38%); border-radius: 7px 7px 2px 2px; min-height: 3px; height: 0; transition: height 1s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); position: relative; }
.bar.paid { background: linear-gradient(180deg, #7dffc8, #2fd18a); box-shadow: 0 0 18px -4px rgba(92, 242, 176, .6); }
.bar.open { background: linear-gradient(180deg, #d5a8ff, #8b5cff); box-shadow: 0 0 18px -4px rgba(178, 107, 255, .6); }
.bar:hover { filter: brightness(1.25); }
.bar-col > small { font-size: 11.5px; color: var(--faint); text-transform: capitalize; }
.bar-col.cur > small { color: var(--ice); font-weight: 700; }
.legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12.5px; color: var(--dim); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }

/* ---------- Listas compactas ---------- */
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0 -8px; }
.li { display: flex; align-items: center; gap: 13px; padding: 10px 8px; border-radius: 12px; transition: background .2s; cursor: default; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
button.li, a.li { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
button.li:hover, a.li:hover { background: rgba(238, 235, 255, .06); }
.li .li-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(238, 235, 255, .06); color: var(--vio); flex: none; font-weight: 800; font-family: 'Unbounded'; font-size: 14px; }
.li .li-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.li .li-main strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .li-main small { font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .li-end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13.5px; font-weight: 700; }
.li .li-end small { font-weight: 500; font-size: 12px; color: var(--faint); }
.li.unread .li-ic { background: var(--grad); color: #fff; }
.card-link { font-size: 12.5px; font-weight: 700; color: var(--ice); display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 0; }
.card-link .ic { width: 14px; height: 14px; transition: transform .25s var(--ease); } .card-link:hover .ic { transform: translateX(3px); }
.mini-empty { padding: 26px 10px; text-align: center; color: var(--faint); font-size: 13.5px; }

/* ---------- Toolbar / tabelas ---------- */
.table-card { padding: 0; overflow: hidden; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.toolbar h2 { font-size: 16px; } .toolbar > div:first-child { min-width: 0; }
.toolbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-wrap { position: relative; } .search-wrap .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; width: 17px; height: 17px; }
.search { width: 250px; max-width: 100%; height: 42px; padding: 0 14px 0 40px; border-radius: 12px; color: var(--ink); background: rgba(238, 235, 255, .045); border: 1px solid var(--line-2); font: inherit; font-size: 14px; transition: all .3s var(--ease); }
.search:focus { outline: none; width: 300px; border-color: var(--vio); box-shadow: 0 0 0 4px rgba(178, 107, 255, .2); background: rgba(178, 107, 255, .08); }
.search::placeholder { color: var(--faint); }
.table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 22px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); white-space: nowrap; background: rgba(238, 235, 255, .025); border-bottom: 1px solid var(--line); }
td { padding: 14px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(178, 107, 255, .07); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.enter { animation: rowIn .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 38ms); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-12px); } }
tbody tr.clickable { cursor: pointer; }
tbody tr.row-unread td:first-child { box-shadow: 3px 0 0 var(--mag) inset; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 600; }
.cell-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--faint); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-thumb { position: relative; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; overflow: hidden; background: var(--grad-soft); border: 1px solid rgba(178, 107, 255, .3); font-family: 'Unbounded'; font-size: 14px; color: var(--ice); }
.logo-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--panel-solid); }
.msg-cell { display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.b-ok { color: var(--ok); background: rgba(92, 242, 176, .1); border-color: rgba(92, 242, 176, .25); }
.b-bad { color: var(--bad); background: rgba(255, 122, 147, .1); border-color: rgba(255, 122, 147, .28); }
.b-warn { color: var(--warn); background: rgba(255, 197, 107, .1); border-color: rgba(255, 197, 107, .28); }
.b-info { color: var(--sky); background: rgba(111, 207, 255, .1); border-color: rgba(111, 207, 255, .28); }
.b-vio { color: var(--vio); background: rgba(178, 107, 255, .13); border-color: rgba(178, 107, 255, .32); }
.b-off { color: var(--faint); background: rgba(238, 235, 255, .05); border-color: var(--line); }
.b-off::before { box-shadow: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -2px; padding: 2px; max-width: 100%; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--dim); font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: all .25s var(--ease); }
.chip:hover { color: var(--ink); border-color: rgba(238, 235, 255, .35); }
.chip.active { color: #fff; border-color: transparent; background: var(--grad); box-shadow: 0 6px 20px -6px rgba(255, 102, 255, .7); }
.chip em { font-style: normal; font-size: 11.5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; background: rgba(238, 235, 255, .12); }
.chip.active em { background: rgba(255, 255, 255, .25); }
.segmented { position: relative; display: inline-flex; padding: 4px; margin-bottom: 18px; border-radius: 14px; background: rgba(238, 235, 255, .05); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 10px; background: var(--grad); box-shadow: 0 6px 18px -6px rgba(255, 102, 255, .7); transition: transform .45s var(--spring), width .45s var(--spring); pointer-events: none; }
.seg { position: relative; z-index: 1; height: 38px; padding: 0 20px; border: 0; background: transparent; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--dim); transition: color .25s; white-space: nowrap; }
.seg.active { color: #fff; }
.sub { display: none; } .sub.active { display: block; animation: tabIn .5s var(--ease) both; }

/* ---------- Skeleton shimmer ---------- */
.sk { display: block; height: 14px; border-radius: 8px; background: linear-gradient(100deg, rgba(238, 235, 255, .06) 30%, rgba(238, 235, 255, .17) 50%, rgba(238, 235, 255, .06) 70%); background-size: 250% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.sk-row td { padding-top: 17px; padding-bottom: 17px; } .sk-row .sk { width: 78%; } .sk-row td:nth-child(2n) .sk { width: 56%; } .sk-row td:nth-child(3n) .sk { width: 66%; } .sk-row td:last-child .sk { width: 52px; margin-left: auto; }
.sk-row td:first-child .sk { width: 88%; height: 18px; }
.sk-row:hover { background: none !important; }
.sk-li { display: flex; align-items: center; gap: 13px; padding: 10px 8px; } .sk-li .sk-c { width: 38px; height: 38px; border-radius: 12px; flex: none; } .sk-li div { flex: 1; display: grid; gap: 8px; } .sk-li .sk:nth-child(2) { width: 55%; height: 11px; }
.kpi.is-loading > strong, .kpi.is-loading > small { color: transparent !important; position: relative; border-radius: 8px; background: linear-gradient(100deg, rgba(238, 235, 255, .06) 30%, rgba(238, 235, 255, .17) 50%, rgba(238, 235, 255, .06) 70%); background-size: 250% 100%; animation: shimmer 1.4s linear infinite; width: fit-content; user-select: none; }
.kpi.is-loading > strong { min-width: 110px; } .kpi.is-loading > small { min-width: 80px; }
.card.is-loading .form-control { color: transparent; border-color: transparent; background: linear-gradient(100deg, rgba(238, 235, 255, .06) 30%, rgba(238, 235, 255, .17) 50%, rgba(238, 235, 255, .06) 70%); background-size: 250% 100%; animation: shimmer 1.4s linear infinite; pointer-events: none; }
.chart.is-loading .bar { height: calc(30px + var(--i, 0) * 16px) !important; background: linear-gradient(100deg, rgba(238, 235, 255, .06) 30%, rgba(238, 235, 255, .17) 50%, rgba(238, 235, 255, .06) 70%) 0 0 / 250% 100%; animation: shimmer 1.4s linear infinite; box-shadow: none; }

/* ---------- Estado vazio ---------- */
.empty { display: none; flex-direction: column; align-items: center; gap: 6px; padding: 54px 20px; text-align: center; }
.empty.show { display: flex; animation: rise .6s var(--ease) both; }
.empty .empty-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 10px; background: var(--grad-soft); border: 1px solid rgba(178, 107, 255, .3); color: var(--vio); animation: float 4s ease-in-out infinite; }
.empty .empty-ic .ic { width: 28px; height: 28px; }
.empty strong { font-family: 'Unbounded'; font-weight: 400; font-size: 16px; }
.empty span { color: var(--faint); font-size: 14px; max-width: 38ch; }
.empty .btn { margin-top: 14px; }
@keyframes float { 50% { transform: translateY(-6px); } }

/* ---------- Gavetas / bottom sheets ---------- */
.form-view { display: none; max-width: 760px; margin: 0 auto; }
.form-view.open { display: block; animation: tabIn .5s var(--ease) both; }
#drawer-sistema { max-width: 1040px; }
.fv-head { display: flex; align-items: center; margin-bottom: 14px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 8px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(238, 235, 255, .04); font-weight: 700; font-size: 14px; transition: all .25s var(--ease); }
.back-btn:hover { background: rgba(238, 235, 255, .09); border-color: rgba(238, 235, 255, .35); transform: translateX(-2px); }
.back-btn .ic { width: 20px; height: 20px; }
.fv-body { display: flex; flex-direction: column; padding: 26px 26px 0; overflow: visible; }
.fv-body > .field, .fv-body > .row-2, .fv-body > .switches, .fv-body > .divider { flex: none; }
#drawer-sistema .fv-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; align-content: start; }
#drawer-sistema .fv-body > .row-2, #drawer-sistema .fv-body > .switches, #drawer-sistema .fv-body > .divider, #drawer-sistema .fv-body > #sys-plans-section, #drawer-sistema .fv-body > .fv-foot { grid-column: 1 / -1; }
#drawer-sistema .fv-body > .switches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fv-foot { position: sticky; bottom: 0; z-index: 5; margin: 10px -26px 0; padding: 16px 26px calc(16px + var(--safe-b)); display: flex; gap: 10px; justify-content: flex-end; background: linear-gradient(180deg, rgba(18, 12, 40, .6), #0f0a24 40%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.fv-foot .btn { flex: 0 1 auto; min-width: 120px; } .fv-foot .btn-primary { flex: 1 1 auto; max-width: 260px; }
body.in-form .tabbar, body.in-form #fab, body.in-form .tab-content { display: none !important; }
body.in-form .content { padding-bottom: 24px; }
.menu-user { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 16px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.menu-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; min-height: 108px; padding: 16px; text-align: left; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); font-weight: 700; font-size: 15px; transition: transform .25s var(--ease), border-color .25s, background .25s; animation: rise .5s var(--ease) both; }
.menu-tile:nth-child(2) { animation-delay: .04s; } .menu-tile:nth-child(3) { animation-delay: .08s; } .menu-tile:nth-child(4) { animation-delay: .12s; } .menu-tile:nth-child(5) { animation-delay: .16s; } .menu-tile:nth-child(6) { animation-delay: .2s; } .menu-tile:nth-child(7) { animation-delay: .24s; } .menu-tile:nth-child(8) { animation-delay: .28s; }
.menu-tile .ic { width: 26px; height: 26px; color: var(--vio); }
.menu-tile:active { transform: scale(.97); }
.menu-tile.active { background: var(--grad-soft); border-color: rgba(178, 107, 255, .5); } .menu-tile.active .ic { color: var(--ice); }
.menu-badge { position: absolute; top: 12px; right: 12px; min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border-radius: 99px; font-style: normal; font-size: 12px; font-weight: 800; background: var(--grad); color: #fff; }
.menu-actions { display: grid; gap: 10px; }
.detail-meta { display: grid; gap: 14px; margin-bottom: 20px; }
.detail-meta .row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(238, 235, 255, .04); border: 1px solid var(--line); min-width: 0; }
.detail-meta .row .ic { color: var(--vio); } .detail-meta .row div { min-width: 0; display: flex; flex-direction: column; } .detail-meta small { font-size: 11.5px; color: var(--faint); } .detail-meta strong, .detail-meta a { font-weight: 600; overflow-wrap: anywhere; }
.msg-body { padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: rgba(238, 235, 255, .035); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; margin-bottom: 20px; }

/* planos dentro da gaveta de sistema */
.plan-card { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; margin-bottom: 10px; background: rgba(238, 235, 255, .035); animation: rise .45s var(--ease) both; }
.plan-card .pc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .plan-card .pc-top strong:last-child { color: var(--ice); }
.plan-card .pc-actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.coupon { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; border-radius: 9px; border: 1px dashed var(--line-2); font-size: 12.5px; background: rgba(0, 0, 0, .18); }
.coupon .mini { display: inline-flex; gap: 6px; }
.link-btn { background: none; border: 0; padding: 2px 4px; font-size: 12.5px; font-weight: 700; color: var(--ice); cursor: pointer; } .link-btn.bad { color: var(--bad); } .link-btn:hover { text-decoration: underline; }

/* ---------- Modal de confirmação / paleta ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 16px; background: rgba(3, 1, 10, .7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility 0s linear .3s; }
.modal-wrap.open { opacity: 1; visibility: visible; transition: opacity .3s var(--ease), visibility 0s; }
.modal { width: 100%; max-width: 400px; padding: 28px 24px 22px; text-align: center; border-radius: 22px; background: linear-gradient(180deg, #1a1238, #0f0a24); border: 1px solid var(--line-2); box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .9); transform: translateY(24px) scale(.94); transition: transform .45s var(--spring); }
.modal-wrap.open .modal { transform: none; }
.modal .m-ic { width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 122, 147, .12); color: var(--bad); border: 1px solid rgba(255, 122, 147, .3); }
.modal .m-ic.neutral { background: var(--grad-soft); color: var(--vio); border-color: rgba(178, 107, 255, .35); }
.modal .m-ic .ic { width: 26px; height: 26px; }
.modal h3 { font-size: 18px; margin-bottom: 8px; } .modal p { color: var(--dim); font-size: 14.5px; }
.modal .m-actions { display: flex; gap: 10px; margin-top: 24px; } .modal .m-actions .btn { flex: 1; min-height: 46px; }
.modal.paylink { max-width: 520px; } .modal.paylink .m-actions .btn { text-decoration: none; justify-content: center; }
.modal.paylink #paylink-url { text-align: center; }
.palette-wrap { align-items: start; padding-top: min(14vh, 110px); }
.palette { width: 100%; max-width: 580px; border-radius: 20px; overflow: hidden; background: linear-gradient(180deg, #1a1238, #0f0a24); border: 1px solid var(--line-2); box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .9), 0 0 70px -25px rgba(178, 107, 255, .6); transform: translateY(-14px) scale(.97); transition: transform .4s var(--spring); }
.modal-wrap.open .palette { transform: none; }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--faint); }
.pal-input input { flex: 1; height: 58px; background: none; border: 0; color: var(--ink); font: inherit; font-size: 16px; outline: none; }
.pal-input kbd { font: 600 11px 'Manrope'; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--dim); }
.pal-list { max-height: min(56vh, 420px); overflow-y: auto; padding: 8px; }
.pal-group { padding: 10px 12px 6px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; transition: background .15s; }
.pal-item .ic { color: var(--vio); } .pal-item span { flex: 1; min-width: 0; display: flex; flex-direction: column; } .pal-item strong { font-size: 14.5px; font-weight: 600; } .pal-item small { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item.sel { background: var(--grad-soft); box-shadow: 0 0 0 1px rgba(178, 107, 255, .4) inset; }
.pal-empty { padding: 30px; text-align: center; color: var(--faint); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; z-index: 500; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; max-width: min(380px, calc(100vw - 32px)); padding: 13px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; background: rgba(22, 15, 46, .94); border: 1px solid var(--line-2); backdrop-filter: blur(14px); box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .8); pointer-events: auto; animation: toastIn .5s var(--spring) both; }
.toast .t-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(92, 242, 176, .14); color: var(--ok); flex: none; } .toast .t-ic .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.toast.error .t-ic { background: rgba(255, 122, 147, .14); color: var(--bad); }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--ok); transform-origin: left; animation: life var(--life, 3.4s) linear forwards; } .toast.error::after { background: var(--bad); }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes life { to { transform: scaleX(0); } }

/* ---------- Barra inferior (mobile) + FAB ---------- */
.tabbar, #fab { display: none; }

/* =========================================================
   Responsivo
   ========================================================= */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 1101px) { .kpis > :last-child:nth-child(odd) { grid-column: auto; } }
@media (max-width: 1180px) {
    .cms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2.wide-left { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
    .cmd-btn { min-width: 0; } .cmd-btn .cmd-txt, .cmd-btn kbd { display: none; } .cmd-btn { padding: 0; width: 42px; justify-content: center; }
}
@media (max-width: 900px) {
    .sidebar { display: none; }
    #btn-view-site .txt { display: none; } #btn-view-site { padding: 0; width: 42px; }
    .content { padding-bottom: calc(var(--tabbar) + var(--safe-b) + 96px); }
    body.app-on .tabbar { display: grid; }
    .tabbar { position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); height: var(--tabbar); grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 22px; background: rgba(18, 12, 40, .86); border: 1px solid var(--line-2); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .9); }
    .tb { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; border-radius: 16px; color: var(--faint); font-size: 10.5px; font-weight: 700; transition: color .25s, background .25s, transform .2s var(--ease); }
    .tb .ic { width: 22px; height: 22px; transition: transform .35s var(--spring); }
    .tb:active { transform: scale(.92); }
    .tb.active { color: #fff; background: var(--grad-soft); box-shadow: 0 0 0 1px rgba(178, 107, 255, .35) inset; }
    .tb.active .ic { color: var(--ice); transform: translateY(-1px) scale(1.12); }
    .tb .dot { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; font-size: 10px; font-weight: 800; background: var(--grad); color: #fff; animation: pop .4s var(--spring); }
    body.app-on #fab { display: grid; }
    #fab { position: fixed; z-index: 65; right: 18px; bottom: calc(var(--tabbar) + var(--safe-b) + 26px); width: 58px; height: 58px; border-radius: 20px; border: 0; background: var(--grad); color: #fff; place-items: center; box-shadow: 0 14px 34px -8px rgba(255, 102, 255, .8), 0 0 0 1px rgba(255, 255, 255, .2) inset; transform: scale(0) rotate(-90deg); transition: transform .5s var(--spring), opacity .3s; opacity: 0; pointer-events: none; }
    #fab.show { transform: none; opacity: 1; pointer-events: auto; }
    #fab:active { transform: scale(.9); } #fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }
    .toolbar-actions .btn-primary.hide-m { display: none; }
    #toasts { right: 12px; left: 12px; bottom: calc(var(--tabbar) + var(--safe-b) + 90px); align-items: center; }
}
@media (max-width: 760px) {
    body { font-size: 14.5px; }
    .grid-2, .cms-grid { grid-template-columns: minmax(0, 1fr); }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 14px; } .kpi .kpi-ic { width: 32px; height: 32px; margin-bottom: 4px; }
    .card { padding: 18px; border-radius: 18px; }
    .toolbar { padding: 16px; } .toolbar-actions { width: 100%; } .search-wrap { flex: 1; } .search, .search:focus { width: 100%; }
    .hero-card { border-radius: 20px; } .hero-actions { width: 100%; } .hero-actions .btn { flex: 1; }
    .chart { height: 180px; }
    .row-2 { grid-template-columns: 1fr; gap: 0; }
    .topbar { padding-inline: 14px; gap: 10px; }

    /* tabelas → cards */
    .table-wrap { overflow: visible; padding: 12px; }
    table, thead, tbody, tr, td { display: block; }
    thead { display: none; }
    tbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
    tbody tr { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(238, 235, 255, .035); }
    tbody tr:hover { background: rgba(178, 107, 255, .08); }
    tbody tr.row-unread { border-color: rgba(255, 102, 255, .4); box-shadow: 0 0 0 1px rgba(255, 102, 255, .15) inset, 0 8px 24px -12px rgba(255, 102, 255, .5); }
    tbody tr.row-unread td:first-child { box-shadow: none; }
    td { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 14px; padding: 7px 0; border: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
    td > * { min-width: 0; max-width: 100%; }
    td::before { content: attr(data-label); flex: none; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); text-align: left; }
    td.td-main { display: block; text-align: left; padding: 0 0 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
    td.td-main::before { display: none; }
    td.td-actions { display: block; margin-top: 8px; padding: 12px 0 0; border-top: 1px solid var(--line); text-align: right; }
    td.td-actions::before { display: none; }
    td.td-actions .row-actions { justify-content: stretch; width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
    td.td-actions .action-btn { height: 40px; justify-content: center; }
    td .msg-cell { max-width: 62vw; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: right; }
    .cell-sub { max-width: 60vw; }
    .sk-row { padding: 16px; } .sk-row td { padding: 6px 0; } .sk-row td::before { display: none; } .sk-row .sk, .sk-row td:last-child .sk { width: 100% !important; margin: 0; } .sk-row td:nth-child(2n) .sk { width: 60% !important; }
    .empty { padding: 40px 16px; }

    /* formulários inline */
    .form-view { max-width: none; }
    .fv-body, #drawer-sistema .fv-body { display: flex; padding: 18px 16px 0; }
    #drawer-sistema .fv-body > .switches { grid-template-columns: minmax(0, 1fr); }
    .fv-foot { margin-inline: -16px; padding-inline: 16px; }
    .fv-foot .btn { min-height: 48px; } .fv-foot .btn-primary { max-width: none; }
    .toolbar .chips { width: 100%; gap: 6px; flex-wrap: wrap; overflow: visible; } .chip { padding: 0 11px; font-size: 13px; gap: 6px; }
    .modal { padding: 24px 20px 20px; }
}
@media (max-width: 380px) {
    .table-wrap { padding: 8px; } tbody tr { padding: 12px; } td.td-actions .action-btn { padding: 0 6px; gap: 4px; font-size: 12px; }
    .chip { padding: 0 9px !important; font-size: 12.5px !important; gap: 5px !important; } .chip em { min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 4px; } .chips { gap: 5px !important; } .toolbar { padding: 14px; } .card { padding: 16px; }
    .hero-card { padding: 20px 16px; } .topbar { padding-inline: 12px; } .page-title { font-size: 16px; } .kpis { gap: 8px; } .kpi > strong { font-size: 16px; } .tb { font-size: 9.5px; } }
@media (min-width: 901px) { #fab { display: none !important; } }
@media (hover: none) { .card.hoverable:hover, .kpi:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .sk { animation: none; }
}

/* Grupo com vários botões: no celular o campo ocupa a linha inteira e os botões descem */
@media (max-width: 640px) { .input-group .form-control { flex: 1 1 100%; } .input-group .btn { flex: 1; } }
