:root {
  --navy: #070138;
  --orange: #ffa92c;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f1f7;
  --text: #0e1030;
  --muted: #666b8a;
  --border: #e2e4ef;
  --danger: #c02b2b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(7, 1, 56, 0.06), 0 8px 24px rgba(7, 1, 56, 0.06);
}

:root[data-theme='dark'] {
  --bg: #050a1e;
  --surface: #0c1430;
  --surface-2: #121b3c;
  --text: #eef1fa;
  --muted: #9aa2c4;
  --border: #1e2850;
  --danger: #ff7a7a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 16px; }

.topbar { background: var(--navy); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.logo svg { width: 22px; height: 22px; color: var(--orange); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

main.wrap { padding-top: 28px; padding-bottom: 64px; }

h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 16px; margin: 0; letter-spacing: -0.01em; }
.meta { color: var(--muted); font-size: 13px; margin: 0; }
.hidden { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login { max-width: 380px; margin: 48px auto; }
.login form { margin-top: 18px; display: grid; gap: 10px; }

input[type='password'], select {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
input[type='password']:focus, select:focus { border-color: var(--orange); }
select { width: auto; padding: 8px 11px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 550;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  transition: filter 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(0.97); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--orange); color: #241500; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: inherit; border-color: rgba(255, 255, 255, 0.22); }
.topbar .btn.ghost:hover { background: rgba(255, 255, 255, 0.1); filter: none; }
.btn.icon-only { padding: 8px; }
.btn.icon-only svg { width: 18px; height: 18px; }
.btn.small { padding: 7px 11px; font-size: 13px; }
.btn.danger { color: var(--danger); background: transparent; }
.btn.danger:hover { background: rgba(192, 43, 43, 0.1); filter: none; }

.error { color: var(--danger); font-size: 13px; margin: 12px 0 0; }

.dropzone {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.over {
  border-color: var(--orange);
  background: var(--surface-2);
  outline: none;
}
.dz-icon { width: 34px; height: 34px; color: var(--orange); }
.dz-title { font-weight: 550; margin: 10px 0 4px; }

.row { display: flex; align-items: center; gap: 10px; }
.expiry-row { margin: 16px 0 4px; }
.expiry-row label { font-size: 13px; color: var(--muted); }

.progress-list, .file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.progress-list { margin-top: 16px; }
.progress-list:empty { margin-top: 0; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }

.item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.item-main { min-width: 0; flex: 1; }
.item-name {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.bar { height: 5px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; width: 0; background: var(--orange); transition: width 0.2s ease; }

.empty { margin-top: 4px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

body.share {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.share-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 40px 32px;
  text-align: center;
  max-width: 440px;
  width: 100%;
}
.share-card h1 { font-size: 19px; word-break: break-word; }
.share-card .btn { margin-top: 22px; }
.share-icon svg { width: 40px; height: 40px; color: var(--orange); }
.brand { margin: 26px 0 0; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

@media (max-width: 560px) {
  .item { flex-wrap: wrap; }
  .item-actions { width: 100%; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #050a1e;
    --surface: #0c1430;
    --surface-2: #121b3c;
    --text: #eef1fa;
    --muted: #9aa2c4;
    --border: #1e2850;
    --danger: #ff7a7a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

.item.upload .item-actions { flex-shrink: 0; }
.item.upload .bar { margin-top: 10px; }
