:root {
  --sidebar-bg: #1a2744;
  --sidebar-link: #d2dde9;
  --sidebar-link-active: #f4e0ad;
  --sidebar-divider: rgba(255, 255, 255, 0.12);

  --bg: #edf1f7;
  --panel: #ffffff;
  --panel-2: #f8fafd;
  --text: #1f2f52;
  --muted: #6b7b98;
  --line: rgba(31, 47, 82, 0.14);

  --gold: #c5a55a;
  --gold-hover: #d5b772;
  --gold-500: #c5a55a;
  --gold-400: #d5b772;
  --blue: #5b7ba8;
  --blue-hover: #6d8dba;
  --text-secondary: #6b7b98;
  --green-500: #22c55e;
  --amber-500: #f59e0b;
  --red-500: #ef4444;
  --blue-500: #3b82f6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  --shadow-sm: 0 4px 16px rgba(23, 39, 68, 0.08);
  --shadow-md: 0 10px 30px rgba(23, 39, 68, 0.14);
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: linear-gradient(180deg, #f4f7fb, #edf2f8 42%, #e8eef6);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.45;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--gold-hover);
}

.nav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 252px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 18px 14px;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 30;
  overflow-y: auto;
}

.nav a {
  color: var(--sidebar-link);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition), transform 100ms ease;
  white-space: nowrap;
  text-align: left;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav a:active {
  transform: scale(0.98);
}

.nav a.active {
  background: rgba(197, 165, 90, 0.24);
  color: var(--sidebar-link-active);
}

.nav .catalog {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  color: #adbed6;
  font-size: 11px;
  padding-top: 12px;
  border-top: 1px solid var(--sidebar-divider);
}

.nav select {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 22, 41, 0.78);
  color: #e6edf8;
  padding: 7px 8px;
}

main {
  margin: 0 0 0 252px;
  padding: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.status {
  color: var(--muted);
}

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

button {
  border: none;
  border-radius: var(--radius-md);
  background: var(--gold);
  color: #1c2b49;
  cursor: pointer;
  padding: 8px 12px;
  font-weight: 700;
  transition: transform var(--transition), opacity var(--transition), background var(--transition);
}

button:hover:not(:disabled) {
  background: var(--gold-hover);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

:focus-visible {
  outline: 2px solid rgba(197, 165, 90, 0.55);
  outline-offset: 2px;
}

button.secondary {
  background: var(--blue);
  color: #fff;
}

button.secondary:hover:not(:disabled) {
  background: var(--blue-hover);
}

button.ghost {
  background: transparent;
  border: 1px solid rgba(31, 47, 82, 0.3);
  color: var(--text);
}

input,
select,
textarea {
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 47, 82, 0.24);
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(197, 165, 90, 0.45);
  outline-offset: 1px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(31, 47, 82, 0.1);
}

.metric {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
}

.metric strong {
  color: var(--gold);
}

.bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(31, 47, 82, 0.16);
}

.fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-hover));
  transition: width 220ms ease;
}

.hide {
  display: none !important;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(31, 47, 82, 0.08);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: skeleton-shimmer 1.4s infinite;
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.empty-state {
  border: 1px dashed rgba(31, 47, 82, 0.24);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--muted);
  background: #f5f8fc;
}

.error-text {
  color: #b91c1c;
}

.u-mt-6 {
  margin-top: 6px;
}

.u-mt-8 {
  margin-top: 8px;
}

.u-mt-10 {
  margin-top: 10px;
}

.u-mt-12 {
  margin-top: 12px;
}

.u-mb-4 {
  margin-bottom: 4px;
}

.u-mb-6 {
  margin-bottom: 6px;
}

@media (max-width: 980px) {
  .nav {
    position: static;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    background: #1a2744;
  }

  .nav .catalog {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
    margin-left: auto;
  }

  main {
    margin-left: 0;
  }
}

/* DESIGN LOCK: enforce the new sidebar-first UX on every page, even if page CSS is legacy. */
:root {
  --bg: #edf1f7 !important;
  --panel: #ffffff !important;
  --panel-2: #f8fafd !important;
  --text: #1f2f52 !important;
  --muted: #6b7b98 !important;
  --line: rgba(31, 47, 82, 0.14) !important;
  --gold: #c5a55a !important;
  --gold-hover: #d5b772 !important;
  --gold-500: #c5a55a !important;
  --gold-400: #d5b772 !important;
  --text-secondary: #6b7b98 !important;
}

body {
  background: linear-gradient(180deg, #f4f7fb, #edf2f8 42%, #e8eef6) !important;
  color: var(--text) !important;
}

body .nav {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 252px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
  padding: 18px 14px !important;
  background: var(--sidebar-bg) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: none !important;
  z-index: 30 !important;
  overflow-y: auto !important;
}

body .nav a {
  color: var(--sidebar-link) !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  padding: 9px 12px !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  text-align: left !important;
}

body .nav a.active {
  background: rgba(197, 165, 90, 0.24) !important;
  color: var(--sidebar-link-active) !important;
}

body .nav .catalog {
  margin-top: auto !important;
  margin-left: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
  color: #adbed6 !important;
  font-size: 11px !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--sidebar-divider) !important;
}

body .nav .catalog select,
body .nav select {
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  background: rgba(12, 22, 41, 0.78) !important;
  color: #e6edf8 !important;
  padding: 7px 8px !important;
}

body > header,
body > main {
  margin-left: 252px !important;
}

@media (max-width: 980px) {
  body .nav {
    position: static !important;
    width: auto !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    padding: 10px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
    background: #1a2744 !important;
  }

  body .nav .catalog {
    margin-top: 0 !important;
    border-top: none !important;
    padding-top: 0 !important;
    margin-left: auto !important;
  }

  body > header,
  body > main {
    margin-left: 0 !important;
  }
}
