:root {
  --bg: #f4f6f8;
  --sidebar: #111827;
  --sidebar-muted: #9ca3af;
  --panel: #ffffff;
  --text: #1e242c;
  --muted: #687385;
  --line: #dfe3ea;
  --accent: #1769aa;
  --accent-dark: #0f4f82;
  --ok: #0f766e;
  --ok-bg: #e6fffb;
  --warn: #8a4b00;
  --warn-bg: #fff4dc;
  --pending: #6d4aff;
  --pending-bg: #f1edff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

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

.sidebar {
  background: var(--sidebar);
  bottom: 0;
  color: #fff;
  left: 0;
  padding: 22px 18px;
  position: fixed;
  top: 0;
  width: 245px;
}

.brand {
  color: #fff;
  display: block;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.language-switcher {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 24px;
}

.language-switcher button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #d8dee8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

.language-switcher button.active {
  background: #fff;
  color: var(--sidebar);
}

.side-nav,
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-nav a,
.sidebar-section a {
  border-radius: 6px;
  color: #d8dee8;
  padding: 9px 10px;
}

.side-nav a:hover,
.sidebar-section a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-section {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 18px;
  padding-top: 18px;
}

.sidebar-section span {
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 700;
  margin: 0 10px 4px;
  text-transform: uppercase;
}

.sidebar-account {
  bottom: 22px;
  left: 18px;
  position: absolute;
  right: 18px;
}

.sidebar-account strong {
  color: #fff;
  display: block;
  font-size: 14px;
  margin: 6px 10px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-account form {
  margin: 0;
}

.sidebar-account button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #d8dee8;
  cursor: pointer;
  font: inherit;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}

.sidebar-account button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.page {
  margin-left: 245px;
  max-width: 1440px;
  padding: 28px;
}

.auth-body {
  background:
    radial-gradient(circle at 20% 20%, rgba(23, 105, 170, 0.16), transparent 28%),
    linear-gradient(135deg, #eef4fb 0%, #f7f8fb 42%, #edf7f5 100%);
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  min-height: 100vh;
}

.auth-panel {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 48px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 227, 234, 0.9);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.12);
  max-width: 460px;
  padding: 34px;
  width: 100%;
}

.auth-brand {
  color: var(--accent);
  display: block;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.auth-card h1 {
  font-size: 32px;
  line-height: 1.1;
  margin: 0 0 10px;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 24px;
}

.auth-card .field {
  margin-bottom: 16px;
}

.auth-card input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  padding: 13px 14px;
  width: 100%;
}

.auth-card button[type="submit"] {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 13px 16px;
  width: 100%;
}

.auth-error {
  background: #fff2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #9f1239;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.auth-language {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.auth-language button {
  background: #eef4fb;
  border: 1px solid #d8e2ef;
  border-radius: 999px;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
  padding: 7px 12px;
}

.auth-language button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.auth-visual {
  background: #111827;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px;
}

.auth-visual h2 {
  font-size: 42px;
  line-height: 1.05;
  margin: 0;
  max-width: 620px;
}

.auth-visual p {
  color: #cbd5e1;
  line-height: 1.6;
  max-width: 560px;
}

.auth-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.auth-metrics article {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 16px;
}

.auth-metrics strong {
  display: block;
  font-size: 24px;
}

.auth-metrics span {
  color: #cbd5e1;
  display: block;
  font-size: 13px;
  margin-top: 6px;
}

.page-title {
  margin-bottom: 22px;
}

.split-title {
  align-items: flex-end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.page-title h1 {
  font-size: 28px;
  margin: 0 0 8px;
}

.page-title p {
  color: var(--muted);
  margin: 0;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 24px;
}

.metric-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric-grid small {
  color: var(--muted);
  display: block;
  line-height: 1.35;
  margin-top: 8px;
}

.metric-ok {
  border-color: #99f6e4 !important;
}

.metric-warn {
  border-color: #f0c36d !important;
}

.metric-grid article,
.panel,
.form-panel,
.warning,
.messages,
.toolbar-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-grid article {
  padding: 18px;
}

.metric-grid strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.metric-grid span {
  color: var(--muted);
  display: block;
  margin-top: 8px;
}

.media-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 22px;
}

.media-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: space-between;
  min-height: 230px;
  padding: 20px;
}

.media-card h2 {
  font-size: 22px;
  margin: 14px 0 8px;
}

.media-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.media-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.media-stats div {
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.media-stats dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 6px;
}

.media-stats dd {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
}

.endpoint-list {
  display: grid;
  gap: 10px;
}

.endpoint-list a {
  align-items: center;
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 13px 14px;
}

.endpoint-list span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.panel,
.form-panel,
.warning,
.messages,
.toolbar-panel {
  margin-bottom: 20px;
  padding: 20px;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading span {
  color: var(--muted);
}

.tabbar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding: 8px;
}

.tabbar a {
  border-radius: 6px;
  color: var(--text);
  font-weight: 650;
  padding: 9px 12px;
}

.tabbar a:hover {
  background: #eef2f7;
}

.filter-grid {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(150px, 1fr)) auto;
}

.filter-grid label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 650;
  gap: 6px;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.warning {
  background: var(--warn-bg);
  border-color: #f0c36d;
  color: var(--warn);
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.content-table td {
  vertical-align: middle;
}

.strong-link {
  color: var(--text);
  display: inline-block;
  font-weight: 700;
}

.muted-line {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.status {
  background: #eef3f8;
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  padding: 5px 9px;
}

.form-panel p {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 10px 14px;
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
  color: #fff;
}

.button-link {
  background: var(--accent);
  border-radius: 6px;
  color: #fff;
  display: inline-block;
  font-weight: 650;
  padding: 10px 14px;
}

.button-link.secondary {
  background: #536173;
}

.button-link.ghost {
  background: #eef2f7;
  color: var(--text);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.row-actions {
  white-space: nowrap;
}

.row-actions a {
  font-weight: 650;
  margin-left: 10px;
}

.pill {
  background: #eef2f7;
  border-radius: 999px;
  color: var(--muted);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  min-width: 32px;
  padding: 5px 9px;
  text-align: center;
}

.pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.pill.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.pill.pending {
  background: var(--pending-bg);
  color: var(--pending);
}

.pill.neutral {
  background: #f1f3f5;
  color: #8a94a6;
}

.asset-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.image-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 16px;
}

.image-grid figure {
  margin: 0;
}

.image-grid img {
  aspect-ratio: 16 / 9;
  background: #eef2f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.image-grid figcaption {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 18px;
  padding: 16px;
}

legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 0 8px;
}

select[multiple] {
  min-height: 180px;
}

.helptext {
  color: var(--muted);
  font-size: 13px;
}

.field-error {
  color: #b42318;
  font-size: 13px;
}

.info-panel {
  background: #f8fbff;
}

.checklist {
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .sidebar-account {
    position: static;
  }

  .page {
    margin-left: 0;
    padding: 20px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

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

  .auth-visual {
    display: none;
  }

  .auth-panel {
    padding: 24px;
  }

  .split-title {
    align-items: flex-start;
    flex-direction: column;
  }

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

  table {
    display: block;
    overflow-x: auto;
  }
}
