/* ==========================================================================
   SyncSentrix — login (entrar.html), crachá de acesso, cartão de crédito
   animado (assinar.html / painel) e painel do cliente (conta.html).
   Usa os tokens de styles.css (:root). O crachá é o elemento de destaque:
   o resto fica sóbrio de propósito.
   ========================================================================== */

/* ==========================================================================
   Login
   ========================================================================== */
.login-body { background: var(--bg); }
.login-page {
  min-height: 100svh; display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(400px, 0.85fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "stage top" "stage side";
}
.login-top { grid-area: top; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px clamp(24px, 5vw, 72px) 0; }
.login-back { font-size: 0.92rem; font-weight: 500; color: var(--ink-70); }
.login-back:hover { color: var(--ink); }
.login-side { grid-area: side; display: flex; flex-direction: column; padding: 0 clamp(24px, 5vw, 72px) 24px; }
.login-main { margin-block: auto; width: 100%; max-width: 400px; padding-block: 40px; }
.login-main h1 { font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; }
.login-lead { margin-top: 12px; color: var(--ink-70); font-size: 1.02rem; max-width: 36ch; }
.login-form { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }
.login-form .btn { width: 100%; margin-top: 6px; }
.login-form .form-error { margin-top: 0; }
.login-form .form-error a { color: inherit; font-weight: 700; text-decoration: underline; }
.login-alt { margin-top: 28px; padding-top: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; color: var(--ink-70); text-align: left; }
.login-alt a { color: var(--blue); font-weight: 600; }
.login-legal { font-size: 0.78rem; color: var(--ink-50); }

/* ---------- Palco ---------- */
.idcard-stage {
  --bw: clamp(290px, 31vw, 430px);
  grid-area: stage; position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 24px 150px; perspective: 1400px;
  background: radial-gradient(120% 70% at 50% 0%, #17248A 0%, var(--navy) 62%);
}
.idcard-stage::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}
.idcard-sun { position: absolute; left: 50%; bottom: 0; z-index: -1; width: min(880px, 125%); transform: translateX(-50%); }

/* ---------- Crachá ---------- */
.idcard-float { animation: idcard-float 6s ease-in-out infinite; }
@keyframes idcard-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.idcard-stage.is-busy .idcard-float { animation-play-state: paused; }

.idcard {
  --rx: 0deg; --ry: 0deg; --lift: 0px; --mx: 50%; --my: 30%;
  position: relative; width: var(--bw); aspect-ratio: 1.586; font-size: calc(var(--bw) / 24);
  transform-style: preserve-3d;
  transform: translateY(var(--lift)) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.idcard.is-tracking { transition: transform 0.12s linear; }
.idcard.is-tapping { --lift: 46px; --rx: 32deg; --ry: 0deg; transition-duration: 0.45s; }
.idcard.is-denied { animation: idcard-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes idcard-shake {
  10%, 90% { translate: -2px 0; } 20%, 80% { translate: 4px 0; }
  30%, 50%, 70% { translate: -8px 0; } 40%, 60% { translate: 8px 0; }
}
.idcard-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.8s cubic-bezier(0.3, 1.35, 0.45, 1); }
.idcard.is-flipped .idcard-inner { transform: rotateY(180deg); }

.idcard-face {
  position: absolute; inset: 0; overflow: hidden; border-radius: 1.15em;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  padding: 7% 7.5%; color: #fff;
  box-shadow: 0 2.2em 3.6em -1.4em rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.idcard-front { display: flex; flex-direction: column; background: linear-gradient(140deg, #2B48E3 0%, #1432AF 46%, #0D2183 100%); }
.idcard-back { transform: rotateY(180deg); background: linear-gradient(150deg, #1A2A86 0%, #0A1240 70%); }
.idcard-arc { position: absolute; right: 0; bottom: 0; width: 44%; pointer-events: none; }
.idcard-top { display: flex; align-items: center; gap: 0.5em; position: relative; }
.idcard-mark { width: 2.1em; flex: none; }
.idcard-brand { font-size: 1.3em; font-weight: 700; letter-spacing: -0.01em; }
.idcard-nfc { width: 1.55em; margin-left: auto; color: rgba(255, 255, 255, 0.85); }
.idcard-chip {
  position: relative; margin-top: 1em; width: 2.9em; height: 2.15em; border-radius: 0.42em;
  background:
    linear-gradient(90deg, transparent 32%, rgba(10, 18, 64, 0.35) 32% 36%, transparent 36% 64%, rgba(10, 18, 64, 0.35) 64% 68%, transparent 68%),
    linear-gradient(0deg, transparent 46%, rgba(10, 18, 64, 0.35) 46% 54%, transparent 54%),
    linear-gradient(135deg, #E9FBFE 0%, #7FD8EC 55%, #4FB2CB 100%);
  box-shadow: inset 0 0 0 1px rgba(10, 18, 64, 0.3);
}
.idcard-field { display: flex; flex-direction: column; gap: 0.12em; min-width: 0; position: relative; }
.idcard-front > .idcard-field { margin-top: auto; max-width: 70%; }
.idcard-row { display: flex; gap: 1.8em; margin-top: 0.7em; max-width: 62%; position: relative; }
.idcard-label { font-size: 0.62em; font-weight: 500; color: rgba(255, 255, 255, 0.66); }
.idcard-value { font-size: 0.86em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idcard-holder { font-family: var(--font-mono); font-size: 1.02em; font-weight: 500; }
.idcard-holder.is-placeholder { color: rgba(255, 255, 255, 0.55); }
.idcard-holder.is-typing { animation: holder-tick 0.25s ease-out; }
@keyframes holder-tick { from { text-shadow: 0 0 0.6em rgba(127, 216, 236, 0.9); } to { text-shadow: none; } }

.idcard-stamp {
  position: absolute; right: 7%; top: 36%; z-index: 2;
  font-size: 1em; font-weight: 700; letter-spacing: 0.01em; padding: 0.22em 0.75em; border-radius: 0.45em;
  color: #4ADE80; border: 0.16em solid currentColor; background: rgba(10, 18, 64, 0.55);
  opacity: 0; transform: rotate(-11deg) scale(1.6);
  transition: opacity 0.2s ease, transform 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.idcard[data-result] .idcard-stamp { opacity: 1; transform: rotate(-11deg) scale(1); }
.idcard[data-result="pending"] .idcard-stamp { color: #FBBF24; }

.idcard-shine {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.3), transparent 42%);
  mix-blend-mode: soft-light; opacity: 0; transition: opacity 0.3s ease;
}
.idcard.is-tracking .idcard-shine { opacity: 1; }
.idcard-front::after {
  content: ""; position: absolute; inset: -40%; pointer-events: none; z-index: 3;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.22) 50%, transparent 58%);
  transform: translateX(-60%); animation: idcard-sweep 1.6s 0.5s ease-out 1 both;
}
@keyframes idcard-sweep { to { transform: translateX(60%); } }

.idcard-stripe { position: absolute; left: 0; right: 0; top: 13%; height: 19%; background: #05070A; }
.idcard-sign {
  position: absolute; left: 7.5%; right: 7.5%; top: 42%;
  display: flex; align-items: center; gap: 0.8em; padding: 0.45em 0.8em; border-radius: 0.4em;
  background: repeating-linear-gradient(-45deg, #FFFFFF 0 0.5em, #EEF2FB 0.5em 1em); color: var(--ink);
}
.idcard-sign .idcard-label { color: var(--ink-50); }
.idcard-dots { font-family: var(--font-mono); font-size: 1.05em; font-weight: 600; letter-spacing: 0.12em; min-height: 1.3em; line-height: 1.3; white-space: nowrap; overflow: hidden; }
.idcard-note { position: absolute; left: 7.5%; right: 42%; bottom: 9%; font-size: 0.6em; line-height: 1.4; color: rgba(255, 255, 255, 0.7); }
.idcard-barcode {
  position: absolute; right: 7.5%; bottom: 10%; width: 28%; height: 15%; border-radius: 2px; opacity: 0.85;
  background: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 4px, #fff 4px 5px, transparent 5px 9px, #fff 9px 12px, transparent 12px 13px);
}

/* ---------- Leitor da portaria ---------- */
.reader {
  position: relative; z-index: 1; margin-top: 30px; width: calc(var(--bw) * 0.8);
  display: flex; align-items: center; gap: 12px; padding: 13px 18px 12px;
  border-radius: 16px; background: linear-gradient(180deg, #1D2333 0%, #0A0C10 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 18px 32px -12px rgba(0, 0, 0, 0.75);
  color: #C9D2EA; font-size: 0.9rem; font-weight: 500;
}
.reader::before { content: ""; position: absolute; left: 18px; right: 18px; top: 5px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); }
.reader-led { --led: #4C7DFF; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--led); box-shadow: 0 0 0 4px color-mix(in srgb, var(--led) 22%, transparent), 0 0 16px var(--led); animation: led-breathe 2.4s ease-in-out infinite; }
.reader-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader[data-state="reading"] .reader-led { --led: #7FD8EC; animation: led-blink 0.32s steps(2, jump-none) infinite; }
.reader[data-state="granted"] .reader-led { --led: #22C55E; animation: none; }
.reader[data-state="pending"] .reader-led { --led: #F5A524; animation: none; }
.reader[data-state="denied"] .reader-led { --led: #EF4444; animation: none; }
.reader[data-state="granted"] { color: #BBF7D0; }
.reader[data-state="denied"] { color: #FECACA; }
.reader[data-state="pending"] { color: #FDE68A; }
@keyframes led-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes led-blink { 0% { opacity: 1; } 100% { opacity: 0.2; } }

@media (max-width: 900px) {
  .login-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "top" "stage" "side"; }
  .login-top { padding-top: 16px; padding-bottom: 16px; }
  .idcard-stage { --bw: min(76vw, 330px); padding: 36px 20px 104px; }
  .idcard-sun { width: 150%; }
  .reader { margin-top: 22px; font-size: 0.84rem; }
  .login-main { padding-block: 28px 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .idcard-float, .reader-led, .idcard-front::after { animation: none !important; }
  .idcard, .idcard-inner, .idcard-stamp { transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   Cartão de crédito com prévia ao vivo (checkout e painel)
   ========================================================================== */
.cc-scene { perspective: 1200px; }
.cc {
  --cw: min(100%, 360px); --cc-a: #2B48E3; --cc-b: #0D2183;
  position: relative; width: var(--cw); aspect-ratio: 1.586; font-size: 15px;
  transform-style: preserve-3d; transition: transform 0.75s cubic-bezier(0.3, 1.3, 0.45, 1);
}
.cc.is-flipped { transform: rotateY(180deg); }
.cc[data-brand="visa"] { --cc-a: #2B48E3; --cc-b: #0D2183; }
.cc[data-brand="mastercard"] { --cc-a: #2A2D36; --cc-b: #05070A; }
.cc[data-brand="elo"] { --cc-a: #1F2937; --cc-b: #0A0C10; }
.cc[data-brand="amex"] { --cc-a: #0E7490; --cc-b: #0B3B4E; }
.cc[data-brand="hipercard"] { --cc-a: #B91C1C; --cc-b: #6B0F0F; }
.cc-face {
  position: absolute; inset: 0; overflow: hidden; border-radius: 16px; padding: 22px 24px; color: #fff;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: linear-gradient(140deg, var(--cc-a), var(--cc-b)); transition: background 0.4s ease;
  box-shadow: 0 22px 40px -18px rgba(5, 7, 10, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.cc-front { display: flex; flex-direction: column; }
.cc-front::before { content: ""; position: absolute; right: -18%; bottom: -46%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, 0.07); }
.cc-back { transform: rotateY(180deg); }
.cc-top { display: flex; justify-content: space-between; align-items: center; }
.cc-chip { width: 42px; height: 31px; border-radius: 6px; background: linear-gradient(90deg, transparent 32%, rgba(0, 0, 0, 0.18) 32% 36%, transparent 36% 64%, rgba(0, 0, 0, 0.18) 64% 68%, transparent 68%), linear-gradient(135deg, #FDE9B0, #D9B45A); }
.cc-brand { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; opacity: 0.95; min-height: 1.2em; }
.cc-brand[data-brand="visa"] { font-style: italic; font-size: 1.3rem; letter-spacing: 0.04em; }
.cc-number { margin-top: auto; font-family: var(--font-mono); font-size: 1.22rem; font-weight: 500; letter-spacing: 0.06em; white-space: nowrap; }
.cc-number span { display: inline-block; transition: transform 0.2s ease, opacity 0.2s ease; }
.cc-number span.is-new { animation: cc-digit 0.25s ease-out; }
@keyframes cc-digit { from { transform: translateY(-40%); opacity: 0; } to { transform: none; opacity: 1; } }
.cc-bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; }
.cc-field { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cc-label { font-size: 0.68rem; color: rgba(255, 255, 255, 0.65); }
.cc-value { font-size: 0.86rem; font-weight: 600; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-stripe { position: absolute; left: 0; right: 0; top: 16%; height: 20%; background: #05070A; }
.cc-cvv { position: absolute; left: 8%; right: 8%; top: 46%; display: flex; justify-content: flex-end; align-items: center; height: 18%; padding: 0 12px; border-radius: 4px; background: repeating-linear-gradient(-45deg, #fff 0 6px, #EEF2FB 6px 12px); color: var(--ink); font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.1em; }
.cc-back-note { position: absolute; left: 8%; right: 8%; bottom: 10%; font-size: 0.7rem; color: rgba(255, 255, 255, 0.65); }
@media (prefers-reduced-motion: reduce) { .cc { transition-duration: 0.01ms; } .cc-number span.is-new { animation: none; } }

/* No checkout: o cartão fica ao lado dos campos */
.co-pay { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.co-pay .cc { --cw: 300px; font-size: 13px; }
.co-pay .cc-face { padding: 18px 20px; }
.co-pay .cc-number { font-size: 1.05rem; }
@media (max-width: 1180px) { .co-pay { grid-template-columns: minmax(0, 1fr); } .co-pay .cc-scene { justify-self: center; } }

/* ==========================================================================
   Painel do cliente (conta.html)
   ========================================================================== */
.panel-body { background: var(--bg-alt); }
.panel { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100svh; }
.panel-topbar { display: none; }
.panel-side {
  position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 28px;
  padding: 24px 16px; background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto;
}
.panel-brand { padding-inline: 8px; }
.panel-brand .brand-logo { height: 32px; }
.panel-nav { display: flex; flex-direction: column; gap: 2px; }
.panel-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  font-size: 0.95rem; font-weight: 500; color: var(--ink-70); transition: background-color 0.15s ease, color 0.15s ease;
}
.panel-nav a:hover { background: var(--bg-alt); color: var(--ink); }
.panel-nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.panel-nav svg { width: 20px; height: 20px; flex: none; }
.nav-count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: var(--r-pill); text-align: center;
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; background: var(--bg-alt); color: var(--ink-70);
}
.panel-nav a[aria-current="page"] .nav-count { background: rgba(255, 255, 255, 0.16); color: #fff; }
.nav-count.is-alert { background: var(--orange); color: var(--ink); }
.panel-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.panel-user-info { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.panel-user-info strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-user-info span { font-size: 0.78rem; color: var(--ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-logout { margin-left: auto; flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-50); }
.panel-logout:hover { background: var(--bg-alt); color: var(--crit); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 0.88rem; font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.panel-scrim { position: fixed; inset: 0; z-index: 150; background: rgba(5, 7, 10, 0.45); }

.panel-main { min-width: 0; padding: 32px clamp(20px, 3.5vw, 48px) 72px; outline: none; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.panel-head h1 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; outline: none; }
.panel-head p { margin-top: 6px; color: var(--ink-70); }
.access-pill { display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: var(--r-pill); font-size: 0.86rem; font-weight: 600; background: var(--ok-bg); color: #137A40; }
.access-pill.is-off { background: var(--crit-bg); color: #B42318; }
.access-pill.is-pending { background: var(--warn-bg); color: #8A5300; }
.access-pill.is-off .dot-live { background: var(--crit); }
.access-pill.is-pending .dot-live { background: var(--warn); }
.access-pill:not(.is-ok) .dot-live::after { display: none; }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 400; max-width: min(420px, calc(100vw - 40px));
  padding: 13px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 0.92rem; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-on { opacity: 1; transform: none; }
.toast.is-error { background: #B42318; }

.notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-bottom: 22px; padding: 16px 20px;
  border-radius: var(--r-md); border: 2px solid var(--ink); background: #FEF3C7; box-shadow: 0 4px 0 var(--ink);
}
.notice.is-danger { background: #FEE2E2; }
.notice.is-ok { background: #DDF7E7; }
.notice p { flex: 1 1 320px; color: var(--ink-70); font-size: 0.94rem; }
.notice strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 2px; }

.pnl-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 2.4vw, 26px); min-width: 0; }
.pnl-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.pnl-card-head h2 { font-size: 1.08rem; font-weight: 700; }
.pnl-card-head a, .link-btn { font-size: 0.88rem; font-weight: 600; color: var(--blue); }
.link-btn { padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.muted { color: var(--ink-50); font-size: 0.86rem; }
.card-copy { color: var(--ink-70); font-size: 0.92rem; margin: -6px 0 16px; }
.pnl-note { margin-bottom: 18px; padding: 14px 18px; border-radius: var(--r-md); background: var(--blue-soft); color: var(--ink-70); font-size: 0.92rem; }
.pnl-note strong { color: var(--ink); }

.tag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 0.74rem; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill); background: var(--bg-alt); color: var(--ink-70); }
.tag.ok { background: var(--ok-bg); color: #137A40; }
.tag.warn { background: var(--warn-bg); color: #8A5300; }
.tag.crit { background: var(--crit-bg); color: #B42318; }
.tag.info { background: var(--blue-soft); color: var(--blue); }
.empty { padding: 26px 12px; text-align: center; color: var(--ink-50); font-size: 0.92rem; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* ---------- Visão geral ---------- */
.ov-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 56px);
  padding: clamp(24px, 3.4vw, 40px); border-radius: var(--r-lg); color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #1A2896 0%, var(--navy) 58%);
}
.ov-hero::after {
  content: ""; position: absolute; right: -80px; bottom: -190px; z-index: -1; width: 380px; aspect-ratio: 1; border-radius: 50%;
  border: 46px solid rgba(127, 216, 236, 0.1);
}
.ov-card { --bw: 340px; perspective: 1200px; }
.ov-card .idcard { transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.idcard.is-static .idcard-front::after { display: none; }
.idcard[data-result="denied"] .idcard-stamp { color: #F87171; }
.ov-label { font-size: 0.86rem; color: rgba(255, 255, 255, 0.66); }
.ov-plan { margin-top: 4px; font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.8rem); font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.ov-price { margin-top: 8px; font-family: var(--font-mono); font-size: 1.05rem; color: var(--cyan); }
.ov-copy { margin-top: 10px; color: rgba(255, 255, 255, 0.78); max-width: 40ch; }
.ov-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; margin: 24px 0 0; }
.ov-facts dt { font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); }
.ov-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 0.95rem; }
.ov-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--cyan); }
.btn-ghost-light { border: 1.5px solid rgba(255, 255, 255, 0.35); color: #fff; }
.btn-ghost-light:hover { border-color: #fff; }
.btn-danger { background: var(--crit); color: #fff; }
.btn-danger:hover { background: #B42318; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 20px; padding: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); }
.metric { min-width: 0; padding: 20px 22px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric-label { font-size: 0.86rem; color: var(--ink-70); }
.metric-value { margin-top: 4px; font-family: var(--font-mono); font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.metric-value small { font-size: 0.9rem; font-weight: 500; color: var(--ink-50); letter-spacing: 0; }
.metric-value.is-crit { color: var(--crit); }
.metric-note { margin-top: 4px; font-size: 0.8rem; color: var(--ink-50); }
.metric-note a { color: var(--blue); font-weight: 600; }
.meter { display: flex; gap: 3px; margin-top: 10px; }
.meter span { flex: 1; height: 8px; border-radius: 3px; background: var(--line); }
.meter span.on { background: var(--blue); }
.meter.is-full span.on { background: var(--orange); }

.ov-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 0.94rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 0.82rem; color: var(--ink-50); }
.row-end { font-family: var(--font-mono); font-size: 0.9rem; white-space: nowrap; }
.row-end.is-declined { color: var(--crit); text-decoration: line-through; }
.sev { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.sev-critical { background: var(--crit); }
.sev-warning { background: var(--amber); }
.sev-info { background: var(--blue-glow); }

/* ---------- Máquinas ---------- */
.machines { padding-block: 6px; }
.machine { border-top: 1px solid var(--line); }
.machine:first-child { border-top: 0; }
.machine summary {
  list-style: none; cursor: pointer; display: grid; align-items: center; gap: 12px 18px; padding: 16px 4px;
  grid-template-columns: auto minmax(0, 1fr) 120px 118px 104px 16px;
}
.machine-meta .muted { font-family: var(--font-body); }
.machine summary::-webkit-details-marker { display: none; }
.machine-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-50); }
.machine-dot.is-running { background: var(--ok); }
.machine-dot.is-maintenance { background: var(--warn); }
.machine-name { min-width: 0; display: flex; flex-direction: column; }
.machine-name strong { font-size: 0.98rem; }
.machine-name span { font-size: 0.82rem; color: var(--ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.machine-meta { font-size: 0.9rem; white-space: nowrap; }
.machine-chev { color: var(--ink-50); transition: transform 0.2s ease; }
.machine[open] .machine-chev { transform: rotate(180deg); }
.machine-body { padding: 0 4px 18px 32px; }
.machine-notes { margin-bottom: 6px; color: var(--ink-70); font-size: 0.92rem; }
.sensor-table { width: 100%; min-width: 520px; margin-top: 10px; border-collapse: collapse; font-size: 0.86rem; }
.sensor-table th { text-align: left; font-size: 0.74rem; font-weight: 600; color: var(--ink-50); padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); }
.sensor-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.sensor-table tr:last-child td { border-bottom: 0; }

/* ---------- Assinatura ---------- */
.sub-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.sub-plan { font-size: clamp(1.7rem, 1.4rem + 1vw, 2.2rem); font-weight: 700; line-height: 1.05; }
.sub-price { margin-top: 6px; font-family: var(--font-mono); color: var(--ink-70); }
.period { margin: 22px 0 6px; }
.period-bar { position: relative; height: 10px; border-radius: var(--r-pill); background: var(--bg-alt); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.period-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--blue); }
.period-labels { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 0.8rem; color: var(--ink-50); }
.period-labels span:nth-child(2) { color: var(--ink); font-weight: 600; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-row strong { font-size: 0.95rem; }
.switch-row > span > span { font-size: 0.84rem; color: var(--ink-50); }
.switch {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 46px; height: 28px; margin: 0;
  border-radius: var(--r-pill); background: var(--line-strong); cursor: pointer; transition: background-color 0.2s ease;
}
.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1); }
.switch:checked { background: var(--ok); }
.switch:checked::before { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 20px; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.facts dt { font-size: 0.8rem; color: var(--ink-50); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 0.92rem; overflow-wrap: anywhere; }
.quote { margin-top: 18px; padding: 18px; border-radius: var(--r-md); background: var(--bg-alt); border: 1.5px dashed var(--line-strong); }
.quote p { font-size: 0.9rem; color: var(--ink-70); }
.quote-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.quote-top strong { font-family: var(--font-mono); font-size: 1.6rem; letter-spacing: -0.02em; }
.quote .btn { margin-top: 14px; }
.quote-error { margin-top: 10px; color: #B42318; font-size: 0.9rem; font-weight: 500; }
.pay-choice { margin: 22px 0 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }
.pay-choice legend { font-weight: 700; margin-bottom: 10px; }
.new-card { margin-top: 16px; }
.renew-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- Cartão (formulário com prévia) ---------- */
.card-form { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.card-form .cc { --cw: 300px; font-size: 13px; }
.card-form .cc-face { padding: 18px 20px; }
.card-form .cc-number { font-size: 1.05rem; }
.card-form-wrap { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.saved-card { margin-bottom: 16px; }
.saved-card .cc { --cw: 320px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-grid { display: grid; gap: 14px; }

/* ---------- Pagamentos ---------- */
.pay-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.pay-grid .card-form { grid-template-columns: minmax(0, 1fr); }
.pay-grid .card-form-preview { justify-self: center; }
.pnl-pay-table { min-width: 620px; }
.pnl-pay-table td:nth-child(2) { min-width: 210px; }
.pnl-pay-table .num { padding-right: 12px; }
.pnl-pay-table td:last-child { text-align: right; padding-right: 0; }

/* ---------- Suporte ---------- */
.support-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.support-grid textarea { resize: vertical; min-height: 140px; }
.support-grid .field-hint a { color: var(--blue); font-weight: 600; }
.tickets { display: flex; flex-direction: column; }
.ticket { padding: 16px 0; border-top: 1px solid var(--line); }
.ticket:first-child { border-top: 0; padding-top: 0; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ticket h3 { margin-top: 6px; font-size: 1rem; }
.ticket-msg { margin-top: 8px; font-size: 0.9rem; color: var(--ink-70); white-space: pre-line; }
.ticket-reply { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--ok-bg); font-size: 0.9rem; }
.ticket-reply p { margin-top: 4px; color: var(--ink-70); white-space: pre-line; }

/* ---------- Configurações ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
#prefsForm .switch-row:first-of-type { border-top: 0; padding-top: 0; }
.pref-sev { padding: 16px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.pref-sev p { display: flex; flex-direction: column; gap: 2px; }
.pref-sev p span { font-size: 0.84rem; color: var(--ink-50); }
.pref-sev .cycle-toggle { margin: 0; align-self: flex-start; }

/* ---------- Diálogo e recibo ---------- */
.pnl-dialog { width: min(540px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); color: var(--ink); }
.pnl-dialog::backdrop { background: rgba(5, 7, 10, 0.5); }
.dialog-body { padding: 26px; }
.dialog-body h2 { font-size: 1.25rem; }
.dialog-body > p { margin-top: 8px; color: var(--ink-70); }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.receipt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 2px dashed var(--line-strong); }
.receipt-head img { height: 32px; width: auto; }
.receipt-amount { margin-top: 20px; font-family: var(--font-mono); font-size: 2.2rem; font-weight: 600; letter-spacing: -0.03em; }
.receipt-desc { color: var(--ink-70); margin-bottom: 18px; }
.receipt-note { margin-top: 18px; font-size: 0.78rem; color: var(--ink-50); }
.receipt-print { padding: 40px; max-width: 640px; margin: 0 auto; }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .ov-hero { grid-template-columns: minmax(0, 1fr); }
  .ov-card { justify-self: center; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .ov-cols, .sub-grid, .pay-grid, .support-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .card-form { grid-template-columns: minmax(0, 1fr); }
  .card-form-preview { justify-self: center; }
}
@media (max-width: 960px) {
  .panel { grid-template-columns: minmax(0, 1fr); }
  .panel-topbar {
    display: flex; position: sticky; top: 0; z-index: 120; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .panel-topbar .brand-logo { height: 30px; }
  .panel-menu-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line-strong); }
  .panel-side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; height: auto; width: min(300px, 86vw);
    transform: translateX(-102%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: var(--shadow-lg);
  }
  .panel.menu-open .panel-side { transform: none; }
  .panel-main { padding: 24px 16px 64px; }
  .machine summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .machine summary .machine-meta { grid-column: 2; }
  .machine summary .machine-chev { grid-row: 1; grid-column: 3; }
  .machine-body { padding-left: 4px; }
}
@media (max-width: 520px) {
  .ov-card { --bw: min(300px, calc(100vw - 80px)); }
  .ov-facts { grid-template-columns: minmax(0, 1fr); }
  .metric { padding: 16px; }
  .metric-value { font-size: 1.6rem; }
  .card-form .cc, .saved-card .cc { --cw: min(300px, calc(100vw - 80px)); font-size: 12px; }
}
@media print {
  .receipt-print .receipt-head { border-bottom-color: #999; }
}

/* ==========================================================================
   Personalização do painel: cor de destaque, tema escuro, densidade, crachá
   (atributos data-accent / data-theme / data-density no <html>)
   ========================================================================== */
:root { --accent: #0A0C10; --accent-ink: #fff; --accent-soft: rgba(10, 12, 16, 0.07); --link: var(--blue); }
html[data-accent="azul"] { --accent: #1E2A8F; --accent-ink: #fff; --accent-soft: #E5E7F7; --link: #1E2A8F; }
html[data-accent="ciano"] { --accent: #0E7490; --accent-ink: #fff; --accent-soft: #DDF2F7; --link: #0E7490; }
html[data-accent="laranja"] { --accent: #C2410C; --accent-ink: #fff; --accent-soft: #FDECE3; --link: #C2410C; }
html[data-accent="verde"] { --accent: #15803D; --accent-ink: #fff; --accent-soft: #E1F4E8; --link: #15803D; }
html[data-accent="roxo"] { --accent: #6D28D9; --accent-ink: #fff; --accent-soft: #EEE6FC; --link: #6D28D9; }

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131A28; --bg-alt: #0B1019;
  --ink: #E8ECF6; --ink-70: #B0B9CD; --ink-50: #7F889D;
  --line: #222C40; --line-strong: #34405A;
  --blue-soft: #1A2344; --cyan-soft: #0F2E38;
  --ok-bg: rgba(34, 197, 94, 0.15); --warn-bg: rgba(245, 165, 36, 0.15); --crit-bg: rgba(239, 68, 68, 0.17);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5); --shadow-md: 0 14px 32px -12px rgba(0, 0, 0, 0.7); --shadow-lg: 0 34px 70px -20px rgba(0, 0, 0, 0.8);
  --accent: #E8ECF6; --accent-ink: #0A0C10; --accent-soft: rgba(232, 236, 246, 0.1); --link: #93A3FF;
}
html[data-theme="dark"][data-accent="azul"] { --accent: #7C8CF5; --accent-ink: #0A0C10; --accent-soft: rgba(124, 140, 245, 0.16); --link: #9AA7FF; }
html[data-theme="dark"][data-accent="ciano"] { --accent: #38BDD8; --accent-ink: #04212A; --accent-soft: rgba(56, 189, 216, 0.16); --link: #5FD0E6; }
html[data-theme="dark"][data-accent="laranja"] { --accent: #FB8A4A; --accent-ink: #2A1103; --accent-soft: rgba(251, 138, 74, 0.16); --link: #FDA06D; }
html[data-theme="dark"][data-accent="verde"] { --accent: #34D399; --accent-ink: #032015; --accent-soft: rgba(52, 211, 153, 0.15); --link: #5EE0AE; }
html[data-theme="dark"][data-accent="roxo"] { --accent: #A78BFA; --accent-ink: #1A0B3A; --accent-soft: rgba(167, 139, 250, 0.16); --link: #BCA6FF; }

/* O que usa a cor de destaque */
.panel-body .btn-primary { background: var(--accent); color: var(--accent-ink); }
.panel-body .btn-primary:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.12); box-shadow: var(--shadow-md); }
.panel-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.panel-nav a[aria-current="page"] .nav-count { background: color-mix(in srgb, var(--accent-ink) 18%, transparent); color: var(--accent-ink); }
.panel-body .cycle-toggle input:checked + span { background: var(--accent); color: var(--accent-ink); }
.panel-body .plan-option input:checked + .plan-card { border-color: var(--accent); box-shadow: 0 5px 0 var(--accent); }
.panel-body .plan-option input:checked + .plan-card .plan-card-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.panel-body .switch:checked { background: var(--accent); }
.panel-body .switch:checked::before { background: var(--accent-ink); }
html:not([data-accent="grafite"]):not([data-theme="dark"]) .panel-body .switch:checked::before,
html[data-theme="dark"] .panel-body .switch:checked::before { background: var(--bg); }
.period-fill, .meter span.on { background: var(--accent); }
.avatar { background: var(--accent); color: var(--accent-ink); }
.pnl-card-head a, .link-btn, .metric-note a, .check-row a, .support-grid .field-hint a, .empty a, .panel-body .plan-card-limit { color: var(--link); }
.panel-body :focus-visible { outline-color: var(--accent); }
.ov-blocks { display: flex; flex-direction: column; gap: 20px; }
.ov-blocks > .metrics, .ov-blocks > .ov-cols { margin-top: 0; }
.ov-cols.is-single { grid-template-columns: minmax(0, 1fr); }

/* Tema escuro: ajustes do que não sai só dos tokens */
html[data-theme="dark"] .panel-body { background: var(--bg-alt); }
html[data-theme="dark"] .pnl-dialog { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] .toast { background: var(--ink); color: var(--bg); }
html[data-theme="dark"] .toast.is-error { background: #F87171; color: #2A0606; }
html[data-theme="dark"] .notice { background: #33290F; border-color: var(--line-strong); box-shadow: none; }
html[data-theme="dark"] .notice.is-danger { background: #3A1518; }
html[data-theme="dark"] .notice.is-ok { background: #0F2E1D; }
html[data-theme="dark"] .tag.ok, html[data-theme="dark"] .access-pill.is-ok { color: #4ADE80; }
html[data-theme="dark"] .tag.warn, html[data-theme="dark"] .access-pill.is-pending { color: #FBBF24; }
html[data-theme="dark"] .tag.crit, html[data-theme="dark"] .access-pill.is-off, html[data-theme="dark"] .quote-error { color: #F87171; }
html[data-theme="dark"] .tag.info { color: #A5B4FC; }
html[data-theme="dark"] .access-pill { background: var(--ok-bg); }
html[data-theme="dark"] .access-pill.is-off { background: var(--crit-bg); }
html[data-theme="dark"] .access-pill.is-pending { background: var(--warn-bg); }
html[data-theme="dark"] .ov-hero { background: radial-gradient(120% 140% at 0% 0%, #1B2A8F 0%, #0A1030 60%); box-shadow: inset 0 0 0 1px var(--line); }
html[data-theme="dark"] .field input, html[data-theme="dark"] .field select, html[data-theme="dark"] .field textarea { background: var(--bg-alt); }
html[data-theme="dark"] .btn-outline { color: var(--ink); border-color: var(--line-strong); }
html[data-theme="dark"] .btn-outline:hover { border-color: var(--ink-70); }
html[data-theme="dark"] .ticket-reply { color: var(--ink); }
.logo-on-dark { display: none; }
html[data-theme="dark"] .logo-on-light { display: none; }
html[data-theme="dark"] .logo-on-dark { display: block; }

/* Densidade compacta */
html[data-density="compact"] .panel-main { padding-top: 20px; }
html[data-density="compact"] .panel-head { margin-bottom: 18px; }
html[data-density="compact"] .panel-head h1 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); }
html[data-density="compact"] .pnl-card { padding: 14px 18px; }
html[data-density="compact"] .pnl-card-head { margin-bottom: 10px; }
html[data-density="compact"] .ov-blocks, html[data-density="compact"] .custom-grid { gap: 12px; }
html[data-density="compact"] .ov-cols, html[data-density="compact"] .sub-grid, html[data-density="compact"] .pay-grid,
html[data-density="compact"] .support-grid, html[data-density="compact"] .settings-grid { gap: 12px; }
html[data-density="compact"] .ov-hero { padding: 20px 24px; gap: 28px; }
html[data-density="compact"] .ov-card { --bw: 290px; }
html[data-density="compact"] .ov-facts { margin-top: 14px; gap: 10px 22px; }
html[data-density="compact"] .ov-actions { margin-top: 16px; }
html[data-density="compact"] .metric { padding: 12px 16px; }
html[data-density="compact"] .metric-value { font-size: 1.55rem; }
html[data-density="compact"] .row { padding: 8px 0; }
html[data-density="compact"] .row:first-child { padding-top: 0; }
html[data-density="compact"] .panel-nav a { padding: 7px 12px; }
html[data-density="compact"] .switch-row { padding: 10px 0; }
html[data-density="compact"] .field input, html[data-density="compact"] .field select { padding: 9px 12px; }
html[data-density="compact"] .machine summary { padding: 10px 4px; }

/* Cores do crachá */
.idcard[data-card="grafite"] .idcard-front { background: linear-gradient(140deg, #3A3F4C 0%, #1A1D25 50%, #07080B 100%); }
.idcard[data-card="ciano"] .idcard-front { background: linear-gradient(140deg, #22C3E0 0%, #0E8FAE 50%, #0B5E75 100%); }
.idcard[data-card="ciano"] .idcard-arc circle { fill: #0A1240; stroke: #0A1240; }
.idcard[data-card="ciano"] .idcard-mark circle { fill: #0A1240; }
.idcard[data-card="laranja"] .idcard-front { background: linear-gradient(140deg, #FF9A4D 0%, #F06A14 48%, #B83F06 100%); }
.idcard[data-card="laranja"] .idcard-arc circle { fill: #0A1240; stroke: #0A1240; }
.idcard[data-card="laranja"] .idcard-mark circle { fill: #0A1240; }

/* ---------- Tela Personalizar ---------- */
.custom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.custom-span { grid-column: 1 / -1; }
.photo-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 20px 28px; align-items: center; }
.avatar-xl .avatar { width: 104px; height: 104px; font-size: 2.2rem; box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent); }
.photo-side .card-copy { margin: 0 0 12px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-actions label.btn { cursor: pointer; }
.photo-actions input:focus-visible + .btn, .photo-actions label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.nick-form .form-actions { margin-top: 10px; }

.choices { display: grid; gap: 10px; }
.choices-theme { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices-swatch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices-card { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box {
  height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 10px;
  border: 2px solid var(--line); border-radius: var(--r-md); background: var(--bg); text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.choice:hover .choice-box { border-color: var(--line-strong); }
.choice input:checked + .choice-box { border-color: var(--accent); box-shadow: 0 4px 0 var(--accent); }
.choice input:focus-visible + .choice-box { outline: 2px solid var(--accent); outline-offset: 3px; }
.choice-label { font-size: 0.86rem; font-weight: 600; line-height: 1.3; display: flex; flex-direction: column; }
.choice-label small { font-size: 0.74rem; font-weight: 500; color: var(--ink-50); }
.choices-swatch .choice-box { flex-direction: row; justify-content: flex-start; text-align: left; padding: 10px 12px; }
.swatch { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }

.theme-preview { position: relative; width: 100%; max-width: 120px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-strong); }
.theme-preview i { position: absolute; left: 0; top: 0; bottom: 0; width: 28%; }
.theme-preview b { position: absolute; left: 36%; right: 10%; height: 14%; border-radius: 4px; }
.theme-preview b:nth-of-type(1) { top: 22%; }
.theme-preview b:nth-of-type(2) { top: 50%; right: 30%; }
.theme-preview.is-light { background: #F3F5FA; }
.theme-preview.is-light i { background: #fff; border-right: 1px solid #E2E6F0; }
.theme-preview.is-light b { background: #fff; box-shadow: 0 0 0 1px #E2E6F0; }
.theme-preview.is-dark { background: #0B1019; }
.theme-preview.is-dark i { background: #131A28; border-right: 1px solid #222C40; }
.theme-preview.is-dark b { background: #1C2436; }
.theme-preview.is-auto { background: linear-gradient(135deg, #F3F5FA 50%, #0B1019 50%); }
.theme-preview.is-auto i { background: linear-gradient(135deg, #fff 50%, #131A28 50%); }
.theme-preview.is-auto b { background: linear-gradient(135deg, #fff 50%, #1C2436 50%); }

.mini-card { position: relative; width: 100%; max-width: 92px; aspect-ratio: 1.586; border-radius: 7px; overflow: hidden; background: linear-gradient(140deg, #2B48E3, #1432AF 46%, #0D2183); }
.mini-card i { position: absolute; right: -16%; bottom: -30%; width: 55%; aspect-ratio: 1; border-radius: 50%; background: #7FD8EC; }
.mini-card[data-card="grafite"] { background: linear-gradient(140deg, #3A3F4C, #1A1D25 50%, #07080B); }
.mini-card[data-card="ciano"] { background: linear-gradient(140deg, #22C3E0, #0E8FAE 50%, #0B5E75); }
.mini-card[data-card="ciano"] i, .mini-card[data-card="laranja"] i { background: #0A1240; }
.mini-card[data-card="laranja"] { background: linear-gradient(140deg, #FF9A4D, #F06A14 48%, #B83F06); }

.block-list { display: flex; flex-direction: column; }
.block-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.block-item:first-child { border-top: 0; padding-top: 0; }
.block-item.is-hidden .block-toggle span { color: var(--ink-50); }
.block-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: 0.94rem; }
.block-move { display: flex; gap: 4px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line-strong); color: var(--ink-70); }
.icon-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-50); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.custom-foot { display: flex; justify-content: flex-end; margin-top: 20px; }

@media (max-width: 1180px) {
  .custom-grid { grid-template-columns: minmax(0, 1fr); }
  .photo-row { grid-template-columns: auto minmax(0, 1fr); }
  .nick-form { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .photo-row { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .choices-swatch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choices-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   Primeiro acesso e Administração
   ========================================================================== */
.panel-nav a[hidden] { display: none; }
.panel-nav .nav-admin { margin-top: 10px; position: relative; }
.panel-nav .nav-admin::before { content: ""; position: absolute; left: 12px; right: 12px; top: -6px; border-top: 1px solid var(--line); }

.first-access { max-width: 560px; }
.first-access h2 { font-size: 1.4rem; margin: 14px 0 8px; }
.first-access .card-copy { margin: 0 0 20px; }
.first-access-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
html[data-theme="dark"] .first-access-icon { color: var(--accent); }

.admin-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin: 22px 0 16px; }
.admin-bar .cycle-toggle { margin: 0; }
.admin-search { flex: 1 1 280px; max-width: 420px; }
.admin-search input { border-radius: var(--r-pill); padding-left: 18px; }
.admin-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th { text-align: left; font-size: 0.74rem; font-weight: 600; color: var(--ink-50); padding: 0 14px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 14px 14px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td strong { display: block; font-size: 0.94rem; }
.admin-table .row-sub { display: block; margin-top: 2px; }
.admin-table .num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.admin-table .muted { white-space: nowrap; }
.admin-table .tag + .row-sub { margin-top: 6px; }
.admin-actions { text-align: right; white-space: nowrap; padding-right: 0 !important; }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.btn-danger-outline { color: #B42318; border-color: rgba(180, 35, 24, 0.35); }
.btn-danger-outline:hover { border-color: #B42318; }
html[data-theme="dark"] .btn-danger-outline { color: #F87171; border-color: rgba(248, 113, 113, 0.4); }
.admin-tickets { display: flex; flex-direction: column; gap: 16px; }
.admin-ticket h3 { margin-top: 6px; font-size: 1.02rem; }
.admin-reply { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.admin-reply textarea { resize: vertical; min-height: 84px; }
.admin-reply .form-actions { margin-top: 12px; }
