/* Paleta alinhada ao index.html legado (prompt.md) */
:root {
  --bg-0: #0d0b1f;
  --bg-1: #14112e;
  --bg-2: #1a1640;
  --bg-3: #221c52;
  --txt: #e6e3ff;
  --txt-dim: #a09bc7;
  --txt-soft: #7e7aa3;
  --h1: #ff4fa3;
  --h1-glow: #ff95cc;
  --h2: #34e0d7;
  --h2-glow: #6effe6;
  --h3: #ffb84d;
  --h3-glow: #ffd285;
  --link: #5ab8ff;
  --link-hov: #a3d6ff;
  --inline-bg: #2a2350;
  --inline-txt: #ffe066;
  --warn-amber: #ffb84d;
  --warn-red: #ff5b6e;
  --warn-green: #5dd45d;
  --warn-blue: #5ab8ff;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.55);
  --wiki-tab-name-width: 220px;
  --wiki-tab-actions-width: 9.5rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(ellipse at top left, #1c1240 0%, #0d0b1f 55%) fixed,
    radial-gradient(ellipse at bottom right, #261540 0%, transparent 60%) fixed;
  color: var(--txt);
}

#app-root {
  min-height: 100vh;
}

input[type='text'],
input[type='password'],
input[type='email'],
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 110, 255, 0.25);
  color: var(--txt);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
input:focus,
textarea:focus {
  border-color: var(--h2);
}

textarea {
  min-height: 72px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(90deg, var(--h1), var(--h3));
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 79, 163, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 6px 22px rgba(255, 79, 163, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--warn-red);
  border: 1px solid rgba(255, 91, 110, 0.45);
}
.btn-ghost:hover {
  background: rgba(255, 91, 110, 0.08);
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

/* Verde claro — Ativar item, Ativar wiki, Confirmar modal, etc. */
.btn-activate {
  background: rgba(93, 212, 93, 0.22);
  color: #c8f5c8;
  border: 1px solid rgba(93, 212, 93, 0.45);
  box-shadow: 0 2px 10px rgba(93, 212, 93, 0.1);
}
.btn-activate:hover:not(:disabled) {
  background: rgba(93, 212, 93, 0.32);
  color: #e0ffe0;
}
.btn-activate:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.status-btns button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(180, 110, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
  color: var(--txt-dim);
  cursor: pointer;
  font-size: 13px;
}
.status-btns button.active {
  border-color: var(--h2);
  color: var(--txt);
  background: rgba(52, 224, 215, 0.12);
}

.header-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(10, 8, 24, 0.95), rgba(17, 9, 42, 0.92));
  border-bottom: 1px solid rgba(180, 110, 255, 0.18);
  backdrop-filter: blur(8px);
}
.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.header-bar--storage .header-brand {
  align-items: center;
  text-align: center;
}

.header-bar h1 {
  margin: 0;
  font-size: 17px;
  background: linear-gradient(90deg, var(--h1), var(--h3), var(--h2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-nova-storage-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 2px 0 4px;
}

.header-nova-storage-wrap.is-hidden {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--txt-dim);
}

.wiki-list-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 8px;
  border-bottom: 1px solid rgba(180, 110, 255, 0.1);
}

.wiki-list-bar.storage-list-bar {
  align-items: flex-start;
  gap: 14px 16px;
}

.storage-charts-loading {
  margin: 0;
  width: 100%;
  font-size: 13px;
  color: var(--txt-dim);
}

.storage-charts-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  flex: 1 1 100%;
  width: 100%;
}

.storage-chart-card {
  flex: 1 1 280px;
  min-width: min(100%, 280px);
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(20, 17, 46, 0.65);
  border: 1px solid rgba(180, 110, 255, 0.22);
  box-shadow: var(--shadow-soft);
}

.storage-chart-card--bars {
  flex: 1 1 320px;
}

.storage-chart-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--h2);
}

.storage-chart-pie-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.storage-chart-pie-svg {
  width: 168px;
  height: 168px;
  display: block;
}

.storage-chart-legend {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--txt-dim);
  line-height: 1.55;
}

.storage-chart-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.storage-chart-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.storage-chart-caption {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--txt-soft);
  line-height: 1.45;
}

.storage-chart-empty {
  margin: 0;
  font-size: 12px;
  color: var(--txt-soft);
}

.storage-chart-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.storage-chart-bar-row {
  display: grid;
  grid-template-columns: minmax(72px, 28%) 1fr minmax(52px, auto);
  gap: 8px 10px;
  align-items: center;
}

.storage-chart-bar-row--inactive {
  opacity: 0.55;
}

.storage-chart-bar-label {
  font-size: 12px;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.storage-chart-bar-track {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: rgba(180, 110, 255, 0.12);
  border: 1px solid rgba(180, 110, 255, 0.2);
  overflow: hidden;
}

.storage-chart-bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: 5px 0 0 5px;
  transition: width 0.35s ease;
}

.storage-chart-bar-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #0d0b1f;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.storage-chart-bar-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--txt-dim);
  text-align: right;
  white-space: nowrap;
}

.wiki-list-bar-sep {
  width: 1px;
  height: 26px;
  margin: 0 4px;
  background: rgba(180, 110, 255, 0.28);
  flex-shrink: 0;
}

.btn-nova-wiki,
label.btn-nova-wiki {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  color: #0d2818;
  background: linear-gradient(145deg, #b8f5c8 0%, #7de89a 48%, #5dd45d 100%);
  border: 1px solid rgba(160, 255, 190, 0.65);
  box-shadow:
    0 2px 10px rgba(93, 212, 93, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn.btn-small.btn-nova-wiki {
  padding: 7px 12px 7px 8px;
  font-size: 12px;
  gap: 6px;
}

.btn.btn-small.btn-nova-wiki .btn-nova-wiki-icon {
  width: 22px;
  height: 22px;
}

.btn-nova-wiki:hover,
label.btn-nova-wiki:hover {
  filter: brightness(1.06);
  box-shadow:
    0 4px 16px rgba(93, 212, 93, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transform: translateY(-1px);
}

.btn-nova-wiki:active,
label.btn-nova-wiki:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.modal .row-actions .btn-nova-wiki {
  padding: 9px 18px 9px 12px;
}

.file-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.file-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-picker-btn {
  margin: 0;
  flex-shrink: 0;
}

/* .field label sobrescrevia display/cor do botão verde */
.field .file-picker-btn.btn-nova-wiki {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0d2818;
  cursor: pointer;
}

.file-picker-name {
  font-size: 13px;
  color: var(--txt-soft);
  min-width: 0;
  word-break: break-all;
}

.file-picker-name--selected {
  color: var(--txt-dim);
}

.file-picker-meta {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--txt-soft);
}

.modal-add-files {
  max-width: 520px;
}

.add-file-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(180, 110, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
}

.add-file-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 12px;
  font-size: 12px;
  border-bottom: 1px solid rgba(180, 110, 255, 0.1);
}

.add-file-list-item:last-child {
  border-bottom: none;
}

.add-file-list-name {
  color: var(--txt-dim);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

.add-file-list-status {
  flex-shrink: 0;
  font-size: 11px;
}

.add-file-list-item--ok .add-file-list-status {
  color: var(--ok, #5dd45d);
}

.add-file-list-item--err .add-file-list-status {
  color: var(--warn-red);
}

/* Barra de uso do storage (modal Adicionar arquivo) */
.storage-quota-wrap {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(20, 17, 46, 0.55);
  border: 1px solid rgba(180, 110, 255, 0.2);
}

.storage-quota-wrap[hidden] {
  display: none !important;
}

.storage-quota-heading {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
}

.storage-quota-heading-sub {
  font-weight: 500;
  color: var(--txt-soft);
}

.storage-quota-loading {
  margin: 0;
  font-size: 12px;
  color: var(--txt-dim);
}

.storage-quota-bar {
  position: relative;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(34, 28, 82, 0.95), rgba(26, 22, 64, 0.98));
  border: 1px solid rgba(180, 110, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.storage-quota-seg {
  position: absolute;
  top: 0;
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: width 0.25s ease, left 0.25s ease;
}

.storage-quota-used {
  left: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(255, 79, 163, 0.85), rgba(181, 139, 255, 0.75));
}

.storage-quota-new {
  z-index: 3;
  background: linear-gradient(90deg, rgba(255, 184, 77, 0.9), rgba(255, 210, 133, 0.85));
}

.storage-quota-free {
  z-index: 1;
  background: transparent;
  pointer-events: none;
}

.storage-quota-seg-label {
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: #0d0b1f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}

.storage-quota-seg-label--dim {
  color: var(--txt-dim);
  text-shadow: none;
  font-weight: 600;
}

.storage-quota-total-badge {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--txt);
  background: rgba(13, 11, 31, 0.72);
  border: 1px solid rgba(180, 110, 255, 0.35);
  pointer-events: none;
}

.storage-quota-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  color: var(--txt-dim);
}

.storage-quota-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: middle;
}

.storage-quota-swatch-used {
  background: linear-gradient(90deg, #ff4fa3, #b58bff);
}

.storage-quota-swatch-new {
  background: linear-gradient(90deg, #ffb84d, #ffd285);
}

.storage-quota-swatch-total {
  background: linear-gradient(90deg, #221c52, #1a1640);
  border: 1px solid rgba(180, 110, 255, 0.4);
}

.storage-quota-warn {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--warn-red);
}

.storage-quota-ok {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--txt-dim);
}

.btn-nova-wiki-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
  color: #1a5c32;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.btn-nova-wiki-icon svg {
  display: block;
}

.btn-nova-wiki:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.35);
  transform: none;
}

.storage-limit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--txt-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 110, 255, 0.28);
  cursor: help;
  user-select: none;
}

.storage-limit-badge-icon {
  flex-shrink: 0;
  color: var(--h2);
  opacity: 0.9;
}

.storage-tabs-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 8px 20px 10px;
  border-bottom: 1px solid rgba(180, 110, 255, 0.12);
}

.storage-tabs-list {
  flex: 1;
  min-width: 0;
  padding: 0;
  border-bottom: none;
}

.storage-tabs-actions {
  flex-shrink: 0;
  align-self: flex-start;
}

.wiki-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  padding: 8px 20px 10px;
  border-bottom: 1px solid rgba(180, 110, 255, 0.12);
  align-items: start;
}

@media (min-width: 1100px) {
  .wiki-tabs {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  }
}

.wiki-tabs-empty {
  margin: 0;
  font-size: 13px;
  color: var(--txt-soft);
}

.wiki-tab-item {
  display: grid;
  grid-template-columns: var(--wiki-tab-name-width) auto;
  gap: 6px 12px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.wiki-tab-btn {
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(180, 110, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--txt-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-tab-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: var(--wiki-tab-actions-width);
}

.wiki-tab-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}

.wiki-tab-actions-row .btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.wiki-tab-actions-full {
  width: 100%;
  justify-content: center;
}

.wiki-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--txt);
}

.wiki-tab-btn.active {
  background: linear-gradient(90deg, rgba(255, 79, 163, 0.22), rgba(52, 224, 215, 0.12));
  color: var(--txt);
  border-color: rgba(255, 79, 163, 0.35);
}

.wiki-tab-btn.wiki-tab-inactive {
  opacity: 0.65;
  border-style: dashed;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(180, 110, 255, 0.12);
}
.tabs button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(180, 110, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--txt-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
}
.tabs button.active {
  background: linear-gradient(90deg, rgba(255, 79, 163, 0.22), rgba(52, 224, 215, 0.12));
  color: var(--txt);
  border-color: rgba(255, 79, 163, 0.35);
}

.main-pad {
  padding: 20px 24px 48px;
  max-width: 1100px;
  margin: 0 auto;
}

.empty-records-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(48vh, 420px);
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: var(--txt-soft);
}

.card {
  background: rgba(20, 17, 46, 0.65);
  border: 1px solid rgba(180, 110, 255, 0.15);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}
.card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--h2);
}

.item-row {
  border-top: 1px solid rgba(180, 110, 255, 0.1);
  padding: 14px 0;
}
.item-row:first-of-type {
  border-top: none;
  padding-top: 0;
}
.item-title {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12.5px;
  color: var(--h3);
  margin-bottom: 4px;
}
.item-desc {
  font-size: 13px;
  color: var(--txt-dim);
  line-height: 1.45;
}

.splash {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

/* Fundo: marca Lista 01 — Opção 2 (Pexels 17065769, layout/images) */
.screen-login {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: url('/images/login-bg.jpg') center / cover no-repeat fixed;
}

.screen-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    rgba(13, 11, 31, 0.72) 0%,
    rgba(28, 18, 64, 0.82) 45%,
    rgba(13, 11, 31, 0.88) 100%
  );
  pointer-events: none;
}

.screen-login > .login-box {
  position: relative;
  z-index: 1;
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 28px;
  border-radius: 16px;
  background: rgba(20, 17, 46, 0.92);
  border: 1px solid rgba(180, 110, 255, 0.28);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
}
.login-brand {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--h2);
  text-align: center;
}

.login-tagline {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--txt-soft);
  text-align: center;
}

.login-form .btn-auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  padding: 11px 16px;
  font-size: 14px;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.login-form .btn-auth-submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
  background: linear-gradient(90deg, var(--h1), var(--h3));
  color: #fff;
}

.login-footer {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--txt-soft);
  text-align: center;
  line-height: 1.6;
}

.login-footer .btn-auth-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(90, 184, 255, 0.12);
  color: var(--link);
  border: 1px solid rgba(90, 184, 255, 0.4);
  transition: background 0.12s, border-color 0.12s;
}

.login-footer .btn-auth-alt:hover {
  background: rgba(90, 184, 255, 0.2);
  color: var(--link-hov);
  border-color: rgba(90, 184, 255, 0.55);
}

.login-box .err {
  color: var(--warn-red);
  font-size: 13px;
  margin: 8px 0;
  min-height: 1.2em;
}
.field {
  margin-bottom: 14px;
}
.field > label:not(.field-checkbox-label):not(.file-picker-btn) {
  display: block;
  font-size: 12px;
  color: var(--txt-soft);
  margin-bottom: 6px;
}

.field-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(52, 224, 215, 0.06);
  border: 1px solid rgba(52, 224, 215, 0.22);
}

.field-checkbox input[type='checkbox'] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 2px 0 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #5dd45d;
}

.field-checkbox-label {
  display: inline;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--txt);
  cursor: pointer;
}

.field-checkbox-label strong {
  color: var(--h2);
  font-weight: 600;
}

.field-checkbox-label code {
  font-size: 12px;
  color: var(--inline-txt);
  background: var(--inline-bg);
  padding: 1px 6px;
  border-radius: 4px;
}

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.health-ok {
  background: var(--warn-green);
  box-shadow: 0 0 10px var(--warn-green);
}
.health-bad {
  background: var(--warn-red);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(34, 28, 82, 0.95);
  border: 1px solid rgba(52, 224, 215, 0.35);
  color: var(--txt);
  font-size: 13px;
  z-index: 100;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 20px;
}
.modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100% !important;
  max-width: 676px !important;
  max-height: 73.15vh !important;
  overflow: auto !important;
  padding: 18px 20px !important;
  border-radius: 14px !important;
  background: var(--bg-1) !important;
  border: 1px solid rgba(180, 110, 255, 0.25) !important;
  z-index: 90 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
  transform: translate(-50%, -50%) scale(1) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out !important;
}

.modal.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  animation: slideInModal 0.3s ease-out forwards !important;
}

.modal.active::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: -1;
}

@keyframes slideInModal {
  from {
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}
.modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(180, 110, 255, 0.15);
}

.modal h3 {
  margin: 0;
  color: var(--h3);
  font-size: 1.15rem;
  flex: 1;
}

.modal .modal-close {
  background: none;
  border: none;
  color: var(--txt-dim);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 10px;
}

.modal .modal-close:hover {
  color: var(--h1);
  transform: scale(1.1);
}

.modal .form-group {
  margin-bottom: 0.5rem;
}

.modal .form-group label {
  margin-bottom: 0.15rem;
  font-size: 0.92rem;
}

.modal .form-group input,
.modal .form-group textarea,
.modal .form-group select {
  padding: 0.5rem;
  font-size: 0.92rem;
}

.modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.modal .form-row .form-group {
  margin-bottom: 0;
}

.modal .modal-actions {
  gap: 0.7rem;
  margin-top: 1rem;
  padding-top: 1rem;
  display: flex;
  justify-content: center;
}

.modal .btn-primary,
.modal .btn-secondary {
  padding: 0.65rem 1.3rem;
  font-size: 0.88rem;
}

.modal-actions-center {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.modal-actions-center.modal-actions-pair {
  gap: 10px;
  flex-wrap: wrap;
}

.btn-cancel-light {
  background: rgba(220, 50, 70, 0.55);
  color: #ffe0e4;
  border: 1px solid rgba(255, 91, 110, 0.7);
  box-shadow: 0 2px 12px rgba(255, 91, 110, 0.25);
}
.btn-cancel-light:hover:not(:disabled) {
  background: rgba(220, 50, 70, 0.72);
  color: #fff;
}

.modal-features {
  max-width: 540px;
}

#modal-editar-features,
#modal-features {
  max-height: 90vh !important;
}

#modal-editar-features .features-list,
#modal-features .features-list {
  max-height: calc(90vh - 140px);
}

.features-list {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(180, 110, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.feature-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.feature-desc {
  font-size: 14px;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feature-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.feat-toggle {
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.feat-ativar {
  background: rgba(93, 212, 93, 0.15);
  color: #5dd45d;
  border-color: rgba(93, 212, 93, 0.4);
}

.feat-ativar:hover {
  background: rgba(93, 212, 93, 0.28);
}

.feat-inativar {
  background: rgba(255, 91, 110, 0.15);
  color: #ff5b6e;
  border-color: rgba(255, 91, 110, 0.4);
}

.feat-inativar:hover {
  background: rgba(255, 91, 110, 0.28);
}

.ef-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(180, 110, 255, 0.25);
  border-radius: 6px;
  color: var(--txt);
  font-size: 13px;
  padding: 6px 10px;
  font-family: inherit;
}

.ef-input:focus {
  outline: none;
  border-color: var(--h2);
}

.features-form {
  border-top: 1px solid rgba(180, 110, 255, 0.15);
  padding-top: 14px;
}

.features-vazio {
  color: var(--txt-dim);
  font-size: 14px;
  padding: 8px 0;
}

.btn-features {
  background: rgba(180, 110, 255, 0.15);
  color: #c084fc;
  font-size: 0.82rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(180, 110, 255, 0.35);
  border-radius: 4px;
}

.btn-features:hover {
  background: rgba(180, 110, 255, 0.28);
  color: #d8b4fe;
}

.modal-assinaturas {
  max-width: 560px;
}

#modal-assinaturas {
  max-height: 90vh !important;
}

#modal-assinaturas .planos-grid {
  max-height: calc(90vh - 180px);
}

.assinaturas-hint {
  font-size: 13px;
  color: var(--txt-dim);
  margin-bottom: 16px;
}

.planos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.plano-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(180, 110, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.plano-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--h2);
  flex-shrink: 0;
  cursor: pointer;
}

.plano-card.selected {
  border-color: var(--h2);
  background: rgba(52, 224, 215, 0.07);
}

.plano-card:hover {
  border-color: rgba(180, 110, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

.plano-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plano-nome {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
}

.plano-preco {
  font-size: 12px;
  color: var(--h3);
}

.plano-features-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.plano-features-list li {
  font-size: 11px;
  color: var(--txt-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.plano-features-list li.feat-inativa {
  opacity: 0.45;
  text-decoration: line-through;
}

.feat-bullet {
  font-size: 10px;
  color: var(--h2);
  flex-shrink: 0;
}

.feat-inativa .feat-bullet {
  color: var(--warn-red);
}

.planos-vazio {
  color: var(--txt-dim);
  font-size: 14px;
  padding: 12px 0;
}

.button-64 {
  align-items: center;
  background-image: linear-gradient(144deg, #AF40FF, #5B42F3 50%, #00DDEB);
  border: 0;
  border-radius: 8px;
  box-shadow: rgba(151, 65, 252, 0.2) 0 15px 30px -5px;
  box-sizing: border-box;
  color: #FFFFFF;
  display: flex;
  font-family: Phantomsans, sans-serif;
  font-size: 14px;
  justify-content: center;
  line-height: 1em;
  max-width: 100%;
  min-width: 140px;
  padding: 3px;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
  cursor: pointer;
}

.button-64:active,
.button-64:hover {
  outline: 0;
}

.button-64 span {
  background-color: rgb(5, 6, 45);
  padding: 10px 12px;
  border-radius: 6px;
  width: 100%;
  height: 100%;
  transition: 300ms;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button-64:hover span {
  background: none;
}

@media (min-width: 768px) {
  .button-64 {
    font-size: 16px;
    min-width: 180px;
  }
}

.btn-confirm-light {
  background: rgba(50, 180, 80, 0.50);
  color: #d0fad0;
  border: 1px solid rgba(93, 212, 93, 0.7);
  box-shadow: 0 2px 12px rgba(93, 212, 93, 0.2);
}
.btn-confirm-light:hover:not(:disabled) {
  background: rgba(50, 180, 80, 0.68);
  color: #fff;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Filters Bar */
.filters-bar {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  padding: 1rem;
  background: var(--bg-2);
  border-radius: 8px;
  border: 1px solid rgba(180, 110, 255, 0.15);
}

.filters-bar .form-group {
  margin-bottom: 0;
  min-width: 180px;
}

.filters-bar select {
  padding: 0.5rem;
  font-size: 0.92rem;
}

/* Botão-link (inline, parece um <a>) */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--link);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover {
  color: var(--link-hov);
}

/* Botão Config no header */
.btn-config {
  background: rgba(52, 224, 215, 0.10);
  color: var(--h2);
  border: 1px solid rgba(52, 224, 215, 0.30);
}
.btn-config:hover {
  background: rgba(52, 224, 215, 0.18);
}

.btn-admin {
  background: rgba(255, 184, 77, 0.12);
  color: var(--h3);
  border: 1px solid rgba(255, 184, 77, 0.35);
}
.btn-admin:hover {
  background: rgba(255, 184, 77, 0.2);
}

.modal-back-stack {
  z-index: 90;
}

.modal.modal-wide {
  max-width: 640px;
}

.modal-admin {
  max-width: min(920px, 94vw);
  min-height: min(380px, 78vh);
  padding: 28px 32px 24px;
}

.admin-modal-title {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--h2);
}

.admin-modal-sub {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--txt-soft);
  line-height: 1.45;
}

.admin-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0 28px;
}

.admin-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 120px;
  padding: 18px 20px;
  text-align: left;
  border-radius: 12px;
  background: rgba(20, 17, 46, 0.75);
  border: 1px solid rgba(180, 110, 255, 0.22);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-family: inherit;
  color: var(--txt);
  transition: border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.15s;
}

.admin-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 184, 77, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.admin-card:active {
  transform: translateY(0);
}

.admin-card-icon {
  font-size: 28px;
  line-height: 1;
}

.admin-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--txt);
}

.admin-card-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--txt-dim);
}

.admin-users-wrap {
  max-height: 50vh;
  overflow: auto;
  margin-bottom: 8px;
}

/* Linhas do modal de configurações */
.config-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(180, 110, 255, 0.10);
  font-size: 14px;
}
.config-row:last-of-type {
  border-bottom: none;
}
.config-label {
  min-width: 120px;
  font-size: 12px;
  color: var(--txt-soft);
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(90deg, #ff4fa3, #b58bff);
  color: #fff;
}

/* ── Navegação Wikis / Storage ──────────────────────────────────────── */
.btn-nav {
  background: rgba(255,255,255,0.05);
  color: var(--txt-dim);
  border: 1px solid rgba(180,110,255,0.2);
}
.btn-nav:hover {
  background: rgba(255,255,255,0.1);
  color: var(--txt);
}
.btn-nav.active {
  background: linear-gradient(90deg, rgba(255,79,163,0.25), rgba(52,224,215,0.15));
  color: var(--txt);
  border-color: rgba(255,79,163,0.45);
}

/* ── Botão Excluir (vermelho) ───────────────────────────────────────── */
.btn-danger {
  background: rgba(255,91,110,0.12);
  color: var(--warn-red);
  border: 1px solid rgba(255,91,110,0.35);
}
.btn-danger:hover { background: rgba(255,91,110,0.22); }
.btn-danger:disabled { opacity: 0.45; cursor: default; }

/* ── Página Storage ─────────────────────────────────────────────────── */
.storage-page { padding: 4px 0; }

.storage-inactive-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--h3);
  background: rgba(255, 184, 77, 0.12);
  border: 1px dashed rgba(255, 184, 77, 0.45);
}

.storage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.storage-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--txt-soft);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid rgba(180,110,255,0.18);
}
.storage-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(180,110,255,0.08);
  vertical-align: middle;
}
.storage-table tr:last-child td { border-bottom: none; }
.storage-table tr:hover td { background: rgba(255,255,255,0.02); }

.st-name {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12.5px;
  color: var(--link);
}
.st-actions { text-align: right; }

.badge-wiki {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(52,224,215,0.15);
  color: var(--h2);
  border: 1px solid rgba(52,224,215,0.3);
}

.wiki-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 12px;
  border-bottom: 1px solid rgba(180, 110, 255, 0.12);
}

.wiki-toolbar-sep {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: rgba(180, 110, 255, 0.25);
  flex-shrink: 0;
}

.storage-toolbar-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--h2);
  letter-spacing: 0.02em;
  margin-right: 4px;
}

.btn-filter {
  background: rgba(255, 255, 255, 0.04);
  color: var(--txt-dim);
  border: 1px solid rgba(180, 110, 255, 0.22);
}
.btn-filter:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--txt);
}
.btn-filter.active {
  background: linear-gradient(90deg, rgba(255, 79, 163, 0.2), rgba(52, 224, 215, 0.12));
  color: var(--txt);
  border-color: rgba(255, 79, 163, 0.4);
}

.item-row-deleted {
  opacity: 0.72;
  border-left: 3px solid var(--warn-red);
  padding-left: 11px;
}

.item-row-ok {
  background: rgba(93, 212, 93, 0.09);
  box-shadow: inset 0 0 0 1px rgba(93, 212, 93, 0.18);
  border-radius: 8px;
  padding: 12px 10px;
  margin: 0 -6px;
}

.item-row-fail {
  background: rgba(255, 91, 110, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 91, 110, 0.2);
  border-radius: 8px;
  padding: 12px 10px;
  margin: 0 -6px;
}

/* Item confirmado — só botões pendente/ok/falha/alerta apagados */
.item-row-confirmed .status-btns {
  pointer-events: none;
  user-select: none;
}

.item-row-confirmed .status-btns button,
.item-row-confirmed .status-btns button:disabled {
  cursor: default;
  opacity: 0.5;
  filter: saturate(0.75);
}

.item-row-confirmed .status-btns button.active {
  opacity: 0.62;
  border-color: rgba(52, 224, 215, 0.22);
  background: rgba(52, 224, 215, 0.06);
  color: var(--txt-dim);
}

.item-row-confirmed textarea:disabled {
  cursor: default;
}

.item-row-confirmed .row-actions .btn[data-final] {
  cursor: pointer;
  pointer-events: auto;
}

.badge-deleted {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(255, 91, 110, 0.15);
  color: var(--warn-red);
  border: 1px solid rgba(255, 91, 110, 0.35);
  vertical-align: middle;
}
