:root {
  --navy: #313a4c;
  --navy-dark: #252d3d;
  --sky: #a1dcee;
  --green: #3ba186;
  --white: #ffffff;
  --ink: #242b38;
  --muted: #667085;
  --line: #d7dee8;
  --soft-line: #e6ebf1;
  --page: #f3f6f8;
  --panel: #fbfcfd;
  color-scheme: light;
  font-family: "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

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

button,
input,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

h1,
h2,
strong {
  font-family: Arial, Helvetica, sans-serif;
}

h1,
h2,
p {
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  padding: 6px clamp(18px, 4vw, 34px);
  border-bottom: 1px solid var(--soft-line);
  background: var(--white);
}

.brand {
  display: flex;
  align-items: center;
  width: min(230px, 66vw);
}

.brand img {
  width: 100%;
  height: auto;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.account form {
  margin: 0;
}

.account button,
.login-panel button,
.admin-form button,
.table-wrap button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
}

.account button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
  border: 1px solid #cfd6e1;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 44px rgba(37, 45, 61, 0.12);
}

.intro {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(300px, 1.25fr);
  gap: 24px;
  align-items: end;
  padding: 28px 38px 22px;
}

.intro p,
.shelf-heading p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.intro h1 {
  margin-top: 4px;
  color: var(--navy);
  font-size: 34px;
  line-height: 1.1;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.shelf {
  margin: 0 38px 24px;
  padding: 22px 0 0;
  border-top: 1px solid var(--soft-line);
}

.shelf-primary {
  border-top: 4px solid var(--sky);
}

.shelf-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.shelf-heading h2 {
  margin-top: 4px;
  color: var(--navy);
  font-size: 22px;
}

.shelf-heading span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.app-grid {
  display: grid;
  gap: 14px;
}

.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.app-card:hover,
.app-card:focus-visible {
  border-color: #aab7c8;
  box-shadow: 0 12px 24px rgba(37, 45, 61, 0.09);
  transform: translateY(-1px);
}

.app-card svg {
  color: var(--navy);
}

.app-card.primary {
  border-top: 4px solid var(--green);
}

.app-card.primary svg {
  color: var(--green);
}

.app-card.quiet {
  background: #f7fafc;
}

.app-card strong {
  color: var(--navy);
  font-size: 21px;
}

.app-card small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.3;
}

.login-page {
  min-height: 100vh;
  background: var(--page);
}

.login-page .topbar {
  border-bottom: 0;
}

.login-shell {
  display: grid;
  width: min(520px, calc(100% - 32px));
  min-height: calc(100vh - 98px);
  margin: 0 auto;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.login-panel {
  width: 100%;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 44px rgba(37, 45, 61, 0.12);
}

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

.login-panel h1,
.admin-head h1 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.1;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.code-form {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--soft-line);
}

label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

.secondary-button {
  border: 1px solid var(--line) !important;
  background: var(--white) !important;
  color: var(--navy) !important;
}

.danger-button {
  background: #9f3a3a !important;
  color: var(--white) !important;
}

.text-link,
.admin-link {
  color: var(--navy);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-floating {
  width: min(1180px, calc(100% - 32px));
  margin: -34px auto 56px;
  text-align: right;
}

.admin-page {
  padding: 30px 38px 38px;
}

.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.admin-head p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) 150px auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--navy);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

td form {
  display: inline-block;
  margin: 0 6px 6px 0;
}

@media (max-width: 840px) {
  .topbar,
  .shelf-heading,
  .admin-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .account {
    display: none;
  }

  main {
    width: calc(100% - 20px);
    margin-top: 20px;
  }

  .intro {
    grid-template-columns: 1fr;
    padding: 24px 18px 18px;
  }

  .intro h1 {
    font-size: 30px;
  }

  .shelf {
    margin-left: 18px;
    margin-right: 18px;
  }

  .cols-2,
  .cols-3 {
    grid-template-columns: 1fr;
  }

  .login-panel {
    padding: 24px;
  }

  .admin-page {
    padding: 24px 18px;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }
}
