:root {
  color-scheme: light;
  --ink: #17213a;
  --muted: #667286;
  --line: #dfe6ee;
  --surface: #ffffff;
  --page: #f3f6f4;
  --accent: #253f88;
  --accent-dark: #192c66;
  --green: #4f8e43;
  --green-soft: #d6e973;
  --ok: #16794c;
  --warn: #9a5b00;
}

* {
  box-sizing: border-box;
}

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

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

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 440px);
  min-height: 100vh;
}

.brand-panel {
  display: grid;
  align-items: center;
  padding: 72px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(18, 30, 69, 0.86), rgba(47, 105, 56, 0.7)),
    url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1800&q=82");
  background-position: center;
  background-size: cover;
}

.brand-content {
  display: grid;
  gap: 40px;
  max-width: 760px;
}

.login-logo {
  width: min(280px, 100%);
  height: auto;
  margin-bottom: 40px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 800;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  color: #ffffff;
  background: var(--accent);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.brand-panel h1 {
  max-width: 780px;
  margin-bottom: 18px;
  color: #ffffff;
  font-size: clamp(3.2rem, 6.6vw, 6.8rem);
  line-height: 0.92;
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.18rem;
  line-height: 1.65;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 56px 48px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 54px rgba(24, 42, 104, 0.08);
}

.login-panel h2 {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 2.1rem;
}

.login-panel p {
  color: var(--muted);
}

.status {
  width: fit-content;
  margin-bottom: 32px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 700;
}

.status-ready {
  color: var(--ok);
  background: #e9f8f0;
}

.status-warning {
  color: var(--warn);
  background: #fff3d8;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  width: 100%;
  margin: 26px 0 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #31529f);
  box-shadow: 0 14px 28px rgba(37, 63, 136, 0.22);
}

.primary-action:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

.primary-action.disabled {
  pointer-events: none;
  background: #a7b0c1;
  box-shadow: none;
}

.secondary-action {
  color: var(--ink);
  background: #edf1f7;
}

.login-help {
  margin-bottom: 0;
  color: #9a5b00;
  font-size: 0.92rem;
}

code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #263348;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
}

.metadata-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 24px;
  background: #17213a;
  color: #ffffff;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

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

.sidebar a {
  padding: 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
}

.sidebar a.active,
.sidebar a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.workspace {
  padding: 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin-bottom: 6px;
  font-size: 1.8rem;
}

.topbar p {
  margin-bottom: 0;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.metric-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.metric-grid strong {
  font-size: 1.2rem;
}

@media (max-width: 860px) {
  .login-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

.brand-panel {
    min-height: 42vh;
    padding: 32px;
  }

  .brand-content {
    gap: 24px;
  }

  .login-panel {
    min-height: auto;
    padding: 32px;
    border-left: 0;
    box-shadow: none;
  }

  .sidebar {
    display: none;
  }

  .topbar,
  .metric-grid {
    grid-template-columns: 1fr;
  }

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