:root {
  --bg: #f0f4f8;
  --bg-accent: #ddeeff;
  --panel: #ffffff;
  --ink: #152238;
  --ink-soft: #3c4f6c;
  --brand: #0455bf;
  --brand-2: #00a58f;
  --danger: #c7273f;
  --ok: #1f8d44;
  --ring: rgba(4, 85, 191, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 8% -20%, rgba(0, 165, 143, 0.20), transparent 70%),
    radial-gradient(900px 450px at 95% 0%, rgba(4, 85, 191, 0.20), transparent 70%),
    linear-gradient(180deg, var(--bg), #eef3ff 45%, #f5f9fb);
  min-height: 100vh;
}

.container {
  width: min(1100px, calc(100% - 1.5rem));
  margin: 0 auto;
}

header.topbar {
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(21, 34, 56, 0.08);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-badge {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.7rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}

nav.menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

nav.menu a,
nav.menu button {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  background: transparent;
  padding: 0.52rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

nav.menu a:hover,
nav.menu button:hover {
  background: rgba(4, 85, 191, 0.09);
}

.user-chip {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(4, 85, 191, 0.1);
  border: 1px solid rgba(4, 85, 191, 0.2);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(21, 34, 56, 0.09);
  border-radius: 1rem;
  box-shadow: 0 18px 35px -28px rgba(14, 36, 69, 0.35);
  padding: 1.1rem;
}

main {
  padding: 1rem 0 1.8rem;
}

.hero {
  display: grid;
  gap: 1rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
}

.hero p {
  margin: 0;
  color: var(--ink-soft);
}

.flash {
  margin: 0.8rem 0;
  padding: 0.7rem 0.95rem;
  border-radius: 0.8rem;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(31, 141, 68, 0.12);
  color: var(--ok);
  border-color: rgba(31, 141, 68, 0.24);
}

.flash-error {
  background: rgba(199, 39, 63, 0.12);
  color: var(--danger);
  border-color: rgba(199, 39, 63, 0.24);
}

.grid-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

label {
  font-size: 0.93rem;
  font-weight: 700;
}

input,
select,
button,
textarea {
  font: inherit;
}

input,
select,
textarea {
  margin-top: 0.32rem;
  width: 100%;
  border-radius: 0.74rem;
  border: 1px solid #c8d3e8;
  padding: 0.68rem 0.76rem;
  background: #fcfdff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}

button.primary,
a.primary {
  background: linear-gradient(135deg, var(--brand), #0e76db);
  color: #fff;
  border: none;
  text-decoration: none;
  display: inline-block;
  padding: 0.68rem 0.92rem;
  border-radius: 0.78rem;
  font-weight: 700;
}

button.primary:hover,
a.primary:hover {
  filter: brightness(1.03);
}

button.secondary {
  background: #f2f7ff;
  border: 1px solid #c6d8f6;
  color: var(--ink);
  padding: 0.62rem 0.9rem;
  border-radius: 0.74rem;
  font-weight: 700;
}

button.danger {
  background: #fff4f4;
  border: 1px solid #f3c8cf;
  color: var(--danger);
  padding: 0.48rem 0.72rem;
  border-radius: 0.6rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

th,
td {
  text-align: left;
  padding: 0.58rem;
  border-bottom: 1px solid #ebeff6;
}

th {
  color: var(--ink-soft);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.folder-list,
.media-list {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.media-item img,
.media-item video {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 0.78rem;
  border: 1px solid #d6dff0;
  background: #000;
}

.small {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.capture-actions {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 0.8rem;
}

.preview-wrap {
  border: 1px solid #dce7f9;
  background: #f8fbff;
  border-radius: 0.9rem;
  padding: 0.8rem;
  margin-top: 0.5rem;
}

.preview-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.preview-item {
  border: 1px solid #d7e2f5;
  background: #fff;
  border-radius: 0.8rem;
  padding: 0.5rem;
}

.preview-item img,
.preview-item video {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 0.6rem;
  background: #000;
}

.password-meter {
  margin-top: 0.45rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #e4e9f4;
  overflow: hidden;
}

.password-meter > span {
  display: block;
  height: 100%;
  width: 0;
  background: #ee6e27;
  transition: width 220ms ease;
}

@media (max-width: 800px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.7rem 0;
  }

  nav.menu {
    width: 100%;
  }

  nav.menu a,
  nav.menu button {
    flex: 1 1 auto;
    text-align: center;
  }

  .media-item img,
  .media-item video {
    height: 145px;
  }

  .preview-item img,
  .preview-item video {
    height: 120px;
  }
}
