/* Área administrativa — sidebar escura + conteúdo shell */

.admin-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

/* ---- sidebar ---- */

.admin-sidebar {
  background: var(--ink);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
}
.admin-sidebar__brand .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  letter-spacing: -0.02em;
}
.admin-sidebar__brand .sep { color: rgba(255, 255, 255, 0.35); }

.admin-sidebar__group-title {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
  padding: 0 8px 8px;
}

.admin-sidebar__nav { display: flex; flex-direction: column; gap: 2px; }

.admin-sidebar__link {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}
.admin-sidebar__link:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.admin-sidebar__link--active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
}

.admin-sidebar__user {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-sidebar__avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}
.admin-sidebar__username { font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }
.admin-sidebar__logout {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.admin-sidebar__logout:hover { color: #fff; }

/* ---- conteúdo ---- */

.admin-main { background: var(--shell); min-width: 0; }
.admin-page { padding: 28px; }

.admin-page__header {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 24px;
}
.admin-page__header h1 {
  margin: 0 0 4px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.admin-page__header p { margin: 0; font-size: 14px; color: var(--muted); }
.admin-page__header .actions { margin-left: auto; }

/* tiles de estatísticas */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-tile__label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 8px;
}
.stat-tile__value {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* tabela do admin */
.admin-table {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table__head, .admin-table__row {
  display: grid;
  align-items: center;
}
.admin-table__head {
  background: var(--surf);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.admin-table__head > div, .admin-table__row > div { padding: 12px 10px; }
.admin-table__row { border-bottom: 1px solid var(--line); }
.admin-table__row:last-child { border-bottom: 0; }
.admin-table__row:hover { background: var(--surf); }

.admin-table--categories .admin-table__head,
.admin-table--categories .admin-table__row {
  grid-template-columns: 36px 2fr 1.4fr 90px 130px 70px;
}
.admin-table--articles .admin-table__head,
.admin-table--articles .admin-table__row {
  grid-template-columns: 2.2fr 1.2fr 110px 110px 130px;
}

.drag-handle { color: var(--faint); cursor: grab; font-size: 14px; padding-left: 14px; }
.sortable-ghost { opacity: 0.4; }

.cell-title { display: flex; align-items: center; gap: 12px; }
.cell-title__glyph {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surf);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.cell-title__name { font-size: 14px; font-weight: 500; }
.cell-title__desc { font-size: 12px; color: var(--faint); }

.cell-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--muted); }
.cell-num { font-size: 13.5px; font-variant-numeric: tabular-nums; }

.vis-toggle {
  border: 0;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.vis-toggle--public { background: var(--ok-bg); color: var(--ok-fg); }
.vis-toggle--internal { background: var(--warn-bg); color: var(--warn-fg); }

/* formulários do admin */
.admin-form { max-width: 720px; }
.admin-form .card { padding: 20px; margin-bottom: 16px; }
.admin-form .card h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.admin-form__actions { display: flex; gap: 10px; }

.locale-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.locale-fields__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- editor de artigos ---- */

.editor-topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.editor-topbar__crumb { font-size: 13px; color: var(--faint); display: flex; gap: 8px; }
.editor-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  padding: 28px;
  align-items: start;
}

.editor-card { overflow: hidden; }
.editor-card__toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surf);
  border-radius: var(--radius) var(--radius) 0 0;
}
.editor-card__toolbar .lexxy-editor__toolbar-button {
  border: 0;
  background: transparent;
  min-width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
}
.editor-card__toolbar .lexxy-editor__toolbar-button:hover { background: var(--line); }
.editor-card__toolbar .lexxy-editor__toolbar-button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.editor-card__toolbar-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.editor-card__toolbar-text { font-size: 12.5px !important; }

.editor-card__body { padding: 28px 32px 44px; }

.editor-title-input {
  width: 100%;
  border: 0;
  outline: none;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  background: transparent;
}
.editor-title-input::placeholder { color: var(--faint); }

.editor-summary-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: none;
  font-size: 15.5px;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  background: transparent;
}
.editor-summary-input::placeholder { color: var(--faint); }

/* o editor lexxy dentro do card: sem borda própria */
.editor-card__body lexxy-editor { border: 0; padding: 0; }
.editor-card__body .lexxy-editor__content,
.editor-card__body [contenteditable] { min-height: 320px; }

.editor-rail { display: flex; flex-direction: column; gap: 16px; }

.editor-panel { padding: 18px; }
.editor-panel__title { font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.editor-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.editor-panel__row:first-of-type { border-top: 0; }
.editor-panel__add { display: flex; gap: 6px; margin-top: 10px; }

.field-label-plain { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.editor-panel .field select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; background: #fff; }

.segmented { display: flex; gap: 6px; }
.segmented__option {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  background: #fff;
}
.segmented__option:has(.segmented__radio:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.segmented__radio { position: absolute; opacity: 0; pointer-events: none; }

.slug-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surf);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- assistente de importação ---- */

.import-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.import-steps__item { display: flex; align-items: center; gap: 8px; }
.import-steps__mark {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--faint);
}
.import-steps__item--done .import-steps__mark { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-fg); }
.import-steps__item--current .import-steps__mark { background: var(--ink); border-color: var(--ink); color: #fff; }
.import-steps__label { font-size: 13px; color: var(--faint); font-weight: 500; }
.import-steps__item--done .import-steps__label { color: var(--muted); }
.import-steps__item--current .import-steps__label { color: var(--ink); font-weight: 600; }
.import-steps__line { width: 28px; height: 1px; background: var(--line); }

.import-drop {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 56px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.import-drop__title { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.import-drop input[type="file"] { font-size: 13px; }

.import-file { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.import-file__glyph {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surf);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.import-note { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12.5px; color: var(--faint); }
.import-progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 16px; }
.import-progress__bar { height: 100%; background: var(--ink); }
.import-result__value { font-family: var(--font-display); font-size: 34px; line-height: 1; font-weight: 600; letter-spacing: -0.03em; }

.admin-table select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13.5px;
  background: #fff;
  outline: none;
}
.admin-table select:focus { border-color: var(--ink); }
