/* ================================================================
   CriaVibe — Design System v3 (PHP Edition)
   Font: Inter | Icons: Font Awesome 6
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #6366f1;
  --primary-dk: #4f46e5;
  --primary-lt: #e0e7ff;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --light: #94a3b8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(15, 23, 42, .08);
  --shadow-md: 0 4px 24px rgba(15, 23, 42, .12);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);
  --tr: all .18s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  font-size: 15px
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5
}

a {
  text-decoration: none;
  color: inherit
}

button {
  font-family: inherit;
  cursor: pointer
}

img {
  display: block;
  max-width: 100%
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 4px
}

/* ── Topnav ── */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  box-shadow: var(--shadow);
}

.manager-topbar {
  background: var(--surface);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px
}

.manager-tab {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text)
}

.manager-spacer {
  flex: 1
}

.manager-actions {
  display: flex;
  align-items: center;
  gap: 8px
}

@media (max-width: 768px) {
  .manager-topbar {
    flex-wrap: wrap;
    padding: 16px;
    gap: 12px
  }

  .manager-tab {
    width: 100%;
    text-align: center;
    font-size: 1.15rem
  }

  .manager-spacer {
    display: none
  }

  .manager-actions {
    width: 100%;
    justify-content: center;
    gap: 6px
  }

  .manager-actions .btn {
    flex: 1;
    min-width: 0;
    padding-left: 4px !important;
    padding-right: 4px !important;
    font-size: 0.7rem;
    white-space: nowrap;
    justify-content: center;
    display: flex;
    align-items: center
  }
}

.topnav-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  gap: 8px
}

.topnav-spacer {
  flex: 1
}

.topnav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .825rem;
  color: var(--muted)
}

.topnav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 24px;
  color: var(--primary);
}

.topnav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.topnav-user strong {
  color: var(--text);
  font-weight: 600
}

.topnav-logout {
  font-size: .8rem;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--tr);
  background: none
}

.topnav-logout:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger)
}

.topnav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--muted);
  cursor: pointer;
  padding: 8px
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .825rem;
  font-weight: 600;
  border: none;
  transition: var(--tr);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit
}

.btn-primary {
  background: var(--primary);
  color: #fff
}

.btn-primary:hover {
  background: var(--primary-dk);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .35)
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border-2)
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-lt)
}

.btn-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1.5px solid #fecaca
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: .775rem
}

.btn-block {
  width: 100%;
  justify-content: center
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--muted)
}

.btn-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-lt)
}

.btn-voltar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none
}

.btn-voltar i {
  transition: transform .2s ease
}

.btn-voltar:hover {
  color: var(--primary);
  background: var(--primary-lt);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .15)
}

.btn-voltar:hover i {
  transform: translateX(-3px)
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em
}

.badge-ativo {
  background: #dcfce7;
  color: #15803d
}

.badge-inativo {
  background: var(--surface-2);
  color: var(--light);
  border: 1px solid var(--border)
}

.badge-primary {
  background: var(--primary-lt);
  color: var(--primary-dk)
}

/* ── Form ── */
.form-group {
  margin-bottom: 18px
}

.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 6px
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: inherit;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color .2s
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1)
}

.form-control::placeholder {
  color: var(--light)
}

textarea.form-control {
  resize: vertical;
  min-height: 80px
}

select.form-control {
  cursor: pointer
}

.form-hint {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 5px
}

.form-error {
  font-size: .75rem;
  color: var(--danger);
  margin-top: 5px;
  display: none
}

.form-error.show {
  display: block
}

/* ── Modal ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center
}

.modal-backdrop.open {
  display: flex
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 460px;
  max-width: 96vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(.96) translateY(8px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700
}

.modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--tr)
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text)
}

.modal-body {
  padding: 20px 24px 24px
}

/* ── Toggle ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-2);
  border-radius: 24px;
  transition: .25s
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: .25s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15)
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--primary)
}

.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(18px)
}

/* ── Flash ── */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px
}

.flash-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0
}

.flash-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca
}

/* ── Empty ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px
}

.empty-state .icon {
  font-size: 3rem;
  color: var(--light);
  margin-bottom: 16px
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px
}

.empty-state p {
  font-size: .875rem;
  color: var(--muted);
  max-width: 360px
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  z-index: 9999;
  animation: fadeIn .2s ease
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

/* ── Layout painel ── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 17, 0.6);
  backdrop-filter: blur(3px);
  z-index: 399;
  /* Just below the sidebar */
  opacity: 0;
  visibility: hidden;
  transition: var(--tr);
}

body.sidebar-open .sidebar-overlay {
  opacity: 1;
  visibility: visible;
}

.painel-layout {
  display: flex;
  margin-top: 56px;
  min-height: calc(100vh - 56px)
}

.painel-sidebar {
  width: 220px;
  position: fixed;
  top: 56px;
  bottom: 0;
  left: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  overflow-y: auto;
  z-index: 100
}

.painel-sidebar h3 {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--light);
  text-transform: uppercase;
  padding: 0 20px 10px
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  border-left: 3px solid transparent;
  transition: var(--tr)
}

.sidebar-link i {
  width: 16px;
  text-align: center;
  font-size: .85rem
}

.sidebar-link:hover {
  background: var(--bg);
  color: var(--text)
}

.sidebar-link.active {
  color: var(--primary);
  background: var(--primary-lt);
  border-left-color: var(--primary);
  font-weight: 600
}

.painel-main {
  margin-left: 220px;
  flex: 1;
  padding: 28px 32px;
  max-width: 1100px
}

.painel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap
}

.painel-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  flex: 1;
  min-width: 180px
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: .825rem;
  color: var(--muted);
  transition: var(--tr)
}

.search-bar:focus-within {
  border-color: var(--primary)
}

.search-bar input {
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: .825rem;
  width: 200px
}

/* ── Galleries table ── */
.galleries-table {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible
}

.table-responsive {
  width: 100%;
  overflow: visible;
  padding-bottom: 20px
}

.galleries-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px
}

.galleries-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--light);
  text-transform: uppercase;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border)
}

.galleries-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s
}

.galleries-table tbody tr:last-child {
  border-bottom: none
}

.galleries-table tbody tr:hover {
  background: var(--surface-2)
}

.galleries-table td {
  padding: 12px 16px;
  vertical-align: middle;
  font-size: .85rem
}

.gallery-thumb {
  width: 52px;
  height: 36px;
  object-fit: contain;
  background: #0f172a;
  border-radius: 0
}

.gallery-thumb-empty {
  width: 52px;
  height: 36px;
  border-radius: 0;
  background: var(--primary-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: .75rem
}

.gallery-name {
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.gallery-name:hover {
  color: var(--primary)
}

/* ── Actions dropdown ── */
.actions-menu {
  position: relative;
  display: inline-block
}

.actions-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--tr)
}

.actions-btn:hover {
  background: var(--bg);
  color: var(--text)
}

.actions-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  z-index: 300;
  overflow: hidden
}

.actions-dropdown.open {
  display: block;
  animation: ddIn .15s ease
}

@keyframes ddIn {
  from {
    opacity: 0;
    transform: translateY(-4px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.actions-dropdown a,
.actions-dropdown button.dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  transition: background .12s;
  cursor: pointer;
  font-family: inherit
}

.actions-dropdown a:hover,
.actions-dropdown button.dd-item:hover {
  background: var(--bg)
}

.actions-dropdown button.danger {
  color: var(--danger)
}

.actions-dropdown button.danger:hover {
  background: #fef2f2
}

.actions-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2px 0
}

/* ── Copy btn ── */
.copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: var(--tr);
  display: inline-flex;
  align-items: center;
  gap: 5px
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-lt)
}

/* ── Short text utilities ── */
.show-on-mobile {
  display: none;
}

/* =========================================================
   HERO CRIAVIBE — IMAGE BACKGROUND VERSION
========================================================= */

.hero {
  position: relative;

  width: 100%;
  min-height: 100vh;

  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
}

/* =========================================================
   IMAGEM DE FUNDO
========================================================= */

.hero-bg {
  position: absolute;
  inset: 0;

  /* =====================================================
       TROQUE O CAMINHO DA IMAGEM AQUI ↓↓↓
       Exemplo:
       url('/static/img/banner.jpg')
    ===================================================== */

  background-image: url('../images/telas/fundo-site.png');

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  z-index: 1;

  transform: scale(1.02);

  animation: bgZoom 18s ease-in-out infinite alternate;
}

/* =========================================================
   OVERLAY ESCURO PREMIUM
========================================================= */

.hero::after, .hero-overlay {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(2, 2, 8, 0.45) 0%, rgba(2, 2, 8, 0.7) 100%);
  z-index: 2;
  pointer-events: none;
}

/* =========================================================
   GRID PREMIUM
========================================================= */

.hero-dots {
  position: absolute;
  inset: 0;

  background-image:
    radial-gradient(rgba(255, 255, 255, .05) 1px,
      transparent 1px);

  background-size: 26px 26px;

  opacity: .22;

  z-index: 3;
}

/* =========================================================
   CONTAINER DOS BOTÕES
========================================================= */

.hero-content {
  position: relative;

  z-index: 10;

  width: 100%;
  height: 100vh;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  padding-bottom: 7%;
}

/* =========================================================
   ÁREA DOS BOTÕES
========================================================= */

.hero-actions {
  display: flex;
  gap: 18px;

  flex-wrap: wrap;

  justify-content: center;
  align-items: center;
}

/* =========================================================
   BOTÕES
========================================================= */

.btn-hero {
  border: none;
  outline: none;

  cursor: pointer;

  padding: 18px 42px;

  border-radius: 18px;

  font-size: 1rem;
  font-weight: 700;

  transition: .28s ease;

  backdrop-filter: blur(14px);

  position: relative;

  overflow: hidden;
}

/* =========================================================
   BOTÃO PRINCIPAL
========================================================= */

.btn-hero-primary {

  color: #fff;

  background:
    linear-gradient(135deg,
      rgba(124, 58, 237, .95),
      rgba(99, 102, 241, .95));

  box-shadow:
    0 15px 40px rgba(99, 102, 241, .35),
    0 0 60px rgba(168, 85, 247, .22);
}

.btn-hero-primary:hover {

  transform:
    translateY(-4px) scale(1.03);

  box-shadow:
    0 20px 70px rgba(99, 102, 241, .55),
    0 0 120px rgba(168, 85, 247, .38);
}

/* =========================================================
   BOTÃO SECUNDÁRIO
========================================================= */

.btn-hero-ghost {

  color: #fff;

  background:
    rgba(255, 255, 255, .08);

  border:
    1px solid rgba(255, 255, 255, .18);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, .22);
}

.btn-hero-ghost:hover {

  background:
    rgba(255, 255, 255, .14);

  transform:
    translateY(-4px);
}

/* =========================================================
   EFEITO BRILHO
========================================================= */

.btn-hero::before {

  content: "";

  position: absolute;

  top: 0;
  left: -120%;

  width: 100%;
  height: 100%;

  background:
    linear-gradient(120deg,
      transparent,
      rgba(255, 255, 255, .25),
      transparent);

  transition: .7s;
}

.btn-hero:hover::before {
  left: 120%;
}

/* =========================================================
   ANIMAÇÃO SUAVE DA IMAGEM
========================================================= */

@keyframes bgZoom {

  0% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1.08);
  }
}

/* =========================================================
   RESPONSIVO
========================================================= */

@media(max-width:768px) {

  .hero-content {
    padding:
      0 24px 80px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-hero {
    width: 100%;
  }

}

/* =========================================================
   TABLET
========================================================= */

@media(max-width: 1100px) {

  .hero {
    padding: 110px 24px 50px;
  }

  .hero-banner {
    max-width: 100%;
  }

  .hero-actions {
    bottom: 4%;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media(max-width: 768px) {

  .hero {

    min-height: auto;

    padding:
      100px 14px 40px;
  }

  .hero-content {
    width: 100%;
  }

  .hero-banner {

    width: 100%;

    max-width: 100%;

    border-radius: 18px;
  }

  .hero-actions {

    position: relative;

    bottom: auto;
    left: auto;

    transform: none;

    margin-top: -20px;

    display: flex;
    justify-content: center;
  }

  .btn-hero {

    width: 100%;

    max-width: 320px;

    font-size: .95rem;

    padding: 16px 24px;

    border-radius: 14px;
  }
}

/* ── Responsive ── */
@media(max-width:768px) {
  .badge {
    padding: 2px 6px;
    font-size: .65rem;
    gap: 3px;
    border-radius: 15px
  }

  .topnav-toggle {
    display: block
  }

  .topnav-user span {
    display: none
  }

  .topnav {
    height: 80px;
    padding: 15px 16px 0;
    z-index: 500
  }

  .topnav>* {
    position: relative;
    z-index: 501;
  }

  .painel-layout {
    margin-top: 80px;
    min-height: calc(100vh - 80px)
  }

  .painel-sidebar {
    top: 80px;
    left: -220px;
    transition: transform .3s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.1);
    z-index: 400;
  }

  body.sidebar-open .painel-sidebar {
    transform: translateX(220px);
  }

  .painel-main {
    margin-left: 0;
    padding: 20px 16px
  }

  .painel-header h2 {
    font-size: 1.1rem
  }

  .search-bar input {
    width: 120px
  }

  /* Modal optimization */
  .modal {
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    position: fixed;
    bottom: 0;
    max-height: 85vh
  }

  @keyframes modalIn {
    from {
      opacity: 0;
      transform: translateY(100%)
    }

    to {
      opacity: 1;
      transform: translateY(0)
    }
  }

  .modal-body {
    padding-bottom: 40px
  }

  /* ── Mobile Galleries Cards Premium ── */
  .table-responsive {
    overflow: visible;
    padding-bottom: 0;
  }

  .galleries-table {
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .galleries-table table,
  .galleries-table tbody,
  .galleries-table tr,
  .galleries-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .galleries-table thead {
    display: none;
  }

  .galleries-table tr {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .galleries-table td {
    padding: 0;
    border: none;
  }

  /* Top section: Capa */
  .galleries-table td:nth-child(1) {
    width: 55px;
    margin-right: 14px;
  }

  .gallery-thumb,
  .gallery-thumb-empty {
    width: 55px;
    height: 55px;
    border-radius: 0;
    object-fit: contain;
    background: #0f172a;
  }

  /* Galeria Nome/Badge */
  .galleries-table td:nth-child(2) {
    flex: 0 0 calc(100% - 69px);
    min-width: 0;
    padding-right: 30px;
    /* forces break */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 55px;
  }

  /* BOTTOM ROW: Columns Grid layout for metrics */
  .galleries-table td:nth-child(3),
  .galleries-table td:nth-child(4),
  .galleries-table td:nth-child(5),
  .galleries-table td:nth-child(6) {
    flex: 1;
    min-width: 0;
    margin-top: 16px;
    padding-top: 14px;
    padding-bottom: 2px;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    background: transparent;
    border-radius: 0;
    border-left: none;
    border-bottom: none;
    font-size: 0.8rem;
  }

  /* Playlist (TD3) */
  .galleries-table td:nth-child(3) {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    padding-top: 12px;
    font-weight: 500;
    font-size: 0.72rem;
    color: var(--light);
  }

  .galleries-table td:nth-child(3):has(span:only-child),
  .galleries-table td:nth-child(3):empty {
    display: none;
  }

  .galleries-table td:nth-child(6) {
    border-right: none;
  }

  /* Remove vertical line on last item */

  /* Top Labels */
  .galleries-table td:nth-child(4)::before {
    content: "FOTOS";
    display: block;
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
  }

  .galleries-table td:nth-child(5)::before {
    content: "SELEÇÃO";
    display: block;
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
  }

  .galleries-table td:nth-child(6)::before {
    content: "DOWNLOAD";
    display: block;
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
  }

  /* Values below Labels */
  .galleries-table td:nth-child(4)>span {
    display: none !important;
  }

  .galleries-table td:nth-child(4) strong {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1;
  }

  .galleries-table td:nth-child(5)>span,
  .galleries-table td:nth-child(6)>span {
    font-size: 0.68rem;
    line-height: 1.2;
    padding: 3px 8px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Actions */
  .galleries-table td:nth-child(7) {
    position: absolute;
    top: 26px;
    right: 12px;
    width: auto;
    z-index: 10;
  }

  .actions-dropdown {
    right: 0;
    top: calc(100% + 5px);
    z-index: 9999;
  }

  /* Short texts for smaller footprint */
  .hide-on-mobile {
    display: none !important;
  }

  .show-on-mobile {
    display: inline !important;
  }
}

@media(max-width:480px) {
  .btn span {
    display: none
  }

  .btn i {
    font-size: 1rem;
    margin: 0
  }

  .topnav-logo span {
    display: none
  }
}
