@font-face {
  font-family: "Rebels";
  src: url("/static/fonts/Rebels-Fett.woff2") format("woff2");
  font-display: swap;
}

:root {
  --radius: 0.625rem;
  --background: #181617;
  --foreground: #fafafa;
  --card: #181617;
  --card-foreground: #fafafa;
  --primary: #0344dc;
  --primary-foreground: #fafafa;
  --secondary: #262626;
  --secondary-foreground: #fafafa;
  --muted: #1f1f1f;
  --muted-foreground: #a1a1a1;
  --accent: rgba(250, 250, 250, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --pop: rgba(250, 250, 250, 0.025);
  --input: rgba(255, 255, 255, 0.15);
  --success: #03dc3d;
  --warning: #fe9a00;
  --destructive: #dc4003;
  --sidebar: #181617;
  --sidebar-primary: #0344dc;
  --sidebar-accent: rgba(250, 250, 250, 0.05);
  --gap: 2rem;
  --sides: 1rem;
  --header-height: 3.7rem;
  --sidebar-width: 260px;
  --font-display: "Rebels", "Roboto Mono", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  min-height: 100%;
  scrollbar-gutter: stable;
  background: var(--muted);
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-mono);
  background: var(--muted);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

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

img,
svg,
video {
  max-width: 100%;
  display: block;
}

[x-cloak] {
  display: none !important;
}

.font-display { font-family: var(--font-display); }
.text-muted { color: var(--muted-foreground); }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-4xl { font-size: 36px; }
.uppercase { text-transform: uppercase; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

.layout {
  display: grid;
  grid-template-columns: minmax(220px, var(--sidebar-width)) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: start;
  align-items: start;
  min-height: 100vh;
  gap: var(--gap);
  padding: var(--sides);
}

.header {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: var(--header-height);
  height: var(--header-height);
  max-height: var(--header-height);
  padding: 0.65rem 1.25rem;
  background: rgba(24, 22, 23, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  position: sticky;
  top: var(--sides);
  z-index: 80;
  overflow: visible;
  isolation: isolate;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 36px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(3, 68, 220, 0.05);
}

.header::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: calc(var(--radius) + 10px);
  background: radial-gradient(
    ellipse 100% 80% at 50% 50%,
    rgba(3, 68, 220, 0.14) 0%,
    rgba(3, 68, 220, 0.04) 45%,
    transparent 72%
  );
  filter: blur(18px);
  opacity: 0.9;
  pointer-events: none;
}

.header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 0 0 40px rgba(3, 68, 220, 0.1);
  pointer-events: none;
}

.header-title {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.header-title-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.header-logo {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(3, 68, 220, 0.22);
}

.header-brand-text {
  min-width: 0;
}

.header-brand:hover .app-title {
  color: var(--primary);
}

.header-title .app-subtitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-title {
  margin: 0;
}

.app-subtitle {
  margin: 0;
}

.header-search,
.creative-search {
  width: 180px;
  min-width: 180px;
}

.logout-form {
  margin: 0;
}

.header-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  margin-left: auto;
}

.creative-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  min-width: 0;
  overflow: visible;
  position: relative;
  z-index: 40;
  isolation: isolate;
}

.creative-search {
  order: -1;
  flex: 1 1 180px;
  width: auto;
  min-width: 160px;
  max-width: 260px;
}

.creative-toolbar .cv-dropdown,
.creative-toolbar .geo-dropdown {
  flex: 0 0 auto;
  max-width: 180px;
  position: relative;
}

.creative-toolbar .cv-dropdown:has(.cv-dropdown-trigger[aria-expanded="true"]) {
  z-index: 60;
}

.creative-toolbar .cv-dropdown-menu {
  z-index: 500;
}

.creative-toolbar .geo-dropdown {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
}

.creative-toolbar .cv-dropdown-trigger {
  width: 100%;
  height: 2.25rem;
  min-height: 2.25rem;
  max-height: 2.25rem;
  padding: 0 2rem 0 0.65rem;
  font-size: 12px;
  line-height: 1;
}

.creative-toolbar .input,
.creative-toolbar .btn {
  height: 2.25rem;
  flex: 0 0 auto;
}

.creative-toolbar .input {
  padding: 0 0.65rem;
  font-size: 12px;
}

.creative-toolbar .btn {
  padding: 0 0.85rem;
}

.creative-toolbar .btn-primary {
  margin-left: auto;
}

.sidebar-wrap {
  min-width: 0;
  align-self: start;
  position: sticky;
  top: calc(var(--header-height) + var(--sides) + 1rem);
  max-height: calc(100vh - var(--header-height) - var(--sides) - 2rem);
}

.app-nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.app-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.95rem 0.35rem 0.4rem;
  border-radius: 999px;
  color: var(--foreground);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s ease;
}

.app-nav-icon {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: rgba(3, 68, 220, 0.18);
  color: #8cb4ff;
  box-shadow: inset 0 0 0 1px rgba(3, 68, 220, 0.25);
}

.app-nav-icon svg {
  width: 0.72rem;
  height: 0.72rem;
  margin-left: 0.06rem;
}

.app-nav-link:hover {
  background: rgba(3, 68, 220, 0.12);
  border-color: rgba(3, 68, 220, 0.35);
  color: #fff;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 18px rgba(3, 68, 220, 0.14);
}

.app-nav-link:hover .app-nav-icon {
  background: rgba(3, 68, 220, 0.34);
  color: #fff;
}

.app-nav-link.active {
  background: linear-gradient(135deg, rgba(3, 68, 220, 0.42), rgba(3, 68, 220, 0.18));
  border-color: rgba(92, 140, 255, 0.55);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(3, 68, 220, 0.22),
    0 10px 24px rgba(3, 68, 220, 0.22);
}

.app-nav-link.active .app-nav-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.header--detail .header-title {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.header--detail .page-title {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sidebar {
  width: 100%;
  min-width: 0;
  max-height: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar);
  border: 2px solid var(--pop);
  border-radius: var(--radius);
  padding: 1rem;
}

.sidebar-top {
  flex-shrink: 0;
}

.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 0.75rem;
  padding-right: 0.15rem;
}

.sidebar-scroll::-webkit-scrollbar,
.cv-dropdown-menu::-webkit-scrollbar,
.modal::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb,
.cv-dropdown-menu::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover,
.cv-dropdown-menu::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: -10px;
  width: 20px;
  height: 100%;
  cursor: col-resize;
  z-index: 30;
  touch-action: none;
}

.sidebar-resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 56px;
  border-radius: 2px;
  background: var(--border);
  opacity: 0.55;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s, background 0.15s;
}

.sidebar-resize-handle:hover::after,
.sidebar-resize-handle:active::after {
  opacity: 1;
  background: var(--primary);
}

.main {
  min-width: 0;
  background: var(--background);
  border: 2px solid var(--pop);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.grid,
.creative-grid {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
  align-items: start;
}

.creative-grid-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0;
  padding: 3rem 1.5rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  animation: cv-fade-up 0.55s ease both;
}

.creative-grid-empty-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  background: rgba(3, 68, 220, 0.14);
  color: var(--primary);
  font-size: 0.85rem;
}

.creative-grid-empty-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.creative-grid-empty-text {
  margin: 0;
  font-size: 13px;
}

/* Creative Vault page polish */
.layout--creativevault .sidebar {
  background: rgba(24, 22, 23, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.layout--creativevault .main {
  position: relative;
  overflow: visible;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
}

.layout--creativevault .main::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(24, 22, 23, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 0;
  pointer-events: none;
}

.layout--creativevault .main > * {
  position: relative;
}

.layout--creativevault .main > .creative-toolbar {
  z-index: 40;
  isolation: isolate;
}

.layout--creativevault .main > #creative-grid {
  z-index: 1;
}

.layout--creativevault .sidebar-wrap {
  animation: cv-slide-in-left 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.layout--creativevault .cv-main {
  position: relative;
  animation: cv-fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.layout--creativevault .creative-toolbar {
  animation: cv-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.layout--creativevault #creative-grid {
  width: 100%;
  min-width: 0;
  transition: opacity 0.2s ease;
}

.layout--creativevault .cv-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  animation: cv-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.layout--creativevault .cv-page-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: 0.01em;
}

.layout--creativevault .cv-page-subtitle {
  margin: 0.3rem 0 0;
}

.layout--creativevault .cv-page-count {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b8cffd;
  background: rgba(3, 68, 220, 0.14);
  border: 1px solid rgba(3, 68, 220, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.layout--creativevault #creative-grid.htmx-swapping {
  opacity: 0.55;
}

.layout--creativevault .card-shell {
  animation: cv-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.layout--creativevault .card-shell:nth-child(1) { animation-delay: 0.08s; }
.layout--creativevault .card-shell:nth-child(2) { animation-delay: 0.12s; }
.layout--creativevault .card-shell:nth-child(3) { animation-delay: 0.16s; }
.layout--creativevault .card-shell:nth-child(4) { animation-delay: 0.2s; }
.layout--creativevault .card-shell:nth-child(5) { animation-delay: 0.24s; }
.layout--creativevault .card-shell:nth-child(6) { animation-delay: 0.28s; }
.layout--creativevault .card-shell:nth-child(7) { animation-delay: 0.3s; }
.layout--creativevault .card-shell:nth-child(8) { animation-delay: 0.32s; }
.layout--creativevault .card-shell:nth-child(9) { animation-delay: 0.34s; }
.layout--creativevault .card-shell:nth-child(10) { animation-delay: 0.36s; }
.layout--creativevault .card-shell:nth-child(11) { animation-delay: 0.38s; }
.layout--creativevault .card-shell:nth-child(12) { animation-delay: 0.4s; }

.layout--creativevault .card-shell:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.layout--creativevault .creative-toolbar .btn-primary {
  box-shadow: 0 8px 22px rgba(3, 68, 220, 0.22);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.layout--creativevault .creative-toolbar .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(3, 68, 220, 0.32);
}

.layout--creativevault .creative-grid-loading {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes cv-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cv-slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes cv-card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .layout--creativevault .sidebar-wrap,
  .layout--creativevault .cv-main,
  .layout--creativevault .cv-page-head,
  .layout--creativevault .creative-toolbar,
  .layout--creativevault .card-shell,
  .creative-grid-empty {
    animation: none !important;
  }

  .layout--creativevault .card-shell:hover {
    transform: none;
  }
}

.creative-grid-sentinel {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 1rem;
}

.creative-grid-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 12px;
  color: var(--muted-foreground);
}

.creative-grid-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: creative-grid-spin 0.7s linear infinite;
}

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

.card-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--pop);
  border-radius: var(--radius);
  padding: 6px;
  overflow: visible;
  position: relative;
  z-index: 0;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.card-shell:has(.cv-dropdown-trigger[aria-expanded="true"]) {
  z-index: 40;
}

.card-media-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-info-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-info-link:hover .card-title,
.card-media-link:hover .card-title {
  color: var(--primary);
}

.card-thumb-wrap {
  position: relative;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
}

.card-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.2) 45%, rgba(0, 0, 0, 0.62) 100%),
    rgba(3, 68, 220, 0.08);
  opacity: 0.78;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.card-thumb-wrap:hover .card-play-overlay,
.card-play-overlay:focus-visible {
  opacity: 1;
}

.card-play-icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: rgba(3, 68, 220, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  transform: scale(0.94);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-play-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  margin-left: 0.12rem;
}

.card-play-overlay:hover .card-play-icon,
.card-play-overlay:focus-visible .card-play-icon {
  transform: scale(1);
  box-shadow: 0 14px 34px rgba(3, 68, 220, 0.35);
}

.card-video-download {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.card-video-download svg {
  width: 1rem;
  height: 1rem;
}

.card-thumb-wrap:hover .card-video-download,
.card-video-download:focus-visible {
  opacity: 1;
}

.card-video-download:hover,
.card-video-download:focus-visible {
  background: rgba(3, 68, 220, 0.92);
  transform: translateY(-1px);
}

.card-video-delete {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.card-video-delete svg {
  width: 0.95rem;
  height: 0.95rem;
}

.card-thumb-wrap:hover .card-video-delete,
.card-video-delete:focus-visible {
  opacity: 1;
}

.card-video-delete:hover,
.card-video-delete:focus-visible {
  background: rgba(220, 64, 3, 0.92);
  border-color: rgba(252, 165, 165, 0.35);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .card-video-download {
    opacity: 0.88;
  }

  .card-video-delete {
    opacity: 0.88;
  }
}

.card-inner {
  min-width: 0;
  overflow: visible;
  background: var(--card);
  border-radius: calc(var(--radius) - 2px);
  padding: 12px;
}

.card-inner-stats {
  padding-top: 0;
  margin-top: -4px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  overflow: visible;
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.5rem;
  min-width: 0;
}

.card-title-row .card-info-link {
  flex: 1 1 auto;
  min-width: 0;
}

.card-title-date {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.card-meta {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.2rem;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.card-meta-tools {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
}

.card-inner h3,
.card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  transition: color 0.15s;
}

.thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  background: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  font-family: var(--font-mono);
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s, transform 0.08s;
}

.btn:hover {
  opacity: 0.92;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
.cv-dropdown-trigger:focus-visible,
.geo-flag-btn:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(3, 68, 220, 0.25);
}

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.btn-destructive {
  background: var(--destructive);
  color: #fff;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 11px;
}

.btn-icon {
  padding: 0.35rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  line-height: 0;
}

.btn-icon svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--input);
  color: var(--foreground);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.2;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(250, 250, 250, 0.38);
}

.select {
  appearance: none;
  cursor: pointer;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5' stroke='%23a1a1a1' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 14px;
}

.select:hover,
.input:hover,
.textarea:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.select:focus,
.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(3, 68, 220, 0.25);
  background-color: rgba(255, 255, 255, 0.08);
}

.select option {
  background: #1a1a1a;
  color: var(--foreground);
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

.cv-dropdown {
  position: relative;
  min-width: 0;
}

.cv-dropdown-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 2.25rem;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.cv-dropdown-trigger:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.cv-dropdown-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(3, 68, 220, 0.25);
}

.cv-dropdown-flag {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.cv-dropdown-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cv-dropdown-chevron {
  position: absolute;
  right: 0.55rem;
  width: 14px;
  height: 14px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.cv-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 120;
  max-height: 16rem;
  overflow: auto;
  overscroll-behavior: contain;
  background: #141314;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 0.35rem;
}

.cv-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.cv-dropdown-item:hover,
.cv-dropdown-item.active {
  background: rgba(3, 68, 220, 0.16);
}

.cv-dropdown-item-new { color: #60a5fa; }
.cv-dropdown-item-testing { color: #fbbf24; }
.cv-dropdown-item-winner { color: #34d399; }
.cv-dropdown-item-dead { color: #a1a1aa; }
.cv-dropdown-item-paused { color: #fb923c; }
.cv-dropdown-item-banned { color: #f87171; }

.geo-dropdown {
  width: 180px;
}

.geo-select {
  min-width: 11rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  border-radius: calc(var(--radius) - 2px);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  border: 1px solid;
  white-space: nowrap;
}

.badge-success { color: var(--success); border-color: var(--success); background: rgba(3, 220, 61, 0.1); }
.badge-warning { color: var(--warning); border-color: var(--warning); background: rgba(254, 154, 0, 0.1); }
.badge-destructive { color: var(--destructive); border-color: var(--destructive); background: rgba(220, 64, 3, 0.1); }
.badge-secondary { color: var(--secondary-foreground); border-color: var(--secondary); background: var(--secondary); }

.badge-status-new { color: #60a5fa; border-color: #3b82f6; background: rgba(59, 130, 246, 0.14); }
.badge-status-testing { color: #fbbf24; border-color: #f59e0b; background: rgba(245, 158, 11, 0.14); }
.badge-status-winner { color: #34d399; border-color: #10b981; background: rgba(16, 185, 129, 0.14); }
.badge-status-dead { color: #a1a1aa; border-color: #71717a; background: rgba(113, 113, 122, 0.18); }
.badge-status-paused { color: #fb923c; border-color: #ea580c; background: rgba(234, 88, 12, 0.14); }
.badge-status-banned { color: #f87171; border-color: #dc2626; background: rgba(220, 38, 38, 0.14); }

.status-select,
.cv-dropdown-trigger.status-select {
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s, background 0.15s;
}

.status-select.status-select-new,
.cv-dropdown-trigger.status-select-new { border-color: #3b82f6; color: #60a5fa; }

.status-select.status-select-testing,
.cv-dropdown-trigger.status-select-testing { border-color: #f59e0b; color: #fbbf24; }

.status-select.status-select-winner,
.cv-dropdown-trigger.status-select-winner { border-color: #10b981; color: #34d399; }

.status-select.status-select-dead,
.cv-dropdown-trigger.status-select-dead { border-color: #71717a; color: #a1a1aa; }

.status-select.status-select-paused,
.cv-dropdown-trigger.status-select-paused { border-color: #ea580c; color: #fb923c; }

.status-select.status-select-banned,
.cv-dropdown-trigger.status-select-banned { border-color: #dc2626; color: #f87171; }

.folder-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto min-content;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  min-width: 0;
}

.folder-row:hover,
.folder-row.active {
  background: var(--sidebar-accent);
}

.folder-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.folder-name {
  min-width: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-count {
  color: var(--muted-foreground);
  text-align: right;
  min-width: 2rem;
}

.drag-handle {
  cursor: grab;
  color: var(--muted-foreground);
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  overflow: hidden;
  background: #0f0e10;
}

.page-shell--creativevault {
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
  overflow-y: visible;
  background: #0f0e10;
}

.page-shell--creativevault .layout {
  position: relative;
  z-index: 1;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.55;
  animation: ambient-grid-pulse 8s ease-in-out infinite;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}

.ambient-orb--1 {
  width: 28rem;
  height: 28rem;
  top: -8rem;
  left: -6rem;
  background: rgba(3, 68, 220, 0.45);
  animation: ambient-float-1 14s ease-in-out infinite;
}

.ambient-orb--2 {
  width: 22rem;
  height: 22rem;
  right: -5rem;
  bottom: -6rem;
  background: rgba(3, 220, 120, 0.12);
  animation: ambient-float-2 18s ease-in-out infinite;
}

.ambient-orb--3 {
  width: 16rem;
  height: 16rem;
  top: 35%;
  right: 18%;
  background: rgba(120, 80, 255, 0.18);
  animation: ambient-float-3 12s ease-in-out infinite;
}

.login-card {
  width: 100%;
  background: rgba(24, 22, 23, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem 1.75rem 1.75rem;
  box-shadow:
    0 0 0 1px rgba(3, 68, 220, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  animation: login-card-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.75rem;
  animation: login-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.login-logo {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #1a5cff, #0344dc);
  box-shadow:
    0 0 0 2px rgba(3, 68, 220, 0.25),
    0 12px 28px rgba(3, 68, 220, 0.35);
  animation: login-logo-pulse 3s ease-in-out infinite;
}

.login-title {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.login-subtitle {
  margin: 0.35rem 0 0;
  font-size: 12px;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}

.login-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(220, 64, 3, 0.12);
  border: 1px solid rgba(220, 64, 3, 0.35);
  animation: login-shake 0.45s ease-in-out;
}

.login-form {
  gap: 1rem;
}

.login-field {
  animation: login-fade-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-field--1 { animation-delay: 0.18s; }
.login-field--2 { animation-delay: 0.28s; }
.login-field--3 { animation-delay: 0.38s; }

.login-input {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    transform 0.15s ease;
}

.login-input:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.login-input:focus {
  border-color: rgba(3, 68, 220, 0.75);
  box-shadow:
    0 0 0 3px rgba(3, 68, 220, 0.2),
    0 8px 24px rgba(3, 68, 220, 0.12);
  transform: translateY(-1px);
}

.login-submit {
  position: relative;
  overflow: hidden;
  margin-top: 0.35rem;
  min-height: 2.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 28px rgba(3, 68, 220, 0.28);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.login-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

.login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(3, 68, 220, 0.38);
}

.login-submit:hover::before {
  transform: translateX(120%);
}

.login-submit:active {
  transform: translateY(0);
}

.login-footer {
  text-align: center;
  margin: 0;
  opacity: 0;
  animation: login-fade-up 0.6s ease 0.55s forwards;
}

@keyframes login-card-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ambient-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(28px, 22px) scale(1.06); }
}

@keyframes ambient-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, -18px) scale(1.08); }
}

@keyframes ambient-float-3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-16px, 14px); }
}

@keyframes ambient-grid-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.7; }
}

@keyframes login-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(28px, 22px) scale(1.06); }
}

@keyframes login-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, -18px) scale(1.08); }
}

@keyframes login-float-3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-16px, 14px); }
}

@keyframes login-grid-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.7; }
}

@keyframes login-logo-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(3, 68, 220, 0.25),
      0 12px 28px rgba(3, 68, 220, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(3, 68, 220, 0.4),
      0 16px 36px rgba(3, 68, 220, 0.48);
  }
}

@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .login-card,
  .login-brand,
  .login-field,
  .login-footer,
  .ambient-orb,
  .ambient-grid,
  .login-logo {
    animation: none !important;
  }

  .login-footer {
    opacity: 1;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.add-modal-layer {
  margin: 0;
}

.video-modal-layer {
  z-index: 210;
}

.video-modal {
  width: min(960px, 100%);
  max-height: min(92vh, 860px);
  display: grid;
  gap: 0.85rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.video-modal-title {
  margin: 0;
  font-size: 1.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-modal-player {
  width: 100%;
  max-height: calc(92vh - 5rem);
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius) - 4px);
  background: #000;
  object-fit: contain;
}

.modal {
  width: 100%;
  max-width: 640px;
  max-height: min(90vh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.modal--add-creative {
  max-width: 680px;
}

.modal--add-creative.modal--bulk {
  max-width: 760px;
}

.add-creative-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.add-creative-title {
  margin: 0;
}

.add-creative-subtitle {
  margin: 0.35rem 0 0;
  font-size: 12px;
}

.add-creative-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.add-creative-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.add-creative-tab:hover:not(:disabled) {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.05);
}

.add-creative-tab.active {
  color: var(--foreground);
  background: rgba(3, 68, 220, 0.18);
  box-shadow: inset 0 0 0 1px rgba(3, 68, 220, 0.28);
}

.add-creative-tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.add-creative-shared {
  display: grid;
  gap: 1rem;
}

.add-creative-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

.cv-file-upload--bulk .cv-file-upload-icon {
  color: #9ec0ff;
}

.bulk-queue {
  display: grid;
  gap: 0.75rem;
}

.bulk-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bulk-queue-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.bulk-queue-clear {
  min-height: 1.85rem;
  padding: 0.3rem 0.65rem;
  font-size: 10px;
}

.bulk-queue-table {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.bulk-queue-header,
.bulk-queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.45fr) 4.75rem 5.5rem 2rem;
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
}

.bulk-queue-header {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.bulk-queue-col {
  min-width: 0;
}

.bulk-queue-col--file {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.bulk-queue-col--size,
.bulk-queue-col--status {
  justify-self: start;
}

.bulk-queue-col--action {
  justify-self: end;
}

.bulk-queue-header .bulk-queue-col {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(161, 161, 161, 0.9);
}

.bulk-queue-list {
  display: grid;
  max-height: 260px;
  overflow: auto;
  overscroll-behavior: contain;
}

.bulk-queue-row {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bulk-queue-row:last-child {
  border-bottom: 0;
}

.bulk-queue-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.bulk-queue-row--uploading {
  background: rgba(3, 68, 220, 0.08);
}

.bulk-queue-row--done {
  background: rgba(3, 220, 61, 0.05);
}

.bulk-queue-row--error {
  background: rgba(220, 64, 3, 0.07);
}

.bulk-queue-file-icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius) - 6px);
  background: rgba(3, 68, 220, 0.14);
  border: 1px solid rgba(3, 68, 220, 0.24);
  color: #93b4fd;
  font-size: 0.55rem;
  line-height: 1;
}

.bulk-queue-filename {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-queue-title-input {
  width: 100%;
  min-width: 0;
  height: 2rem;
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 11px;
}

.bulk-queue-size {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.bulk-queue-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bulk-queue-row--uploading .bulk-queue-status {
  color: #93b4fd;
  background: rgba(3, 68, 220, 0.14);
  border-color: rgba(3, 68, 220, 0.28);
}

.bulk-queue-row--done .bulk-queue-status {
  color: #6ee7a0;
  background: rgba(3, 220, 61, 0.12);
  border-color: rgba(3, 220, 61, 0.24);
}

.bulk-queue-row--error .bulk-queue-status {
  color: #fca5a5;
  background: rgba(220, 64, 3, 0.12);
  border-color: rgba(220, 64, 3, 0.28);
}

.bulk-queue-remove {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  border-radius: calc(var(--radius) - 4px);
}

.upload-progress-card--bulk {
  width: min(520px, 92vw);
}

.upload-bulk-meta {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
}

.upload-bulk-count {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--foreground);
}

.upload-bulk-current {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-bulk-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: 220px;
  overflow: auto;
}

.upload-bulk-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.45rem 0.55rem;
  align-items: start;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
}

.upload-bulk-list-item--done {
  color: #8de7b0;
}

.upload-bulk-list-item--uploading {
  color: #93b4fd;
}

.upload-bulk-list-item--error {
  color: #fca5a5;
}

.upload-bulk-list-icon {
  width: 1rem;
  text-align: center;
}

.upload-bulk-list-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-bulk-list-error {
  grid-column: 2;
  font-size: 10px;
  color: #fca5a5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirm-dialog {
  width: 100%;
  max-width: 420px;
  background: rgba(24, 22, 23, 0.98);
  border: 1px solid rgba(3, 68, 220, 0.28);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(3, 68, 220, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.confirm-dialog-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(3, 68, 220, 0.14);
  border: 1px solid rgba(3, 68, 220, 0.35);
  color: #93b4fd;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.confirm-dialog-icon-error {
  background: rgba(220, 64, 3, 0.12);
  border-color: rgba(220, 64, 3, 0.45);
  color: #fca5a5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.confirm-dialog-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--foreground);
}

.confirm-dialog-message {
  margin: 0 0 1.5rem;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.confirm-dialog-actions .btn-primary {
  box-shadow: 0 8px 20px rgba(3, 68, 220, 0.28);
}

.geo-flags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  margin-top: 0.75rem;
  padding: 0 0.25rem;
  min-height: 2.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.geo-flags::-webkit-scrollbar {
  display: none;
}

.geo-flag-btn {
  display: grid;
  place-items: center;
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: calc(var(--radius) - 2px);
  border: 2px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.geo-flag-btn:hover {
  border-color: var(--primary);
  background: rgba(3, 68, 220, 0.12);
}

.geo-flag-btn.active {
  border-color: var(--primary);
  background: rgba(3, 68, 220, 0.2);
}

.sidebar-folders-block {
  min-height: 0;
}

.geo-hint {
  margin: 0;
  padding: 0 0.25rem;
}

.geo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.geo-badge-empty {
  color: var(--muted-foreground);
}

.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.upload-progress-card {
  width: min(420px, 92vw);
  padding: 1.5rem;
  background: var(--background);
  border: 2px solid var(--pop);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.upload-progress-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  text-transform: uppercase;
}

.upload-progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0344dc, #3b82f6);
  border-radius: 999px;
  transition: width 0.15s ease;
}

.upload-progress-percent {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-display);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 180;
  max-width: min(420px, calc(100vw - 2rem));
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-row {
  display: grid;
  gap: 0.35rem;
}

.cv-file-upload {
  position: relative;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: calc(var(--radius) - 2px);
  background:
    linear-gradient(135deg, rgba(3, 68, 220, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}

.cv-file-upload:hover,
.cv-file-upload--dragover {
  border-color: rgba(3, 68, 220, 0.42);
  background:
    linear-gradient(135deg, rgba(3, 68, 220, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  box-shadow: inset 0 0 0 1px rgba(3, 68, 220, 0.12);
}

.cv-file-upload--selected {
  border-style: solid;
  border-color: rgba(3, 68, 220, 0.38);
  background:
    linear-gradient(135deg, rgba(3, 68, 220, 0.14) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.cv-file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cv-file-upload-input:focus-visible ~ .cv-file-upload-body {
  box-shadow: 0 0 0 2px rgba(3, 68, 220, 0.25);
  border-radius: calc(var(--radius) - 4px);
}

.cv-file-upload-body {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  cursor: pointer;
}

.cv-file-upload-btn {
  flex-shrink: 0;
}

.cv-file-upload-icon {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 4px);
  display: grid;
  place-items: center;
  background: rgba(3, 68, 220, 0.16);
  border: 1px solid rgba(3, 68, 220, 0.3);
  color: #93b4fd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cv-file-upload-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.cv-file-upload-text {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.cv-file-upload-title {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cv-file-upload-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.cv-file-upload-hint--ready {
  color: #7eb0ff;
}

.cv-file-upload--selected .cv-file-upload-icon {
  background: rgba(3, 220, 61, 0.12);
  border-color: rgba(3, 220, 61, 0.32);
  color: #6ee7a0;
}

.folder-field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.folder-field-row .cv-dropdown {
  flex: 1 1 auto;
  min-width: 0;
}

.folder-field-hint {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #93b4fd;
  letter-spacing: 0.02em;
}

.folder-add-btn {
  flex: 0 0 auto;
  font-size: 1.1rem;
  font-weight: 700;
}

.folder-add-btn:not(:disabled) {
  color: #93b4fd;
  border-color: rgba(3, 68, 220, 0.35);
  background: rgba(3, 68, 220, 0.12);
}

.folder-add-btn:not(:disabled):hover {
  background: rgba(3, 68, 220, 0.2);
  border-color: rgba(3, 68, 220, 0.5);
}

.folder-add-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.folder-inline-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.metrics-inline-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: start;
}

.metrics-inline-row .form-row {
  min-width: 0;
}

.metrics-inline-row .input {
  padding: 0.45rem 0.55rem;
}

.folder-create-error {
  margin: 0;
}

.label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.2rem 0.35rem;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  line-height: 1;
}

.stat-num {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border-radius: 3px;
  padding: 0 0.1rem;
  transition: background 0.12s;
}

.stat-num:hover {
  background: rgba(255, 255, 255, 0.08);
}

.stat-input {
  width: 100%;
  min-width: 0;
  padding: 0.1rem 0.2rem;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--primary);
  border-radius: 3px;
  outline: none;
}

.card-status-dropdown {
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
}

.card-status-dropdown .cv-dropdown-trigger {
  width: auto;
  min-width: 4.5rem;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 0.18rem 1.2rem 0.18rem 0.55rem;
  font-size: 11px;
  line-height: 1.2;
  border-radius: 999px;
  font-weight: 500;
  background: transparent;
}

.card-status-dropdown .cv-dropdown-label {
  text-align: center;
}

.card-status-dropdown .cv-dropdown-chevron {
  right: 0.35rem;
  width: 12px;
  height: 12px;
}

.card-status-dropdown .cv-dropdown-menu {
  min-width: 7.5rem;
  z-index: 200;
  right: 0;
  left: auto;
}

@media (max-width: 420px) {
  .card-title-row {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .card-title-date {
    width: 100%;
  }

  .card-meta-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .card-meta-tools {
    width: 100%;
    justify-content: flex-end;
  }
}

.error {
  color: var(--destructive);
  font-size: 12px;
  margin-top: 0.5rem;
}

.header--detail {
  height: auto;
  max-height: none;
  min-height: var(--header-height);
}

.header-back {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.header-back:hover {
  color: var(--primary);
}

.header--detail .header-actions {
  align-self: center;
  flex-shrink: 0;
}

.layout--home .home-main,
.layout--detail .detail-main {
  grid-column: 1 / -1;
}

.home-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.home-hero-title {
  margin: 0 0 0.35rem;
}

.home-hero-text {
  margin: 0;
  max-width: 42rem;
}

.home-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
}

.home-module-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 11rem;
  padding: 1.15rem;
  border-radius: var(--radius);
  background: var(--pop);
  border: 2px solid transparent;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.home-module-card:hover {
  border-color: rgba(3, 68, 220, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.home-module-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.home-module-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(3, 68, 220, 0.18);
  color: var(--primary);
  font-size: 0.75rem;
}

.home-module-title {
  margin: 0;
}

.home-module-text {
  margin: 0;
  flex: 1 1 auto;
}

.home-module-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.home-module-stat {
  font-size: 12px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.home-module-cta {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
}

.page-title {
  margin: 0.5rem 0 0;
}

.detail-main {
  grid-column: 1 / -1;
}

.detail-video {
  aspect-ratio: 16 / 9;
  height: auto;
}

.detail-video-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-video-download {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  transition: background 0.2s ease, transform 0.15s ease;
}

.detail-video-download svg {
  width: 1.05rem;
  height: 1.05rem;
}

.detail-video-download:hover,
.detail-video-download:focus-visible {
  background: rgba(3, 68, 220, 0.92);
  transform: translateY(-1px);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.detail-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.detail-actions {
  display: flex;
  justify-content: flex-start;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
}

.sortable-ghost {
  opacity: 0.4;
}

@media (max-width: 1200px) {
  .creative-toolbar .btn-primary {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  :root {
    --sides: 0.75rem;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .header {
    position: static;
  }

  .sidebar-wrap {
    position: static;
    max-height: none;
  }

  .sidebar {
    max-height: none;
  }

  .sidebar-resize-handle {
    display: none;
  }

  .main {
    padding: 1rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .layout {
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .header {
    padding: 0.65rem 0.85rem;
    height: var(--header-height);
    max-height: var(--header-height);
  }

  .creative-toolbar {
    gap: 0.45rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 0.15rem;
  }

  .creative-toolbar .input,
  .creative-toolbar .btn,
  .creative-toolbar .cv-dropdown-trigger {
    height: 2.1rem;
    min-height: 2.1rem;
    max-height: 2.1rem;
  }

  .bulk-queue-header,
  .bulk-queue-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 4.25rem 4.75rem 2rem;
    gap: 0.45rem;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .bulk-queue-col--status .bulk-queue-status {
    min-width: 0;
    width: 100%;
  }

  .modal--add-creative.modal--bulk {
    max-width: 100%;
  }

  .creative-search {
    flex: 1 0 140px;
    min-width: 120px;
    max-width: 200px;
  }

  .sidebar,
  .main,
  .login-card,
  .modal,
  .confirm-dialog {
    border-radius: calc(var(--radius) - 2px);
  }

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

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metrics-inline-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .confirm-dialog-actions {
    justify-content: stretch;
  }

  .confirm-dialog-actions .btn {
    flex: 1 1 auto;
  }

  .toast {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}

.system-status {
  position: relative;
  flex: 0 0 auto;
}

.system-status-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.system-status-trigger:hover,
.system-status-trigger:focus-visible {
  color: var(--text);
  border-color: rgba(3, 68, 220, 0.35);
  background: rgba(3, 68, 220, 0.08);
  box-shadow: 0 0 0 1px rgba(3, 68, 220, 0.12);
  outline: none;
}

.system-status-icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: rgba(3, 68, 220, 0.18);
  color: #8cb4ff;
  box-shadow: inset 0 0 0 1px rgba(3, 68, 220, 0.25);
}

.system-status-icon svg {
  width: 0.9rem;
  height: 0.9rem;
}

.system-status-icon-badge {
  position: absolute;
  right: -0.05rem;
  bottom: -0.05rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  border: 1.5px solid rgba(18, 17, 18, 0.95);
  background: #3ecf8e;
  box-shadow: 0 0 6px rgba(62, 207, 142, 0.45);
}

.system-status-icon--warning .system-status-icon-badge {
  background: #f5b942;
  box-shadow: 0 0 6px rgba(245, 185, 66, 0.45);
}

.system-status-icon--critical .system-status-icon-badge {
  background: #ff6b6b;
  box-shadow: 0 0 6px rgba(255, 107, 107, 0.45);
}

.system-status-trigger:hover .system-status-icon,
.system-status-trigger:focus-visible .system-status-icon {
  background: rgba(3, 68, 220, 0.28);
  color: #b8d0ff;
}

.system-status-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 120;
  width: min(17rem, calc(100vw - 2rem));
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(18, 17, 18, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(3, 68, 220, 0.08);
}

.system-status-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.system-status-head-title {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.system-status-head-meta {
  color: var(--text-muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.system-status-loading,
.system-status-error {
  margin: 0;
  font-size: 0.78rem;
}

.system-status-error {
  color: #ff8f8f;
}

.system-status-metrics {
  display: grid;
  gap: 0.7rem;
}

.system-status-metric {
  display: grid;
  gap: 0.3rem;
}

.system-status-metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.system-status-metric-head span:last-child {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.system-status-bar {
  height: 0.35rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.system-status-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(3, 68, 220, 0.85), rgba(74, 126, 255, 0.95));
  transition: width 0.35s ease;
}

.system-status-bar-fill--memory {
  background: linear-gradient(90deg, rgba(62, 207, 142, 0.85), rgba(110, 231, 168, 0.95));
}

.system-status-bar-fill--disk {
  background: linear-gradient(90deg, rgba(245, 185, 66, 0.85), rgba(255, 214, 120, 0.95));
}

.system-status-metric-sub {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.stats-panel {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  position: relative;
}

.stats-panel .stats {
  flex: 1 1 auto;
  min-width: 0;
}

.stat-item--readonly .stat-num {
  cursor: default;
}

.metric-add-btn {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(3, 68, 220, 0.12);
  color: #b8d0ff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.metric-add-btn:hover,
.metric-add-btn:focus-visible {
  background: rgba(3, 68, 220, 0.22);
  border-color: rgba(3, 68, 220, 0.4);
  outline: none;
}

.metric-add-btn--detail {
  width: auto;
  min-height: 2rem;
  padding: 0 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-add-popover,
.metric-add-panel {
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(12, 12, 13, 0.96);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.stats-panel .metric-add-popover {
  position: absolute;
  top: calc(100% - 0.15rem);
  right: 0;
  z-index: 30;
  width: min(16rem, calc(100vw - 2rem));
  margin-top: 0;
}

.metric-add-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.metric-fields--compact {
  gap: 0.45rem;
}

.metric-field {
  display: grid;
  gap: 0.25rem;
}

.metric-field-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.metric-field-input {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
}

.metric-add-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.metrics-section {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.02);
}

.metrics-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.metrics-section-title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metrics-section-subtitle {
  margin: 0.2rem 0 0;
}

.metrics-avg-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.metrics-avg-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(3, 68, 220, 0.06);
}

.metrics-avg-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.metrics-avg-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
}

.metrics-history-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metrics-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.metrics-history-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(255, 255, 255, 0.02);
}

.metrics-history-row,
.metrics-history-edit {
  padding: 0.75rem;
}

.metrics-history-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.metrics-history-date {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.metrics-history-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.metrics-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-destructive-text {
  color: #ff8f8f;
}

.btn-destructive-text:hover {
  color: #ffb3b3;
}

@media (max-width: 720px) {
  .metrics-avg-grid,
  .metric-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-history-row {
    flex-direction: column;
  }
}