/* Layout, formulários e listas do painel administrativo (responsivo). */
:root {
  --adm-surface: #171e29;
  --adm-surface-2: #1d2735;
  --adm-input: #0f141c;
  --adm-line: rgb(255 255 255 / 10%);
  --adm-muted: #9aa8bb;
  --adm-gold: #e6b45e;
}

section.hero {
  display: block;
  min-height: 0;
  padding: clamp(0.75rem, 3vw, 2rem) !important;
  overflow: visible;
  text-align: left;
}

section.hero > .card,
section.hero > div {
  width: min(100%, 80rem) !important;
  max-width: 80rem !important;
  margin: 0 auto !important;
  border: 1px solid var(--adm-line);
  border-radius: 1rem;
  background: var(--adm-surface) !important;
  color: #e8edf5;
  overflow: hidden;
}

section.hero .card-header,
section.hero .breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem clamp(1rem, 3vw, 1.5rem) !important;
  border-bottom: 1px solid var(--adm-line);
  border-radius: 0;
  background: transparent !important;
}

section.hero .eyebrow {
  margin: 0;
  font-size: 1rem !important;
  letter-spacing: 0.18em;
}

section.hero .card-body,
section.hero #background-form {
  padding: clamp(1rem, 3vw, 1.5rem) !important;
}

section.hero #msgalert,
section.hero .alert {
  margin: 1rem clamp(1rem, 3vw, 1.5rem) 0;
}

section.hero .card-body .alert {
  margin: 0 0 1rem;
}

/* Botões */
.btn {
  min-height: 2.5rem;
  padding: 0.5rem 1.1rem;
  white-space: normal;
}

.btn-sm {
  height: auto;
  min-height: 2.15rem;
  padding: 0.35rem 0.8rem;
}

.btn-outline-light {
  border: 1px solid var(--adm-line);
  color: #e8edf5;
}

.btn-success {
  background: #2f9e72;
  color: #fff;
}

.btn-danger,
.btn-outline-danger {
  border: 1px solid rgb(255 111 97 / 60%);
}

.btn-danger {
  background: #d9534f;
  color: #fff;
}

.btn-outline-danger {
  background: transparent;
  color: #ff8a80;
}

/* Formulários */
.adm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.adm-form-grid .adm-full {
  grid-column: 1 / -1;
}

section.hero label.form-label,
.adm-field > label {
  display: block;
  margin-bottom: 0.35rem;
  color: #cfd8e5;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
}

section.hero .form-control,
section.hero .form-select {
  min-height: 2.6rem;
  border: 1px solid var(--adm-line);
  border-radius: 0.65rem;
  background-color: var(--adm-input);
  color: #f1f5f9;
}

section.hero .form-control:focus,
section.hero .form-select:focus {
  border-color: var(--adm-gold);
  background-color: var(--adm-input);
  box-shadow: 0 0 0 0.2rem rgb(230 180 94 / 18%);
  color: #fff;
}

section.hero .form-text,
section.hero .form-text.text-light {
  color: var(--adm-muted) !important;
}

section.hero textarea.form-control {
  min-height: 7rem;
}

.adm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--adm-line);
}

.adm-section {
  margin-top: 1.5rem;
  padding: 1.1rem;
  border: 1px solid var(--adm-line);
  border-radius: 0.85rem;
  background: var(--adm-surface-2);
}

.adm-section > h2,
.adm-section > h5 {
  margin: 0 0 0.85rem;
  color: var(--adm-gold);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.adm-perms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.adm-perm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--adm-line);
  border-radius: 0.7rem;
  background: var(--adm-input);
}

.adm-perm .form-check-input {
  width: 2.6rem;
  height: 1.4rem;
  margin: 0;
  cursor: pointer;
}

.adm-perm .form-check-input:checked {
  border-color: var(--adm-gold);
  background-color: var(--adm-gold);
}

.adm-perm .form-check-input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.adm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  margin-top: 1rem;
  color: var(--adm-muted);
  font-size: 0.85rem;
}

.adm-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 8%);
  color: #e8edf5;
  font-size: 0.75rem;
  font-weight: 700;
}

.adm-badge-gold {
  background: rgb(230 180 94 / 18%);
  color: var(--adm-gold);
}

.adm-badge-green {
  background: rgb(67 194 155 / 18%);
  color: #43c29b;
}

.adm-badge-red {
  background: rgb(255 111 97 / 18%);
  color: #ff8a80;
}

.adm-badge-blue {
  background: rgb(70 143 255 / 18%);
  color: #7fb0ff;
}

/* Listas */
section.hero .table-responsive,
section.hero .table {
  margin: 0;
}

section.hero .table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgb(255 255 255 / 4%);
  color: #e8edf5;
  vertical-align: middle;
}

section.hero .table > :not(caption) > * > * {
  padding: 0.75rem 0.85rem;
  border-bottom-color: var(--adm-line);
}

section.hero .table thead th {
  color: var(--adm-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

section.hero .table img {
  display: inline-block;
}

@media (max-width: 991.98px) {
  .adm-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  section.hero .card-body,
  section.hero #background-form {
    padding: 0.85rem !important;
  }

  section.hero .table-responsive {
    overflow: visible;
  }

  section.hero table.table,
  section.hero table.table tbody,
  section.hero table.table tr,
  section.hero table.table td {
    display: block;
    width: 100%;
  }

  section.hero table.table thead {
    position: absolute;
    left: -9999px;
  }

  section.hero table.table tr {
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--adm-line);
    border-radius: 0.8rem;
    background: var(--adm-surface-2);
  }

  section.hero table.table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgb(255 255 255 / 5%) !important;
    text-align: right;
    word-break: break-word;
  }

  section.hero table.table td:last-child {
    border-bottom: 0 !important;
  }

  section.hero table.table td::before {
    flex: 0 0 38%;
    color: var(--adm-muted);
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
  }

  section.hero table.table td:not([data-label])::before,
  section.hero table.table td[data-label=""]::before {
    display: none;
  }

  .adm-actions .btn {
    flex: 1 1 100%;
  }
}

/* Suporte */
.admin-support-link { position: relative; }
.admin-bell-badge {
  display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .35rem;
  border-radius: 999px; background: #d6453d; color: #fff; font-size: .75rem; line-height: 1.3rem;
  text-align: center; font-weight: 700;
}
.admin-bell-badge[hidden] { display: none; }
.adm-support-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.adm-support-filters .form-select { width: auto; min-width: 11rem; }
.adm-thread { display: grid; gap: .75rem; margin: 1rem 0; }
.adm-msg { padding: .85rem 1rem; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); text-align: left; }
.adm-msg-staff { background: rgba(80,140,255,.1); border-color: rgba(80,140,255,.3); }
.adm-msg header { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: .85rem; opacity: .85; margin-bottom: .4rem; }
.adm-msg p { margin: 0; overflow-wrap: anywhere; }
.adm-attach { display: block; max-width: 100%; max-height: 320px; margin-top: .6rem; border-radius: 8px; }
.adm-reply { text-align: left; }
.adm-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

/* Formulario de posts: secoes em cartoes e campos com borda visivel */
.post-editor-form > fieldset {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #0d6efd;
  border-radius: .6rem;
  padding: 1rem 1.25rem 1.25rem;
  margin-bottom: 1.25rem !important;
}
.post-editor-form > fieldset > legend {
  float: none;
  width: auto;
  padding: 0 .5rem;
  margin-bottom: .75rem;
  font-weight: 700;
  color: #0f172a;
}
.post-editor-form .form-label {
  font-weight: 600;
  color: #1e293b;
}
.post-editor-form .form-control,
.post-editor-form .form-select {
  background: #fff;
  border: 2px solid #94a3b8;
  border-radius: .45rem;
}
.post-editor-form .form-control:focus,
.post-editor-form .form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25);
}
.post-editor-form .form-check-input {
  border: 2px solid #64748b;
}
.post-editor-form fieldset fieldset,
.post-editor-form .card {
  background: #fff;
  border: 1px solid #94a3b8;
}