@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #f4f7fb;
  --muted: rgba(244, 247, 251, .72);
  --line: rgba(255, 255, 255, .18);
  --glass: rgba(14, 20, 32, .46);
  --glass-2: rgba(255, 255, 255, .08);
  --orange: #ff8a2a;
  --shadow: 0 24px 60px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.glass-app {
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--ink);
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.bg, .bg-shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.bg {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.04);
}
.bg-shade {
  background:
    radial-gradient(900px 520px at 70% 20%, rgba(255, 138, 42, .16), transparent 55%),
    radial-gradient(800px 480px at 12% 80%, rgba(80, 120, 255, .2), transparent 50%),
    linear-gradient(180deg, rgba(7, 11, 18, .28), rgba(7, 11, 18, .62));
}

.rail {
  position: fixed;
  z-index: 5;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 999px;
  background: rgba(10, 14, 22, .42);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.rail-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .06);
  border: 1px solid transparent;
}
.rail-btn:hover, .rail-btn.is-on {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .22);
}
.rail-out:hover { background: rgba(255, 90, 90, .28); }

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 120px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.top {
  position: sticky;
  top: 14px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(10, 14, 22, .38);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
}
.brand img {
  height: 42px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .92;
}
.pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid transparent;
  font-size: .92rem;
  font-weight: 700;
}
.pill:hover, .pill.is-on {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .2);
}
.pill-out:hover { background: rgba(255, 90, 90, .25); }
.top-tools { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}
.search input::placeholder { color: rgba(255, 255, 255, .55); }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #2a1404;
  background: radial-gradient(circle at 30% 30%, #ffd19a, var(--orange));
  box-shadow: 0 8px 20px rgba(255, 138, 42, .35);
}

.sheet, .glass-card, .stat, .login-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.sheet {
  padding: 28px;
  border-radius: 32px;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.sheet-head { margin-bottom: 18px; }
.eyebrow {
  margin: 0 0 6px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 800;
  color: #ffc48a;
}
h1, h2 { margin: 0; font-weight: 800; letter-spacing: -.03em; }
h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
h2 { font-size: 1.15rem; }
.lede, .card-note, .empty-inline {
  color: var(--muted);
  line-height: 1.5;
}
.lede { max-width: 46rem; margin: 8px 0 0; }

.flash {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--line);
}
.flash-ok { background: rgba(52, 168, 112, .28); }
.flash-error { background: rgba(196, 62, 62, .34); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}
.stat {
  position: relative;
  overflow: hidden;
  min-height: 148px;
  padding: 18px;
  border-radius: 24px;
  transition: transform .25s ease;
}
.stat:hover, .photo:hover, .glass-card:hover { transform: translateY(-5px); }
.stat-blue { background: linear-gradient(155deg, rgba(59, 130, 246, .82), rgba(29, 78, 216, .55)); }
.stat-gold { background: linear-gradient(155deg, rgba(234, 179, 8, .84), rgba(180, 110, 16, .55)); }
.stat-purple { background: linear-gradient(155deg, rgba(139, 92, 246, .84), rgba(91, 33, 182, .55)); }
.stat-ico {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  margin-bottom: 14px;
}
.stat-k, .stat-s { margin: 0; font-size: .82rem; font-weight: 700; }
.stat-s { opacity: .8; }
.stat-v {
  margin: 4px 0 6px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.stat-v-sm { font-size: 1.25rem; padding-top: 8px; }

.split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 14px;
}
.glass-card {
  padding: 20px;
  border-radius: 24px;
  background: var(--glass-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform .25s ease;
}
.card-note { margin: 6px 0 16px; font-size: .92rem; }
.field { display: block; margin-bottom: 12px; }
.field span {
  display: block;
  margin-bottom: 6px;
  font-size: .82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .8);
}
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 20, .35);
  outline: none;
}
.field select option { color: #142033; }
.field input:focus, .field select:focus, .search:focus-within {
  border-color: rgba(255, 176, 92, .8);
  box-shadow: 0 0 0 3px rgba(255, 138, 42, .2);
}
.search input:focus { box-shadow: none; }
.upload, .grid-head { scroll-margin-top: 130px; }
.file-pick { display: block; margin: 4px 0 14px; cursor: pointer; }
.file-pick input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.file-pick-ui {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .05);
}
.file-pick-ui small { color: var(--muted); }
.file-pick:hover .file-pick-ui { background: rgba(255, 255, 255, .1); }

.btn-go, .btn-del {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 800;
}
.btn-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  color: #2a1404;
  background: linear-gradient(180deg, #ffc27a, var(--orange));
  box-shadow: 0 10px 24px rgba(255, 138, 42, .28);
}
.btn-go:hover { filter: brightness(1.05); }
.upload .btn-go { width: 100%; }

.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; margin-bottom: 6px; }
.bar-row b { font-weight: 800; }
.bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #f5c16c 55%, #a78bfa);
}

.grid-head { margin: 22px 0 12px; }
.grid-head .card-note { margin: 4px 0 0; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.photo {
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  transition: transform .25s ease;
}
.photo-frame { aspect-ratio: 4 / 3; background: rgba(0, 0, 0, .25); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-missing {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .9rem;
}
.photo-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
}
.photo-meta strong, .photo-meta small { display: block; }
.photo-meta strong { font-size: .95rem; }
.photo-meta small { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.btn-del {
  padding: 8px 12px;
  color: #fff;
  background: rgba(196, 62, 62, .75);
}
.btn-del:hover { background: rgba(176, 40, 40, .9); }
.empty-card { text-align: center; padding: 36px 16px; }
.empty-inline { margin: 8px 0 0; }

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(440px, 100%);
  padding: 32px 28px;
  border-radius: 32px;
  background: rgba(12, 18, 28, .5);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.brand-logo {
  height: 64px;
  width: auto;
  margin-bottom: 18px;
  filter: brightness(0) invert(1);
}
.login-card .btn-go { width: 100%; margin-top: 6px; }

.rail-btn svg, .pill svg, .search svg, .stat-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:focus-visible {
  outline: 2px solid #ffc27a;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media (max-width: 980px) {
  .rail { display: none; }
  .app { width: min(1180px, calc(100% - 28px)); }
  .top { grid-template-columns: 1fr; border-radius: 24px; }
  .pills, .top-tools { justify-content: flex-start; }
  .stats, .split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sheet { padding: 18px; border-radius: 24px; }
  .search { min-width: 0; flex: 1; }
  .stat-v { font-size: 1.7rem; }
}
