/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #333;
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-banner {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  gap: 40px;
}

.nav-left {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-right {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-left: auto;
}

.nav-link {
  color: #888;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s;
}

.nav-link:hover {
  color: #fff;
}

.nav-link.active {
  color: #fff;
}

.nav-link-auth {
  padding: 8px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.nav-link-login {
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  border: 1px solid #e0e0e0;
}

.nav-link-login:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.nav-link-register {
  background: #333;
  color: #fff;
  border: 1px solid transparent;
}

.nav-link-register:hover {
  background: #444;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
}

.nav-link-logout {
  background: rgba(212, 60, 55, 0.1);
  color: #D43C37;
  border: 1px solid #D43C37;
}

.nav-link-logout:hover {
  background: rgba(212, 60, 55, 0.2);
  transform: translateY(-2px);
}

/* Main Content */
.main {
  flex: 1;
  padding: 20px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 20px 20px;
  margin-bottom: 40px;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 20px;
  color: #888;
}

/* ═══════════════════════════════════════════════════════════
   Landing Page — Single-screen layout
   ═══════════════════════════════════════════════════════════ */

/* Hide footer + remove main padding on landing; prevent scrollbar */
body:has(.landing-single) { overflow: hidden; }
body:has(.landing-single) .footer { display: none; }
body:has(.landing-single) .main { padding: 0; }

/* Override base layout — break out of .container */
.landing {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-top: -20px;
}

/* ── Hero (full viewport minus header) ────────────────── */
.land-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 79px);
  height: calc(100dvh - 79px);
  padding: 24px 24px 32px;
  overflow: hidden;
  isolation: isolate;
  gap: 24px;
  background: #030308;
}

/* Canvas starfield — sits behind all content */
.land-space {
  position: absolute;
  inset: 0;
  z-index: -3;
  display: block;
  pointer-events: none;
}

/* Nebula glow — very subtle colour wash */
.land-nebula {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 20% 25%, rgba(60, 30, 100, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 70%, rgba(20, 50, 120, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 25% 25% at 55% 40%, rgba(180, 50, 40, 0.03) 0%, transparent 55%);
  animation: landNebulaShift 40s ease-in-out infinite alternate;
}

@keyframes landNebulaShift {
  0%   { opacity: 0.6; filter: hue-rotate(0deg); }
  100% { opacity: 1;   filter: hue-rotate(12deg); }
}

/* Vignette — strong edge darkening for depth */
.land-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 70% 50% at 50% 45%, transparent 0%, rgba(3, 3, 8, 0.85) 100%);
  pointer-events: none;
}

/* Hero content */
.land-hero-content {
  position: relative;
  text-align: center;
  max-width: 680px;
  animation: landFadeUp 0.8s ease both;
}

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

.land-title {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  color: #fff;
  margin: 0 0 12px;
}

.land-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: #666;
  letter-spacing: 1.5px;
  line-height: 1.5;
  margin: 0;
}

/* ── Feature cards (inline in hero) ───────────────────── */
.land-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 700px;
  width: 100%;
  animation: landFadeUp 0.8s ease 0.15s both;
}

.land-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.land-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.land-card-icon {
  color: #D43C37;
  flex-shrink: 0;
  margin-top: 1px;
}

.land-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  margin: 0 0 4px;
}

.land-card-text {
  font-size: 11px;
  color: #666;
  line-height: 1.5;
  margin: 0;
}

/* ── CTA buttons ──────────────────────────────────────── */
.land-cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  animation: landFadeUp 0.8s ease 0.3s both;
}

.land-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}

.land-btn-primary {
  background: #D43C37;
  color: #fff;
}

.land-btn-primary:hover {
  background: #E8304A;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 60, 55, 0.3);
}

.land-btn-ghost {
  background: transparent;
  color: #888;
  border: 1px solid #333;
}

.land-btn-ghost:hover {
  color: #fff;
  border-color: #555;
  transform: translateY(-2px);
}

/* ── Landing responsive ───────────────────────────────── */

/* Tall narrow screens / tablets */
@media (max-width: 768px) {
  .land-hero {
    height: calc(100dvh - 79px);
    padding: 16px 16px 24px;
    gap: 20px;
  }

  .land-title {
    font-size: 32px;
  }

  .land-subtitle {
    font-size: 11px;
    letter-spacing: 1px;
  }

  .land-features-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .land-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .land-card-icon svg {
    width: 18px;
    height: 18px;
  }

  .land-card-title {
    font-size: 11px;
  }

  .land-card-text {
    font-size: 10px;
  }

  .land-btn {
    padding: 10px 22px;
    font-size: 12px;
  }
}

/* Very small phones */
@media (max-width: 400px) {
  .land-hero {
    gap: 16px;
    padding: 12px 12px 20px;
  }

  .land-title {
    font-size: 26px;
  }

  .land-card {
    padding: 10px 12px;
  }

  .land-card-text {
    display: none;
  }
}

/* Short screens (landscape phones, small laptops) */
@media (max-height: 600px) {
  .land-hero {
    gap: 12px;
    padding: 8px 16px 16px;
  }

  .land-title {
    font-size: 28px;
    margin-bottom: 6px;
  }

  .land-subtitle {
    font-size: 11px;
  }

  .land-card {
    padding: 10px 14px;
  }

  .land-card-text {
    display: none;
  }

  .land-btn {
    padding: 8px 20px;
    font-size: 12px;
  }
}

/* Upload Section */
.upload-section {
  max-width: 800px;
  margin: 0 auto;
}

.drop-zone {
  background: rgba(30, 30, 30, 0.8);
  border: 3px solid #444;
  border-radius: 16px;
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  min-height: 220px;
}

.drop-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.drop-zone:hover {
  border-color: #666;
  background: rgba(40, 40, 40, 0.9);
  transform: translateY(-4px);
}

.drop-zone.dragover {
  border-color: #fff;
  background: rgba(50, 50, 50, 0.95);
  transform: scale(1.02);
}

.drop-zone-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.drop-zone-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: -5px;
}

.drop-zone-text {
  font-size: 15px;
  color: #888;
  margin-bottom: 15px;
  text-decoration: none;
}

.drop-zone-limit {
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

/* Features Row */
.features-row {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 60px;
  flex-wrap: wrap;
}

/* Files Page */
.files-header {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 60px;
}

.files-title {
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.files-container {
  max-width: 1900px;
  margin: 0 auto;
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px 24px;
}

.files-table {
  width: 100%;
  border-collapse: collapse;
}

.files-table th {
  text-align: left;
  padding: 16px 12px;
  color: #888;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid #444;
}

.files-table th:nth-child(1) {
  min-width: 250px;
}

.files-table th:nth-child(2) {
  min-width: 80px;
}

.files-table th:nth-child(3) {
  min-width: 120px;
}

.files-table th:nth-child(4) {
  min-width: 100px;
}

.files-table th:nth-child(5) {
  min-width: 150px;
}

.files-table td {
  padding: 16px 12px;
  border-bottom: 1px solid #333;
  white-space: nowrap;
  height: 50px;
  vertical-align: middle;
}

.files-table tr:last-child td {
  border-bottom: none;
}

.files-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

.file-name {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.file-name:hover {
  color: #DA524E;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.status-public {
  background: rgba(212, 60, 55, 0.2);
}

.status-protected {
  background: rgba(250, 204, 21, 0.2);
}

.status-e2e {
  background: rgba(212, 60, 55, 0.2);
}

.status-server-enc {
  background: rgba(250, 204, 21, 0.2);
}

.status-protected {
  background: rgba(250, 204, 21, 0.2);
}

.copy-link-btn {
  background: linear-gradient(135deg, #444 0%, #333 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-link-btn:hover {
  background: linear-gradient(135deg, #555 0%, #444 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.edit-btn {
  background: linear-gradient(135deg, #444 0%, #333 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.edit-btn:hover {
  background: linear-gradient(135deg, #555 0%, #444 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.delete-btn {
  background: linear-gradient(135deg, #D43C37 0%, #A8302C 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.delete-btn:hover {
  background: linear-gradient(135deg, #DA524E 0%, #D43C37 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 60, 55, 0.3);
}

.files-empty {
  text-align: center;
  padding: 60px 40px;
}

.files-empty-icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.files-empty-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.files-empty-text {
  font-size: 16px;
  color: #888;
  margin-bottom: 32px;
}

.files-empty-button {
  display: inline-block;
  background: linear-gradient(135deg, #444 0%, #333 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.files-empty-button:hover {
  background: linear-gradient(135deg, #555 0%, #444 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.feature-card {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.feature-title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.feature-desc {
  font-size: 16px;
  color: #888;
}

/* Manage Page */
.manage-header {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 40px;
}

.manage-header-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.manage-header-left {
  justify-self: start;
}

.manage-header-right {
  justify-self: end;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #333;
  border-radius: 8px;
  color: #888;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back .back-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-back .back-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #444;
  color: #bbb;
}

.btn-back:hover .back-icon {
  transform: translateX(-2px);
}

.manage-title {
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-align: center;
}

.manage-subtitle {
  font-size: 18px;
  color: #888;
}

.manage-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.manage-info-section,
.manage-settings-section {
  flex: 1;
  min-width: 300px;
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px 24px;
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #444;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #444;
}

.section-header .section-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* File Preview Box */
.file-preview-box {
  width: 100%;
  max-height: 400px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
  padding: 12px;
}

.file-preview-thumbnail {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 4px;
}

/* Full-width Share Section */
.manage-share-section-full {
  width: 100%;
  max-width: 1200px;
  margin: 24px auto 40px;
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px 24px;
}

/* Info Grid */
.info-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.info-label {
  color: #888;
  font-size: 15px;
  flex-shrink: 0;
  margin-right: 16px;
}

.info-value {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}

.info-value-filename {
  display: flex;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.info-value-filename .file-name-base {
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.info-value-filename .file-name-ext {
  flex-shrink: 0;
  color: #888;
}

.status-protected {
  color: #ffffff;
}

.status-none {
  color: #facc15;
}

/* Settings Form */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-hint {
  font-size: 11px;
  color: #666;
  letter-spacing: 0.3px;
  margin-top: -4px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-checkbox {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
  margin: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #2d2d2d;
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider::before {
  position: absolute;
  content: '';
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #888;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-checkbox:checked + .toggle-slider {
  background: #D43C37;
}

.toggle-checkbox:checked + .toggle-slider::before {
  transform: translateX(24px);
  background: #fff;
}

.toggle-switch-locked {
  opacity: 0.5;
  pointer-events: none;
}

.toggle-switch-locked .toggle-checkbox {
  cursor: not-allowed;
}

.toggle-switch-locked .toggle-slider {
  cursor: not-allowed;
}

.toggle-text {
  color: #e0e0e0;
  font-size: 15px;
  font-weight: 500;
  width: 120px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Password Group */
.password-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.label-text {
  color: #888;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  width: 120px;
}

.e2e-panel {
  max-width: 600px;
  margin: 20px auto 0;
  padding: 24px 40px;
  background: transparent;
  border: none;
  border-radius: 12px;
}

.e2e-toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.e2e-toggle-row:not(:first-child) {
  margin-top: 8px;
}

.e2e-label-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #666;
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  font-family: serif;
  cursor: help;
  position: relative;
  transition: all 0.3s ease;
}

.info-icon:hover {
  background: #888;
  transform: scale(1.1);
}

.info-icon::after {
  content: attr(title);
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  color: #e0e0e0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  white-space: normal;
  width: 300px;
  text-align: center;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  text-transform: none;
  letter-spacing: 0;
}

.info-icon:hover::after {
  opacity: 1;
  visibility: visible;
}

.e2e-label {
  color: #888;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.e2e-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.e2e-button-row {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.e2e-input {
  flex: 1;
  min-width: 300px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 14px;
  color: #e0e0e0;
  font-size: 14px;
  transition: border-color 0.3s;
}

.e2e-input:focus {
  outline: none;
  border-color: #D43C37;
}

.e2e-input::placeholder {
  color: #666;
}

.e2e-btn {
  flex-shrink: 0;
  padding: 10px 20px;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: 110px;
}

.e2e-btn:hover {
  background: #555;
}

#generateBtn {
  background: linear-gradient(135deg, #D43C37 0%, #A8302C 100%) !important;
}

#generateBtn:hover {
  background: linear-gradient(135deg, #DA524E 0%, #D43C37 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 60, 55, 0.4);
}

#copyBtn {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
}

#copyBtn:hover {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.e2e-note {
  color: #DA524E;
  font-size: 14px;
  margin: 0;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
}

/* .copy-toast is deprecated — kept for compatibility, uses toast system visuals */
.copy-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #22c55e;
  color: #fff;
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  animation: toastSlideDown 0.3s ease;
}

.form-input,
.form-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 12px 16px;
  color: #e0e0e0;
  font-size: 16px;
  transition: border-color 0.3s;
  flex: 1;
  min-width: 0;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #666;
}

.form-select option {
  background: #1a1a1a;
  color: #e0e0e0;
}

.form-input::placeholder {
  color: #666;
}

.form-submit {
  background: linear-gradient(135deg, #444 0%, #333 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-submit:hover {
  background: linear-gradient(135deg, #555 0%, #444 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Share Box */
.share-box {
  display: flex;
  gap: 12px;
}

.share-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 12px 16px;
  color: #888;
  font-size: 14px;
  font-family: 'Monaco', 'Courier New', monospace;
}

.copy-button {
  background: linear-gradient(135deg, #444 0%, #333 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.copy-button:hover {
  background: linear-gradient(135deg, #555 0%, #444 100%);
  transform: translateY(-2px);
}

.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.share-row:last-of-type {
  margin-bottom: 0;
}

.share-row-label {
  font-size: 12px;
  font-weight: 700;
  color: #666;
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.share-row .share-box {
  flex: 1;
}

.share-note {
  font-size: 14px;
  color: #666;
  margin-top: 16px;
}

.delete-file-btn {
  background: linear-gradient(135deg, #D43C37 0%, #A8302C 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.delete-file-btn:hover {
  background: linear-gradient(135deg, #DA524E 0%, #D43C37 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 60, 55, 0.3);
}

.btn-delete-manage {
  background: linear-gradient(135deg, #D43C37 0%, #A8302C 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-delete-manage:hover {
  background: linear-gradient(135deg, #DA524E 0%, #D43C37 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 60, 55, 0.3);
}

/* Modern Manage Page Layout */
.manage-modern {
  display: flex;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto 0;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid #282828;
  border-radius: 16px;
  overflow: hidden;
  min-height: 420px;
}

/* Left column wrapper (preview + detail grid) */
.manage-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(0, 0, 0, 0.3);
}

/* Preview Panel (left) */
.manage-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px 24px;
  min-width: 0;
  position: relative;
}

.manage-preview-img-wrap {
  width: 100%;
  max-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  border-radius: 10px;
  overflow: hidden;
}

.manage-preview-img {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 10px;
}

.manage-preview-link {
  cursor: default;
  text-decoration: none;
}

.manage-preview-link .manage-preview-img {
  cursor: pointer;
  transition: opacity 0.2s, box-shadow 0.2s;
}

.manage-preview-link .manage-preview-img:hover {
  opacity: 0.85;
}

.manage-preview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  font-size: 64px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  border: 1px solid #222;
}

.manage-preview-filename {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
  margin-bottom: 8px;
}

.manage-preview-filename .file-name-ext {
  color: #666;
}

.manage-preview-filename-lg {
  font-size: 26px;
  font-weight: 700;
}

.manage-preview-meta {
  font-size: 13px;
  color: #666;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.manage-meta-sep {
  color: #444;
}

.manage-detail-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
  width: 100%;
  max-width: 420px;
}

.manage-detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 80px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.manage-detail-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #555;
  text-transform: uppercase;
}

.manage-detail-value {
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
  white-space: nowrap;
}

.manage-detail-grid-below {
  margin-top: 0;
  padding: 16px 32px 24px;
  max-width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.manage-detail-grid-outside {
  max-width: 1200px;
  margin: 24px auto 40px;
  padding: 20px 32px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid #282828;
  border-radius: 16px;
  gap: 8px;
}

.manage-preview-badge,
.manage-preview-badges {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
}

.manage-preview-badges .file-badge {
  margin-left: 0;
}

/* Sidebar (right) */
.manage-sidebar {
  width: 380px;
  flex-shrink: 0;
  padding: 28px 24px;
  border-left: 1px solid #222;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.manage-setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-setting-toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.manage-setting-label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.manage-setting-hint {
  display: block;
  font-size: 10px;
  color: #555;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* Hidden state for manage settings that preserves layout (no shifting) */
.manage-setting-hidden {
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  border: none !important;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease, padding 0.25s ease;
}

.manage-setting-visible {
  visibility: visible;
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.manage-setting-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 14px;
  color: #e0e0e0;
  font-size: 14px;
  transition: border-color 0.2s;
  cursor: pointer;
}

.manage-setting-select:focus {
  outline: none;
  border-color: #555;
}

.manage-setting-select option {
  background: #1a1a1a;
  color: #e0e0e0;
}

.manage-setting-input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 14px;
  color: #e0e0e0;
  font-size: 14px;
  transition: border-color 0.2s;
}

.manage-setting-input:focus {
  outline: none;
  border-color: #555;
}

.manage-setting-input::placeholder {
  color: #555;
}

.manage-setting-pw-row {
  display: flex;
  gap: 8px;
}

.manage-setting-pw-btn {
  background: #333;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px 16px;
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.manage-setting-pw-btn:hover {
  background: #444;
  border-color: #555;
}

/* Share section inside sidebar */
.manage-share {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid #222;
}

.manage-share-row {
  display: flex;
  gap: 8px;
}

.manage-share-input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 9px 12px;
  color: #777;
  font-size: 12px;
  font-family: 'Monaco', 'Courier New', monospace;
}

.manage-share-wget {
  font-size: 11px;
}

.manage-share-copy {
  background: #333;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 9px 14px;
  color: #e0e0e0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.manage-share-copy:hover {
  background: #444;
  border-color: #555;
}

.manage-share-note {
  font-size: 11px;
  color: #555;
  margin: 2px 0 0;
}

/* Action buttons at bottom of sidebar */
.manage-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #222;
}

.manage-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}

.manage-action-download {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  border: 1px solid #333;
}

.manage-action-download:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #444;
  color: #fff;
}

.manage-action-delete {
  background: rgba(212, 60, 55, 0.12);
  color: #D43C37;
  border: 1px solid rgba(212, 60, 55, 0.25);
}

.manage-action-delete:hover {
  background: rgba(212, 60, 55, 0.22);
  border-color: rgba(212, 60, 55, 0.4);
}

/* Responsive: stack on mobile */
@media (max-width: 800px) {
  .manage-modern {
    flex-direction: column;
  }
  
  .manage-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid #222;
  }
  
  .manage-preview {
    padding: 28px 20px 20px;
  }
  
  .manage-preview-img-wrap {
    max-height: 260px;
  }
  
  .manage-preview-img {
    max-height: 260px;
  }

  .manage-detail-grid {
    max-width: 100%;
  }

  .manage-detail-grid-below {
    padding: 16px 20px 20px;
  }

  .manage-detail-grid-outside {
    margin: 16px auto 30px;
    padding: 16px 20px;
    border-radius: 16px;
  }
}

/* Temp Upload Progress Card
   The drop zone keeps its original dimensions so the page layout does not shift.
   The progress card fills the full drop zone area. */
.drop-zone.uploading {
  background: rgba(30, 30, 30, 0.8);
  border: 3px solid #444;
  padding: 0;
  box-shadow: none;
  transform: none;
  cursor: default;
}

.drop-zone.uploading::before {
  display: none;
}

.drop-zone.uploading:hover {
  background: rgba(30, 30, 30, 0.8);
  border: 3px solid #444;
  transform: none;
}

.upload-progress-card {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.upload-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
}

.upload-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

.upload-card-close {
  background: none;
  border: none;
  color: #666;
  font-size: 24px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
}

.upload-card-close:hover {
  background: rgba(212, 60, 55, 0.15);
  color: #D43C37;
}

.upload-card-body {
  padding: 16px 40px 24px;
}

.upload-card-bar {
  width: 100%;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 20px;
}

.upload-card-fill {
  height: 100%;
  background: linear-gradient(90deg, #D43C37, #DA524E);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.upload-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.upload-card-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #222;
  border-radius: 8px;
  text-align: center;
}

.upload-card-stat-label {
  font-size: 9px;
  color: #555;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.upload-card-stat-value {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: visible;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.upload-card-filename {
  margin-top: 12px;
  font-size: 11px;
  color: #555;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-height: 16px;
  text-align: center;
}

/* Flash Messages */
/* ── Unified Toast System ─────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 500px;
  padding: 0 16px;
}

.toast-message {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: toastSlideDown 0.3s ease;
  width: fit-content;
  max-width: 100%;
}

.toast-message.toast-success {
  background: #22c55e;
  color: #fff;
}

.toast-message.toast-error {
  background: #DA524E;
  color: #fff;
}

.toast-message.toast-info {
  background: #333;
  color: #fff;
}

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

/* Legacy flash-messages (still used by Jinja2 server-side rendering) */
.flash-messages {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 500px;
  padding: 0 16px;
}

.flash-message {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: toastSlideDown 0.3s ease;
  background: #DA524E;
  width: fit-content;
  max-width: 100%;
}

.flash-message.error {
  background: #DA524E;
  color: #fff;
}

.flash-message.success {
  background: #22c55e;
  color: #fff;
}

/* Password & Not Found Sections */
.pw-section,
.notfound-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 20px;
}

.pw-card {
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  max-width: 800px;
  width: 100%;
}

.notfound-card {
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.pw-icon,
.notfound-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.pw-title,
.notfound-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.pw-subtitle,
.notfound-subtitle {
  font-size: 16px;
  color: #888;
  margin-bottom: 32px;
}

.pw-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.pw-input-wrapper {
  width: 100%;
}

.pw-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 14px 18px;
  color: #e0e0e0;
  font-size: 16px;
  transition: border-color 0.3s;
  text-align: center;
}

.pw-input:focus {
  outline: none;
  border-color: #666;
}

.pw-submit {
  background: linear-gradient(135deg, #444 0%, #333 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 48px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.pw-submit:hover {
  background: linear-gradient(135deg, #555 0%, #444 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pw-note {
  font-size: 13px;
  color: #666;
  margin-top: 20px;
}

.notfound-button {
  display: inline-block;
  background: linear-gradient(135deg, #444 0%, #333 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.notfound-button:hover {
  background: linear-gradient(135deg, #555 0%, #444 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Footer */
.footer {
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid #333;
  padding: 10px 20px 8px;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-section {
  flex: 1;
  min-width: 200px;
  max-width: 250px;
}

.footer-section h3 {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.footer-section ul,
.footer-section ol {
  list-style: none;
}

.footer-section li {
  color: #888;
  padding: 2px 0;
  font-size: 11px;
}

.footer-section p {
  color: #888;
  font-size: 10px;
  line-height: 1.5;
}

.footer-bottom {
  max-width: 1200px;
  margin: 10px auto 0;
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid #333;
}

.footer-bottom p {
  color: #666;
  font-size: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 32px;
  }

  .docs-sidebar {
    display: none;
  }

  .docs-main {
    padding-left: 0;
  }

  .docs-layout {
    padding: 0 12px 40px;
  }

  .docs-section-title {
    font-size: 20px;
  }

  .param-row {
    grid-template-columns: 120px 80px 1fr;
    font-size: 12px;
  }

  .docs-info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .files-title {
    font-size: 32px;
  }

  .manage-title {
    font-size: 32px;
  }
  
  .hero-subtitle {
    font-size: 16px;
  }
  
  .drop-zone {
    padding: 60px 20px;
  }
  
  .drop-zone-icon {
  font-size: 42px;
  }
  
  .drop-zone-title {
    font-size: 22px;
  }
  
  .features-row {
    flex-direction: column;
    align-items: center;
  }
  
  .manage-layout {
    flex-direction: column;
  }
  
  .logo-banner {
    height: 28px;
  }

  .nav {
    gap: 20px;
  }
  
  .nav-link {
    font-size: 14px;
  }
  
  .share-box {
    flex-direction: column;
  }
  
  .share-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  
  .share-row-label {
    text-align: left;
  }
}

/* Docs Page - Layout */
.docs-layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 40px;
  gap: 0;
  min-height: calc(100vh - 200px);
}

/* Docs Sidebar */
.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 24px 0 24px 0;
}

.docs-sidebar-inner {
  padding-right: 24px;
  border-right: 1px solid #2a2a2a;
}

.docs-sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  letter-spacing: 1.2px;
  padding: 8px 12px 6px;
  margin: 0;
}

.docs-nav {
  display: flex;
  flex-direction: column;
}

.docs-nav-link {
  display: block;
  padding: 8px 12px;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.docs-nav-link:hover {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.03);
}

.docs-nav-link.active {
  color: #D43C37;
  border-left-color: #D43C37;
  background: rgba(212, 60, 55, 0.06);
}

.docs-nav-divider {
  height: 1px;
  background: #2a2a2a;
  margin: 12px 12px;
}

/* Docs Main Content */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 24px 0 0 40px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.docs-section {
  scroll-margin-top: 90px;
}

.docs-section-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 24px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #2a2a2a;
}

.docs-section-content {
  display: flex;
  flex-direction: column;
}

.docs-section-content h3 {
  font-size: 14px;
  font-weight: 700;
  color: #666;
  letter-spacing: 0.8px;
  margin: 28px 0 12px 0;
}

.docs-section-content h3:first-child {
  margin-top: 0;
}

/* Info Grid (Overview) */
.docs-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.docs-info-card {
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 16px 20px;
}

.docs-info-label {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.docs-info-value {
  font-size: 15px;
  color: #e0e0e0;
  font-weight: 600;
}

.docs-info-value code {
  color: #e0e0e0;
  background: none;
  padding: 0;
}

/* API Endpoint */
.api-endpoint {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.api-method {
  color: #fff;
  padding: 5px 12px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  min-width: 56px;
  text-align: center;
  font-family: 'Monaco', 'Courier New', monospace;
}

.api-method-get {
  background: #2563eb;
}

.api-method-post {
  background: #16a34a;
}

.api-path {
  font-family: 'Monaco', 'Courier New', monospace;
  color: #e0e0e0;
  font-size: 15px;
  font-weight: 600;
}

.api-description {
  margin-bottom: 20px;
}

.api-description p {
  color: #999;
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 8px 0;
}

.api-description p:last-child {
  margin-bottom: 0;
}

.api-description code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: #e0e0e0;
}

/* Code Blocks */
.code-block {
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(40, 40, 40, 0.6);
  border-bottom: 1px solid #2a2a2a;
}

.code-title {
  color: #666;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.copy-btn {
  background: linear-gradient(135deg, #333 0%, #282828 100%);
  color: #999;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.copy-btn:hover {
  background: linear-gradient(135deg, #444 0%, #383838 100%);
  color: #e0e0e0;
  border-color: #555;
}

.code-block pre {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
}

.code-block code {
  color: #e0e0e0;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.7;
}

/* Collapsible code blocks */
.code-block.collapsed pre {
  display: none;
}

.code-toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 10px;
  margin-right: 6px;
}

.code-block:not(.collapsed) .code-toggle-icon {
  transform: rotate(90deg);
}

/* Param Tables */
.param-table {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.param-row {
  display: grid;
  grid-template-columns: 180px 120px 1fr;
  padding: 10px 16px;
  border-bottom: 1px solid #222;
  align-items: center;
}

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

.param-header {
  background: rgba(40, 40, 40, 0.6);
  font-weight: 700;
  color: #555;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.param-name {
  color: #DA524E;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
}

.param-type {
  color: #facc15;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
}

.param-desc {
  color: #888;
  font-size: 13px;
  line-height: 1.5;
}

.param-desc code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  color: #e0e0e0;
}

/* Account Page */
.account-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
  gap: 0;
  min-height: calc(100vh - 200px);
}

.account-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 24px 0;
}

.account-sidebar-inner {
  padding-right: 24px;
  border-right: 1px solid #2a2a2a;
}

.account-sidebar-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 12px 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid #2a2a2a;
}

.account-sidebar-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 12px;
}

.account-sidebar-name {
  font-size: 14px;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.account-sidebar-role {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.account-nav {
  display: flex;
  flex-direction: column;
}

.account-nav-heading {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  letter-spacing: 1.2px;
  padding: 8px 12px 6px;
}

.account-nav-link {
  display: block;
  padding: 8px 12px;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.account-nav-link:hover {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.03);
}

.account-nav-link.active {
  color: #D43C37;
  border-left-color: #D43C37;
  background: rgba(212, 60, 55, 0.06);
}

.account-nav-divider {
  height: 1px;
  background: #2a2a2a;
  margin: 12px 12px;
}

.account-main {
  flex: 1;
  min-width: 0;
  padding: 24px 0 0 40px;
}

.account-section {
  margin-bottom: 48px;
}

.account-section-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 24px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #2a2a2a;
}

.account-section-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 24px;
}

.account-card {
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
}

.account-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #e0e0e0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 16px;
}

.account-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #1a1a1a;
}

.account-field:last-child {
  border-bottom: none;
}

.account-field-label {
  font-size: 13px;
  color: #888;
  font-weight: 500;
}

.account-field-value {
  font-size: 13px;
  color: #e0e0e0;
  font-weight: 600;
}

.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.account-stat {
  background: rgba(30, 30, 30, 0.5);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.account-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.account-stat-label {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.account-storage-bar {
  height: 6px;
  background: #1a1a1a;
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0 8px;
}

.account-storage-fill {
  height: 100%;
  background: linear-gradient(90deg, #D43C37, #E8304A);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.account-storage-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #888;
}

.account-form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.account-form-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.account-form-input {
  padding: 10px 14px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.account-form-input:focus {
  border-color: #D43C37;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.account-btn-primary {
  background: #D43C37;
  color: #fff;
}

.account-btn-primary:hover {
  background: #E8304A;
}

.account-btn-secondary {
  background: #222;
  color: #e0e0e0;
}

.account-btn-secondary:hover {
  background: #333;
}

.account-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.account-recovery-key {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  word-break: break-all;
  font-family: monospace;
  font-size: 12px;
  color: #D43C37;
  user-select: all;
  margin-bottom: 12px;
}

.account-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.account-badge-active {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.account-badge-inactive {
  background: rgba(158, 158, 158, 0.15);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
}

.account-nav-danger {
  color: #ef4444 !important;
}

.account-nav-danger:hover {
  color: #f87171 !important;
}

.account-danger-title {
  color: #ef4444;
}

.account-danger-card {
  border-color: rgba(239, 68, 68, 0.3);
}

.account-danger-warning {
  color: #888;
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 16px;
}

.account-danger-divider {
  border-top: 1px solid #333;
  margin: 16px 0;
}

.account-btn-danger {
  background: #7f1d1d;
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.account-btn-danger:hover {
  background: #991b1b;
  border-color: rgba(239, 68, 68, 0.5);
}

@media (max-width: 768px) {
  .account-sidebar {
    display: none;
  }

  .account-main {
    padding-left: 0;
  }

  .account-layout {
    padding: 0 12px 40px;
  }

  .account-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Auth Pages */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 40px 20px;
}

.auth-box {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 40px;
  max-width: 450px;
  width: 100%;
}

.auth-box h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #e0e0e0;
  font-size: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  text-transform: uppercase;
}

.form-input {
  padding: 12px 16px;
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid #444;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 16px;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #e0e0e0;
  background: rgba(40, 40, 40, 0.9);
}

.btn-primary {
  padding: 14px 24px;
  background: #333;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: #444;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
}

.auth-link {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
  color: #888;
}

.auth-link a {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 600;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* Captcha */
.captcha-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.captcha-image-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-image {
  border-radius: 8px;
  border: 1px solid #444;
  height: 60px;
  width: 200px;
  user-select: none;
  -webkit-user-drag: none;
  background: #141414;
}

.captcha-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid #444;
  border-radius: 8px;
  color: #888;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.captcha-refresh:hover {
  color: #e0e0e0;
  border-color: #e0e0e0;
  background: rgba(40, 40, 40, 0.9);
}

.captcha-refresh:active svg {
  transform: rotate(-180deg);
  transition: transform 0.3s ease;
}

.captcha-input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

/* Dashboard */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

.dashboard-header {
  margin-bottom: 40px;
}

.dashboard-header h1 {
  font-size: 36px;
  margin-bottom: 20px;
  color: #e0e0e0;
}

.storage-info {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px;
  max-width: 600px;
}

.storage-bar-container {
  width: 100%;
  height: 20px;
  background: rgba(30, 30, 30, 0.8);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.storage-bar {
  height: 100%;
  background: linear-gradient(90deg, #666, #444);
  transition: width 0.3s ease;
}

.storage-info p {
  color: #888;
  font-size: 14px;
  margin: 0;
}

.upload-section {
  margin-bottom: 40px;
}

/* Temporary Files Section */
.temp-files-section {
  margin-top: 60px;
  margin-bottom: 40px;
}

.temp-files-section .section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #e0e0e0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.file-list-container {
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid #333;
  border-radius: 12px;
  overflow: hidden;
}

.file-list-table {
  width: 100%;
  border-collapse: collapse;
}

.file-list-table thead {
  background: rgba(30, 30, 30, 0.8);
  border-bottom: 1px solid #444;
}

.file-list-table th {
  padding: 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-list-item {
  border-bottom: none;
  transition: background 0.2s ease;
}

.file-list-item:hover {
  background: rgba(30, 30, 30, 0.5);
}

.file-list-table td {
  padding: 16px;
  color: #e0e0e0;
  font-size: 14px;
}

.file-list-table .file-icon {
  font-size: 20px;
  margin-right: 8px;
  flex-shrink: 0;
}

.file-list-table .td-filename {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 300px;
  overflow: hidden;
}

.file-list-table .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  font-size: 16px;
  transition: all 0.2s ease;
  margin: 0 2px;
}

.file-list-table .action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.files-section h2 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #e0e0e0;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.file-card {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: all 0.3s ease;
}

.file-card:hover {
  border-color: #e0e0e0;
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.1);
}

.file-icon {
  font-size: 48px;
  text-align: center;
}

.file-info {
  flex: 1;
}

.file-name {
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 8px;
  word-break: break-word;
}

.file-size, .file-date, .file-expires {
  font-size: 13px;
  color: #888;
  margin: 4px 0;
}

.file-actions {
  display: flex;
  gap: 10px;
}

.btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #555;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.3px;
  min-height: 28px;
  box-sizing: border-box;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #777;
}

.no-files {
  text-align: center;
  padding: 60px 20px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid #333;
  border-radius: 12px;
}

.no-files p {
  font-size: 18px;
  color: #888;
}

/* ── Admin Panel ────────────────────────────────────────────────────── */

.adm-layout {
  display: flex;
  min-height: calc(100vh - 60px);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.adm-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 24px 0;
}

.adm-sidebar-inner {
  padding-right: 24px;
  border-right: 1px solid #2a2a2a;
}

.adm-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #555;
  padding: 8px 12px 6px;
  margin: 0;
}

.adm-nav {
  display: flex;
  flex-direction: column;
}

.adm-nav-link {
  display: block;
  padding: 8px 12px;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
}

.adm-nav-link:hover {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.03);
}

.adm-nav-link.active {
  color: #D43C37;
  border-left-color: #D43C37;
  background: rgba(212, 60, 55, 0.06);
}

/* Main area */
.adm-main {
  flex: 1;
  min-width: 0;
  padding: 24px 0 60px 40px;
}

.adm-page-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 24px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #2a2a2a;
}

/* Tabs */
.adm-tab {
  display: none;
}

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

/* Admin flash — now uses unified toast system (CSS kept for backward compat) */
.adm-flash {
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: toastSlideDown 0.3s ease;
  transition: opacity 0.3s;
}

.adm-flash-success {
  background: #22c55e;
  color: #fff;
}

.adm-flash-error {
  background: #DA524E;
  color: #fff;
}

.adm-flash-info {
  background: #333;
  color: #fff;
}

/* Stats Grid */
.adm-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.adm-stat-card {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  padding: 16px;
  transition: border-color 0.2s;
}

.adm-stat-card:hover {
  border-color: #2a2a2a;
}

.adm-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: #555;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.adm-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #e0e0e0;
}

/* Cards */
.adm-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.adm-card {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  padding: 20px;
}

.adm-card-title {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

/* Storage bar */
.adm-storage-info {
  margin-bottom: 12px;
}

.adm-storage-bar {
  height: 8px;
  background: #1e1e1e;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.adm-storage-fill {
  height: 100%;
  background: #DE1833;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.adm-storage-fill.adm-storage-warn {
  background: #ef4444;
}

.adm-storage-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #888;
  font-weight: 500;
}

.adm-storage-detail {
  font-size: 10px;
  color: #555;
  letter-spacing: 0.3px;
}

/* Quick actions */
.adm-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.adm-action-btn {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #1e1e1e;
  border-radius: 8px;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.adm-action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #333;
  color: #e0e0e0;
}

.adm-action-danger {
  border-color: rgba(222, 24, 51, 0.2);
  color: #DE1833;
}

.adm-action-danger:hover {
  background: rgba(222, 24, 51, 0.08);
  border-color: rgba(222, 24, 51, 0.4);
}

/* Tab header with search */
.adm-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.adm-tab-header .adm-page-title {
  margin: 0;
}

.adm-search-wrap {
  position: relative;
}

.adm-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  pointer-events: none;
}

.adm-search {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 8px;
  color: #e0e0e0;
  padding: 8px 12px 8px 32px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  width: 220px;
  outline: none;
  transition: border-color 0.2s;
}

.adm-search:focus {
  border-color: #333;
}

.adm-search::placeholder {
  color: #444;
}

/* Tables */
.adm-table-wrap {
  overflow-x: auto;
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
}

.adm-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.8px;
  border-bottom: 1px solid #1e1e1e;
  white-space: nowrap;
  user-select: none;
}

.adm-table td {
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  color: #ccc;
  border-bottom: 1px solid #141414;
  white-space: nowrap;
}

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

.adm-table tbody tr:last-child td {
  border-bottom: none;
}

.adm-sortable {
  cursor: pointer;
  transition: color 0.15s;
}

.adm-sortable:hover {
  color: #888;
}

.adm-th-actions {
  text-align: right !important;
  width: 100px;
}

.adm-td-actions {
  text-align: right !important;
}

.adm-td-id {
  color: #555;
  font-size: 12px;
  font-weight: 600;
}

.adm-td-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-td-date {
  color: #777;
  font-size: 12px;
}

.adm-td-filename {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-muted {
  color: #444;
}

.adm-empty {
  text-align: center !important;
  color: #555;
  padding: 40px 14px !important;
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* User cell */
.adm-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.adm-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.adm-user-avatar svg {
  width: 28px;
  height: 28px;
}

.adm-user-name {
  font-weight: 600;
  font-size: 13px;
  color: #e0e0e0;
}

/* Role badge */
.adm-role {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.adm-role-admin {
  background: rgba(222, 24, 51, 0.12);
  color: #DE1833;
  border: 1px solid rgba(222, 24, 51, 0.3);
}

.adm-role-user {
  background: rgba(100, 150, 255, 0.1);
  color: #6496ff;
  border: 1px solid rgba(100, 150, 255, 0.25);
}

/* Flags */
.adm-flag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-right: 4px;
}

.adm-flag-e2e {
  background: rgba(212, 60, 55, 0.15);
  color: #D43C37;
}

.adm-flag-public {
  background: rgba(100, 150, 255, 0.15);
  color: #6496ff;
}

.adm-flag-pw {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* Storage cell */
.adm-storage-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
}

.adm-storage-mini {
  height: 4px;
  background: #1e1e1e;
  border-radius: 2px;
  overflow: hidden;
}

.adm-storage-mini-fill {
  height: 100%;
  background: #DE1833;
  border-radius: 2px;
}

.adm-storage-text {
  font-size: 11px;
  color: #777;
}

/* Visitor ID */
.adm-visitor {
  background: rgba(100, 100, 100, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
  color: #888;
}

/* Action buttons */
.adm-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.adm-btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #1e1e1e;
  border-radius: 6px;
  color: #888;
  cursor: pointer;
  transition: all 0.12s ease;
  text-decoration: none;
}

.adm-btn-sm:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #333;
  color: #e0e0e0;
}

.adm-btn-sm.adm-btn-danger:hover {
  background: rgba(222, 24, 51, 0.1);
  border-color: rgba(222, 24, 51, 0.4);
  color: #DE1833;
}

/* Pagination */
.adm-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  justify-content: center;
}

.adm-page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid #1e1e1e;
  border-radius: 6px;
  color: #888;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.adm-page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  border-color: #333;
  color: #e0e0e0;
}

.adm-page-btn.active {
  background: rgba(222, 24, 51, 0.1);
  border-color: rgba(222, 24, 51, 0.3);
  color: #DE1833;
}

.adm-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.adm-page-dots {
  color: #555;
  font-size: 12px;
  padding: 0 4px;
}

.adm-page-info {
  font-size: 11px;
  color: #555;
  margin-left: 12px;
  letter-spacing: 0.3px;
}

/* Charts */
.adm-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.adm-chart-card {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  padding: 20px;
}

.adm-chart-title {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.adm-chart-card canvas {
  width: 100% !important;
  height: 200px !important;
}

/* Settings */
.adm-settings-wrap {
  max-width: 680px;
}

.adm-settings-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.adm-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid #1e1e1e;
  gap: 24px;
}

.adm-setting-row:last-child {
  border-bottom: none;
}

.adm-setting-info {
  flex: 1;
  min-width: 0;
}

.adm-setting-name {
  font-size: 13px;
  font-weight: 700;
  color: #e0e0e0;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.adm-setting-desc {
  font-size: 11px;
  color: #666;
  line-height: 1.5;
  letter-spacing: 0.3px;
}

.adm-settings-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(222, 24, 51, 0.05);
  border: 1px solid rgba(222, 24, 51, 0.15);
  border-radius: 8px;
  font-size: 11px;
  color: #888;
  letter-spacing: 0.3px;
  line-height: 1.5;
}

/* Toggle Switch */
.adm-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.adm-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.adm-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #333;
  border-radius: 24px;
  transition: background 0.25s ease;
}

.adm-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.25s ease;
}

.adm-toggle input:checked + .adm-toggle-slider {
  background: rgba(222, 24, 51, 0.3);
}

.adm-toggle input:checked + .adm-toggle-slider::before {
  transform: translateX(20px);
  background: #DE1833;
}

/* Responsive */
@media (max-width: 900px) {
  .adm-layout {
    flex-direction: column;
    padding: 0 12px;
  }

  .adm-sidebar {
    width: 100%;
    padding: 16px 0 0;
    position: static;
    max-height: none;
  }

  .adm-sidebar-inner {
    position: static;
    padding-right: 0;
    border-right: none;
  }

  .adm-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .adm-nav-link {
    padding: 8px 12px;
    font-size: 11px;
    border-left: none;
  }

  .adm-main {
    padding: 20px 0 40px 0;
  }

  .adm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .adm-card-row {
    grid-template-columns: 1fr;
  }

  .adm-charts-grid {
    grid-template-columns: 1fr;
  }

  .adm-tab-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .adm-search {
    width: 100%;
  }
}

/* Flash Messages */
/* Dashboard flash messages — inherit unified toast positioning */
.mega-dashboard .flash-messages {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  max-width: 500px;
  width: 100%;
  padding: 0 16px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mega-dashboard .flash-message {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #DA524E;
  color: #fff;
  padding: 14px 36px 14px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: toastSlideDown 0.3s ease;
  width: fit-content;
  max-width: 100%;
}

.flash-dismiss {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.flash-dismiss:hover {
  color: #fff;
}

/* E2EE Overlay (setup + unlock) */
.e2ee-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.e2ee-card {
  position: relative;
  background: rgba(14, 14, 14, 0.95);
  border: 1px solid rgba(222, 24, 51, 0.4);
  border-radius: 16px;
  padding: 40px 36px 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow:
    0 0 15px rgba(222, 24, 51, 0.15),
    0 0 40px rgba(222, 24, 51, 0.08),
    0 24px 64px rgba(0, 0, 0, 0.6);
  animation: e2eeCardIn 0.3s ease, e2eeGlow 3s ease-in-out infinite;
}

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

@keyframes e2eeGlow {
  0%, 100% {
    border-color: rgba(222, 24, 51, 0.35);
    box-shadow:
      0 0 15px rgba(222, 24, 51, 0.12),
      0 0 40px rgba(222, 24, 51, 0.06),
      0 24px 64px rgba(0, 0, 0, 0.6);
  }
  50% {
    border-color: rgba(222, 24, 51, 0.7);
    box-shadow:
      0 0 20px rgba(222, 24, 51, 0.25),
      0 0 60px rgba(222, 24, 51, 0.12),
      0 24px 64px rgba(0, 0, 0, 0.6);
  }
}

.e2ee-dismiss {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: #555;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.e2ee-dismiss:hover {
  color: #e0e0e0;
}

.e2ee-card-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.e2ee-card-title {
  color: #e0e0e0;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.e2ee-card-desc {
  color: #777;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.e2ee-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.e2ee-input {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e0e0e0;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.e2ee-input:focus {
  border-color: #DE1833;
}

.e2ee-input.e2ee-input-error {
  border-color: #ef4444;
}

.e2ee-btn {
  background: #DE1833;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.2s, opacity 0.2s;
}

.e2ee-btn:hover {
  background: #E8304A;
}

.e2ee-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .e2ee-card {
    padding: 32px 20px 24px;
  }

  .e2ee-input-row {
    flex-direction: column;
  }

  .e2ee-input {
    width: 100%;
  }

  .e2ee-btn {
    width: 100%;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .file-grid {
    grid-template-columns: 1fr;
  }
  

  
  .users-table {
    font-size: 12px;
  }
  
  .users-table th,
  .users-table td {
    padding: 4px 8px;
  }
}

/* MEGA.NZ Style Dashboard */
.mega-dashboard {
  display: flex;
  flex: 1;
  background: #0a0a0a;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  min-height: 0;
}

/* Sidebar */
.mega-sidebar {
  width: 260px;
  background: #141414;
  border-right: 1px solid #222;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar-header {
  padding: 12px 20px;
  border-bottom: 1px solid #222;
  min-height: 65px;
}

.sidebar-header h2 {
  font-size: 20px;
  color: #e0e0e0;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #888;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #e0e0e0;
}

.sidebar-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  border-left-color: #e0e0e0;
}

.sidebar-icon {
  font-size: 20px;
}

.sidebar-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-storage {
  padding: 20px;
  border-top: 1px solid #222;
}

.storage-label {
  font-size: 11px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.storage-progress {
  height: 6px;
  background: #222;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.storage-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #666, #444);
  transition: width 0.3s ease;
}

.storage-text {
  font-size: 12px;
  color: #888;
}

/* Main Content Area */
.mega-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  overflow: hidden;
  position: relative;
}

/* Top Bar */
.mega-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #141414;
  border-bottom: 1px solid #222;
  min-height: 65px;
}

.topbar-title {
  font-size: 20px;
  color: #e0e0e0;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  flex: 1;
  min-width: 0;
}

.topbar-header-container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}



.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-new-folder,
.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-new-folder svg,
.btn-upload svg {
  opacity: 0.75;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.btn-new-folder:hover,
.btn-upload:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-new-folder:hover svg,
.btn-upload:hover svg {
  opacity: 1;
}

.btn-new-folder:active,
.btn-upload:active {
  transform: translateY(0);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.08);
}

.btn-icon-new-folder {
  display: none;
}

.btn-upload-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-upload-large svg {
  opacity: 0.75;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.btn-upload-large:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-upload-large:hover svg {
  opacity: 1;
}

.btn-upload-large:active {
  transform: translateY(0);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.08);
}

/* Drop Zone Overlay */
.mega-dropzone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 20, 20, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.mega-dropzone.visible {
  display: flex;
}

.mega-dropzone.uploading {
  background: rgba(10, 10, 10, 0.95);
}

.mega-dropzone-content {
  text-align: center;
}

.dropzone-icon {
  font-size: 80px;
  display: block;
  margin-bottom: 20px;
}

.dropzone-text {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

/* File Browser */
.mega-browser {
  flex: 1;
  overflow-y: auto;
  background: #0a0a0a;
}

.browser-header {
  display: grid;
  grid-template-columns: 1fr auto 120px 150px 100px;
  gap: 20px;
  padding: 15px 30px;
  background: #141414;
  border-bottom: 1px solid #222;
  font-size: 12px;
  color: #666;
  font-weight: 600;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.browser-header .browser-col {
  color: #666;
  font-size: 12px;
}

.sort-header {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.sort-header:hover {
  color: #aaa;
}

.sort-header.sort-active {
  color: #ffffff;
}

.sort-arrow {
  font-size: 10px;
  margin-left: 2px;
  vertical-align: middle;
}

.browser-files {
  padding: 0;
}

.browser-row {
  display: grid;
  grid-template-columns: 1fr auto 120px 150px 100px;
  gap: 20px;
  padding: 10px 30px;
  background: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  transition: all 0.2s ease;
  cursor: pointer;
}

.browser-row:hover {
  background: #141414;
}

.file-row {
  cursor: default !important;
}

.file-row:hover {
  cursor: default !important;
}

.file-row * {
  cursor: default !important;
}

.browser-col {
  display: flex;
  align-items: center;
  color: #e0e0e0;
  font-size: 14px;
}

.col-name {
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.file-icon-small {
  font-size: 20px;
  flex-shrink: 0;
}

.file-icon-preview {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  transition: background-color 0.15s;
}

.file-icon-preview:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.file-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  min-width: 0;
  flex: 1;
}

.file-name-base {
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.file-name-ext {
  flex-shrink: 0;
  color: #888;
}

.col-size,
.col-date {
  color: #888;
  font-size: 13px;
}

.col-actions {
  gap: 4px;
  justify-content: flex-end;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
  font-size: 16px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.action-btn:hover {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.action-btn.action-download:hover {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.2);
}

.action-btn.action-manage:hover {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.2);
}

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

.action-btn.action-restore:hover {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.2);
}

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

.action-btn.action-copy:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.2);
}

/* Empty State */
.browser-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.browser-empty h3 {
  font-size: 20px;
  color: #e0e0e0;
  margin-bottom: 10px;
}

.browser-empty p {
  font-size: 14px;
  color: #888;
}

/* Responsive for Mega Dashboard */
@media (max-width: 768px) {
  .mega-dashboard {
    flex-direction: column;
  }
  
  .mega-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #222;
  }
  
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    padding: 10px;
  }
  
  .sidebar-item {
    flex-shrink: 0;
  }
  
  .browser-header,
  .browser-row {
    grid-template-columns: 1fr auto 80px 60px;
    padding: 12px 15px;
  }
  
  .col-date,
  .col-tags,
  .col-check,
  .col-encryption {
    display: none;
  }
  
  .mega-topbar {
    padding: 15px 20px;
  }
  
  .upload-progress-toast {
    width: calc(100% - 40px);
    bottom: 10px;
    right: 20px;
    left: 20px;
  }
  
  .upload-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* User Menu Dropdown */
/* ── User Menu & Dropdown ──────────────────────────────────────────── */

.user-menu {
  position: relative;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50px;
  color: #b0b0b0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu-button:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: #222;
  color: #e0e0e0;
}

.user-avatar-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  letter-spacing: 0.5px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-arrow {
  transition: transform 0.25s ease;
  margin-left: 2px;
  opacity: 0.5;
  flex-shrink: 0;
}

.user-menu-button:hover .user-arrow {
  opacity: 0.8;
}

.user-menu-button.active .user-arrow {
  transform: rotate(180deg);
  opacity: 0.8;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: #141414;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow: hidden;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
}

.dropdown-user-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.dropdown-user-details {
  flex: 1;
  min-width: 0;
}

.dropdown-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-role {
  font-size: 10px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: #1e1e1e;
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #888;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.12s ease;
  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e0e0e0;
}

.dropdown-item-logout:hover {
  background: rgba(222, 24, 51, 0.06);
  color: #DE1833;
}

.dropdown-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.12s ease;
}

.dropdown-item:hover .dropdown-icon {
  opacity: 1;
}

.dropdown-label {
  flex: 1;
}

/* Full width dashboard - no padding from main */
body:has(.mega-dashboard) .main {
  padding: 0;
  overflow: hidden;
}

body:has(.mega-dashboard) .container {
  max-width: 100%;
  padding: 0;
  margin: 0;
}
/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  min-width: 400px;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #e0e0e0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #888;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
}

.modal-body {
  padding: 24px;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid #444;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 14px;
  transition: all 0.2s ease;
}

.modal-input:focus {
  outline: none;
  border-color: #666;
  background: rgba(40, 40, 40, 0.9);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #2a2a2a;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid #444;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #555;
}

.btn-primary-small {
  padding: 10px 20px;
  background: #333;
  border: 1px solid #444;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary-small:hover {
  background: #444;
}

/* Upload Progress Toast (Bottom) */
.upload-progress-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 460px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  z-index: 2000;
  animation: slideUp 0.3s ease;
}

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

.upload-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #2a2a2a;
}

.upload-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #e0e0e0;
  letter-spacing: 0.5px;
}

.upload-toast-close {
  background: none;
  border: none;
  color: #666;
  font-size: 24px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
}

.upload-toast-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
}

.upload-toast-body {
  padding: 16px 20px;
}

.upload-progress-bar {
  width: 100%;
  height: 6px;
  background: #222;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #D43C37, #DA524E);
  transition: width 0.3s ease;
}

.upload-stats {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0;
}

.upload-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 0 4px;
}

.upload-stat:first-child {
  text-align: left;
}

.upload-stat:nth-child(2) {
  text-align: center;
}

.upload-stat:last-child {
  text-align: right;
}

.upload-stat-label {
  font-size: 10px;
  color: #666;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.upload-stat-value {
  font-size: 13px;
  color: #e0e0e0;
  font-weight: 600;
  white-space: nowrap;
  overflow: visible;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.upload-progress-text {
  font-size: 13px;
  color: #888;
}

.upload-filename {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-height: 16px;
}

/* Breadcrumb Path */
.breadcrumb-path {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  min-width: 0;
  flex-wrap: wrap;
}

.breadcrumb-path-item {
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
  letter-spacing: 0.3px;
}

.breadcrumb-path-item:hover {
  color: #b0b0b0;
}

.breadcrumb-path-current {
  color: #e0e0e0;
}

.breadcrumb-path-current:hover {
  color: #e0e0e0;
}

.breadcrumb-path-sep {
  color: #444;
  font-size: 16px;
  font-weight: 400;
  user-select: none;
}

/* Create Folder Button */
.btn-create-folder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid #444;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-create-folder:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #555;
}

/* Folder Row Styling */
.folder-row {
  cursor: pointer !important;
  transition: all 0.2s ease;
}

.folder-row:hover {
  background: #141414 !important;
}

.folder-row:active {
  background: #1a1a1a !important;
  transform: scale(0.998);
}

.folder-link {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  pointer-events: none;
}

.folder-row:hover .folder-link {
  text-decoration: none;
}

/* Drag and Drop States */
.file-row.dragging {
  opacity: 0.5;
}

.folder-row.drop-target {
  background: rgba(255, 255, 255, 0.1) !important;
  border-left: 3px solid #e0e0e0;
}

.file-row {
  cursor: move;
}

/* Delete Buttons */
.delete-folder-btn,
.delete-file-btn,
.delete-temp-file-btn {
  cursor: pointer;
  background: rgba(30, 30, 30, 0.8);
  border: none;
  outline: none;
  font-size: 16px;
  padding: 4px;
  color: #e0e0e0;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.delete-folder-btn:hover,
.delete-file-btn:hover,
.delete-temp-file-btn:hover {
  background: rgba(212, 60, 55, 0.2);
  color: #D43C37;
  transform: scale(1.1);
}

/* Sidebar Folder Tree */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #222;
  min-height: 65px;
}

.sidebar-header h2 {
  font-size: 20px;
  color: #e0e0e0;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

.folder-tree {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.folder-tree-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  position: relative;
  transition: background 0.2s ease;
}

.folder-tree-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.folder-tree-item:hover .folder-tree-actions {
  opacity: 1;
}

.folder-tree-item::before {
  display: none;
}

.folder-tree-toggle {
  background: none;
  border: none;
  color: #888;
  font-size: 12px;
  padding: 4px;
  cursor: pointer;
  margin-right: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.folder-tree-toggle:hover {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.05);
}

.folder-tree-spacer {
  width: 20px;
  height: 20px;
  margin-right: 4px;
  flex-shrink: 0;
  display: inline-block;
}

.folder-tree-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  text-decoration: none;
  color: #b0b0b0;
  font-size: 13px;
  transition: color 0.2s ease;
}

.folder-tree-link:hover {
  color: #e0e0e0;
}

.folder-tree-link.active {
  color: #e0e0e0;
  font-weight: 600;
}

.folder-tree-icon {
  font-size: 14px;
}

.folder-tree-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-tree-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.folder-tree-action {
  background: none;
  border: none;
  font-size: 16px;
  padding: 4px;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
  line-height: 1;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.folder-tree-action:hover {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.05);
}

.folder-tree-action[data-action="delete"]:hover {
  color: #D43C37;
  background: rgba(212, 60, 55, 0.1);
}

.folder-tree-children {
  padding-left: 0;
}

.folder-tree-children > .folder-tree-item {
  padding-left: 32px;
}

.folder-tree-children .folder-tree-children > .folder-tree-item {
  padding-left: 52px;
}

.folder-tree-children .folder-tree-children .folder-tree-children > .folder-tree-item {
  padding-left: 72px;
}

.folder-tree-children .folder-tree-children .folder-tree-children .folder-tree-children > .folder-tree-item {
  padding-left: 92px;
}

.folder-tree-children .folder-tree-children .folder-tree-children .folder-tree-children .folder-tree-children > .folder-tree-item {
  padding-left: 112px;
}

.folder-tree-file {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  position: relative;
  transition: background 0.2s ease;
}

.folder-tree-file:hover {
  background: rgba(255, 255, 255, 0.03);
}

.root-folder {
  font-weight: 600;
}

/* Context Menu */
.context-menu {
  display: none;
  position: fixed;
  background: #141414;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03);
  min-width: 200px;
  z-index: 3000;
  overflow: hidden;
  padding: 4px 0;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: #888;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.context-menu-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e0e0e0;
}

.context-menu-item:hover .context-icon {
  opacity: 1;
}

.context-menu-item[data-action="open"]:hover {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

.context-menu-item[data-action="open"]:hover .context-icon {
  color: #f59e0b;
}

.context-menu-item[data-action="download"]:hover {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.06);
}

.context-menu-item[data-action="download"]:hover .context-icon {
  color: #60a5fa;
}

.context-menu-item[data-action="copy-link"]:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.06);
}

.context-menu-item[data-action="copy-link"]:hover .context-icon {
  color: #38bdf8;
}

.context-menu-item[data-action="properties"]:hover {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.06);
}

.context-menu-item[data-action="properties"]:hover .context-icon {
  color: #a78bfa;
}

.context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.06);
  color: #ef4444;
}

.context-menu-item.danger:hover .context-icon {
  color: #ef4444;
}

.context-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.context-icon svg {
  width: 16px;
  height: 16px;
}

.context-menu-divider {
  height: 1px;
  background: #1e1e1e;
  margin: 4px 0;
}

/* Properties Modal */
.modal-properties {
  max-width: 550px;
}

.property-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.property-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
}

.property-label {
  font-size: 13px;
  color: #888;
  font-weight: 600;
}

.property-value {
  font-size: 13px;
  color: #e0e0e0;
  display: flex;
  align-items: center;
}

.property-code {
  font-family: 'Monaco', 'Courier New', monospace;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* File Badges */
.file-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.file-badge-expires {
  background: rgba(245, 158, 11, 0.10);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
  margin-left: 0;
  min-height: 22px;
  min-width: 42px;
  justify-content: center;
  box-sizing: border-box;
}

.file-badge-expires .badge-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.file-badge-public {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
  min-height: 22px;
  min-width: 42px;
  justify-content: center;
  box-sizing: border-box;
}

.file-badge-private {
  background: rgba(158, 158, 158, 0.15);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
}

.file-badge-warning {
  background: rgba(212, 60, 55, 0.15);
  color: #D43C37;
  border: 1px solid rgba(212, 60, 55, 0.3);
}

.file-badge-info {
  background: rgba(33, 150, 243, 0.15);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.file-badge-browsable {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.file-badge-e2e {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.file-badge-server-enc {
  background: rgba(250, 204, 21, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(250, 204, 21, 0.3);
}

/* Status column right-align */
.td-status {
  text-align: right;
}

.td-status .file-badge {
  margin-left: 4px;
  margin-right: 0;
}


.share-link-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-link-label {
  font-size: 10px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.share-link-url {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  color: #888;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #2a2a2a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.share-link-url:hover {
  color: #e0e0e0;
  border-color: #444;
}

.share-link-copy {
  background: rgba(255, 255, 255, 0.05);
  color: #888;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.share-link-copy:hover {
  color: #e0e0e0;
  border-color: #555;
  background: rgba(255, 255, 255, 0.1);
}

.toggle-label {
  font-size: 13px;
  color: #e0e0e0;
  min-width: 60px;
}

.toggle-label-text {
  font-size: 13px;
  color: #e0e0e0;
  margin-left: 12px;
  min-width: 60px;
}

/* Properties Modal - Password Group */
.prop-password-group {
  flex-wrap: wrap;
  gap: 8px;
}

.prop-password-input {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 12px;
  padding: 5px 10px;
  width: 140px;
  outline: none;
  transition: border-color 0.2s;
}

.prop-password-input:focus {
  border-color: #D43C37;
}

.prop-password-save {
  background: #D43C37;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.prop-password-save:hover {
  background: #E8304A;
}

/* Properties Modal - Re-encryption Progress */
.prop-reencrypt-progress {
  padding: 12px 0;
}

.prop-reencrypt-status {
  font-size: 11px;
  color: #888;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.prop-reencrypt-bar-bg {
  width: 100%;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
}

.prop-reencrypt-bar {
  height: 100%;
  background: #D43C37;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Confirmation Modal */
.modal-confirm {
  z-index: 3000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-confirm .modal-confirm-content {
  max-width: 420px;
  min-width: 0;
  animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #222;
  background: #111;
  position: relative;
  box-shadow: none;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-16px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Top accent bar */
.confirm-accent-bar {
  height: 3px;
  width: 100%;
}

.confirm-accent-danger {
  background: linear-gradient(90deg, #D43C37, #ef4444);
}

.confirm-accent-permanent {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.confirm-accent-warn {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.modal-confirm-header {
  flex-direction: column;
  gap: 12px;
  padding: 28px 28px 16px;
  text-align: center;
  border-bottom: none;
}

.confirm-icon {
  font-size: 36px;
  line-height: 1;
}

.modal-confirm-header h3 {
  font-size: 16px;
  color: #f0f0f0;
  margin: 0;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  letter-spacing: 0.02em;
}

.modal-confirm-header h3 .file-name-ext {
  color: #666;
  font-weight: 500;
}

.modal-confirm-body {
  padding: 0 28px 24px;
  text-align: center;
}

.modal-confirm-body p {
  font-size: 14px;
  color: #888;
  line-height: 1.5;
  margin: 0;
}

.modal-confirm-footer {
  padding: 16px 28px 20px;
  border-top: 1px solid #1e1e1e;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-confirm-footer .btn-secondary {
  padding: 9px 20px;
  background: transparent;
  border: 1px solid #333;
  border-radius: 8px;
  color: #999;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.03em;
}

.modal-confirm-footer .btn-secondary:hover {
  background: #1a1a1a;
  border-color: #444;
  color: #ccc;
}

.btn-danger-confirm {
  padding: 9px 22px;
  background: #D43C37;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.03em;
}

.btn-danger-confirm:hover {
  background: #e04540;
  box-shadow: 0 2px 12px rgba(212, 60, 55, 0.35);
}

.btn-danger-confirm:active {
  background: #c0342f;
}

/* Permanent delete variant */
.confirm-permanent .btn-danger-confirm {
  background: #dc2626;
}

.confirm-permanent .btn-danger-confirm:hover {
  background: #ef4444;
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.4);
}

.confirm-permanent .modal-confirm-header h3 {
  color: #fca5a5;
}

/* Confirm Modal — E2E Warning Variant */
.confirm-e2e-warn .confirm-accent-bar,
.confirm-no-e2e .confirm-accent-bar {
  display: none;
}

.modal-confirm.confirm-e2e-warn {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.confirm-e2e-warn .modal-confirm-content {
  background: rgba(14, 14, 14, 0.97);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  box-shadow:
    0 0 15px rgba(245, 158, 11, 0.1),
    0 0 40px rgba(245, 158, 11, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.6);
  animation: modalSlideIn 0.3s ease, e2eWarnGlow 3s ease-in-out infinite;
  max-width: 440px;
}

@keyframes e2eWarnGlow {
  0%, 100% {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow:
      0 0 15px rgba(245, 158, 11, 0.1),
      0 0 40px rgba(245, 158, 11, 0.06),
      0 24px 64px rgba(0, 0, 0, 0.6);
  }
  50% {
    border-color: rgba(245, 158, 11, 0.65);
    box-shadow:
      0 0 20px rgba(245, 158, 11, 0.2),
      0 0 60px rgba(245, 158, 11, 0.1),
      0 24px 64px rgba(0, 0, 0, 0.6);
  }
}

.confirm-e2e-warn .modal-confirm-header {
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  padding: 32px 28px 20px;
}

.confirm-e2e-warn .confirm-icon {
  font-size: 0;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 14px;
}

.confirm-e2e-warn .confirm-icon svg {
  width: 28px;
  height: 28px;
}

.confirm-e2e-warn .modal-confirm-header h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #f5c542;
  margin-top: 4px;
}

.confirm-e2e-warn .modal-confirm-body {
  padding: 20px 28px 24px;
}

.confirm-e2e-warn .modal-confirm-body p {
  font-size: 13px;
  color: #999;
  line-height: 1.7;
}

.confirm-e2e-warn .modal-confirm-body .e2e-warn-filename {
  display: block;
  color: #e0e0e0;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
  word-break: break-all;
}

.confirm-e2e-warn .modal-confirm-body .e2e-warn-size {
  color: #f5c542;
  font-weight: 600;
}

.confirm-e2e-warn .modal-confirm-footer {
  border-top: 1px solid rgba(245, 158, 11, 0.15);
  padding: 16px 28px;
  gap: 10px;
}

.confirm-e2e-warn .btn-secondary {
  background: transparent;
  border: 1px solid #333;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
}

.confirm-e2e-warn .btn-secondary:hover {
  border-color: #555;
  color: #ccc;
  background: rgba(255, 255, 255, 0.03);
}

.confirm-e2e-warn .btn-danger-confirm {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f5c542;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}

.confirm-e2e-warn .btn-danger-confirm:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
  transform: translateY(-1px);
}

.confirm-e2e-warn .btn-danger-confirm:active {
  transform: translateY(0);
}

/* ------------------------------------------
   Confirm variant: NO E2E (red accent)
   ------------------------------------------ */
.modal-confirm.confirm-no-e2e {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.confirm-no-e2e .modal-confirm-content {
  background: rgba(14, 14, 14, 0.97);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 16px;
  box-shadow:
    0 0 15px rgba(239, 68, 68, 0.1),
    0 0 40px rgba(239, 68, 68, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.6);
  animation: modalSlideIn 0.3s ease, noE2eGlow 3s ease-in-out infinite;
  max-width: 440px;
}

@keyframes noE2eGlow {
  0%, 100% {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow:
      0 0 15px rgba(239, 68, 68, 0.1),
      0 0 40px rgba(239, 68, 68, 0.06),
      0 24px 64px rgba(0, 0, 0, 0.6);
  }
  50% {
    border-color: rgba(239, 68, 68, 0.65);
    box-shadow:
      0 0 20px rgba(239, 68, 68, 0.2),
      0 0 60px rgba(239, 68, 68, 0.1),
      0 24px 64px rgba(0, 0, 0, 0.6);
  }
}

.confirm-no-e2e .modal-confirm-header {
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
  padding: 32px 28px 20px;
}

.confirm-no-e2e .confirm-icon {
  font-size: 0;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 14px;
}

.confirm-no-e2e .confirm-icon svg {
  width: 28px;
  height: 28px;
}

.confirm-no-e2e .modal-confirm-header h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ef4444;
  margin-top: 4px;
}

.confirm-no-e2e .modal-confirm-body {
  padding: 20px 28px 24px;
}

.confirm-no-e2e .modal-confirm-body p {
  font-size: 13px;
  color: #999;
  line-height: 1.7;
}

.confirm-no-e2e .modal-confirm-body .no-e2e-warn-count {
  display: block;
  color: #e0e0e0;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}

.confirm-no-e2e .modal-confirm-body .no-e2e-warn-hint {
  color: #666;
  font-size: 12px;
}

.confirm-no-e2e .modal-confirm-footer {
  border-top: 1px solid rgba(239, 68, 68, 0.15);
  padding: 16px 28px;
  gap: 10px;
}

.confirm-no-e2e .btn-secondary {
  background: transparent;
  border: 1px solid #333;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
}

.confirm-no-e2e .btn-secondary:hover {
  border-color: #555;
  color: #ccc;
  background: rgba(255, 255, 255, 0.03);
}

.confirm-no-e2e .btn-danger-confirm {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}

.confirm-no-e2e .btn-danger-confirm:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15);
  transform: translateY(-1px);
}

.confirm-no-e2e .btn-danger-confirm:active {
  transform: translateY(0);
}

/* ==========================================
   SEARCH BOX
   ========================================== */
.search-box {
  position: relative;
}

.search-input {
  width: 220px;
  padding: 8px 14px;
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid #333;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #555;
  width: 300px;
  background: rgba(40, 40, 40, 0.9);
}

.search-input::placeholder {
  color: #666;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.search-results {
  position: absolute;
  top: 100%;
  right: 0;
  width: 400px;
  max-height: 400px;
  overflow-y: auto;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  z-index: 2000;
  margin-top: 8px;
}

.search-section-label {
  padding: 10px 16px 6px;
  font-size: 10px;
  font-weight: 700;
  color: #666;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: #e0e0e0;
  transition: background 0.15s ease;
  cursor: pointer;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.search-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.search-info {
  flex: 1;
  min-width: 0;
}

.search-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-path {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 13px;
  font-weight: 600;
}

/* ==========================================
   BULK OPERATIONS
   ========================================== */
.bulk-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.bulk-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bulk-select-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bulk-count {
  font-size: 13px;
  color: #888;
  font-weight: 600;
}

.bulk-right {
  display: flex;
  gap: 10px;
}

.bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.06);
  color: #e0e0e0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bulk-btn svg {
  opacity: 0.75;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.bulk-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bulk-btn:hover svg {
  opacity: 1;
}

.bulk-btn:active {
  transform: translateY(0);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.08);
}

.bulk-btn-restore {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.25);
  color: #4ade80;
}

.bulk-btn-restore:hover {
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.4);
  color: #6ee7a0;
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.15);
}

.bulk-btn-restore:active {
  background: rgba(74, 222, 128, 0.1);
}

.bulk-btn-delete {
  background: rgba(212, 60, 55, 0.08);
  border-color: rgba(212, 60, 55, 0.25);
  color: #D43C37;
}

.bulk-btn-delete:hover {
  background: rgba(212, 60, 55, 0.16);
  border-color: rgba(212, 60, 55, 0.4);
  color: #f07370;
  box-shadow: 0 4px 12px rgba(212, 60, 55, 0.15);
}

.bulk-btn-delete:active {
  background: rgba(212, 60, 55, 0.1);
}

.bulk-btn-cancel {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #888;
}

.bulk-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #bbb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.bulk-btn-cancel:active {
  background: rgba(255, 255, 255, 0.06);
}

.col-check {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.col-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #D43C37;
}

/* Update grid to include checkbox column + encryption column */
.browser-header,
.browser-row {
  grid-template-columns: 36px 1fr auto 40px 120px 150px 130px;
}

/* Tags column */
.col-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Browsable column — hidden, replaced by PUBLIC badge in col-tags */
.col-browsable {
  display: none;
}

/* Encryption column */
.col-encryption {
  display: flex;
  align-items: center;
  justify-content: center;
}

.enc-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.enc-icon-e2e {
  background: #4ade80;
  box-shadow: 0 0 4px rgba(74, 222, 128, 0.5);
}

.enc-icon-server {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

/* ==========================================
   FILE THUMBNAILS
   ========================================== */
.file-thumbnail {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #333;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-thumbnail:hover {
  border-color: #666;
  transform: scale(1.15);
  transform-origin: left center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.e2e-thumb-placeholder {
  cursor: pointer;
}

/* ==========================================
   PREVIEW BUTTON
   ========================================== */
.preview-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  margin-left: 4px;
  flex-shrink: 0;
}

.browser-row:hover .preview-btn {
  opacity: 0.7;
}

.preview-btn:hover {
  opacity: 1 !important;
}

/* ==========================================
   PREVIEW MODAL
   ========================================== */
.preview-modal {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px) saturate(0.5);
  -webkit-backdrop-filter: blur(14px) saturate(0.5);
  flex-direction: column;
}

.preview-modal.preview-visible {
  display: flex;
  animation: previewFadeIn 0.2s ease forwards;
}

@keyframes previewFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.preview-modal.preview-hiding {
  animation: previewFadeOut 0.15s ease forwards;
}

@keyframes previewFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Close button - top right floating */
.preview-resolution {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  display: none;
  align-items: center;
  padding: 0 12px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #aaa;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.preview-resolution.visible {
  display: flex;
}

.preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #aaa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preview-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Stage - the main content area, fills available space */
.preview-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 0;
  overflow: auto;
  padding: 56px 24px 16px 24px;
}

/* Bottom bar - filename and actions */
.preview-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.preview-bar-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
  display: flex;
  min-width: 0;
}

.preview-bar-name .file-name-base {
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.preview-bar-name .file-name-ext {
  flex-shrink: 0;
  color: #888;
}

.preview-bar-download {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  text-decoration: none;
}

.preview-bar-download:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Image preview - fills as much space as possible */
.preview-image {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 6px;
  animation: previewImgIn 0.25s ease forwards;
}

@keyframes previewImgIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* Video preview */
.preview-video {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  border-radius: 6px;
}

/* Audio preview */
.preview-audio-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 40px;
}

.preview-audio-icon {
  font-size: 80px;
  opacity: 0.7;
}

.preview-audio {
  width: 100%;
  max-width: 500px;
  filter: invert(1) hue-rotate(180deg);
}

/* PDF preview */
.preview-pdf {
  width: 90vw;
  height: calc(100vh - 140px);
  border: none;
  border-radius: 6px;
}

/* Text preview */
.preview-text {
  width: 90vw;
  max-width: 900px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  background: rgba(15, 15, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #d4d4d4;
  padding: 24px;
  border-radius: 8px;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  box-shadow: none;
}

/* Loading spinner */
.preview-loading {
  color: #555;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
}

.preview-loading::after {
  content: '';
  display: block;
  width: 28px;
  height: 28px;
  margin: 16px auto 0;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: rgba(255,255,255,0.3);
  border-radius: 50%;
  animation: previewSpin 0.7s linear infinite;
}

@keyframes previewSpin {
  to { transform: rotate(360deg); }
}

/* Error */
.preview-error {
  color: #D43C37;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ==========================================
   TRASH VIEW
   ========================================== */
.trash-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #D43C37;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
}

.sidebar-trash-item {
  border-top: 1px solid #222;
  padding: 0;
  flex-shrink: 0;
}

.sidebar-trash-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: #888;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-trash-link:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #e0e0e0;
}

.sidebar-trash-link.active {
  color: #e0e0e0;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #e0e0e0;
}

.sidebar-trash-icon {
  font-size: 16px;
}

.sidebar-trash-label {
  font-weight: inherit;
  letter-spacing: 0.3px;
}

.btn-restore-all,
.btn-empty-trash {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-restore-all svg,
.btn-empty-trash svg {
  opacity: 0.75;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.btn-restore-all:hover svg,
.btn-empty-trash:hover svg {
  opacity: 1;
}

.btn-restore-all:active,
.btn-empty-trash:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-restore-all {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e0e0e0;
}

.btn-restore-all:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-empty-trash {
  background: rgba(212, 60, 55, 0.1);
  border: 1px solid rgba(212, 60, 55, 0.25);
  color: #E0635F;
}

.btn-empty-trash:hover {
  background: rgba(212, 60, 55, 0.18);
  border-color: rgba(212, 60, 55, 0.4);
  color: #f07370;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 60, 55, 0.2);
}

.btn-empty-trash:active {
  background: rgba(212, 60, 55, 0.12);
}

.restore-file-btn,
.permanent-delete-btn {
  cursor: pointer;
  background: rgba(30, 30, 30, 0.8);
  border: none;
  font-size: 16px;
  transition: all 0.2s ease;
}

.restore-file-btn:hover {
  background: rgba(74, 222, 128, 0.2);
  transform: scale(1.1);
}

.permanent-delete-btn:hover {
  background: rgba(212, 60, 55, 0.2);
  transform: scale(1.1);
}

.trash-row {
  opacity: 0.85;
}

.trash-row:hover {
  opacity: 1;
}

.trash-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  white-space: nowrap;
}

.trash-countdown svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.trash-countdown-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 0 6px 6px;
  transition: width 0.3s ease;
}

.trash-countdown-time {
  font-variant-numeric: tabular-nums;
}

.trash-countdown.countdown-overdue {
  color: rgb(255, 80, 80);
  background: rgba(255, 80, 80, 0.1);
  border-color: rgba(255, 80, 80, 0.25);
  animation: overduePulse 2s ease-in-out infinite;
}

.trash-countdown.countdown-overdue .trash-countdown-bar {
  background: rgb(255, 80, 80);
  width: 100%;
}

@keyframes overduePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Rename button styling */
.rename-file-btn,
.rename-folder-btn {
  cursor: pointer;
  background: rgba(30, 30, 30, 0.8);
  border: none;
  outline: none;
  font-size: 16px;
  padding: 4px;
  color: #e0e0e0;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.rename-file-btn:hover,
.rename-folder-btn:hover {
  background: rgba(212, 60, 55, 0.2);
  color: #D43C37;
  transform: scale(1.1);
}

/* ==========================================
   BULK MOVE MODAL
   ========================================== */
.modal-move {
  min-width: 420px;
  max-width: 520px;
}

.move-folder-tree {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px 0;
}

.move-tree-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
  color: #b0b0b0;
  font-size: 13px;
  transition: background 0.2s ease;
  user-select: none;
  position: relative;
}

.move-tree-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #e0e0e0;
}

.move-tree-item.selected {
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  border-left: 3px solid #e0e0e0;
}

.move-tree-item.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.move-tree-toggle {
  background: none;
  border: none;
  color: #888;
  font-size: 12px;
  padding: 4px;
  cursor: pointer;
  margin-right: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.move-tree-toggle:hover {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.05);
}

.move-tree-toggle.no-children {
  visibility: hidden;
}

.move-tree-spacer {
  width: 20px;
  height: 20px;
  margin-right: 4px;
  flex-shrink: 0;
  display: inline-block;
}

.move-tree-icon {
  font-size: 14px;
  margin-right: 8px;
  flex-shrink: 0;
}

.move-tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.move-tree-children {
  padding-left: 0;
}

.move-tree-children.collapsed {
  display: none;
}

.move-tree-children > .move-tree-item {
  padding-left: 32px;
}

.move-tree-children .move-tree-children > .move-tree-item {
  padding-left: 52px;
}

.move-tree-children .move-tree-children .move-tree-children > .move-tree-item {
  padding-left: 72px;
}

.move-tree-children .move-tree-children .move-tree-children .move-tree-children > .move-tree-item {
  padding-left: 92px;
}

.move-tree-children .move-tree-children .move-tree-children .move-tree-children .move-tree-children > .move-tree-item {
  padding-left: 112px;
}

.btn-primary {
  background: #DE1833;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background: #E8304A;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Responsive updates for checkbox column */
@media (max-width: 768px) {
  .browser-header,
  .browser-row {
    grid-template-columns: 36px 1fr 80px 80px;
  }
  
  .col-date,
  .col-tags,
  .col-encryption {
    display: none;
  }
  
  .search-input {
    width: 150px;
  }
  
  .search-input:focus {
    width: 200px;
  }
  
  .search-results {
    width: 300px;
  }
  
  .preview-stage {
    padding: 48px 8px 8px 8px;
  }
  .preview-bar-name {
    max-width: 70vw;
    font-size: 12px;
  }
  .preview-text {
    width: 96vw;
    padding: 16px;
    font-size: 12px;
  }
  .preview-pdf {
    width: 96vw;
  }
}

/* ==========================================
   BROWSABLE FOLDER VIEW
   Uses full dashboard layout with sidebar.
   Folder links must be re-enabled because the
   dashboard CSS disables them (pointer-events: none)
   since dashboard.js handles row clicks instead.
   ========================================== */

/* Enable folder links in browse view */
body.browse-view .folder-link {
  pointer-events: auto;
  cursor: pointer;
}

body.browse-view .folder-row {
  cursor: pointer;
}

.bulk-btn-select-all {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #e0e0e0;
}

.bulk-btn-select-all:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bulk-btn-select-all:active {
  background: rgba(255, 255, 255, 0.08);
}

.bulk-btn-download {
  background: rgba(212, 60, 55, 0.08);
  border-color: rgba(212, 60, 55, 0.25);
  color: #D43C37;
}

.bulk-btn-download:hover {
  background: rgba(212, 60, 55, 0.16);
  border-color: rgba(212, 60, 55, 0.4);
  color: #f07370;
  box-shadow: 0 4px 12px rgba(212, 60, 55, 0.15);
}

.bulk-btn-download:active {
  background: rgba(212, 60, 55, 0.1);
}

/* Browse view: show action buttons in folder rows */
body.browse-view .folder-row .col-actions {
  display: flex;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════
   Inline Manage Modal (dashboard overlay)
   ═══════════════════════════════════════════════════════════════════ */

.manage-modal {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px) saturate(0.6);
  -webkit-backdrop-filter: blur(16px) saturate(0.6);
  z-index: 2500;
  justify-content: center;
  align-items: center;
}

.manage-modal.manage-modal-visible {
  display: flex;
  animation: manageModalFadeIn 0.2s ease forwards;
}

.manage-modal.manage-modal-hiding {
  animation: manageModalFadeOut 0.15s ease forwards;
}

@keyframes manageModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes manageModalFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

.manage-modal-panel {
  position: relative;
  background: #111111;
  border: 1px solid #1e1e1e;
  border-radius: 16px;
  width: 420px;
  max-width: 92vw;
  max-height: 85vh;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: manageModalSlideIn 0.25s ease forwards;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.manage-modal-scroll {
  overflow-y: auto;
  padding: 28px 24px 20px;
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}

.manage-modal-scroll::-webkit-scrollbar {
  width: 5px;
}

.manage-modal-scroll::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 3px;
}

.manage-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  z-index: 10;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.manage-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

/* ── Header ── */

.manage-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-right: 28px;
}

.manage-modal-icon {
  font-size: 32px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}

.manage-modal-icon img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 12px;
}

.manage-modal-title-wrap {
  min-width: 0;
  flex: 1;
}

.manage-modal-name {
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e0;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.manage-modal-name .file-name-ext {
  color: #666;
  font-weight: 500;
}

.manage-modal-badges {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.manage-modal-badges .file-badge {
  font-size: 10px;
  padding: 2px 7px;
}

/* ── Detail grid ── */

.manage-modal-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid #1e1e1e;
}

.manage-modal-detail {
  background: #111111;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.manage-modal-detail-label {
  font-size: 10px;
  font-weight: 600;
  color: #555;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.manage-modal-detail-value {
  font-size: 13px;
  color: #ccc;
  font-weight: 500;
}

/* Encryption value styling with backgrounds */
.manage-modal-encryption-value {
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.03em;
  display: inline-block;
}

.manage-modal-encryption-e2e {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.manage-modal-encryption-server {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.manage-modal-encryption-mixed {
  background: rgba(245, 197, 66, 0.15);
  color: #f5c542;
  border: 1px solid rgba(245, 197, 66, 0.3);
}

/* ── Settings ── */

.manage-modal-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.manage-modal-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.manage-modal-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.manage-modal-select {
  width: 100%;
  padding: 9px 12px;
  background: #0d0d0d;
  border: 1px solid #1e1e1e;
  border-radius: 8px;
  color: #ccc;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.manage-modal-select:hover {
  border-color: #333;
}

.manage-modal-select:focus {
  border-color: #DE1833;
}

.manage-modal-select option {
  background: #111;
  color: #ccc;
}

.manage-modal-toggle-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #1a1a1a;
}

.manage-modal-toggle-text {
  min-width: 0;
  flex: 1;
}

.manage-modal-hint {
  font-size: 10px;
  color: #444;
  letter-spacing: 0.03em;
  display: block;
  margin-top: 2px;
}

/* ── Share section ── */

.manage-modal-share {
  padding-top: 2px;
}

.manage-modal-share-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.manage-modal-share-input {
  flex: 1;
  padding: 8px 10px;
  background: #0d0d0d;
  border: 1px solid #1e1e1e;
  border-radius: 6px;
  color: #888;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  min-width: 0;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.manage-modal-share-copy {
  padding: 8px 14px;
  background: #1a1a1a;
  border: 1px solid #1e1e1e;
  border-radius: 6px;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.manage-modal-share-copy:hover {
  background: #222;
  color: #ccc;
  border-color: #333;
}

.manage-modal-regenerate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #777;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  justify-content: center;
  font-family: inherit;
}

.manage-modal-regenerate-btn:hover {
  background: #1a1a1a;
  color: #ccc;
  border-color: #333;
}

.manage-modal-regenerate-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.manage-modal-regenerate-working {
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.3);
}

.manage-modal-regenerate-success {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
}

/* ── Wget Command ── */

.manage-modal-wget {
  padding-top: 4px;
}

.manage-modal-wget-input {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Courier New', monospace;
  font-size: 10px;
  color: #6a9955;
  letter-spacing: 0.02em;
}

/* ── Actions ── */

.manage-modal-actions {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid #1a1a1a;
}

.manage-modal-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: 1px solid transparent;
  text-align: center;
}

.manage-modal-btn svg {
  flex-shrink: 0;
}

.manage-modal-btn-download {
  background: rgba(96, 165, 250, 0.08);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.15);
}

.manage-modal-btn-download:hover {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.25);
  color: #60a5fa;
}

.manage-modal-btn-delete {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.15);
}

.manage-modal-btn-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}



/* ── Loading state ── */

.manage-modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: #555;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.manage-modal-loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid #333;
  border-top-color: #DE1833;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 10px;
}

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

/* ── Inline toggle spinner ── */
.toggle-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid #333;
  border-top-color: #DE1833;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 5px;
}

/* ── Responsive ── */

@media (max-width: 480px) {
  .manage-modal-panel {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
  }

  .manage-modal {
    align-items: flex-end;
  }

  .manage-modal-scroll {
    padding: 24px 18px 16px;
  }

  .manage-modal-actions {
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   View Toggle Buttons
   ═══════════════════════════════════════════════════════════════════════ */

.view-toggle {
  display: inline-flex;
  align-items: center;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  margin-left: 8px;
  flex-shrink: 0;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.view-toggle-btn:hover {
  color: #aaa;
  background: #222;
}

.view-toggle-btn.active {
  color: #fff;
  background: #DE1833;
}

.view-toggle-btn svg {
  width: 15px;
  height: 15px;
}

/* ═══════════════════════════════════════════════════════════════════════
   Tile / Grid View (MEGA.nz style)
   ═══════════════════════════════════════════════════════════════════════ */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px 20px;
}

.tile-item {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}

.tile-item:hover {
  border-color: #333;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.tile-item:hover .tile-actions {
  opacity: 1;
}

.tile-item.drop-target {
  border-color: #DE1833;
  box-shadow: 0 0 12px rgba(222, 24, 51, 0.3);
}

/* ── Tile Checkbox ── */

.tile-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tile-item:hover .tile-checkbox,
.tile-checkbox:has(input:checked) {
  opacity: 1;
}

.tile-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #DE1833;
}

/* ── Tile selected state (bulk mode) ── */

.tile-item.tile-selected {
  border-color: #DE1833;
  box-shadow: 0 0 8px rgba(222, 24, 51, 0.2);
}

.tile-item.tile-selected .tile-checkbox {
  opacity: 1;
}

/* Show all tile checkboxes when bulk mode is active */
.tile-grid.bulk-mode-active .tile-checkbox {
  opacity: 1;
}

/* ── Tile Thumbnail Area ── */

.tile-thumb {
  position: relative;
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d0d;
  overflow: hidden;
  flex-shrink: 0;
}

.tile-thumb-folder {
  background: #0f1114;
}

.tile-folder-icon {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.tile-thumb-icon {
  font-size: 42px;
  line-height: 1;
  opacity: 0.8;
}

.tile-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-thumb-has-img {
  background: #080808;
}

.tile-thumb-image .tile-thumb-img,
.tile-thumb-video .tile-thumb-img {
  object-fit: cover;
}

/* ── Tile Link (folder navigation) ── */

.tile-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-height: 0;
}

.tile-link .tile-thumb {
  flex-shrink: 0;
}

/* ── Tile Info Area ── */

.tile-info {
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
}

.tile-name {
  font-size: 0.82em;
  font-weight: 600;
  color: #e0e0e0;
  overflow: hidden;
  letter-spacing: 0.01em;
  line-height: 1.3;
  min-width: 0;
}

.tile-name .file-name-text {
  display: flex;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-name .file-name-base {
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.tile-name .file-name-ext {
  flex-shrink: 0;
  color: #888;
}

.tile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72em;
  color: #666;
  letter-spacing: 0.02em;
}

.tile-meta .enc-icon {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
}

.tile-size {
  white-space: nowrap;
}

/* ── Tile Thumbnail Badges (bottom-left overlay) ── */

.tile-thumb-badges {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 2;
  max-width: calc(100% - 12px);
}

.tile-thumb-badges .file-badge {
  font-size: 0.65em;
  padding: 2px 6px;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(4px);
  border-radius: 4px;
}

.tile-thumb-badges .trash-countdown {
  font-size: 0.72em;
  padding: 2px 7px;
  backdrop-filter: blur(4px);
  border-radius: 4px;
}

/* ── Tile Actions Overlay ── */

.tile-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 3;
}

.tile-actions .action-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid #333;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.tile-actions .action-btn svg {
  width: 14px;
  height: 14px;
}

.tile-actions .action-btn:hover {
  border-color: #555;
  background: rgba(30, 30, 30, 0.95);
}

/* ── Trash Tile ── */

.trash-tile {
  opacity: 0.85;
}

.trash-tile:hover {
  opacity: 1;
}

.trash-tile .tile-thumb-badges .trash-countdown {
  font-size: 0.72em;
  padding: 2px 7px;
}

/* ── Tile Grid Responsive ── */

@media (max-width: 800px) {
  .tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 14px 16px;
  }

  .tile-thumb {
    height: 120px;
  }
}

@media (max-width: 480px) {
  .tile-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px 12px;
  }

  .tile-thumb {
    height: 100px;
  }

  .tile-info {
    padding: 8px 10px 6px;
  }

  .tile-name {
    font-size: 0.76em;
  }

  .view-toggle {
    margin-left: 4px;
  }
}

@media (max-width: 768px) {
  .view-toggle {
    margin-left: 6px;
  }
}
