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

:root {
  --bg:         #080B12;
  --surface:    #0D1117;
  --surface-2:  #111820;
  --border:     #1A2332;
  --border-2:   #202D3D;
  --blue:       #1C7ED6;
  --blue-dim:   rgba(28, 126, 214, 0.12);
  --red:        #E53E3E;
  --red-dim:    rgba(229, 62, 62, 0.12);
  --text:       #E8EDF2;
  --muted:      #4A5568;
  --subtle:     #2D3748;
}

html, body {
  height: 100%;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ── topbar ──────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: rgba(8, 11, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: #0D1825;
  border: 1px solid #1A3050;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.logout-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface);
}

.logout-btn svg {
  flex-shrink: 0;
}

/* ── page layout ─────────────────────────────────────── */
.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

/* ── upload zone ─────────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed var(--border-2);
  border-radius: 14px;
  margin-bottom: 40px;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.upload-zone-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  cursor: default;
}

.upload-icon {
  width: 52px;
  height: 52px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--blue);
  flex-shrink: 0;
  transition: background 0.15s;
}

.upload-text {
  flex: 1;
}

.upload-primary {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 3px;
}

.upload-secondary {
  font-size: 12px;
  color: var(--muted);
}

.file-label {
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-label:hover {
  color: #4da3f5;
}

/* progress */
.upload-progress {
  padding: 0 28px 18px;
  display: none;
}

.upload-progress.visible {
  display: block;
}

.progress-bar-wrap {
  height: 4px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 99px;
  transition: width 0.1s linear;
}

.progress-label {
  font-size: 12px;
  color: var(--muted);
}

/* ── section header ──────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.file-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── file list ───────────────────────────────────────── */
#container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── file row ────────────────────────────────────────── */
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s;
  animation: rowIn 0.2s ease both;
}

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

.file-row:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}

/* file type icon pill */
.file-type {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.file-type.img   { background: rgba(72,187,120,0.1); color: #48BB78; border: 1px solid rgba(72,187,120,0.2); }
.file-type.vid   { background: rgba(237,100,166,0.1); color: #ED64A6; border: 1px solid rgba(237,100,166,0.2); }
.file-type.doc   { background: rgba(99,179,237,0.1); color: #63B3ED; border: 1px solid rgba(99,179,237,0.2); }
.file-type.pdf   { background: rgba(252,129,74,0.1); color: #FC814A; border: 1px solid rgba(252,129,74,0.2); }
.file-type.arc   { background: rgba(246,224,94,0.1); color: #F6E05E; border: 1px solid rgba(246,224,94,0.2); }
.file-type.code  { background: rgba(154,104,243,0.1); color: #9A68F3; border: 1px solid rgba(154,104,243,0.2); }
.file-type.other { background: rgba(74,85,104,0.15); color: var(--muted); border: 1px solid var(--border); }

/* file name */
.file-name {
  flex: 1;
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* action buttons */
.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.action-btn svg {
  flex-shrink: 0;
}

.action-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface-2);
}

.action-btn.delete:hover {
  color: var(--red);
  border-color: rgba(229,62,62,0.3);
  background: var(--red-dim);
}

/* ── empty state ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: var(--subtle);
}

.empty-state p {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-state span {
  font-size: 13px;
  color: var(--muted);
}

/* ── loading state ───────────────────────────────────── */
.loading-state {
  display: flex;
  justify-content: center;
  padding: 48px;
}

.loading-state.hidden {
  display: none;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── toast ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(229,62,62,0.3);
  color: #FC8181;
}

/* ── responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
  .upload-zone-inner { flex-direction: column; text-align: center; }
  .action-btn span   { display: none; }
  .action-btn        { padding: 7px; }
  .page              { padding: 24px 16px 60px; }
  .topbar            { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}