:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --text: #16181d;
  --muted: #5d6574;
  --line: #d9dde5;
  --panel: #ffffff;
  --accent: #176b87;
  --accent-2: #0f766e;
  --shadow: 0 16px 40px rgb(22 24 29 / 10%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 92%), rgb(246 247 249 / 92%)),
    repeating-linear-gradient(135deg, rgb(23 107 135 / 8%) 0 1px, transparent 1px 18px);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: 0;
}

.logout {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
}

.apps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.app-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.app-card:hover,
.app-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.app-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800;
}

.app-card strong,
.app-card small {
  display: block;
}

.app-card strong {
  margin-bottom: 5px;
  font-size: 1rem;
}

.app-card small {
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 900px) {
  .apps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding: 24px 0;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .apps {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --text: #f4f6f8;
    --muted: #a7afbd;
    --line: #29313d;
    --panel: #171c22;
    --shadow: 0 16px 40px rgb(0 0 0 / 24%);
  }

  body {
    background:
      linear-gradient(180deg, rgb(16 19 23 / 96%), rgb(18 24 28 / 96%)),
      repeating-linear-gradient(135deg, rgb(20 184 166 / 8%) 0 1px, transparent 1px 18px);
  }
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-shell {
  width: min(100% - 32px, 440px);
}

.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin-bottom: 8px;
  font-size: 2.4rem;
}

.login-copy {
  margin: 0 0 22px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.login-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: transparent;
  font: inherit;
}

.login-field input:focus {
  border-color: var(--accent);
  outline: none;
}

.login-form button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.login-form button:disabled,
.login-field input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-error {
  margin-bottom: 14px;
  border: 1px solid #b42318;
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffd7d3;
  background: rgb(180 35 24 / 18%);
}
