/*!
 * Hub de Comunicação Científica Lab-Div V3.0 — Fire Stick Storage & Portfolio Portal v2.0
 * Copyright (C) 2026 João Paulo Stangorlini de Carvalho
 *
 * Este programa é software livre: você pode redistribuí-lo e/ou modificá-lo
 * sob os termos da Licença Pública Geral Affero GNU (AGPLv3) conforme
 * publicada pela Free Software Foundation.
 *
 * Este programa é distribuído na esperança de que seja útil, mas SEM
 * QUALQUER GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO
 * ou ADEQUAÇÃO A UM DETERMINADO FIM.
 */

:root {
  --bg-obsidian: #07040e;
  --bg-surface: #110a1f;
  --bg-surface-elevated: #180f2c;
  --bg-surface-hover: #21143b;

  --gold-primary: #d4af37;
  --gold-bright: #f5d061;
  --gold-muted: #9a7b2c;
  --gold-border: rgba(212, 175, 55, 0.22);
  --gold-border-strong: rgba(245, 208, 97, 0.55);

  --purple-royal: #6d28d9;
  --purple-amethyst: #a855f7;
  --purple-deep: #3b1378;
  --purple-border: rgba(168, 85, 247, 0.22);

  --text-primary: #f7f4fc;
  --text-secondary: #b9aed3;
  --text-muted: #7e7299;

  --danger: #e11d48;
  --success: #10b981;

  --font-ui: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

html,
body {
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-ui);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Luzes Atmosféricas Fixas */
.ambient-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  opacity: 0.4;
}

.ambient-purple {
  top: -180px;
  left: -140px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(109, 40, 217, 0.34) 0%, transparent 70%);
}

.ambient-gold {
  bottom: -200px;
  right: -140px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, transparent 70%);
}

/* ==========================================================================
   TOPBAR (Camada única com backdrop-filter permitido)
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 6, 20, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gold-border);
}

.topbar-inner {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-emblem {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.35), rgba(212, 175, 55, 0.22));
  border: 1px solid var(--gold-border-strong);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  font-size: 1rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--gold-primary);
  text-transform: uppercase;
}

.brand-name {
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
}

/* Abas de Ambientes */
.env-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  padding: 0.28rem;
  border-radius: 999px;
  border: 1px solid var(--purple-border);
}

.env-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.env-tab:hover {
  color: var(--text-primary);
}

.env-tab.active {
  background: linear-gradient(135deg, var(--purple-royal), #4c1d95);
  color: var(--gold-bright);
  box-shadow: 0 0 0 1px var(--gold-border-strong);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-bright);
}

.icon-sm {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Botões */
.btn-console {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  background: rgba(24, 15, 44, 0.9);
  border: 1px solid var(--gold-border);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-console:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 232, 148, 0.5);
  background: linear-gradient(135deg, #e3be42 0%, #b88917 100%);
  color: #0b0614;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-gold:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-outline-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.58rem 1.05rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-border-strong);
  background: var(--bg-surface-elevated);
  color: var(--gold-bright);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.86rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.btn-outline-gold:hover {
  background: var(--bg-surface-hover);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  cursor: pointer;
}

.btn-xs {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-xs-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-xs-ghost:hover {
  color: var(--gold-bright);
}

.file-btn {
  cursor: pointer;
}

/* ==========================================================================
   CONTAINER PRINCIPAL & PORTFÓLIO HERO
   ========================================================================== */
.main-shell {
  position: relative;
  z-index: 1;
  max-width: 1520px;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}

.portfolio-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
  margin-bottom: 1.5rem;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  color: var(--gold-primary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(1.65rem, 3.4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(95deg, #ffffff 0%, #f5d061 55%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
}

.hero-subtitle {
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 300;
  max-width: 640px;
}

.portfolio-admin-bar {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Pílulas de Álbum */
.album-bar-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}

.album-pills,
.filter-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.album-pills::-webkit-scrollbar,
.filter-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  background: var(--bg-surface);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: var(--text-secondary);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.pill:hover {
  border-color: var(--gold-border-strong);
  color: var(--text-primary);
}

.pill.active {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.48), rgba(212, 175, 55, 0.2));
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  font-weight: 500;
}

.photo-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   AJUSTE 6: MASONRY GRID 60FPS (SEM BACKDROP-BLUR + ZERO CLS ASPECT-RATIO)
   ========================================================================== */
.masonry-grid {
  column-count: 1;
  column-gap: 1.15rem;
}

@media (min-width: 620px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .masonry-grid {
    column-count: 3;
  }
}

@media (min-width: 1440px) {
  .masonry-grid {
    column-count: 4;
  }
}

.photo-card,
.skeleton-card {
  break-inside: avoid;
  margin-bottom: 1.15rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--bg-surface);
  border: 1px solid rgba(212, 175, 55, 0.16);
  position: relative;
  transform: translateZ(0);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.photo-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-border-strong);
}

.photo-frame {
  width: 100%;
  background: linear-gradient(135deg, #130b24 0%, #1c1033 100%);
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.32s ease, transform 0.45s ease;
}

.photo-frame img.loaded {
  opacity: 1;
}

.photo-card:hover .photo-frame img.loaded {
  transform: scale(1.025);
}

.photo-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.2rem 1rem 0.9rem;
  background: linear-gradient(to top, rgba(7, 4, 14, 0.94) 0%, rgba(7, 4, 14, 0.5) 55%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

@media (hover: none) {
  .photo-overlay {
    opacity: 1;
  }
}

.photo-info h4 {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-primary);
}

.photo-info span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.photo-admin-actions {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: flex;
  gap: 0.35rem;
  z-index: 3;
}

.card-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--gold-border);
  background: rgba(11, 6, 20, 0.88);
  color: var(--text-primary);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
}

.card-action-btn.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.skeleton-card {
  width: 100%;
  background: linear-gradient(110deg, #120b22 25%, #1e1338 45%, #120b22 65%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}

.empty-state {
  text-align: center;
  padding: 4.5rem 1.5rem;
  background: var(--bg-surface);
  border: 1px dashed var(--gold-border);
  border-radius: var(--radius-lg);
}

.empty-emblem {
  font-size: 2rem;
  color: var(--gold-bright);
  margin-bottom: 0.75rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.45rem;
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

/* ==========================================================================
   AMBIENTES 2 & 3: TELEMETRIA, COFRE PESSOAL & EXPLORADOR HUB
   ========================================================================== */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--purple-border);
}

.zone-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold-primary);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  margin-top: 0.25rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 0.25rem;
}

.header-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Telemetria Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 960px) {
  .telemetry-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.telemetry-card {
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
}

.t-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.t-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.t-value {
  font-size: 1.35rem;
  color: var(--gold-bright);
  margin-top: 0.2rem;
}

.t-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid var(--purple-border);
  color: var(--text-primary);
}

.segmented-bar {
  height: 12px;
  width: 100%;
  background: #090513;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.seg-fill {
  height: 100%;
  transition: width 0.35s ease;
}

.seg-portfolio {
  background: linear-gradient(90deg, #d4af37, #f5d061);
}

.seg-vault {
  background: linear-gradient(90deg, #a855f7, #d8b4fe);
}

.seg-hub {
  background: linear-gradient(90deg, #5b21b6, #7c3aed);
}

.seg-other {
  background: rgba(255, 255, 255, 0.18);
}

.zone-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.legend-name {
  display: block;
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.legend-item strong {
  font-size: 0.8rem;
  color: var(--text-primary);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.dot-gold { background: var(--gold-bright); }
.dot-amethyst { background: var(--purple-amethyst); }
.dot-violet { background: var(--purple-royal); }
.dot-free { background: #2c2242; border: 1px solid rgba(255,255,255,0.25); }

.t-path,
.t-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  word-break: break-all;
}

.mini-bar {
  height: 7px;
  width: 100%;
  background: #090513;
  border-radius: 999px;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-amethyst), var(--gold-bright));
  transition: width 0.25s ease;
}

/* Dropzone & Toolbars */
.dropzone-banner {
  border: 1px dashed var(--gold-border-strong);
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.12), rgba(212, 175, 55, 0.06));
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone-banner.compact {
  padding: 0.8rem 1rem;
}

.dropzone-banner.dragover {
  border-color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.16);
  color: var(--gold-bright);
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.crumb-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--purple-border);
  color: var(--gold-bright);
  padding: 0.32rem 0.65rem;
  border-radius: 7px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.crumb-sep {
  color: var(--text-muted);
}

.input-dark,
.select-dark {
  background: var(--bg-surface);
  border: 1px solid var(--purple-border);
  color: var(--text-primary);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  outline: none;
}

.input-dark:focus,
.select-dark:focus {
  border-color: var(--gold-bright);
}

.input-dark.full,
.select-dark.full {
  width: 100%;
}

/* Cards Vault & HUB Media */
.vault-grid,
.hub-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.95rem;
}

.entry-card {
  background: var(--bg-surface);
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.entry-card:hover {
  border-color: var(--gold-border-strong);
  transform: translateY(-2px);
}

.entry-thumb {
  height: 148px;
  background: #0c0718;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

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

.entry-kind-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: rgba(109, 40, 217, 0.28);
  border: 1px solid var(--gold-border);
  color: var(--gold-bright);
  text-transform: uppercase;
}

.entry-body {
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.entry-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.entry-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.entry-btn {
  flex: 1;
  padding: 0.36rem 0.45rem;
  font-size: 0.74rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.entry-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-bright);
}

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

/* ==========================================================================
   CINEMA LIGHTBOX 60FPS
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 3, 10, 0.96);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
}

.lightbox-hud {
  position: relative;
  z-index: 5;
  background: rgba(14, 8, 28, 0.76);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.8rem 1.25rem;
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--gold-border);
  flex-wrap: wrap;
}

.lb-meta-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.lb-album-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.22rem 0.58rem;
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid var(--gold-border-strong);
  color: var(--gold-bright);
  text-transform: uppercase;
}

.lb-meta-title h3 {
  font-size: 0.98rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lb-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--gold-border);
  color: var(--text-primary);
  padding: 0.36rem 0.65rem;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
}

.lb-btn:hover,
.lb-btn.active {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.lb-zoom-readout {
  font-size: 0.76rem;
  min-width: 42px;
  text-align: center;
  color: var(--gold-bright);
}

.lightbox-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
}

.lightbox-stage.dragging {
  cursor: grabbing;
}

.lightbox-stage img {
  max-width: 92vw;
  max-height: 76vh;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(18, 11, 34, 0.85);
  border: 1px solid var(--gold-border);
  color: var(--gold-bright);
  font-size: 1.6rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

.lightbox-bottom {
  border-top: 1px solid var(--gold-border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lb-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.lb-exif-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.exif-chip {
  font-size: 0.72rem;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  background: rgba(109, 40, 217, 0.22);
  border: 1px solid rgba(212, 175, 55, 0.26);
  color: var(--gold-bright);
}

/* ==========================================================================
   MODAIS & FILA FLUTUANTE DE UPLOAD
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 3, 12, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-box {
  width: 100%;
  max-width: 460px;
  background: var(--bg-surface);
  border: 1px solid var(--gold-border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8);
}

.modal-wide {
  max-width: 640px;
}

.modal-preview-box {
  max-width: 960px;
}

.modal-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.preview-head-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.field-label {
  font-size: 0.8rem;
  color: var(--gold-bright);
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 580px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.portfolio-drop-select {
  margin-top: 0.35rem;
  padding: 1.65rem 1rem;
  border: 1px dashed var(--gold-border-strong);
  border-radius: var(--radius-md);
  background: rgba(109, 40, 217, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  cursor: pointer;
}

.drop-icon {
  font-size: 1.4rem;
  color: var(--gold-bright);
}

.selected-count {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--gold-bright);
}

.modal-foot {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.preview-body {
  padding: 1rem;
  background: #05030a;
  min-height: 320px;
  max-height: 78vh;
  overflow: auto;
  display: grid;
  place-items: center;
}

.preview-body img,
.preview-body video {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 8px;
}

.preview-body iframe {
  width: 100%;
  height: 70vh;
  border: none;
  border-radius: 8px;
  background: #fff;
}

.preview-body pre {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Upload Queue Drawer */
.upload-drawer {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 85;
  width: min(380px, calc(100vw - 2rem));
  background: rgba(17, 10, 31, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--gold-border-strong);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.upload-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.upload-drawer-head strong {
  display: block;
  font-size: 0.88rem;
  color: var(--gold-bright);
}

.upload-drawer-btns {
  display: flex;
  gap: 0.5rem;
}

.upload-queue-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
}

.queue-item-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.queue-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold-bright);
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 340px;
}

.toast {
  background: #170e2b;
  border: 1px solid var(--gold-border-strong);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.84rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.2s ease;
}

.toast.error {
  border-color: var(--danger);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 0.7rem 0.9rem;
  }
  .env-tabs {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .env-tab {
    flex: 1;
    justify-content: center;
    padding: 0.45rem 0.5rem;
    font-size: 0.78rem;
  }
  .lb-nav {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }
}

