/* ==========================================================================
   LÓGIX CMS • PAINEL ADMINISTRATIVO & GESTÃO DE CONTEÚDO (ESTILO WORDPRESS)
   Design System: Dark Industrial Luxury / Dashboard SaaS
   ========================================================================== */

:root {
  --admin-bg: #0B0E14;
  --admin-sidebar: #101520;
  --admin-card: #151C2C;
  --admin-card-hover: #1A2338;
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-focus: #EA580C;

  --accent-copper: #EA580C;
  --accent-copper-hover: #F97316;
  --accent-amber: #F59E0B;
  --accent-green: #10B981;
  --accent-red: #EF4444;
  --accent-blue: #0EA5E9;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  margin: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Estilo WordPress */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header img {
  height: 38px;
  border-radius: 8px;
}

.sidebar-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  margin: 0;
  color: #fff;
  line-height: 1.1;
}

.sidebar-header span {
  font-size: 0.7rem;
  color: var(--accent-copper);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  list-style: none;
  padding: 16px 12px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.sidebar-item a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.sidebar-item.active a {
  background: var(--accent-copper);
  color: #fff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.sidebar-item a i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.user-badge img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--accent-copper);
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s;
}

.btn-logout:hover {
  color: var(--accent-red);
}

/* Conteúdo Principal */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-topbar {
  height: 64px;
  background: var(--admin-sidebar);
  border-bottom: 1px solid var(--admin-border);
  padding-inline: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-topbar h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  margin: 0;
  color: #fff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* Tabs e Telas */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards & Tabelas */
.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title-row h3 {
  font-size: 1.25rem;
  margin: 0;
  color: #fff;
}

/* Tabela de Artigos */
.cms-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.cms-table th, .cms-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.9rem;
}

.cms-table th {
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
}

.cms-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.post-thumb-mini {
  width: 50px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
}

.badge-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(234, 88, 12, 0.15);
  color: var(--accent-copper-hover);
}

.action-btns {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-icon.danger:hover {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

/* Modal de Criação/Edição */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--admin-sidebar);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 1.3rem;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Grid de Imagens da Galeria */
.gallery-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.gallery-manage-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--admin-border);
  background: var(--admin-bg);
  aspect-ratio: 4 / 3;
}

.gallery-manage-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-manage-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-manage-card:hover .gallery-manage-overlay {
  opacity: 1;
}

/* Upload Dropzone */
.dropzone-box {
  border: 2px dashed var(--admin-border);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(255, 255, 255, 0.01);
  margin-bottom: 20px;
}

.dropzone-box:hover {
  border-color: var(--accent-copper);
  background: rgba(234, 88, 12, 0.04);
}

.dropzone-box i {
  font-size: 2.4rem;
  color: var(--accent-copper);
  margin-bottom: 12px;
}
