:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --accent: #1867c0;
  --accent-dark: #0f4f97;
  --error: #b42318;
  --success: #147447;
  --shadow: 0 24px 70px rgba(23, 32, 51, 0.12);
  --secondary-hover: #eef3f8;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101828;
  --panel: #182230;
  --ink: #f3f6fb;
  --muted: #aab4c5;
  --line: #334155;
  --accent: #6aa9f0;
  --accent-dark: #8bbcf4;
  --error: #ff9b92;
  --success: #8bddb1;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --secondary-hover: #253244;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1fr);
  width: min(940px, 100%);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
  color: #ffffff;
  background:
    linear-gradient(rgba(15, 79, 151, 0.76), rgba(15, 79, 151, 0.88)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1200&q=80")
      center / cover;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 28px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  font-size: 1.5rem;
  font-weight: 800;
}

.brand-panel h1,
.login-form h2,
.topbar h1 {
  margin: 0;
  letter-spacing: 0;
}

.brand-panel h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.brand-panel p,
.form-subtitle {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.login-panel {
  display: grid;
  align-items: center;
  padding: 42px;
}

.login-form {
  display: grid;
  gap: 20px;
}

.login-form h2 {
  font-size: 1.75rem;
}

.form-subtitle {
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--panel);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(24, 103, 192, 0.14);
}

.error-message {
  min-height: 20px;
  margin: 0;
  color: var(--error);
  font-weight: 650;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

a.secondary-button {
  display: inline-grid;
  min-height: 48px;
  place-items: center;
  padding: 0 18px;
  text-decoration: none;
}

.dashboard-page {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto 28px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--success);
  font-weight: 800;
  text-transform: uppercase;
}

.secondary-button {
  width: auto;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--panel);
}

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

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theme-button {
  min-width: 86px;
}

.floating-theme-button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.metric-card {
  display: grid;
  gap: 18px;
  min-height: 150px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-card span {
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  align-self: end;
  font-size: 2rem;
}

@media (max-width: 760px) {
  .auth-page,
  .dashboard-page {
    padding: 16px;
  }

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

  .brand-panel,
  .login-panel {
    padding: 28px;
  }

  .brand-panel {
    min-height: 250px;
  }

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

  .secondary-button {
    width: 100%;
  }

  .floating-theme-button {
    position: static;
    justify-self: end;
    width: auto;
  }

  .topbar-actions {
    width: 100%;
  }

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