/* ==========================================================
   A Boa do Rildy — Admin v0.5
   ========================================================== */

.admin-body {
  background: #f5f5f5;
  color: #171717;
}

.admin-header {
  min-height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #111;
  color: #fff;
}

.admin-brand,
.admin-nav a,
.link-button {
  color: inherit;
  text-decoration: none;
}

.admin-brand {
  font-weight: 800;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-nav a.active {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.admin-container {
  width: min(1180px, calc(100% - 32px));
  margin: 40px auto 80px;
}

.admin-form-container {
  max-width: 980px;
}

.admin-page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-page-heading h1 {
  margin: 4px 0 8px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
  font-weight: 700;
  opacity: .6;
}

.admin-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.05);
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-toolbar input,
.admin-toolbar select,
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  font: inherit;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-list-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid #ececec;
  border-radius: 14px;
}

.admin-list-thumb {
  width: 104px;
  height: 82px;
  overflow: hidden;
  border-radius: 10px;
  background: #eee;
}

.admin-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  font-size: .75rem;
  opacity: .55;
}

.admin-list-content h2 {
  margin: 0;
  font-size: 1.05rem;
}

.admin-list-content p {
  margin: 5px 0 0;
  font-size: .9rem;
  opacity: .7;
}

.admin-list-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #ececec;
  font-size: .72rem;
  font-weight: 700;
}

.badge-success {
  background: #e7f7ec;
}

.badge-highlight {
  background: #fff3c7;
}

.admin-list-actions {
  display: flex;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.button-primary {
  background: #111;
  color: #fff;
}

.button-secondary {
  background: #ececec;
  color: #111;
}

.button-danger {
  background: #ffe7e7;
  color: #8f1010;
}

.button-small {
  min-height: 34px;
  padding: 0 11px;
  font-size: .82rem;
}

.button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-span-2 {
  grid-column: 1 / -1;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  font-weight: 700;
}

.form-field textarea {
  resize: vertical;
}

.field-help {
  margin: 0;
  font-size: .82rem;
  opacity: .65;
}

.checkbox-field {
  align-content: center;
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-field input {
  width: auto;
}

.image-preview-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}

.image-preview-wrapper img {
  width: min(360px, 100%);
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
}

.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.form-message {
  min-height: 20px;
}

.form-message-error,
.error-state {
  color: #9b1414;
}

.empty-state,
.error-state {
  padding: 28px;
  text-align: center;
  background: #fafafa;
  border-radius: 12px;
}

@media (max-width: 760px) {
  .admin-header,
  .admin-page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header {
    padding: 18px;
  }

  .admin-nav {
    width: 100%;
    overflow-x: auto;
  }

  .admin-toolbar,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-span-2 {
    grid-column: auto;
  }

  .admin-list-item {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .admin-list-thumb {
    width: 76px;
    height: 76px;
  }

  .admin-list-actions {
    grid-column: 1 / -1;
  }
}


/* Compatibilidade do login/dashboard */
.admin-auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-auth-card {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 16px 50px rgba(0,0,0,.08);
}

.admin-auth-card .admin-brand {
  color: #111;
  display: inline-block;
  margin-bottom: 28px;
}

.admin-form {
  display: grid;
  gap: 18px;
  margin: 24px 0 18px;
}

.admin-button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.admin-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.admin-button--secondary {
  background: #ececec;
  color: #111;
}

.admin-message {
  min-height: 20px;
  margin: 0;
}

.admin-message.is-error {
  color: #9b1414;
}

.admin-muted {
  opacity: .7;
}

.admin-back-link {
  color: #111;
}

.admin-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.admin-layout[hidden] {
  display: none !important;
}

.admin-layout {
  min-height: 100vh;
}

.admin-sidebar {
  padding: 24px;
  background: #111;
  color: #fff;
}

.admin-brand--light {
  color: #fff;
}

.admin-site-link {
  color: #fff;
}

.admin-main {
  padding: 32px;
}

.admin-topbar,
.admin-user-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0;
}

.admin-stat-card,
.admin-panel,
.admin-next-step {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  padding: 20px;
}

.admin-stat-card {
  display: grid;
  gap: 8px;
}

.admin-stat-card__value {
  font-size: 2rem;
}

.admin-panel__header,
.admin-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-event-row {
  padding: 14px 0;
  border-top: 1px solid #eee;
}

.admin-event-row__main {
  display: grid;
  gap: 5px;
}

.admin-event-row__badges {
  display: flex;
  gap: 6px;
}

.admin-badge,
.admin-chip {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #ececec;
  font-size: .75rem;
  font-weight: 700;
}

.admin-badge--published {
  background: #e7f7ec;
}

.admin-badge--featured {
  background: #fff3c7;
}

.admin-alert--error {
  color: #9b1414;
  margin: 16px 0;
}

@media (min-width: 900px) {
  .admin-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
  }
}

@media (max-width: 899px) {
  .admin-sidebar {
    display: grid;
    gap: 18px;
  }

  .admin-main {
    padding: 20px;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-topbar,
  .admin-user-area,
  .admin-panel__header,
  .admin-event-row {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* v0.7 — Curadorias */
.admin-brand-item {
  grid-template-columns: 104px minmax(0, 1fr) auto;
}

.admin-brand-thumb img {
  object-fit: contain;
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
}

.image-preview-wrapper--brand {
  flex-direction: column;
}

.image-preview-wrapper--brand img {
  width: min(100%, 360px);
  max-height: 220px;
  object-fit: contain;
  background: #f6f6f6;
}

@media (max-width: 760px) {
  .admin-brand-item {
    grid-template-columns: 76px minmax(0,1fr);
  }
}


/* ==========================================================
   v0.7.1 — Correções do Dashboard Admin
   ========================================================== */

/* O atributo hidden precisa prevalecer sobre display:grid */
[hidden] {
  display: none !important;
}

.admin-loading[hidden] {
  display: none !important;
}

/* Layout do dashboard */
.admin-layout {
  min-height: 100vh;
  background: #f5f5f5;
}

.admin-sidebar {
  box-sizing: border-box;
}

.admin-sidebar .admin-brand {
  display: block;
  margin-bottom: 28px;
  white-space: nowrap;
}

/* Evita herdar o menu horizontal das páginas CRUD */
.admin-sidebar .admin-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  overflow: visible;
}

.admin-sidebar .admin-nav a,
.admin-sidebar .admin-nav .disabled {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  white-space: nowrap;
  text-decoration: none;
}

.admin-sidebar .admin-nav a.active {
  background: rgba(255,255,255,.10);
  text-decoration: none;
}

.admin-sidebar .admin-nav .disabled {
  opacity: .42;
  cursor: default;
}

.admin-sidebar .admin-nav .disabled small {
  margin-left: 8px;
  font-size: .7rem;
  opacity: .75;
}

.admin-site-link {
  display: inline-block;
  margin-top: 24px;
  text-underline-offset: 4px;
}

.admin-main {
  min-width: 0;
  box-sizing: border-box;
}

.admin-topbar {
  min-width: 0;
  flex-wrap: wrap;
}

.admin-user-area {
  flex-shrink: 0;
}

.admin-user-email {
  max-width: 320px;
  overflow-wrap: anywhere;
}

.admin-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* Desktop */
@media (min-width: 900px) {
  .admin-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
  }

  .admin-main {
    padding: 40px 32px 60px;
  }
}

/* Tablet/mobile */
@media (max-width: 899px) {
  .admin-layout {
    display: block;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-sidebar .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .admin-sidebar .admin-nav a,
  .admin-sidebar .admin-nav .disabled {
    width: auto;
  }

  .admin-main {
    padding: 24px 16px 48px;
  }
}

@media (max-width: 600px) {
  .admin-sidebar .admin-nav {
    flex-direction: column;
  }

  .admin-sidebar .admin-nav a,
  .admin-sidebar .admin-nav .disabled {
    width: 100%;
  }

  .admin-topbar,
  .admin-user-area {
    align-items: flex-start;
  }

  .admin-user-area {
    width: 100%;
    justify-content: space-between;
  }
}


/* ==========================================================
   v0.7.2 — Dashboard visual inspirado no layout de referência
   ========================================================== */

.admin-dashboard-body {
  margin: 0;
  background: #f7f7f8;
  min-height: 100vh;
}

.dashboard-shell[hidden],
.admin-loading[hidden] {
  display: none !important;
}

.dashboard-shell {
  min-height: 100vh;
}

.dashboard-sidebar {
  background: linear-gradient(180deg, #111214 0%, #0d0e10 100%);
  color: #fff;
  padding: 30px 18px 22px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 5;
}

.dashboard-brand {
  display: inline-block;
  margin: 3px 10px 26px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .02em;
}

.dashboard-nav {
  display: grid;
  gap: 7px;
}

.dashboard-nav a {
  min-height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: .94rem;
  opacity: .94;
}

.dashboard-nav a:hover {
  background: rgba(255,255,255,.06);
}

.dashboard-nav a.active {
  background: rgba(255,255,255,.08);
  color: #ff3d4f;
}

.dashboard-nav__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.dashboard-nav__icon svg,
.dashboard-open-site svg,
.dashboard-logout svg,
.dashboard-stat-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-nav a:first-child .dashboard-nav__icon svg {
  fill: none;
}

.dashboard-open-site {
  margin: 30px 10px 0;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
}

.dashboard-open-site svg {
  width: 18px;
  height: 18px;
}

.dashboard-logout {
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 9px;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.dashboard-logout svg {
  width: 18px;
  height: 18px;
}

.dashboard-main {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fbfbfc;
}

.dashboard-account-bar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 46px);
  box-sizing: border-box;
}

.dashboard-account {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dashboard-account__text {
  display: grid;
  text-align: right;
  gap: 4px;
}

.dashboard-account__text strong {
  font-size: .92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.dashboard-account__text span {
  color: #777;
  font-size: .83rem;
}

.dashboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #ffe1e5;
  color: #e4273a;
  font-weight: 800;
}

.dashboard-content {
  width: min(1240px, calc(100% - 48px));
  margin: 54px auto 0;
  flex: 1;
}

.dashboard-heading {
  margin-bottom: 32px;
}

.dashboard-heading p {
  margin: 0 0 8px;
  color: #222;
  font-size: .9rem;
}

.dashboard-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.4rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.dashboard-heading span {
  display: block;
  margin-top: 10px;
  color: #777;
  font-size: .95rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-stat-card {
  min-height: 132px;
  padding: 24px 22px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 13px;
  box-shadow: 0 5px 18px rgba(17, 24, 39, .035);
}

.dashboard-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.dashboard-stat-icon svg {
  width: 22px;
  height: 22px;
}

.dashboard-stat-icon--pink {
  background: #ffe4e8;
  color: #ff3150;
}

.dashboard-stat-icon--green {
  background: #e4f7e9;
  color: #21a94c;
}

.dashboard-stat-icon--purple {
  background: #eee6ff;
  color: #7654e8;
}

.dashboard-stat-icon--yellow {
  background: #fff1d6;
  color: #f29a00;
}

.dashboard-stat-card strong {
  display: block;
  margin: 0 0 4px;
  font-size: 2rem;
  line-height: 1;
}

.dashboard-stat-card h2 {
  margin: 8px 0 5px;
  font-size: .96rem;
  line-height: 1.15;
}

.dashboard-stat-card p {
  margin: 0;
  color: #777;
  font-size: .8rem;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 20px;
}

.dashboard-panel {
  overflow: hidden;
  background: #fff;
  border: 1px solid #e4e4e6;
  border-radius: 13px;
  box-shadow: 0 5px 18px rgba(17, 24, 39, .03);
}

.dashboard-panel__header {
  min-height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #ececee;
}

.dashboard-panel__header h2 {
  margin: 0;
  font-size: 1rem;
}

.dashboard-panel__header a {
  padding: 8px 12px;
  border: 1px solid #e5e5e7;
  border-radius: 8px;
  color: #111;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
}

.dashboard-event-list {
  padding: 0 18px;
}

.dashboard-event-row {
  min-height: 92px;
  padding: 13px 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #efeff1;
}

.dashboard-event-row:last-child {
  border-bottom: none;
}

.dashboard-event-thumb {
  width: 62px;
  height: 62px;
  overflow: hidden;
  border-radius: 8px;
  background: #ededee;
}

.dashboard-event-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-event-thumb__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #888;
}

.dashboard-event-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.dashboard-event-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9rem;
}

.dashboard-event-info span,
.dashboard-event-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #666;
  font-size: .78rem;
}

.dashboard-event-status {
  padding-left: 8px;
}

.dashboard-event-badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .7rem;
  line-height: 1;
  white-space: nowrap;
}

.dashboard-event-badge--published {
  color: #188b3b;
  background: #ddf5e5;
}

.dashboard-event-badge--featured {
  color: #cf3040;
  background: #ffe5e8;
}

.dashboard-event-badge--draft {
  color: #a56a00;
  background: #fff0cc;
}

.dashboard-panel__footer {
  min-height: 52px;
  border-top: 1px solid #ececee;
  display: grid;
  place-items: center;
}

.dashboard-panel__footer a {
  color: #111;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
}

.dashboard-empty {
  min-height: 110px;
  display: grid;
  place-content: center;
  text-align: center;
  color: #777;
}

.dashboard-empty strong {
  color: #222;
}

.dashboard-empty p {
  margin: 5px 0 0;
}

.dashboard-footer {
  padding: 44px 24px 30px;
  text-align: center;
  color: #8a8a8a;
  font-size: .8rem;
}

.admin-dashboard-body .admin-alert--error {
  margin: 0 0 20px;
  padding: 13px 15px;
  border-radius: 10px;
  background: #fff0f0;
  border: 1px solid #ffd9d9;
}

@media (min-width: 980px) {
  .dashboard-shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .dashboard-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
  }
}

@media (max-width: 1180px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 979px) {
  .dashboard-shell {
    display: block;
  }

  .dashboard-sidebar {
    gap: 24px;
  }

  .dashboard-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-open-site {
    margin-top: 18px;
  }

  .dashboard-logout {
    max-width: 220px;
  }

  .dashboard-content {
    margin-top: 28px;
  }
}

@media (max-width: 760px) {
  .dashboard-account-bar {
    min-height: 72px;
    padding: 0 16px;
  }

  .dashboard-content {
    width: min(100% - 28px, 1240px);
  }

  .dashboard-stats,
  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .dashboard-nav {
    grid-template-columns: 1fr;
  }

  .dashboard-stat-card {
    min-height: 112px;
  }
}

@media (max-width: 520px) {
  .dashboard-account__text strong {
    max-width: 210px;
  }

  .dashboard-event-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .dashboard-event-thumb {
    width: 54px;
    height: 54px;
  }

  .dashboard-event-status {
    grid-column: 2;
    padding-left: 0;
  }
}


/* v0.7.5 — Configurações */
.form-message-success {
  color: #188b3b;
}
