/* ReUse Panel — visual alinhado ao panel.resetuse.app (Filament dark + branding) */
:root {
  --reuse-ink: #040709;
  --reuse-ink-soft: #071014;
  --reuse-surface: #0a1216;
  --reuse-surface-raised: #0d171c;
  --reuse-line: #173039;
  --reuse-line-strong: #294047;
  --reuse-text: #f4f8f7;
  --reuse-text-muted: #90a6ad;
  --reuse-primary: #26dab0;
  --reuse-primary-strong: #16b890;
  --reuse-cyan: #63e8ff;
  --reuse-amber: #f2c94c;
  --reuse-rose: #ff647c;
  --reuse-radius: 8px;
  --reuse-focus: 0 0 0 3px #63e8ff61;
  --sidebar-width: 17.5rem;
  --font: "Inter", "Inter Variable", ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; letter-spacing: 0; }
body, .fi-body {
  font-family: var(--font);
  background: var(--reuse-ink);
  color: var(--reuse-text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--reuse-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--reuse-cyan);
  outline-offset: 2px;
}

/* Circuit backdrop */
.reuse-circuit-backdrop {
  z-index: 0; pointer-events: none; opacity: .2;
  position: fixed; inset: 0; overflow: hidden;
}
.reuse-circuit-backdrop:before {
  content: "";
  background-image:
    linear-gradient(#26dab01a 1px, #0000 1px),
    linear-gradient(90deg, #63e8ff14 1px, #0000 1px);
  background-size: 64px 64px;
  position: absolute; inset: 0;
}
.reuse-circuit-backdrop:after {
  content: "";
  background: #0407096b;
  position: absolute; inset: 0;
}
.reuse-circuit-backdrop__line {
  z-index: 1; border-style: solid; border-color: #26dab07a;
  width: min(32vw, 30rem); height: 5rem; display: block; position: absolute;
}
.reuse-circuit-backdrop__line:after {
  content: ""; background: var(--reuse-ink); border: 1px solid #63e8ffb3;
  border-radius: 50%; width: 7px; height: 7px; position: absolute;
}
.reuse-circuit-backdrop__line--one { border-width: 0 1px 1px 0; top: 18%; left: -2rem; }
.reuse-circuit-backdrop__line--one:after { bottom: -4px; right: -4px; }
.reuse-circuit-backdrop__line--two { border-width: 1px 0 0 1px; bottom: 17%; right: -2rem; }
.reuse-circuit-backdrop__line--two:after { top: -4px; left: -4px; }
.reuse-circuit-backdrop__line--three {
  border-width: 1px 1px 0 0; border-color: #63e8ff5c;
  width: 12rem; bottom: -3.5rem; right: 22%;
}
.reuse-circuit-backdrop__line--three:after { top: -4px; right: -4px; }

/* Login (fi-simple) */
.fi-simple-layout { min-height: 100vh; position: relative; z-index: 1; }
.fi-simple-main-ctn {
  min-height: 100vh; display: grid; place-items: center;
  padding: 2rem 1rem 1rem;
}
.fi-simple-main {
  width: min(100%, 28rem);
  border-radius: var(--reuse-radius);
  background: #071014f5;
  border: 1px solid #173039e6;
  position: relative; overflow: hidden;
  box-shadow: 0 28px 80px #0000006b;
  padding: 2rem 1.75rem 1.5rem;
}
.fi-simple-main:before {
  content: "";
  background: var(--reuse-primary);
  height: 3px;
  box-shadow: 7rem 0 0 var(--reuse-cyan);
  position: absolute; top: 0; left: 0; right: 0;
}
.fi-simple-header { text-align: center; margin-bottom: 1.5rem; }
.fi-simple-header img.fi-logo { height: 3rem; width: auto; }
.fi-simple-header-heading {
  color: var(--reuse-text); font-weight: 750; font-size: 1.35rem;
  margin: 1rem 0 0;
}
.fi-simple-header-heading:after {
  content: "";
  background: var(--reuse-primary);
  width: 3.5rem; height: 2px;
  box-shadow: 1.8rem 0 0 var(--reuse-cyan);
  border-radius: 2px; margin: 1rem auto 0; display: block;
}

.reuse-captcha { gap: .55rem; display: grid; margin: .35rem 0; }
.reuse-captcha__label { color: #dce8e9; font-size: .875rem; font-weight: 650; }
.reuse-captcha__button {
  background: var(--reuse-ink); cursor: pointer;
  border: 1px solid #63e8ff61; border-radius: 6px;
  width: min(100%, 280px); padding: 0; overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.reuse-captcha__button:hover { border-color: var(--reuse-cyan); transform: translateY(-1px); }
.reuse-captcha__button img { width: 100%; height: auto; display: block; }
.reuse-captcha__hint { color: var(--reuse-text-muted); font-size: .75rem; }

.reuse-footer {
  z-index: 1; color: var(--reuse-text-muted);
  justify-content: center; align-items: center; gap: .5rem;
  padding: 1.25rem 1rem; font-size: .75rem;
  display: flex; position: relative; flex-wrap: wrap; text-align: center;
}
.reuse-footer__mark { width: 1.25rem; height: 1.25rem; }
.reuse-footer__status { align-items: center; gap: .35rem; display: inline-flex; }
.reuse-footer__status:before {
  content: ""; background: var(--reuse-primary); border-radius: 50%;
  width: .4rem; height: .4rem; box-shadow: 0 0 0 3px #26dab01f;
}

/* App shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.sidebar {
  background: #0a1216fa;
  border-right: 1px solid #173039d9;
  box-shadow: 12px 0 34px #04070940;
  padding: 1rem .85rem 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .7rem .9rem;
  border-bottom: 1px solid #17303999;
}
.brand img { height: 2.1rem; width: auto; display: block; }
.brand-copy strong { display: block; font-size: .95rem; font-weight: 700; }
.brand-copy small { color: var(--reuse-text-muted); font-size: .72rem; }

.sidebar nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; overflow: auto; }
.sidebar nav .nav-group {
  color: var(--reuse-text-muted); font-size: .68rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .85rem .7rem .35rem;
}
.sidebar nav a {
  color: #b7c8cd; padding: .62rem .75rem; border-radius: 6px;
  text-decoration: none; border: 1px solid transparent;
  display: flex; align-items: center; gap: .55rem; font-size: .9rem; font-weight: 550;
  transition: border-color .15s, background-color .15s, color .15s;
}
.sidebar nav a:hover {
  background: #26dab014; border-color: #26dab033; color: var(--reuse-text); text-decoration: none;
}
.sidebar nav a.active {
  background: #26dab01a; border-color: #26dab06b; color: var(--reuse-primary);
  box-shadow: inset 3px 0 0 var(--reuse-primary);
}
.sidebar-foot {
  border-top: 1px solid #17303999; padding-top: .9rem;
  display: grid; gap: .65rem;
}
.user-chip strong { display: block; font-size: .88rem; }
.user-chip small {
  color: var(--reuse-text-muted); text-transform: uppercase;
  letter-spacing: .04em; font-size: .68rem;
}

.main { padding: 1.35rem 1.6rem 2.5rem; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.topbar h1 {
  margin: 0; font-size: clamp(1.45rem, 2vw, 1.85rem); font-weight: 750; color: var(--reuse-text);
}
.topbar h1:after {
  content: "";
  background: var(--reuse-primary);
  width: 5.5rem; height: 3px;
  box-shadow: 2.4rem 0 0 var(--reuse-cyan);
  border-radius: 2px; margin-top: .8rem; display: block;
}
.topbar-actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }

.reuse-credit-balance {
  border-radius: var(--reuse-radius); color: var(--reuse-text); white-space: nowrap;
  background: #26dab017; border: 1px solid #26dab06b;
  align-items: center; gap: .45rem; min-height: 2.25rem;
  padding: .35rem .7rem; font-size: .8rem; display: inline-flex;
}
.reuse-credit-balance strong { color: var(--reuse-primary); font-variant-numeric: tabular-nums; }
.reuse-credit-balance--empty,
.reuse-credit-balance--empty strong { color: #ef4444; background: #dc262617; border-color: #dc26266b; }

.reuse-zero-credit-alert {
  border-radius: var(--reuse-radius); color: #fecaca;
  background: linear-gradient(135deg, #ff647c24, #f2c94c12), #071014e0;
  border: 1px solid #dc262673;
  align-items: flex-start; gap: .9rem; margin-block-end: 1.25rem;
  padding: 1rem 1.1rem; display: flex; box-shadow: 0 14px 38px #0000003d;
}
.reuse-zero-credit-alert__icon {
  color: #ff647c; background: #dc26261a; border: 1px solid #dc26265c;
  border-radius: 7px; flex: 0 0 2.35rem; place-items: center;
  width: 2.35rem; height: 2.35rem; display: grid; font-weight: 800;
}
.reuse-zero-credit-alert strong { margin-block-end: .2rem; font-size: .92rem; display: block; }
.reuse-zero-credit-alert p { color: #fca5a5; margin: 0; font-size: .84rem; line-height: 1.55; }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem; margin-bottom: 1.25rem;
}
.stat-card, .card, .fi-section {
  background: #0a1216e6;
  border: 1px solid #173039e0;
  border-radius: var(--reuse-radius);
  box-shadow: 0 12px 30px #0407092e;
}
.stat-card { padding: 1.05rem 1.15rem; overflow: hidden; }
.stat-card span { color: var(--reuse-text-muted); font-size: .82rem; font-weight: 600; }
.stat-card strong {
  display: block; font-size: 1.75rem; margin-top: .35rem; font-weight: 750; color: var(--reuse-text);
}
.card { padding: 1.15rem 1.25rem; margin-bottom: 1.1rem; }
.card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.card-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }

.table-wrap { overflow: auto; border-radius: 6px; border: 1px solid #17303999; }
table, .reuse-operations-table {
  border-collapse: collapse; width: 100%; font-size: .875rem;
}
thead { background: #17303959; }
th, td {
  text-align: left; border-bottom: 1px solid #173039ad;
  padding: .75rem; white-space: nowrap; vertical-align: middle;
}
th { color: #c9d7db; font-weight: 650; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr { transition: background-color .14s, box-shadow .14s; }
tbody tr:hover { background: #63e8ff12; box-shadow: inset 3px 0 #63e8ffb8; }
.empty { color: var(--reuse-text-muted); text-align: center; padding: 1.4rem !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem 1rem;
}
.form-grid label, .fi-fo-field {
  display: grid; gap: .35rem; color: #d6e1e3; font-size: .84rem; font-weight: 650;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid .actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
input, select, textarea {
  width: 100%;
  background: #071014;
  color: var(--reuse-text);
  border: 1px solid #173039bd;
  border-radius: 6px;
  padding: .65rem .75rem;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--reuse-cyan);
  box-shadow: var(--reuse-focus);
  outline: none;
}
textarea { min-height: 90px; resize: vertical; }
.check {
  display: flex !important; align-items: center; gap: .55rem;
  font-weight: 550 !important; color: #d6e1e3; grid-template-columns: none !important;
}
.check input { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 6px; border: 1px solid transparent;
  padding: .58rem .95rem; font: inherit; font-weight: 650; font-size: .875rem;
  cursor: pointer; text-decoration: none; transition: .15s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-primary {
  background: var(--reuse-primary); color: #042018; border-color: #26dab0;
}
.btn-primary:hover { background: var(--reuse-primary-strong); }
.btn-secondary, .btn-ghost {
  background: #0d171c; color: var(--reuse-text); border-color: #294047;
}
.btn-danger { background: #ff647c22; color: #ffb0bc; border-color: #ff647c88; }
.btn-sm { padding: .35rem .65rem; font-size: .78rem; }
.btn-block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: .15rem .55rem; font-size: .72rem; font-weight: 700;
  border: 1px solid transparent;
}
.badge-ok { background: #26dab022; color: var(--reuse-primary); border-color: #26dab055; }
.badge-warn { background: #f2c94c22; color: var(--reuse-amber); border-color: #f2c94c55; }
.badge-danger { background: #ff647c22; color: #ffb0bc; border-color: #ff647c55; }
.badge-muted { background: #17303966; color: #b7c8cd; border-color: #294047; }

.alert {
  border-radius: var(--reuse-radius); padding: .85rem 1rem; margin-bottom: 1rem;
  border: 1px solid; font-size: .9rem;
}
.alert-success { background: #26dab018; border-color: #26dab055; color: #b8f5e4; }
.alert-error { background: #ff647c18; border-color: #ff647c55; color: #ffc1cb; }
.alert-warning { background: #f2c94c18; border-color: #f2c94c55; color: #ffe6a3; }

.login-page .fi-sc-form { display: grid; gap: 1rem; }
.login-page label { display: grid; gap: .35rem; color: #d6e1e3; font-size: .875rem; font-weight: 650; }
.login-page .btn-primary { margin-top: .35rem; }

@media (max-width: 1100px) {
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto;
    border-right: 0; border-bottom: 1px solid #173039d9;
  }
  .form-grid { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .reuse-circuit-backdrop:before { background-size: 44px 44px; }
  .reuse-circuit-backdrop__line { width: 55vw; }
}
