:root {
  --bg: #050816;
  --bg-strong: #0b1220;
  --surface: rgba(10, 15, 27, 0.88);
  --surface-strong: rgba(14, 20, 36, 0.98);
  --stroke: rgba(148, 163, 184, 0.14);
  --text: #eef2ff;
  --muted: #94a3b8;
  --accent: #4f7cff;
  --accent-strong: #325dff;
  --highlight: #14b8a6;
  --danger: #f87171;
  --shadow: 0 28px 80px rgba(2, 6, 23, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-display: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(79, 124, 255, 0.14), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(20, 184, 166, 0.12), transparent 20%),
    linear-gradient(180deg, #040711 0%, #0a1120 48%, #050816 100%);
  color: var(--text);
  font-family: var(--font-body);
}

.background-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.background-layer-one {
  background:
    radial-gradient(circle at 80% 80%, rgba(79, 124, 255, 0.12), transparent 22%),
    radial-gradient(circle at 15% 78%, rgba(20, 184, 166, 0.1), transparent 18%);
}

.background-layer-two {
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 85%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

#app {
  min-height: 100vh;
}

.shell {
  width: min(1280px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
  padding: 18px 22px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 999px;
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(2, 6, 23, 0.22);
}

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

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.brand small {
  color: var(--muted);
}

.brand-glyph {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.24), rgba(20, 184, 166, 0.12));
  color: #f8fafc;
  font-family: var(--font-display);
  font-size: 1.5rem;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.24);
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.topnav a,
.primary-link {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  transition: 180ms ease;
}

.topnav a.active,
.topnav a:hover,
.primary-link:hover {
  background: rgba(79, 124, 255, 0.14);
  color: #ffffff;
}

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

.mini-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-user img,
.profile-identity img,
.admin-user-card img {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.mini-user strong {
  display: block;
}

.mini-user small {
  color: var(--muted);
}

.page {
  display: grid;
  gap: 28px;
}

.hero-grid,
.upload-layout,
.admin-user-layout,
.admin-dashboard {
  display: grid;
  gap: 24px;
}

.hero-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.upload-layout,
.admin-user-layout {
  grid-template-columns: 1.1fr 0.9fr;
}

.upload-layout-focused {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.admin-dashboard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-panel,
.panel,
.upload-stage,
.config-card,
.login-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--stroke);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-panel,
.panel,
.config-card,
.login-card {
  padding: 30px;
}

.upload-stage {
  min-height: 460px;
  padding: 36px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  border-style: dashed;
  background:
    radial-gradient(circle at top, rgba(79, 124, 255, 0.1), transparent 36%),
    linear-gradient(180deg, rgba(9, 14, 26, 0.96), rgba(9, 14, 26, 0.84));
}

.upload-stage.dragging,
.upload-stage.has-file {
  border-color: rgba(96, 165, 250, 0.32);
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.36);
}

.drop-graphic {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  margin-bottom: 18px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.18), rgba(20, 184, 166, 0.12));
  transform: rotate(-6deg);
  box-shadow: 0 26px 50px rgba(2, 6, 23, 0.34);
}

.drop-kicker,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.73rem;
  color: var(--muted);
}

.upload-stage-title {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.98;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.8rem);
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
}

h3 {
  font-size: 1.2rem;
}

.lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.04rem;
}

.upload-stage-copy {
  max-width: 48ch;
}

.card-copy {
  margin: 10px 0 0;
  color: var(--muted);
}

.hero-actions,
.drop-actions,
.action-row,
.search-row,
.quota-row,
.progress-meta,
.panel-header,
.file-card-head,
.file-meta,
.topnav,
.field-grid,
.hero-grid,
.upload-layout,
.meta-list,
.profile-summary,
.profile-identity,
.result-card,
.stat-strip {
  align-items: center;
}

.hero-actions,
.drop-actions,
.action-row,
.search-row,
.file-meta,
.quota-row,
.progress-meta,
.panel-header,
.file-card-head,
.stat-strip,
.topnav {
  display: flex;
}

.hero-actions,
.drop-actions,
.action-row,
.search-row,
.file-meta,
.quota-row,
.progress-meta,
.stat-strip {
  gap: 12px;
}

.action-row.wrap {
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.link-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f8fafc;
  box-shadow: 0 16px 30px rgba(50, 93, 255, 0.24);
}

.primary-button:hover,
.ghost-button:hover,
.link-row:hover {
  transform: translateY(-1px);
}

.ghost-button,
.link-row {
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
}

.ghost-button.danger {
  color: var(--danger);
}

.wide-button {
  width: 100%;
}

.accent-panel {
  display: grid;
  place-items: center;
  min-height: 100%;
  background: linear-gradient(160deg, rgba(8, 13, 24, 0.96), rgba(15, 23, 42, 0.94));
  color: #f8fafc;
}

.accent-card {
  position: relative;
  z-index: 1;
  width: min(340px, 100%);
}

.accent-label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.panel-halo {
  position: absolute;
  inset: auto auto -80px -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 128, 147, 0.48), transparent 70%);
  filter: blur(20px);
}

.flow-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
  color: rgba(255, 244, 230, 0.84);
}

.stat-strip {
  margin-top: 30px;
  flex-wrap: wrap;
}

.stat-strip div {
  min-width: 124px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.compact-strip {
  justify-content: center;
  margin-top: 12px;
}

.stat-strip strong,
.quota-row strong {
  display: block;
  font-family: var(--font-display);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field,
.checkbox-row {
  display: grid;
  gap: 8px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field input,
.field select,
.search-row input {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
}

.field-note,
.inline-error,
.loading-card,
.meta-list span,
.file-meta,
.timer-badge,
.divider span,
.status-pill,
.file-type {
  color: var(--muted);
}

.field-note,
.inline-error {
  margin: 0;
}

.inline-error {
  color: var(--danger);
}

.progress-block,
.result-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.progress-track {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.progress-track.large {
  height: 14px;
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--highlight), var(--accent));
}

.result-card,
.quota-card,
.meta-list div,
.file-card,
.admin-user-card,
.toast,
.status-pill,
.timer-badge,
.link-stack.compact .link-row,
.infinite-sentinel,
.loading-card,
.dev-auth {
  border-radius: var(--radius-md);
}

.result-card,
.quota-card,
.meta-list div,
.file-card,
.admin-user-card,
.loading-card,
.dev-auth {
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: var(--surface-strong);
}

.link-stack {
  display: grid;
  gap: 10px;
}

.link-row {
  width: 100%;
  justify-content: flex-start;
}

.center-stage {
  min-height: 60vh;
  display: grid;
  place-items: center;
}

.narrow {
  width: min(560px, 100%);
}

.profile-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
}

.profile-identity {
  display: flex;
  gap: 18px;
}

.profile-identity img {
  width: 88px;
  height: 88px;
}

.quota-card {
  min-width: min(320px, 100%);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.files-panel {
  display: grid;
  gap: 18px;
}

.file-grid,
.admin-result-grid,
.storage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.storage-card,
.storage-util {
  display: grid;
  gap: 14px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.storage-card {
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: var(--surface-strong);
  border-radius: var(--radius-md);
}

.storage-util small {
  color: var(--muted);
}

.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.file-card,
.admin-user-card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.file-action-button {
  flex: 1 1 0;
}

.admin-user-card {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.file-type,
.status-pill,
.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(148, 163, 184, 0.08);
}

.meta-list {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.meta-list div {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.timer-badge {
  width: fit-content;
}

.infinite-sentinel,
.loading-card {
  padding: 18px;
  text-align: center;
}

.search-row {
  margin-bottom: 18px;
}

.search-row input {
  flex: 1;
}

.checkbox-row {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
}

.divider {
  position: relative;
  text-align: center;
  margin: 24px 0 16px;
}

.divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgba(148, 163, 184, 0.12);
}

.divider span {
  position: relative;
  padding: 0 12px;
  background: var(--surface);
}

.dev-auth {
  padding: 18px;
}

.status-pill {
  width: fit-content;
}

.status-pill.warn {
  color: var(--accent-strong);
}

.toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  z-index: 20;
}

.toast {
  min-width: 220px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.96);
  transform: translateY(8px);
  opacity: 0;
  transition: 180ms ease;
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.32);
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.24);
  color: var(--danger);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 26px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.58);
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .hero-grid,
  .upload-layout,
  .admin-user-layout,
  .profile-summary,
  .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .file-grid,
  .admin-result-grid,
  .storage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    grid-template-columns: 1fr;
    border-radius: 28px;
  }

  .topnav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 24px, 100%);
    padding-top: 14px;
  }

  .hero-panel,
  .panel,
  .upload-stage,
  .config-card,
  .login-card {
    padding: 22px;
  }

  .file-grid,
  .admin-result-grid,
  .storage-grid,
  .field-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .profile-identity,
  .topbar-user,
  .admin-user-card {
    grid-template-columns: 1fr;
  }

  .topbar-user,
  .admin-user-card {
    align-items: flex-start;
  }
}
