/* =========================================================
   VARIÁVEIS GLOBAIS E TOKENS DE DESIGN
   ========================================================= */
:root {
  --bg-color: #0f1729;
  --panel-bg: rgba(18, 24, 42, 0.5);
  --panel-border: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(25, 32, 52, 0.55);
  --text-main: #e8ecf4;
  --text-muted: #8b9ab5;
  --accent-color: #6366f1;
  --accent-color-hover: #4f46e5;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Inter', sans-serif;
  
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 8px;
}

/* =========================================================
   RESET E BASE
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* =========================================================
   BACKGROUND ANIMADO (BLOBS)
   ========================================================= */
.bg-blur {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  filter: blur(90px);
}

.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.7;
  animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
  width: 420px;
  height: 420px;
  background: linear-gradient(135deg, var(--accent-purple), #a78bfa);
  top: -10%;
  left: -8%;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--accent-blue), #60a5fa);
  bottom: -15%;
  right: -8%;
  animation-delay: -5s;
}

.blob-3 {
  width: 320px;
  height: 320px;
  background: linear-gradient(135deg, #10b981, #34d399);
  bottom: 25%;
  left: 18%;
  animation-duration: 25s;
}

@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(150px, 50px) rotate(180deg); }
  100% { transform: translate(-50px, 150px) rotate(360deg); }
}

/* =========================================================
   ESTRUTURA PRINCIPAL DO APP (GLASSMORPHISM)
   ========================================================= */
.app-container {
  width: 90%;
  max-width: 1000px;
  min-height: 80vh;
  border-radius: var(--border-radius-lg);
  padding: 40px;
  position: relative;
  z-index: 10;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--panel-border);
}

.glass-subpanel {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 24px;
}

/* Gerenciamento de Telas (SPA) */
.view-section {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.view-section.active {
  display: block;
}

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

/* =========================================================
   ELEMENTOS GERAIS E UTILITÁRIOS
   ========================================================= */
h1, h2, h3, h4 {
  font-family: var(--font-display);
}

p {
  line-height: 1.6;
  color: var(--text-muted);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.mt-3 { margin-top: 24px; }
.mt-5 { margin-top: 40px; }

/* Botões */
button {
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--text-main);
  background-image: linear-gradient(90deg, var(--accent-color) var(--progress, -10px), transparent var(--progress, 0%));
  color: #111;
  padding: 14px 28px;
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(255,255,255, 0.3);
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.95rem;
  backdrop-filter: blur(10px);
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.icon-img {
  width: 24px;
  height: 24px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* =========================================================
   LANDING PAGE ESPECÍFICO
   ========================================================= */
#landing-page {
  max-width: 800px;
  margin: 0 auto;
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--panel-border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo i {
  font-size: 36px;
  color: var(--accent-color);
}

.nav-logo .logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-logo .logo-text span {
  color: var(--accent-color);
}

.hero-b {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.8s ease;
}
.hero-b h1 {
  font-size: 3.5rem;
  margin-bottom: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  letter-spacing: -1px;
}
.hero-b p {
  font-size: 1.2rem;
  max-width: 650px;
  margin: 0 auto 40px auto;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.highlight-card {
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
}
.highlight-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 15px 30px -10px rgba(0,0,0,0.5);
}
.highlight-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  transform: skewX(-20deg);
  transition: all 0.5s ease;
}
.highlight-card:hover::before {
  left: 200%;
}
.highlight-card i {
  font-size: 48px;
  margin-bottom: 8px;
}
.highlight-card h3 {
  font-size: 1.4rem;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.highlight-card p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.highlight-card strong {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

.cta-container {
  text-align: center;
  margin-bottom: 20px;
}
.btn-large {
  padding: 18px 40px;
  font-size: 1.15rem;
  border-radius: 100px;
  box-shadow: 0 10px 25px -10px var(--accent-color);
}

.neon-hover {
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.neon-hover:hover {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), 0 0 40px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

/* =========================================================
   DASHBOARD ESPECÍFICO E LAYOUT
   ========================================================= */
.dash-layout {
  display: block;
}

.vault-content-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: start;
}

.vault-sidebar {
  border-right: 1px solid var(--panel-border);
  padding-right: 12px;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: auto;
}

/* Custom Scrollbar for vault-sidebar */
.vault-sidebar::-webkit-scrollbar {
  width: 6px;
}
.vault-sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.vault-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.vault-main-area {
  min-width: 0;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
}

.user-greeting {
  display: flex;
  flex-direction: column;
}

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

#user-name {
  font-size: 1.2rem;
  font-family: var(--font-display);
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  height: 100%;
  gap: 12px;
}

.dashed-border {
  border: 2px dashed rgba(255,255,255, 0.2);
  transition: all 0.3s ease;
}
.dashed-border:hover {
  border-color: var(--accent-color);
  background: rgba(30, 36, 51, 0.8);
}
.dashed-border.drag-active {
  border-color: var(--accent-color);
  background: rgba(30, 36, 51, 0.9);
  transform: scale(1.02);
}

.upload-area i {
  font-size: 64px;
  color: var(--accent-blue);
  margin-bottom: 16px;
}

.empty-state {
  margin-top: 16px;
  padding: 40px;
  text-align: center;
  background: rgba(0,0,0,0.2);
  border-radius: var(--border-radius-md);
}
.empty-state i {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

.card-skeleton {
  opacity: 0.6;
}

.card-skeleton .card-thumbnail {
  pointer-events: none;
}

.card-skeleton .card-actions > * {
  pointer-events: none;
}

.skeleton-bar {
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
}

.skeleton-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.5s infinite;
}

.skeleton-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.card-stagger {
  animation: cardStaggerIn 0.35s ease forwards;
  opacity: 0;
  transform: translateY(12px);
}

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

/* =========================================================
   VAULT GRID — VISUAL-FIRST CARDS
   ========================================================= */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.list-header {
    margin-bottom: 24px;
}

.file-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  padding: 0;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.file-checkbox {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: #ef4444;
  z-index: 2;
}

.file-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
}

.card-thumbnail {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease;
}

.card-thumbnail:hover {
  filter: brightness(1.1);
}

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

.card-thumbnail i {
  font-size: 48px;
  opacity: 0.7;
}

.thumb-image { background: rgba(0, 0, 0, 0.2); }
.thumb-video { background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2)); }
.thumb-audio { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(59, 130, 246, 0.2)); }
.thumb-pdf { background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05)); }
.thumb-archive { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.1)); }
.thumb-other { background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)); }

.card-info {
  padding: 14px 16px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-info .file-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
  color: var(--text-main);
}

.file-meta-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-ttl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
  width: fit-content;
}

.card-ttl i {
  font-size: 0.78rem;
}

.card-ttl.ttl-ok {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.card-ttl.ttl-warning {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.card-ttl.ttl-expired {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.card-ttl.ttl-folder {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.card-actions {
  display: flex;
  padding: 8px 16px 16px;
  gap: 6px;
}

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 1.05rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-rename:hover, .action-rename-folder:hover { background: var(--accent-blue); color: white; }
.action-qr:hover, .action-qr-folder:hover { background: var(--accent-purple); color: white; }
.action-copy:hover, .action-copy-folder:hover { background: var(--accent-color); color: white; }
.action-download:hover, .action-download-folder:hover { background: #10b981; color: white; }
.action-delete:hover, .action-delete-folder:hover { background: #ef4444; color: white; }

/* =========================================================
   RENAME MODAL
   ========================================================= */
.rename-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease forwards;
}

.rename-modal {
  width: 100%;
  max-width: 460px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rename-modal h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--text-main);
}

.rename-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.rename-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.rename-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.rename-actions .btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
}

.rename-actions .btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

.rename-actions .btn-primary {
  padding: 10px 20px !important;
  font-size: 0.9rem !important;
}

/* =========================================================
   PREVIEW MODAL
   ========================================================= */
.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease forwards;
}

.preview-modal {
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

.preview-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 90px);
}

.preview-title i {
  color: var(--accent-blue);
  flex-shrink: 0;
}

.preview-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.preview-rename-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.preview-rename-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.preview-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.preview-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

.preview-modal-body {
  overflow-y: auto;
  padding: 24px;
  flex: 1;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.preview-gallery-wrapper {
  display: flex;
  align-items: stretch;
  flex: 1;
  position: relative;
  min-height: 0;
}

.preview-gallery-footer {
  display: flex;
  justify-content: center;
  padding: 10px 16px;
  border-top: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.gallery-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 14px;
  border-radius: 100px;
  font-weight: 500;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.preview-select-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  user-select: none;
  flex-shrink: 0;
}

.preview-select-cb {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.preview-toolbar-actions {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.preview-action-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-sm);
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.preview-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.preview-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.preview-action-btn[data-action="rename"]:hover { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.preview-action-btn[data-action="qr"]:hover { background: rgba(139, 92, 246, 0.2); color: var(--accent-purple); }
.preview-action-btn[data-action="copy"]:hover { background: rgba(99, 102, 241, 0.2); color: var(--accent-color); }
.preview-action-btn[data-action="download"]:hover { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.preview-action-danger:hover { background: rgba(239, 68, 68, 0.2) !important; color: #ef4444 !important; }

.preview-toolbar .gallery-counter {
  flex-shrink: 0;
}

.gallery-nav {
  width: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-main);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  border-radius: 0;
}

.gallery-nav:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.gallery-nav:last-child {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.gallery-nav:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-color);
}

.gallery-nav:active {
  transform: scale(0.92);
  background: rgba(99, 102, 241, 0.3);
}

/* =========================================================
   QR CODE MODAL
   ========================================================= */
.qr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease forwards;
}

.qr-modal {
  width: 100%;
  max-width: 400px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

.qr-modal-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--text-main);
}

.qr-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qr-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

.qr-modal-body {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.qr-container {
  background: white;
  padding: 16px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-container img {
  display: block;
}

.qr-filename {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  word-break: break-word;
  max-width: 100%;
}

.qr-link-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.qr-link-input {
  flex: 1;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: monospace;
}

.qr-copy-btn {
  padding: 10px 16px !important;
  font-size: 0.85rem !important;
}

.qr-expiry-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  padding: 6px 14px;
  border-radius: 100px;
}

/* =========================================================
   SHARE PAGE (PUBLICO)
   ========================================================= */
#share-page {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  flex-direction: column;
}

.share-back-btn {
  position: absolute;
  top: 32px;
  left: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px 8px 14px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  z-index: 100;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.share-back-btn i {
  font-size: 1.1rem;
  transition: transform 0.25s ease;
}

.share-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  color: #fff;
}

.share-back-btn:active {
  transform: scale(0.96);
}

.share-card, .share-error {
  width: 100%;
  max-width: 560px;
  border-radius: var(--border-radius-lg);
  padding: 48px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.share-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
}

.share-logo i {
  font-size: 28px;
  color: var(--accent-color);
}

.share-file-icon {
  font-size: 64px;
  color: var(--accent-purple);
}

.share-preview {
  width: 100%;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.share-preview img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.share-preview video {
  width: 100%;
  max-height: 400px;
  display: block;
  border-radius: var(--border-radius-sm);
}

.share-preview iframe {
  width: 100%;
  height: 400px;
  border: none;
  border-radius: var(--border-radius-sm);
}

.share-preview-audio {
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.share-preview-audio i {
  font-size: 64px;
  color: var(--accent-purple);
}

.share-preview-audio audio {
  width: 100%;
}

.share-preview-icon {
  padding: 40px;
}

.share-preview-icon i {
  font-size: 80px;
  color: var(--accent-purple);
}

.share-filename {
  font-size: 1.2rem;
  color: var(--text-main);
  word-break: break-word;
}

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

.share-download-btn {
  margin-top: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.share-footer {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.5;
  margin-top: 8px;
}

.share-expiry-notice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  padding: 8px 14px;
  border-radius: 100px;
  margin-top: 4px;
}

.share-expiry-notice i {
  font-size: 0.95rem;
}

.share-error i {
  font-size: 64px;
  color: #ef4444;
  margin-bottom: 8px;
}

.share-error h2 {
  color: var(--text-main);
  font-size: 1.4rem;
}

.share-error p {
  color: var(--text-muted);
}

.share-loading {
  text-align: center;
  padding: 60px;
}

.share-loading i {
  font-size: 48px;
  color: var(--accent-color);
  display: block;
  margin-bottom: 16px;
}

/* =========================================================
   DASHBOARD COLUMNS (FILES & CHAT)
   ========================================================= */
.dash-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.file-column, .chat-column {
  display: flex;
  flex-direction: column;
}

/* Chat Section Styles */
.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--panel-bg);
  border-radius: var(--border-radius-md);
  height: 100%;
}

.chat-header {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--panel-border);
}

.chat-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.chat-header p {
  font-size: 0.9rem;
}

.chat-messages {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 8px;
}
.msg-sent, .msg-received {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  word-break: break-word;
}
.msg-sent {
  align-self: flex-end;
  background: var(--accent-color);
  color: #fff;
}
.msg-received {
  align-self: flex-start;
  background: var(--card-bg);
  color: var(--text-main);
}
.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
}
.chat-input input {
  flex: 1;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  color: var(--text-main);
}
.loading-text, .error-text {
  text-align: center;
  padding: 40px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--border-radius-md);
  color: var(--text-muted);
}

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.toast {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
  animation: slideInToast 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast i {
  font-size: 24px;
}

.toast.success i { color: #10b981; }
.toast.error i { color: #ef4444; }
.toast.info i { color: var(--accent-blue); }

.toast.hiding {
  animation: slideOutToast 0.3s ease-in forwards;
}

@keyframes slideInToast {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutToast {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

/* =========================================================
   STORAGE QUOTA BAR
   ========================================================= */
.storage-quota-container {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-md);
}

.storage-quota-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.storage-quota-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.storage-quota-info i {
    font-size: 1.1rem;
    color: var(--accent-blue);
}

.storage-quota-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.storage-quota-label #storage-used-text {
    color: var(--text-main);
    font-weight: 600;
}

.storage-quota-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.storage-quota-fill {
    height: 100%;
    width: 0%;
    border-radius: 100px;
    background: linear-gradient(90deg, #10b981, #22c55e);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
    min-width: 0;
}

.storage-quota-fill.quota-warning {
    background: linear-gradient(90deg, #f59e0b, #eab308);
}

.storage-quota-fill.quota-danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    animation: pulse-bar 1.5s ease-in-out infinite;
}

@keyframes pulse-bar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.storage-alert-icon {
    color: #f59e0b;
    font-size: 1rem;
    display: none;
    animation: shake-icon 0.5s ease-in-out infinite alternate;
}

.storage-alert-icon.visible {
    display: inline-flex;
}

.storage-alert-icon.critical {
    color: #ef4444;
    animation: shake-icon 0.3s ease-in-out infinite alternate;
}

@keyframes shake-icon {
    0% { transform: rotate(-8deg); }
    100% { transform: rotate(8deg); }
}

.storage-quota-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: none;
}

.storage-quota-hint.visible {
    display: block;
}

.storage-quota-hint.warning {
    color: #f59e0b;
}

.storage-quota-hint.danger {
    color: #ef4444;
    font-weight: 600;
}

.retention-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    margin-bottom: 24px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--border-radius-sm);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.retention-banner i {
    font-size: 1.15rem;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.retention-banner strong {
    color: var(--text-main);
    font-weight: 600;
}

.upload-retention-hint {
    font-size: 0.78rem;
    color: var(--accent-blue);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.upload-retention-hint i {
    font-size: 0.9rem;
}

/* =========================================================
   STORAGE FULL MODAL
   ========================================================= */
.storage-full-details {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    text-align: left;
}

.storage-full-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.88rem;
    color: var(--text-muted);
}

.storage-full-row:last-child {
    border-bottom: none;
}

.storage-full-row strong {
    color: var(--text-main);
    font-weight: 600;
}

.storage-full-highlight strong {
    color: #f59e0b;
}

.storage-full-bar-row {
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
}

.storage-full-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    overflow: hidden;
}

.storage-full-fill {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    transition: width 0.4s ease;
}

.storage-full-bar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =========================================================
   EXPLORER BAR
   ========================================================= */
.explorer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
}

.explorer-path {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.btn-back-folder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-right: 12px;
    z-index: 10;
}

.btn-back-folder:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 8px;
    min-height: 48px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.breadcrumb-item {
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 5px;
    white-space: nowrap;
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.breadcrumb-item.active {
    color: var(--text-main);
    font-weight: 600;
    cursor: default;
    background: none;
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.35;
    user-select: none;
    font-size: 0.7rem;
}

/* =========================================================
   FOLDER CARDS
   ========================================================= */.btn-folder-new {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #f59e0b;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-folder-new:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

.explorer-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sort-select {
    padding: 7px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa5b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.sort-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.08);
}
.sort-select:focus {
    border-color: var(--accent-color);
}
.sort-select option {
    background: #1a1d27;
    color: var(--text-main);
}

/* =========================================================
   FOLDER CARDS
   ========================================================= */
.folder-card {
    cursor: pointer;
    position: relative;
}

.folder-card:hover {
    border-color: #f59e0b !important;
    transform: translateY(-5px);
}

.folder-card:hover .thumb-folder i {
    color: #fbbf24;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.folder-card .file-name {
    cursor: pointer;
}

.thumb-folder {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.04));
}

.thumb-folder i {
    font-size: 64px;
    color: #f59e0b;
}

.action-delete-folder:hover {
    background: #ef4444 !important;
    color: white !important;
}

/* =========================================================
   BULK ACTIONS
   ========================================================= */
.bulk-actions {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0 -24px 16px;
    padding: 12px 24px;
    background: rgba(30, 36, 51, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--panel-border);
    display: none;
    gap: 10px;
    align-items: center;
}

.btn-bulk-action {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--accent-color);
    padding: 8px 14px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}
.bulk-label { display: inline; }
.btn-bulk-action:hover { background: rgba(99, 102, 241, 0.22); border-color: rgba(99, 102, 241, 0.45); }
.btn-bulk-share { background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.25); color: #06b6d4; }
.btn-bulk-share:hover { background: rgba(6, 182, 212, 0.22); border-color: rgba(6, 182, 212, 0.45); }
.btn-bulk-danger { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); color: #ef4444; }
.btn-bulk-danger:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); }

/* =========================================================
   MOVE MODAL - FOLDER LIST
   ========================================================= */
.move-folder-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-sm);
    background: rgba(0, 0, 0, 0.2);
}

.move-folder-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    transition: all 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.move-folder-item:last-child {
    border-bottom: none;
}

.move-folder-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

.move-folder-item i {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.move-folder-item.current {
    opacity: 0.4;
    pointer-events: none;
}

.upload-dest-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--panel-border);
}

.upload-dest-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.upload-dest-path {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

.upload-dest-path i {
    color: #f59e0b;
    font-size: 1.1rem;
}

.upload-folder-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-folder-input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.upload-folder-input-group label i {
    color: #f59e0b;
    font-size: 1rem;
}

.upload-folder-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.upload-dest-selector {
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.upload-dest-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.upload-dest-header:hover { background: rgba(99, 102, 241, 0.1); }
.upload-dest-header.active { background: rgba(99, 102, 241, 0.12); border-bottom: 1px solid var(--panel-border); }

.upload-dest-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    flex-shrink: 0;
}

.upload-dest-path {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    color: var(--text-main);
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.upload-dest-path i { color: var(--accent-color); font-size: 1rem; flex-shrink: 0; }

.upload-dest-chevron {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.upload-dest-header.active .upload-dest-chevron { transform: rotate(180deg); }

.upload-explorer {
    border-top: none;
}

.upload-explorer-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    background: rgba(0,0,0,0.1);
}

.upload-explorer-back {
    width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04);
    color: var(--text-main); font-size: 0.95rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.upload-explorer-back:hover:not(:disabled) { background: var(--accent-color); border-color: var(--accent-color); color: white; }
.upload-explorer-back:disabled { opacity: 0.25; cursor: default; }

.upload-explorer-breadcrumb {
    display: flex; align-items: center; gap: 2px;
    font-size: 0.8rem; flex: 1; min-width: 0;
    overflow-x: auto; scrollbar-width: none;
}
.upload-explorer-breadcrumb::-webkit-scrollbar { display: none; }

.explorer-crumb {
    padding: 3px 8px; border-radius: 4px; cursor: pointer;
    color: var(--text-muted); font-weight: 500; white-space: nowrap;
    transition: all 0.12s; display: inline-flex; align-items: center; gap: 4px;
}
.explorer-crumb:hover { background: rgba(255,255,255,0.06); color: var(--text-main); }
.explorer-crumb.current { color: var(--text-main); font-weight: 600; cursor: default; }
.explorer-crumb.current:hover { background: none; }
.explorer-crumb-sep { color: var(--text-muted); opacity: 0.3; font-size: 0.65rem; }

.upload-explorer-body {
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
}
.upload-explorer-body::-webkit-scrollbar { width: 4px; }
.upload-explorer-body::-webkit-scrollbar-track { background: transparent; }
.upload-explorer-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

/* =========================================================
   TREE VIEW (MODALS)
   ========================================================= */
.tree-container {
    max-height: 350px;
    overflow-y: auto;
    overflow-x: auto;
    padding: 4px;
}

.tree-container::-webkit-scrollbar { width: 4px; }
.tree-container::-webkit-scrollbar-track { background: transparent; }
.tree-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.tree-node {
    display: flex;
    flex-direction: column;
}

.tree-node-content {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    color: var(--text-main);
    gap: 6px;
    font-size: 0.9rem;
    user-select: none;
}

.tree-node-content:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tree-node-content.selected {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-color);
}

.tree-node-content.selected .tree-icon {
    color: var(--accent-color);
}

.tree-expander {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.tree-expander:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tree-icon {
    font-size: 1.1rem;
    color: #f59e0b; /* Folder color */
}

.tree-label {
    flex: 1;
    white-space: nowrap;
}

.tree-children {
    display: none;
    padding-left: 18px;
    margin-left: 9px;
    border-left: 1px dashed rgba(255, 255, 255, 0.1);
}

.explorer-empty {
    text-align: center; padding: 20px 12px; color: var(--text-muted); font-size: 0.85rem;
}
.explorer-empty i { font-size: 32px; display: block; margin-bottom: 8px; opacity: 0.35; }

.folder-entry-modal {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 6px;
    cursor: pointer; transition: all 0.12s; color: var(--text-main);
    font-size: 0.88rem;
}
.folder-entry-modal:hover { background: rgba(99,102,241,0.1); }
.folder-entry-modal .fe-icon { color: #f59e0b; font-size: 1.15rem; flex-shrink: 0; }
.folder-entry-modal .fe-name { flex: 1; }
.folder-entry-modal .fe-arrow { color: var(--text-muted); font-size: 0.8rem; opacity: 0.4; flex-shrink: 0; }

.upload-new-folder-row {
    margin-top: 4px;
}

.new-folder-entry-modal {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: 6px;
    cursor: pointer; transition: all 0.12s;
    color: #f59e0b; font-size: 0.85rem;
    border: 1px dashed rgba(245,158,11,0.25);
}
.new-folder-entry-modal:hover { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.4); }
.new-folder-entry-modal i { font-size: 1rem; }

.nf-input-row-modal {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px;
}
.nf-input-row-modal input {
    flex: 1; padding: 8px 10px; border-radius: 6px;
    border: 1px solid rgba(245,158,11,0.3); background: rgba(0,0,0,0.3);
    color: var(--text-main); font-family: var(--font-sans); font-size: 0.85rem;
}
.nf-input-row-modal input:focus { outline: none; border-color: #f59e0b; }
.nf-input-row-modal button {
    background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25);
    color: #f59e0b; padding: 8px 12px; border-radius: 6px;
    cursor: pointer; font-weight: 600; font-size: 0.8rem; transition: all 0.15s;
}
.nf-input-row-modal button:hover { background: rgba(245,158,11,0.2); }
.nf-input-row-modal .cancel-nf {
    background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); color: var(--text-muted);
}
.nf-input-row-modal .cancel-nf:hover { background: rgba(255,255,255,0.08); }

/* =========================================================
   MOBILE RESPONSIVO E CLASSES AUXILIARES
   ========================================================= */
.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: block;
  }
  .app-container {
    width: 100%;
    padding: 16px;
  }
  .dash-layout {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    position: static;
    height: auto;
    max-height: 400px;
  }
  .highlight-grid {
    grid-template-columns: 1fr;
  }
  .hero-b h1 { font-size: 2.4rem; }
  .dash-columns {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .upload-area {
    padding: 8px 12px;
    height: auto;
    gap: 2px;
    border-radius: var(--border-radius-sm);
  }
  .upload-area i {
    font-size: 1rem;
  }
  .upload-area h3 {
    font-size: 0.8rem;
    margin-bottom: 0;
  }
  .upload-area p {
    font-size: 0.7rem;
    margin-bottom: 0;
  }
  .upload-retention-hint {
    font-size: 0.62rem;
    margin-top: 1px;
  }
  .storage-quota-container {
    margin-bottom: 12px;
  }
  .retention-banner {
    padding: 8px 12px;
    font-size: 0.72rem;
    margin-bottom: 14px;
    gap: 8px;
  }
  .chat-section {
    min-height: auto;
    padding: 14px;
  }
  .chat-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }
  .chat-header p {
    font-size: 0.75rem;
  }
  .chat-toggle-icon {
    display: inline-block;
    font-size: 0.85rem;
    opacity: 0.4;
    margin-left: 6px;
    transition: opacity 0.2s, transform 0.2s;
  }
  #chat-toggle-header {
    cursor: pointer;
    transition: background 0.2s;
    border-radius: var(--border-radius-sm);
    padding: 8px 10px;
    margin: -6px;
  }
  #chat-toggle-header:hover, #chat-toggle-header:active {
    background: rgba(255,255,255,0.04);
  }
  #chat-toggle-header:hover .chat-toggle-icon {
    opacity: 0.8;
  }
  .chat-body {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--panel-border);
  }
  .chat-body.chat-open {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 220px;
  }
  .card-thumbnail {
    height: 110px;
  }
  .card-thumbnail i {
    font-size: 30px;
  }
  .file-card {
    border-radius: var(--border-radius-sm);
  }
  .card-info {
    padding: 8px 10px;
  }
  .file-name {
    font-size: 0.82rem;
  }
  .action-btn {
    padding: 6px 0;
    font-size: 0.85rem;
  }
  .qr-modal {
    max-width: 90vw;
  }
  .share-card, .share-error {
    padding: 32px 20px;
  }

  .vault-sidebar {
    display: none;
  }
  .vault-content-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .vault-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .explorer-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .explorer-path {
    width: 100%;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .explorer-bar-actions {
    width: 100%;
    gap: 8px;
  }
  .sort-select {
    flex: 1;
    min-width: 0;
  }
  .btn-folder-new {
    flex: none;
    justify-content: center;
    white-space: nowrap;
  }
  .bulk-actions {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    margin: 0 -16px 8px;
    border-radius: 0;
  }
  .btn-bulk-action {
    flex: 1 1 auto;
    justify-content: center;
    padding: 7px 10px;
    font-size: 0.72rem;
    gap: 4px;
    min-width: 0;
    border-radius: var(--border-radius-sm);
  }
}

/* =========================================================
   INLINE UPLOAD PROGRESS
   ========================================================= */
.upload-active {
  border-color: var(--accent-color) !important;
  background: rgba(30, 36, 51, 0.9) !important;
}

.upload-progress-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  animation: fadeIn 0.3s ease;
}

.upload-progress-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.upload-progress-info i {
  font-size: 28px;
  color: var(--accent-color);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.upload-progress-label {
  color: var(--text-main);
  font-weight: 500;
}

.upload-progress-label strong {
  color: var(--accent-color);
  font-size: 1.2rem;
  font-family: var(--font-display);
}

.upload-progress-detail {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.upload-progress-track {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-purple));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-progress-fill.complete {
  background: linear-gradient(90deg, #10b981, #22c55e);
}

.upload-card-appear {
  animation: uploadCardAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes uploadCardAppear {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
  .gallery-nav {
    width: 36px;
    min-width: 36px;
    font-size: 1.1rem;
  }
  .preview-modal {
    max-width: 100vw;
    border-radius: 0;
    max-height: 100vh;
  }
  .preview-overlay {
    padding: 0;
  }
  .preview-toolbar {
    padding: 8px 12px;
    gap: 8px;
  }
  .preview-action-btn {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
  .preview-select-label span {
    font-size: 0.72rem;
  }
  .bulk-actions {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 10px 12px;
    margin: 0 -24px 12px;
  }
  .btn-bulk-action {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    font-size: 0.65rem;
    gap: 0;
    min-width: 0;
  }
  .btn-bulk-action > i {
    display: none;
  }
  .highlight-card {
    padding: 24px;
  }
  .highlight-card h3 {
    font-size: 1.2rem;
  }
}
