:root {
  color-scheme: light;
  --ink: #17202f;
  --muted: #637086;
  --line: #d9e1ed;
  --panel: #ffffff;
  --soft: #f5f7fb;
  --nav: #061a34;
  --nav-2: #0b2c56;
  --blue: #0768ea;
  --blue-2: #0352bd;
  --orange: #ff8a00;
  --green: #15803d;
  --red: #b42318;
  --shadow: 0 18px 40px rgba(7, 27, 55, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--blue);
  text-decoration: none;
}

img {
  max-width: 100%;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: linear-gradient(180deg, var(--nav), var(--nav-2));
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
  line-height: 1.1;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

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

.sidebar nav a,
.logout-form button {
  color: #dce9fb;
  border: 0;
  background: transparent;
  padding: 11px 12px;
  border-radius: 8px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.sidebar nav a.active,
.sidebar nav a:hover,
.logout-form button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.logout-form {
  margin-top: auto;
}

.main {
  margin-left: 260px;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar h1,
.install-card h1,
.login-card h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.eyebrow {
  color: #00a9d6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 7px;
  text-transform: uppercase;
}

.user-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #e8f1ff;
  color: #064ba8;
  font-size: 13px;
  font-weight: 700;
}

.panel,
.stat-card,
.install-card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel h2,
.panel h3,
.install-card h2 {
  margin: 0 0 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.grid.form-list {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
}

.grid.form-list.wide-form {
  grid-template-columns: minmax(420px, 0.9fr) minmax(0, 1fr);
}

.grid.compact {
  gap: 12px;
}

.span-2 {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary {
  background: var(--blue);
  color: #fff;
}

.primary:hover {
  background: var(--blue-2);
}

.secondary {
  background: #e8eef7;
  color: #14345d;
}

.danger {
  background: #fee4e2;
  color: var(--red);
}

.icon {
  width: 42px;
  padding: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.actions {
  text-align: right;
  white-space: nowrap;
}

.searchbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid #b7e1c1;
  background: #ecfdf3;
  color: #075e2c;
  font-weight: 700;
}

.alert.error {
  border-color: #ffc9c2;
  background: #fff1ef;
  color: #9a1b12;
}

.empty,
.muted {
  color: var(--muted);
}

.list-row {
  display: grid;
  gap: 3px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.list-row span {
  color: var(--muted);
  font-size: 13px;
}

.line-items {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.line-head,
.line-row {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1fr) 80px 110px 54px 42px;
  gap: 8px;
  align-items: center;
}

.line-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.check {
  place-items: center;
}

.check input,
.checkbox input {
  width: auto;
  min-height: auto;
}

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

.settings-logo {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.settings-logo img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.stacked {
  display: grid;
  gap: 12px;
}

.inline-form {
  margin-top: 16px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

.login-body,
.install-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, rgba(0, 169, 214, 0.16), transparent 32%),
    linear-gradient(135deg, #061a34, #0b2c56 54%, #101828);
}

.login-card,
.install-card {
  width: min(980px, 100%);
  padding: 28px;
}

.login-card {
  max-width: 440px;
}

.login-logo,
.install-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.install-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 1020px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .main {
    margin-left: 0;
    padding: 18px;
  }

  .cards,
  .grid.two,
  .grid.form-list,
  .grid.form-list.wide-form {
    grid-template-columns: 1fr;
  }

  .line-head {
    display: none;
  }

  .line-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h1,
  .install-card h1,
  .login-card h1 {
    font-size: 26px;
  }

  .line-row {
    grid-template-columns: 1fr;
  }

  .searchbar {
    flex-direction: column;
  }
}
