/* Configurações Globais e Tokens */
:root {
  --bg-color: #0b0f19;
  --sidebar-bg: rgba(22, 28, 45, 0.55);
  --card-bg: rgba(22, 28, 45, 0.65);
  --card-border: rgba(255, 255, 255, 0.06);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #fbbf24;
  --glow-color: rgba(139, 92, 246, 0.15);
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --font-title: 'Outfit', sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  height: 100vh;
  overflow: hidden;
  background-image: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
                    radial-gradient(circle at 5% 30%, rgba(59, 130, 246, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Scrollbar Customizado */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Layout Principal */
.app-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  height: 100vh;
  width: 100vw;
}

/* Cores de Destaque */
.text-blue { color: var(--accent-blue) !important; }
.text-green { color: var(--accent-green) !important; }
.text-red { color: var(--accent-red) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-yellow { color: var(--accent-yellow) !important; }

/* Barra Lateral (Sidebar) */
.sidebar {
  background: linear-gradient(180deg, rgba(13, 17, 28, 0.97) 0%, rgba(10, 14, 24, 0.99) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  padding: 1.1rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  padding: 0 0.2rem;
}

.brand-icon {
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.4));
  flex-shrink: 0;
}

.brand h2 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand h2 span {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex-grow: 1;
}

/* Label de seção (ex: FILTROS) */
.nav-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(156, 163, 175, 0.45);
  text-transform: uppercase;
  padding: 0.6rem 0.6rem 0.2rem;
  display: block;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.78rem;
  padding: 0.48rem 0.65rem;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition: all 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item i {
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.18s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.04);
}

.nav-item:hover i {
  opacity: 1;
}

.nav-item.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.18);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.08);
}

.nav-item.active i {
  opacity: 1;
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 0.4rem 0.2rem;
}

/* Widget do MEGA */
.mega-status-widget {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin-top: 0.5rem;
}

.mega-status-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.mega-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.mega-dot.active {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulseSync 2s infinite;
}

@keyframes pulseSync {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.mega-status-widget h4 {
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.mega-status-text {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.mega-sync-time {
  font-size: 0.63rem;
  color: rgba(156, 163, 175, 0.6);
  margin-bottom: 0.55rem;
}

.btn-sync-now {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.2s ease;
  letter-spacing: 0.02em;
}

.btn-sync-now:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-sync-now i.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Área Central */
.main-content {
  padding: 2rem 3rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Cabeçalho */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 0.7rem 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-grow: 1;
  max-width: 480px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.55rem 1rem;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-bar:focus-within {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

.search-bar input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.9rem;
  width: 100%;
}

.search-bar input:focus {
  outline: none;
}

.btn-upload {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.3rem;
  border-radius: 10px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
  transition: all 0.2s ease;
}

.btn-upload:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
  filter: brightness(1.05);
}

.btn-upload:active {
  transform: translateY(0);
}

/* Grid de Arquivos */
.files-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}

/* Card de Arquivo Redesenhado Premium */
.file-card {
  background: rgba(22, 28, 45, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.file-card:hover {
  transform: translateY(-4px);
  background: rgba(22, 28, 45, 0.5);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(139, 92, 246, 0.08);
}

/* Efeito de brilho de borda (glow) sutil com base no tipo de arquivo */
.file-card.file-document:hover { border-color: rgba(59, 130, 246, 0.35); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.08); }
.file-card.file-spreadsheet:hover { border-color: rgba(16, 185, 129, 0.35); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(16, 185, 129, 0.08); }
.file-card.file-pdf:hover { border-color: rgba(239, 68, 68, 0.35); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(239, 68, 68, 0.08); }
.file-card.file-image:hover { border-color: rgba(139, 92, 246, 0.35); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(139, 92, 246, 0.08); }
.file-card.file-text:hover { border-color: rgba(251, 191, 36, 0.35); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(251, 191, 36, 0.08); }

.file-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Quadrado elegante para o ícone */
.file-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 1.35rem;
  transition: all 0.25s ease;
}

/* Cores específicas de acordo com a extensão do arquivo */
.file-card.file-document .file-icon-container { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.file-card.file-spreadsheet .file-icon-container { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.file-card.file-pdf .file-icon-container { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.file-card.file-image .file-icon-container { background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.2); color: var(--accent-purple); }
.file-card.file-text .file-icon-container { background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.2); color: var(--accent-yellow); }

/* Ações secundárias que aparecem no hover do card */
.file-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.file-card:hover .file-card-actions {
  opacity: 1;
  transform: translateX(0);
}

.btn-file-share, .btn-file-delete {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  transition: all 0.2s ease;
}

.btn-file-share:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #ffffff;
  transform: scale(1.05);
}

.btn-file-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ffffff;
  transform: scale(1.05);
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.file-name {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.file-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.file-status-row {
  margin-top: 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Badges de sincronização estilizados e modernos */
.file-status-indicator {
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.file-status-indicator.synced {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.file-status-indicator.pending {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.15);
  color: var(--accent-yellow);
}

.file-card-loading, .file-card-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Modal do Editor (Tela Cheia) */
.editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #060913;
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.editor-modal.active {
  display: flex;
}

.editor-modal-header {
  background: rgba(22, 28, 45, 0.85);
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.editor-file-info i {
  font-size: 1.5rem;
}

.editor-file-info h3 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 600;
}

.badge-status-local {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.editor-modal-actions {
  display: flex;
  gap: 1rem;
}

.btn-modal-save {
  background: var(--accent-green);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-title);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s ease;
}

.btn-modal-save:hover {
  opacity: 0.9;
}

.btn-modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: #ffffff;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-title);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.btn-modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

.editor-modal-body {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  background: #000000;
}

.editor-container-wrapper {
  width: 100%;
  height: 100%;
}

.editor-pane {
  width: 100%;
  height: 100%;
  overflow: auto;
}

/* Estilo para previews de Imagem fallback */
#fallback-preview-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e121e;
}

#fallback-img-preview {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* Ajustes finos do Quill no Dark Mode */
.ql-toolbar.ql-snow {
  background: #f3f4f6 !important;
  border: none !important;
}

.ql-container.ql-snow {
  border: none !important;
  background: #ffffff !important;
  color: #111827 !important;
}

/* Card de Usuário na Sidebar */
.user-session-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.user-session-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-session-info i {
  font-size: 1.25rem;
  color: var(--accent-blue);
  opacity: 0.9;
}

.user-session-info h4 {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.user-role {
  font-size: 0.6rem;
  color: rgba(156, 163, 175, 0.6);
  display: block;
}

.btn-logout {
  background: transparent;
  border: none;
  color: rgba(156, 163, 175, 0.5);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0.2rem;
  flex-shrink: 0;
}

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

/* Tela de Autenticação (Overlay) */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 60%);
}

.auth-card {
  background: rgba(17, 24, 39, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(25px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.05);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-icon {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.35));
}

.auth-header h2 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  color: #ffffff;
}

.auth-header h2 span {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#auth-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-input-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-input-group label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-input-group input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.auth-input-group input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
  background: rgba(0, 0, 0, 0.35);
}

.btn-auth-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: #ffffff;
  border: none;
  padding: 0.75rem;
  border-radius: 10px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 0.6rem;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
  transition: all 0.2s ease;
}

.btn-auth-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
  transform: translateY(-1.5px);
}

.btn-auth-submit:active {
  transform: translateY(0);
}

.auth-toggle-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

#auth-toggle-action {
  color: var(--accent-blue);
  font-weight: 600;
  cursor: pointer;
}

#auth-toggle-action:hover {
  text-decoration: underline;
}

/* Modal de Compartilhamento */
.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.65);
  backdrop-filter: blur(12px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.share-modal.active {
  display: flex;
}

.share-modal-card {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 100%;
  max-width: 450px;
  backdrop-filter: blur(25px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 92, 246, 0.05);
  overflow: hidden;
  opacity: 0;
}

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

.share-modal.active .share-modal-card {
  animation: modalZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.share-modal-header {
  padding: 1.3rem 1.6rem;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-modal-header h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.btn-share-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.btn-share-close:hover {
  color: #ffffff;
}

.share-modal-body {
  padding: 1.6rem;
}

.share-file-name-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.share-file-name-label strong {
  color: var(--accent-blue);
  font-weight: 600;
}

.share-input-group {
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.share-input-group label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.share-input-group input, .share-input-group select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #ffffff;
  padding: 0.7rem 0.95rem;
  border-radius: 10px;
  font-family: var(--font-family);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.share-input-group input:focus, .share-input-group select:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
  background: rgba(0, 0, 0, 0.35);
}

.btn-share-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: #ffffff;
  border: none;
  padding: 0.7rem;
  border-radius: 10px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  margin-top: 0.6rem;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
  transition: all 0.2s ease;
}

.btn-share-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
}

.btn-share-submit:active {
  transform: translateY(0);
}

/* Botão Compartilhar no Card */
.btn-file-share {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: auto;
  margin-right: 0.4rem;
}

/* ==========================================
   ESTILOS ADICIONAIS: 2FA, ADMIN E RECURSOS
   ========================================== */

/* Widgets de Cota e Recursos na Sidebar */
.user-quota-widget, .server-resources-widget {
  margin-top: 1rem;
}

.resource-bar-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.resource-bar-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 3px;
  transition: width 0.3s ease;
}

#mega-space-bar {
  background: #06b6d4;
}

/* Modais de Conta e Administração */
.account-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.65);
  backdrop-filter: blur(12px);
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.account-modal-card {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  backdrop-filter: blur(25px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(139, 92, 246, 0.05);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
}

.account-modal.active .account-modal-card {
  animation: modalZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.account-modal-card.admin-card {
  max-width: 1000px;
  width: 90%;
}

.account-modal-header {
  padding: 1.3rem 2rem;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.account-modal-header h3 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
}

.account-modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex-grow: 1;
}

.account-section h4 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.account-input-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.account-input-group label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.account-input-group input, .account-input-group select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #ffffff;
  padding: 0.7rem 0.95rem;
  border-radius: 10px;
  font-family: var(--font-family);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.account-input-group input:focus, .account-input-group select:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
  background: rgba(0, 0, 0, 0.35);
}

.btn-account-action {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
  transition: all 0.2s ease;
}

.btn-account-action:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
}

.btn-account-action:active {
  transform: translateY(0);
}

.btn-account-action.btn-danger {
  background: var(--accent-red);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.security-tip-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Painel Administrativo Layout Split */
.admin-split-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.admin-form-section {
  flex: 0 0 auto;
  width: 290px;
  min-width: 260px;
}

.admin-list-section {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-divider {
  width: 1px;
  background: var(--card-border);
  align-self: stretch;
}

/* Tabela Administrativa */
.table-responsive {
  max-height: 350px;
  overflow-y: auto;
  overflow-x: auto; /* Garante rolagem horizontal elegante se a tela for muito pequena */
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 6px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle; /* Alinha todo o conteúdo da tabela verticalmente no centro */
  white-space: nowrap; /* Impede a quebra de texto nas células e cabeçalhos */
}

.admin-table td:first-child {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.admin-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.01);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.admin-badge-2fa {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.admin-badge-2fa.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.admin-badge-2fa.inactive {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.admin-table-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.btn-admin-table-action {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d1d5db;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-admin-table-action:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  transform: translateY(-1px);
}

/* Excluir: vermelho sólido por padrão */
.btn-admin-table-action.danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  font-weight: 600;
}

.btn-admin-table-action.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* Reset 2FA: borda vermelha sutil */
.btn-admin-table-action.warning {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-admin-table-action.warning:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
  transform: translateY(-1px);
}

.admin-system-tag {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding-right: 0.5rem;
}

/* Transição de MFA na tela de login */
#auth-step-mfa {
  animation: fadeIn 0.3s ease forwards;
}

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

.btn-file-share:hover {
  background: var(--accent-blue);
  color: #ffffff;
  transform: scale(1.05);
}

/* ==========================================
   DROPDOWN DE CRIAÇÃO RÁPIDA
   ========================================== */
.new-file-dropdown:hover #new-file-dropdown-content {
  display: block !important;
}

.dropdown-content a:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ==========================================
   ÁREA DE ANOTAÇÕES & LEMBRETES (POST-ITS)
   ========================================== */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.note-card {
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.note-card:hover {
  transform: translateY(-4px);
}

/* Cores Glassmorphic de Anotações */
.note-blue {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.05);
}
.note-blue:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15), 0 0 15px rgba(59, 130, 246, 0.1);
}

.note-orange {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.25);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.05);
}
.note-orange:hover {
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 10px 25px rgba(249, 115, 22, 0.15), 0 0 15px rgba(249, 115, 22, 0.1);
}

.note-green {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.05);
}
.note-green:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.15), 0 0 15px rgba(16, 185, 129, 0.1);
}

.note-purple {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.05);
}
.note-purple:hover {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.15), 0 0 15px rgba(139, 92, 246, 0.1);
}

.note-red {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.05);
}
.note-red:hover {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.15), 0 0 15px rgba(239, 68, 68, 0.1);
}

.note-yellow {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.25);
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.05);
}
.note-yellow:hover {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 10px 25px rgba(251, 191, 36, 0.15), 0 0 15px rgba(251, 191, 36, 0.1);
}

/* Conteúdo do Post-it */
.note-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.note-card-title {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
}

.note-card-body {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
  flex-grow: 1;
  overflow-y: auto;
  max-height: 120px;
}

.note-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.note-reminder-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
}

.note-reminder-info.notified-status {
  color: var(--accent-green);
}

.note-reminder-info.pending-status {
  color: var(--accent-yellow);
}

.note-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-note-action {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.btn-note-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: scale(1.05);
}

.btn-note-action.delete:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #ffffff;
}

/* Filtros de Anotações */
.btn-note-filter {
  transition: all 0.2s;
}

.btn-note-filter.active {
  background: rgba(139, 92, 246, 0.15) !important;
  border-color: rgba(139, 92, 246, 0.3) !important;
  color: #ffffff !important;
}

.btn-note-filter:not(.active):hover {
  background: rgba(255, 255, 255, 0.02) !important;
  color: #ffffff !important;
}

/* Seletor de Cores no Modal */
.color-radio {
  transition: transform 0.2s, border-color 0.2s;
}

.color-radio:has(input:checked) {
  border-color: #ffffff !important;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  transform: scale(1.15);
}

