:root {
  --bg: #0a0a0f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f0f0f5;
  --text-muted: #8888a0;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
  --font: 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.15), transparent),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(168, 85, 247, 0.1), transparent);
  pointer-events: none;
  z-index: 0;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.header, .container { position: relative; z-index: 1; }

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 15, 0.6);
}

.logo { display: flex; align-items: center; gap: 16px; }

.logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px var(--accent-glow);
}

.logo-icon svg { width: 26px; height: 26px; color: white; }

.logo h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.logo p { font-size: 0.85rem; color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.admin-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 999px;
  font-size: 0.875rem;
}

.admin-badge .dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.upload-section { margin-bottom: 40px; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 56px 32px;
  text-align: center;
  background: var(--surface);
  transition: all 0.25s ease;
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 40px var(--accent-glow);
}

.drop-icon {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.drop-icon svg { width: 32px; height: 32px; color: var(--accent); }

.drop-zone h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; }
.drop-zone p { color: var(--text-muted); margin-bottom: 12px; }
.hint { font-size: 0.8rem; color: var(--text-muted); opacity: 0.7; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border: none; border-radius: 10px;
  font-family: var(--font); font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: white;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--accent-glow); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--surface-hover); }

.btn-sm { padding: 8px 14px; font-size: 0.8rem; }

.btn-link {
  background: none; border: none;
  color: var(--accent); font-family: var(--font);
  font-size: inherit; cursor: pointer; text-decoration: underline;
}

.btn-link:hover { color: #818cf8; }

.upload-queue { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

.upload-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.upload-item .name { flex: 1; font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .progress-bar { flex: 0 0 120px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.upload-item .progress-fill { height: 100%; background: var(--accent); transition: width 0.2s; border-radius: 2px; }
.upload-item .status { font-size: 0.75rem; color: var(--text-muted); min-width: 48px; text-align: right; }
.upload-item.done .status { color: var(--success); }
.upload-item.error .status { color: var(--danger); }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 { font-size: 1.1rem; font-weight: 600; }

.files-list { display: flex; flex-direction: column; gap: 8px; }

.file-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background 0.2s;
}

.file-card:hover { background: var(--surface-hover); }

.file-icon {
  width: 42px; height: 42px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.file-icon svg { width: 20px; height: 20px; color: var(--accent); }

.file-info { flex: 1; min-width: 0; }
.file-info .name { font-weight: 500; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info .meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.file-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer; color: var(--text);
  transition: all 0.2s;
}

.btn-icon:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }
.btn-icon.danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,0.08); }

.empty-state, .loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: #14141c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%; max-width: 400px;
  margin: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.modal-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.modal-card > p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 24px; }

.modal-card label {
  display: block; margin-bottom: 16px;
  font-size: 0.8rem; color: var(--text-muted);
}

.modal-card input {
  display: block; width: 100%; margin-top: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font); font-size: 0.9rem;
}

.modal-card input:focus { outline: none; border-color: var(--accent); }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.error { color: var(--danger); font-size: 0.85rem; margin-top: 8px; }

.hidden { display: none !important; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px;
  background: #1e1e2a;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.875rem;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transition: opacity 0.3s;
}

.toast.hidden { opacity: 0; pointer-events: none; }

@media (max-width: 640px) {
  .header { padding: 16px; flex-direction: column; gap: 16px; align-items: flex-start; }
  .drop-zone { padding: 40px 20px; }
  .file-card { flex-wrap: wrap; }
  .file-actions { width: 100%; justify-content: flex-end; }
}
