:root {
  --navy: #061724;
  --navy-2: #132b3c;
  --red: #c9212b;
  --red-dark: #991923;
  --line: #d5dbe2;
  --panel: #ffffff;
  --text: #071321;
  --muted: #687384;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f6f8fb;
}

body.is-authenticated {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  background: var(--navy);
  color: #ffffff;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.logo-shell {
  background: #ffffff;
  border-radius: 4px;
  padding: 14px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.logo-shell img,
.auth-logo {
  display: block;
  width: 100%;
  height: auto;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.nav-footer-button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #d7e0e7;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-item span:first-child {
  flex: 0 0 20px;
  width: 20px;
  color: #aab8c3;
}

.nav-item span:not(:first-child) {
  flex: 1;
  min-width: 0;
  width: auto;
}

.nav-item:hover,
.nav-footer-button:hover,
.nav-item.is-active {
  background: var(--navy-2);
  color: #ffffff;
}

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

.sidebar-footer p {
  color: #aab8c3;
  overflow-wrap: anywhere;
}

.main-panel {
  min-width: 0;
  padding: 0 28px 36px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 28px;
  padding: 32px;
}

.auth-logo {
  width: min(420px, 82vw);
  margin: 0 auto;
}

.auth-card,
.placeholder-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-width: 0;
}

.auth-card {
  width: min(520px, 88vw);
  padding: 20px;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.topbar > div:first-child {
  min-width: 240px;
}

.topbar h1,
.section-heading h2,
.auth-card h1 {
  margin: 0;
}

.topbar h1 {
  font-size: 1.8rem;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar-actions {
  justify-content: flex-end;
  flex: 1 1 360px;
  min-width: 0;
}

.topbar-actions span {
  overflow-wrap: anywhere;
}

.workspace-section {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.section-heading {
  margin-bottom: 16px;
}

.placeholder-card {
  min-height: min(460px, 52vh);
  display: grid;
  place-items: center;
  padding: 32px;
}

.placeholder-card img {
  display: block;
  width: min(360px, 76vw);
  height: auto;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c8ced6;
  border-radius: 3px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
}

select {
  min-height: 36px;
  border: 1px solid #c8ced6;
  border-radius: 3px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 6px 10px;
}

.language-row {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.language-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-control span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.language-select {
  width: auto;
}

button {
  background: var(--red);
  border: 1px solid var(--red);
  padding: 9px 14px;
  border-radius: 3px;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

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

.auth-card button {
  margin-top: 16px;
}

.status {
  min-height: 20px;
  color: var(--muted);
}

@media (max-width: 1180px) and (min-width: 721px) {
  body.is-authenticated {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .sidebar {
    align-items: center;
    padding: 16px 12px;
    gap: 18px;
  }

  .logo-shell {
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
  }

  .logo-shell img {
    width: 48px;
    height: 40px;
    max-width: none;
    object-fit: cover;
    object-position: left center;
  }

  nav {
    width: 100%;
    gap: 8px;
  }

  .nav-item,
  .nav-footer-button {
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px;
  }

  .nav-item {
    font-size: 0;
    gap: 0;
  }

  .nav-item span:first-child {
    width: auto;
    font-size: 1rem;
    font-weight: 800;
  }

  .nav-item span:not(:first-child) {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .main-panel {
    padding: 0 22px 32px;
  }

  .topbar {
    min-height: auto;
    align-items: flex-start;
    padding: 18px 0;
  }

  .topbar-actions {
    flex-basis: 100%;
    justify-content: space-between;
    width: 100%;
  }
}

@media (max-width: 720px) {
  body.is-authenticated {
    display: block;
  }

  .sidebar {
    min-height: auto;
    padding: 10px 12px;
    gap: 10px;
  }

  .logo-shell {
    height: 44px;
    padding: 8px 10px;
  }

  .logo-shell img {
    width: min(220px, 100%);
    max-height: 32px;
    object-fit: contain;
    object-position: left center;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-item {
    justify-content: center;
    min-height: 44px;
    padding: 8px 6px;
    text-align: center;
    font-size: 0.82rem;
  }

  .nav-item span:first-child {
    width: auto;
  }

  .nav-item span:not(:first-child) {
    flex: initial;
  }

  .sidebar-footer {
    display: none;
  }

  .main-panel {
    padding: 0 14px 24px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
    padding: 16px 0;
    gap: 12px;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .topbar h1,
  .section-heading h2 {
    font-size: 1.5rem;
  }

  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
    flex: none;
    width: 100%;
  }

  .language-control {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-card {
    padding: 14px;
  }
}
