/* Painel de licenças — tema sóbrio, uso profissional */
:root {
  --bg: #09090b;
  --bg-elevated: #0c0c0f;
  --surface: #18181b;
  --surface-hover: #1f1f23;
  --border: #27272a;
  --border-strong: #3f3f46;
  --text: #fafafa;
  --muted: #a1a1aa;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-muted: rgba(99, 102, 241, 0.15);
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #fbbf24;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body.panel-body,
body.auth-body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(99, 102, 241, 0.06), transparent);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ——— Login ——— */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}
.auth-shell {
  display: grid;
  width: 100%;
  max-width: 1080px;
  min-height: 100vh;
  margin: auto;
  grid-template-columns: 1fr 1fr;
  box-shadow: 0 0 0 1px var(--border);
}
@media (max-width: 840px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 440px;
    box-shadow: none;
  }
}
.auth-aside {
  background: linear-gradient(165deg, #1e1b4b 0%, var(--surface) 45%, var(--bg) 100%);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
}
@media (max-width: 840px) {
  .auth-aside {
    display: none;
  }
}
.auth-aside-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-hover);
  background: var(--accent-muted);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
  width: fit-content;
}
.auth-aside h2 {
  margin: 0 0 16px;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.auth-aside p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
}
.auth-aside ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.auth-aside li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 14px;
  color: #d4d4d8;
  font-size: 14px;
  line-height: 1.5;
}
.auth-aside li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.9;
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--bg-elevated);
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-brand {
  margin-bottom: 8px;
}
.auth-brand strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auth-brand span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.auth-lead {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 24px;
}

/* ——— Layout painel ——— */
.panel-body {
  display: flex;
  min-height: 100vh;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 40;
}
@media (max-width: 900px) {
  .sidebar-backdrop:not([hidden]) {
    display: block;
  }
}
.sidebar {
  width: 268px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  z-index: 50;
  transition: transform 0.2s ease;
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #4338ca);
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sidebar-brand-text strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}
.nav-section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 16px 12px 8px;
}
.nav-section:first-of-type {
  padding-top: 8px;
}
.nav-item {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-muted);
  color: #e0e7ff;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}
.nav-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-item.active .nav-ico {
  opacity: 1;
  color: var(--accent-hover);
}
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 8px;
}
.sidebar-user-email {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  word-break: break-all;
}
.btn-block {
  width: 100%;
  justify-content: center;
}

.main {
  flex: 1;
  padding: 20px 28px 48px;
  overflow-x: auto;
  min-width: 0;
}
@media (max-width: 900px) {
  .main {
    padding: 16px 16px 40px;
    width: 100%;
  }
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
@media (max-width: 900px) {
  .sidebar-toggle {
    display: flex;
  }
}
.topbar-titles {
  flex: 1;
  min-width: 0;
}
.topbar h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.topbar-sub {
  margin: 6px 0 0;
  font-size: 14px;
}

.tab-panel.hidden {
  display: none;
}

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
  opacity: 0.85;
}
.kpi-card .num {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.kpi-card .lbl {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  font-weight: 500;
}

.overview-split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 380px);
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .overview-split {
    grid-template-columns: 1fr;
  }
}
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.panel-card-head {
  margin-bottom: 14px;
}
.panel-card-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}
.chart-card .panel-card-title {
  font-size: 16px;
}
.chart-wrap {
  position: relative;
  height: 240px;
  max-width: 100%;
}
.gap-tight {
  gap: 16px !important;
}
.code-block-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}
.code-block {
  flex: 1;
  min-width: 200px;
  display: block;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  word-break: break-all;
  color: #e4e4e7;
  line-height: 1.45;
}

.toolbar {
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.2);
}
.table tr:last-child td {
  border-bottom: 0;
}
.table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.table code {
  font-size: 12px;
  word-break: break-all;
}

.btn {
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-secondary {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: #27272a;
  border-color: #52525b;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface-hover);
}
.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}
.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #d4d4d8;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stack.narrow {
  max-width: 440px;
}
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.link {
  color: var(--accent-hover);
  text-decoration: none;
  font-weight: 500;
}
.link:hover {
  text-decoration: underline;
}
.inline-code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: #e4e4e7;
}

.card-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.mt-2 {
  margin-top: 20px;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.45;
}
.alert-error {
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
}
.alert-success {
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
  color: #bbf7d0;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  max-width: 360px;
  font-weight: 500;
}
.toast.ok {
  border-color: rgba(74, 222, 128, 0.4);
  color: var(--ok);
}
.toast.err {
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--danger);
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 96vw;
}
.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
.modal-box {
  background: #121214;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: min(500px, 92vw);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.modal-box h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-active {
  background: rgba(74, 222, 128, 0.15);
  color: var(--ok);
}
.badge-suspended {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warn);
}
.badge-expired {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}
.badge-open {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}
.badge-done {
  background: rgba(74, 222, 128, 0.15);
  color: var(--ok);
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.subtab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.subtab:hover {
  background: var(--surface-hover);
}
.subtab.active {
  background: var(--accent-muted);
  border-color: rgba(99, 102, 241, 0.35);
  color: #e0e7ff;
}
.subpanel.hidden {
  display: none;
}
.hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}
.mb-2 {
  margin-bottom: 18px;
}
.comms-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.comms-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.comms-list li p {
  margin: 8px 0 0;
  line-height: 1.55;
}

/* Documentação / Ajuda */
.doc-hero {
  margin-bottom: 28px;
  max-width: 820px;
}
.doc-hero-title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.doc-card-wide {
  grid-column: 1 / -1;
}
@media (min-width: 900px) {
  .doc-card-wide {
    grid-column: span 2;
  }
}
.doc-card h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}
.doc-list {
  margin: 0;
  padding-left: 20px;
  color: #d4d4d8;
  line-height: 1.65;
  font-size: 14px;
}
.doc-list li {
  margin-bottom: 10px;
}
.doc-list-plain {
  list-style: disc;
}
.terminal-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 12px 0;
}
.terminal-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}
.terminal-pre {
  margin: 0;
  padding: 16px 14px;
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
  color: #e4e4e7;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
}
.terminal-comment {
  color: #71717a;
}
